From c83fab32a9f670d698df9c08ab3a4528edcfe9cc Mon Sep 17 00:00:00 2001 From: B Harrell Date: Tue, 25 May 2021 11:04:19 -0500 Subject: [PATCH] Revert "TensorFlow Source" This reverts commit 45a00fb17f28bfda0348e1855580fc36345dac2f. --- .../tfjs-data/dist/datasets/csv_dataset.d.ts | 97 - .../tfjs-data/dist/datasets/csv_dataset.js | 379 - .../dist/datasets/csv_dataset.js.map | 1 - .../dist/datasets/csv_dataset_test.js.map | 1 - .../dist/datasets/text_line_dataset.d.ts | 35 - .../dist/datasets/text_line_dataset.js | 47 - .../dist/datasets/text_line_dataset.js.map | 1 - .../datasets/text_line_dataset_test.js.map | 1 - .../dist/iterators/byte_chunk_iterator.d.ts | 31 - .../dist/iterators/byte_chunk_iterator.js | 115 - .../dist/iterators/byte_chunk_iterator.js.map | 1 - .../iterators/byte_chunk_iterator_test.js.map | 1 - .../iterators/chained_iterator_test.js.map | 1 - .../dist/iterators/file_chunk_iterator.d.ts | 41 - .../dist/iterators/file_chunk_iterator.js | 94 - .../dist/iterators/file_chunk_iterator.js.map | 1 - .../iterators/file_chunk_iterator_test.js.map | 1 - .../dist/iterators/lazy_iterator.d.ts | 422 - .../tfjs-data/dist/iterators/lazy_iterator.js | 1006 - .../dist/iterators/lazy_iterator.js.map | 1 - .../dist/iterators/lazy_iterator_test.js.map | 1 - .../dist/iterators/microphone_iterator.d.ts | 58 - .../dist/iterators/microphone_iterator.js | 187 - .../dist/iterators/microphone_iterator.js.map | 1 - .../iterators/microphone_iterator_test.js.map | 1 - .../iterators/prefetch_iterator_test.js.map | 1 - .../iterators/shuffle_iterator_test.js.map | 1 - .../dist/iterators/string_iterator.d.ts | 39 - .../dist/iterators/string_iterator.js | 99 - .../dist/iterators/string_iterator.js.map | 1 - .../iterators/string_iterator_test.js.map | 1 - .../dist/iterators/url_chunk_iterator.d.ts | 26 - .../dist/iterators/url_chunk_iterator.js | 61 - .../dist/iterators/url_chunk_iterator.js.map | 1 - .../iterators/url_chunk_iterator_test.js.map | 1 - .../dist/iterators/webcam_iterator.d.ts | 44 - .../dist/iterators/webcam_iterator.js | 192 - .../dist/iterators/webcam_iterator.js.map | 1 - .../iterators/webcam_iterator_test.js.map | 1 - .../tfjs-data/dist/miniprogram/index.js | 18 - .../tfjs-data/dist/miniprogram/index.js.map | 1 - .../dist/sources/file_data_source.d.ts | 39 - .../dist/sources/file_data_source.js | 51 - .../dist/sources/file_data_source.js.map | 1 - .../dist/sources/url_data_source.d.ts | 33 - .../tfjs-data/dist/sources/url_data_source.js | 52 - .../dist/sources/url_data_source.js.map | 1 - .../tfjs-data/dist/util/deep_clone.d.ts | 18 - .../tfjs-data/dist/util/deep_clone.js | 35 - .../tfjs-data/dist/util/deep_clone.js.map | 1 - .../tfjs-data/dist/util/deep_map.d.ts | 117 - .../tfjs-data/dist/util/deep_map.js | 229 - .../tfjs-data/dist/util/deep_map.js.map | 1 - .../tfjs-data/dist/util/deep_map_test.js.map | 1 - .../dist/util/growing_ring_buffer.d.ts | 32 - .../dist/util/growing_ring_buffer.js | 61 - .../dist/util/growing_ring_buffer.js.map | 1 - .../tfjs-data/dist/util/ring_buffer.d.ts | 84 - .../tfjs-data/dist/util/ring_buffer.js | 161 - .../tfjs-data/dist/util/ring_buffer.js.map | 1 - .../dist/util/ring_buffer_test.js.map | 1 - .../tfjs-data/dist/util/source_util.d.ts | 18 - .../tfjs-data/dist/util/source_util.js | 24 - .../tfjs-data/dist/util/source_util.js.map | 1 - .../dist/util/source_util_test.js.map | 1 - .../tfjs-data/dist/util/test_utils.d.ts | 51 - .../tfjs-data/dist/util/test_utils.js.map | 1 - .../@tensorflow/tfjs-data/dist/version.js | 5 - .../@tensorflow/tfjs-data/dist/version.js.map | 1 - .../@tensorflow/tfjs-data/src/dataset.ts | 705 - .../tfjs-data/src/datasets/csv_dataset.ts | 396 - .../src/datasets/text_line_dataset.ts | 50 - .../@tensorflow/tfjs-data/src/datasource.ts | 42 - .../@tensorflow/tfjs-data/src/index.ts | 25 - .../src/iterators/byte_chunk_iterator.ts | 126 - .../src/iterators/file_chunk_iterator.ts | 110 - .../tfjs-data/src/iterators/lazy_iterator.ts | 1190 - .../src/iterators/microphone_iterator.ts | 234 - .../src/iterators/string_iterator.ts | 112 - .../src/iterators/url_chunk_iterator.ts | 62 - .../src/iterators/webcam_iterator.ts | 223 - .../@tensorflow/tfjs-data/src/readers.ts | 282 - .../tfjs-data/src/sources/file_data_source.ts | 55 - .../tfjs-data/src/sources/url_data_source.ts | 55 - .../@tensorflow/tfjs-data/src/statistics.ts | 212 - .../@tensorflow/tfjs-data/src/types.ts | 219 - .../tfjs-data/src/util/deep_clone.ts | 35 - .../tfjs-data/src/util/deep_map.ts | 277 - .../tfjs-data/src/util/growing_ring_buffer.ts | 69 - .../tfjs-data/src/util/ring_buffer.ts | 176 - .../tfjs-data/src/util/source_util.ts | 24 - .../tfjs-data/src/util/test_utils.ts | 152 - .../@tensorflow/tfjs-data/src/version.ts | 5 - .../@tensorflow/tfjs-layers/LICENSE | 249 - .../@tensorflow/tfjs-layers/README.md | 94 - .../tfjs-layers/dist/activations.d.ts | 184 - .../tfjs-layers/dist/activations.js | 255 - .../tfjs-layers/dist/activations.js.map | 1 - .../tfjs-layers/dist/activations_test.js.map | 1 - .../tfjs-layers/dist/backend/common.d.ts | 23 - .../tfjs-layers/dist/backend/common.js | 34 - .../tfjs-layers/dist/backend/common.js.map | 1 - .../tfjs-layers/dist/backend/state.d.ts | 16 - .../tfjs-layers/dist/backend/state.js | 35 - .../tfjs-layers/dist/backend/state.js.map | 1 - .../dist/backend/state_test.js.map | 1 - .../dist/backend/tfjs_backend.d.ts | 259 - .../tfjs-layers/dist/backend/tfjs_backend.js | 643 - .../dist/backend/tfjs_backend.js.map | 1 - .../dist/backend/tfjs_backend_test.js.map | 1 - .../tfjs-layers/dist/base_callbacks.d.ts | 217 - .../tfjs-layers/dist/base_callbacks.js | 488 - .../tfjs-layers/dist/base_callbacks.js.map | 1 - .../dist/base_callbacks_test.js.map | 1 - .../tfjs-layers/dist/callbacks.d.ts | 137 - .../@tensorflow/tfjs-layers/dist/callbacks.js | 171 - .../tfjs-layers/dist/callbacks.js.map | 1 - .../tfjs-layers/dist/callbacks_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/common.d.ts | 40 - .../@tensorflow/tfjs-layers/dist/common.js | 109 - .../tfjs-layers/dist/common.js.map | 1 - .../tfjs-layers/dist/common_test.js.map | 1 - .../tfjs-layers/dist/constraints.d.ts | 142 - .../tfjs-layers/dist/constraints.js | 147 - .../tfjs-layers/dist/constraints.js.map | 1 - .../tfjs-layers/dist/constraints_test.js.map | 1 - .../tfjs-layers/dist/engine/container.d.ts | 229 - .../tfjs-layers/dist/engine/container.js | 1140 - .../tfjs-layers/dist/engine/container.js.map | 1 - .../dist/engine/container_test.js.map | 1 - .../dist/engine/dataset_fakes.d.ts | 74 - .../dist/engine/dataset_fakes.js.map | 1 - .../dist/engine/dataset_fakes_test.js.map | 1 - .../tfjs-layers/dist/engine/dataset_stub.d.ts | 22 - .../tfjs-layers/dist/engine/dataset_stub.js | 20 - .../dist/engine/dataset_stub.js.map | 1 - .../tfjs-layers/dist/engine/executor.d.ts | 139 - .../tfjs-layers/dist/engine/executor.js | 444 - .../tfjs-layers/dist/engine/executor.js.map | 1 - .../dist/engine/executor_test.js.map | 1 - .../tfjs-layers/dist/engine/input_layer.d.ts | 78 - .../tfjs-layers/dist/engine/input_layer.js | 124 - .../dist/engine/input_layer.js.map | 1 - .../dist/engine/input_layer_test.js.map | 1 - .../tfjs-layers/dist/engine/topology.d.ts | 709 - .../tfjs-layers/dist/engine/topology.js | 1246 - .../tfjs-layers/dist/engine/topology.js.map | 1 - .../dist/engine/topology_test.js.map | 1 - .../tfjs-layers/dist/engine/training.d.ts | 650 - .../tfjs-layers/dist/engine/training.js | 1611 - .../tfjs-layers/dist/engine/training.js.map | 1 - .../dist/engine/training_dataset.d.ts | 163 - .../dist/engine/training_dataset.js | 351 - .../dist/engine/training_dataset.js.map | 1 - .../dist/engine/training_dataset_test.js.map | 1 - .../dist/engine/training_tensors.d.ts | 200 - .../dist/engine/training_tensors.js | 437 - .../dist/engine/training_tensors.js.map | 1 - .../dist/engine/training_test.js.map | 1 - .../dist/engine/training_utils.d.ts | 71 - .../tfjs-layers/dist/engine/training_utils.js | 156 - .../dist/engine/training_utils.js.map | 1 - .../dist/engine/training_utils_test.js.map | 1 - .../dist/engine/training_weighted_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/errors.d.ts | 53 - .../@tensorflow/tfjs-layers/dist/errors.js | 79 - .../tfjs-layers/dist/errors.js.map | 1 - .../tfjs-layers/dist/errors_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/exports.d.ts | 238 - .../@tensorflow/tfjs-layers/dist/exports.js | 250 - .../tfjs-layers/dist/exports.js.map | 1 - .../tfjs-layers/dist/exports_constraints.d.ts | 38 - .../tfjs-layers/dist/exports_constraints.js | 48 - .../dist/exports_constraints.js.map | 1 - .../dist/exports_initializers.d.ts | 164 - .../tfjs-layers/dist/exports_initializers.js | 196 - .../dist/exports_initializers.js.map | 1 - .../tfjs-layers/dist/exports_layers.d.ts | 1469 - .../tfjs-layers/dist/exports_layers.js | 1625 - .../tfjs-layers/dist/exports_layers.js.map | 1 - .../tfjs-layers/dist/exports_metrics.d.ts | 266 - .../tfjs-layers/dist/exports_metrics.js | 289 - .../tfjs-layers/dist/exports_metrics.js.map | 1 - .../tfjs-layers/dist/exports_models.d.ts | 10 - .../tfjs-layers/dist/exports_models.js | 11 - .../tfjs-layers/dist/exports_models.js.map | 1 - .../dist/exports_regularizers.d.ts | 30 - .../tfjs-layers/dist/exports_regularizers.js | 48 - .../dist/exports_regularizers.js.map | 1 - .../@tensorflow/tfjs-layers/dist/index.d.ts | 33 - .../@tensorflow/tfjs-layers/dist/index.js | 32 - .../@tensorflow/tfjs-layers/dist/index.js.map | 1 - .../tfjs-layers/dist/initializers.d.ts | 229 - .../tfjs-layers/dist/initializers.js | 489 - .../tfjs-layers/dist/initializers.js.map | 1 - .../tfjs-layers/dist/initializers_test.js.map | 1 - .../dist/keras_format/activation_config.d.ts | 19 - .../dist/keras_format/activation_config.js | 18 - .../keras_format/activation_config.js.map | 1 - .../tfjs-layers/dist/keras_format/common.d.ts | 30 - .../tfjs-layers/dist/keras_format/common.js | 16 - .../dist/keras_format/common.js.map | 1 - .../dist/keras_format/constraint_config.d.ts | 35 - .../dist/keras_format/constraint_config.js | 19 - .../keras_format/constraint_config.js.map | 1 - .../dist/keras_format/initializer_config.d.ts | 66 - .../dist/keras_format/initializer_config.js | 24 - .../keras_format/initializer_config.js.map | 1 - .../dist/keras_format/input_config.d.ts | 28 - .../dist/keras_format/input_config.js | 20 - .../dist/keras_format/input_config.js.map | 1 - .../dist/keras_format/keras_class_names.d.ts | 26 - .../dist/keras_format/keras_class_names.js | 19 - .../keras_format/keras_class_names.js.map | 1 - .../advanced_activation_serialization.d.ts | 49 - .../advanced_activation_serialization.js | 26 - .../advanced_activation_serialization.js.map | 1 - ...convolutional_depthwise_serialization.d.ts | 31 - .../convolutional_depthwise_serialization.js | 21 - ...nvolutional_depthwise_serialization.js.map | 1 - .../layers/convolutional_serialization.d.ts | 64 - .../layers/convolutional_serialization.js | 25 - .../layers/convolutional_serialization.js.map | 1 - .../layers/core_serialization.d.ts | 64 - .../keras_format/layers/core_serialization.js | 26 - .../layers/core_serialization.js.map | 1 - .../layers/embeddings_serialization.d.ts | 31 - .../layers/embeddings_serialization.js | 20 - .../layers/embeddings_serialization.js.map | 1 - .../layers/layer_serialization.d.ts | 28 - .../layers/layer_serialization.js | 34 - .../layers/layer_serialization.js.map | 1 - .../layers/merge_serialization.d.ts | 32 - .../layers/merge_serialization.js | 26 - .../layers/merge_serialization.js.map | 1 - .../layers/normalization_serialization.d.ts | 38 - .../layers/normalization_serialization.js | 21 - .../layers/normalization_serialization.js.map | 1 - .../layers/padding_serialization.d.ts | 24 - .../layers/padding_serialization.js | 20 - .../layers/padding_serialization.js.map | 1 - .../layers/pooling_serialization.d.ts | 41 - .../layers/pooling_serialization.js | 27 - .../layers/pooling_serialization.js.map | 1 - .../layers/recurrent_serialization.d.ts | 94 - .../layers/recurrent_serialization.js | 22 - .../layers/recurrent_serialization.js.map | 1 - .../layers/wrappers_serialization.d.ts | 30 - .../layers/wrappers_serialization.js | 21 - .../layers/wrappers_serialization.js.map | 1 - .../dist/keras_format/loss_config.d.ts | 17 - .../dist/keras_format/loss_config.js | 21 - .../dist/keras_format/loss_config.js.map | 1 - .../keras_format/model_serialization.d.ts | 58 - .../dist/keras_format/model_serialization.js | 10 - .../keras_format/model_serialization.js.map | 1 - .../dist/keras_format/node_config.d.ts | 52 - .../dist/keras_format/node_config.js | 10 - .../dist/keras_format/node_config.js.map | 1 - .../dist/keras_format/optimizer_config.d.ts | 62 - .../dist/keras_format/optimizer_config.js | 18 - .../dist/keras_format/optimizer_config.js.map | 1 - .../dist/keras_format/regularizer_config.d.ts | 23 - .../dist/keras_format/regularizer_config.js | 19 - .../keras_format/regularizer_config.js.map | 1 - .../dist/keras_format/topology_config.d.ts | 46 - .../dist/keras_format/topology_config.js | 10 - .../dist/keras_format/topology_config.js.map | 1 - .../dist/keras_format/training_config.d.ts | 36 - .../dist/keras_format/training_config.js | 1 - .../dist/keras_format/training_config.js.map | 1 - .../tfjs-layers/dist/keras_format/types.d.ts | 90 - .../tfjs-layers/dist/keras_format/types.js | 10 - .../dist/keras_format/types.js.map | 1 - .../tfjs-layers/dist/keras_format/utils.d.ts | 25 - .../tfjs-layers/dist/keras_format/utils.js | 28 - .../dist/keras_format/utils.js.map | 1 - .../layers/advanced_activation_test.js.map | 1 - .../dist/layers/advanced_activations.d.ts | 137 - .../dist/layers/advanced_activations.js | 227 - .../dist/layers/advanced_activations.js.map | 1 - .../dist/layers/convolutional.d.ts | 401 - .../tfjs-layers/dist/layers/convolutional.js | 973 - .../dist/layers/convolutional.js.map | 1 - .../dist/layers/convolutional_depthwise.d.ts | 72 - .../dist/layers/convolutional_depthwise.js | 139 - .../layers/convolutional_depthwise.js.map | 1 - .../convolutional_depthwise_test.js.map | 1 - .../dist/layers/convolutional_recurrent.d.ts | 128 - .../dist/layers/convolutional_recurrent.js | 340 - .../layers/convolutional_recurrent.js.map | 1 - .../convolutional_recurrent_test.js.map | 1 - .../dist/layers/convolutional_test.js.map | 1 - .../tfjs-layers/dist/layers/core.d.ts | 235 - .../tfjs-layers/dist/layers/core.js | 461 - .../tfjs-layers/dist/layers/core.js.map | 1 - .../tfjs-layers/dist/layers/core_test.js.map | 1 - .../tfjs-layers/dist/layers/embeddings.d.ts | 86 - .../tfjs-layers/dist/layers/embeddings.js | 139 - .../tfjs-layers/dist/layers/embeddings.js.map | 1 - .../dist/layers/embeddings_test.js.map | 1 - .../tfjs-layers/dist/layers/merge.d.ts | 404 - .../tfjs-layers/dist/layers/merge.js | 981 - .../tfjs-layers/dist/layers/merge.js.map | 1 - .../tfjs-layers/dist/layers/merge_test.js.map | 1 - .../tfjs-layers/dist/layers/noise.d.ts | 97 - .../tfjs-layers/dist/layers/noise.js | 153 - .../tfjs-layers/dist/layers/noise.js.map | 1 - .../tfjs-layers/dist/layers/noise_test.js.map | 1 - .../dist/layers/normalization.d.ts | 195 - .../tfjs-layers/dist/layers/normalization.js | 396 - .../dist/layers/normalization.js.map | 1 - .../dist/layers/normalization_test.js.map | 1 - .../tfjs-layers/dist/layers/padding.d.ts | 66 - .../tfjs-layers/dist/layers/padding.js | 184 - .../tfjs-layers/dist/layers/padding.js.map | 1 - .../dist/layers/padding_test.js.map | 1 - .../tfjs-layers/dist/layers/pooling.d.ts | 229 - .../tfjs-layers/dist/layers/pooling.js | 518 - .../tfjs-layers/dist/layers/pooling.js.map | 1 - .../dist/layers/pooling_test.js.map | 1 - .../tfjs-layers/dist/layers/recurrent.d.ts | 666 - .../tfjs-layers/dist/layers/recurrent.js | 1337 - .../tfjs-layers/dist/layers/recurrent.js.map | 1 - .../dist/layers/recurrent_test.js.map | 1 - .../dist/layers/serialization.d.ts | 22 - .../tfjs-layers/dist/layers/serialization.js | 27 - .../dist/layers/serialization.js.map | 1 - .../dist/layers/serialization_test.js.map | 1 - .../tfjs-layers/dist/layers/wrappers.d.ts | 95 - .../tfjs-layers/dist/layers/wrappers.js | 484 - .../tfjs-layers/dist/layers/wrappers.js.map | 1 - .../dist/layers/wrappers_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/logs.d.ts | 39 - .../@tensorflow/tfjs-layers/dist/logs.js | 58 - .../@tensorflow/tfjs-layers/dist/logs.js.map | 1 - .../@tensorflow/tfjs-layers/dist/losses.d.ts | 85 - .../@tensorflow/tfjs-layers/dist/losses.js | 237 - .../tfjs-layers/dist/losses.js.map | 1 - .../tfjs-layers/dist/losses_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/metrics.d.ts | 51 - .../@tensorflow/tfjs-layers/dist/metrics.js | 164 - .../tfjs-layers/dist/metrics.js.map | 1 - .../tfjs-layers/dist/metrics_test.js.map | 1 - .../tfjs-layers/dist/miniprogram/index.js | 18 - .../tfjs-layers/dist/miniprogram/index.js.map | 1 - .../tfjs-layers/dist/model_save_test.js.map | 1 - .../dist/model_summary_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/models.d.ts | 575 - .../@tensorflow/tfjs-layers/dist/models.js | 933 - .../tfjs-layers/dist/models.js.map | 1 - .../tfjs-layers/dist/models_test.js.map | 1 - .../tfjs-layers/dist/optimizers.d.ts | 14 - .../tfjs-layers/dist/optimizers.js | 39 - .../tfjs-layers/dist/optimizers.js.map | 1 - .../tfjs-layers/dist/optimizers_test.js.map | 1 - .../tfjs-layers/dist/regularizers.d.ts | 57 - .../tfjs-layers/dist/regularizers.js | 99 - .../tfjs-layers/dist/regularizers.js.map | 1 - .../tfjs-layers/dist/regularizers_test.js.map | 1 - .../tfjs-layers/dist/setup_tests.d.ts | 21 - .../tfjs-layers/dist/setup_tests.js | 24 - .../tfjs-layers/dist/setup_tests.js.map | 1 - .../tfjs-layers/dist/tf-layers.es2017.js | 35464 ------------ .../tfjs-layers/dist/tf-layers.es2017.js.map | 1 - .../tfjs-layers/dist/tf-layers.es2017.min.js | 18 - .../dist/tf-layers.es2017.min.js.html | 3229 -- .../dist/tf-layers.es2017.min.js.map | 1 - .../tfjs-layers/dist/tf-layers.fesm.js | 35433 ------------ .../tfjs-layers/dist/tf-layers.fesm.js.map | 1 - .../tfjs-layers/dist/tf-layers.fesm.min.js | 18 - .../dist/tf-layers.fesm.min.js.html | 3229 -- .../dist/tf-layers.fesm.min.js.map | 1 - .../@tensorflow/tfjs-layers/dist/tf-layers.js | 36964 ------------- .../tfjs-layers/dist/tf-layers.js.map | 1 - .../tfjs-layers/dist/tf-layers.min.js | 18 - .../tfjs-layers/dist/tf-layers.min.js.html | 3229 -- .../tfjs-layers/dist/tf-layers.min.js.map | 1 - .../tfjs-layers/dist/tf-layers.node.js | 36960 ------------- .../tfjs-layers/dist/tf-layers.node.js.map | 1 - .../tfjs-layers/dist/tsconfig.tsbuildinfo | 46061 ---------------- .../@tensorflow/tfjs-layers/dist/types.d.ts | 52 - .../@tensorflow/tfjs-layers/dist/types.js | 10 - .../@tensorflow/tfjs-layers/dist/types.js.map | 1 - .../tfjs-layers/dist/types_test.js.map | 1 - .../dist/user_defined_metadata.d.ts | 35 - .../tfjs-layers/dist/user_defined_metadata.js | 101 - .../dist/user_defined_metadata.js.map | 1 - .../dist/user_defined_metadata_test.js.map | 1 - .../tfjs-layers/dist/utils/conv_utils.d.ts | 28 - .../tfjs-layers/dist/utils/conv_utils.js | 77 - .../tfjs-layers/dist/utils/conv_utils.js.map | 1 - .../tfjs-layers/dist/utils/generic_utils.d.ts | 178 - .../tfjs-layers/dist/utils/generic_utils.js | 517 - .../dist/utils/generic_utils.js.map | 1 - .../dist/utils/generic_utils_test.js.map | 1 - .../tfjs-layers/dist/utils/layer_utils.d.ts | 26 - .../tfjs-layers/dist/utils/layer_utils.js | 197 - .../tfjs-layers/dist/utils/layer_utils.js.map | 1 - .../tfjs-layers/dist/utils/math_utils.d.ts | 66 - .../tfjs-layers/dist/utils/math_utils.js | 131 - .../tfjs-layers/dist/utils/math_utils.js.map | 1 - .../dist/utils/math_utils_test.js.map | 1 - .../dist/utils/serialization_utils.d.ts | 25 - .../dist/utils/serialization_utils.js | 124 - .../dist/utils/serialization_utils.js.map | 1 - .../utils/serialization_utils_test.js.map | 1 - .../tfjs-layers/dist/utils/test_utils.d.ts | 53 - .../tfjs-layers/dist/utils/test_utils.js | 118 - .../tfjs-layers/dist/utils/test_utils.js.map | 1 - .../tfjs-layers/dist/utils/types_utils.d.ts | 40 - .../tfjs-layers/dist/utils/types_utils.js | 76 - .../tfjs-layers/dist/utils/types_utils.js.map | 1 - .../dist/utils/types_utils_test.js.map | 1 - .../dist/utils/variable_utils.d.ts | 18 - .../tfjs-layers/dist/utils/variable_utils.js | 29 - .../dist/utils/variable_utils.js.map | 1 - .../dist/utils/variable_utils_test.js.map | 1 - .../tfjs-layers/dist/variables.d.ts | 200 - .../@tensorflow/tfjs-layers/dist/variables.js | 290 - .../tfjs-layers/dist/variables.js.map | 1 - .../tfjs-layers/dist/variables_test.js.map | 1 - .../@tensorflow/tfjs-layers/dist/version.d.ts | 3 - .../@tensorflow/tfjs-layers/dist/version.js | 5 - .../tfjs-layers/dist/version.js.map | 1 - .../tfjs-layers/dist/version_test.js.map | 1 - .../@tensorflow/tfjs-layers/package.json | 104 - .../tfjs-layers/src/activations.ts | 278 - .../tfjs-layers/src/backend/common.ts | 39 - .../tfjs-layers/src/backend/state.ts | 39 - .../tfjs-layers/src/backend/tfjs_backend.ts | 719 - .../tfjs-layers/src/base_callbacks.ts | 597 - .../@tensorflow/tfjs-layers/src/callbacks.ts | 255 - .../@tensorflow/tfjs-layers/src/common.ts | 120 - .../tfjs-layers/src/constraints.ts | 263 - .../tfjs-layers/src/engine/container.ts | 1321 - .../tfjs-layers/src/engine/dataset_fakes.ts | 245 - .../tfjs-layers/src/engine/dataset_stub.ts | 25 - .../tfjs-layers/src/engine/executor.ts | 531 - .../tfjs-layers/src/engine/input_layer.ts | 208 - .../tfjs-layers/src/engine/topology.ts | 1643 - .../tfjs-layers/src/engine/training.ts | 1902 - .../src/engine/training_dataset.ts | 615 - .../src/engine/training_tensors.ts | 633 - .../tfjs-layers/src/engine/training_utils.ts | 190 - .../@tensorflow/tfjs-layers/src/errors.ts | 85 - .../@tensorflow/tfjs-layers/src/exports.ts | 270 - .../tfjs-layers/src/exports_constraints.ts | 51 - .../tfjs-layers/src/exports_initializers.ts | 210 - .../tfjs-layers/src/exports_layers.ts | 1699 - .../tfjs-layers/src/exports_metrics.ts | 316 - .../tfjs-layers/src/exports_models.ts | 11 - .../tfjs-layers/src/exports_regularizers.ts | 50 - .../@tensorflow/tfjs-layers/src/index.ts | 40 - .../tfjs-layers/src/initializers.ts | 651 - .../tfjs-layers/src/keras_format/README.md | 53 - .../src/keras_format/activation_config.ts | 31 - .../tfjs-layers/src/keras_format/common.ts | 43 - .../src/keras_format/constraint_config.ts | 55 - .../src/keras_format/initializer_config.ts | 113 - .../src/keras_format/input_config.ts | 43 - .../src/keras_format/keras_class_names.ts | 34 - .../advanced_activation_serialization.ts | 86 - .../convolutional_depthwise_serialization.ts | 47 - .../layers/convolutional_serialization.ts | 100 - .../keras_format/layers/core_serialization.ts | 107 - .../layers/embeddings_serialization.ts | 43 - .../layers/layer_serialization.ts | 44 - .../layers/merge_serialization.ts | 66 - .../layers/normalization_serialization.ts | 53 - .../layers/padding_serialization.ts | 37 - .../layers/pooling_serialization.ts | 82 - .../layers/recurrent_serialization.ts | 131 - .../layers/wrappers_serialization.ts | 48 - .../src/keras_format/loss_config.ts | 27 - .../src/keras_format/model_serialization.ts | 71 - .../src/keras_format/node_config.ts | 62 - .../src/keras_format/optimizer_config.ts | 99 - .../src/keras_format/regularizer_config.ts | 34 - .../src/keras_format/topology_config.ts | 53 - .../src/keras_format/training_config.ts | 35 - .../tfjs-layers/src/keras_format/types.ts | 116 - .../tfjs-layers/src/keras_format/utils.ts | 28 - .../src/layers/advanced_activations.ts | 345 - .../tfjs-layers/src/layers/convolutional.ts | 1446 - .../src/layers/convolutional_depthwise.ts | 211 - .../src/layers/convolutional_recurrent.ts | 578 - .../tfjs-layers/src/layers/core.ts | 675 - .../tfjs-layers/src/layers/embeddings.ts | 210 - .../tfjs-layers/src/layers/merge.ts | 1075 - .../tfjs-layers/src/layers/noise.ts | 209 - .../tfjs-layers/src/layers/normalization.ts | 639 - .../tfjs-layers/src/layers/padding.ts | 237 - .../tfjs-layers/src/layers/pooling.ts | 701 - .../tfjs-layers/src/layers/recurrent.ts | 2099 - .../tfjs-layers/src/layers/serialization.ts | 34 - .../tfjs-layers/src/layers/wrappers.ts | 590 - .../@tensorflow/tfjs-layers/src/logs.ts | 78 - .../@tensorflow/tfjs-layers/src/losses.ts | 272 - .../@tensorflow/tfjs-layers/src/metrics.ts | 188 - .../@tensorflow/tfjs-layers/src/models.ts | 1100 - .../@tensorflow/tfjs-layers/src/optimizers.ts | 45 - .../tfjs-layers/src/regularizers.ts | 149 - .../tfjs-layers/src/setup_tests.ts | 25 - .../@tensorflow/tfjs-layers/src/types.ts | 74 - .../tfjs-layers/src/user_defined_metadata.ts | 104 - .../tfjs-layers/src/utils/conv_utils.ts | 86 - .../tfjs-layers/src/utils/generic_utils.ts | 562 - .../tfjs-layers/src/utils/layer_utils.ts | 218 - .../tfjs-layers/src/utils/math_utils.ts | 146 - .../src/utils/serialization_utils.ts | 128 - .../tfjs-layers/src/utils/test_utils.ts | 138 - .../tfjs-layers/src/utils/types_utils.ts | 81 - .../tfjs-layers/src/utils/variable_utils.ts | 30 - .../@tensorflow/tfjs-layers/src/variables.ts | 359 - .../@tensorflow/tfjs-layers/src/version.ts | 5 - .../tfjs-layers/tsconfig.test.json | 12 - .../@tensorflow/tfjs-node/.bazelversion | 1 - .../node_modules/@tensorflow/tfjs-node/.nycrc | 20 - .../@tensorflow/tfjs-node/DEVELOPMENT.md | 117 - .../@tensorflow/tfjs-node/README.md | 176 - .../tfjs-node/WINDOWS_TROUBLESHOOTING.md | 54 - .../@tensorflow/tfjs-node/binding.gyp | 108 - .../tfjs-node/binding/napi_auto_ref.h | 70 - .../tfjs-node/binding/tf_auto_status.h | 36 - .../tfjs-node/binding/tf_auto_tensor.h | 36 - .../tfjs-node/binding/tfe_auto_op.h | 36 - .../tfjs-node/binding/tfjs_backend.cc | 1192 - .../tfjs-node/binding/tfjs_backend.h | 108 - .../tfjs-node/binding/tfjs_binding.cc | 296 - .../@tensorflow/tfjs-node/binding/utils.h | 329 - .../tfjs-node/build-tmp-napi-v5/Makefile | 329 - .../obj.target/action_after_build.stamp.d | 1 - .../Release/obj.target/tfjs_binding.node.d | 1 - .../tfjs_binding/binding/tfjs_backend.o.d | 37 - .../tfjs_binding/binding/tfjs_binding.o.d | 31 - .../Release/.deps/Release/tfjs_binding.node.d | 1 - .../obj.target/action_after_build.stamp | 0 .../Release/obj.target/tfjs_binding.node | Bin 87424 -> 0 bytes .../tfjs_binding/binding/tfjs_backend.o | Bin 87160 -> 0 bytes .../tfjs_binding/binding/tfjs_binding.o | Bin 19880 -> 0 bytes .../Release/tfjs_binding.node | Bin 87424 -> 0 bytes .../action_after_build.target.mk | 32 - .../build-tmp-napi-v5/binding.Makefile | 6 - .../tfjs-node/build-tmp-napi-v5/config.gypi | 201 - .../build-tmp-napi-v5/tfjs_binding.target.mk | 160 - .../@tensorflow/tfjs-node/deps/LICENSE | 203 - .../tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES | 8963 --- .../deps/include/tensorflow/c/c_api.h | 1591 - .../include/tensorflow/c/c_api_experimental.h | 311 - .../deps/include/tensorflow/c/c_api_macros.h | 46 - .../deps/include/tensorflow/c/eager/c_api.h | 466 - .../tensorflow/c/eager/c_api_experimental.h | 568 - .../deps/include/tensorflow/c/eager/dlpack.h | 40 - .../include/tensorflow/c/tensor_interface.h | 73 - .../deps/include/tensorflow/c/tf_attrtype.h | 39 - .../deps/include/tensorflow/c/tf_datatype.h | 83 - .../include/tensorflow/c/tf_file_statistics.h | 34 - .../deps/include/tensorflow/c/tf_status.h | 94 - .../deps/include/tensorflow/c/tf_tensor.h | 169 - .../deps/include/tensorflow/c/tf_tstring.h | 20 - .../tensorflow/core/platform/ctstring.h | 120 - .../core/platform/ctstring_internal.h | 449 - .../@tensorflow/tfjs-node/dist/callbacks.d.ts | 144 - .../@tensorflow/tfjs-node/dist/callbacks.js | 371 - .../tfjs-node/dist/callbacks_test.d.ts | 17 - .../tfjs-node/dist/callbacks_test.js | 391 - .../tfjs-node/dist/canvas_test.d.ts | 17 - .../@tensorflow/tfjs-node/dist/canvas_test.js | 120 - .../@tensorflow/tfjs-node/dist/image.d.ts | 163 - .../@tensorflow/tfjs-node/dist/image.js | 355 - .../tfjs-node/dist/image_test.d.ts | 1 - .../@tensorflow/tfjs-node/dist/image_test.js | 560 - .../@tensorflow/tfjs-node/dist/index.d.ts | 55 - .../@tensorflow/tfjs-node/dist/index.js | 81 - .../tfjs-node/dist/index_test.d.ts | 17 - .../@tensorflow/tfjs-node/dist/index_test.js | 88 - .../tfjs-node/dist/int64_tensors.d.ts | 45 - .../tfjs-node/dist/int64_tensors.js | 98 - .../tfjs-node/dist/int64_tensors_test.d.ts | 17 - .../tfjs-node/dist/int64_tensors_test.js | 66 - .../tfjs-node/dist/io/file_system.d.ts | 74 - .../tfjs-node/dist/io/file_system.js | 383 - .../tfjs-node/dist/io/file_system_test.d.ts | 17 - .../tfjs-node/dist/io/file_system_test.js | 578 - .../@tensorflow/tfjs-node/dist/io/index.d.ts | 21 - .../@tensorflow/tfjs-node/dist/io/index.js | 25 - .../tfjs-node/dist/io/io_utils.d.ts | 41 - .../@tensorflow/tfjs-node/dist/io/io_utils.js | 81 - .../tfjs-node/dist/io/io_utils_test.d.ts | 17 - .../tfjs-node/dist/io/io_utils_test.js | 54 - .../tfjs-node/dist/io/node_http.d.ts | 27 - .../tfjs-node/dist/io/node_http.js | 44 - .../tfjs-node/dist/io/node_http_test.d.ts | 17 - .../tfjs-node/dist/io/node_http_test.js | 202 - .../tfjs-node/dist/kernels/Abs.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Abs.js | 36 - .../tfjs-node/dist/kernels/Acos.d.ts | 18 - .../tfjs-node/dist/kernels/Acos.js | 28 - .../tfjs-node/dist/kernels/Acosh.d.ts | 18 - .../tfjs-node/dist/kernels/Acosh.js | 28 - .../tfjs-node/dist/kernels/Add.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Add.js | 30 - .../tfjs-node/dist/kernels/AddN.d.ts | 18 - .../tfjs-node/dist/kernels/AddN.js | 33 - .../tfjs-node/dist/kernels/All.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/All.js | 38 - .../tfjs-node/dist/kernels/Any.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Any.js | 38 - .../tfjs-node/dist/kernels/ArgMax.d.ts | 18 - .../tfjs-node/dist/kernels/ArgMax.js | 45 - .../tfjs-node/dist/kernels/ArgMin.d.ts | 18 - .../tfjs-node/dist/kernels/ArgMin.js | 45 - .../tfjs-node/dist/kernels/Asin.d.ts | 18 - .../tfjs-node/dist/kernels/Asin.js | 28 - .../tfjs-node/dist/kernels/Asinh.d.ts | 18 - .../tfjs-node/dist/kernels/Asinh.js | 28 - .../tfjs-node/dist/kernels/Atan.d.ts | 18 - .../tfjs-node/dist/kernels/Atan.js | 28 - .../tfjs-node/dist/kernels/Atan2.d.ts | 18 - .../tfjs-node/dist/kernels/Atan2.js | 30 - .../tfjs-node/dist/kernels/Atanh.d.ts | 18 - .../tfjs-node/dist/kernels/Atanh.js | 28 - .../tfjs-node/dist/kernels/AvgPool.d.ts | 18 - .../tfjs-node/dist/kernels/AvgPool.js | 50 - .../tfjs-node/dist/kernels/AvgPool3D.d.ts | 18 - .../tfjs-node/dist/kernels/AvgPool3D.js | 54 - .../tfjs-node/dist/kernels/AvgPool3DGrad.d.ts | 18 - .../tfjs-node/dist/kernels/AvgPool3DGrad.js | 57 - .../tfjs-node/dist/kernels/AvgPoolGrad.d.ts | 18 - .../tfjs-node/dist/kernels/AvgPoolGrad.js | 53 - .../tfjs-node/dist/kernels/BatchMatMul.d.ts | 18 - .../tfjs-node/dist/kernels/BatchMatMul.js | 35 - .../dist/kernels/BatchToSpaceND.d.ts | 18 - .../tfjs-node/dist/kernels/BatchToSpaceND.js | 40 - .../tfjs-node/dist/kernels/Bincount.d.ts | 18 - .../tfjs-node/dist/kernels/Bincount.js | 35 - .../tfjs-node/dist/kernels/Cast.d.ts | 18 - .../tfjs-node/dist/kernels/Cast.js | 35 - .../tfjs-node/dist/kernels/Ceil.d.ts | 18 - .../tfjs-node/dist/kernels/Ceil.js | 28 - .../tfjs-node/dist/kernels/ClipByValue.d.ts | 18 - .../tfjs-node/dist/kernels/ClipByValue.js | 31 - .../tfjs-node/dist/kernels/Complex.d.ts | 18 - .../tfjs-node/dist/kernels/Complex.js | 38 - .../tfjs-node/dist/kernels/ComplexAbs.d.ts | 18 - .../tfjs-node/dist/kernels/ComplexAbs.js | 33 - .../tfjs-node/dist/kernels/Concat.d.ts | 18 - .../tfjs-node/dist/kernels/Concat.js | 43 - .../tfjs-node/dist/kernels/Conv2D.d.ts | 20 - .../tfjs-node/dist/kernels/Conv2D.js | 68 - .../dist/kernels/Conv2DBackpropFilter.d.ts | 18 - .../dist/kernels/Conv2DBackpropFilter.js | 57 - .../dist/kernels/Conv2DBackpropInput.d.ts | 18 - .../dist/kernels/Conv2DBackpropInput.js | 57 - .../tfjs-node/dist/kernels/Conv3D.d.ts | 18 - .../tfjs-node/dist/kernels/Conv3D.js | 53 - .../dist/kernels/Conv3DBackpropFilterV2.d.ts | 18 - .../dist/kernels/Conv3DBackpropFilterV2.js | 57 - .../dist/kernels/Conv3DBackpropInputV2.d.ts | 18 - .../dist/kernels/Conv3DBackpropInputV2.js | 58 - .../tfjs-node/dist/kernels/Cos.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Cos.js | 28 - .../tfjs-node/dist/kernels/Cosh.d.ts | 18 - .../tfjs-node/dist/kernels/Cosh.js | 28 - .../tfjs-node/dist/kernels/CropAndResize.d.ts | 18 - .../tfjs-node/dist/kernels/CropAndResize.js | 41 - .../tfjs-node/dist/kernels/Cumsum.d.ts | 18 - .../tfjs-node/dist/kernels/Cumsum.js | 39 - .../tfjs-node/dist/kernels/DepthToSpace.d.ts | 18 - .../tfjs-node/dist/kernels/DepthToSpace.js | 43 - .../dist/kernels/DepthwiseConv2dNative.d.ts | 20 - .../dist/kernels/DepthwiseConv2dNative.js | 69 - .../DepthwiseConv2dNativeBackpropFilter.d.ts | 18 - .../DepthwiseConv2dNativeBackpropFilter.js | 51 - .../DepthwiseConv2dNativeBackpropInput.d.ts | 18 - .../DepthwiseConv2dNativeBackpropInput.js | 51 - .../tfjs-node/dist/kernels/Diag.d.ts | 18 - .../tfjs-node/dist/kernels/Diag.js | 28 - .../tfjs-node/dist/kernels/Dilation2D.d.ts | 18 - .../tfjs-node/dist/kernels/Dilation2D.js | 44 - .../kernels/Dilation2DBackpropFilter.d.ts | 18 - .../dist/kernels/Dilation2DBackpropFilter.js | 44 - .../dist/kernels/Dilation2DBackpropInput.d.ts | 18 - .../dist/kernels/Dilation2DBackpropInput.js | 44 - .../tfjs-node/dist/kernels/Elu.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Elu.js | 28 - .../tfjs-node/dist/kernels/EluGrad.d.ts | 18 - .../tfjs-node/dist/kernels/EluGrad.js | 30 - .../tfjs-node/dist/kernels/Equal.d.ts | 18 - .../tfjs-node/dist/kernels/Equal.js | 30 - .../tfjs-node/dist/kernels/Erf.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Erf.js | 28 - .../tfjs-node/dist/kernels/Exp.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Exp.js | 29 - .../tfjs-node/dist/kernels/ExpandDims.d.ts | 18 - .../tfjs-node/dist/kernels/ExpandDims.js | 32 - .../tfjs-node/dist/kernels/Expm1.d.ts | 18 - .../tfjs-node/dist/kernels/Expm1.js | 28 - .../tfjs-node/dist/kernels/FFT.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/FFT.js | 31 - .../tfjs-node/dist/kernels/Fill.d.ts | 18 - .../tfjs-node/dist/kernels/Fill.js | 57 - .../tfjs-node/dist/kernels/Floor.d.ts | 18 - .../tfjs-node/dist/kernels/Floor.js | 28 - .../tfjs-node/dist/kernels/FloorDiv.d.ts | 18 - .../tfjs-node/dist/kernels/FloorDiv.js | 30 - .../dist/kernels/FusedBatchNorm.d.ts | 18 - .../tfjs-node/dist/kernels/FusedBatchNorm.js | 65 - .../tfjs-node/dist/kernels/FusedConv2D.d.ts | 18 - .../tfjs-node/dist/kernels/FusedConv2D.js | 44 - .../dist/kernels/FusedDepthwiseConv2D.d.ts | 18 - .../dist/kernels/FusedDepthwiseConv2D.js | 47 - .../tfjs-node/dist/kernels/GatherNd.d.ts | 18 - .../tfjs-node/dist/kernels/GatherNd.js | 33 - .../tfjs-node/dist/kernels/GatherV2.d.ts | 18 - .../tfjs-node/dist/kernels/GatherV2.js | 41 - .../tfjs-node/dist/kernels/Greater.d.ts | 18 - .../tfjs-node/dist/kernels/Greater.js | 30 - .../tfjs-node/dist/kernels/GreaterEqual.d.ts | 18 - .../tfjs-node/dist/kernels/GreaterEqual.js | 30 - .../tfjs-node/dist/kernels/IFFT.d.ts | 18 - .../tfjs-node/dist/kernels/IFFT.js | 31 - .../tfjs-node/dist/kernels/Identity.d.ts | 18 - .../tfjs-node/dist/kernels/Identity.js | 29 - .../tfjs-node/dist/kernels/Imag.d.ts | 18 - .../tfjs-node/dist/kernels/Imag.js | 41 - .../tfjs-node/dist/kernels/IsFinite.d.ts | 18 - .../tfjs-node/dist/kernels/IsFinite.js | 28 - .../tfjs-node/dist/kernels/IsInf.d.ts | 18 - .../tfjs-node/dist/kernels/IsInf.js | 28 - .../tfjs-node/dist/kernels/IsNan.d.ts | 18 - .../tfjs-node/dist/kernels/IsNan.js | 28 - .../tfjs-node/dist/kernels/LRN.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/LRN.js | 42 - .../tfjs-node/dist/kernels/LRNGrad.d.ts | 18 - .../tfjs-node/dist/kernels/LRNGrad.js | 42 - .../tfjs-node/dist/kernels/LeakyRelu.d.ts | 18 - .../tfjs-node/dist/kernels/LeakyRelu.js | 36 - .../tfjs-node/dist/kernels/Less.d.ts | 18 - .../tfjs-node/dist/kernels/Less.js | 30 - .../tfjs-node/dist/kernels/LessEqual.d.ts | 18 - .../tfjs-node/dist/kernels/LessEqual.js | 30 - .../tfjs-node/dist/kernels/LinSpace.d.ts | 18 - .../tfjs-node/dist/kernels/LinSpace.js | 38 - .../tfjs-node/dist/kernels/Log.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Log.js | 28 - .../tfjs-node/dist/kernels/Log1p.d.ts | 18 - .../tfjs-node/dist/kernels/Log1p.js | 28 - .../tfjs-node/dist/kernels/LogicalAnd.d.ts | 18 - .../tfjs-node/dist/kernels/LogicalAnd.js | 28 - .../tfjs-node/dist/kernels/LogicalNot.d.ts | 18 - .../tfjs-node/dist/kernels/LogicalNot.js | 28 - .../tfjs-node/dist/kernels/LogicalOr.d.ts | 18 - .../tfjs-node/dist/kernels/LogicalOr.js | 28 - .../tfjs-node/dist/kernels/Max.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Max.js | 33 - .../tfjs-node/dist/kernels/MaxPool.d.ts | 18 - .../tfjs-node/dist/kernels/MaxPool.js | 49 - .../tfjs-node/dist/kernels/MaxPool3D.d.ts | 18 - .../tfjs-node/dist/kernels/MaxPool3D.js | 53 - .../tfjs-node/dist/kernels/MaxPool3DGrad.d.ts | 18 - .../tfjs-node/dist/kernels/MaxPool3DGrad.js | 54 - .../tfjs-node/dist/kernels/MaxPoolGrad.d.ts | 18 - .../tfjs-node/dist/kernels/MaxPoolGrad.js | 50 - .../tfjs-node/dist/kernels/Maximum.d.ts | 18 - .../tfjs-node/dist/kernels/Maximum.js | 30 - .../tfjs-node/dist/kernels/Mean.d.ts | 18 - .../tfjs-node/dist/kernels/Mean.js | 36 - .../tfjs-node/dist/kernels/Min.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Min.js | 33 - .../tfjs-node/dist/kernels/Minimum.d.ts | 18 - .../tfjs-node/dist/kernels/Minimum.js | 30 - .../tfjs-node/dist/kernels/MirrorPad.d.ts | 18 - .../tfjs-node/dist/kernels/MirrorPad.js | 42 - .../tfjs-node/dist/kernels/Mod.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Mod.js | 30 - .../tfjs-node/dist/kernels/Multinomial.d.ts | 18 - .../tfjs-node/dist/kernels/Multinomial.js | 43 - .../tfjs-node/dist/kernels/Multiply.d.ts | 18 - .../tfjs-node/dist/kernels/Multiply.js | 30 - .../tfjs-node/dist/kernels/Neg.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Neg.js | 28 - .../dist/kernels/NonMaxSuppressionV3.d.ts | 18 - .../dist/kernels/NonMaxSuppressionV3.js | 41 - .../dist/kernels/NonMaxSuppressionV4.d.ts | 18 - .../dist/kernels/NonMaxSuppressionV4.js | 50 - .../dist/kernels/NonMaxSuppressionV5.d.ts | 18 - .../dist/kernels/NonMaxSuppressionV5.js | 46 - .../tfjs-node/dist/kernels/NotEqual.d.ts | 18 - .../tfjs-node/dist/kernels/NotEqual.js | 30 - .../tfjs-node/dist/kernels/OneHot.d.ts | 18 - .../tfjs-node/dist/kernels/OneHot.js | 42 - .../tfjs-node/dist/kernels/OnesLike.d.ts | 18 - .../tfjs-node/dist/kernels/OnesLike.js | 33 - .../tfjs-node/dist/kernels/Pack.d.ts | 24 - .../tfjs-node/dist/kernels/Pack.js | 37 - .../tfjs-node/dist/kernels/PadV2.d.ts | 18 - .../tfjs-node/dist/kernels/PadV2.js | 40 - .../tfjs-node/dist/kernels/Pow.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Pow.js | 33 - .../tfjs-node/dist/kernels/Prelu.d.ts | 18 - .../tfjs-node/dist/kernels/Prelu.js | 33 - .../tfjs-node/dist/kernels/Prod.d.ts | 18 - .../tfjs-node/dist/kernels/Prod.js | 39 - .../tfjs-node/dist/kernels/Range.d.ts | 18 - .../tfjs-node/dist/kernels/Range.js | 53 - .../tfjs-node/dist/kernels/Real.d.ts | 18 - .../tfjs-node/dist/kernels/Real.js | 37 - .../tfjs-node/dist/kernels/RealDiv.d.ts | 18 - .../tfjs-node/dist/kernels/RealDiv.js | 30 - .../tfjs-node/dist/kernels/Reciprocal.d.ts | 18 - .../tfjs-node/dist/kernels/Reciprocal.js | 28 - .../tfjs-node/dist/kernels/Relu.d.ts | 18 - .../tfjs-node/dist/kernels/Relu.js | 28 - .../tfjs-node/dist/kernels/Relu6.d.ts | 18 - .../tfjs-node/dist/kernels/Relu6.js | 28 - .../tfjs-node/dist/kernels/Reshape.d.ts | 18 - .../tfjs-node/dist/kernels/Reshape.js | 37 - .../dist/kernels/ResizeBilinear.d.ts | 18 - .../tfjs-node/dist/kernels/ResizeBilinear.js | 47 - .../dist/kernels/ResizeBilinearGrad.d.ts | 18 - .../dist/kernels/ResizeBilinearGrad.js | 37 - .../dist/kernels/ResizeNearestNeighbor.d.ts | 18 - .../dist/kernels/ResizeNearestNeighbor.js | 47 - .../kernels/ResizeNearestNeighborGrad.d.ts | 18 - .../dist/kernels/ResizeNearestNeighborGrad.js | 41 - .../tfjs-node/dist/kernels/Reverse.d.ts | 18 - .../tfjs-node/dist/kernels/Reverse.js | 38 - .../tfjs-node/dist/kernels/Round.d.ts | 18 - .../tfjs-node/dist/kernels/Round.js | 28 - .../tfjs-node/dist/kernels/Rsqrt.d.ts | 18 - .../tfjs-node/dist/kernels/Rsqrt.js | 28 - .../tfjs-node/dist/kernels/ScatterNd.d.ts | 18 - .../tfjs-node/dist/kernels/ScatterNd.js | 37 - .../tfjs-node/dist/kernels/Select.d.ts | 18 - .../tfjs-node/dist/kernels/Select.js | 30 - .../tfjs-node/dist/kernels/Selu.d.ts | 18 - .../tfjs-node/dist/kernels/Selu.js | 28 - .../tfjs-node/dist/kernels/Sigmoid.d.ts | 18 - .../tfjs-node/dist/kernels/Sigmoid.js | 28 - .../tfjs-node/dist/kernels/Sign.d.ts | 18 - .../tfjs-node/dist/kernels/Sign.js | 28 - .../tfjs-node/dist/kernels/Sin.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Sin.js | 28 - .../tfjs-node/dist/kernels/Sinh.d.ts | 18 - .../tfjs-node/dist/kernels/Sinh.js | 28 - .../tfjs-node/dist/kernels/Slice.d.ts | 18 - .../tfjs-node/dist/kernels/Slice.js | 41 - .../tfjs-node/dist/kernels/Softmax.d.ts | 18 - .../tfjs-node/dist/kernels/Softmax.js | 30 - .../tfjs-node/dist/kernels/Softplus.d.ts | 18 - .../tfjs-node/dist/kernels/Softplus.js | 28 - .../dist/kernels/SpaceToBatchND.d.ts | 18 - .../tfjs-node/dist/kernels/SpaceToBatchND.js | 40 - .../tfjs-node/dist/kernels/SparseToDense.d.ts | 18 - .../tfjs-node/dist/kernels/SparseToDense.js | 42 - .../tfjs-node/dist/kernels/SplitV.d.ts | 18 - .../tfjs-node/dist/kernels/SplitV.js | 49 - .../tfjs-node/dist/kernels/Sqrt.d.ts | 18 - .../tfjs-node/dist/kernels/Sqrt.js | 28 - .../tfjs-node/dist/kernels/Square.d.ts | 18 - .../tfjs-node/dist/kernels/Square.js | 28 - .../dist/kernels/SquaredDifference.d.ts | 18 - .../dist/kernels/SquaredDifference.js | 30 - .../tfjs-node/dist/kernels/Step.d.ts | 18 - .../tfjs-node/dist/kernels/Step.js | 36 - .../tfjs-node/dist/kernels/StridedSlice.d.ts | 18 - .../tfjs-node/dist/kernels/StridedSlice.js | 100 - .../tfjs-node/dist/kernels/Sub.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Sub.js | 30 - .../tfjs-node/dist/kernels/Sum.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Sum.js | 33 - .../tfjs-node/dist/kernels/Tan.d.ts | 18 - .../@tensorflow/tfjs-node/dist/kernels/Tan.js | 28 - .../tfjs-node/dist/kernels/Tanh.d.ts | 18 - .../tfjs-node/dist/kernels/Tanh.js | 28 - .../tfjs-node/dist/kernels/Tile.d.ts | 18 - .../tfjs-node/dist/kernels/Tile.js | 37 - .../tfjs-node/dist/kernels/TopK.d.ts | 18 - .../tfjs-node/dist/kernels/TopK.js | 42 - .../tfjs-node/dist/kernels/Transpose.d.ts | 18 - .../tfjs-node/dist/kernels/Transpose.js | 37 - .../tfjs-node/dist/kernels/Unpack.d.ts | 18 - .../tfjs-node/dist/kernels/Unpack.js | 42 - .../dist/kernels/UnsortedSegmentSum.d.ts | 18 - .../dist/kernels/UnsortedSegmentSum.js | 38 - .../tfjs-node/dist/kernels/ZerosLike.d.ts | 18 - .../tfjs-node/dist/kernels/ZerosLike.js | 33 - .../tfjs-node/dist/kernels/_FusedMatMul.d.ts | 18 - .../tfjs-node/dist/kernels/_FusedMatMul.js | 38 - .../@tensorflow/tfjs-node/dist/node.d.ts | 37 - .../@tensorflow/tfjs-node/dist/node.js | 39 - .../tfjs-node/dist/nodejs_kernel_backend.d.ts | 112 - .../tfjs-node/dist/nodejs_kernel_backend.js | 600 - .../dist/nodejs_kernel_backend_test.d.ts | 17 - .../dist/nodejs_kernel_backend_test.js | 188 - .../tfjs-node/dist/proto/api_pb.js | 9136 --- .../tfjs-node/dist/register_all_kernels.d.ts | 1 - .../tfjs-node/dist/register_all_kernels.js | 325 - .../@tensorflow/tfjs-node/dist/run_tests.d.ts | 20 - .../@tensorflow/tfjs-node/dist/run_tests.js | 138 - .../tfjs-node/dist/saved_model.d.ts | 158 - .../@tensorflow/tfjs-node/dist/saved_model.js | 493 - .../tfjs-node/dist/saved_model_test.d.ts | 17 - .../tfjs-node/dist/saved_model_test.js | 700 - .../tfjs-node/dist/tensorboard.d.ts | 64 - .../@tensorflow/tfjs-node/dist/tensorboard.js | 102 - .../tfjs-node/dist/tensorboard_test.d.ts | 17 - .../tfjs-node/dist/tensorboard_test.js | 390 - .../tfjs-node/dist/tfjs_binding.d.ts | 56 - .../tfjs-node/dist/tfjs_binding.js | 18 - .../tfjs-node/dist/tfjs_binding_test.d.ts | 17 - .../tfjs-node/dist/tfjs_binding_test.js | 255 - .../@tensorflow/tfjs-node/dist/version.d.ts | 3 - .../@tensorflow/tfjs-node/dist/version.js | 6 - .../tfjs-node/lib/napi-v5/tfjs_binding.node | Bin 87424 -> 0 bytes .../@tensorflow/tfjs-node/package.json | 129 - .../tfjs-node/python/int64_model.py | 36 - .../tfjs-node/python/unint8_model.py | 35 - .../scripts/build-and-upload-addon.sh | 37 - .../scripts/custom-binary.sample.json | 8 - .../tfjs-node/scripts/deps-constants.js | 121 - .../tfjs-node/scripts/deps-stage.js | 97 - .../scripts/ensure-cpu-gpu-packages-align.js | 79 - .../tfjs-node/scripts/get-addon-name.js | 35 - .../@tensorflow/tfjs-node/scripts/install.js | 207 - .../scripts/print-full-package-host.js | 9 - .../tfjs-node/scripts/publish-npm-gpu.sh | 59 - .../tfjs-node/scripts/resources.js | 93 - .../tfjs-node/scripts/tsconfig.json | 6 - .../@tensorflow/tfjs-node/src/callbacks.ts | 325 - .../@tensorflow/tfjs-node/src/image.ts | 299 - .../@tensorflow/tfjs-node/src/index.ts | 86 - .../tfjs-node/src/int64_tensors.ts | 102 - .../tfjs-node/src/io/file_system.ts | 288 - .../@tensorflow/tfjs-node/src/io/index.ts | 23 - .../@tensorflow/tfjs-node/src/io/io_utils.ts | 80 - .../@tensorflow/tfjs-node/src/io/node_http.ts | 45 - .../@tensorflow/tfjs-node/src/kernels/Abs.ts | 38 - .../@tensorflow/tfjs-node/src/kernels/Acos.ts | 31 - .../tfjs-node/src/kernels/Acosh.ts | 31 - .../@tensorflow/tfjs-node/src/kernels/Add.ts | 33 - .../@tensorflow/tfjs-node/src/kernels/AddN.ts | 35 - .../@tensorflow/tfjs-node/src/kernels/All.ts | 40 - .../@tensorflow/tfjs-node/src/kernels/Any.ts | 40 - .../tfjs-node/src/kernels/ArgMax.ts | 49 - .../tfjs-node/src/kernels/ArgMin.ts | 49 - .../@tensorflow/tfjs-node/src/kernels/Asin.ts | 31 - .../tfjs-node/src/kernels/Asinh.ts | 31 - .../@tensorflow/tfjs-node/src/kernels/Atan.ts | 31 - .../tfjs-node/src/kernels/Atan2.ts | 32 - .../tfjs-node/src/kernels/Atanh.ts | 31 - .../tfjs-node/src/kernels/AvgPool.ts | 57 - .../tfjs-node/src/kernels/AvgPool3D.ts | 62 - .../tfjs-node/src/kernels/AvgPool3DGrad.ts | 65 - .../tfjs-node/src/kernels/AvgPoolGrad.ts | 60 - .../tfjs-node/src/kernels/BatchMatMul.ts | 37 - .../tfjs-node/src/kernels/BatchToSpaceND.ts | 46 - .../tfjs-node/src/kernels/Bincount.ts | 41 - .../@tensorflow/tfjs-node/src/kernels/Cast.ts | 37 - .../@tensorflow/tfjs-node/src/kernels/Ceil.ts | 31 - .../tfjs-node/src/kernels/ClipByValue.ts | 32 - .../tfjs-node/src/kernels/Complex.ts | 40 - .../tfjs-node/src/kernels/ComplexAbs.ts | 35 - .../tfjs-node/src/kernels/Concat.ts | 46 - .../tfjs-node/src/kernels/Conv2D.ts | 79 - .../src/kernels/Conv2DBackpropFilter.ts | 70 - .../src/kernels/Conv2DBackpropInput.ts | 69 - .../tfjs-node/src/kernels/Conv3D.ts | 62 - .../src/kernels/Conv3DBackpropFilterV2.ts | 67 - .../src/kernels/Conv3DBackpropInputV2.ts | 67 - .../@tensorflow/tfjs-node/src/kernels/Cos.ts | 31 - .../@tensorflow/tfjs-node/src/kernels/Cosh.ts | 31 - .../tfjs-node/src/kernels/CropAndResize.ts | 45 - .../tfjs-node/src/kernels/Cumsum.ts | 41 - .../tfjs-node/src/kernels/DepthToSpace.ts | 45 - .../src/kernels/DepthwiseConv2dNative.ts | 82 - .../DepthwiseConv2dNativeBackpropFilter.ts | 62 - .../DepthwiseConv2dNativeBackpropInput.ts | 65 - .../@tensorflow/tfjs-node/src/kernels/Diag.ts | 31 - .../tfjs-node/src/kernels/Dilation2D.ts | 51 - .../src/kernels/Dilation2DBackpropFilter.ts | 52 - .../src/kernels/Dilation2DBackpropInput.ts | 52 - .../@tensorflow/tfjs-node/src/kernels/Elu.ts | 31 - .../tfjs-node/src/kernels/EluGrad.ts | 32 - .../tfjs-node/src/kernels/Equal.ts | 33 - .../@tensorflow/tfjs-node/src/kernels/Erf.ts | 31 - .../tfjs-node/src/kernels/_FusedMatMul.ts | 47 - .../@tensorflow/tfjs-node/src/node.ts | 40 - .../tfjs-node/src/nodejs_kernel_backend.ts | 656 - .../tfjs-node/src/register_all_kernels.ts | 325 - .../@tensorflow/tfjs-node/src/run_tests.ts | 154 - .../@tensorflow/tfjs-node/src/saved_model.ts | 464 - .../@tensorflow/tfjs-node/src/tensorboard.ts | 111 - .../@tensorflow/tfjs-node/src/tfjs_binding.ts | 87 - .../@tensorflow/tfjs-node/src/version.ts | 5 - .../@tensorflow/tfjs-node/tsconfig.json | 25 - .../@tensorflow/tfjs-node/tsconfig.test.json | 13 - 999 files changed, 318037 deletions(-) delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/chained_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/prefetch_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/shuffle_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/miniprogram/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/miniprogram/index.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/dataset.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasource.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/index.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/readers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/statistics.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/types.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/test_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/version.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/LICENSE delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/README.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_weighted_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tsconfig.tsbuildinfo delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/package.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/activations.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/common.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/constraints.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_fakes.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_stub.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/errors.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/index.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/initializers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/README.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/activation_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/constraint_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/input_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/keras_class_names.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/core_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/layer_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/merge_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/normalization_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/padding_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/pooling_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/loss_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/model_serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/node_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/optimizer_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/regularizer_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/topology_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/training_config.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/types.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/logs.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/losses.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/metrics.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/models.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/setup_tests.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/types.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/test_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/variables.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/version.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/tsconfig.test.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.bazelversion delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.nycrc delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/DEVELOPMENT.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/README.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/WINDOWS_TROUBLESHOOTING.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding.gyp delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/napi_auto_ref.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_status.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_tensor.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfe_auto_op.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.cc delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_binding.cc delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/utils.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Makefile delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/action_after_build.stamp.d delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding.node.d delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_backend.o.d delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_binding.o.d delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/tfjs_binding.node.d delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/action_after_build.stamp delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding.node delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_backend.o delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_binding.o delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/tfjs_binding.node delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/action_after_build.target.mk delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/binding.Makefile delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/config.gypi delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/tfjs_binding.target.mk delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/LICENSE delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_experimental.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api_experimental.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/dlpack.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tensor_interface.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_file_statistics.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js delete mode 100755 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/_FusedMatMul.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/node.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/nodejs_kernel_backend.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/register_all_kernels.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/run_tests.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/saved_model.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tensorboard.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tfjs_binding.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/version.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.test.json diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.d.ts deleted file mode 100644 index 55f3f2d5e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.d.ts +++ /dev/null @@ -1,97 +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 { DataSource } from '../datasource'; -import { LazyIterator } from '../iterators/lazy_iterator'; -import { CSVConfig } from '../types'; -import { TextLineDataset } from './text_line_dataset'; -/** - * 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'} - */ -export declare class CSVDataset extends Dataset { - protected readonly input: DataSource; - base: TextLineDataset; - private hasHeader; - private fullColumnNames; - private columnNamesValidated; - private columnConfigs; - private configuredColumnsOnly; - private delimiter; - private delimWhitespace; - /** - * 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'} - */ - columnNames(): Promise; - private setColumnNames; - private maybeReadHeaderLine; - /** - * 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: DataSource, csvConfig?: CSVConfig); - iterator(): Promise>; - makeDataElement(line: string): TensorContainer; - private getBoolean; - private parseRow; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js deleted file mode 100644 index 9fdba7e19..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js +++ /dev/null @@ -1,379 +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 { util } from '@tensorflow/tfjs-core'; -import { Dataset } from '../dataset'; -import { TextLineDataset } from './text_line_dataset'; -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'} - */ -export 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; - default: - } - 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; - default: - } - 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; - default: - } - break; - default: - } - } - // 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() -//# sourceMappingURL=csv_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/datasets/csv_dataset.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js.map deleted file mode 100644 index a809bec21..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csv_dataset.js","sourceRoot":"","sources":["../../src/datasets/csv_dataset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAkB,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,M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. 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"]} \ 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/datasets/csv_dataset_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset_test.js.map deleted file mode 100644 index e5e44fbca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csv_dataset_test.js","sourceRoot":"","sources":["../../src/datasets/csv_dataset_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,MAAM,SAAS,GAAG;;;;;;KAMb,CAAC;AAEN,MAAM,oBAAoB,GAAG;CAC5B,GAAG,SAAS,CAAC;AAEd,MAAM,OAAO,GACT,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC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AAC,cAAc,EAAE,CAAC;QAE3C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAC,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;IAChD,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 */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {FileDataSource} from '../sources/file_data_source';\nimport {CSVDataset} from './csv_dataset';\n\nconst csvString = `ab,cd,ef\nghi,,jkl\n,mn,op\n1.4,7.8,12\nqrs,tu,\nv,w,x\ny,z,`;\n\nconst csvStringWithHeaders = `foo,bar,baz\n` + csvString;\n\nconst csvData =\n env().get('IS_BROWSER') ? new Blob([csvString]) : Buffer.from(csvString);\n\nconst csvDataWithHeaders = env().get('IS_BROWSER') ?\n new Blob([csvStringWithHeaders]) :\n Buffer.from(csvStringWithHeaders);\n\nconst csvDataExtra = `A,B,C\n1,2,3\n2,2,3\n3,2,3\n4,2,3\n5,2,3\n6,2,3\n7,2,3`;\n\nconst csvDataSemicolon = `A;B;C\n1;2;3\n2;2;3\n3;2;3\n4;2;3\n5;2;3\n6;2;3\n7;2;3`;\n\nconst csvMixedType = `A,B,C,D\n1,True,3,1\n2,False,2,0\n3,True,1,1\n1,False,3,0\n2,True,2,1\n3,False,1,0\n1,True,3,1\n2,False,2,0`;\n\nconst csvWithQuote = `\"A\",B,\"C\"\n1,\"2\",3\n2,2,3\n3,\"\"\"2\",3\n4,\"2,\",\n\"5\",2,3\n6,2,\"345\"123,456\"\"\n7,\"2\",3`;\n\nconst csvWithMultiWhitespaces = `A B C\n1 2 3\n2 2 3\n3 2 3\n4 2 3\n5 2 3\n6 2 3\n7 2 3`;\n\nconst csvWithSingleWhitespace = `A B C\\n` +\n `1 2 3\\n` +\n `2 \\n` +\n `3 2 3`;\n\nconst csvWithMissingElement = `A,B,C\n1,2,3\n2,\n3,2,3`;\n\nconst csvWithDOSLineBreaker = `A,B,C\\r\\n1,2,3\\r\\nv,\\rw,x\\r\\n3,2,3`;\n\nconst csvDataWithHeadersExtra = env().get('IS_BROWSER') ?\n new Blob([csvDataExtra]) :\n Buffer.from(csvDataExtra);\nconst csvDataWithSemicolon = env().get('IS_BROWSER') ?\n new Blob([csvDataSemicolon]) :\n Buffer.from(csvDataSemicolon);\nconst csvDataWithMixedType = env().get('IS_BROWSER') ?\n new Blob([csvMixedType]) :\n Buffer.from(csvMixedType);\nconst csvDataWithQuote = env().get('IS_BROWSER') ? new Blob([csvWithQuote]) :\n Buffer.from(csvWithQuote);\nconst csvDataWithMultiWhitespaces = env().get('IS_BROWSER') ?\n new Blob([csvWithMultiWhitespaces]) :\n Buffer.from(csvWithMultiWhitespaces);\nconst csvDataWithMissingElement = env().get('IS_BROWSER') ?\n new Blob([csvWithMissingElement]) :\n Buffer.from(csvWithMissingElement);\nconst csvDataWithSingleWhitespace = env().get('IS_BROWSER') ?\n new Blob([csvWithSingleWhitespace]) :\n Buffer.from(csvWithSingleWhitespace);\nconst csvDataWithDOSLineBreaker = env().get('IS_BROWSER') ?\n new Blob([csvWithDOSLineBreaker]) :\n Buffer.from(csvWithDOSLineBreaker);\n\ndescribe('CSVDataset', () => {\n it('produces a stream of dicts containing UTF8-decoded csv data',\n async () => {\n const source = new FileDataSource(csvData, {chunkSize: 10});\n const dataset = new CSVDataset(\n source, {hasHeader: false, columnNames: ['foo', 'bar', 'baz']});\n\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'foo': 'ab', 'bar': 'cd', 'baz': 'ef'},\n {'foo': 'ghi', 'bar': undefined, 'baz': 'jkl'},\n {'foo': undefined, 'bar': 'mn', 'baz': 'op'},\n {'foo': 1.4, 'bar': 7.8, 'baz': 12},\n {'foo': 'qrs', 'bar': 'tu', 'baz': undefined},\n {'foo': 'v', 'bar': 'w', 'baz': 'x'},\n {'foo': 'y', 'bar': 'z', 'baz': undefined},\n ]);\n });\n\n it('reads CSV column headers when requested', async () => {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'foo': 'ab', 'bar': 'cd', 'baz': 'ef'},\n {'foo': 'ghi', 'bar': undefined, 'baz': 'jkl'},\n {'foo': undefined, 'bar': 'mn', 'baz': 'op'},\n {'foo': 1.4, 'bar': 7.8, 'baz': 12},\n {'foo': 'qrs', 'bar': 'tu', 'baz': undefined},\n {'foo': 'v', 'bar': 'w', 'baz': 'x'},\n {'foo': 'y', 'bar': 'z', 'baz': undefined},\n ]);\n });\n\n it('throw error when column configs mismatch column names', async done => {\n try {\n const source = new FileDataSource(csvData, {chunkSize: 10});\n const dataset = new CSVDataset(source, {\n hasHeader: false,\n columnNames: ['foo', 'bar', 'baz'],\n columnConfigs: {'A': {required: true}}\n });\n await dataset.columnNames();\n done.fail();\n } catch (error) {\n expect(error.message)\n .toBe(\n 'The key \"A\" provided in columnConfigs does not ' +\n 'match any of the column names (foo,bar,baz).');\n done();\n }\n });\n\n it('throw error when no header line and no column names provided',\n async done => {\n try {\n const source = new FileDataSource(csvData, {chunkSize: 10});\n const dataset = new CSVDataset(source, {hasHeader: false});\n await dataset.columnNames();\n done.fail();\n } catch (error) {\n expect(error.message)\n .toBe('Column names must be provided if there is no header line.');\n done();\n }\n });\n\n it('take first line as columnNames by default', async () => {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'foo': 'ab', 'bar': 'cd', 'baz': 'ef'},\n {'foo': 'ghi', 'bar': undefined, 'baz': 'jkl'},\n {'foo': undefined, 'bar': 'mn', 'baz': 'op'},\n {'foo': 1.4, 'bar': 7.8, 'baz': 12},\n {'foo': 'qrs', 'bar': 'tu', 'baz': undefined},\n {'foo': 'v', 'bar': 'w', 'baz': 'x'},\n {'foo': 'y', 'bar': 'z', 'baz': undefined},\n ]);\n });\n\n it('emits rows in order despite async requests', async () => {\n const source = new FileDataSource(csvDataWithHeadersExtra, {chunkSize: 10});\n const ds = new CSVDataset(source);\n expect(await ds.columnNames()).toEqual(['A', 'B', 'C']);\n const csvIterator = await ds.iterator();\n const promises = [\n csvIterator.next(), csvIterator.next(), csvIterator.next(),\n csvIterator.next(), csvIterator.next()\n ];\n const elements = await Promise.all(promises);\n expect(elements[0].value).toEqual({A: 1, B: 2, C: 3});\n expect(elements[1].value).toEqual({A: 2, B: 2, C: 3});\n expect(elements[2].value).toEqual({A: 3, B: 2, C: 3});\n expect(elements[3].value).toEqual({A: 4, B: 2, C: 3});\n expect(elements[4].value).toEqual({A: 5, B: 2, C: 3});\n });\n\n it('throw error when required column is empty', async done => {\n try {\n const source = new FileDataSource(csvData, {chunkSize: 10});\n const dataset = new CSVDataset(source, {\n hasHeader: false,\n columnNames: ['foo', 'bar', 'baz'],\n columnConfigs: {'foo': {required: true}}\n });\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n const iter = await dataset.iterator();\n await iter.toArrayForTest();\n done.fail();\n } catch (error) {\n expect(error.message)\n .toBe('Required column foo is empty in this line: ,mn,op');\n done();\n }\n });\n\n it('fill default value when provided', async () => {\n const source = new FileDataSource(csvData, {chunkSize: 10});\n const dataset = new CSVDataset(source, {\n hasHeader: false,\n columnNames: ['foo', 'bar', 'baz'],\n columnConfigs: {'foo': {default: 'abc'}, 'baz': {default: 123}}\n });\n\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'foo': 'ab', 'bar': 'cd', 'baz': 'ef'},\n {'foo': 'ghi', 'bar': undefined, 'baz': 'jkl'},\n {'foo': 'abc', 'bar': 'mn', 'baz': 'op'},\n {'foo': 1.4, 'bar': 7.8, 'baz': 12},\n {'foo': 'qrs', 'bar': 'tu', 'baz': 123},\n {'foo': 'v', 'bar': 'w', 'baz': 'x'},\n {'foo': 'y', 'bar': 'z', 'baz': 123},\n ]);\n });\n\n it('provide delimiter through parameter', async () => {\n const source = new FileDataSource(csvDataWithSemicolon, {chunkSize: 10});\n const dataset = new CSVDataset(source, {delimiter: ';'});\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result[0]).toEqual({A: 1, B: 2, C: 3});\n expect(result[1]).toEqual({A: 2, B: 2, C: 3});\n expect(result[2]).toEqual({A: 3, B: 2, C: 3});\n expect(result[3]).toEqual({A: 4, B: 2, C: 3});\n expect(result[4]).toEqual({A: 5, B: 2, C: 3});\n });\n\n it('provide datatype through parameter to parse different types',\n async () => {\n const source = new FileDataSource(csvDataWithMixedType, {chunkSize: 10});\n const dataset = new CSVDataset(source, {\n columnConfigs: {\n 'A': {dtype: 'int32'},\n 'B': {dtype: 'bool'},\n 'C': {dtype: 'int32'},\n 'D': {dtype: 'bool'}\n }\n });\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C', 'D']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'A': 1, 'B': 1, 'C': 3, 'D': 1}, {'A': 2, 'B': 0, 'C': 2, 'D': 0},\n {'A': 3, 'B': 1, 'C': 1, 'D': 1}, {'A': 1, 'B': 0, 'C': 3, 'D': 0},\n {'A': 2, 'B': 1, 'C': 2, 'D': 1}, {'A': 3, 'B': 0, 'C': 1, 'D': 0},\n {'A': 1, 'B': 1, 'C': 3, 'D': 1}, {'A': 2, 'B': 0, 'C': 2, 'D': 0}\n ]);\n });\n\n it('reads CSV with selected column in order', async () => {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset = new CSVDataset(\n source,\n {columnConfigs: {'bar': {}, 'foo': {}}, configuredColumnsOnly: true});\n\n expect(await dataset.columnNames()).toEqual(['bar', 'foo']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'bar': 'cd', 'foo': 'ab'},\n {'bar': undefined, 'foo': 'ghi'},\n {'bar': 'mn', 'foo': undefined},\n {'bar': 7.8, 'foo': 1.4},\n {'bar': 'tu', 'foo': 'qrs'},\n {'bar': 'w', 'foo': 'v'},\n {'bar': 'z', 'foo': 'y'},\n ]);\n });\n\n it('reads CSV with wrong column', async done => {\n try {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset =\n new CSVDataset(source, {columnNames: ['bar', 'foooooooo']});\n await dataset.columnNames();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'The length of provided columnNames (2) does not match the length ' +\n 'of the header line read from file (3).');\n done();\n }\n });\n\n it('reads CSV with column names override header', async () => {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset = new CSVDataset(source, {columnNames: ['a', 'b', 'c']});\n expect(await dataset.columnNames()).toEqual(['a', 'b', 'c']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'a': 'ab', 'b': 'cd', 'c': 'ef'},\n {'a': 'ghi', 'b': undefined, 'c': 'jkl'},\n {'a': undefined, 'b': 'mn', 'c': 'op'},\n {'a': 1.4, 'b': 7.8, 'c': 12},\n {'a': 'qrs', 'b': 'tu', 'c': undefined},\n {'a': 'v', 'b': 'w', 'c': 'x'},\n {'a': 'y', 'b': 'z', 'c': undefined},\n ]);\n });\n\n it('reads CSV with missing label value', async done => {\n try {\n const source = new FileDataSource(csvDataWithHeaders, {chunkSize: 10});\n const dataset =\n new CSVDataset(source, {columnConfigs: {'baz': {isLabel: true}}});\n expect(await dataset.columnNames()).toEqual(['foo', 'bar', 'baz']);\n const iter = await dataset.iterator();\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 iter.toArray();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Required column baz is empty in this line: qrs,tu,');\n done();\n }\n });\n\n it('reads CSV with label column', async () => {\n const source = new FileDataSource(csvDataWithHeadersExtra, {chunkSize: 10});\n const dataset =\n new CSVDataset(source, {columnConfigs: {'C': {isLabel: true}}});\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {xs: {'A': 1, 'B': 2}, ys: {'C': 3}},\n {xs: {'A': 2, 'B': 2}, ys: {'C': 3}},\n {xs: {'A': 3, 'B': 2}, ys: {'C': 3}},\n {xs: {'A': 4, 'B': 2}, ys: {'C': 3}},\n {xs: {'A': 5, 'B': 2}, ys: {'C': 3}},\n {xs: {'A': 6, 'B': 2}, ys: {'C': 3}}, {xs: {'A': 7, 'B': 2}, ys: {'C': 3}}\n ]);\n });\n\n it('reads CSV with quote', async () => {\n const source = new FileDataSource(csvDataWithQuote, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n {'A': 1, 'B': 2, 'C': 3}, {'A': 2, 'B': 2, 'C': 3},\n {'A': 3, 'B': '\"\"2', 'C': 3}, {'A': 4, 'B': '2,', 'C': undefined},\n {'A': 5, 'B': 2, 'C': 3}, {'A': 6, 'B': 2, 'C': '345\"123,456\"'},\n {'A': 7, 'B': 2, 'C': 3}\n ]);\n });\n\n it('check duplicate column names', async done => {\n try {\n const csvStringWithDuplicateColumnNames = `foo,bar,foo\n ` + csvString;\n const csvDataWithDuplicateColumnNames = env().get('IS_BROWSER') ?\n new Blob([csvStringWithDuplicateColumnNames]) :\n Buffer.from(csvStringWithDuplicateColumnNames);\n const source =\n new FileDataSource(csvDataWithDuplicateColumnNames, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n await dataset.columnNames();\n } catch (e) {\n expect(e.message).toEqual('Duplicate column names found: foo');\n done();\n }\n });\n\n it('throw error with missing elements', async done => {\n try {\n const source =\n new FileDataSource(csvDataWithMissingElement, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n await iter.toArrayForTest();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Invalid row in csv file. Should have 3 elements in a row, ' +\n 'but got 2,');\n done();\n }\n });\n\n it('collapse continuous white spaces', async () => {\n const source =\n new FileDataSource(csvDataWithMultiWhitespaces, {chunkSize: 10});\n const dataset = new CSVDataset(source, {delimWhitespace: true});\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result[0]).toEqual({A: 1, B: 2, C: 3});\n expect(result[1]).toEqual({A: 2, B: 2, C: 3});\n expect(result[2]).toEqual({A: 3, B: 2, C: 3});\n expect(result[3]).toEqual({A: 4, B: 2, C: 3});\n expect(result[4]).toEqual({A: 5, B: 2, C: 3});\n });\n\n it('parse correctly with single white spaces delimiter', async () => {\n const source =\n new FileDataSource(csvDataWithSingleWhitespace, {chunkSize: 10});\n const dataset = new CSVDataset(source, {delimiter: ' '});\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result[0]).toEqual({A: 1, B: 2, C: 3});\n expect(result[1]).toEqual({A: 2, B: undefined, C: undefined});\n expect(result[2]).toEqual({A: 3, B: 2, C: 3});\n });\n\n it('throw error when delimiter is provided and delimWhitespace is true',\n async done => {\n try {\n const source =\n new FileDataSource(csvDataWithMultiWhitespaces, {chunkSize: 10});\n const dataset =\n new CSVDataset(source, {delimiter: ',', delimWhitespace: true});\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Delimiter should not be provided when delimWhitespace is true.');\n done();\n }\n });\n\n it('parse correctly when csv file has extra line breaker', async () => {\n const source =\n new FileDataSource(csvDataWithDOSLineBreaker, {chunkSize: 10});\n const dataset = new CSVDataset(source);\n expect(await dataset.columnNames()).toEqual(['A', 'B', 'C']);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result[0]).toEqual({A: 1, B: 2, C: 3});\n expect(result[1]).toEqual({A: 'v', B: '\\rw', C: 'x'});\n expect(result[2]).toEqual({A: 3, B: 2, C: 3});\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/datasets/text_line_dataset.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.d.ts deleted file mode 100644 index 8d595fa39..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.d.ts +++ /dev/null @@ -1,35 +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 { Dataset } from '../dataset'; -import { DataSource } from '../datasource'; -import { LazyIterator } from '../iterators/lazy_iterator'; -/** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ -export declare class TextLineDataset extends Dataset { - protected readonly input: DataSource; - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - constructor(input: DataSource); - iterator(): Promise>; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js deleted file mode 100644 index 68d270aec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js +++ /dev/null @@ -1,47 +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 { Dataset } from '../dataset'; -/** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ -export 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; - } -} -//# sourceMappingURL=text_line_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/datasets/text_line_dataset.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js.map deleted file mode 100644 index 281c9423b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"text_line_dataset.js","sourceRoot":"","sources":["../../src/datasets/text_line_dataset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAInC;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,OAAe;IAClD;;;;OAIG;IACH,YAA+B,KAAiB;QAC9C,KAAK,EAAE,CAAC;QADqB,UAAK,GAAL,KAAK,CAAY;IAEhD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClD,MAAM,YAAY,GAAG,aAAa,CAAC,UAAU,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACvD,0EAA0E;YAC1E,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACvB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aAC1B;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACtB,CAAC;CACF","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 {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"]} \ 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/datasets/text_line_dataset_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset_test.js.map deleted file mode 100644 index c50e119c3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasets/text_line_dataset_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"text_line_dataset_test.js","sourceRoot":"","sources":["../../src/datasets/text_line_dataset_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,MAAM,KAAK,GAAG;;sCAEwB,CAAC;AAEvC,MAAM,qBAAqB,GAAG,gCAAgC,CAAC;AAE/D,MAAM,QAAQ,GACV,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErE,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAEvC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,iEAAiE,EACjE,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE3C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,+BAA+B;YAC/B,2CAA2C;YAC3C,uCAAuC;SACxC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEN,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,MAAM,GACR,IAAI,cAAc,CAAC,yBAAyB,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE3C,yCAAyC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,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 */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {FileDataSource} from '../sources/file_data_source';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst runes = `ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ\nᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗᛁᚳᛚᚢᚾ᛫ᚻᛦᛏ᛫ᛞᚫᛚᚪᚾ\nᚷᛁᚠ᛫ᚻᛖ᛫ᚹᛁᛚᛖ᛫ᚠᚩᚱ᛫ᛞᚱᛁᚻᛏᚾᛖ᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇᛏᚪᚾ᛬`;\n\nconst textWithDOSLineBreaks = 'abc\\rdefg\\r\\nhijklmn\\r\\nopqrst';\n\nconst testBlob =\n env().get('IS_BROWSER') ? new Blob([runes]) : Buffer.from(runes);\n\nconst textBlobWithDOSLineBreaks = env().get('IS_BROWSER') ?\n new Blob([textWithDOSLineBreaks]) :\n Buffer.from(textWithDOSLineBreaks);\n\ndescribe('TextLineDataset', () => {\n it('Produces a stream of strings containing UTF8-decoded text lines',\n async () => {\n const source = new FileDataSource(testBlob, {chunkSize: 10});\n const dataset = new TextLineDataset(source);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n expect(result).toEqual([\n 'ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ',\n 'ᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗᛁᚳᛚᚢᚾ᛫ᚻᛦᛏ᛫ᛞᚫᛚᚪᚾ',\n 'ᚷᛁᚠ᛫ᚻᛖ᛫ᚹᛁᛚᛖ᛫ᚠᚩᚱ᛫ᛞᚱᛁᚻᛏᚾᛖ᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇᛏᚪᚾ᛬',\n ]);\n });\n\n it('Parses lines from windows/DOS text correctly', async () => {\n const source =\n new FileDataSource(textBlobWithDOSLineBreaks, {chunkSize: 10});\n const dataset = new TextLineDataset(source);\n const iter = await dataset.iterator();\n const result = await iter.toArrayForTest();\n\n // \\r is retained when not followed by \\n\n expect(result[0]).toEqual('abc\\rdefg');\n expect(result[1]).toEqual('hijklmn');\n expect(result[2]).toEqual('opqrst');\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/iterators/byte_chunk_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.d.ts deleted file mode 100644 index 489789ac5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.d.ts +++ /dev/null @@ -1,31 +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 { LazyIterator } from './lazy_iterator'; -import { StringIterator } from './string_iterator'; -export declare abstract 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(): StringIterator; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js deleted file mode 100644 index d5b7d883b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js +++ /dev/null @@ -1,115 +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 { env } from '@tensorflow/tfjs-core'; -import { LazyIterator, OneToManyIterator } from './lazy_iterator'; -import { StringIterator } from './string_iterator'; -export 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; - } -} -//# sourceMappingURL=byte_chunk_iterator.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/iterators/byte_chunk_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js.map deleted file mode 100644 index 4f6962bf3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"byte_chunk_iterator.js","sourceRoot":"","sources":["../../src/iterators/byte_chunk_iterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAgB,iBAAkB,SAAQ,YAAwB;IACtE;;;;;;;;OAQG;IACH,UAAU;QACR,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAED,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAE/E,uCAAuC;AACvC,qEAAqE;AACrE,4EAA4E;AAC5E,oBAAoB;AAEpB,MAAM,YAAa,SAAQ,cAAc;IAGvC,YAAsB,QAAkC;QACtD,KAAK,EAAE,CAAC;QADY,aAAQ,GAAR,QAAQ,CAA0B;QAEtD,IAAI,CAAC,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7C,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C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;SACtD;QACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 {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"]} \ 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/iterators/byte_chunk_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator_test.js.map deleted file mode 100644 index 3fdcaf6c6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/byte_chunk_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"byte_chunk_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/byte_chunk_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAExD,MAAM,KAAK,GAAG;;sCAEwB,CAAC;AAEvC,MAAM,QAAQ,GACV,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErE,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAE,QAAiB,CAAC,IAAI,CAAC,CAAC;YACxB,QAAmB,CAAC,UAAU,CAAC,CAAC;aAC9D,OAAO,CAAC,GAAG,CAAC,CAAC;QAClB,MAAM,YAAY,GAAG,iBAAiB,CAAC,UAAU,EAAE,CAAC;QAEpD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACnD,mEAAmE;QACnE,qEAAqE;QACrE,sEAAsE;QACtE,qEAAqE;QACrE,sBAAsB;QACtB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,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 */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator} from './file_chunk_iterator';\n\nconst runes = `ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ\nᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗᛁᚳᛚᚢᚾ᛫ᚻᛦᛏ᛫ᛞᚫᛚᚪᚾ\nᚷᛁᚠ᛫ᚻᛖ᛫ᚹᛁᛚᛖ᛫ᚠᚩᚱ᛫ᛞᚱᛁᚻᛏᚾᛖ᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇᛏᚪᚾ᛬`;\n\nconst testData =\n env().get('IS_BROWSER') ? new Blob([runes]) : Buffer.from(runes);\n\ndescribe('ByteChunkIterator.decodeUTF8()', () => {\n it('Correctly reassembles split characters', async () => {\n const byteChunkIterator = new FileChunkIterator(testData, {chunkSize: 50});\n expect((env().get('IS_BROWSER') ? (testData as Blob).size :\n (testData as Buffer).byteLength))\n .toEqual(323);\n const utf8Iterator = byteChunkIterator.decodeUTF8();\n\n const result = await utf8Iterator.toArrayForTest();\n // The test string is 109 characters long; its UTF8 encoding is 323\n // bytes. We read it in chunks of 50 bytes, so there were 7 chunks of\n // bytes. The UTF decoder slightly adjusted the boundaries between the\n // chunks to allow decoding, but did not change the number of chunks,\n // so 7 chunks remain.\n expect(result.length).toEqual(7);\n const totalCharacters = result.map(x => x.length).reduce((a, b) => a + b);\n expect(totalCharacters).toEqual(109);\n expect(result.join('')).toEqual(runes);\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/iterators/chained_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/chained_iterator_test.js.map deleted file mode 100644 index 4f27f836d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/chained_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chained_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/chained_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAA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AC5C,cAAc,CAAC,CAAC,GAAG,mBAAmB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;aACjD;SACF;QAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,cAAc,EAAE,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,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 */\n\nimport {ChainedIterator} from './lazy_iterator';\nimport {iteratorFromItems} from './lazy_iterator';\nimport {TestIntegerIterator} from './lazy_iterator_test';\n\nconst SHORT_STREAM_LENGTH = 15;\n\ndescribe('ChainedIterator', () => {\n it('produces a single underlying stream as expected', async () => {\n const chainedIterator = new ChainedIterator(\n iteratorFromItems([new TestIntegerIterator(SHORT_STREAM_LENGTH)]));\n\n const expectedResult: number[] = [];\n for (let i = 0; i < 1; i++) {\n for (let j = 0; j < SHORT_STREAM_LENGTH; j++) {\n expectedResult[i * SHORT_STREAM_LENGTH + j] = j;\n }\n }\n\n const result = await chainedIterator.toArrayForTest();\n expect(result).toEqual(expectedResult);\n });\n it('produces multiple underlying streams as expected', async () => {\n const chainedIterator = new ChainedIterator(iteratorFromItems([\n new TestIntegerIterator(SHORT_STREAM_LENGTH),\n new TestIntegerIterator(SHORT_STREAM_LENGTH),\n new TestIntegerIterator(SHORT_STREAM_LENGTH)\n ]));\n\n const expectedResult: number[] = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < SHORT_STREAM_LENGTH; j++) {\n expectedResult[i * SHORT_STREAM_LENGTH + j] = j;\n }\n }\n\n const result = await chainedIterator.toArrayForTest();\n expect(result).toEqual(expectedResult);\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/iterators/file_chunk_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.d.ts deleted file mode 100644 index 2895bbf17..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.d.ts +++ /dev/null @@ -1,41 +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 { FileElement } from '../types'; -import { ByteChunkIterator } from './byte_chunk_iterator'; -export interface FileChunkIteratorOptions { - /** The byte offset at which to begin reading the File or Blob. Default 0. */ - offset?: number; - /** The number of bytes to read at a time. Default 1MB. */ - chunkSize?: number; -} -/** - * 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. - */ -export declare class FileChunkIterator extends ByteChunkIterator { - protected file: FileElement; - protected options: FileChunkIteratorOptions; - offset: number; - chunkSize: number; - constructor(file: FileElement, options?: FileChunkIteratorOptions); - summary(): string; - next(): Promise>; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js deleted file mode 100644 index 32cd96055..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js +++ /dev/null @@ -1,94 +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. - * - * ============================================================================= - */ -// inspired by https://github.com/maxogden/filereader-stream -import { env, util } from '@tensorflow/tfjs-core'; -import { ByteChunkIterator } from './byte_chunk_iterator'; -/** - * 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. - */ -export 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 }; - } -} -//# sourceMappingURL=file_chunk_iterator.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/iterators/file_chunk_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js.map deleted file mode 100644 index abdc0725d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file_chunk_iterator.js","sourceRoot":"","sources":["../../src/iterators/file_chunk_iterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4DAA4D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;gBAClE,qEAAqE;gBACrE,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;aACrC;YACD,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO,EAAC,KAAK,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC;IAC7C,CAAC;CACF","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\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"]} \ 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/iterators/file_chunk_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator_test.js.map deleted file mode 100644 index 86c620aca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/file_chunk_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file_chunk_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/file_chunk_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAExD,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,EAAE;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAEjC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,YAAY,GAAG,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,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c,EAAE,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,GAAG,EAAE;YACV,gDAAgD;YAChD,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACG,YAAY,CACT,kEAAkE;YAClE,MAAM,CAAC,CAAC;IAClB,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 */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator} from './file_chunk_iterator';\n\nconst range = (start: number, end: number) => {\n return Array.from({length: (end - start)}, (v, k) => k + start);\n};\n\nconst testData = env().get('IS_BROWSER') ?\n new Blob([new Uint8Array(range(0, 55))]) :\n new Uint8Array(range(0, 55));\n\ndescribe('FileChunkIterator', () => {\n it('Reads the entire file and then closes the stream', async () => {\n const readIterator = new FileChunkIterator(testData, {chunkSize: 10});\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(6);\n const totalBytes = result.map(x => x.length).reduce((a, b) => a + b);\n expect(totalBytes).toEqual(55);\n });\n\n it('Reads chunks in order', async () => {\n const readIterator = new FileChunkIterator(testData, {chunkSize: 10});\n const result = await readIterator.toArrayForTest();\n expect(result[0][0]).toEqual(0);\n expect(result[1][0]).toEqual(10);\n expect(result[2][0]).toEqual(20);\n expect(result[3][0]).toEqual(30);\n expect(result[4][0]).toEqual(40);\n expect(result[5][0]).toEqual(50);\n });\n\n it('Reads chunks of expected sizes', async () => {\n const readIterator = new FileChunkIterator(testData, {chunkSize: 10});\n const result = await readIterator.toArrayForTest();\n expect(result[0].length).toEqual(10);\n expect(result[1].length).toEqual(10);\n expect(result[2].length).toEqual(10);\n expect(result[3].length).toEqual(10);\n expect(result[4].length).toEqual(10);\n expect(result[5].length).toEqual(5);\n });\n\n it('Provides mistyped data throws error', () => {\n expect(() => {\n // tslint:disable-next-line:no-unused-expression\n new FileChunkIterator(null);\n })\n .toThrowError(\n 'FileChunkIterator only supports File, Blob and Uint8Array right ' +\n 'now.');\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/iterators/lazy_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.d.ts deleted file mode 100644 index cde9dfc40..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.d.ts +++ /dev/null @@ -1,422 +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 { Container } from '../types'; -import { DeepMapResult } from '../util/deep_map'; -import { RingBuffer } from '../util/ring_buffer'; -/** - * A nested structure of LazyIterators, used as the input to zip(). - */ -export declare type IteratorContainer = Container>; -/** - * Create a `LazyIterator` from an array of items. - */ -export declare function iteratorFromItems(items: T[]): LazyIterator; -/** - * Create a `LazyIterator` of incrementing integers. - */ -export declare function iteratorFromIncrementing(start: number): LazyIterator; -/** - * 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. - */ -export declare function iteratorFromFunction(func: () => IteratorResult | Promise>): LazyIterator; -/** - * 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. - */ -export declare function iteratorFromConcatenated(baseIterators: LazyIterator>, baseErrorHandler?: (e: Error) => boolean): LazyIterator; -/** - * Create a `LazyIterator` by concatenating streams produced by calling a - * stream-generating function a given number of times. - * - * Since a `LazyIterator` is read-once, it cannot be repeated, but this - * function can be used to achieve a similar effect: - * - * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6); - * - * @param iteratorFunc: A function that produces a new stream on each call. - * @param count: The number of times to call the function. - * @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. - */ -export declare function iteratorFromConcatenatedFunction(iteratorFunc: () => IteratorResult>, count: number, baseErrorHandler?: (e: Error) => boolean): LazyIterator; -/** - * 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. - */ -export declare function iteratorFromZipped(iterators: IteratorContainer, mismatchMode?: ZipMismatchMode): LazyIterator; -/** - * 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();` - */ -export declare abstract class LazyIterator { - abstract summary(): string; - /** - * Returns a `Promise` for the next element in the stream. - * - * When an item can be provided successfully, the return value is - * `{value:T, done:false}`. - * - * Calling next() on a closed stream returns `{value:null, done:true}`. - */ - abstract next(): Promise>; - /** - * 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. - */ - 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 stream elements, which will resolve - * when the stream is exhausted. - */ - toArrayForTest(): Promise; - /** - * 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. - */ - resolveFully(): Promise; - /** - * 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. - */ - resolveWhile(predicate: (r: T) => boolean): Promise; - /** - * 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: (error: Error) => boolean): LazyIterator; - /** - * 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: (value: T) => boolean): LazyIterator; - /** - * 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: (value: T) => O): LazyIterator; - /** - * 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: (value: T) => Promise): LazyIterator; - /** - * 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: (value: T) => Promise): LazyIterator; - /** - * 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: (value: T) => O[]): LazyIterator; - /** - * Apply a function to every element of the stream. - * - * @param f A function to apply to each stream element. - */ - forEachAsync(f: (value: T) => void): Promise; - /** - * 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. - */ - serialForEach(f: (value: T) => Promise): Promise; - /** - * 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: number, smallLastBatch?: boolean): LazyIterator; - /** - * 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: number, smallLastBatch?: boolean, zipFn?: (xs: any[]) => DeepMapResult): LazyIterator; - /** - * 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: LazyIterator, baseErrorHandler?: (e: Error) => boolean): LazyIterator; - /** - * 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: number): LazyIterator; - /** - * 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: number): LazyIterator; - /** - * 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: number): LazyIterator; - /** - * 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: number, seed?: string): LazyIterator; - /** - * Force an iterator to execute serially: each next() call will await the - * prior one, so that they cannot execute concurrently. - */ - serial(): LazyIterator; -} -/** - * 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. - */ -export declare abstract class OneToManyIterator extends LazyIterator { - private lastRead; - protected outputQueue: RingBuffer; - constructor(); - next(): Promise>; - /** - * Read one or more chunks from upstream and process them, possibly - * reading or writing a carryover, and adding processed items to the - * output queue. Note it's possible that no items are added to the queue - * on a given pump() call, even if the upstream stream is not closed - * (e.g., because items are filtered). - * - * @return `true` if any action was taken, i.e. fetching items from the - * upstream source OR adding items to the output queue. `false` if the - * upstream source is exhausted AND nothing was added to the queue - * (i.e., any remaining carryover). - */ - protected abstract pump(): Promise; - serialNext(): Promise>; -} -/** - * 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. - */ -export declare class ChainedIterator extends LazyIterator { - private readonly baseErrorHandler?; - private lastRead; - private iterator; - private moreIterators; - constructor(iterators: LazyIterator>, baseErrorHandler?: (e: Error) => boolean); - summary(): string; - next(): Promise>; - private readFromChain; -} -export declare enum ZipMismatchMode { - FAIL = 0, - SHORTEST = 1, - LONGEST = 2 -} -/** - * 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. - */ -export declare class PrefetchIterator extends LazyIterator { - protected upstream: LazyIterator; - protected bufferSize: number; - protected buffer: RingBuffer>>; - constructor(upstream: LazyIterator, bufferSize: number); - summary(): string; - /** - * Refill the prefetch buffer. Returns only after the buffer is full, or - * the upstream source is exhausted. - */ - protected refill(): void; - next(): Promise>; -} -/** - * 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. - */ -export declare class ShuffleIterator extends PrefetchIterator { - protected upstream: LazyIterator; - protected windowSize: number; - private readonly random; - private lastRead; - private upstreamExhausted; - constructor(upstream: LazyIterator, windowSize: number, seed?: string); - next(): Promise>; - private randomInt; - protected chooseIndex(): number; - serialNext(): Promise>; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js deleted file mode 100644 index de98e5d29..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js +++ /dev/null @@ -1,1006 +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 { deepClone } from '../util/deep_clone'; -import { deepMapAndAwaitAll, deepZip, zipToList } from '../util/deep_map'; -import { GrowingRingBuffer } from '../util/growing_ring_buffer'; -import { RingBuffer } from '../util/ring_buffer'; -// 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. - */ -export function iteratorFromItems(items) { - return new ArrayIterator(items); -} -/** - * Create a `LazyIterator` of incrementing integers. - */ -export function iteratorFromIncrementing(start) { - let i = start; - return iteratorFromFunction(() => ({ value: i++, done: false })); -} -/** - * 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. - */ -export 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. - */ -export function iteratorFromConcatenated(baseIterators, baseErrorHandler) { - return new ChainedIterator(baseIterators, baseErrorHandler); -} -/** - * Create a `LazyIterator` by concatenating streams produced by calling a - * stream-generating function a given number of times. - * - * Since a `LazyIterator` is read-once, it cannot be repeated, but this - * function can be used to achieve a similar effect: - * - * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6); - * - * @param iteratorFunc: A function that produces a new stream on each call. - * @param count: The number of times to call the function. - * @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. - */ -export function iteratorFromConcatenatedFunction(iteratorFunc, count, baseErrorHandler) { - return iteratorFromConcatenated(iteratorFromFunction(iteratorFunc).take(count), 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. - */ -export 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();` - */ -export 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. - */ -export 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. - */ -export 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; - } -} -export 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: - default: - // 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. - */ -export 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. - */ -export 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.alea(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 }; - } -} -//# sourceMappingURL=lazy_iterator.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/iterators/lazy_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js.map deleted file mode 100644 index f67c50f3c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js.map +++ /dev/null @@ -1 +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,GAAG,IAAI,CAAC;aAC/B;iBAAM;gBACL,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,OAAO,MAAM,CAAC;aACf;SACF;QACD,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IACnC,CAAC;CACF","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 * 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"]} \ 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/iterators/lazy_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator_test.js.map deleted file mode 100644 index abe6d7aa9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lazy_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/lazy_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAEjN,MAAM,OAAO,mBAAoB,SAAQ,YAAoB;IAI3D,YAA+B,SAAS,GAAG;QACzC,KAAK,EAAE,CAAC;QADqB,WAAM,GAAN,MAAM,CAAM;QAH3C,iBAAY,GAAG,CAAC,CAAC;QAKf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,OAAO;QACL,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,EAAE;YACpC,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;SAClC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,C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4C;QAE5C,MAAM,UAAU,GACZ,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAyB,CAAC,CAAC,CAAC;QACjE,mEAAmE;QAEnE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEnC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,MAAM,EAAE,GAAG,CAA0B,CAAC;YACtC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAW,GAAG,EAAE,CAAC,CAAC;YAChD,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SAC9C;IACH,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 */\n\nimport {TensorContainer, TensorContainerArray, TensorContainerObject} from '@tensorflow/tfjs-core';\nimport {iteratorFromConcatenated, iteratorFromConcatenatedFunction, iteratorFromFunction, iteratorFromIncrementing, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './lazy_iterator';\n\nexport class TestIntegerIterator extends LazyIterator {\n currentIndex = 0;\n data: number[];\n\n constructor(protected readonly length = 100) {\n super();\n this.data = Array.from({length}, (v, k) => k);\n }\n\n summary() {\n return `TestIntegers`;\n }\n\n async next(): Promise> {\n if (this.currentIndex >= this.length) {\n return {value: null, done: true};\n }\n const result = this.data[this.currentIndex];\n this.currentIndex++;\n // Sleep for a millisecond every so often.\n // This purposely scrambles the order in which these promises are resolved,\n // to demonstrate that the various methods still process the stream\n // in the correct order.\n if (Math.random() < 0.1) {\n await new Promise(res => setTimeout(res, 1));\n }\n return {value: result, done: false};\n }\n}\n\ndescribe('LazyIterator', () => {\n it('collects all stream elements into an array', async () => {\n const readIterator = new TestIntegerIterator();\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(100);\n });\n\n it('reads chunks in order', async () => {\n const readIterator = new TestIntegerIterator();\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(100);\n for (let i = 0; i < 100; i++) {\n expect(result[i]).toEqual(i);\n }\n });\n\n it('filters elements', async () => {\n const readIterator = new TestIntegerIterator().filter(x => x % 2 === 0);\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(50);\n for (let i = 0; i < 50; i++) {\n expect(result[i]).toEqual(2 * i);\n }\n });\n\n it('maps elements', async () => {\n const readIterator = new TestIntegerIterator().map(x => `item ${x}`);\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(100);\n for (let i = 0; i < 100; i++) {\n expect(result[i]).toEqual(`item ${i}`);\n }\n });\n\n it('maps elements through an async function', async () => {\n const readIterator = new TestIntegerIterator().mapAsync(async x => {\n // Sleep for a millisecond every so often.\n // This purposely scrambles the order in which these promises are\n // resolved, to demonstrate that we still process the\n // stream in the correct order.\n if (Math.random() < 0.1) {\n await new Promise(res => setTimeout(res, 1));\n }\n return Promise.resolve(`item ${x}`);\n });\n // It's important to prefetch in order to test the promise randomization\n // above. Note collect() already prefetches by default, but here we do it\n // explicitly anyway just to be extra clear.\n const result = await readIterator.prefetch(200).toArray();\n expect(result.length).toEqual(100);\n for (let i = 0; i < 100; i++) {\n expect(result[i]).toEqual(`item ${i}`);\n }\n });\n\n it('flatmaps simple elements', async () => {\n const readStream = new TestIntegerIterator().flatmap(\n x => [`item ${x} A`, `item ${x} B`, `item ${x} C`]);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(300);\n for (let i = 0; i < 100; i++) {\n expect(result[3 * i + 0]).toEqual(`item ${i} A`);\n expect(result[3 * i + 1]).toEqual(`item ${i} B`);\n expect(result[3 * i + 2]).toEqual(`item ${i} C`);\n }\n });\n\n it('flatmap flattens object elements but not their contents', async () => {\n const readStream = new TestIntegerIterator().flatmap(\n x =>\n [{foo: `foo ${x} A`, bar: `bar ${x} A`},\n {foo: `foo ${x} B`, bar: `bar ${x} B`},\n {foo: `foo ${x} C`, bar: `bar ${x} C`},\n ]);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(300);\n for (let i = 0; i < 100; i++) {\n expect(result[3 * i + 0]).toEqual({foo: `foo ${i} A`, bar: `bar ${i} A`});\n expect(result[3 * i + 1]).toEqual({foo: `foo ${i} B`, bar: `bar ${i} B`});\n expect(result[3 * i + 2]).toEqual({foo: `foo ${i} C`, bar: `bar ${i} C`});\n }\n });\n\n it('flatmap flattens array elements but not their contents', async () => {\n const readStream = new TestIntegerIterator().flatmap(\n x => [\n [`foo ${x} A`, `bar ${x} A`],\n [`foo ${x} B`, `bar ${x} B`],\n [`foo ${x} C`, `bar ${x} C`],\n ]);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(300);\n for (let i = 0; i < 100; i++) {\n expect(result[3 * i + 0]).toEqual([`foo ${i} A`, `bar ${i} A`]);\n expect(result[3 * i + 1]).toEqual([`foo ${i} B`, `bar ${i} B`]);\n expect(result[3 * i + 2]).toEqual([`foo ${i} C`, `bar ${i} C`]);\n }\n });\n\n it('batches elements to a row-major representation', async () => {\n const readIterator = new TestIntegerIterator().rowMajorBatch(8);\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(13);\n for (let i = 0; i < 12; i++) {\n expect(result[i]).toEqual(Array.from({length: 8}, (v, k) => (i * 8) + k));\n }\n expect(result[12]).toEqual([96, 97, 98, 99]);\n });\n\n it('batches elements to a column-major representation', async () => {\n const readIterator = new TestIntegerIterator().columnMajorBatch(8);\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(13);\n for (let i = 0; i < 12; i++) {\n expect(result[i]).toEqual(Array.from({length: 8}, (v, k) => (i * 8) + k));\n }\n expect(result[12]).toEqual([96, 97, 98, 99]);\n });\n\n it('can be limited to a certain number of elements', async () => {\n const readIterator = new TestIntegerIterator().take(8);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4, 5, 6, 7]);\n });\n\n it('is unaltered by a negative or undefined take() count.', async () => {\n const baseIterator = new TestIntegerIterator();\n const readIterator = baseIterator.take(-1);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual(baseIterator.data);\n const baseIterator2 = new TestIntegerIterator();\n const readIterator2 = baseIterator2.take(undefined);\n const result2 = await readIterator2.toArrayForTest();\n expect(result2).toEqual(baseIterator2.data);\n });\n\n it('can skip a certain number of elements', async () => {\n const readIterator = new TestIntegerIterator().skip(88).take(8);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([88, 89, 90, 91, 92, 93, 94, 95]);\n });\n\n it('is unaltered by a negative or undefined skip() count.', async () => {\n const baseIterator = new TestIntegerIterator();\n const readIterator = baseIterator.skip(-1);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual(baseIterator.data);\n const baseIterator2 = new TestIntegerIterator();\n const readIterator2 = baseIterator2.skip(undefined);\n const result2 = await readIterator2.toArrayForTest();\n expect(result2).toEqual(baseIterator2.data);\n });\n\n it('can selectively ignore upstream errors', async () => {\n const readIterator = new TestIntegerIterator().take(10).map(x => {\n if (x % 2 === 0) {\n throw new Error('Oh no, an even number!');\n }\n return x;\n });\n // The 'true' response means the iterator should continue.\n const errorIgnoringIterator = readIterator.handleErrors((e) => true);\n const result = await errorIgnoringIterator.toArrayForTest();\n expect(result).toEqual([1, 3, 5, 7, 9]);\n });\n\n it('can terminate cleanly based on upstream errors', async () => {\n const readIterator = new TestIntegerIterator().map(x => {\n if (x % 2 === 0) {\n throw new Error(`Oh no, an even number: ${x}`);\n }\n return x;\n });\n // The 'true' response means the iterator should continue.\n // But in the case of 10, return false, terminating the stream.\n const errorHandlingIterator = readIterator.handleErrors(\n (e) => e.message !== 'Oh no, an even number: 10');\n const result = await errorHandlingIterator.toArrayForTest();\n expect(result).toEqual([1, 3, 5, 7, 9]);\n });\n\n it('can selectively propagate upstream errors', async done => {\n const readIterator = new TestIntegerIterator().map(x => {\n if (x % 2 === 0) {\n throw new Error(`Oh no, an even number: ${x}`);\n }\n return x;\n });\n const errorHandlingIterator = readIterator.handleErrors((e) => {\n if (e.message === 'Oh no, an even number: 2') {\n throw e;\n }\n return true;\n });\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 errorHandlingIterator.toArray();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual('Oh no, an even number: 2');\n done();\n }\n });\n\n it('can be forced to execute serially', async () => {\n // This is like FilterIterator, except that it does not enforce serial\n // execution. For testing.\n class ParallelFilterIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary} -> ParallelFilterIterator`;\n }\n\n async next(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n }\n }\n }\n\n const newReadIterator = () =>\n new ParallelFilterIterator((new TestIntegerIterator()).take(10), x => {\n return x % 2 === 0;\n });\n\n // Without enforcing serial execution, order gets scrambled; consequently\n // the done signal arrives before any of the accepted elements!\n const badResult = await newReadIterator().toArrayForTest();\n expect(badResult).toEqual([0]);\n\n // But with serial execution, everything is fine.\n const goodResult = await newReadIterator().serial().toArrayForTest();\n expect(goodResult).toEqual([0, 2, 4, 6, 8]);\n });\n\n it('can be created from an array', async () => {\n const readIterator = iteratorFromItems([1, 2, 3, 4, 5, 6]);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([1, 2, 3, 4, 5, 6]);\n });\n\n it('can be created from a function', async () => {\n let i = -1;\n const func = () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true};\n\n const readIterator = iteratorFromFunction(func);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4, 5, 6]);\n });\n\n it('can be created with incrementing integers', async () => {\n const readIterator = iteratorFromIncrementing(0).take(7);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4, 5, 6]);\n });\n\n it('can be concatenated', async () => {\n const a = iteratorFromItems([1, 2, 3]);\n const b = iteratorFromItems([4, 5, 6]);\n const readIterator = a.concatenate(b);\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual([1, 2, 3, 4, 5, 6]);\n });\n\n it('can be created by concatenating streams', async () => {\n const a = new TestIntegerIterator();\n const b = new TestIntegerIterator();\n const readIterator = iteratorFromConcatenated(iteratorFromItems([a, b]));\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(200);\n });\n\n it('can be created by concatenating streams from a function', async () => {\n const readIterator = iteratorFromConcatenatedFunction(\n () => ({value: new TestIntegerIterator(), done: false}), 3);\n const expectedResult: number[] = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 100; j++) {\n expectedResult[i * 100 + j] = j;\n }\n }\n\n const result = await readIterator.toArrayForTest();\n expect(result).toEqual(expectedResult);\n });\n\n it('can be created by zipping an array of streams', async () => {\n const a = new TestIntegerIterator();\n const b = new TestIntegerIterator().map(x => x * 10);\n const c = new TestIntegerIterator().map(x => `string ${x}`);\n const readStream = iteratorFromZipped([a, b, c]);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(100);\n\n // each result has the form [x, x * 10, 'string ' + x]\n\n for (const e of result) {\n const ee = e as TensorContainerArray;\n expect(ee[1]).toEqual(ee[0] as number * 10);\n expect(ee[2]).toEqual(`string ${ee[0]}`);\n }\n });\n\n it('can be created by zipping a dict of streams', async () => {\n const a = new TestIntegerIterator();\n const b = new TestIntegerIterator().map(x => x * 10);\n const c = new TestIntegerIterator().map(x => `string ${x}`);\n const readStream = iteratorFromZipped({a, b, c});\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(100);\n\n // each result has the form {a: x, b: x * 10, c: 'string ' + x}\n\n for (const e of result) {\n const ee = e as TensorContainerObject;\n expect(ee['b']).toEqual(ee['a'] as number * 10);\n expect(ee['c']).toEqual(`string ${ee['a']}`);\n }\n });\n\n it('can be created by zipping a nested structure of streams', async () => {\n const a = new TestIntegerIterator().map(x => ({'a': x, 'constant': 12}));\n const b = new TestIntegerIterator().map(\n x => ({'b': x * 10, 'array': [x * 100, x * 200]}));\n const c = new TestIntegerIterator().map(x => ({'c': `string ${x}`}));\n const readStream = iteratorFromZipped([a, b, c]);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(100);\n\n // each result has the form\n // [\n // {a: x, 'constant': 12}\n // {b: x * 10, 'array': [x * 100, x * 200]},\n // {c: 'string ' + x}\n // ]\n\n for (const e of result) {\n const ee = e as TensorContainerArray;\n const aa = ee[0] as TensorContainerObject;\n const bb = ee[1] as TensorContainerObject;\n const cc = ee[2] as TensorContainerObject;\n expect(aa['constant']).toEqual(12);\n expect(bb['b']).toEqual(aa['a'] as number * 10);\n expect(bb['array']).toEqual([\n aa['a'] as number * 100, aa['a'] as number * 200\n ]);\n expect(cc['c']).toEqual(`string ${aa['a']}`);\n }\n });\n\n it('zip requires streams of the same length by default', async done => {\n try {\n const a = new TestIntegerIterator(10);\n const b = new TestIntegerIterator(3);\n const c = new TestIntegerIterator(2);\n const readStream = iteratorFromZipped([a, b, c]);\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 readStream.toArray();\n done.fail();\n } catch (error) {\n expect(error.message)\n .toBe(\n 'Zipped streams should have the same length. ' +\n 'Mismatched at element 2.');\n done();\n }\n });\n\n it('zip can be told to terminate when the shortest stream terminates',\n async () => {\n const a = new TestIntegerIterator(10);\n const b = new TestIntegerIterator(3);\n const c = new TestIntegerIterator(2);\n const readStream =\n iteratorFromZipped([a, b, c], ZipMismatchMode.SHORTEST);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(2);\n });\n\n it('zip can be told to terminate when the longest stream terminates',\n async () => {\n const a = new TestIntegerIterator(10);\n const b = new TestIntegerIterator(3);\n const c = new TestIntegerIterator(2);\n const readStream =\n iteratorFromZipped([a, b, c], ZipMismatchMode.LONGEST);\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(10);\n expect(result[9]).toEqual([9, null, null]);\n });\n\n /**\n * This test demonstrates behavior that is intrinsic to the tf.data zip()\n * API, but that may not be what users ultimately want when zipping dicts.\n * This may merit a convenience function (e.g., maybe flatZip()).\n */\n it('zipping TensorContainer streams requires manual merge', async () => {\n function naiveMerge(xs: TensorContainer[]): TensorContainer {\n const result = {};\n for (const x of xs) {\n // For now, we do nothing to detect name collisions here\n Object.assign(result, x);\n }\n return result;\n }\n\n const a = new TestIntegerIterator().map(x => ({'a': x}));\n const b = new TestIntegerIterator().map(x => ({'b': x * 10}));\n const c = new TestIntegerIterator().map(x => ({'c': `string ${x}`}));\n const zippedStream = iteratorFromZipped([a, b, c]);\n // At first, each result has the form\n // [{a: x}, {b: x * 10}, {c: 'string ' + x}]\n\n const readStream =\n zippedStream.map(e => naiveMerge(e as TensorContainerArray));\n // Now each result has the form {a: x, b: x * 10, c: 'string ' + x}\n\n const result = await readStream.toArrayForTest();\n expect(result.length).toEqual(100);\n\n for (const e of result) {\n const ee = e as TensorContainerObject;\n expect(ee['b']).toEqual(ee['a'] as number * 10);\n expect(ee['c']).toEqual(`string ${ee['a']}`);\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/iterators/microphone_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.d.ts deleted file mode 100644 index 280602eba..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.d.ts +++ /dev/null @@ -1,58 +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 { Tensor, Tensor2D, Tensor3D, TensorContainer } from '@tensorflow/tfjs-core'; -import { MicrophoneConfig } from '../types'; -import { LazyIterator } from './lazy_iterator'; -/** - * 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. - */ -export declare class MicrophoneIterator extends LazyIterator { - protected readonly microphoneConfig: MicrophoneConfig; - private isClosed; - private stream; - private readonly fftSize; - private readonly columnTruncateLength; - private freqData; - private timeData; - private readonly numFrames; - private analyser; - private audioContext; - private sampleRateHz; - private readonly audioTrackConstraints; - private readonly smoothingTimeConstant; - private readonly includeSpectrogram; - private readonly includeWaveform; - private constructor(); - summary(): string; - static create(microphoneConfig?: MicrophoneConfig): Promise; - start(): Promise; - next(): Promise>; - capture(): Promise<{ - spectrogram: Tensor3D; - waveform: Tensor2D; - }>; - private getAudioData; - stop(): void; - toArray(): Promise; - getSampleRate(): number; - private flattenQueue; - private getTensorFromAudioDataArray; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js deleted file mode 100644 index f474dbcc8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js +++ /dev/null @@ -1,187 +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, tensor, util } from '@tensorflow/tfjs-core'; -import { LazyIterator } from './lazy_iterator'; -/** - * 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. - */ -export 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); - } -} -//# sourceMappingURL=microphone_iterator.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/iterators/microphone_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js.map deleted file mode 100644 index a1619cfb7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"microphone_iterator.js","sourceRoot":"","sources":["../../src/iterators/microphone_iterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAU,MAAM,EAAuC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAErG,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAA6B;IAgBnE,YAAuC,gBAAkC;QACvE,KAAK,EAAE,CAAC;QAD6B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAfjE,aAAQ,GAAG,KAAK,CAAC;QAiBvB,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC;QAChD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,EAAE;YACvD,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;YAClC,MAAM,IAAI,KAAK,CACX,mDAAmD;gBACnD,+BAA+B,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;SACpD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@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"]} \ 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/iterators/microphone_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator_test.js.map deleted file mode 100644 index 9edef43fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/microphone_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"microphone_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/microphone_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACpE,oEAAoE;AACpE,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAE7E,mBAAmB,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAC7C,UAAU,CAAC,GAAG,EAAE;QAC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E,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;YAC9C,kBAAkB,EAAE,KAAK;YACzB,eAAe,EAAE,IAAI;YACrB,OAAO,EAAE,EAAE;YACX,uBAAuB,EAAE,CAAC;SAC3B,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAClD,kCAAkC;QAClC,MAAM,CAAE,MAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;YAC9C,kBAAkB,EAAE,IAAI;YACxB,eAAe,EAAE,IAAI;YACrB,OAAO,EAAE,EAAE;YACX,uBAAuB,EAAE,CAAC;SAC3B,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAClD,kCAAkC;QAClC,MAAM,CAAE,MAAc,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,kCAAkC;QAClC,MAAM,CAAE,MAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1D,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 */\n\nimport {tensor2d, tensor3d, test_util} from '@tensorflow/tfjs-core';\n// TODO(kangyizhang): import from index once microphone is exported.\nimport * as tfd from '../readers';\nimport {describeBrowserEnvs, setupFakeAudeoStream} from '../util/test_utils';\n\ndescribeBrowserEnvs('MicrophoneIterator', () => {\n beforeEach(() => {\n setupFakeAudeoStream();\n });\n\n it('gets tensor with default shape with no config', async () => {\n const microphoneIterator = await tfd.microphone();\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([43, 1024, 1]);\n });\n\n it('throws error when sample rate is not available', async done => {\n try {\n await tfd.microphone({sampleRateHz: 48000});\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Mismatch in sampling rate: Expected: 48000; Actual: 44100');\n done();\n }\n });\n\n it('gets sample rate', async () => {\n const microphoneIterator = await tfd.microphone({sampleRateHz: 44100});\n expect(microphoneIterator.getSampleRate()).toEqual(44100);\n });\n\n it('uses available sample rate on device when it is not provided',\n async () => {\n const microphoneIterator = await tfd.microphone();\n expect(microphoneIterator.getSampleRate()).toEqual(44100);\n });\n\n it('gets tensor in correct shape with fftSize', async () => {\n const microphoneIterator = await tfd.microphone({fftSize: 16});\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([43, 16, 1]);\n });\n\n it('throws error with invalid fftSize', async done => {\n try {\n await tfd.microphone({fftSize: 1000});\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Invalid fftSize: it must be a power of 2 between 2 to 4 and ' +\n '2 to 14, but got 1000');\n done();\n }\n });\n\n it('gets tensor in correct shape with columnTruncateLength', async () => {\n const microphoneIterator =\n await tfd.microphone({columnTruncateLength: 232, fftSize: 128});\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([43, 232, 1]);\n });\n\n it('gets tensor in correct shape with numFramesPerSpectrogram', async () => {\n const microphoneIterator =\n await tfd.microphone({numFramesPerSpectrogram: 3, fftSize: 16});\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([3, 16, 1]);\n });\n\n it('gets tensor in correct shape with full spectrogram config', async () => {\n const microphoneIterator = await tfd.microphone({\n sampleRateHz: 44100,\n fftSize: 16,\n numFramesPerSpectrogram: 10,\n columnTruncateLength: 10\n });\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([10, 10, 1]);\n });\n\n it('provides both spectrogram and waveform', async () => {\n const microphoneIterator = await tfd.microphone(\n {includeSpectrogram: true, includeWaveform: true, fftSize: 16});\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result.value as any).spectrogram.shape).toEqual([43, 16, 1]);\n // tslint:disable-next-line:no-any\n expect((result.value as any).waveform.shape).toEqual([688, 1]);\n });\n\n it('stops and restarts microphone', async () => {\n const microphoneIterator = await tfd.microphone({fftSize: 16});\n const result1 = await microphoneIterator.next();\n expect(result1.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result1.value as any).spectrogram.shape).toEqual([43, 16, 1]);\n microphoneIterator.stop();\n const result2 = await microphoneIterator.next();\n expect(result2.done).toBeTruthy();\n expect(result2.value).toBeNull();\n microphoneIterator.start();\n expect(result1.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result1.value as any).spectrogram.shape).toEqual([43, 16, 1]);\n });\n\n it('stops microphone multiple times', async () => {\n const microphoneIterator =\n await tfd.microphone({fftSize: 16, numFramesPerSpectrogram: 2});\n const result1 = await microphoneIterator.next();\n expect(result1.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n expect((result1.value as any).spectrogram.shape).toEqual([2, 16, 1]);\n microphoneIterator.stop();\n const result2 = await microphoneIterator.next();\n expect(result2.done).toBeTruthy();\n expect(result2.value).toBeNull();\n microphoneIterator.stop();\n const result3 = await microphoneIterator.next();\n expect(result3.done).toBeTruthy();\n expect(result3.value).toBeNull();\n });\n\n it('gets spectrogram and waveform tensor with correct value', async () => {\n const microphoneIterator = await tfd.microphone({\n numFramesPerSpectrogram: 1,\n fftSize: 16,\n includeSpectrogram: true,\n includeWaveform: true\n });\n const result = await microphoneIterator.next();\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n const value = result.value as any;\n expect(value.spectrogram.shape).toEqual([1, 16, 1]);\n test_util.expectArraysClose(\n await value.spectrogram.array(),\n await tensor3d([[\n [0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12],\n [13], [14], [15]\n ]]).array());\n expect(value.waveform.shape).toEqual([16, 1]);\n test_util.expectArraysClose(\n await value.waveform.array(),\n await tensor2d([\n [-16], [-17], [-18], [-19], [-20], [-21], [-22], [-23], [-24], [-25],\n [-26], [-27], [-28], [-29], [-30], [-31]\n ]).array());\n });\n\n it('calls iterator.next() concurrently', async () => {\n let timesRun = 0;\n let tensorsReturned = 0;\n const microphoneIterator = await tfd.microphone(\n {numFramesPerSpectrogram: 10, columnTruncateLength: 10, fftSize: 32});\n\n // This function will be called 3 times. Between each call there is a 200ms\n // interval. The spectrogram tensor will be returned after 464ms.\n /**\n * The events happen in sequence are:\n * call 1st at 0ms, timesRun:1, tensorsReturned:0;\n * call 2nd at 1ms, timesRun:2, tensorsReturned:0;\n * call 3rd at 2ms, timesRun:3, tensorsReturned:0;\n * tensor returned from 1st call at ~7ms, timesRun:3, tensorsReturned:1;\n * tensor returned from 2nd call, timesRun:3, tensorsReturned:2;\n * tensor returned from 3rd call, timesRun:3, tensorsReturned:3.\n */\n const getTensor = async () => {\n // Clear the interval after it ran 3 times.\n if (timesRun === 3) {\n clearInterval(interval);\n } else {\n timesRun++;\n expect(tensorsReturned).toBe(0);\n const result = await microphoneIterator.next();\n tensorsReturned++;\n // When the first tensor got returned (~464ms), getTensor() function\n // should have been called 3 times (at 400ms).\n expect(timesRun).toBe(3);\n expect(result.done).toBeFalsy();\n // tslint:disable-next-line:no-any\n const value = result.value as any;\n expect(value.spectrogram.shape).toEqual([10, 10, 1]);\n }\n };\n\n // Call iterator.next() every 200 milliseconds, stop after 3 times.\n const interval = setInterval(getTensor, 1);\n\n // Wait 3 seconds for the intervals to run.\n await new Promise(resolve => {\n setTimeout(() => {\n resolve();\n }, 100);\n });\n // Assert the intervals run 3 times.\n expect(timesRun).toBe(3);\n expect(tensorsReturned).toBe(3);\n });\n\n it('gets spectrogram from iterator.capture', async () => {\n const microphoneIterator =\n await tfd.microphone({fftSize: 16, numFramesPerSpectrogram: 1});\n const result = await microphoneIterator.capture();\n // tslint:disable-next-line:no-any\n expect((result as any).spectrogram.shape).toEqual([1, 16, 1]);\n });\n\n it('gets waveform from iterator.capture', async () => {\n const microphoneIterator = await tfd.microphone({\n includeSpectrogram: false,\n includeWaveform: true,\n fftSize: 16,\n numFramesPerSpectrogram: 1\n });\n const result = await microphoneIterator.capture();\n // tslint:disable-next-line:no-any\n expect((result as any).waveform.shape).toEqual([16, 1]);\n });\n\n it('gets spectrogram and waveform from iterator.capture', async () => {\n const microphoneIterator = await tfd.microphone({\n includeSpectrogram: true,\n includeWaveform: true,\n fftSize: 16,\n numFramesPerSpectrogram: 1\n });\n const result = await microphoneIterator.capture();\n // tslint:disable-next-line:no-any\n expect((result as any).spectrogram.shape).toEqual([1, 16, 1]);\n // tslint:disable-next-line:no-any\n expect((result as any).waveform.shape).toEqual([16, 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/iterators/prefetch_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/prefetch_iterator_test.js.map deleted file mode 100644 index e871b4762..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/prefetch_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"prefetch_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/prefetch_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gCAAgC,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,gBAAgB,GAClB,IAAI,gBAAgB,CAAC,IAAI,mBAAmB,EAAE,EAAE,GAAG,CAAC,CAAC;QACzD,MAAM,cAAc,GAAa,EAAE,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC5B,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACvB;QAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EACjE,KAAK,IAAI,EAAE;QACT,MAAM,YAAY,GAAG,gCAAgC,CACjD,GAAG,EAAE,CAA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MAAM,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,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 {iteratorFromConcatenatedFunction} from './lazy_iterator';\nimport {PrefetchIterator} from './lazy_iterator';\nimport {TestIntegerIterator} from './lazy_iterator_test';\n\ndescribe('PrefetchIterator', () => {\n it('fetches a stream completely (stream size < buffer size)', async () => {\n const prefetchIterator =\n new PrefetchIterator(new TestIntegerIterator(), 500);\n const expectedResult: number[] = [];\n for (let j = 0; j < 100; j++) {\n expectedResult[j] = j;\n }\n\n const result = await prefetchIterator.toArray();\n expect(result).toEqual(expectedResult);\n });\n\n it('fetches a chained stream completely (stream size < buffer size)',\n async () => {\n const baseIterator = iteratorFromConcatenatedFunction(\n () => ({value: new TestIntegerIterator(), done: false}), 3);\n\n const prefetchIterator = new PrefetchIterator(baseIterator, 500);\n\n const expectedResult: number[] = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 100; j++) {\n expectedResult[i * 100 + j] = j;\n }\n }\n\n const result = await prefetchIterator.toArray();\n expect(result).toEqual(expectedResult);\n });\n\n it('fetches a chained stream completely (stream size > buffer size)',\n async () => {\n const baseIterator = iteratorFromConcatenatedFunction(\n () => ({value: new TestIntegerIterator(), done: false}), 3);\n\n const prefetchIterator = new PrefetchIterator(baseIterator, 122);\n const expectedResult: number[] = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 100; j++) {\n expectedResult[i * 100 + j] = j;\n }\n }\n\n const result = await prefetchIterator.toArray();\n expect(result).toEqual(expectedResult);\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/iterators/shuffle_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/shuffle_iterator_test.js.map deleted file mode 100644 index ee59d659a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/shuffle_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shuffle_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/shuffle_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAC,gCAAgC,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,YAAY,GAAG,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QACjE,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAChE,MAAM,iBAAiB,GAAa,EAAE,CAAC;QACvC,KAAK,IAAI,CAAC,GAAG,C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,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC,EAAE,EAAE;gBAC5C,iBAAiB,CAAC,CAAC,GAAG,mBAAmB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;aACpD;SACF;QACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,cAAc,EAAE,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,KAAK,CAAS,mBAAmB,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACnB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC,EAAE,EAAE;YAC5C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SAC9B;IACH,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 */\n\nimport {ChainedIterator, iteratorFromItems} from './lazy_iterator';\nimport {iteratorFromConcatenatedFunction} from './lazy_iterator';\nimport {ShuffleIterator} from './lazy_iterator';\nimport {TestIntegerIterator} from './lazy_iterator_test';\n\nconst LONG_STREAM_LENGTH = 100;\nconst SHORT_STREAM_LENGTH = 15;\n\ndescribe('ShuffleIterator', () => {\n it('shuffles a stream without replacement', async () => {\n const baseIterator = new TestIntegerIterator(LONG_STREAM_LENGTH);\n const shuffleIterator = new ShuffleIterator(baseIterator, 1000);\n const notExpectedResult: number[] = [];\n for (let i = 0; i < 1; i++) {\n for (let j = 0; j < LONG_STREAM_LENGTH; j++) {\n notExpectedResult[i * LONG_STREAM_LENGTH + j] = j;\n }\n }\n const result = await shuffleIterator.toArrayForTest();\n expect(result).not.toEqual(notExpectedResult);\n expect(result.length).toEqual(LONG_STREAM_LENGTH);\n const counts = new Array(LONG_STREAM_LENGTH);\n result.forEach((x) => {\n counts[x] = (counts[x] || 0) + 1;\n });\n for (let i = 0; i < LONG_STREAM_LENGTH; i++) {\n expect(counts[i]).toEqual(1);\n }\n });\n\n it('shuffles a single chained stream without replacement', async () => {\n const baseIterator = new ChainedIterator(\n iteratorFromItems([new TestIntegerIterator(SHORT_STREAM_LENGTH)]));\n const shuffleIterator = new ShuffleIterator(baseIterator, 1000);\n const notExpectedResult: number[] = [];\n for (let i = 0; i < 1; i++) {\n for (let j = 0; j < SHORT_STREAM_LENGTH; j++) {\n notExpectedResult[i * SHORT_STREAM_LENGTH + j] = j;\n }\n }\n const result = await shuffleIterator.toArrayForTest();\n expect(result).not.toEqual(notExpectedResult);\n expect(result.length).toEqual(SHORT_STREAM_LENGTH);\n const counts = new Array(SHORT_STREAM_LENGTH);\n result.forEach((x) => {\n counts[x] = (counts[x] || 0) + 1;\n });\n for (let i = 0; i < SHORT_STREAM_LENGTH; i++) {\n expect(counts[i]).toEqual(1);\n }\n });\n\n it('shuffles multiple chained streams without replacement', async () => {\n const baseIterator = iteratorFromConcatenatedFunction(\n () => (\n {value: new TestIntegerIterator(SHORT_STREAM_LENGTH), done: false}),\n 3);\n const shuffleIterator = new ShuffleIterator(baseIterator, 1000);\n const notExpectedResult: number[] = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < SHORT_STREAM_LENGTH; j++) {\n notExpectedResult[i * SHORT_STREAM_LENGTH + j] = j;\n }\n }\n const result = await shuffleIterator.toArrayForTest();\n expect(result).not.toEqual(notExpectedResult);\n expect(result.length).toEqual(3 * SHORT_STREAM_LENGTH);\n const counts = new Array(SHORT_STREAM_LENGTH);\n result.forEach((x) => {\n counts[x] = (counts[x] || 0) + 1;\n });\n for (let i = 0; i < SHORT_STREAM_LENGTH; i++) {\n expect(counts[i]).toEqual(3);\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/iterators/string_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.d.ts deleted file mode 100644 index 8c6992e7f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.d.ts +++ /dev/null @@ -1,39 +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 { LazyIterator } from './lazy_iterator'; -export declare abstract 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: string): StringIterator; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js deleted file mode 100644 index 354e11b38..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js +++ /dev/null @@ -1,99 +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 { LazyIterator, OneToManyIterator } from './lazy_iterator'; -export 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; - } -} -//# sourceMappingURL=string_iterator.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/iterators/string_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js.map deleted file mode 100644 index d506b127b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -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,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC/C,IAAI,WAAW,CAAC,IAAI,EAAE;YACpB,IAAI,IAAI,CAAC,SAAS,KAAK,EAAE,EAAE;gBACzB,OAAO,KAAK,CAAC;aACd;YAED,yEAAyE;YACzE,2CAA2C;YAC3C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtD,0DAA0D;QAC1D,iEAAiE;QACjE,8CAA8C;QAE9C,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YACrC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 {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"]} \ 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/iterators/string_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator_test.js.map deleted file mode 100644 index 277d836ee..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/string_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/string_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAExD,MAAM,KAAK,GAAG;;;;;+DAKiD,CAAC;AAEhE,MAAM,QAAQ,GACV,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,MAAM,YAAY,GAAG,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CA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I,CAAC,CAAC;QAE/D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,eAAe,GACjB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxD,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 {env} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator} from './file_chunk_iterator';\n\nconst lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\neiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum\ndolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,\nsunt in culpa qui officia deserunt mollit anim id est laborum.`;\n\nconst testData =\n env().get('IS_BROWSER') ? new Blob([lorem]) : Buffer.from(lorem);\n\ndescribe('StringIterator.split()', () => {\n it('Correctly splits lines', async () => {\n const byteIterator = new FileChunkIterator(testData, {chunkSize: 50});\n const utf8Iterator = byteIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n');\n const expected = lorem.split('\\n');\n\n const result = await lineIterator.toArrayForTest();\n expect(result.length).toEqual(6);\n const totalCharacters = result.map(x => x.length).reduce((a, b) => a + b);\n expect(totalCharacters).toEqual(440);\n expect(result).toEqual(expected);\n expect(result.join('\\n')).toEqual(lorem);\n });\n\n it('Correctly splits strings even when separators fall on chunk boundaries',\n async () => {\n const byteIterator = new FileChunkIterator(\n env().get('IS_BROWSER') ? new Blob(['ab def hi pq']) :\n Buffer.from('ab def hi pq'),\n {chunkSize: 3});\n // Note the initial chunking will be\n // ['ab ', 'def', ' hi', ' ', ' ', 'pq],\n // so here we are testing for correct behavior when\n // * a separator is the last character in a chunk (the first chunk),\n // * it is the first character (the third chunk), and\n // * when the entire chunk consists of separators (fourth and fifth).\n const utf8Iterator = byteIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split(' ');\n const expected = ['ab', 'def', 'hi', '', '', '', '', '', 'pq'];\n\n const result = await lineIterator.toArrayForTest();\n expect(result.length).toEqual(9);\n const totalCharacters =\n result.map(x => x.length).reduce((a, b) => a + b);\n expect(totalCharacters).toEqual(9);\n expect(result).toEqual(expected);\n expect(result.join(' ')).toEqual('ab def hi pq');\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/iterators/url_chunk_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.d.ts deleted file mode 100644 index e0bbd2d7d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.d.ts +++ /dev/null @@ -1,26 +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 { FileChunkIterator, FileChunkIteratorOptions } from './file_chunk_iterator'; -/** - * 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. - */ -export declare function urlChunkIterator(url: RequestInfo, options?: FileChunkIteratorOptions): Promise; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js deleted file mode 100644 index 94c10a468..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js +++ /dev/null @@ -1,61 +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 { util } from '@tensorflow/tfjs-core'; -import { FileChunkIterator } from './file_chunk_iterator'; -/** - * 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. - */ -export 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; -}; -//# sourceMappingURL=url_chunk_iterator.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/iterators/url_chunk_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js.map deleted file mode 100644 index 709e45320..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"url_chunk_iterator.js","sourceRoot":"","sources":["../../src/iterators/url_chunk_iterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAA2B,MAAM,uBAAuB,CAAC;AAElF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAClC,GAAgB,EAAE,UAAoC,EAAE;IAC1D,IAAI,SAAS,CAAC;IACd,IAAI,WAAW,CAAC;IAChB,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC7B,SAAS,GAAG,GAAa,CAAC;KAC3B;SAAM;QACL,SAAS,GAAI,GAAe,CAAC,GAAG,CAAC;QACjC,WAAW,GAAG,yBAAyB,CAAC,GAAc,CAAC,CAAC;KACzD;IACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAChE,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KACnD;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;KACtC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,yBAAyB,GAAG,CAAC,OAAgB,EAAE,EAAE;IACrD,MAAM,IAAI,GAAG;QACX,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC;IACF,OAAO,IAAI,CAAC;AACd,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 {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"]} \ 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/iterators/url_chunk_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator_test.js.map deleted file mode 100644 index cec38c8f1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/url_chunk_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"url_chunk_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/url_chunk_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEjD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAY,EAAE,EAAE;YACjD,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAChD,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;YACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC5D,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;aACxC;YAED,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,WAAW,EAAE,KAAK,IAAI,EAAE;oBACtB,OAAO,GAAG,CAAC;gBACb,CAAC;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,EAAE,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACnD,MAAM,CAAC,MAAM,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C,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,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 */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {urlChunkIterator} from './url_chunk_iterator';\n\nconst TEST_STRING = 'abcdefghijklmnopqrstuvwxyz';\n\ndescribe('URLChunkIterator', () => {\n beforeAll(() => {\n spyOn(util, 'fetch').and.callFake((path: string) => {\n const buf = new ArrayBuffer(TEST_STRING.length);\n const bufView = new Uint8Array(buf);\n for (let i = 0, strLen = TEST_STRING.length; i < strLen; i++) {\n bufView[i] = TEST_STRING.charCodeAt(i);\n }\n\n return {\n ok: true,\n arrayBuffer: async () => {\n return buf;\n }\n };\n });\n });\n\n it('Reads the entire file and then closes the stream', async () => {\n const readIterator = await urlChunkIterator('', {chunkSize: 10});\n const result = await readIterator.toArrayForTest();\n expect(result.length).toEqual(3);\n const totalBytes = result.map(x => x.length).reduce((a, b) => a + b);\n expect(totalBytes).toEqual(26);\n });\n\n it('Reads chunks in order', async () => {\n const readIterator = await urlChunkIterator('', {chunkSize: 10});\n\n const result = await readIterator.toArrayForTest();\n expect(result[0][0]).toEqual('a'.charCodeAt(0));\n expect(result[1][0]).toEqual('k'.charCodeAt(0));\n expect(result[2][0]).toEqual('u'.charCodeAt(0));\n });\n\n it('Reads chunks of expected sizes', async () => {\n const readIterator = await urlChunkIterator('', {chunkSize: 10});\n\n const result = await readIterator.toArrayForTest();\n expect(result[0].length).toEqual(10);\n expect(result[1].length).toEqual(10);\n expect(result[2].length).toEqual(6);\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/iterators/webcam_iterator.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.d.ts deleted file mode 100644 index d8368730e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.d.ts +++ /dev/null @@ -1,44 +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 { Tensor3D } from '@tensorflow/tfjs-core'; -import { WebcamConfig } from '../types'; -import { LazyIterator } from './lazy_iterator'; -/** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ -export declare class WebcamIterator extends LazyIterator { - protected readonly webcamVideoElement: HTMLVideoElement; - protected readonly webcamConfig: WebcamConfig; - private isClosed; - private stream; - private resize; - private cropSize; - private cropBox; - private cropBoxInd; - private constructor(); - summary(): string; - static create(webcamVideoElement?: HTMLVideoElement, webcamConfig?: WebcamConfig): Promise; - start(): Promise; - next(): Promise>; - private needToResize; - cropAndResizeFrame(img: Tensor3D): Tensor3D; - capture(): Promise; - stop(): void; - toArray(): Promise; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js deleted file mode 100644 index 308580097..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js +++ /dev/null @@ -1,192 +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 { browser, cast, env, expandDims, image, reshape, tensor1d, tensor2d, tidy, util } from '@tensorflow/tfjs-core'; -import { LazyIterator } from './lazy_iterator'; -/** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ -export 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.'); - } -} -//# sourceMappingURL=webcam_iterator.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/iterators/webcam_iterator.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js.map deleted file mode 100644 index 5aff76929..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcam_iterator.js","sourceRoot":"","sources":["../../src/iterators/webcam_iterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAY,QAAQ,EAAgC,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE7J,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAsB;IAQxD,YACuB,kBAAoC,EACpC,YAA0B;QAC/C,KAAK,EAAE,CAAC;QAFa,uBAAkB,GAAlB,kBAAkB,CAAkB;QACpC,iBAAY,GAAZ,YAAY,CAAc;QATzC,aAAQ,GAAG,IAAI,CAAC;QAEhB,WAAM,GAAG,KAAK,CAAC;QASrB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,QAAQ;gBACT,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YACpE,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACzC,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;gBAChC,6CAA6C;gBAC7C,MAAM,kBAAkB,GACpB,IAA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,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,mDAAmD;IACnD,IAAI;QACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAEvC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAEtC,IAAI;YACF,IAAI,CAAC,kBAAkB,CAAC,SAAS,GAAG,IAAI,CAAC;SAC1C;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,IAAI,CAAC,kBAAkB,CAAC,GAAG,GAAG,IAAI,CAAC;SACpC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,qDAAqD;IACrD,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;CACF","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 {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"]} \ 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/iterators/webcam_iterator_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator_test.js.map deleted file mode 100644 index 2b3a8bc3d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/iterators/webcam_iterator_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcam_iterator_test.js","sourceRoot":"","sources":["../../src/iterators/webcam_iterator_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,mBAAmB,EAAE,6BAA6B,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,mBAAmB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AC,CAAC;IACtD,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 */\n\nimport {memory, tensor3d, test_util} from '@tensorflow/tfjs-core';\nimport {describeBrowserEnvs, replaceHTMLVideoElementSource, setupFakeVideoStream} from '../util/test_utils';\nimport {WebcamIterator} from './webcam_iterator';\n\ndescribeBrowserEnvs('WebcamIterator', () => {\n beforeEach(() => {\n setupFakeVideoStream();\n });\n\n it('create webcamIterator with html element', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 160;\n videoElement.height = 90;\n\n const webcamIterator = await WebcamIterator.create(videoElement);\n\n await replaceHTMLVideoElementSource(videoElement);\n\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([90, 160, 3]);\n });\n\n it('create webcamIterator with html element and capture', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 160;\n videoElement.height = 90;\n\n const webcamIterator = await WebcamIterator.create(videoElement);\n\n await replaceHTMLVideoElementSource(videoElement);\n\n const result = await webcamIterator.capture();\n expect(result.shape).toEqual([90, 160, 3]);\n });\n\n it('create webcamIterator with no html element', async () => {\n const webcamIterator = await WebcamIterator.create(\n 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('create webcamIterator with no html element and capture', async () => {\n const webcamIterator = await WebcamIterator.create(\n null, {resizeWidth: 300, resizeHeight: 150});\n const result = await webcamIterator.capture();\n expect(result.shape).toEqual([150, 300, 3]);\n });\n\n it('create webcamIterator with no html element and no size', async done => {\n try {\n await WebcamIterator.create();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n done();\n }\n });\n\n it('resize and center crop has correct shape with html element', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 100;\n videoElement.height = 200;\n const webcamIterator = await WebcamIterator.create(\n videoElement, {resizeWidth: 30, resizeHeight: 40, centerCrop: true});\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([40, 30, 3]);\n });\n\n it('resize and center crop has correct pixel with html element', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 4;\n videoElement.height = 4;\n const webcamIterator = await WebcamIterator.create(\n videoElement, {resizeWidth: 2, resizeHeight: 2, centerCrop: true});\n const originalImg = tensor3d([\n [[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]],\n [\n [1, 1, 1],\n [11, 12, 13],\n [14, 15, 16],\n [1, 1, 1],\n ],\n [\n [1, 1, 1],\n [1, 2, 3],\n [4, 5, 6],\n [1, 1, 1],\n ],\n [[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]]\n ]);\n const croppedImg = webcamIterator.cropAndResizeFrame(originalImg);\n test_util.expectArraysClose(\n await croppedImg.array(),\n await tensor3d([\n [[6.625, 7.1875, 7.75], [8.3125, 8.875, 9.4375]],\n\n [[1, 1.5625, 2.125], [2.6875, 3.25, 3.8125]]\n ]).array());\n });\n\n it('resize in bilinear method has correct shape with html element',\n async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 100;\n videoElement.height = 200;\n\n const webcamIterator = await WebcamIterator.create(\n videoElement,\n {resizeWidth: 30, resizeHeight: 40, centerCrop: false});\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([40, 30, 3]);\n });\n\n it('resize in bilinear method has correct pixel with html element',\n async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 4;\n videoElement.height = 4;\n const webcamIterator = await WebcamIterator.create(\n videoElement, {resizeWidth: 2, resizeHeight: 2, centerCrop: false});\n const originalImg = tensor3d([\n [[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]],\n [\n [1, 1, 1],\n [11, 12, 13],\n [14, 15, 16],\n [1, 1, 1],\n ],\n [\n [1, 1, 1],\n [1, 2, 3],\n [4, 5, 6],\n [1, 1, 1],\n ],\n [[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]]\n ]);\n const croppedImg = webcamIterator.cropAndResizeFrame(originalImg);\n test_util.expectArraysClose(\n await croppedImg.array(), await tensor3d([\n [[1, 1, 1], [1, 1, 1]],\n\n [[1, 1, 1], [1, 1, 1]]\n ]).array());\n });\n\n it('webcamIterator could stop', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 160;\n videoElement.height = 90;\n\n const webcamIterator = await WebcamIterator.create(videoElement);\n await replaceHTMLVideoElementSource(videoElement);\n const result1 = await webcamIterator.next();\n expect(result1.done).toBeFalsy();\n expect(result1.value.shape).toEqual([90, 160, 3]);\n\n await webcamIterator.stop();\n const result2 = await webcamIterator.next();\n expect(result2.done).toBeTruthy();\n expect(result2.value).toBeNull();\n });\n\n it('webcamIterator could restart', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 160;\n videoElement.height = 90;\n\n const webcamIterator = await WebcamIterator.create(videoElement);\n await replaceHTMLVideoElementSource(videoElement);\n const result1 = await webcamIterator.next();\n expect(result1.done).toBeFalsy();\n expect(result1.value.shape).toEqual([90, 160, 3]);\n\n webcamIterator.stop();\n const result2 = await webcamIterator.next();\n expect(result2.done).toBeTruthy();\n expect(result2.value).toBeNull();\n\n // Skip validation when it's in Firefox and Mac OS, because BrowserStack for\n // Firefox does not trigger the readyState event when restarting.\n if (navigator.userAgent.search('Firefox') < 0 &&\n navigator.userAgent.search('OS X') < 0) {\n await webcamIterator.start();\n await replaceHTMLVideoElementSource(videoElement);\n const result3 = await webcamIterator.next();\n expect(result3.done).toBeFalsy();\n expect(result3.value.shape).toEqual([90, 160, 3]);\n }\n });\n\n it('capture with cropAndResize has no memory leaks', async () => {\n const videoElement = document.createElement('video');\n videoElement.width = 100;\n videoElement.height = 200;\n const webcamIterator = await WebcamIterator.create(\n videoElement, { resizeWidth: 30, resizeHeight: 40, centerCrop: true });\n\n const before = memory();\n\n const result = await webcamIterator.capture();\n result.dispose();\n\n const after = memory();\n\n expect(after.numTensors).toEqual(before.numTensors);\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/miniprogram/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/miniprogram/index.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/miniprogram/index.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, 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,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,GAA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gB6BgT,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/sources/file_data_source.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.d.ts deleted file mode 100644 index cb00f51a3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.d.ts +++ /dev/null @@ -1,39 +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 { DataSource } from '../datasource'; -import { ByteChunkIterator } from '../iterators/byte_chunk_iterator'; -import { FileChunkIteratorOptions } from '../iterators/file_chunk_iterator'; -import { FileElement } from '../types'; -/** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ -export declare class FileDataSource extends DataSource { - protected input: FileElement | string; - protected readonly options: FileChunkIteratorOptions; - /** - * 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: FileElement | string, options?: FileChunkIteratorOptions); - iterator(): Promise; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js deleted file mode 100644 index 067ba535b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js +++ /dev/null @@ -1,51 +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 { env } from '@tensorflow/tfjs-core'; -import { DataSource } from '../datasource'; -import { FileChunkIterator } from '../iterators/file_chunk_iterator'; -import { isLocalPath } from '../util/source_util'; -/** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ -export 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); - } -} -//# sourceMappingURL=file_data_source.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/sources/file_data_source.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js.map deleted file mode 100644 index 9b05cf9e6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/file_data_source.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file_data_source.js","sourceRoot":"","sources":["../../src/sources/file_data_source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,iBAAiB,EAA2B,MAAM,kCAAkC,CAAC;AAE7F,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C;;;;;;;OAOG;IACH,YACc,KAAyB,EAChB,UAAoC,EAAE;QAC3D,KAAK,EAAE,CAAC;QAFI,UAAK,GAAL,KAAK,CAAoB;QAChB,YAAO,GAAP,OAAO,CAA+B;IAE7D,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACnD,8CAA8C;YAC9C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,YAAY,CAAE,IAAI,CAAC,KAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SAChE;QACD,yEAAyE;QACzE,wBAAwB;QACxB,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF","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 {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"]} \ 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/sources/url_data_source.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.d.ts deleted file mode 100644 index 9985e6306..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.d.ts +++ /dev/null @@ -1,33 +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 { DataSource } from '../datasource'; -import { ByteChunkIterator } from '../iterators/byte_chunk_iterator'; -import { FileChunkIteratorOptions } from '../iterators/file_chunk_iterator'; -export declare class URLDataSource extends DataSource { - protected readonly url: RequestInfo; - protected readonly fileOptions: FileChunkIteratorOptions; - /** - * 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: RequestInfo, fileOptions?: FileChunkIteratorOptions); - iterator(): Promise; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js deleted file mode 100644 index 8fc802098..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js +++ /dev/null @@ -1,52 +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 { DataSource } from '../datasource'; -import { urlChunkIterator } from '../iterators/url_chunk_iterator'; -import { isLocalPath } from '../util/source_util'; -import { FileDataSource } from './file_data_source'; -/* - * Represents a URL readable as a stream of binary data chunks. - */ -export 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); - } - } -} -//# sourceMappingURL=url_data_source.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/sources/url_data_source.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js.map deleted file mode 100644 index 5fd4ba5d7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/sources/url_data_source.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"url_data_source.js","sourceRoot":"","sources":["../../src/sources/url_data_source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAC3C;;;;;;OAMG;IACH,YACuB,GAAgB,EAChB,cAAwC,EAAE;QAC/D,KAAK,EAAE,CAAC;QAFa,QAAG,GAAH,GAAG,CAAa;QAChB,gBAAW,GAAX,WAAW,CAA+B;IAEjE,CAAC;IAED,sEAAsE;IACtE,yEAAyE;IACzE,8EAA8E;IAC9E,6EAA6E;IAC7E,KAAK,CAAC,QAAQ;QACZ,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACzB,OAAO,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,GAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;iBAC5D,QAAQ,EAAE,CAAC;SACjB;aAAM;YACL,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACrD;IACH,CAAC;CACF","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 {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"]} \ 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/util/deep_clone.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.d.ts deleted file mode 100644 index 5b16bc2c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.d.ts +++ /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. - * - * ============================================================================= - */ -export declare function deepClone(container: T): T; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js deleted file mode 100644 index 7c8e31903..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js +++ /dev/null @@ -1,35 +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 { deepMap, isIterable } from './deep_map'; -export 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 }; - } -} -//# sourceMappingURL=deep_clone.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/util/deep_clone.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js.map deleted file mode 100644 index 652b736d0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"deep_clone.js","sourceRoot":"","sources":["../../src/util/deep_clone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAiB,UAAU,EAAC,MAAM,YAAY,CAAC;AAE9D,MAAM,UAAU,SAAS,CAAI,SAAY;IACvC,OAAO,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC3C,CAAC;AAED,mCAAmC;AACnC,SAAS,aAAa,CAAC,IAAS;IAC9B,IAAI,IAAI,YAAY,EAAE,CAAC,MAAM,EAAE;QAC7B,OAAO,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC,CAAC;KAChD;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;KACrC;SAAM;QACL,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;KACtC;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 {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"]} \ 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/util/deep_map.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.d.ts deleted file mode 100644 index d7b4ee7bc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.d.ts +++ /dev/null @@ -1,117 +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. - * - * ============================================================================= - */ -/** - * A return value for a mapping function that can be applied via deepMap. - * - * If recurse is true, the value should be empty, and iteration will continue - * into the object or array. - */ -export declare type DeepMapResult = { - value: any; - recurse: boolean; -}; -/** - * 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. - */ -export declare function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any | any[]; -/** - * 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. - */ -export declare function deepZip(inputs: any[], zipFn?: (xs: any[]) => DeepMapResult): any | any[]; -export declare function zipToList(x: any[]): DeepMapResult; -/** - * A return value for an async map function for use with deepMapAndAwaitAll. - * - * If recurse is true, the value should be empty, and iteration will continue - * into the object or array. - */ -export declare type DeepMapAsyncResult = { - value: Promise; - recurse: boolean; -}; -/** - * 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. - */ -export declare function deepMapAndAwaitAll(input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise; -/** - * Determine whether the argument is iterable. - * - * @returns true if the argument is an array or any non-Tensor object. - */ -export declare function isIterable(obj: any): boolean; -/** - * 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. - */ -export declare function canTensorify(obj: any): boolean; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js deleted file mode 100644 index d2aeaa4c9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js +++ /dev/null @@ -1,229 +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'; -/** - * 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. - */ -export 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. - */ -export 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 -export 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. - */ -export 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 -export 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 -export 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')); -} -//# sourceMappingURL=deep_map.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/util/deep_map.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js.map deleted file mode 100644 index c63ae19f6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"deep_map.js","sourceRoot":"","sources":["../../src/util/deep_map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAe5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CAAC,KAAU,EAAE,KAAgC;IAElE,OAAO,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CACpB,KAA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WAAW,CAAC,CAAC;SAC5B;KACF;IAED,kEAAkE;IAClE,kDAAkD;IAClD,0EAA0E;IAC1E,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,kCAAkC;AAClC,MAAM,UAAU,UAAU,CAAC,GAAQ;IACjC,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAClB,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,kCAAkC;AAClC,MAAM,UAAU,YAAY,CAAC,GAAQ;IACnC,OAAO,GAAG,IAAI,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACxD,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC;QACvD,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAU;IAC7B,OAAO,CACH,KAAK,KAAK,IAAI;QACd,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;AAClE,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';\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"]} \ 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/util/deep_map_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map_test.js.map deleted file mode 100644 index 8668efcea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/deep_map_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"deep_map_test.js","sourceRoot":"","sources":["../../src/util/deep_map_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK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AAU,EAAE,CAAC;YAC7C,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;YAC/D,MAAM,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;YAClC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,CAAC,YAAY,CAAC,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,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 */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable-next-line:max-line-length\nimport {canTensorify, deepMap, deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, isIterable} from './deep_map';\n\nconst integerNames = [\n 'zero', 'one', 'two', 'three', ['an array representing', 'four'],\n {five: 'I am a dict'}\n];\n\n// tslint:disable-next-line:no-any\nfunction transform(x: any): DeepMapResult {\n if (x === null) {\n return null;\n }\n if (typeof (x) === 'number') {\n return {value: integerNames[x], recurse: false};\n }\n\n if (isIterable(x)) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction asyncTransform(x: any): DeepMapAsyncResult {\n const result = transform(x);\n return {\n value: result.value === null ? null : Promise.resolve(result.value),\n recurse: result.recurse\n };\n}\n\ndescribe('deepMap', () => {\n it('maps single mappable objects', () => {\n expect(deepMap(null, transform)).toEqual(null);\n expect(deepMap(1, transform)).toEqual('one');\n expect(deepMap(3, transform)).toEqual('three');\n expect(deepMap('hello', transform)).toEqual('hello');\n });\n it('maps arrays of mappable objects', () => {\n expect(deepMap([null, 1], transform)).toEqual([null, 'one']);\n expect(deepMap([1, 2, 3], transform)).toEqual(['one', 'two', 'three']);\n expect(deepMap([1, 'hello', 3, null], transform)).toEqual([\n 'one', 'hello', 'three', null\n ]);\n });\n it('maps objects containing mappable fields', () => {\n expect(deepMap({a: null, b: 1}, transform)).toEqual({a: null, b: 'one'});\n expect(deepMap({a: 1, b: 2, c: 3}, transform))\n .toEqual({a: 'one', b: 'two', c: 'three'});\n expect(deepMap({a: 1, b: 'hello', c: 3, d: null}, transform))\n .toEqual({a: 'one', b: 'hello', c: 'three', d: null});\n });\n it('maps nested structures containing mappable fields', () => {\n const input = {a: 'hello', b: [2, 3, null, {ba: 0, bb: 'world'}]};\n const expected = {\n a: 'hello',\n b: ['two', 'three', null, {ba: 'zero', bb: 'world'}]\n };\n expect(deepMap(input, transform)).toEqual(expected);\n });\n it('maps elements that produce arrays or objects', () => {\n const input = {a: 'hello', b: [2, 4, null, {ba: 5, bb: 'world'}]};\n const expected = {\n a: 'hello',\n b: [\n 'two', ['an array representing', 'four'], null,\n {ba: {five: 'I am a dict'}, bb: 'world'}\n ]\n };\n expect(deepMap(input, transform)).toEqual(expected);\n });\n it('handles repetitions', () => {\n const input = {a1: 4, a2: 4, b1: 5, b2: 5};\n const result = deepMap(input, transform);\n expect(result).toEqual({\n a1: ['an array representing', 'four'],\n a2: ['an array representing', 'four'],\n b1: {five: 'I am a dict'},\n b2: {five: 'I am a dict'}\n });\n const b1Mapped = result.b1;\n const b2Mapped = result.b2;\n expect(b2Mapped).toBe(b1Mapped);\n });\n it('detects and rejects cycles', () => {\n // tslint:disable-next-line:no-any\n const b: any[] = [2, 3, null, {ba: 0, bb: 'world'}];\n const c = {a: 'hello', b};\n b[4] = c;\n const input = [b, c];\n expect(() => deepMap(input, transform)).toThrowError();\n });\n});\n\ndescribe('asyncDeepMap', () => {\n it('Maps single mappable objects', async () => {\n expect(await deepMapAndAwaitAll(null, asyncTransform)).toEqual(null);\n expect(await deepMapAndAwaitAll(1, asyncTransform)).toEqual('one');\n expect(await deepMapAndAwaitAll(3, asyncTransform)).toEqual('three');\n expect(await deepMapAndAwaitAll('hello', asyncTransform)).toEqual('hello');\n });\n it('Maps arrays of mappable objects', async () => {\n expect(await deepMapAndAwaitAll([null, 1], asyncTransform)).toEqual([\n null, 'one'\n ]);\n expect(await deepMapAndAwaitAll([1, 2, 3], asyncTransform)).toEqual([\n 'one', 'two', 'three'\n ]);\n expect(await deepMapAndAwaitAll([1, 'hello', 3, null], asyncTransform))\n .toEqual(['one', 'hello', 'three', null]);\n });\n it('Maps objects containing mappable fields', async () => {\n expect(await deepMapAndAwaitAll({a: null, b: 1}, asyncTransform))\n .toEqual({a: null, b: 'one'});\n expect(await deepMapAndAwaitAll({a: 1, b: 2, c: 3}, asyncTransform))\n .toEqual({a: 'one', b: 'two', c: 'three'});\n expect(await deepMapAndAwaitAll(\n {a: 1, b: 'hello', c: 3, d: null}, asyncTransform))\n .toEqual({a: 'one', b: 'hello', c: 'three', d: null});\n });\n it('Maps nested structures containing mappable fields', async () => {\n const input = {a: 'hello', b: [2, 3, null, {ba: 0, bb: 'world'}]};\n const expected = {\n a: 'hello',\n b: ['two', 'three', null, {ba: 'zero', bb: 'world'}]\n };\n expect(await deepMapAndAwaitAll(input, asyncTransform)).toEqual(expected);\n });\n it('maps elements that produce arrays or objects', async () => {\n const input = {a: 'hello', b: [2, 4, null, {ba: 5, bb: 'world'}]};\n const expected = {\n a: 'hello',\n b: [\n 'two', ['an array representing', 'four'], null,\n {ba: {five: 'I am a dict'}, bb: 'world'}\n ]\n };\n expect(await deepMapAndAwaitAll(input, asyncTransform)).toEqual(expected);\n });\n it('handles repetitions', async () => {\n const input = {a1: 4, a2: 4, b1: 5, b2: 5};\n const result = await deepMapAndAwaitAll(input, asyncTransform);\n expect(result).toEqual({\n a1: ['an array representing', 'four'],\n a2: ['an array representing', 'four'],\n b1: {five: 'I am a dict'},\n b2: {five: 'I am a dict'}\n });\n const b1Mapped = result.b1;\n const b2Mapped = result.b2;\n expect(b2Mapped).toBe(b1Mapped);\n });\n it('detects and rejects cycles', async done => {\n try {\n // tslint:disable-next-line:no-any\n const b: any[] = [2, 3, null, {ba: 0, bb: 'world'}];\n const c = {a: 'hello', b};\n b[4] = c;\n const input = [b, c];\n await deepMapAndAwaitAll(input, asyncTransform);\n done.fail();\n } catch (e) {\n expect(e.message).toBe('Circular references are not supported.');\n done();\n }\n });\n});\n\ndescribe('deepZip', () => {\n it('zips arrays of primitives', () => {\n expect(deepZip([1, 2, 3])).toEqual([1, 2, 3]);\n expect(deepZip([null, 1])).toEqual([null, 1]);\n expect(deepZip([1, 'hello', 3, null])).toEqual([1, 'hello', 3, null]);\n });\n it('zips objects containing simple fields', () => {\n expect(deepZip([\n {a: 1, b: 2}, {a: 3, b: 4}\n ])).toEqual({a: [1, 3], b: [2, 4]});\n expect(deepZip([\n {a: 1, b: 'hello', c: 4, d: null}, {a: 2, b: 'world', c: 5, d: 7},\n {a: 3, b: '!', c: 6, d: null}\n ])).toEqual({\n a: [1, 2, 3],\n b: ['hello', 'world', '!'],\n c: [4, 5, 6],\n d: [null, 7, null]\n });\n });\n it('zips arrays containing simple fields', () => {\n expect(deepZip([[1, 2], [3, 4]])).toEqual([[1, 3], [2, 4]]);\n });\n it('zips nested structures', () => {\n const input = [\n {a: 'plums', b: [1, 2, null, {ba: 3, bb: 'sweet'}]},\n {a: 'icebox', b: [3, 4, 5, {ba: 6, bb: 'cold'}]}\n ];\n const expected = {\n a: ['plums', 'icebox'],\n b: [[1, 3], [2, 4], [null, 5], {ba: [3, 6], bb: ['sweet', 'cold']}]\n };\n expect(deepZip(input)).toEqual(expected);\n });\n it('detects and rejects cycles', () => {\n // tslint:disable-next-line:no-any\n const b: any[] = [2, 3, null, {ba: 0, bb: 'world'}];\n const c = {a: 'hello', b};\n b[4] = c;\n const input = [b, c];\n expect(() => deepZip(input)).toThrowError();\n });\n\n describe('canTensorify', () => {\n it('returns true for primitives', () => {\n expect(canTensorify('a')).toBeTruthy();\n expect(canTensorify(1)).toBeTruthy();\n expect(canTensorify(true)).toBeTruthy();\n });\n\n it('returns true for arrays', () => {\n expect(canTensorify(['a', 'b', 'c'])).toBeTruthy();\n expect(canTensorify([1, 2, 3])).toBeTruthy();\n expect(canTensorify([true, false, true])).toBeTruthy();\n });\n\n it('returns true for TypedArrays', () => {\n expect(canTensorify(new Float32Array([1, 2, 3]))).toBeTruthy();\n expect(canTensorify(new Int32Array([1, 2, 3]))).toBeTruthy();\n });\n\n it('returns true for Tensors', () => {\n expect(canTensorify(tf.tensor([1, 2, 3]))).toBeTruthy();\n });\n\n it('returns false for non-Tensor objects', () => {\n expect(canTensorify({a: 1, b: 2, c: 3})).toBeFalsy();\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/util/growing_ring_buffer.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.d.ts deleted file mode 100644 index 28dfdc533..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.d.ts +++ /dev/null @@ -1,32 +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 { RingBuffer } from './ring_buffer'; -export declare class GrowingRingBuffer extends RingBuffer { - private static INITIAL_CAPACITY; - /** - * Constructs a `GrowingRingBuffer`. - */ - constructor(); - isFull(): boolean; - push(value: T): void; - unshift(value: T): void; - /** - * Doubles the capacity of the buffer. - */ - private expand; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js deleted file mode 100644 index d75064c67..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js +++ /dev/null @@ -1,61 +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 { RingBuffer } from './ring_buffer'; -export 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; -//# sourceMappingURL=growing_ring_buffer.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/util/growing_ring_buffer.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js.map deleted file mode 100644 index f8d0d4bef..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"growing_ring_buffer.js","sourceRoot":"","sources":["../../src/util/growing_ring_buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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AAG,GAAG,CAAC;IACjB,CAAC;;AA9Cc,kCAAgB,GAAG,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 */\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"]} \ 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/util/ring_buffer.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.d.ts deleted file mode 100644 index f585a8f3e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.d.ts +++ /dev/null @@ -1,84 +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. - * - * ============================================================================= - */ -/** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ -export declare class RingBuffer { - capacity: number; - protected begin: number; - protected end: number; - protected doubledCapacity: number; - protected data: T[]; - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - constructor(capacity: number); - /** - * Map any index into the range 0 <= index < 2*capacity. - */ - protected wrap(index: number): number; - protected get(index: number): T; - protected set(index: number, value: T): void; - /** - * Returns the current number of items in the buffer. - */ - length(): number; - /** - * Reports whether the buffer is full. - * @returns true if the number of items in the buffer equals its capacity, and - * false otherwise. - */ - isFull(): boolean; - /** - * Reports whether the buffer is empty. - * @returns true if the number of items in the buffer equals zero, and - * false otherwise. - */ - isEmpty(): boolean; - /** - * Adds an item to the end of the buffer. - */ - push(value: T): void; - /** - * Adds many items to the end of the buffer, in order. - */ - pushAll(values: T[]): void; - /** - * Removes and returns the last item in the buffer. - */ - pop(): T; - /** - * Adds an item to the beginning of the buffer. - */ - unshift(value: T): void; - /** - * Removes and returns the first item in the buffer. - */ - shift(): T; - /** - * 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: number): T; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js deleted file mode 100644 index 1a7d91176..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js +++ /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. - * - * ============================================================================= - */ -/** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ -export 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; - } -} -//# sourceMappingURL=ring_buffer.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/util/ring_buffer.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js.map deleted file mode 100644 index e0df054ef..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ring_buffer.js","sourceRoot":"","sources":["../../src/util/ring_buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,OAAO,UAAU;IAUrB;;;OAGG;IACH,YAAmB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;QAbnC,kEAAkE;QAClE,8DAA8D;QAC9D,qEAAqE;QAC3D,UAAK,GAAG,CAAC,CAAC,CAAE,YAAY;QACxB,QAAG,GAAG,CAAC,CAAC,CAAI,YAAY;QAUhC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,MAAM,IAAI,UAAU,CAAC,kDAAkD,CAAC,CAAC;SAC1E;QACD,IAAI,QAAQ,GAAG,CAAC,EAAE;YAChB,MAAM,IAAI,UAAU,CAAC,4CAA4C,CAAC,CAAC;SACpE;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,KAAK,CAAI,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,CAAC,GAAG,QAAQ,CAAC;IACtC,CAAC;IAED;;OAEG;IACO,IAAI,CAAC,KAAa;QAC1B,oCAAoC;QACpC,OAAO,KAAK,GAAG,CAAC,EAAE;YAChB,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC;SAC/B;QACD,OAAO,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;IACtC,CAAC;IAES,GAAG,CAAC,KAAa;QACzB,IAAI,KAAK,GAAG,CAAC,EAAE;YACb,MAAM,IA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I,UAAU,CAAC,uBAAuB,CAAC,CAAC;SAC/C;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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\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"]} \ 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/util/ring_buffer_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer_test.js.map deleted file mode 100644 index ad3a5ee4f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ring_buffer_test.js","sourceRoot":"","sources":["../../src/util/ring_buffer_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAS,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;YAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACd;QACD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAElC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,KAAK,IAAI,CAA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AE,GAAG,EAAE;QAC1C,MAAM,IAAI,GAAG,IAAI,UAAU,CAAS,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAEjC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnD,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 */\n\nimport {RingBuffer} from './ring_buffer';\n\ndescribe('RingBuffer', () => {\n it('Works as a stack (LIFO)', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.push(i);\n }\n expect(ring.length()).toEqual(10);\n\n const result: number[] = [];\n for (let i = 0; i < 10; i++) {\n result[i] = ring.pop();\n }\n expect(result).toEqual([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]);\n expect(ring.length()).toEqual(0);\n });\n\n it('Works as a queue (FIFO)', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.push(i);\n }\n expect(ring.length()).toEqual(10);\n\n const result: number[] = [];\n for (let i = 0; i < 7; i++) {\n result[i] = ring.shift();\n }\n expect(result).toEqual([0, 1, 2, 3, 4, 5, 6]);\n expect(ring.length()).toEqual(3);\n\n // test wrapping\n for (let i = 10; i < 15; i++) {\n ring.push(i);\n }\n expect(ring.length()).toEqual(8);\n\n const result2: number[] = [];\n for (let i = 0; i < 8; i++) {\n result2[i] = ring.shift();\n }\n expect(result2).toEqual([7, 8, 9, 10, 11, 12, 13, 14]);\n expect(ring.length()).toEqual(0);\n });\n\n it('Works as a reverse stack (LIFO)', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.unshift(i);\n }\n expect(ring.length()).toEqual(10);\n\n const result: number[] = [];\n for (let i = 0; i < 10; i++) {\n result[i] = ring.shift();\n }\n expect(result).toEqual([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]);\n expect(ring.length()).toEqual(0);\n });\n\n it('Works as a reverse queue (FIFO)', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.unshift(i);\n }\n expect(ring.length()).toEqual(10);\n\n const result: number[] = [];\n for (let i = 0; i < 10; i++) {\n result[i] = ring.pop();\n }\n expect(result).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);\n expect(ring.length()).toEqual(0);\n });\n\n it('Works as a shuffling queue', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.push(i);\n }\n expect(ring.length()).toEqual(10);\n\n expect(ring.shuffleExcise(3)).toEqual(3);\n expect(ring.shuffleExcise(6)).toEqual(6);\n\n const result: number[] = [];\n for (let i = 0; i < 8; i++) {\n result[i] = ring.shift();\n }\n // note how position 3 got the last element (9) and position 6 got the\n // next-to-last element(8).\n expect(result).toEqual([0, 1, 2, 9, 4, 5, 8, 7]);\n expect(ring.length()).toEqual(0);\n });\n\n it('Throws error on push over capacity', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.push(i);\n }\n expect(() => ring.push(10)).toThrowError(/full/);\n });\n\n it('Throws error on pop when empty', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n expect(() => ring.pop()).toThrowError(/empty/);\n });\n\n it('Throws error on unshift over capacity', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n for (let i = 0; i < 10; i++) {\n ring.unshift(i);\n }\n expect(() => ring.unshift(10)).toThrowError(/full/);\n });\n\n it('Throws error on shift when empty', () => {\n const ring = new RingBuffer(10);\n expect(ring.length()).toEqual(0);\n\n expect(() => ring.shift()).toThrowError(/empty/);\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/util/source_util.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.d.ts deleted file mode 100644 index c38f7e342..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.d.ts +++ /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. - * - * ============================================================================= - */ -export declare function isLocalPath(source: any): boolean; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js deleted file mode 100644 index 4d817775a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.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. - * - * ============================================================================= - */ -// Skip tslint any type check cause this method is aiming to check type of -// input. -// tslint:disable-next-line:no-any -export function isLocalPath(source) { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; -} -//# sourceMappingURL=source_util.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/util/source_util.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js.map deleted file mode 100644 index e24a78ac6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source_util.js","sourceRoot":"","sources":["../../src/util/source_util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,0EAA0E;AAC1E,SAAS;AACT,kCAAkC;AAClC,MAAM,UAAU,WAAW,CAAC,MAAW;IACrC,OAAO,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;AAC3E,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\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"]} \ 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/util/source_util_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util_test.js.map deleted file mode 100644 index 281825417..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/source_util_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source_util_test.js","sourceRoot":"","sources":["../../src/util/source_util_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,MAAM,aAAa,GAAG,iBAAiB,CAAC;AACxC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAEtE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;IAC7B,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 */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {isLocalPath} from './source_util';\n\nconst nonPathString = 'iamnotlocalpath';\nconst testData = env().get('IS_BROWSER') ? new Blob([nonPathString]) :\n Buffer.from(nonPathString);\n\ndescribe('source_util', () => {\n it('returns true if it is local path', () => {\n const result = isLocalPath('file://testfile');\n expect(result).toBeTruthy();\n });\n\n it('returns false if it is not local path', () => {\n const result = isLocalPath(nonPathString);\n expect(result).toBeFalsy();\n });\n\n it('returns false if it is not string type', () => {\n const result = isLocalPath(testData);\n expect(result).toBeFalsy();\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/util/test_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.d.ts deleted file mode 100644 index 08c435935..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.d.ts +++ /dev/null @@ -1,51 +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. - * - * ============================================================================= - */ -export declare function setupFakeVideoStream(): void; -export declare function replaceHTMLVideoElementSource(videoElement: HTMLVideoElement): Promise; -export declare function describeAllEnvs(testName: string, tests: () => void): void; -export declare function describeBrowserEnvs(testName: string, tests: () => void): void; -export declare function describeNodeEnvs(testName: string, tests: () => void): void; -/** - * Testing Utilities for browser audeo stream. - */ -export declare function setupFakeAudeoStream(): void; -export declare class FakeAudioContext { - readonly sampleRate = 44100; - static createInstance(): FakeAudioContext; - createMediaStreamSource(): FakeMediaStreamAudioSourceNode; - createAnalyser(): FakeAnalyser; - close(): void; -} -export declare class FakeAudioMediaStream { - constructor(); - getTracks(): Array<{}>; -} -declare class FakeMediaStreamAudioSourceNode { - constructor(); - connect(node: {}): void; -} -declare class FakeAnalyser { - fftSize: number; - smoothingTimeConstant: number; - private x; - constructor(); - getFloatFrequencyData(data: Float32Array): void; - getFloatTimeDomainData(data: Float32Array): void; - disconnect(): void; -} -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.js.map deleted file mode 100644 index 93f20df35..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/util/test_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test_utils.js","sourceRoot":"","sources":["../../src/util/test_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,iDAAiD;AACjD,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAC,MAAM,yCAAyC,CAAC;AAE9H,4BAA4B;AAC5B,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,GAAG,CAAC;IAClB,MAAM,MAAM,GAAG,GAAG,CAAC;IACnB,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3C,GAAG,CAAC,SAAS,GAAG,YAAY,CAAC;IAC7B,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClC,kCAAkC;IAClC,MAAM,MAAM,GAAI,aAAqB,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACxD,SAAS,CAAC,YAAY,CAAC,YAAY,GAAG,KAAK,IAAI,EAAE;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAC/C,YAA8B;IAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,iCAAiC;IACjC,MAAM,CAAC,GAA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,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;YACzC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACtB;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,UAAU,KAAU,CAAC;CACtB","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 */\n\n// tslint:disable-next-line: no-imports-from-dist\nimport {ALL_ENVS, BROWSER_ENVS, describeWithFlags, NODE_ENVS, registerTestEnv} from '@tensorflow/tfjs-core/dist/jasmine_util';\n\n// Provide fake video stream\nexport function setupFakeVideoStream() {\n const width = 100;\n const height = 200;\n const canvasElement = document.createElement('canvas');\n const ctx = canvasElement.getContext('2d');\n ctx.fillStyle = 'rgb(1,2,3)';\n ctx.fillRect(0, 0, width, height);\n // tslint:disable-next-line:no-any\n const stream = (canvasElement as any).captureStream(60);\n navigator.mediaDevices.getUserMedia = async () => {\n return stream;\n };\n}\n\nexport async function replaceHTMLVideoElementSource(\n videoElement: HTMLVideoElement) {\n const source = document.createElement('source');\n // tslint:disable:max-line-length\n source.src =\n 'data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAu1tZGF0AAACrQYF//+p3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE1NSByMjkwMSA3ZDBmZjIyIC0gS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AAAAAAAAAAAAAIAAAIYdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAPoAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAACgAAAAWgAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAD6AAAAAAAAQAAAAABkG1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAQAAAAEAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAATttaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAD7c3RibAAAAJdzdHNkAAAAAAAAAAEAAACHYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAACgAFoASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADFhdmNDAWQACv/hABhnZAAKrNlCjfkhAAADAAEAAAMAAg8SJZYBAAZo6+JLIsAAAAAYc3R0cwAAAAAAAAABAAAAAQAAQAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAC5QAAAAEAAAAUc3RjbwAAAAAAAAABAAAAMAAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTguMTIuMTAw';\n source.type = 'video/mp4';\n videoElement.srcObject = null;\n videoElement.appendChild(source);\n videoElement.play();\n\n if (videoElement.readyState < 2) {\n await new Promise(resolve => {\n videoElement.addEventListener('loadeddata', () => resolve());\n });\n }\n}\n\n// Register backends.\nregisterTestEnv({name: 'cpu', backendName: 'cpu'});\nregisterTestEnv({\n name: 'webgl2',\n backendName: 'webgl',\n flags: {\n 'WEBGL_VERSION': 2,\n 'WEBGL_CPU_FORWARD': false,\n 'WEBGL_SIZE_UPLOAD_UNIFORM': 0\n }\n});\n\nexport function describeAllEnvs(testName: string, tests: () => void) {\n describeWithFlags(testName, ALL_ENVS, () => {\n tests();\n });\n}\n\nexport function describeBrowserEnvs(testName: string, tests: () => void) {\n describeWithFlags(testName, BROWSER_ENVS, () => {\n tests();\n });\n}\n\nexport function describeNodeEnvs(testName: string, tests: () => void) {\n describeWithFlags(testName, NODE_ENVS, () => {\n tests();\n });\n}\n\n/**\n * Testing Utilities for browser audeo stream.\n */\nexport function setupFakeAudeoStream() {\n navigator.mediaDevices.getUserMedia = async () => {\n const stream = new MediaStream();\n return stream;\n };\n // tslint:disable-next-line:no-any\n (window as any).AudioContext = FakeAudioContext.createInstance;\n}\n\nexport class FakeAudioContext {\n readonly sampleRate = 44100;\n\n static createInstance() {\n return new FakeAudioContext();\n }\n\n createMediaStreamSource() {\n return new FakeMediaStreamAudioSourceNode();\n }\n\n createAnalyser() {\n return new FakeAnalyser();\n }\n\n close(): void {}\n}\n\nexport class FakeAudioMediaStream {\n constructor() {}\n getTracks(): Array<{}> {\n return [];\n }\n}\n\nclass FakeMediaStreamAudioSourceNode {\n constructor() {}\n connect(node: {}): void {}\n}\n\nclass FakeAnalyser {\n fftSize: number;\n smoothingTimeConstant: number;\n private x: number;\n constructor() {\n this.x = 0;\n }\n\n getFloatFrequencyData(data: Float32Array): void {\n const xs: number[] = [];\n for (let i = 0; i < this.fftSize / 2; ++i) {\n xs.push(this.x++);\n }\n data.set(new Float32Array(xs));\n }\n\n getFloatTimeDomainData(data: Float32Array): void {\n const xs: number[] = [];\n for (let i = 0; i < this.fftSize / 2; ++i) {\n xs.push(-(this.x++));\n }\n data.set(new Float32Array(xs));\n }\n\n disconnect(): void {}\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.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js deleted file mode 100644 index a02ce6909..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; -export { version }; -//# sourceMappingURL=version.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/version.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js.map deleted file mode 100644 index 4e5822fb5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,wDAAwD;AACxD,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,OAAO,EAAC,OAAO,EAAC,CAAC","sourcesContent":["/** @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"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/dataset.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/dataset.ts deleted file mode 100644 index 65a43b5cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/dataset.ts +++ /dev/null @@ -1,705 +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, TensorLike} from '@tensorflow/tfjs-core'; -import * as seedrandom from 'seedrandom'; - -import {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator'; -import {Container} from './types'; -import {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map'; - -/** - * A nested structure of Datasets, used as the input to zip(). - */ -export type DatasetContainer = Container>; - -// 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 abstract class Dataset { - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - * - * CAUTION: Any Tensors contained within the elements returned from - * this stream *must* be manually disposed to avoid a GPU memory leak. - * The tf.tidy() approach cannot be used in an asynchronous context. - */ - abstract async iterator(): Promise>; - - readonly size: number = 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: number, smallLastBatch = true): Dataset { - 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: Dataset): 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: (value: T) => boolean): Dataset { - 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: (input: T) => void): Promise { - 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: (value: T) => O): Dataset { - 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: (value: T) => Promise): - Dataset { - 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: number): Dataset { - 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?: number): Dataset { - 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: number): Dataset { - 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); - } - - // TODO(soergel): deep sharded shuffle, where supported - - 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 = true): - Dataset { - 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: number): Dataset { - 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(); - } -} - -/** - * 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: () => Promise>, - size: number = null): Dataset { - return new class extends Dataset { - size = size; - - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - async iterator(): Promise> { - 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: T[]): Dataset { - 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: DatasetContainer): - Dataset { - // 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] as Dataset).size : - Math.min(size, (datasets[i] as Dataset).size); - } - } else if (datasets instanceof Object) { - for (const ds in datasets) { - size = size == null ? (datasets[ds] as Dataset).size : - Math.min(size, (datasets[ds] as Dataset).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: any[]): DeepMapResult { - 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: T[]): - tf.Tensor { - 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 as tf.Tensor[]); - } else { - // Input is a possibly-nested array of numbers. - return tf.tensor(arrays as TensorLike); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts deleted file mode 100644 index 8cc1276d6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts +++ /dev/null @@ -1,396 +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, util} from '@tensorflow/tfjs-core'; -import {Dataset} from '../dataset'; -import {DataSource} from '../datasource'; -import {LazyIterator} from '../iterators/lazy_iterator'; -import {ColumnConfig, CSVConfig} from '../types'; -import {TextLineDataset} from './text_line_dataset'; - -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'} - */ -export class CSVDataset extends Dataset { - base: TextLineDataset; - private hasHeader = true; - private fullColumnNames: string[] = null; - private columnNamesValidated = false; - private columnConfigs: {[key: string]: ColumnConfig} = null; - private configuredColumnsOnly = false; - private delimiter = ','; - private delimWhitespace = false; - - /** - * 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`. - */ - private 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: {[key: string]: number} = this.fullColumnNames.reduce( - (countAcc: {[key: string]: number}, 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; - } - - private 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: string = firstElement.value; - const headers = this.parseRow(firstLine, false); - return headers; - } else { - return null; - } - } - - /** - * 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(protected readonly input: DataSource, csvConfig?: CSVConfig) { - super(); - 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 : ','; - } - } - - async iterator(): Promise> { - 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: string): TensorContainer { - const values = this.parseRow(line); - const features: {[key: string]: TensorContainer} = {}; - const labels: {[key: string]: TensorContainer} = {}; - - 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}; - } - } - - private getBoolean(value: string): number { - if (value === '1' || value.toLowerCase() === 'true') { - return 1; - } else { - return 0; - } - } - - // adapted from https://beta.observablehq.com/@mbostock/streaming-csv - private parseRow(line: string, validateElementCount = true): string[] { - const result: string[] = []; - 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; - default: - } - 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; - default: - } - 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; - default: - } - break; - default: - } - } - // 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() diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts deleted file mode 100644 index 62b5e5396..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts +++ /dev/null @@ -1,50 +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 {Dataset} from '../dataset'; -import {DataSource} from '../datasource'; -import {LazyIterator} from '../iterators/lazy_iterator'; - -/** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ -export class TextLineDataset extends Dataset { - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - constructor(protected readonly input: DataSource) { - super(); - } - - async iterator(): Promise> { - 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; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasource.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasource.ts deleted file mode 100644 index 39d36fe3e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/datasource.ts +++ /dev/null @@ -1,42 +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 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 async iterator(): Promise; - - // TODO(soergel): consider chainable Dataset construction here -} - -// TODO(soergel): consider convenience factory functions here -// in combination with chainable source->dataset above, e.g.: -// tf.data.url(...).asCsvDataset().shuffle().batch() diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/index.ts deleted file mode 100644 index 540e441fb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/index.ts +++ /dev/null @@ -1,25 +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/src/iterators/byte_chunk_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts deleted file mode 100644 index 8de22ed37..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts +++ /dev/null @@ -1,126 +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 {env} from '@tensorflow/tfjs-core'; -import {LazyIterator, OneToManyIterator} from './lazy_iterator'; -import {StringIterator} from './string_iterator'; - -export abstract 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(): StringIterator { - 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 { - private impl: Utf8IteratorImpl; - - constructor(protected upstream: LazyIterator) { - super(); - 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 { - // `decoder` as `any` here to dynamically assign value based on the - // environment. - // tslint:disable-next-line:no-any - decoder: any; - - constructor(protected readonly upstream: LazyIterator) { - super(); - 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(): Promise { - const chunkResult = await this.upstream.next(); - let chunk; - if (chunkResult.done) { - return false; - } else { - chunk = chunkResult.value; - } - - let text: string; - 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; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts deleted file mode 100644 index 865c07217..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts +++ /dev/null @@ -1,110 +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. - * - * ============================================================================= - */ - -// inspired by https://github.com/maxogden/filereader-stream -import {env, util} from '@tensorflow/tfjs-core'; -import {FileElement} from '../types'; -import {ByteChunkIterator} from './byte_chunk_iterator'; - -export interface FileChunkIteratorOptions { - /** The byte offset at which to begin reading the File or Blob. Default 0. */ - offset?: number; - /** The number of bytes to read at a time. Default 1MB. */ - chunkSize?: number; -} - -/** - * 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. - */ -export class FileChunkIterator extends ByteChunkIterator { - offset: number; - chunkSize: number; - - constructor( - protected file: FileElement, - protected options: FileChunkIteratorOptions = {}) { - super(); - 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(): Promise> { - 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: string|ArrayBuffer|Uint8Array = 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}; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts deleted file mode 100644 index 99978f2b1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts +++ /dev/null @@ -1,1190 +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 {Container} from '../types'; -import {deepClone} from '../util/deep_clone'; -import {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map'; -import {GrowingRingBuffer} from '../util/growing_ring_buffer'; -import {RingBuffer} from '../util/ring_buffer'; - -/** - * A nested structure of LazyIterators, used as the input to zip(). - */ -export type IteratorContainer = Container>; - -// 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. - */ -export function iteratorFromItems(items: T[]): LazyIterator { - return new ArrayIterator(items); -} - -/** - * Create a `LazyIterator` of incrementing integers. - */ -export function iteratorFromIncrementing(start: number): LazyIterator { - let i = start; - return iteratorFromFunction(() => ({value: i++, done: false})); -} - -/** - * 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. - */ -export function iteratorFromFunction( - func: () => - IteratorResult| Promise>): LazyIterator { - 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. - */ -export function iteratorFromConcatenated( - baseIterators: LazyIterator>, - baseErrorHandler?: (e: Error) => boolean): LazyIterator { - return new ChainedIterator(baseIterators, baseErrorHandler); -} - -/** - * Create a `LazyIterator` by concatenating streams produced by calling a - * stream-generating function a given number of times. - * - * Since a `LazyIterator` is read-once, it cannot be repeated, but this - * function can be used to achieve a similar effect: - * - * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6); - * - * @param iteratorFunc: A function that produces a new stream on each call. - * @param count: The number of times to call the function. - * @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. - */ -export function iteratorFromConcatenatedFunction( - iteratorFunc: () => IteratorResult>, count: number, - baseErrorHandler?: (e: Error) => boolean): LazyIterator { - return iteratorFromConcatenated( - iteratorFromFunction(iteratorFunc).take(count), 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. - */ -export function iteratorFromZipped( - iterators: IteratorContainer, - mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator { - 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();` - */ -export abstract class LazyIterator { - // This class implements AsyncIterator, but we have not yet set the - // TypeScript --downlevelIteration flag to enable that. - - abstract summary(): string; - - /** - * Returns a `Promise` for the next element in the stream. - * - * When an item can be provided successfully, the return value is - * `{value:T, done:false}`. - * - * Calling next() on a closed stream returns `{value:null, done:true}`. - */ - abstract async next(): Promise>; - - /** - * 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(): Promise { - const result: T[] = []; - 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(): Promise { - const stream = this.prefetch(100); - const result: T[] = []; - 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(): Promise { - 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: (r: T) => boolean): Promise { - 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: (error: Error) => boolean): LazyIterator { - 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: (value: T) => boolean): LazyIterator { - 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: (value: T) => O): LazyIterator { - 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: (value: T) => Promise): LazyIterator { - 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: (value: T) => Promise): LazyIterator { - 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: (value: T) => O[]): LazyIterator { - 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: (value: T) => void): Promise { - 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: (value: T) => Promise): Promise { - 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: number, smallLastBatch = true): LazyIterator { - 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: number, smallLastBatch = true, - // tslint:disable-next-line:no-any - zipFn: (xs: any[]) => DeepMapResult = zipToList): - LazyIterator { - // 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: LazyIterator, - baseErrorHandler?: (e: Error) => boolean): LazyIterator { - 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: number): LazyIterator { - 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: number): LazyIterator { - 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: number): LazyIterator { - 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: number, seed?: string): LazyIterator { - 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(): LazyIterator { - 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 { - private trav = 0; - constructor(protected items: T[]) { - super(); - } - - summary() { - return `Array of ${this.items.length} items`; - } - - async next(): Promise> { - 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( - protected nextFn: () => IteratorResult| Promise>) { - super(); - } - - summary() { - return `Function call`; - } - - async next(): Promise> { - 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 { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - constructor(protected upstream: LazyIterator) { - super(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - summary() { - return `${this.upstream.summary()} -> Serial`; - } - - async next(): Promise> { - // 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; - } - - private async serialNext(): Promise> { - return this.upstream.next(); - } -} - -class SkipIterator extends LazyIterator { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - // Local state that should not be clobbered by out-of-order execution. - count = 0; - - constructor(protected upstream: LazyIterator, protected maxCount: number) { - super(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - summary() { - return `${this.upstream.summary()} -> Skip`; - } - - async next(): Promise> { - // 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; - } - - private async serialNext(): Promise> { - // 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 as {}); - } - return this.upstream.next(); - } -} - -class TakeIterator extends LazyIterator { - count = 0; - constructor(protected upstream: LazyIterator, protected maxCount: number) { - super(); - } - - summary() { - return `${this.upstream.summary()} -> Take`; - } - - async next(): Promise> { - 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 { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - constructor( - protected upstream: LazyIterator, protected batchSize: number, - protected enableSmallLastBatch = true) { - super(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - summary() { - return `${this.upstream.summary()} -> RowMajorBatch`; - } - - async next(): Promise> { - // 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; - } - - private async serialNext(): Promise> { - const batch: T[] = []; - 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 { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - constructor( - protected upstream: LazyIterator, - protected predicate: (value: T) => boolean) { - super(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - summary() { - return `${this.upstream.summary()} -> Filter`; - } - - async next(): Promise> { - // 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; - } - - private async serialNext(): Promise> { - while (true) { - const item = await this.upstream.next(); - if (item.done || this.predicate(item.value)) { - return item; - } - tf.dispose(item.value as {}); - } - } -} - -class MapIterator extends LazyIterator { - constructor( - protected upstream: LazyIterator, - protected transform: (value: I) => O) { - super(); - } - - summary() { - return `${this.upstream.summary()} -> Map`; - } - - async next(): Promise> { - const item = await this.upstream.next(); - if (item.done) { - return {value: null, done: true}; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {}); - // 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 as {}); - - // 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 { - count = 0; - constructor( - protected upstream: LazyIterator, - protected handler: (error: Error) => boolean) { - super(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - summary() { - return `${this.upstream.summary()} -> handleErrors`; - } - - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - async next(): Promise> { - // 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(): Promise> { - 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( - protected upstream: LazyIterator, - protected transform: (value: I) => Promise) { - super(); - } - - summary() { - return `${this.upstream.summary()} -> AsyncMap`; - } - - async next(): Promise> { - const item = await this.upstream.next(); - if (item.done) { - return {value: null, done: true}; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {}); - // 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 as {}); - - // 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. - */ -export abstract class OneToManyIterator extends LazyIterator { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - // Local state that should not be clobbered by out-of-order execution. - protected outputQueue: RingBuffer; - - constructor() { - super(); - this.outputQueue = new GrowingRingBuffer(); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - async next(): Promise> { - // 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; - } - - /** - * Read one or more chunks from upstream and process them, possibly - * reading or writing a carryover, and adding processed items to the - * output queue. Note it's possible that no items are added to the queue - * on a given pump() call, even if the upstream stream is not closed - * (e.g., because items are filtered). - * - * @return `true` if any action was taken, i.e. fetching items from the - * upstream source OR adding items to the output queue. `false` if the - * upstream source is exhausted AND nothing was added to the queue - * (i.e., any remaining carryover). - */ - protected abstract async pump(): Promise; - - async serialNext(): Promise> { - // 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( - protected upstream: LazyIterator, - protected transform: (value: I) => O[]) { - super(); - } - - summary() { - return `${this.upstream.summary()} -> Flatmap`; - } - - async pump(): Promise { - const item = await this.upstream.next(); - if (item.done) { - return false; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {}); - // 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 as {}); - 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. - */ -export class ChainedIterator extends LazyIterator { - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise> = null; - - // Local state that should not be clobbered by out-of-order execution. - private iterator: LazyIterator = null; - private moreIterators: LazyIterator>; - - constructor( - iterators: LazyIterator>, - private readonly baseErrorHandler?: (e: Error) => boolean) { - super(); - this.moreIterators = iterators; - } - - summary() { - const upstreamSummaries = 'TODO: fill in upstream of chained summaries'; - return `${upstreamSummaries} -> Chained`; - } - - async next(): Promise> { - this.lastRead = this.readFromChain(this.lastRead); - return this.lastRead; - } - - private async readFromChain(lastRead: Promise>): - Promise> { - // 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; - } -} - -export enum ZipMismatchMode { - FAIL, // require zipped streams to have the same length - SHORTEST, // terminate zip when the first stream is exhausted - LONGEST // use nulls for exhausted streams; use up the longest stream. -} - -/** - * 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 { - private count = 0; - private currentPromise: Promise> = null; - - constructor( - protected readonly iterators: IteratorContainer, - protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) { - super(); - } - - summary() { - const upstreamSummaries = 'TODO: fill in upstream of zip summaries'; - return `{${upstreamSummaries}} -> Zip`; - } - - private async nextState(afterState: Promise>): - Promise> { - // 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: IteratorContainer): DeepMapAsyncResult { - 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: O = 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: - default: - // Continue. The exhausted streams already produced value: null. - } - } - - this.count++; - return {value: mapped, done: false}; - } - - async next(): Promise> { - 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. - */ -export class PrefetchIterator extends LazyIterator { - protected buffer: RingBuffer>>; - - constructor( - protected upstream: LazyIterator, protected bufferSize: number) { - super(); - 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. - */ - protected refill() { - while (!this.buffer.isFull()) { - const v = this.upstream.next(); - this.buffer.push(v); - } - } - - next(): Promise> { - 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. - */ -export class ShuffleIterator extends PrefetchIterator { - private readonly random: seedrandom.prng; - - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - private lastRead: Promise>; - - // Local state that should not be clobbered by out-of-order execution. - private upstreamExhausted = false; - - constructor( - protected upstream: LazyIterator, protected windowSize: number, - seed?: string) { - super(upstream, windowSize); - this.random = seedrandom.alea(seed || tf.util.now().toString()); - this.lastRead = Promise.resolve({value: null, done: false}); - } - - async next(): Promise> { - // 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; - } - - private randomInt(max: number) { - return Math.floor(this.random() * max); - } - - protected chooseIndex(): number { - return this.randomInt(this.buffer.length()); - } - - async serialNext(): Promise> { - // 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}; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts deleted file mode 100644 index a0f553f30..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts +++ /dev/null @@ -1,234 +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, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core'; -import {MicrophoneConfig} from '../types'; -import {LazyIterator} from './lazy_iterator'; - -/** - * 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. - */ -export class MicrophoneIterator extends LazyIterator { - private isClosed = false; - private stream: MediaStream; - private readonly fftSize: number; - private readonly columnTruncateLength: number; - private freqData: Float32Array; - private timeData: Float32Array; - private readonly numFrames: number; - private analyser: AnalyserNode; - private audioContext: AudioContext; - private sampleRateHz: number; - private readonly audioTrackConstraints: MediaTrackConstraints; - private readonly smoothingTimeConstant: number; - private readonly includeSpectrogram: boolean; - private readonly includeWaveform: boolean; - - private constructor(protected readonly microphoneConfig: MicrophoneConfig) { - super(); - 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: 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(): Promise { - 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 as any).AudioContext || (window as any).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(): Promise> { - if (this.isClosed) { - return {value: null, done: true}; - } - - let spectrogramTensor: Tensor; - let waveformTensor: Tensor; - - 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(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> { - return (await this.next()).value as - {spectrogram: Tensor3D, waveform: Tensor2D}; - } - - private async getAudioData(): - Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> { - const freqDataQueue: Float32Array[] = []; - const timeDataQueue: Float32Array[] = []; - 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(): void { - 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(): Promise { - throw new Error('Can not convert infinite audio stream to array.'); - } - - // Return audio sampling rate in Hz - getSampleRate(): number { - return this.sampleRateHz; - } - - private flattenQueue(queue: Float32Array[]): Float32Array { - const frameSize = queue[0].length; - const freqData = new Float32Array(queue.length * frameSize); - queue.forEach((data, i) => freqData.set(data, i * frameSize)); - return freqData; - } - - private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]): - Tensor { - 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); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts deleted file mode 100644 index 7707950ee..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts +++ /dev/null @@ -1,112 +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 {LazyIterator, OneToManyIterator} from './lazy_iterator'; - -export abstract 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: string): StringIterator { - 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 { - private impl: SplitIteratorImpl; - - constructor(protected upstream: LazyIterator, separator: string) { - super(); - this.impl = new SplitIteratorImpl(upstream, separator); - } - - summary() { - return this.impl.summary(); - } - - async next() { - return this.impl.next(); - } -} - -class SplitIteratorImpl extends OneToManyIterator { - // A partial string at the end of an upstream chunk - carryover = ''; - - constructor( - protected upstream: LazyIterator, protected separator: string) { - super(); - } - - summary() { - return `${this.upstream.summary()} -> Split('${this.separator}')`; - } - - async pump(): Promise { - 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; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts deleted file mode 100644 index b5c5bf95d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts +++ /dev/null @@ -1,62 +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 {util} from '@tensorflow/tfjs-core'; -import {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator'; - -/** - * 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. - */ -export async function urlChunkIterator( - url: RequestInfo, options: FileChunkIteratorOptions = {}) { - let urlString; - let requestInit; - if ((typeof url) === 'string') { - urlString = url as string; - } else { - urlString = (url as Request).url; - requestInit = getRequestInitFromRequest(url as Request); - } - 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: 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; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts deleted file mode 100644 index 0c6fa97d0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts +++ /dev/null @@ -1,223 +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 {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core'; -import {WebcamConfig} from '../types'; -import {LazyIterator} from './lazy_iterator'; - -/** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ -export class WebcamIterator extends LazyIterator { - private isClosed = true; - private stream: MediaStream; - private resize = false; - private cropSize: [number, number]; - private cropBox: Tensor2D; - private cropBoxInd: Tensor1D; - - private constructor( - protected readonly webcamVideoElement: HTMLVideoElement, - protected readonly webcamConfig: WebcamConfig) { - super(); - 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?: HTMLVideoElement, webcamConfig: 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(): Promise { - 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(): Promise> { - 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}; - } - } - - private 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: Tensor3D): Tensor3D { - return tidy(() => { - const expandedImage: Tensor4D = 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) as [number, number, number]); - }); - } - - // Capture one frame from the video stream, and extract the value from - // iterator.next() result. - async capture(): Promise { - return (await this.next()).value; - } - - // Stop the video stream and pause webcam iterator. - stop(): void { - 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(): Promise { - throw new Error('Can not convert infinite video stream to array.'); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/readers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/readers.ts deleted file mode 100644 index 995f69dea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/readers.ts +++ /dev/null @@ -1,282 +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, 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'; -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 function csv( - source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset { - 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: () => IteratorResult| Promise>): Dataset { - 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: () => Iterator| Promise>): Dataset { - 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?: HTMLVideoElement, - webcamConfig?: WebcamConfig): Promise { - 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?: MicrophoneConfig): - Promise { - return MicrophoneIterator.create(microphoneConfig); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts deleted file mode 100644 index 598cf5acb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts +++ /dev/null @@ -1,55 +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 {env} from '@tensorflow/tfjs-core'; -import {DataSource} from '../datasource'; -import {ByteChunkIterator} from '../iterators/byte_chunk_iterator'; -import {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator'; -import {FileElement} from '../types'; -import {isLocalPath} from '../util/source_util'; - -/** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ -export 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( - protected input: FileElement|string, - protected readonly options: FileChunkIteratorOptions = {}) { - super(); - } - - async iterator(): Promise { - 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 as string).substr(7)); - } - // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming - // with file in browser. - return new FileChunkIterator(this.input as FileElement, this.options); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts deleted file mode 100644 index 9f8777d60..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts +++ /dev/null @@ -1,55 +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 {DataSource} from '../datasource'; -import {ByteChunkIterator} from '../iterators/byte_chunk_iterator'; -import {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator'; -import {urlChunkIterator} from '../iterators/url_chunk_iterator'; -import {isLocalPath} from '../util/source_util'; -import {FileDataSource} from './file_data_source'; - -/* - * Represents a URL readable as a stream of binary data chunks. - */ -export 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( - protected readonly url: RequestInfo, - protected readonly fileOptions: FileChunkIteratorOptions = {}) { - super(); - } - - // 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(): Promise { - if (isLocalPath(this.url)) { - return (new FileDataSource(this.url as string, this.fileOptions)) - .iterator(); - } else { - return urlChunkIterator(this.url, this.fileOptions); - } - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/statistics.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/statistics.ts deleted file mode 100644 index be08c97cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/statistics.ts +++ /dev/null @@ -1,212 +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'; - -import {Dataset} from './dataset'; - -// TODO(kangyizhang): eliminate the need for ElementArray and TabularRecord, by -// computing stats on nested structures via deepMap/deepZip. - -/** - * 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 type ElementArray = number|number[]|tf.Tensor|string; - -/** - * A map from string keys (aka column names) to values for a single element. - */ -export type TabularRecord = { - [key: string]: ElementArray -}; - -// TODO(kangyizhang): Flesh out collected statistics. -// For numeric columns we should provide mean, stddev, histogram, etc. -// For string columns we should provide a vocabulary (at least, top-k), maybe a -// length histogram, etc. -// Collecting only numeric min and max is just the bare minimum for now. - -/** 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 function scaleTo01(min: number, max: number): (value: ElementArray) => - ElementArray { - const range = max - min; - const minTensor: tf.Tensor = tf.scalar(min); - const rangeTensor: tf.Tensor = tf.scalar(range); - return (value: ElementArray): ElementArray => { - 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: Dataset, sampleSize?: number, - shuffleWindowSize?: number): Promise { - 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: DatasetStatistics = {}; - - 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: NumericColumnStatistics = 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: number; - let recordMax: number; - - // 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: NumericColumnStatistics = result[key]; - if (stat.length === 1) { - stat.variance = NaN; - stat.stddev = NaN; - } - } - return result; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/types.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/types.ts deleted file mode 100644 index 77b1b4114..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/types.ts +++ /dev/null @@ -1,219 +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'; - -// Maybe this should be called 'NestedContainer'-- that's just a bit unwieldy. -export type Container = ContainerObject|ContainerArray; - -export 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 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 { - // A number representing Audio sampling rate in Hz. either 44,100 or 48,000. - // If provided sample rate is not available on the device, it will throw an - // error. Optional, defaults to the sample rate available on device. - sampleRateHz?: 44100|48000; - - // The FFT length of each spectrogram column. A higher value will result in - // more details in the frequency domain but fewer details in the time domain. - // Must be a power of 2 between 2 to 4 and 2 to 14, so one of: 16, 32, 64, - // 128, 256, 512, 1024, 2048, 4096, 8192, and 16384. It will throw an error if - // it is an invalid number.Defaults to 1024. - fftSize?: number; - - // Truncate each spectrogram column at how many frequency points. Each audio - // frame contains fftSize, for example, 1024 samples which covers voice - // frequency from 0 to 22,500 Hz. However, the frequency content relevant to - // human speech is generally in the frequency range from 0 to 5000 Hz. So each - // audio frame only need 232 columns to cover the frequency range of human - // voice. This will be part of the output spectrogram tensor shape. Optional, - // defaults to null which means no truncation. - columnTruncateLength?: number; - - // Number of audio frames per spectrogram. The time duration of one - // spectrogram equals to numFramesPerSpectrogram*fftSize/sampleRateHz second. - // For example: the device sampling rate is 44,100 Hz, and fftSize is 1024, - // then each frame duration between two sampling is 0.023 second. If the - // purpose is for an audio model to recognize speech command that last 1 - // second, each spectrogram should contain 1/0.023, which is 43 frames. This - // will be part of the output spectrogram tensor shape. Optional, defaults to - // 43 so that each audio data last 1 second. - numFramesPerSpectrogram?: number; - - // A dictionary specifying the requirements of audio to request, such as - // deviceID, echoCancellation, etc. Optional. - audioTrackConstraints?: MediaTrackConstraints; - - // The averaging constant with the last analysis frame -- basically, it makes - // the transition between values over time smoother. It is used by - // AnalyserNode interface during FFT. Optional, has to be between 0 and 1, - // defaults to 0. - smoothingTimeConstant?: number; - - // Whether to collect the frequency domain audio spectrogram in - // MicrophoneIterator result. If both includeSpectrogram and includeWaveform - // are false, it will throw an error. Defaults to true. - includeSpectrogram?: boolean; - - // Whether to collect the time domain audio waveform in MicrophoneIterator - // result. If both includeSpectrogram and includeWaveform are false, it will - // throw an error. Defaults to false. - includeWaveform?: boolean; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts deleted file mode 100644 index 178df1306..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts +++ /dev/null @@ -1,35 +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 {deepMap, DeepMapResult, isIterable} from './deep_map'; - -export function deepClone(container: T): T { - return deepMap(container, cloneIfTensor); -} - -// tslint:disable-next-line: no-any -function cloneIfTensor(item: any): DeepMapResult { - 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}; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts deleted file mode 100644 index 75da470eb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts +++ /dev/null @@ -1,277 +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'; - -// tslint:disable:no-any - -/** - * A return value for a mapping function that can be applied via deepMap. - * - * If recurse is true, the value should be empty, and iteration will continue - * into the object or array. - */ -export type DeepMapResult = { - value: any, - recurse: boolean -}; - -/** - * 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. - */ -export function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any| - any[] { - 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: any, mapFn: (x: any) => DeepMapResult, - seen: Map = new Map(), containedIn: Set<{}> = new Set()): any| - any[] { - 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: any|any[] = 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. - */ -export function deepZip( - inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] { - return deepZipInternal(inputs, zipFn); -} - -/** - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ -function deepZipInternal( - inputs: any[], zipFn: (xs: any[]) => DeepMapResult, - containedIn: Set<{}> = new Set()): any|any[] { - // 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: any|any[] = 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 -export function zipToList(x: any[]): DeepMapResult { - 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}; - } -} - -/** - * A return value for an async map function for use with deepMapAndAwaitAll. - * - * If recurse is true, the value should be empty, and iteration will continue - * into the object or array. - */ -export type DeepMapAsyncResult = { - value: Promise, - recurse: boolean -}; - -/** - * 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. - */ -export async function deepMapAndAwaitAll( - input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise { - const seen: Map> = 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 -export function isIterable(obj: any): boolean { - 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 -export function canTensorify(obj: any): boolean { - 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: any): boolean { - return ( - value === null || - (typeof value !== 'object' && typeof value !== 'function')); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts deleted file mode 100644 index 8dd0197ba..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.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 {RingBuffer} from './ring_buffer'; - -export class GrowingRingBuffer extends RingBuffer { - private static INITIAL_CAPACITY = 32; - - /** - * Constructs a `GrowingRingBuffer`. - */ - constructor() { - super(GrowingRingBuffer.INITIAL_CAPACITY); - } - - isFull() { - return false; - } - - push(value: T) { - if (super.isFull()) { - this.expand(); - } - super.push(value); - } - - unshift(value: T) { - if (super.isFull()) { - this.expand(); - } - super.unshift(value); - } - - /** - * Doubles the capacity of the buffer. - */ - private 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; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts deleted file mode 100644 index e76fc1c67..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts +++ /dev/null @@ -1,176 +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. - * - * ============================================================================= - */ - -/** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ -export class RingBuffer { - // 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/ - protected begin = 0; // inclusive - protected end = 0; // exclusive - protected doubledCapacity: number; - - protected data: T[]; - - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - constructor(public capacity: number) { - 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. - */ - protected wrap(index: number) { - // don't trust % on negative numbers - while (index < 0) { - index += this.doubledCapacity; - } - return index % this.doubledCapacity; - } - - protected get(index: number) { - if (index < 0) { - throw new RangeError('Can\'t get item at a negative index.'); - } - return this.data[index % this.capacity]; - } - - protected set(index: number, value: T) { - 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(): number { - 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: T) { - 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: T[]) { - for (const value of values) { - this.push(value); - } - } - - /** - * Removes and returns the last item in the buffer. - */ - pop(): T { - 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: T) { - 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(): T { - 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: number): T { - 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; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts deleted file mode 100644 index 9814993cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/source_util.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. - * - * ============================================================================= - */ - -// Skip tslint any type check cause this method is aiming to check type of -// input. -// tslint:disable-next-line:no-any -export function isLocalPath(source: any): boolean { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/test_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/test_utils.ts deleted file mode 100644 index 00e9012b8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/util/test_utils.ts +++ /dev/null @@ -1,152 +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. - * - * ============================================================================= - */ - -// tslint:disable-next-line: no-imports-from-dist -import {ALL_ENVS, BROWSER_ENVS, describeWithFlags, NODE_ENVS, registerTestEnv} from '@tensorflow/tfjs-core/dist/jasmine_util'; - -// Provide fake video stream -export function setupFakeVideoStream() { - const width = 100; - const height = 200; - const canvasElement = document.createElement('canvas'); - const ctx = canvasElement.getContext('2d'); - ctx.fillStyle = 'rgb(1,2,3)'; - ctx.fillRect(0, 0, width, height); - // tslint:disable-next-line:no-any - const stream = (canvasElement as any).captureStream(60); - navigator.mediaDevices.getUserMedia = async () => { - return stream; - }; -} - -export async function replaceHTMLVideoElementSource( - videoElement: HTMLVideoElement) { - const source = document.createElement('source'); - // tslint:disable:max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.appendChild(source); - videoElement.play(); - - if (videoElement.readyState < 2) { - await new Promise(resolve => { - videoElement.addEventListener('loadeddata', () => resolve()); - }); - } -} - -// Register backends. -registerTestEnv({name: 'cpu', backendName: 'cpu'}); -registerTestEnv({ - name: 'webgl2', - backendName: 'webgl', - flags: { - 'WEBGL_VERSION': 2, - 'WEBGL_CPU_FORWARD': false, - 'WEBGL_SIZE_UPLOAD_UNIFORM': 0 - } -}); - -export function describeAllEnvs(testName: string, tests: () => void) { - describeWithFlags(testName, ALL_ENVS, () => { - tests(); - }); -} - -export function describeBrowserEnvs(testName: string, tests: () => void) { - describeWithFlags(testName, BROWSER_ENVS, () => { - tests(); - }); -} - -export function describeNodeEnvs(testName: string, tests: () => void) { - describeWithFlags(testName, NODE_ENVS, () => { - tests(); - }); -} - -/** - * Testing Utilities for browser audeo stream. - */ -export function setupFakeAudeoStream() { - navigator.mediaDevices.getUserMedia = async () => { - const stream = new MediaStream(); - return stream; - }; - // tslint:disable-next-line:no-any - (window as any).AudioContext = FakeAudioContext.createInstance; -} - -export class FakeAudioContext { - readonly sampleRate = 44100; - - static createInstance() { - return new FakeAudioContext(); - } - - createMediaStreamSource() { - return new FakeMediaStreamAudioSourceNode(); - } - - createAnalyser() { - return new FakeAnalyser(); - } - - close(): void {} -} - -export class FakeAudioMediaStream { - constructor() {} - getTracks(): Array<{}> { - return []; - } -} - -class FakeMediaStreamAudioSourceNode { - constructor() {} - connect(node: {}): void {} -} - -class FakeAnalyser { - fftSize: number; - smoothingTimeConstant: number; - private x: number; - constructor() { - this.x = 0; - } - - getFloatFrequencyData(data: Float32Array): void { - const xs: number[] = []; - for (let i = 0; i < this.fftSize / 2; ++i) { - xs.push(this.x++); - } - data.set(new Float32Array(xs)); - } - - getFloatTimeDomainData(data: Float32Array): void { - const xs: number[] = []; - for (let i = 0; i < this.fftSize / 2; ++i) { - xs.push(-(this.x++)); - } - data.set(new Float32Array(xs)); - } - - disconnect(): void {} -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/version.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/version.ts deleted file mode 100644 index 4d1223e8a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/src/version.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** @license See the LICENSE file. */ - -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; -export {version}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/LICENSE deleted file mode 100644 index 60c5c069d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/LICENSE +++ /dev/null @@ -1,249 +0,0 @@ -TensorFlow.js Layers is licensed under both the MIT and the Apache 2.0 licenses. - -================================================================================ -COPYRIGHT - -All contributions by François Chollet: -Copyright (c) 2015 - 2018, François Chollet. -All rights reserved. - -All contributions by Google: -Copyright (c) 2015 - 2018, Google LLC. -All rights reserved. - -All contributions by Microsoft: -Copyright (c) 2017 - 2018, Microsoft, LLC -All rights reserved. - -All other contributions: -Copyright (c) 2015 - 2018, the respective contributors. -All rights reserved. - -Each contributor holds copyright over their respective contributions. -The project versioning (Git) records all such contribution source information. - -LICENSE - -The MIT License (MIT) - -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. - -================================================================================ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/README.md deleted file mode 100644 index cd462791e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# TensorFlow.js Layers: High-Level Machine Learning Model API - -A part of the TensorFlow.js ecosystem, TensorFlow.js Layers is a high-level -API built on [TensorFlow.js Core](/tfjs-core), -enabling users to build, train and execute deep learning models in the browser. -TensorFlow.js Layers is modeled after -[Keras](https://keras.io/) and -[tf.keras](https://www.tensorflow.org/api_docs/python/tf/keras) and can -load models saved from those libraries. - -## Importing - -There are three ways to import TensorFlow.js Layers - -1. You can access TensorFlow.js Layers through the union package - between the TensorFlow.js Core and Layers: - [@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) -2. You can get [TensorFlow.js](https://github.com/tensorflow/tfjs) Layers as a module: - [@tensorflow/tfjs-layers](https://www.npmjs.com/package/@tensorflow/tfjs-layers). - Note that `tfjs-layers` has peer dependency on tfjs-core, so if you import - `@tensorflow/tfjs-layers`, you also need to import - `@tensorflow/tfjs-core`. -3. As a standalone through [unpkg](https://unpkg.com/). - -Option 1 is the most convenient, but leads to a larger bundle size (we will be -adding more packages to it in the future). Use option 2 if you care about bundle -size. - -## Getting started - -### Building, training and executing a model - -The following example shows how to build a toy model with only one `dense` layer -to perform linear regression. - -```js -import * as tf from '@tensorflow/tfjs'; - -// A sequential model is a container which you can add layers to. -const model = tf.sequential(); - -// Add a dense layer with 1 output unit. -model.add(tf.layers.dense({units: 1, inputShape: [1]})); - -// Specify the loss type and optimizer for training. -model.compile({loss: 'meanSquaredError', optimizer: 'SGD'}); - -// Generate some synthetic data for training. -const xs = tf.tensor2d([[1], [2], [3], [4]], [4, 1]); -const ys = tf.tensor2d([[1], [3], [5], [7]], [4, 1]); - -// Train the model. -await model.fit(xs, ys, {epochs: 500}); - -// Ater the training, perform inference. -const output = model.predict(tf.tensor2d([[5]], [1, 1])); -output.print(); -``` - -### Loading a pretrained Keras model - -You can also load a model previously trained and saved from elsewhere (e.g., -from Python Keras) and use it for inference or transfer learning in the browser. - -For example, in Python, save your Keras model using -[tensorflowjs](https://pypi.org/project/tensorflowjs/), -which can be installed using `pip install tensorflowjs`. - - -```python -import tensorflowjs as tfjs - -# ... Create and train your Keras model. - -# Save your Keras model in TensorFlow.js format. -tfjs.converters.save_keras_model(model, '/path/to/tfjs_artifacts/') - -# Then use your favorite web server to serve the directory at a URL, say -# http://foo.bar/tfjs_artifacts/model.json -``` - -To load the model with TensorFlow.js Layers: - -```js -import * as tf from '@tensorflow/tfjs'; - -const model = await tf.loadLayersModel('http://foo.bar/tfjs_artifacts/model.json'); -// Now the model is ready for inference, evaluation or re-training. -``` - -## 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-layers/dist/activations.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts deleted file mode 100644 index d315b2034..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { ActivationIdentifier } from './keras_format/activation_config'; -/** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ -export declare abstract class Activation extends serialization.Serializable { - abstract apply(tensor: Tensor, axis?: number): Tensor; - getConfig(): serialization.ConfigDict; -} -/** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ -export declare class Elu extends Activation { - /** @nocollapse */ - static readonly className = "elu"; - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - apply(x: Tensor, alpha?: number): Tensor; -} -/** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ -export declare class Selu extends Activation { - /** @nocollapse */ - static readonly className = "selu"; - apply(x: Tensor): Tensor; -} -/** - * Rectified linear unit - */ -export declare class Relu extends Activation { - /** @nocollapse */ - static readonly className = "relu"; - apply(x: Tensor): Tensor; -} -/** - * Rectified linear unit activation maxing out at 6.0. - */ -export declare class Relu6 extends Activation { - /** @nocollapse */ - static readonly className = "relu6"; - apply(x: Tensor): Tensor; -} -export declare class Linear extends Activation { - /** @nocollapse */ - static readonly className = "linear"; - apply(x: Tensor): Tensor; -} -/** - * Sigmoid activation function. - */ -export declare class Sigmoid extends Activation { - /** @nocollapse */ - static readonly className = "sigmoid"; - apply(x: Tensor): Tensor; -} -/** - * Segment-wise linear approximation of sigmoid. - */ -export declare class HardSigmoid extends Activation { - /** @nocollapse */ - static readonly className = "hardSigmoid"; - apply(x: Tensor): Tensor; -} -/** - * Softplus activation function. - */ -export declare class Softplus extends Activation { - /** @nocollapse */ - static readonly className = "softplus"; - apply(x: Tensor): Tensor; -} -/** - * Softsign activation function. - */ -export declare class Softsign extends Activation { - /** @nocollapse */ - static readonly className = "softsign"; - apply(x: Tensor): Tensor; -} -/** - * Hyperbolic tangent function. - */ -export declare class Tanh extends Activation { - /** @nocollapse */ - static readonly className = "tanh"; - apply(x: Tensor): Tensor; -} -/** - * Softmax activation function - */ -export declare class Softmax extends Activation { - /** @nocollapse */ - static readonly className = "softmax"; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x: Tensor, axis?: number): Tensor; -} -/** - * Log softmax activation function - */ -export declare class LogSoftmax extends Activation { - /** @nocollapse */ - static readonly className = "logSoftmax"; - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x: Tensor, axis?: number): Tensor; -} -/** - * Swish activation function - */ -export declare class Swish extends Activation { - /** @nocollapse */ - static readonly className = "swish"; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - apply(x: Tensor, alpha?: number): Tensor; -} -/** - * Mish activation function - */ -export declare class Mish extends Activation { - /** @nocollapse */ - static readonly className = "mish"; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - apply(x: Tensor): Tensor; -} -export declare function serializeActivation(activation: Activation): string; -export declare function deserializeActivation(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Activation; -export declare function getActivation(identifier: ActivationIdentifier | serialization.ConfigDict | Activation): Activation; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js deleted file mode 100644 index 217bd43bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js +++ /dev/null @@ -1,255 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// Layer activation functions -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import { deserializeKerasObject } from './utils/generic_utils'; -/** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ -export class Activation extends serialization.Serializable { - getConfig() { - return {}; - } -} -/** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ -export class Elu extends Activation { - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - apply(x, alpha = 1) { - return K.elu(x, alpha); - } -} -/** @nocollapse */ -Elu.className = 'elu'; -serialization.registerClass(Elu); -/** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ -export class Selu extends Activation { - apply(x) { - return tfc.selu(x); - } -} -/** @nocollapse */ -Selu.className = 'selu'; -serialization.registerClass(Selu); -/** - * Rectified linear unit - */ -export class Relu extends Activation { - apply(x) { - return tfc.relu(x); - } -} -/** @nocollapse */ -Relu.className = 'relu'; -serialization.registerClass(Relu); -/** - * Rectified linear unit activation maxing out at 6.0. - */ -export class Relu6 extends Activation { - apply(x) { - return tidy(() => tfc.minimum(6.0, tfc.relu(x))); - } -} -/** @nocollapse */ -Relu6.className = 'relu6'; -serialization.registerClass(Relu6); -//* Linear activation (no-op) */ -export class Linear extends Activation { - apply(x) { - return x; - } -} -/** @nocollapse */ -Linear.className = 'linear'; -serialization.registerClass(Linear); -/** - * Sigmoid activation function. - */ -export class Sigmoid extends Activation { - apply(x) { - return tfc.sigmoid(x); - } -} -/** @nocollapse */ -Sigmoid.className = 'sigmoid'; -serialization.registerClass(Sigmoid); -/** - * Segment-wise linear approximation of sigmoid. - */ -export class HardSigmoid extends Activation { - apply(x) { - return K.hardSigmoid(x); - } -} -/** @nocollapse */ -HardSigmoid.className = 'hardSigmoid'; -serialization.registerClass(HardSigmoid); -/** - * Softplus activation function. - */ -export class Softplus extends Activation { - apply(x) { - return tfc.softplus(x); - } -} -/** @nocollapse */ -Softplus.className = 'softplus'; -serialization.registerClass(Softplus); -/** - * Softsign activation function. - */ -export class Softsign extends Activation { - apply(x) { - return K.softsign(x); - } -} -/** @nocollapse */ -Softsign.className = 'softsign'; -serialization.registerClass(Softsign); -/** - * Hyperbolic tangent function. - */ -export class Tanh extends Activation { - apply(x) { - return tfc.tanh(x); - } -} -/** @nocollapse */ -Tanh.className = 'tanh'; -serialization.registerClass(Tanh); -/** - * Softmax activation function - */ -export class Softmax extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return tfc.softmax(x, axis); - } -} -/** @nocollapse */ -Softmax.className = 'softmax'; -serialization.registerClass(Softmax); -/** - * Log softmax activation function - */ -export class LogSoftmax extends Activation { - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return tfc.logSoftmax(x, axis); - } -} -/** @nocollapse */ -LogSoftmax.className = 'logSoftmax'; -serialization.registerClass(LogSoftmax); -/** - * Swish activation function - */ -export class Swish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - apply(x, alpha = 1) { - return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x)); - } -} -/** @nocollapse */ -Swish.className = 'swish'; -serialization.registerClass(Swish); -/** - * Mish activation function - */ -export class Mish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - apply(x) { - return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x)))); - } -} -/** @nocollapse */ -Mish.className = 'mish'; -serialization.registerClass(Mish); -export function serializeActivation(activation) { - return activation.getClassName(); -} -export function deserializeActivation(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); -} -export function getActivation(identifier) { - if (identifier == null) { - const config = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - const config = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } - else if (identifier instanceof Activation) { - return identifier; - } - else { - return deserializeActivation(identifier); - } -} -//# sourceMappingURL=activations.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-layers/dist/activations.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map deleted file mode 100644 index 2f2976ce5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"activations.js","sourceRoot":"","sources":["../src/activations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,6BAA6B;AAC7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,OAAgB,UAAW,SAAQ,aAAa,CAAC,YAAY;IAEjE,SAAS;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,GAAI,SAAQ,UAAU;IAGjC;;;;;;OAMG;IACH,KAAK,CAAC,CAAS,EAAE,KAAK,GAAG,CAA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AC,CAAC;AAElC,MAAM,UAAU,mBAAmB,CAAC,UAAsB;IACxD,OAAO,UAAU,CAAC,YAAY,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAClC,MAAgC,EAChC,gBAA0C,EAAE;IAC7C,OAAO,sBAAsB,CACzB,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,YAAY,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UACmC;IAC/D,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,MAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACtB,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;KACtC;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACtB,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;KACtC;SAAM,IAAI,UAAU,YAAY,UAAU,EAAE;QAC3C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC;KAC1C;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\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-layers/dist/activations_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map deleted file mode 100644 index f99d0babc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"activations_test.js","sourceRoot":"","sources":["../src/activations_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAC/I,OAAO,EAAC,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAEpG,qBAAqB,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC9C,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAAC;IAClC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;QACZ,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,EAAE,CA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AI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACpD,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;QACZ,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,YAAY,GAAG,QAAQ,CACzB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for activations.ts.\n */\nimport {scalar, tensor1d, tensor2d, tensor3d} from '@tensorflow/tfjs-core';\n\nimport {Elu, HardSigmoid, Linear, LogSoftmax, Relu, Relu6, Selu, Sigmoid, Softmax, Softplus, Softsign, Tanh, Swish, Mish} from './activations';\nimport {describeMathCPUAndGPU, expectNoLeakedTensors, expectTensorsClose} from './utils/test_utils';\n\ndescribeMathCPUAndGPU('linear activation', () => {\n const initVals = new Float32Array([-1, 2, 0, 4, -5, 6]);\n const expectedVals = new Float32Array([-1, 2, 0, 4, -5, 6]);\n const linear = new Linear().apply;\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(linear(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(linear(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(linear(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => linear(initX), 0);\n });\n});\n\ndescribeMathCPUAndGPU('elu activation', () => {\n const initVals = [-1, 2, 0, 4, -5, 6];\n const expectedVals = initVals.map(x => x < 0 ? Math.exp(x) - 1 : x);\n const elu = new Elu().apply;\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(elu(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(elu(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(elu(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => elu(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('selu activation', () => {\n const initVals = [-1, 2, 0, 4, -5, 6];\n const alpha = 1.6732632423543772848170429916717;\n const scale = 1.0507009873554804934193349852946;\n\n const expectedVals =\n initVals.map(x => scale * (x < 0 ? (alpha * (Math.exp(x) - 1)) : x));\n const selu = new Selu().apply;\n\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(selu(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(selu(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(selu(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => selu(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('relu activation', () => {\n const initVals = new Float32Array([-1, 2, 0, 4, -5, 6]);\n const expectedVals = new Float32Array([0, 2, 0, 4, 0, 6]);\n const relu = new Relu().apply;\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(relu(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(relu(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(relu(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => relu(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('relu6 activation', () => {\n const initVals = new Float32Array([-10, -5, 0, 1, 5, 15]);\n const expectedVals = new Float32Array([0, 0, 0, 1, 5, 6]);\n const relu6 = new Relu6().apply;\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(relu6(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(relu6(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(relu6(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => relu6(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('sigmoid activation', () => {\n const sigmoid = new Sigmoid().apply;\n const initVals = [-1, 2, 0, 4, -5, 6];\n it('Scalar', () => {\n expectTensorsClose(sigmoid(scalar(0)), scalar(0.5));\n });\n it('3D', () => {\n const expectedVals = initVals.map(v => 1 / (1 + Math.exp(-v)));\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(sigmoid(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => sigmoid(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('hardSigmoid activation', () => {\n const hardSigmoid = new HardSigmoid().apply;\n const initVals = [-1, 2, 0, 4, -5, 6];\n it('Scalar', () => {\n expectTensorsClose(hardSigmoid(scalar(0)), scalar(0.5));\n });\n it('3D', () => {\n const expectedVals = initVals.map(v => {\n const y = 0.2 * v + 0.5;\n if (y > 1) {\n return 1;\n } else if (y < 0) {\n return 0;\n } else {\n return y;\n }\n });\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(hardSigmoid(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => hardSigmoid(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('softplus activation', () => {\n const softplus = new Softplus().apply;\n const initVals = [-1, 2, 0, 4, -5, 6];\n it('Scalar', () => {\n expectTensorsClose(softplus(scalar(0)), scalar(Math.log(2)));\n });\n it('3D', () => {\n const expectedVals = initVals.map(v => Math.log(Math.exp(v) + 1));\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(softplus(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => softplus(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('softsign activation', () => {\n const softsign = new Softsign().apply;\n const initVals = [-1, 2, 0, 4, -5, 6];\n it('Scalar', () => {\n expectTensorsClose(softsign(scalar(0)), scalar(0));\n });\n it('3D', () => {\n const expectedVals = initVals.map(v => v / (Math.abs(v) + 1));\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(softsign(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => softsign(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('tanh activation', () => {\n const tanh = new Tanh().apply;\n const initVals = [-1, 2, 0, 4, -5, 6];\n const expectedVals = initVals.map(x => Math.tanh(x));\n it('1D', () => {\n const initX = tensor1d(initVals);\n expectTensorsClose(tanh(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initX = tensor2d(initVals, [2, 3]);\n expectTensorsClose(tanh(initX), tensor2d(expectedVals, [2, 3]));\n });\n it('3D', () => {\n const initX = tensor3d(initVals, [1, 2, 3]);\n expectTensorsClose(tanh(initX), tensor3d(expectedVals, [1, 2, 3]));\n });\n it('Does not leak', () => {\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => tanh(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('softmax activation', () => {\n const softmax = new Softmax().apply;\n // Setup: Array with initial values.\n // Execute: Softmax on the last dimension.\n // Expect: Output array matches size and approximate expected values.\n it('1D', () => {\n const initVals = new Float32Array([0, 1, 3, 9]);\n const expectedVals = new Float32Array([0.000, 0.000, 0.002, 0.997]);\n const initX = tensor1d(initVals);\n expectTensorsClose(softmax(initX), tensor1d(expectedVals));\n });\n it('1D all equal', () => {\n const initVals = new Float32Array([-1, -1, -1, -1]);\n const expectedVals = new Float32Array([0.25, 0.25, 0.25, 0.25]);\n const initX = tensor1d(initVals);\n expectTensorsClose(softmax(initX), tensor1d(expectedVals));\n });\n it('2D', () => {\n const initVals = new Float32Array([0, 1, 3, 9, 0, 1, 3, 9]);\n const expectedVals = new Float32Array(\n [0.000, 0.000, 0.002, 0.997, 0.000, 0.000, 0.002, 0.997]);\n const initX = tensor2d(initVals, [2, 4]);\n expectTensorsClose(softmax(initX), tensor2d(expectedVals, [2, 4]));\n });\n it('3D', () => {\n const initVals = new Float32Array([0, 1, 3, 9, 0, 1, 3, 9]);\n const expectedVals = new Float32Array(\n [0.000, 0.000, 0.002, 0.997, 0.000, 0.000, 0.002, 0.997]);\n const initX = tensor3d(initVals, [1, 2, 4]);\n expectTensorsClose(softmax(initX), tensor3d(expectedVals, [1, 2, 4]));\n });\n it('Does not leak', () => {\n const initVals = new Float32Array([0, 1, 3, 9]);\n const initX = tensor1d(initVals);\n expectNoLeakedTensors(() => softmax(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('logsoftmax activation', () => {\n const logsoftmax = new LogSoftmax().apply;\n // Setup: Array with initial values.\n // Execute: logSoftmax on the last dimension.\n // Expect: Output array matches size and approximate expected values.\n it('1D', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n const expectedVals = tensor1d([-9.003, -8.003, -6.003, -0.003]);\n expectTensorsClose(logsoftmax(initX), expectedVals);\n });\n it('1D all equal', () => {\n const initX = tensor1d([-1, -1, -1, -1]);\n const expectedVals = tensor1d([-1.386, -1.386, -1.386, -1.386]);\n expectTensorsClose(logsoftmax(initX), expectedVals);\n });\n it('2D', () => {\n const initX = tensor2d([[0, 1, 3, 9], [0, 1, 3, 9]]);\n const expectedVals = tensor2d(\n [[-9.003, -8.003, -6.003, -0.003], [-9.003, -8.003, -6.003, -0.003]]);\n expectTensorsClose(logsoftmax(initX), expectedVals);\n });\n it('3D', () => {\n const initX = tensor3d([[[0, 1, 3, 9], [0, 1, 3, 9]]]);\n const expectedVals = tensor3d(\n [[[-9.003, -8.003, -6.003, -0.003], [-9.003, -8.003, -6.003, -0.003]]]);\n expectTensorsClose(logsoftmax(initX), expectedVals);\n });\n it('Does not leak', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n expectNoLeakedTensors(() => logsoftmax(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('swish activation', () => {\n const swish = new Swish().apply;\n // Setup: Array with initial values.\n // Execute: Swish on the last dimension.\n // Expect: Output array matches size and approximate expected values.\n it('1D', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n const expectedVals = tensor1d([0, .731, 2.857, 8.998]);\n expectTensorsClose(swish(initX), expectedVals);\n });\n it('1D all equal', () => {\n const initX = tensor1d([-1, -1, -1, -1]);\n const expectedVals = tensor1d([-.268, -.268, -.268, -.268]);\n expectTensorsClose(swish(initX), expectedVals);\n });\n it('2D', () => {\n const initX = tensor2d([[0, 1, 3, 9], [0, 1, 3, 9]]);\n const expectedVals = tensor2d(\n [[0, .731, 2.857, 8.998], [0, .731, 2.857, 8.998]]);\n expectTensorsClose(swish(initX), expectedVals);\n });\n it('3D', () => {\n const initX = tensor3d([[[0, 1, 3, 9], [0, 1, 3, 9]]]);\n const expectedVals = tensor3d(\n [[[0, .731, 2.857, 8.998], [0, .731, 2.857, 8.998]]]);\n expectTensorsClose(swish(initX), expectedVals);\n });\n it('Does not leak', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n expectNoLeakedTensors(() => swish(initX), 1);\n });\n});\n\ndescribeMathCPUAndGPU('mish activation', () => {\n const mish = new Mish().apply;\n // Setup: Array with initial values.\n // Execute: Mish on the last dimension.\n // Expect: Output array matches size and approximate expected values.\n it('1D', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n const expectedVals = tensor1d([0., .865, 2.987, 9.]);\n expectTensorsClose(mish(initX), expectedVals);\n });\n it('1D all equal', () => {\n const initX = tensor1d([-1, -1, -1, -1]);\n const expectedVals = tensor1d([-0.303, -0.303, -0.303, -0.303]);\n expectTensorsClose(mish(initX), expectedVals);\n });\n it('2D', () => {\n const initX = tensor2d([[0, 1, 3, 9], [0, 1, 3, 9]]);\n const expectedVals = tensor2d(\n [[0., .865, 2.987, 9.], [0., .865, 2.987, 9.]]);\n expectTensorsClose(mish(initX), expectedVals);\n });\n it('3D', () => {\n const initX = tensor3d([[[0, 1, 3, 9], [0, 1, 3, 9]]]);\n const expectedVals = tensor3d(\n [[[0., .865, 2.987, 9.], [0., .865, 2.987, 9.]]]);\n expectTensorsClose(mish(initX), expectedVals);\n });\n it('Does not leak', () => {\n const initX = tensor1d([0, 1, 3, 9]);\n expectNoLeakedTensors(() => mish(initX), 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-layers/dist/backend/common.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts deleted file mode 100644 index 4c1642f06..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataFormat } from '../keras_format/common'; -/** - * Returns the value of the fuzz factor used in numeric expressions. - */ -export declare function epsilon(): number; -/** - * Sets the value of the fuzz factor used in numeric expressions. - * @param e New value of epsilon. - */ -export declare function setEpsilon(e: number): void; -/** - * Returns the default image data format convention. - */ -export declare function imageDataFormat(): DataFormat; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js deleted file mode 100644 index 654d8f190..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { backend } from '@tensorflow/tfjs-core'; -let _epsilon; -/** - * Returns the value of the fuzz factor used in numeric expressions. - */ -export function epsilon() { - if (_epsilon == null) { - _epsilon = backend().epsilon(); - } - return _epsilon; -} -/** - * Sets the value of the fuzz factor used in numeric expressions. - * @param e New value of epsilon. - */ -export function setEpsilon(e) { - _epsilon = e; -} -/** - * Returns the default image data format convention. - */ -export function imageDataFormat() { - return 'channelsLast'; -} -//# sourceMappingURL=common.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-layers/dist/backend/common.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map deleted file mode 100644 index c8bee824c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/backend/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAG9C,IAAI,QAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,UAAU,OAAO;IACrB,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,QAAQ,GAAG,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;KAChC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,QAAQ,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\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-layers/dist/backend/state.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts deleted file mode 100644 index 0e5a36cc7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export declare function getNextUniqueTensorId(): number; -/** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ -export declare function getUid(prefix?: string): string; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js deleted file mode 100644 index 17e196051..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Utilities related to persistent state in the backend. - */ -/** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ -let _nextUniqueTensorId = 0; -export function getNextUniqueTensorId() { - return _nextUniqueTensorId++; -} -const _uidPrefixes = {}; -/** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ -export function getUid(prefix = '') { - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); -} -//# sourceMappingURL=state.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-layers/dist/backend/state.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map deleted file mode 100644 index b5d2e4a17..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/backend/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH;;;;GAIG;AACH,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAE5B,MAAM,UAAU,qBAAqB;IACnC,OAAO,mBAAmB,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,YAAY,GAA+B,EAAE,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,MAAM,GAAG,EAAE;IAChC,IAAI,CAAC,CAAC,MAAM,IAAI,YAAY,CAAC,EAAE;QAC7B,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClD,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\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-layers/dist/backend/state_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map deleted file mode 100644 index 086695bf1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"state_test.js","sourceRoot":"","sources":["../../src/backend/state_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC;QACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC;QAC1B,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {getUid} from '../backend/state';\n\ndescribe('getUID ', () => {\n it('second UID is different.', () => {\n const name = 'def';\n const firstUID = getUid(name);\n const secondUID = getUid(name);\n expect(secondUID).not.toEqual(firstUID);\n });\n\n it('with no prefix works and returns different UIDs.', () => {\n const firstUID = getUid();\n const secondUID = getUid();\n expect(firstUID).not.toEqual(secondUID);\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-layers/dist/backend/tfjs_backend.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts deleted file mode 100644 index e7d7caf23..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * deeplearn.js backend. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { Tensor, Tensor1D } from '@tensorflow/tfjs-core'; -import { DataFormat, Shape } from '../keras_format/common'; -import { HasShape } from '../types'; -export declare function setBackend(requestedBackend: 'cpu' | 'webgl'): void; -export declare function getBackend(): 'cpu' | 'webgl'; -/** - * Indicates whether the backend is operating symbolically. - * - * This function will be used to determine how to interpret user code. If - * it returns true, calls to the backend construct a symbolic graph; if - * it returns false, calls to the backend execute immediately. - */ -export declare function isBackendSymbolic(): boolean; -/** - * Get the number of elements in a Tensor. - * @param x The Tensor. - * @return Number of elements in `x`. - */ -export declare function countParams(x: HasShape): number; -/** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ -export declare function cast(x: Tensor, dtype: tfc.DataType): Tensor; -/** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ -export declare function expandDims(x: Tensor, axis?: number): Tensor; -/** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ -export declare function repeat(x: Tensor, n: number): Tensor; -/** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ -export declare function flatten(x: Tensor): Tensor; -/** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ -export declare function batchFlatten(x: Tensor): Tensor; -/** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export declare function sliceAlongFirstAxis(array: Tensor, start: number, size: number): Tensor; -/** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export declare function sliceAlongLastAxis(array: Tensor, start: number, size: number): Tensor; -/** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export declare function sliceAlongAxis(array: Tensor, start: number, size: number, axis: number): Tensor; -/** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ -export declare function concatenate(tensors: Tensor[], axis?: number): Tensor; -/** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ -export declare function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor; -/** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ -export declare function tile(x: Tensor, n: number | number[]): Tensor; -/** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ -export declare function randomNormal(shape: Shape, mean?: number, stddev?: number, dtype?: 'float32' | 'int32', seed?: number): Tensor; -/** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ -export declare function dot(a: Tensor, b: Tensor, activation?: tfc.fused.Activation, bias?: Tensor): Tensor; -/** - * Compute the sign Tensor of an input Tensor. - * - * Elements of the input `tf.Tensor` that are === 0 are mapped to 0. - * Elements of the input `tf.Tensor` that are > 0 are mapped to 1. - * Elements of the input `tf.Tensor` that are < 0 are mapped to -1. - * - * @param x Input `tf.Tensor`. - * @return The sign `tf.Tensor`. - */ -export declare function sign(x: Tensor): Tensor; -/** - * Computes the one-hot representation of an integer tensor. - * @param indices nD integer tensor of shape - * `(batch_size, dim1, dim2, ... dim(n-1))` - * @param numClasses Integer, number of classes to consider. - * @returns (n + 1)D one hot representation of the input - * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)` - */ -export declare function oneHot(indices: Tensor, numClasses: number): Tensor; -/** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ -export declare function gather(reference: Tensor, indices: number[] | Tensor1D, axis?: number): Tensor; -/** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ -export declare function square(x: Tensor): Tensor; -/** - * Element-wise exponentiation. - * - * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which - * takes advatnage of the backend's (e.g., TensorFlow's) automatic - * conversion to tensor. Here we allow `a` to be either a number or a tensor. - * - * @param x The base tensor. - * @param a The exponent, tensor or number. If a number, it is rounded to the - * nearest integer and converted to a tensor. - * @returns A tensor of the same shape as `x`. - */ -export declare function pow(x: Tensor, a: Tensor | number): Tensor; -/** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ -export declare function biasAdd(x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor; -/** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ -export declare function elu(x: Tensor, alpha?: number): Tensor; -/** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ -export declare function softsign(x: Tensor): Tensor; -/** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ -export declare function dropout(x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor; -/** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ -export declare function hardSigmoid(x: Tensor): Tensor; -/** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ -export declare function inTrainPhase(x: () => T, alt: () => T, training?: boolean): T; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js deleted file mode 100644 index 7955d337e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js +++ /dev/null @@ -1,643 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * deeplearn.js backend. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { onesLike as coreOnesLike, scalar, tensor1d, tidy, where, zerosLike as coreZerosLike } from '@tensorflow/tfjs-core'; -import { checkDataFormat } from '../common'; -import { NotImplementedError, ValueError } from '../errors'; -import * as math_utils from '../utils/math_utils'; -import { imageDataFormat } from './common'; -// tslint:enable -/* Setting and getting backend from deeplearn.js. */ -// Default deeplearn.js backend is WebGL (GPU). -let backend = 'webgl'; -export function setBackend(requestedBackend) { - tfc.setBackend(requestedBackend); - backend = requestedBackend; -} -export function getBackend() { - return backend; -} -/** - * Indicates whether the backend is operating symbolically. - * - * This function will be used to determine how to interpret user code. If - * it returns true, calls to the backend construct a symbolic graph; if - * it returns false, calls to the backend execute immediately. - */ -export function isBackendSymbolic() { - return false; -} -/** - * Get the number of elements in a Tensor. - * @param x The Tensor. - * @return Number of elements in `x`. - */ -export function countParams(x) { - const shape = x.shape; - if (shape.length > 0) { - return shape.reduce((a, b) => a * b); - } - else { - // Scalar. - return 1; - } -} -/** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ -export function cast(x, dtype) { - return x.asType(dtype); -} -/** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ -export function expandDims(x, axis = -1) { - const outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); -} -/** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ -export function repeat(x, n) { - return tidy(() => { - if (x.shape.length !== 2) { - throw new ValueError(`repeat() expects a rank-2 tensor, but received a ` + - `rank-${x.shape.length} tensor.`); - } - const y = expandDims(x, 1); - return tile(y, [1, n, 1]); - }); -} -/** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ -export function flatten(x) { - const newShape = [math_utils.arrayProd(x.shape)]; - return x.reshape(newShape); -} -/** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ -export function batchFlatten(x) { - if (x.rank <= 1) { - throw new ValueError(`batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`); - } - const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)]; - return x.reshape(newShape); -} -/** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongFirstAxis(array, start, size) { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); - case 3: - return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); - case 4: - return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return tfc.slice(array, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return tfc.slice(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError(`sliceAlongFirstAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongLastAxis(array, start, size) { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [0, start], [array.shape[0], size]); - case 3: - return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); - case 4: - return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongAxis(array, start, size, axis) { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ -export function concatenate(tensors, axis = -1) { - let rank; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } - else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return tfc.concat(tensors, axis); -} -/** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ -export function concatAlongFirstAxis(a, b) { - switch (a.rank) { - case 1: - return tfc.concat1d([a, b]); - case 2: - return tfc.concat2d([a, b], 0); - case 3: - return tfc.concat3d([a, b], 0); - case 4: - return tfc.concat4d([a, b], 0); - default: - throw new ValueError(`concatAlongFirstAxis() received an unsupported ` + - `tensor rank: ${a.rank}`); - } -} -/** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ -export function tile(x, n) { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError(`The length of input n (${n.length}) does not match ` + - `the number of dimensions in input x (${x.rank})`); - } - return tfc.tile(x, n); -} -/* Creation of random tensors. */ -/** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ -export function randomNormal(shape, mean = 0.0, stddev = 1.0, dtype, seed) { - return tfc.randomNormal(shape, mean, stddev, dtype, seed); -} -/* Linear Algebra */ -/** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ -export function dot(a, b, activation, bias) { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError(`dot requires both inputs to be rank >= 2` + - ` but got x shape = ${a.shape} and y shape = ${b.shape}`); - } - if (b.rank >= 3) { - const xLastDim = a.shape.slice(-1)[0]; - const ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError(`If rank y >= 3, then the second last dim` + - ` of y must equal the last dim of x but got x shape = ${a.shape} and ` + - ` y shape = ${b.shape}`); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - const transposeA = false; - const transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return tfc.fused.matMul({ - a, - b: b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }); - } - else { - // Reshape x into the analogous 2D Tensor. - const aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - const aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - const bShape = b.shape.slice(); - const bLastDim = bShape.pop(); - const ySecondLastDim = bShape.pop(); - const yOtherDims = [...bShape, bLastDim]; - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - const perm = Array.from({ length: b.rank }, (_, i) => { - if (i === 0) { - return b.rank - 2; - } - else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - // Multiply x and y as 2D Tensors, and then reshape back to original. - const outputShape = [...aFirstDims, ...yOtherDims]; - const transposeA = false; - const transposeB = false; - return tfc.fused - .matMul({ - a, - b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }) - .reshape(outputShape); - } -} -/** - * Compute the sign Tensor of an input Tensor. - * - * Elements of the input `tf.Tensor` that are === 0 are mapped to 0. - * Elements of the input `tf.Tensor` that are > 0 are mapped to 1. - * Elements of the input `tf.Tensor` that are < 0 are mapped to -1. - * - * @param x Input `tf.Tensor`. - * @return The sign `tf.Tensor`. - */ -export function sign(x) { - // TODO(cais): Move to the core. - return tidy(() => { - const zerosLikeX = coreZerosLike(x); - const onesLikeX = coreOnesLike(x); - return where(tfc.equal(x, zerosLikeX), zerosLikeX, where(tfc.greater(x, coreZerosLike(x)), onesLikeX, tfc.mul(-1, onesLikeX))); - }); -} -/** - * Computes the one-hot representation of an integer tensor. - * @param indices nD integer tensor of shape - * `(batch_size, dim1, dim2, ... dim(n-1))` - * @param numClasses Integer, number of classes to consider. - * @returns (n + 1)D one hot representation of the input - * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)` - */ -export function oneHot(indices, numClasses) { - return tidy(() => { - if (indices.rank !== 1) { - throw new Error('Only 1D one-hot tensors are supported in the ' + - 'deeplearn backend, at present.'); - } - indices = indices.toInt(); - return tfc.oneHot(indices, numClasses).toFloat(); - }); -} -/* Elementary math functions. */ -/** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ -export function gather(reference, indices, axis) { - return tidy(() => { - if (Array.isArray(indices)) { - indices = tensor1d(indices, 'int32'); - } - else { - indices = indices.toInt(); - } - return tfc.gather(reference, indices, axis); - }); -} -/** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ -export function square(x) { - return tfc.mul(x, x); -} -/** - * Element-wise exponentiation. - * - * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which - * takes advatnage of the backend's (e.g., TensorFlow's) automatic - * conversion to tensor. Here we allow `a` to be either a number or a tensor. - * - * @param x The base tensor. - * @param a The exponent, tensor or number. If a number, it is rounded to the - * nearest integer and converted to a tensor. - * @returns A tensor of the same shape as `x`. - */ -export function pow(x, a) { - return tidy(() => { - if (typeof (a) === 'number') { - a = scalar(Math.round(a), 'int32'); - } - if (a.dtype !== 'int32') { - throw new NotImplementedError(`Non-int32 dtype (${a.dtype}) is not supported by pow() yet`); - } - return tfc.pow(x, a); - }); -} -/** - * Reshapes bias tensor according to rank of x. - */ -function reshapeBias(xRank, bias, dataFormat) { - const biasShape = bias.shape; - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError(`Unexpected bias dimensions: ${bias.rank}` + - `; expected it to be 1 or ${xRank}`); - } - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } - else { - return bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } - else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } - else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank < 3) { - return bias; - } - throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`); -} -/* Neural-network operations. */ -/** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ -export function biasAdd(x, bias, dataFormat) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); -} -/** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ -export function elu(x, alpha = 1) { - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError(`Support for alpha values other than 1 (${alpha}) is not implemented ` + - `yet.`); - } - return tfc.elu(x); -} -/** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ -export function softsign(x) { - return tidy(() => tfc.div(x, tfc.abs(x).add(1))); -} -/** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ -export function dropout(x, level, noiseShape, seed) { - return tidy(() => tfc.dropout(x, level, noiseShape, seed)); -} -/** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ -export function hardSigmoid(x) { - return tidy(() => { - const y = tfc.add(.5, tfc.mul(.2, x)); - return tfc.clipByValue(y, 0, 1); - }); -} -/** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ -export function inTrainPhase(x, alt, training = false) { - return training ? x() : alt(); -} -//# sourceMappingURL=tfjs_backend.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-layers/dist/backend/tfjs_backend.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map deleted file mode 100644 index 8c903e3d9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tfjs_backend.js","sourceRoot":"","sources":["../../src/backend/tfjs_backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,QAAQ,IAAI,YAAY,EAAE,MAAM,EAAoB,QAAQ,EAA0C,IAAI,EAAE,KAAK,EAAE,SAAS,IAAI,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpL,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CA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\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\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-layers/dist/backend/tfjs_backend_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map deleted file mode 100644 index 17e45b61b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tfjs_backend_test.js","sourceRoot":"","sources":["../../src/backend/tfjs_backend_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAW,MAAM,EAAE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H,CAAC,CAAC,CAAC;QACH,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for the TF.js core backend of TF.js Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, scalar, tensor1d, tensor2d, tensor3d, tensor4d, tensor5d, tensor6d, zeros} from '@tensorflow/tfjs-core';\n\nimport {SymbolicTensor} from '../engine/topology';\nimport {range} from '../utils/math_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectNoLeakedTensors, expectTensorsClose} from '../utils/test_utils';\nimport {LayerVariable} from '../variables';\n\nimport * as K from './tfjs_backend';\n\ndescribe('TensorMath', () => {\n it('Setting and getting backend', () => {\n // Default deeplearn.js backend is WebGL (GPU).\n const originalBackend = K.getBackend();\n expect(originalBackend).toEqual('webgl');\n\n K.setBackend('cpu');\n expect(K.getBackend()).toEqual('cpu');\n });\n});\n\ndescribe('dtype', () => {\n it('returns float32 for a Tensor', () => {\n const x = zeros([1]);\n expect(x.dtype).toEqual('float32');\n });\n\n it('returns float32 for a SymbolicTensor', () => {\n const x = new SymbolicTensor('float32', [1], null, [], {});\n expect(x.dtype).toEqual('float32');\n });\n});\n\ndescribeMathCPU('countParams', () => {\n it('Scalar', () => {\n const x = zeros([]);\n expect(K.countParams(x)).toEqual(1);\n expect(K.countParams(new LayerVariable(x).read())).toEqual(1);\n });\n\n it('Tensor1D', () => {\n const x = zeros([3]);\n expect(K.countParams(x)).toEqual(3);\n expect(K.countParams(new LayerVariable(x).read())).toEqual(3);\n });\n\n it('Tensor2D', () => {\n const x = zeros([3, 2]);\n expect(K.countParams(x)).toEqual(6);\n expect(K.countParams(new LayerVariable(x).read())).toEqual(6);\n });\n\n it('Tensor3D', () => {\n const x = zeros([4, 3, 2]);\n expect(K.countParams(x)).toEqual(24);\n expect(K.countParams(new LayerVariable(x).read())).toEqual(24);\n });\n\n it('Tensor4D', () => {\n const x = zeros([4, 3, 2, 1]);\n expect(K.countParams(x)).toEqual(24);\n expect(K.countParams(new LayerVariable(x).read())).toEqual(24);\n });\n});\n\ndescribeMathCPUAndGPU('cast', () => {\n it('float32 to int32', () => {\n const x =\n tensor2d([[-1.1, -1.6], [1.1, 2.2], [3.6, 4.7]], [3, 2], 'float32');\n const y = K.cast(x, 'int32');\n expect(y.dtype).toEqual('int32');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([-1, -1, 1, 2, 3, 4]);\n });\n it('int32 to float32', () => {\n const x = tensor2d([[-1, -1], [1, 2], [3, 4]], [3, 2], 'int32');\n const y = K.cast(x, 'float32');\n expect(y.dtype).toEqual('float32');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([-1, -1, 1, 2, 3, 4]);\n });\n it('float32 to bool', () => {\n const x =\n tensor2d([[-1.1, -1.6], [0.0, 2.2], [3.6, 4.7]], [3, 2], 'float32');\n const y = K.cast(x, 'bool');\n expect(y.dtype).toEqual('bool');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([1, 1, 0, 1, 1, 1]);\n });\n it('bool to float32', () => {\n const x = tensor2d([[0, 1], [0, 1], [1, 0]], [3, 2], 'bool');\n const y = K.cast(x, 'float32');\n expect(y.dtype).toEqual('float32');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([0, 1, 0, 1, 1, 0]);\n });\n it('int32 to bool', () => {\n const x = tensor2d([[-1, -2], [0, 2], [3, 4]], [3, 2], 'int32');\n const y = K.cast(x, 'bool');\n expect(y.dtype).toEqual('bool');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([1, 1, 0, 1, 1, 1]);\n });\n it('bool to int32', () => {\n const x = tensor2d([[0, 1], [0, 1], [1, 0]], [3, 2], 'bool');\n const y = K.cast(x, 'int32');\n expect(y.dtype).toEqual('int32');\n expect(y.shape).toEqual([3, 2]);\n expect(Array.from(y.dataSync())).toEqual([0, 1, 0, 1, 1, 0]);\n });\n});\n\ndescribeMathCPUAndGPU('expandDims', () => {\n it('Scalar to 1D', () => {\n const x = scalar(10);\n expectTensorsClose(K.expandDims(x), tensor1d([10]));\n });\n it('1D to 2D: Last dimension', () => {\n const x = tensor1d([10, 20, 30]);\n expectTensorsClose(K.expandDims(x), tensor2d([[10], [20], [30]], [3, 1]));\n });\n it('1D to 2D: First dimension', () => {\n const x = tensor1d([10, 20, 30]);\n expectTensorsClose(K.expandDims(x, 0), tensor2d([[10, 20, 30]], [1, 3]));\n });\n it('2D to 3D: Last dimension', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n expectTensorsClose(\n K.expandDims(x), tensor3d([[[10], [20]], [[30], [40]]], [2, 2, 1]));\n });\n it('2D to 3D: Second dimension', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n expectTensorsClose(\n K.expandDims(x, 1), tensor3d([[[10, 20]], [[30, 40]]], [2, 1, 2]));\n });\n it('2D to 3D: First dimension', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n expectTensorsClose(\n K.expandDims(x, 0), tensor3d([[[10, 20], [30, 40]]], [1, 2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Repeat', () => {\n it('2D array', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const y = K.repeat(x, 3);\n expectTensorsClose(\n y,\n tensor3d(\n [[[1, 2], [1, 2], [1, 2]], [[3, 4], [3, 4], [3, 4]]], [2, 3, 2]));\n });\n it('Non-2D array leads to AssertionError', () => {\n const x = tensor1d([1, 2, 3]);\n expect(() => K.repeat(x, 2))\n .toThrowError(\n /repeat\\(\\) expects a rank-2 tensor, but received a rank-1 tensor/);\n });\n});\n\ndescribeMathCPUAndGPU('Flatten', () => {\n it('1D Tensor', () => {\n const x = tensor1d([1, 3, 3, 7]);\n const flattend = K.flatten(x);\n expect(flattend.shape).toEqual([4]);\n expect(flattend.dataSync()).toEqual(new Float32Array([1, 3, 3, 7]));\n });\n\n it('2D Tensor', () => {\n const x = tensor2d([1, 3, 3, 7], [2, 2]);\n const flattend = K.flatten(x);\n expect(flattend.shape).toEqual([4]);\n expect(flattend.dataSync()).toEqual(new Float32Array([1, 3, 3, 7]));\n });\n\n it('3D Tensor', () => {\n const x = tensor3d(\n [[[10, 20, 30], [40, 50, 60]], [[-10, -20, -30], [-40, -50, -60]]],\n [2, 2, 3]);\n const flattend = K.flatten(x);\n expect(flattend.shape).toEqual([12]);\n expect(flattend.dataSync()).toEqual(new Float32Array([\n 10, 20, 30, 40, 50, 60, -10, -20, -30, -40, -50, -60\n ]));\n });\n\n it('4D Tensor', () => {\n const x = tensor4d(\n [1, 2, 3, 4, 5, 6, 7, 8, -8, -7, -6, -5, -4, -3, -2, -1], [2, 2, 2, 2]);\n const flattend = K.flatten(x);\n expect(flattend.shape).toEqual([16]);\n expect(flattend.dataSync()).toEqual(new Float32Array([\n 1, 2, 3, 4, 5, 6, 7, 8, -8, -7, -6, -5, -4, -3, -2, -1\n ]));\n });\n});\n\ndescribeMathCPUAndGPU('batchFlatten', () => {\n it('Scalar Tensor leads to error', () => {\n const x = scalar(1337);\n expect(() => K.batchFlatten(x))\n .toThrowError(\n /batchFlatten requires a minimum rank of 2\\. Got rank: 0/);\n });\n\n it('1D Tensor leads to error', () => {\n const x = tensor1d([1, 3, 3, 7]);\n expect(() => K.batchFlatten(x))\n .toThrowError(\n /batchFlatten requires a minimum rank of 2\\. Got rank: 1/);\n });\n\n it('2D Tensor', () => {\n const x = tensor2d([1, 3, 3, 7], [2, 2]);\n const batchFlattened = K.batchFlatten(x);\n expect(batchFlattened.shape).toEqual([2, 2]);\n expect(batchFlattened.dataSync()).toEqual(new Float32Array([1, 3, 3, 7]));\n });\n\n it('3D Tensor', () => {\n const x = tensor3d(\n [[[10, 20, 30], [40, 50, 60]], [[-10, -20, -30], [-40, -50, -60]]],\n [2, 2, 3]);\n const batchFlattened = K.batchFlatten(x);\n expect(batchFlattened.shape).toEqual([2, 6]);\n expect(batchFlattened.dataSync()).toEqual(new Float32Array([\n 10, 20, 30, 40, 50, 60, -10, -20, -30, -40, -50, -60\n ]));\n });\n\n it('4D Tensor', () => {\n const x = tensor4d(\n [1, 2, 3, 4, 5, 6, 7, 8, -8, -7, -6, -5, -4, -3, -2, -1], [2, 2, 2, 2]);\n const batchFlattened = K.batchFlatten(x);\n expect(batchFlattened.shape).toEqual([2, 8]);\n expect(batchFlattened.dataSync()).toEqual(new Float32Array([\n 1, 2, 3, 4, 5, 6, 7, 8, -8, -7, -6, -5, -4, -3, -2, -1\n ]));\n });\n});\n\ndescribeMathCPUAndGPU('sliceAlongFirstAxis', () => {\n const array1DData = [10, 20, 30, 40];\n it('1D', () => {\n const x = tensor1d(array1DData);\n expectTensorsClose(K.sliceAlongFirstAxis(x, 1, 2), tensor1d([20, 30]));\n });\n\n const array2DData = [[10, 11], [20, 21], [30, 31], [40, 41]];\n it('2D', () => {\n const x = tensor2d(array2DData, [4, 2]);\n expectTensorsClose(\n K.sliceAlongFirstAxis(x, 1, 2), tensor2d([[20, 21], [30, 31]], [2, 2]));\n });\n\n const array3DData = [[[10]], [[20]], [[30]], [[40]]];\n it('3D', () => {\n const x = tensor3d(array3DData, [4, 1, 1]);\n expectTensorsClose(\n K.sliceAlongFirstAxis(x, 1, 2), tensor3d([[[20]], [[30]]], [2, 1, 1]));\n });\n\n const array4DData = [[[[10]]], [[[20]]], [[[30]]], [[[40]]]];\n it('4D', () => {\n const x = tensor4d(array4DData, [4, 1, 1, 1]);\n expectTensorsClose(\n K.sliceAlongFirstAxis(x, 1, 2),\n tensor4d([[[[20]]], [[[30]]]], [2, 1, 1, 1]));\n });\n\n const array5DData = [[[[[10]]]], [[[[20]]]], [[[[30]]]], [[[[40]]]]];\n it('5D', () => {\n const x = tensor5d(array5DData, [4, 1, 1, 1, 1]);\n expectTensorsClose(\n K.sliceAlongFirstAxis(x, 1, 2),\n tensor5d([[[[[20]]]], [[[[30]]]]], [2, 1, 1, 1, 1]));\n });\n\n const array6DData = [[[[[[10]]]]], [[[[[20]]]]], [[[[[30]]]]], [[[[[40]]]]]];\n it('6D', () => {\n const x = tensor6d(array6DData, [4, 1, 1, 1, 1, 1]);\n expectTensorsClose(\n K.sliceAlongFirstAxis(x, 1, 2),\n tensor6d([[[[[[20]]]]], [[[[[30]]]]]], [2, 1, 1, 1, 1, 1]));\n });\n\n it('Scalar leads to error', () => {\n expect(() => {\n K.sliceAlongFirstAxis(scalar(24), 0, 1);\n }).toThrow();\n });\n});\n\ndescribeMathCPUAndGPU('sliceAlongLastAxis', () => {\n const array1DData = [10, 20, 30, 40];\n it('1D', () => {\n const x = tensor1d(array1DData);\n expectTensorsClose(K.sliceAlongLastAxis(x, 1, 2), tensor1d([20, 30]));\n });\n\n const array2DData = [[10, 11, 12, 13], [20, 21, 22, 23]];\n it('2D', () => {\n const x = tensor2d(array2DData, [2, 4]);\n expectTensorsClose(\n K.sliceAlongLastAxis(x, 1, 2), tensor2d([[11, 12], [21, 22]], [2, 2]));\n });\n\n const array3DData = [[[10, 20, 30, 40]]];\n it('3D', () => {\n const x = tensor3d(array3DData, [1, 1, 4]);\n expectTensorsClose(\n K.sliceAlongLastAxis(x, 1, 2), tensor3d([[[20, 30]]], [1, 1, 2]));\n });\n\n const array4DData = [[[[10, 20, 30, 40]]]];\n it('3D', () => {\n const x = tensor4d(array4DData, [1, 1, 1, 4]);\n expectTensorsClose(\n K.sliceAlongLastAxis(x, 1, 2), tensor4d([[[[20, 30]]]], [1, 1, 1, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('sliceAlongAxis', () => {\n it('1D', () => {\n const array1DData = [10, 20, 30, 40];\n const x = tensor1d(array1DData);\n expectTensorsClose(K.sliceAlongAxis(x, 1, 2, 1), tensor1d([20, 30]));\n });\n\n const array2DData = [[10, 11], [20, 21], [30, 31], [40, 41]];\n it('2D-1', () => {\n const x = tensor2d(array2DData, [4, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 1, 2, 1), tensor2d([[20, 21], [30, 31]], [2, 2]));\n });\n\n it('2D-2', () => {\n const x = tensor2d(array2DData, [4, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 0, 1, 2),\n tensor2d([[10], [20], [30], [40]], [4, 1]));\n });\n\n const array3DData = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];\n it('3D-1', () => {\n const x = tensor3d(array3DData, [2, 2, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 0, 1, 1), tensor3d([[[1, 2], [3, 4]]], [1, 2, 2]));\n });\n it('3D-2', () => {\n const x = tensor3d(array3DData, [2, 2, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 0, 1, 2),\n tensor3d([[[1, 2]], [[5, 6]]], [2, 1, 2]));\n });\n it('3D-3', () => {\n const x = tensor3d(array3DData, [2, 2, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 0, 1, 3),\n tensor3d([[[1], [3]], [[5], [7]]], [2, 2, 1]));\n });\n\n it('4D', () => {\n const array4DData = [[[[10, 1]]], [[[20, 2]]], [[[30, 3]]], [[[40, 4]]]];\n const x = tensor4d(array4DData, [4, 1, 1, 2]);\n expectTensorsClose(\n K.sliceAlongAxis(x, 0, 1, 4),\n tensor4d([[[[10]]], [[[20]]], [[[30]]], [[[40]]]], [4, 1, 1, 1]));\n });\n});\n\ndescribeMathCPUAndGPU('concatenate', () => {\n it('1D', () => {\n const x = tensor1d([1, 2, 3, 4]);\n const y = tensor1d([-1, -2, -3, -4]);\n const expected = tensor1d([1, 2, 3, 4, -1, -2, -3, -4]);\n expectTensorsClose(K.concatenate([x, y]), expected);\n expectTensorsClose(K.concatenate([x, y], -1), expected);\n expectTensorsClose(K.concatenate([x, y], 0), expected);\n });\n it('2D', () => {\n const x = tensor2d([1, 2, 3, 4], [2, 2]);\n const y = tensor2d([-1, -2, -3, -4], [2, 2]);\n let expected = tensor2d([1, 2, -1, -2, 3, 4, -3, -4], [2, 4]);\n expectTensorsClose(K.concatenate([x, y]), expected);\n expectTensorsClose(K.concatenate([x, y], -1), expected);\n expectTensorsClose(K.concatenate([x, y], 1), expected);\n expected = tensor2d([1, 2, 3, 4, -1, -2, -3, -4], [4, 2]);\n expectTensorsClose(K.concatenate([x, y], 0), expected);\n });\n it('3D', () => {\n const x = tensor3d([1, 2, 3, 4], [2, 2, 1]);\n const y = tensor3d([-1, -2, -3, -4], [2, 2, 1]);\n let expected = tensor3d([1, -1, 2, -2, 3, -3, 4, -4], [2, 2, 2]);\n expectTensorsClose(K.concatenate([x, y]), expected);\n expectTensorsClose(K.concatenate([x, y], -1), expected);\n expectTensorsClose(K.concatenate([x, y], 2), expected);\n expected = tensor3d([1, 2, -1, -2, 3, 4, -3, -4], [2, 4, 1]);\n expectTensorsClose(K.concatenate([x, y], 1), expected);\n expected = tensor3d([1, 2, 3, 4, -1, -2, -3, -4], [4, 2, 1]);\n expectTensorsClose(K.concatenate([x, y], 0), expected);\n });\n it('3D', () => {\n const x = tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]);\n const y = tensor4d([-1, -2, -3, -4, -5, -6, -7, -8], [2, 2, 2, 1]);\n let expected = tensor4d(\n [1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, -8], [2, 2, 2, 2]);\n expectTensorsClose(K.concatenate([x, y]), expected);\n expectTensorsClose(K.concatenate([x, y], -1), expected);\n expectTensorsClose(K.concatenate([x, y], 3), expected);\n expected = tensor4d(\n [1, 2, -1, -2, 3, 4, -3, -4, 5, 6, -5, -6, 7, 8, -7, -8], [2, 2, 4, 1]);\n expectTensorsClose(K.concatenate([x, y], 2), expected);\n expected = tensor4d(\n [1, 2, 3, 4, -1, -2, -3, -4, 5, 6, 7, 8, -5, -6, -7, -8], [2, 4, 2, 1]);\n expectTensorsClose(K.concatenate([x, y], 1), expected);\n expected = tensor4d(\n [1, 2, 3, 4, 5, 6, 7, 8, -1, -2, -3, -4, -5, -6, -7, -8], [4, 2, 2, 1]);\n expectTensorsClose(K.concatenate([x, y], 0), expected);\n });\n});\n\ndescribeMathCPUAndGPU('concatAlongFirstAxis', () => {\n const array1DData1 = [10, 20, 30, 40];\n const array1DData2 = [-10, -20, -30, -40];\n it('1D', () => {\n const a = tensor1d(array1DData1);\n const b = tensor1d(array1DData2);\n expectTensorsClose(\n K.concatAlongFirstAxis(a, b),\n tensor1d([10, 20, 30, 40, -10, -20, -30, -40]));\n });\n\n const array2DData1 = [[10, 11], [20, 21]];\n const array2DData2 = [[30, 31], [40, 41]];\n it('2D', () => {\n const a = tensor2d(array2DData1, [2, 2]);\n const b = tensor2d(array2DData2, [2, 2]);\n expectTensorsClose(\n K.concatAlongFirstAxis(a, b),\n tensor2d([[10, 11], [20, 21], [30, 31], [40, 41]], [4, 2]));\n });\n\n const array3DData1 = [[[10]], [[20]]];\n const array3DData2 = [[[30]], [[40]]];\n it('3D', () => {\n const a = tensor3d(array3DData1, [2, 1, 1]);\n const b = tensor3d(array3DData2, [2, 1, 1]);\n expectTensorsClose(\n K.concatAlongFirstAxis(a, b),\n tensor3d([[[10]], [[20]], [[30]], [[40]]], [4, 1, 1]));\n });\n\n const array4DData1 = [[[[10]]], [[[20]]]];\n const array4DData2 = [[[[30]]], [[[40]]]];\n it('4D', () => {\n const a = tensor4d(array4DData1, [2, 1, 1, 1]);\n const b = tensor4d(array4DData2, [2, 1, 1, 1]);\n expectTensorsClose(\n K.concatAlongFirstAxis(a, b),\n tensor4d([[[[10]]], [[[20]]], [[[30]]], [[[40]]]], [4, 1, 1, 1]));\n });\n\n it('Scalar leads to error', () => {\n expect(() => {\n K.concatAlongFirstAxis(scalar(24), scalar(-24));\n }).toThrow();\n });\n});\n\ndescribeMathCPUAndGPU('tile', () => {\n it('1D, n is number', () => {\n const x = tensor1d([1, 3, 3, 7]);\n const n = 3;\n const y = K.tile(x, n);\n expectTensorsClose(y, tensor1d([1, 3, 3, 7, 1, 3, 3, 7, 1, 3, 3, 7]));\n });\n it('1D, n is number Array', () => {\n const x = tensor1d([1, 3, 3, 7]);\n const n = [3];\n const y = K.tile(x, n);\n expectTensorsClose(y, tensor1d([1, 3, 3, 7, 1, 3, 3, 7, 1, 3, 3, 7]));\n });\n it('2D', () => {\n const x = tensor2d([[1, 3], [3, 7]], [2, 2]);\n const n = [2, 3];\n const y = K.tile(x, n);\n expectTensorsClose(\n y,\n tensor2d(\n [\n [1, 3, 1, 3, 1, 3], [3, 7, 3, 7, 3, 7], [1, 3, 1, 3, 1, 3],\n [3, 7, 3, 7, 3, 7]\n ],\n [4, 6]));\n });\n it('3D', () => {\n const x = tensor3d([[[1]]], [1, 1, 1]);\n const n = [2, 3, 4];\n const y = K.tile(x, n);\n expectTensorsClose(y, tfc.ones([2, 3, 4]));\n });\n it('Mismatch in x dimensions and n length leads to exception', () => {\n expect(() => K.tile(tfc.zeros([2, 2]), 1))\n .toThrowError(/The length of input n \\(1\\) does not match .*2/);\n });\n});\n\ndescribeMathCPUAndGPU('randomNormal', () => {\n const dtypes: DataType[] = ['float32', 'int32'];\n for (const dtype of dtypes) {\n // TODO(bileschi): Add probabilistic assertions on values here.\n it(`Scalar ${dtype}`, () => {\n const s = K.randomNormal([], 0, 10, dtype as 'float32' | 'int32');\n expect(s.shape).toEqual([]);\n });\n\n it(`1D ${dtype}`, () => {\n const v = K.randomNormal([20], 0, 2, dtype as 'float32' | 'int32');\n expect(v.shape).toEqual([20]);\n });\n\n it(`2D ${dtype}`, () => {\n const x = K.randomNormal([3, 20], -10, 20, dtype as 'float32' | 'int32');\n expect(x.shape).toEqual([3, 20]);\n });\n\n it(`3D ${dtype}`, () => {\n const y =\n K.randomNormal([2, 3, 4], 100, 10, dtype as 'float32' | 'int32');\n expect(y.shape).toEqual([2, 3, 4]);\n });\n }\n});\n\ndescribeMathCPUAndGPU('dot', () => {\n it('2D x 2D', () => {\n const x = tensor2d([[1, 0], [0, -1]], [2, 2]);\n const y = tensor2d([[3], [4]], [2, 1]);\n const output = K.dot(x, y);\n expectTensorsClose(output, tensor2d([[3], [-4]], [2, 1]));\n });\n it('2D x 2D: Incompatible dimensions', () => {\n const x = tensor2d([[1, 0], [0, -1]], [2, 2]);\n const y = tensor2d([[3], [4], [5]], [3, 1]);\n expect(() => K.dot(x, y)).toThrowError(/inner shapes.*must match/);\n });\n it('3D x 2D', () => {\n const x = tensor3d([[[1, 0], [0, -1]], [[-2, 0], [0, -2]]], [2, 2, 2]);\n const y = tensor2d([[-1], [1]], [2, 1]);\n expectTensorsClose(\n K.dot(x, y), tensor3d([[[-1], [-1]], [[2], [-2]]], [2, 2, 1]));\n });\n it('4D x 2D', () => {\n const x = tensor4d([1, 2, 3, 6], [1, 1, 2, 2]);\n const y = tensor2d([-1, 1], [2, 1]);\n expectTensorsClose(K.dot(x, y), tensor4d([1, 3], [1, 1, 2, 1]));\n });\n it('5D x 2D', () => {\n const x = tensor5d([1, 2, 3, 6], [1, 1, 1, 2, 2]);\n const y = tensor2d([-1, 1], [2, 1]);\n expectTensorsClose(K.dot(x, y), tensor5d([1, 3], [1, 1, 1, 2, 1]));\n });\n it('5D x 3D', () => {\n const x = tensor5d([1, 2, 3, 6], [1, 1, 1, 2, 2]);\n const y = tensor3d([-1, 1], [1, 2, 1]);\n expectTensorsClose(K.dot(x, y), tensor6d([1, 3], [1, 1, 1, 2, 1, 1]));\n });\n it('4D x 4D', () => {\n const x = tensor4d([1, 2, 3, 4], [1, 2, 1, 2]);\n const y = tensor4d([1, 3], [1, 1, 2, 1]);\n expectTensorsClose(K.dot(x, y), tensor6d([7, 15], [1, 2, 1, 1, 1, 1]));\n });\n it('5D x 3D incompatible shapes yields error', () => {\n const x = tensor5d([1, 2, 3, 4], [1, 1, 1, 2, 2]);\n const y = tensor3d([-1, 1, 3], [1, 3, 1]);\n expect(() => K.dot(x, y))\n .toThrowError(/the second last dim of y must equal the last dim of x/);\n });\n it('2D x 1D leads to error', () => {\n const x = tensor2d([[1, 0], [0, -1]], [2, 2]);\n const y = tensor1d([3, 4]);\n expect(() => K.dot(x, y))\n .toThrowError(/dot requires both inputs to be rank >= 2/);\n });\n it(`1D x 2D leads to error`, () => {\n const x = tensor1d([3, 4]);\n const y = tensor2d([[1, 0], [0, -1]], [2, 2]);\n expect(() => K.dot(x, y))\n .toThrowError(/dot requires both inputs to be rank >= 2/);\n });\n it('2D x Scalar leads to error', () => {\n const x = tensor2d([[1]], [1, 1]);\n const y = scalar(10);\n expect(() => K.dot(x, y))\n .toThrowError(/dot requires both inputs to be rank >= 2/);\n });\n it('1D x 1D leads to error', () => {\n const x = tensor1d([1, 2]);\n const y = tensor1d([3, 4]);\n expect(() => K.dot(x, y))\n .toThrowError(/dot requires both inputs to be rank >= 2/);\n });\n});\n\ndescribeMathCPUAndGPU('sign', () => {\n it('Scalar', () => {\n expectTensorsClose(K.sign(scalar(0)), scalar(0));\n expectTensorsClose(K.sign(scalar(0.5)), scalar(1));\n expectTensorsClose(K.sign(scalar(-0.5)), scalar(-1));\n });\n it('1D', () => {\n const x = tensor1d([1, 2, -1, 0, 3, -4]);\n expectTensorsClose(K.sign(x), tensor1d([1, 1, -1, 0, 1, -1]));\n });\n it('2D', () => {\n const x = tensor2d([[1, 2, -1], [0, 3, -4]], [2, 3]);\n expectTensorsClose(K.sign(x), tensor2d([[1, 1, -1], [0, 1, -1]], [2, 3]));\n });\n});\n\ndescribeMathCPUAndGPU('OneHot', () => {\n it('Unsupported indices', () => {\n const numClasses = 2;\n const indices = tensor2d([[-12, 12], [-10, 10]], [2, 2]);\n expect(() => {\n K.oneHot(indices, numClasses);\n }).toThrowError();\n });\n it('Unsupported numClasses', () => {\n const numClasses = 1;\n const indices = tensor1d([2, 2]);\n expect(() => {\n K.oneHot(indices, numClasses);\n }).toThrowError();\n });\n it('Supported use case', () => {\n const numClasses = 5;\n const indices = tensor1d([1, 3]);\n expectTensorsClose(\n K.oneHot(indices, numClasses).toInt(),\n tensor2d([[0, 1, 0, 0, 0], [0, 0, 0, 1, 0]], [2, 5], 'int32'));\n });\n});\n\ndescribeMathCPUAndGPU('Gather', () => {\n it('1D, Array of numbers with repeats', () => {\n expectTensorsClose(\n K.gather(tensor1d([0, 10, 20, 30]), [2, 2, 3, 1]),\n tensor1d([20, 20, 30, 10]));\n });\n it('2D, Array of numbers', () => {\n expectTensorsClose(\n K.gather(tensor2d([[10, 20], [30, 40], [50, 60]], [3, 2]), [2, 0]),\n tensor2d([[50, 60], [10, 20]], [2, 2]));\n });\n it('2D, Tensor1D', () => {\n expectTensorsClose(\n K.gather(\n tensor2d([[10, 20], [30, 40], [50, 60]], [3, 2]), tensor1d([2, 1])),\n tensor2d([[50, 60], [30, 40]], [2, 2]));\n });\n it('3D, Tensor1D', () => {\n expectTensorsClose(\n K.gather(\n tensor3d([[[10, 20], [30, 40]], [[50, 60], [70, 80]]], [2, 2, 2]),\n tensor1d([1, 0])),\n tensor3d([[[50, 60], [70, 80]], [[10, 20], [30, 40]]], [2, 2, 2]));\n });\n it('2D, Non-default axis', () => {\n expectTensorsClose(\n K.gather(tensor2d([[10, 20], [30, 40], [50, 60]], [3, 2]), [1], 1),\n tensor2d([[20], [40], [60]], [3, 1]));\n });\n});\n\ndescribeMathCPUAndGPU('Square', () => {\n it('Element-wise square', () => {\n expectTensorsClose(\n K.square(tensor2d([[1, -2], [-3, 4]], [2, 2])),\n tensor2d([1, 4, 9, 16], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Pow', () => {\n it('Element-wise Pow: Positive Scalar', () => {\n expectTensorsClose(\n K.pow(tensor2d([[1, 1.5], [2, 2.5]], [2, 2]), scalar(2, 'int32')),\n tensor2d([[1, 2.25], [4, 6.25]], [2, 2]));\n });\n it('Element-wise Pow: Negative Scalar', () => {\n expectTensorsClose(\n K.pow(tensor2d([[1, 1.5], [2, 2.5]], [2, 2]), scalar(-2, 'int32')),\n tensor2d(\n [[1, 1 / (1.5 * 1.5)], [1 / (2 * 2), 1 / (2.5 * 2.5)]], [2, 2]));\n });\n it('Element-wise Pow: Zero Scalar', () => {\n expectTensorsClose(\n K.pow(tensor2d([[1, 1.5], [2, 2.5]], [2, 2]), scalar(0, 'int32')),\n tensor2d([[1, 1], [1, 1]], [2, 2]));\n });\n it('Element-wise Pow: number', () => {\n expectTensorsClose(\n K.pow(tensor2d([[1, 1.5], [2, 2.5]], [2, 2]), 2),\n tensor2d([[1, 2.25], [4, 6.25]], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('softsign', () => {\n it('Element-wise softsign', () => {\n expectTensorsClose(\n tfc.tanh(tensor2d([[-2, -1], [1, 2]], [2, 2])),\n tensor2d(\n [Math.tanh(-2), Math.tanh(-1), Math.tanh(1), Math.tanh(2)],\n [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('dropout', () => {\n const dropoutLevels = [0, 0.75];\n for (const dropoutLevel of dropoutLevels) {\n it(`Level = ${dropoutLevel}`, () => {\n const x = tensor2d(range(1, 21), [10, 2]);\n const y = K.dropout(x, dropoutLevel);\n expect(y.dtype).toEqual(x.dtype);\n expect(y.shape).toEqual(x.shape);\n const xValue = x.dataSync();\n const yValue = y.dataSync();\n let nKept = 0;\n for (let i = 0; i < xValue.length; ++i) {\n if (yValue[i] !== 0) {\n nKept++;\n expect(yValue[i]).toBeCloseTo(1 / (1 - dropoutLevel) * xValue[i]);\n }\n }\n const numel = K.countParams(x);\n if (dropoutLevel === 0) {\n expect(nKept).toEqual(numel);\n } else {\n expect(nKept).toBeLessThan(numel);\n }\n });\n }\n\n it('Level=0.75, with noiseShape', () => {\n const x = tensor2d(range(1, 21), [10, 2]);\n const level = 0.75;\n const noiseShape = [10, 1];\n const y = K.dropout(x, level, noiseShape);\n expect(y.dtype).toEqual(x.dtype);\n expect(y.shape).toEqual(x.shape);\n const xValue = x.dataSync();\n const yValue = y.dataSync();\n let nKept = 0;\n for (let i = 0; i < x.shape[0]; i++) {\n const maskedValue = yValue[i * x.shape[1]];\n for (let j = 0; j < x.shape[1]; j++) {\n const indice = i * x.shape[1] + j;\n if (maskedValue !== 0) {\n nKept++;\n expect(yValue[indice]).toBeCloseTo(1 / (1 - level) * xValue[indice]);\n } else {\n expect(yValue[indice]).toEqual(0);\n }\n }\n }\n const numel = K.countParams(x);\n expect(nKept).toBeLessThan(numel);\n });\n\n it('Level=0.75, with seed', () => {\n const x = tensor2d(range(1, 21), [10, 2]);\n const level = 0.75;\n const seed = 23;\n const y = K.dropout(x, level, null, seed);\n expect(y.dtype).toEqual(x.dtype);\n expect(y.shape).toEqual(x.shape);\n const yValuesExpected =\n [0, 0, 12, 16, 0, 0, 0, 0, 0, 0, 0, 48, 52, 0, 0, 0, 68, 0, 76, 0];\n expectTensorsClose(y, tensor2d(yValuesExpected, [10, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('biasAdd', () => {\n it('1D + 1D', () => {\n const x = tfc.ones([2]);\n const y = tensor1d([-1, 1]);\n expectTensorsClose(K.biasAdd(x, y), tensor1d([0, 2]));\n });\n it('2D + 1D', () => {\n const x = tfc.ones([2, 2]);\n const y = tensor1d([-1, 1]);\n expectTensorsClose(K.biasAdd(x, y), tensor2d([[0, 2], [0, 2]], [2, 2]));\n });\n it('3D + 1D', () => {\n const x = tfc.ones([2, 2, 2]);\n const y = tensor1d([-1, 1]);\n expectTensorsClose(\n K.biasAdd(x, y),\n tensor3d([[[0, 2], [0, 2]], [[0, 2], [0, 2]]], [2, 2, 2]));\n });\n it('4D + 1D', () => {\n const x = tfc.ones([1, 2, 2, 2]);\n const y = tensor1d([-1, 1]);\n expectTensorsClose(\n K.biasAdd(x, y),\n tensor4d([[[[0, 2], [0, 2]], [[0, 2], [0, 2]]]], [1, 2, 2, 2]));\n });\n it('2D + 1D: Incompatible size', () => {\n const x = tfc.ones([2, 2]);\n const y = tensor1d([-1, 0, 1]);\n expect(() => K.biasAdd(x, y)).toThrowError();\n });\n it('3D + 2D leads to error', () => {\n const x = tfc.ones([2, 2, 2]);\n const y = tfc.ones([2, 2]);\n expect(() => K.biasAdd(x, y)).toThrowError();\n });\n});\n\ndescribeMathCPUAndGPU('elu', () => {\n it('elu', () => {\n const xData = [-1, 0, 1, -1];\n expectTensorsClose(\n K.elu(tensor2d(xData, [2, 2])),\n tensor2d(xData.map(x => x < 0 ? Math.exp(x) - 1 : x), [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('softsign', () => {\n it('softsign', () => {\n const xData = [-1, 0, 1, -1];\n expectTensorsClose(\n K.softsign(tensor2d(xData, [2, 2])),\n tensor2d(xData.map(x => x / (Math.abs(x) + 1)), [2, 2]));\n });\n it('Does not leak', () => {\n const input = tensor2d([-1, 0, 1, -1], [2, 2]);\n expectNoLeakedTensors(() => K.softsign(input), 1);\n });\n});\n\ndescribeMathCPUAndGPU('Sigmoid', () => {\n it('2D', () => {\n const xValues = [-5, -2, 0, 1, 2, 5];\n const x = tensor2d(xValues, [2, 3]);\n const y = tfc.sigmoid(x);\n const yValuesExpected = xValues.map(v => 1 / (1 + Math.exp(-v)));\n expectTensorsClose(y, tensor2d(yValuesExpected, [2, 3]));\n });\n});\n\ndescribeMathCPUAndGPU('hardSigmoid', () => {\n it('2D', () => {\n const xValues = [-5, -2, 0, 1, 2, 5];\n const x = tensor2d(xValues, [2, 3]);\n const y = K.hardSigmoid(x);\n const yValuesExpected = xValues.map(x => {\n const y = 0.2 * x + 0.5;\n if (y > 1) {\n return 1;\n } else if (y < 0) {\n return 0;\n } else {\n return y;\n }\n });\n expectTensorsClose(y, tensor2d(yValuesExpected, [2, 3]));\n });\n});\n\ndescribe('inTrainPhase', () => {\n it('training = true', () => {\n expect(K.inTrainPhase(() => -5, () => 5, true)).toEqual(-5);\n });\n it('training = false', () => {\n expect(K.inTrainPhase(() => -5, () => 5, false)).toEqual(5);\n });\n it('training = default false', () => {\n expect(K.inTrainPhase(() => -5, () => 5)).toEqual(5);\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-layers/dist/base_callbacks.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.d.ts deleted file mode 100644 index f60c49e27..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.d.ts +++ /dev/null @@ -1,217 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { Container } from './engine/container'; -import { Logs, UnresolvedLogs } from './logs'; -/** Verbosity logging level when fitting a model. */ -export declare enum ModelLoggingVerbosity { - SILENT = 0, - VERBOSE = 1 -} -/** How often to yield to the main thread when training (in ms). */ -export declare const DEFAULT_YIELD_EVERY_MS = 125; -export declare type Params = { - [key: string]: number | string | boolean | number[] | string[] | boolean[]; -}; -export declare type YieldEveryOptions = 'auto' | 'batch' | 'epoch' | 'never' | number; -/** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ -export declare abstract class BaseCallback { - validationData: Tensor | Tensor[]; - /** - * Training parameters (eg. verbosity, batch size, number of epochs...). - */ - params: Params; - setParams(params: Params): void; - onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; - onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; - onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; - onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; - onTrainBegin(logs?: UnresolvedLogs): Promise; - onTrainEnd(logs?: UnresolvedLogs): Promise; - setModel(model: Container): void; -} -/** - * Container abstracting a list of callbacks. - */ -export declare class CallbackList { - callbacks: BaseCallback[]; - queueLength: number; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - constructor(callbacks?: BaseCallback[], queueLength?: number); - append(callback: BaseCallback): void; - setParams(params: Params): void; - setModel(model: Container): void; - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - onTrainBegin(logs?: UnresolvedLogs): Promise; - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - onTrainEnd(logs?: UnresolvedLogs): Promise; -} -/** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ -export declare class BaseLogger extends BaseCallback { - private seen; - private totals; - constructor(); - onEpochBegin(epoch: number): Promise; - onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; - onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; -} -/** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ -export declare class History extends BaseCallback { - epoch: number[]; - history: { - [key: string]: Array; - }; - onTrainBegin(logs?: UnresolvedLogs): Promise; - onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; - /** - * Await the values of all losses and metrics. - */ - syncData(): Promise; -} -export interface CustomCallbackArgs { - onTrainBegin?: (logs?: Logs) => void | Promise; - onTrainEnd?: (logs?: Logs) => void | Promise; - onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise; - onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise; - onBatchBegin?: (batch: number, logs?: Logs) => void | Promise; - onBatchEnd?: (batch: number, logs?: Logs) => void | Promise; - onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise; -} -/** - * Custom callback for training. - */ -export declare class CustomCallback extends BaseCallback { - protected readonly trainBegin: (logs?: Logs) => void | Promise; - protected readonly trainEnd: (logs?: Logs) => void | Promise; - protected readonly epochBegin: (epoch: number, logs?: Logs) => void | Promise; - protected readonly epochEnd: (epoch: number, logs?: Logs) => void | Promise; - protected readonly batchBegin: (batch: number, logs?: Logs) => void | Promise; - protected readonly batchEnd: (batch: number, logs?: Logs) => void | Promise; - protected readonly yield: (epoch: number, batch: number, logs: Logs) => void | Promise; - private yieldEvery; - private currentEpoch; - constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions); - maybeWait(epoch: number, batch: number, logs: UnresolvedLogs): Promise; - onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; - onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; - onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; - onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; - onTrainBegin(logs?: UnresolvedLogs): Promise; - onTrainEnd(logs?: UnresolvedLogs): Promise; -} -/** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ -export declare function standardizeCallbacks(callbacks: BaseCallback | BaseCallback[] | CustomCallbackArgs | CustomCallbackArgs[], yieldEvery: YieldEveryOptions): BaseCallback[]; -export declare type BaseCallbackConstructor = { - new (): BaseCallback; -}; -/** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ -export declare class CallbackConstructorRegistry { - private static constructors; - /** - * Blocks public access to constructor. - */ - private constructor(); - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - static registerCallbackConstructor(verbosityLevel: number, callbackConstructor: BaseCallbackConstructor): void; - private static checkForDuplicate; - /** - * Clear all registered callback constructors. - */ - protected static clear(): void; - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - static createCallbacks(verbosityLevel: number): BaseCallback[]; -} -export declare function configureCallbacks(callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number, initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number, batchSize: number, doValidation: boolean, callbackMetrics: string[]): { - callbackList: CallbackList; - history: History; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js deleted file mode 100644 index 1d1c8467c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js +++ /dev/null @@ -1,488 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: keras/callbacks.py */ -import { add, div, keep, mul, nextFrame, tidy, util } from '@tensorflow/tfjs-core'; -import { ValueError } from './errors'; -import { resolveScalarsInLogs } from './logs'; -import * as generic_utils from './utils/generic_utils'; -/** Verbosity logging level when fitting a model. */ -export var ModelLoggingVerbosity; -(function (ModelLoggingVerbosity) { - ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; -})(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); -/** How often to yield to the main thread when training (in ms). */ -export const DEFAULT_YIELD_EVERY_MS = 125; -/** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ -export class BaseCallback { - constructor() { - // TODO(michaelterry): This type is a best guess. - this.validationData = null; - } - setParams(params) { - this.params = params; - } - async onEpochBegin(epoch, logs) { } - async onEpochEnd(epoch, logs) { } - async onBatchBegin(batch, logs) { } - async onBatchEnd(batch, logs) { } - async onTrainBegin(logs) { } - async onTrainEnd(logs) { } - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - setModel(model) { - // Do nothing. Use Callback instead of BaseCallback to track the model. - } -} -/** - * Container abstracting a list of callbacks. - */ -export class CallbackList { - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - constructor(callbacks, queueLength = 10) { - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - append(callback) { - this.callbacks.push(callback); - } - setParams(params) { - for (const callback of this.callbacks) { - callback.setParams(params); - } - } - setModel(model) { - for (const callback of this.callbacks) { - callback.setModel(model); - } - } - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochBegin(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochBegin(epoch, logs); - } - } - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochEnd(epoch, logs); - } - } - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchBegin(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchBegin(batch, logs); - } - } - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchEnd(batch, logs); - } - } - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - async onTrainBegin(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainBegin(logs); - } - } - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - async onTrainEnd(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainEnd(logs); - } - } -} -/** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ -export class BaseLogger extends BaseCallback { - constructor() { - super(); - } - async onEpochBegin(epoch) { - this.seen = 0; - this.totals = {}; - } - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - const batchSize = logs['size'] == null ? 0 : logs['size']; - this.seen += batchSize; - for (const key in logs) { - const value = logs[key]; - if (typeof value === 'number') { - if (!this.totals.hasOwnProperty(key)) { - this.totals[key] = 0; - } - this.totals[key] = this.totals[key] + value * batchSize; - } - else { - let oldTotalsToDispose; - if (key in this.totals) { - oldTotalsToDispose = this.totals[key]; - } - else { - this.totals[key] = 0; - } - const total = tidy(() => add((this.totals[key]), mul(value, batchSize))); - this.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - } - } - async onEpochEnd(epoch, logs) { - if (logs != null) { - for (const key of this.params['metrics']) { - if (this.totals[key] == null) { - continue; - } - if (typeof this.totals[key] === 'number') { - logs[key] = this.totals[key] / this.seen; - } - else { - tidy(() => { - const log = mul(div(1, this.seen), this.totals[key]); - logs[key] = log; - this.totals[key].dispose(); - keep(logs[key]); - }); - } - } - } - } -} -/** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ -export class History extends BaseCallback { - async onTrainBegin(logs) { - this.epoch = []; - this.history = {}; - } - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (const key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - } - /** - * Await the values of all losses and metrics. - */ - async syncData() { - const promises = []; - const keys = []; - const indices = []; - for (const key in this.history) { - const valueArray = this.history[key]; - for (let i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - const valueScalar = valueArray[i]; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - const values = await Promise.all(promises); - for (let n = 0; n < values.length; ++n) { - const tensorToDispose = this.history[keys[n]][indices[n]]; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - } -} -/** - * Custom callback for training. - */ -export class CustomCallback extends BaseCallback { - constructor(args, yieldEvery) { - super(); - this.currentEpoch = 0; - this.yieldEvery = yieldEvery || 'auto'; - if (this.yieldEvery === 'auto') { - this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (this.yieldEvery === 'never' && args.onYield != null) { - throw new Error('yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (util.isNumber(this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - this.maybeWait = generic_utils.debounce(this.maybeWait.bind(this), this.yieldEvery); - } - this.trainBegin = args.onTrainBegin; - this.trainEnd = args.onTrainEnd; - this.epochBegin = args.onEpochBegin; - this.epochEnd = args.onEpochEnd; - this.batchBegin = args.onBatchBegin; - this.batchEnd = args.onBatchEnd; - this.yield = args.onYield; - } - async maybeWait(epoch, batch, logs) { - const ps = []; - if (this.yield != null) { - await resolveScalarsInLogs(logs); - ps.push(this.yield(epoch, batch, logs)); - } - ps.push(nextFrame()); - await Promise.all(ps); - } - async onEpochBegin(epoch, logs) { - this.currentEpoch = epoch; - if (this.epochBegin != null) { - await resolveScalarsInLogs(logs); - await this.epochBegin(epoch, logs); - } - } - async onEpochEnd(epoch, logs) { - const ps = []; - if (this.epochEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.epochEnd(epoch, logs)); - } - if (this.yieldEvery === 'epoch') { - ps.push(nextFrame()); - } - await Promise.all(ps); - } - async onBatchBegin(batch, logs) { - if (this.batchBegin != null) { - await resolveScalarsInLogs(logs); - await this.batchBegin(batch, logs); - } - } - async onBatchEnd(batch, logs) { - const ps = []; - if (this.batchEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.batchEnd(batch, logs)); - } - if (this.yieldEvery === 'batch') { - ps.push(nextFrame()); - } - else if (util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - await Promise.all(ps); - } - async onTrainBegin(logs) { - if (this.trainBegin != null) { - await resolveScalarsInLogs(logs); - await this.trainBegin(logs); - } - } - async onTrainEnd(logs) { - if (this.trainEnd != null) { - await resolveScalarsInLogs(logs); - await this.trainEnd(logs); - } - } -} -/** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ -export function standardizeCallbacks(callbacks, yieldEvery) { - if (callbacks == null) { - callbacks = {}; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks; - } - // Convert custom callback configs to custom callback objects. - const callbackConfigs = generic_utils.toList(callbacks); - return callbackConfigs.map(callbackConfig => new CustomCallback(callbackConfig, yieldEvery)); -} -/** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ -export class CallbackConstructorRegistry { - /** - * Blocks public access to constructor. - */ - constructor() { } - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - static registerCallbackConstructor(verbosityLevel, callbackConstructor) { - util.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), () => `Verbosity level is expected to be an integer >= 0, ` + - `but got ${verbosityLevel}`); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push(callbackConstructor); - } - static checkForDuplicate(callbackConstructor) { - for (const levelName in CallbackConstructorRegistry.constructors) { - const constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(ctor => { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - } - /** - * Clear all registered callback constructors. - */ - static clear() { - CallbackConstructorRegistry.constructors = {}; - } - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - static createCallbacks(verbosityLevel) { - const constructors = []; - for (const levelName in CallbackConstructorRegistry.constructors) { - const level = +levelName; - if (verbosityLevel >= level) { - constructors.push(...CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(ctor => new ctor()); - } -} -CallbackConstructorRegistry.constructors = {}; -export function configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { - const history = new History(); - const actualCallbacks = [ - new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose) - ]; - if (callbacks != null) { - actualCallbacks.push(...callbacks); - } - actualCallbacks.push(history); - const callbackList = new CallbackList(actualCallbacks); - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - callbackList.setParams({ - epochs, - initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize, - verbose, - doValidation, - metrics: callbackMetrics, - }); - return { callbackList, history }; -} -//# sourceMappingURL=base_callbacks.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-layers/dist/base_callbacks.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map deleted file mode 100644 index ab7c57bf2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base_callbacks.js","sourceRoot":"","sources":["../src/base_callbacks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,yCAAyC;AAEzC,OAAO,EAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAkB,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAGjG,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAO,oBAAoB,EAAiB,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,aAAa,MAAM,uBAAuB,CAAC;AAEvD,oDAAoD;AACpD,MAAM,CAAN,IAAY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AM;QACN,YAAY;QACZ,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,aAAa;QACpB,SAAS;QACT,OAAO;QACP,YAAY;QACZ,OAAO,EAAE,eAAe;KACzB,CAAC,CAAC;IACH,OAAO,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\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-layers/dist/base_callbacks_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map deleted file mode 100644 index df5ad5091..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base_callbacks_test.js","sourceRoot":"","sources":["../src/base_callbacks_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,2BAA2B,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,oBAAoB,EAAQ,oBAAoB,EAAiB,MAAM,QAAQ,CAAC;AACxF,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAEzD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QACpC,UAAU,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAC,CAAC,CAAC;QACtD,MAAM,UAAU,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAC9D,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,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AK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;QAC5D,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEzB,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC;QACjD,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEvC,WAAW,GAAG,EAAE,CAAC;QACjB,WAAW,GAAG,EAAE,CAAC;QAEjB,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC;QACjD,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for callbacks.\n */\n\nimport {scalar, zeros} from '@tensorflow/tfjs-core';\n\nimport {BaseCallback, BaseLogger, CallbackConstructorRegistry, CallbackList, History} from './base_callbacks';\nimport {Callback} from './callbacks';\nimport {LayersModel} from './engine/training';\nimport * as tfl from './index';\nimport {disposeTensorsInLogs, Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport {describeMathCPUAndGPU} from './utils/test_utils';\n\ndescribe('BaseLogger Callback', () => {\n it('Records and averages losses in an epoch', async () => {\n const baseLogger = new BaseLogger();\n baseLogger.setParams({metrics: ['loss', 'val_loss']});\n await baseLogger.onTrainBegin();\n await baseLogger.onEpochBegin(0);\n await baseLogger.onBatchBegin(0);\n await baseLogger.onBatchEnd(0, {batch: 0, size: 10, loss: 5});\n await baseLogger.onBatchBegin(1);\n await baseLogger.onBatchEnd(1, {batch: 1, size: 10, loss: 6});\n await baseLogger.onBatchBegin(2);\n await baseLogger.onBatchEnd(2, {batch: 2, size: 5, loss: 7});\n const epochLog: UnresolvedLogs = {val_loss: 3};\n await baseLogger.onEpochEnd(0, epochLog);\n expect(epochLog['val_loss'] as number).toEqual(3);\n expect(epochLog['loss'] as number)\n .toBeCloseTo((10 * 5 + 10 * 6 + 5 * 7) / (10 + 10 + 5));\n });\n it('Forgets old epochs', async () => {\n const baseLogger = new BaseLogger();\n baseLogger.setParams({metrics: ['loss', 'val_loss']});\n const numOldEpochs = 2;\n await baseLogger.onTrainBegin();\n for (let i = 0; i < numOldEpochs; ++i) {\n await baseLogger.onEpochBegin(i);\n await baseLogger.onBatchBegin(0);\n await baseLogger.onBatchEnd(0, {batch: 0, size: 10, loss: -5});\n const epochLog: UnresolvedLogs = {val_loss: 3};\n await baseLogger.onEpochEnd(i, epochLog);\n }\n await baseLogger.onEpochBegin(numOldEpochs);\n await baseLogger.onBatchBegin(0);\n await baseLogger.onBatchEnd(0, {batch: 0, size: 10, loss: 5});\n await baseLogger.onBatchBegin(1);\n await baseLogger.onBatchEnd(1, {batch: 1, size: 10, loss: 6});\n await baseLogger.onBatchBegin(2);\n await baseLogger.onBatchEnd(2, {batch: 2, size: 5, loss: 7});\n const epochLog: UnresolvedLogs = {val_loss: 3};\n await baseLogger.onEpochEnd(numOldEpochs, epochLog);\n expect(epochLog['val_loss'] as number).toEqual(3);\n expect(epochLog['loss'] as number)\n .toBeCloseTo((10 * 5 + 10 * 6 + 5 * 7) / (10 + 10 + 5));\n });\n});\n\ndescribe('CallbackList', () => {\n it('Constructor with empty arg', async () => {\n const callbackList = new CallbackList();\n await callbackList.onTrainBegin();\n await callbackList.onTrainEnd();\n });\n it('Constructor and setParams with array of callbacks', () => {\n const history1 = new History();\n const history2 = new History();\n const callbackList = new CallbackList([history1, history2]);\n const params = {'verbose': 3};\n callbackList.setParams(params);\n expect(history1.params).toEqual(params);\n expect(history2.params).toEqual(params);\n });\n it('onTrainBegin', async () => {\n const history1 = new History();\n const history2 = new History();\n const callbackList = new CallbackList([history1, history2]);\n await callbackList.onTrainBegin();\n expect(history1.epoch).toEqual([]);\n expect(history1.history).toEqual({});\n expect(history2.epoch).toEqual([]);\n expect(history2.history).toEqual({});\n });\n it('onEpochEnd', async () => {\n const history1 = new History();\n const history2 = new History();\n const callbackList = new CallbackList([history1, history2]);\n await callbackList.onTrainBegin();\n await callbackList.onEpochEnd(100, {'val_loss': 10, 'val_accuracy': 0.1});\n expect(history1.epoch).toEqual([100]);\n expect(history1.history).toEqual({'val_loss': [10], 'val_accuracy': [0.1]});\n expect(history2.epoch).toEqual([100]);\n expect(history2.history).toEqual({'val_loss': [10], 'val_accuracy': [0.1]});\n await callbackList.onEpochEnd(101, {'val_loss': 9.5, 'val_accuracy': 0.2});\n expect(history1.epoch).toEqual([100, 101]);\n expect(history1.history)\n .toEqual({'val_loss': [10, 9.5], 'val_accuracy': [0.1, 0.2]});\n expect(history2.epoch).toEqual([100, 101]);\n expect(history2.history)\n .toEqual({'val_loss': [10, 9.5], 'val_accuracy': [0.1, 0.2]});\n });\n it('append', async () => {\n const history1 = new History();\n const history2 = new History();\n const callbackList = new CallbackList([history1]);\n await callbackList.onTrainBegin();\n expect(history1.epoch).toEqual([]);\n expect(history1.history).toEqual({});\n await callbackList.append(history2);\n await callbackList.onTrainBegin();\n expect(history2.epoch).toEqual([]);\n expect(history2.history).toEqual({});\n });\n});\n\ndescribeMathCPUAndGPU('resolveScalarsInLogs', () => {\n it('Resolve mixed numbers and scalars', async () => {\n const logs: UnresolvedLogs = {\n 'a': 1,\n 'b': scalar(2),\n 'c': -3,\n 'd': scalar(-4),\n };\n await resolveScalarsInLogs(logs);\n expect(logs['a']).toEqual(1);\n expect(logs['b']).toEqual(2);\n expect(logs['c']).toEqual(-3);\n expect(logs['d']).toEqual(-4);\n });\n\n it('Resolve null works fine', async () => {\n const logs: UnresolvedLogs = null;\n await resolveScalarsInLogs(logs);\n expect(logs).toEqual(null);\n });\n\n it('Resolve empty works fine', async () => {\n const logs: UnresolvedLogs = {};\n await resolveScalarsInLogs(logs);\n expect(logs).toEqual({});\n });\n});\n\ndescribeMathCPUAndGPU('disposeTensorsInLogs', () => {\n it('Resolve mixed numbers and scalars', () => {\n const logs: UnresolvedLogs = {\n 'a': 1,\n 'b': scalar(2),\n 'c': -3,\n 'd': scalar(-4),\n };\n disposeTensorsInLogs(logs);\n expect(logs['a']).toEqual(1);\n // tslint:disable-next-line:no-any\n expect((logs['b'] as any).isDisposed).toEqual(true);\n expect(logs['c']).toEqual(-3);\n // tslint:disable-next-line:no-any\n expect((logs['d'] as any).isDisposed).toEqual(true);\n });\n});\n\ndescribe('History Callback', () => {\n it('onTrainBegin', async () => {\n const history = new History();\n await history.onTrainBegin();\n expect(history.epoch).toEqual([]);\n expect(history.history).toEqual({});\n });\n it('onEpochEnd', async () => {\n const history = new History();\n await history.onTrainBegin();\n await history.onEpochEnd(0, {'val_loss': 10, 'val_accuracy': 0.1});\n expect(history.epoch).toEqual([0]);\n expect(history.history).toEqual({'val_loss': [10], 'val_accuracy': [0.1]});\n await history.onEpochEnd(1, {'val_loss': 9.5, 'val_accuracy': 0.2});\n expect(history.epoch).toEqual([0, 1]);\n expect(history.history)\n .toEqual({'val_loss': [10, 9.5], 'val_accuracy': [0.1, 0.2]});\n });\n});\n\nclass MockLayersModel extends LayersModel {\n constructor(name: string) {\n super({inputs: [], outputs: [], name});\n }\n}\n\nclass MockCallback extends Callback {}\n\ndescribe('CallbackList', () => {\n it('Constructor and setModel with array of callbacks', () => {\n const mockCallback1 = new MockCallback();\n const mockCallback2 = new MockCallback();\n const callbackList = new CallbackList([mockCallback1, mockCallback2]);\n const model = new MockLayersModel('MockModelA');\n callbackList.setModel(model);\n expect(mockCallback1.model).toEqual(model);\n expect(mockCallback2.model).toEqual(model);\n });\n});\n\nlet fake1Epochs: number[];\nclass FakeCallback1 extends BaseCallback {\n constructor() {\n super();\n fake1Epochs = [];\n }\n async onEpochEnd(epoch: number, logs: Logs) {\n fake1Epochs.push(epoch);\n }\n}\n\nlet fake2Epochs: number[];\nclass FakeCallback2 extends BaseCallback {\n constructor() {\n super();\n fake2Epochs = [];\n }\n async onEpochEnd(epoch: number, logs: Logs) {\n fake2Epochs.push(epoch);\n }\n}\n\ndescribe('CallbackConstructorRegistry', () => {\n beforeEach(() => {\n // tslint:disable-next-line:no-any\n (CallbackConstructorRegistry as any).clear();\n });\n\n it('Empty registry creates empty list of callbacks', () => {\n expect(CallbackConstructorRegistry.createCallbacks(0)).toEqual([]);\n expect(CallbackConstructorRegistry.createCallbacks(1)).toEqual([]);\n expect(CallbackConstructorRegistry.createCallbacks(2)).toEqual([]);\n });\n\n it('Registry with one element', () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n\n let callbacks = CallbackConstructorRegistry.createCallbacks(0);\n expect(callbacks.length).toEqual(0);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(1);\n expect(callbacks.length).toEqual(1);\n expect(callbacks[0] instanceof FakeCallback1).toEqual(true);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(2);\n expect(callbacks.length).toEqual(1);\n expect(callbacks[0] instanceof FakeCallback1).toEqual(true);\n });\n\n it('Registry with two elements on two levels', () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n tfl.registerCallbackConstructor(2, FakeCallback2);\n\n let callbacks = CallbackConstructorRegistry.createCallbacks(0);\n expect(callbacks.length).toEqual(0);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(1);\n expect(callbacks.length).toEqual(1);\n expect(callbacks[0] instanceof FakeCallback1).toEqual(true);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(2);\n expect(callbacks.length).toEqual(2);\n expect(callbacks[0] instanceof FakeCallback1).toEqual(true);\n expect(callbacks[1] instanceof FakeCallback2).toEqual(true);\n });\n\n it('Registry with two elements on the same level', () => {\n tfl.registerCallbackConstructor(2, FakeCallback1);\n tfl.registerCallbackConstructor(2, FakeCallback2);\n\n let callbacks = CallbackConstructorRegistry.createCallbacks(0);\n expect(callbacks.length).toEqual(0);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(1);\n expect(callbacks.length).toEqual(0);\n\n callbacks = CallbackConstructorRegistry.createCallbacks(2);\n expect(callbacks.length).toEqual(2);\n expect(callbacks[0] instanceof FakeCallback1).toEqual(true);\n expect(callbacks[1] instanceof FakeCallback2).toEqual(true);\n });\n\n it('Duplicate registration on same level leads to Error', () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n expect(() => tfl.registerCallbackConstructor(1, FakeCallback1))\n .toThrowError(/Duplicate callback constructor/);\n });\n\n it('Duplicate registration on different level leads to Error', () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n expect(() => tfl.registerCallbackConstructor(2, FakeCallback1))\n .toThrowError(/Duplicate callback constructor/);\n });\n\n it('Invalid verbosityLevel leads to Error', () => {\n expect(() => tfl.registerCallbackConstructor(-1, FakeCallback1))\n .toThrowError(/is expected to be an integer >= 0/);\n expect(() => tfl.registerCallbackConstructor(0.5, FakeCallback1))\n .toThrowError(/is expected to be an integer >= 0/);\n expect(() => tfl.registerCallbackConstructor(NaN, FakeCallback1))\n .toThrowError(/is expected to be an integer >= 0/);\n });\n});\n\ndescribeMathCPUAndGPU('CallbackConstructorRegistry initialization', () => {\n it('CallbackConstructorRegistry is initialized properly', () => {\n expect(CallbackConstructorRegistry.createCallbacks(1)).toEqual([]);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.fit and CallbackConstructorRegistry', () => {\n beforeEach(() => {\n // tslint:disable-next-line:no-any\n (CallbackConstructorRegistry as any).clear();\n fake1Epochs = [];\n fake2Epochs = [];\n });\n\n it('LayersModel.fit call with no callback ctor registered', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = zeros([4, 1]);\n const ys = zeros([4, 1]);\n await model.fit(xs, ys, {epochs: 3});\n\n expect(fake1Epochs).toEqual([]);\n });\n\n it('LayersModel.fit call with one callback ctor registered', async () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = zeros([4, 1]);\n const ys = zeros([4, 1]);\n await model.fit(xs, ys, {epochs: 3});\n\n expect(fake1Epochs).toEqual([0, 1, 2]);\n });\n\n it('LayersModel.fit call with two callback ctor registered', async () => {\n tfl.registerCallbackConstructor(1, FakeCallback1);\n tfl.registerCallbackConstructor(2, FakeCallback2);\n\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = zeros([4, 1]);\n const ys = zeros([4, 1]);\n\n await model.fit(xs, ys, {epochs: 3, verbose: 2});\n expect(fake1Epochs).toEqual([0, 1, 2]);\n expect(fake2Epochs).toEqual([0, 1, 2]);\n\n fake1Epochs = [];\n fake2Epochs = [];\n\n await model.fit(xs, ys, {epochs: 3, verbose: 1});\n expect(fake1Epochs).toEqual([0, 1, 2]);\n expect(fake2Epochs).toEqual([]);\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-layers/dist/callbacks.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts deleted file mode 100644 index be0cb83a5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseCallback } from './base_callbacks'; -import { Container } from './engine/container'; -import { LayersModel } from './engine/training'; -import { Logs } from './logs'; -export declare abstract class Callback extends BaseCallback { - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - model: LayersModel; - setModel(model: Container): void; -} -export interface EarlyStoppingCallbackArgs { - /** - * Quantity to be monitored. - * - * Defaults to 'val_loss'. - */ - monitor?: string; - /** - * Minimum change in the monitored quantity to qualify as improvement, - * i.e., an absolute change of less than `minDelta` will count as no - * improvement. - * - * Defaults to 0. - */ - minDelta?: number; - /** - * Number of epochs with no improvement after which training will be stopped. - * - * Defaults to 0. - */ - patience?: number; - /** Verbosity mode. */ - verbose?: number; - /** - * Mode: one of 'min', 'max', and 'auto'. - * - In 'min' mode, training will be stopped when the quantity monitored has - * stopped decreasing. - * - In 'max' mode, training will be stopped when the quantity monitored has - * stopped increasing. - * - In 'auto' mode, the direction is inferred automatically from the name of - * the monitored quantity. - * - * Defaults to 'auto'. - */ - mode?: 'auto' | 'min' | 'max'; - /** - * Baseline value of the monitored quantity. - * - * If specified, training will be stopped if the model doesn't show - * improvement over the baseline. - */ - baseline?: number; - /** - * Whether to restore model weights from the epoch with the best value - * of the monitored quantity. If `False`, the model weights obtained at the - * at the last step of training are used. - * - * **`True` is not supported yet.** - */ - restoreBestWeights?: boolean; -} -/** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ -export declare class EarlyStopping extends Callback { - protected readonly monitor: string; - protected readonly minDelta: number; - protected readonly patience: number; - protected readonly baseline: number; - protected readonly verbose: number; - protected readonly mode: 'auto' | 'min' | 'max'; - protected monitorFunc: (currVal: number, prevVal: number) => boolean; - private wait; - private stoppedEpoch; - private best; - constructor(args?: EarlyStoppingCallbackArgs); - onTrainBegin(logs?: Logs): Promise; - onEpochEnd(epoch: number, logs?: Logs): Promise; - onTrainEnd(logs?: Logs): Promise; - private getMonitorValue; -} -/** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ -export declare function earlyStopping(args?: EarlyStoppingCallbackArgs): EarlyStopping; -export declare const callbacks: { - earlyStopping: typeof earlyStopping; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js deleted file mode 100644 index c20b55081..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: keras/callbacks.py */ -import { BaseCallback } from './base_callbacks'; -import { LayersModel } from './engine/training'; -import { NotImplementedError } from './errors'; -import { resolveScalarsInLogs } from './logs'; -export class Callback extends BaseCallback { - constructor() { - super(...arguments); - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - this.model = null; - } - setModel(model) { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - } -} -function less(currVal, prevVal) { - return currVal < prevVal; -} -function greater(currVal, prevVal) { - return currVal > prevVal; -} -/** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ -export class EarlyStopping extends Callback { - constructor(args) { - super(); - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError('restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - this.monitor = args.monitor || 'val_loss'; - this.minDelta = Math.abs(args.minDelta || 0); - this.patience = args.patience || 0; - this.verbose = args.verbose || 0; - this.mode = args.mode || 'auto'; - this.baseline = args.baseline; - if (['auto', 'min', 'max'].indexOf(this.mode) === -1) { - console.warn(`EarlyStopping mode '${this.mode}' is invalid. ` + - `Falling back to mode 'auto'.`); - this.mode = 'auto'; - } - if (this.mode === 'min') { - this.monitorFunc = less; - } - else if (this.mode === 'max') { - this.monitorFunc = greater; - } - else { - // For mode === 'auto'. - if (this.monitor.indexOf('acc') !== -1) { - this.monitorFunc = greater; - } - else { - this.monitorFunc = less; - } - } - if (this.monitorFunc === less) { - this.minDelta *= -1; - } - } - async onTrainBegin(logs) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } - else { - this.best = this.monitorFunc === less ? Infinity : -Infinity; - } - } - async onEpochEnd(epoch, logs) { - await resolveScalarsInLogs(logs); - const current = this.getMonitorValue(logs); - if (current == null) { - return; - } - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } - else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - } - async onTrainEnd(logs) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log(`Epoch ${this.stoppedEpoch}: early stopping.`); - } - } - getMonitorValue(logs) { - if (logs == null) { - logs = {}; - } - const monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn(`Metric for EarlyStopping ${this.monitor} is not available. ` + - `Available metrics are: ${Object.keys(logs)}`); - } - return monitorValue; - } -} -/** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ -export function earlyStopping(args) { - return new EarlyStopping(args); -} -export const callbacks = { earlyStopping }; -//# sourceMappingURL=callbacks.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-layers/dist/callbacks.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map deleted file mode 100644 index 6ed2f9f73..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../src/callbacks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,yCAAyC;AAEzC,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAO,oBAAoB,EAAC,MAAM,QAAQ,CAAC;AAElD,MAAM,OAAgB,QAAS,SAAQ,YAAY;IAAnD;;QACE,8EAA8E;QAC9E,UAAK,GAAgB,IAAI,CAAC;IAQ5B,CAAC;IANC,QAAQ,CAAC,KAAgB;QACvB,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;SAC1E;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;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7C;aAAM;YACL,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;aAChC;YACD,4CAA4C;SAC7C;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;YACzC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC;SAC5D;IACH,CAAC;IAEO,eAAe,CAAC,IAAU;QAChC,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,GAAG,EAAE,CAAC;SACX;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,OAAO,CAAC,IAAI,CACR,4BAA4B,IAAI,CAAC,OAAO,qBAAqB;gBAC7D,0BAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,aAAa,CAAC,IAAgC;IAC5D,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,EAAC,aAAa,EAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks_test.js.map deleted file mode 100644 index e6d9542ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/callbacks_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"callbacks_test.js","sourceRoot":"","sources":["../src/callbacks_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAEzD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,SAAS,gBAAgB;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAC/B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;QACzD,KAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;QAC/C,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC9B,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC,CAAC,CAAC;QAC7C,MAAM,CAA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 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {tensor2d} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport {describeMathCPUAndGPU} from './utils/test_utils';\n\ndescribe('EarlyStopping', () => {\n function createDummyModel(): tfl.LayersModel {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n return model;\n }\n\n it('Default monitor, default mode, increasing val_loss', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping();\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n await callback.onEpochEnd(2, {val_loss: 9.5});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Default monitor, default mode, holding val_loss', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping();\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n await callback.onEpochEnd(2, {val_loss: 9});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Default monitor, default mode, custom minDelta', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping({minDelta: 1});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 8});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n // An decrease of 0.5 is < minDelta (1) and should trigger stop.\n await callback.onEpochEnd(2, {val_loss: 7.5});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Default monitor, default mode, custom baseline, stopping', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping({baseline: 5});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(1);\n // Failure to go below the baseline will stop the training immediately.\n await callback.onEpochEnd(1, {val_loss: 6});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Default monitor, default mode, custom baseline, not stopping',\n async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping({baseline: 5});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(1);\n // If the loss value goes below the baseline, training should continue.\n await callback.onEpochEnd(1, {val_loss: 4});\n expect(model.stopTraining).toBeUndefined();\n // If the loss value increases, training should stop;\n await callback.onEpochEnd(1, {val_loss: 4.5});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Custom monitor, default model, increasing', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping({monitor: 'aux_loss'});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10, aux_loss: 100});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9, aux_loss: 120});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Custom monitor, max, increasing', async () => {\n const model = createDummyModel();\n const callback =\n tfl.callbacks.earlyStopping({monitor: 'aux_metric', mode: 'max'});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10, aux_metric: 100});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9, aux_metric: 120});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n await callback.onEpochEnd(2, {val_loss: 9, aux_metric: 110});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Custom monitor, max, custom minDelta', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping(\n {monitor: 'aux_metric', mode: 'max', minDelta: 5});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10, aux_metric: 100});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9, aux_metric: 120});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n // An increase of 2 is < minDelta (5) and should cause stopping.\n await callback.onEpochEnd(2, {val_loss: 9, aux_metric: 122});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Custom monitor, max, custom negative minDelta', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping(\n {monitor: 'aux_metric', mode: 'max', minDelta: -5});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10, aux_metric: 100});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9, aux_metric: 120});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n // An increase of 2 is < minDelta (5) and should cause stopping.\n await callback.onEpochEnd(2, {val_loss: 9, aux_metric: 122});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Patience = 2', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping({patience: 2});\n callback.setModel(model);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n await callback.onEpochEnd(0, {val_loss: 10});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {val_loss: 9});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(2);\n await callback.onEpochEnd(2, {val_loss: 9.5});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(3);\n await callback.onEpochEnd(3, {val_loss: 9.6});\n expect(model.stopTraining).toEqual(true);\n });\n\n it('Missing monitor leads to warning', async () => {\n const model = createDummyModel();\n const callback = tfl.callbacks.earlyStopping();\n callback.setModel(model);\n\n const warnMessages: string[] = [];\n function fakeWarn(message: string) {\n warnMessages.push(message);\n }\n spyOn(console, 'warn').and.callFake(fakeWarn);\n\n await callback.onTrainBegin();\n await callback.onEpochBegin(0);\n // Note that the default monitor (val_loss) is missing.\n await callback.onEpochEnd(0, {loss: 100});\n expect(model.stopTraining).toBeUndefined();\n await callback.onEpochBegin(1);\n await callback.onEpochEnd(1, {loss: 100});\n expect(model.stopTraining).toBeUndefined();\n\n expect(warnMessages.length).toEqual(2);\n expect(warnMessages[0]).toMatch(/val_loss is not available/);\n expect(warnMessages[1]).toMatch(/val_loss is not available/);\n });\n});\n\ndescribeMathCPUAndGPU('EarlyStopping LayersModel.fit() integration', () => {\n it('Functional model, monitor loss, With minDelta', async () => {\n const input = tfl.input({shape: [1]});\n const output =\n tfl.layers.dense({units: 1, kernelInitializer: 'ones'}).apply(input) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: input, outputs: output});\n const xs = tensor2d([1, 2, 3, 4], [4, 1]);\n const ys = tensor2d([2, 3, 4, 5], [4, 1]);\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n // Without the EarlyStopping callback, the loss value would be:\n // 1, 0.734, 0.549, 0.421, 0.332, ...\n // With loss being monitored and minDelta set to 0.25, the training should\n // stop after the 3rd epoch.\n const history = await model.fit(xs, ys, {\n epochs: 10,\n callbacks: tfl.callbacks.earlyStopping({monitor: 'loss', minDelta: 0.25})\n });\n expect(history.history.loss.length).toEqual(3);\n });\n\n it('Sequential model, monitor val_acc', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n activation: 'softmax',\n kernelInitializer: 'ones',\n inputShape: [2]\n }));\n const xs = tensor2d([1, 2, 3, 4], [2, 2]);\n const ys = tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n const xsVal = tensor2d([4, 3, 2, 1], [2, 2]);\n const ysVal = tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n model.compile(\n {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n\n // Without the EarlyStopping callback, the val_acc value would be:\n // 0.5, 0.5, 0.5, 0.5, ...\n // With val_acc being monitored, training should stop after the 2nd epoch.\n const history = await model.fit(xs, ys, {\n epochs: 10,\n validationData: [xsVal, ysVal],\n callbacks: tfl.callbacks.earlyStopping({monitor: 'val_acc'})\n });\n expect(history.history.loss.length).toEqual(2);\n });\n\n it('Sequential model, monitor val_acc, custom patience', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n activation: 'softmax',\n kernelInitializer: 'ones',\n inputShape: [2]\n }));\n const xs = tensor2d([1, 2, 3, 4], [2, 2]);\n const ys = tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n const xsVal = tensor2d([4, 3, 2, 1], [2, 2]);\n const ysVal = tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n model.compile(\n {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n\n // Without the EarlyStopping callback, the val_acc value would be:\n // 0.5, 0.5, 0.5, 0.5, ...\n // With val_acc being monitored and patience set to 4, training should stop\n // after the 5th epoch.\n const history = await model.fit(xs, ys, {\n epochs: 10,\n validationData: [xsVal, ysVal],\n callbacks: tfl.callbacks.earlyStopping({monitor: 'val_acc', patience: 4})\n });\n expect(history.history.loss.length).toEqual(5);\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-layers/dist/common.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts deleted file mode 100644 index 8d3a8e96c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export declare function checkDataFormat(value?: string): void; -export declare function checkInterpolationFormat(value?: string): void; -export declare function checkPaddingMode(value?: string): void; -export declare function checkPoolMode(value?: string): void; -/** - * Enter namescope, which can be nested. - */ -export declare function nameScope(name: string, fn: () => T): T; -/** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ -export declare function getScopedTensorName(tensorName: string): string; -/** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ -export declare function getUniqueTensorName(scopedName: string): string; -/** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ -export declare function isValidTensorName(name: string): boolean; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js deleted file mode 100644 index 58596fdd1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Common functions for TensorFlow.js Layers. - */ -import { VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES } from './keras_format/common'; -import { checkStringTypeUnionValue } from './utils/generic_utils'; -// A map from the requested scoped name of a Tensor to the number of Tensors -// wanting that name so far. This allows enforcing name uniqueness by appending -// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. -const nameMap = new Map(); -export function checkDataFormat(value) { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); -} -export function checkInterpolationFormat(value) { - checkStringTypeUnionValue(VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); -} -export function checkPaddingMode(value) { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); -} -export function checkPoolMode(value) { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); -} -const _nameScopeStack = []; -const _nameScopeDivider = '/'; -/** - * Enter namescope, which can be nested. - */ -export function nameScope(name, fn) { - _nameScopeStack.push(name); - try { - const val = fn(); - _nameScopeStack.pop(); - return val; - } - catch (e) { - _nameScopeStack.pop(); - throw e; - } -} -/** - * Get the current namescope as a flat, concatenated string. - */ -function currentNameScopePrefix() { - if (_nameScopeStack.length === 0) { - return ''; - } - else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } -} -/** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ -export function getScopedTensorName(tensorName) { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; -} -/** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ -export function getUniqueTensorName(scopedName) { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - const index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - if (index > 0) { - const result = `${scopedName}_${index}`; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } - else { - return scopedName; - } -} -const tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); -/** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ -export function isValidTensorName(name) { - return !!name.match(tensorNameRegex); -} -//# sourceMappingURL=common.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-layers/dist/common.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js.map deleted file mode 100644 index 0dba09801..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,OAAO,EAAC,wBAAwB,EAAE,iCAAiC,EAAE,yBAAyB,EAAE,sBAAsB,EAAC,MAAM,uBAAuB,CAAC;AACrJ,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAEhE,4EAA4E;AAC5E,gFAAgF;AAChF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QAClC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;KACpE;IACD,OAAO,sBAAsB,EAAE,GAAG,UAAU,CAAC;AAC/C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;KACpE;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;KAC5B;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAErD,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,MAAM,MAAM,GAAG,GAAG,UAAU,IAAI,KAAK,EAAE,CAAC;QACxC,uDAAuD;QACvD,yCAAyC;QACzC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;KACf;SAAM;QACL,OAAO,UAAU,CAAC;KACnB;AACH,CAAC;AAED,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\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-layers/dist/common_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map deleted file mode 100644 index e2e493eb1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common_test.js","sourceRoot":"","sources":["../src/common_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,eAAe,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,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mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for common.ts.\n */\n\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode, checkPoolMode, getUniqueTensorName, isValidTensorName} from './common';\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\n\ndescribe('checkDataFormat', () => {\n it('Valid values', () => {\n const extendedValues = VALID_DATA_FORMAT_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkDataFormat(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkDataFormat('foo')).toThrowError(/foo/);\n try {\n checkDataFormat('bad');\n } catch (e) {\n expect(e).toMatch('DataFormat');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_DATA_FORMAT_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribe('checkIntorpolationFormat', () => {\n it('Valid values', () => {\n const extendedValues =\n VALID_INTERPOLATION_FORMAT_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkInterpolationFormat(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkInterpolationFormat('foo')).toThrowError(/foo/);\n try {\n checkInterpolationFormat('bad');\n } catch (e) {\n expect(e).toMatch('InterpolationFormat');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_INTERPOLATION_FORMAT_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\ndescribe('checkPaddingMode', () => {\n it('Valid values', () => {\n const extendedValues = VALID_PADDING_MODE_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkPaddingMode(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkPaddingMode('foo')).toThrowError(/foo/);\n try {\n checkPaddingMode('bad');\n } catch (e) {\n expect(e).toMatch('PaddingMode');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_PADDING_MODE_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribe('checkPoolMode', () => {\n it('Valid values', () => {\n const extendedValues = VALID_POOL_MODE_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkPoolMode(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkPoolMode('foo')).toThrowError(/foo/);\n try {\n checkPoolMode('bad');\n } catch (e) {\n expect(e).toMatch('PoolMode');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_POOL_MODE_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribe('isValidTensorName', () => {\n it('Valid tensor names', () => {\n expect(isValidTensorName('a')).toEqual(true);\n expect(isValidTensorName('A')).toEqual(true);\n expect(isValidTensorName('foo1')).toEqual(true);\n expect(isValidTensorName('Foo2')).toEqual(true);\n expect(isValidTensorName('n_1')).toEqual(true);\n expect(isValidTensorName('n.1')).toEqual(true);\n expect(isValidTensorName('n_1_2')).toEqual(true);\n expect(isValidTensorName('n.1.2')).toEqual(true);\n expect(isValidTensorName('a/B/c')).toEqual(true);\n expect(isValidTensorName('z_1/z_2/z.3')).toEqual(true);\n expect(isValidTensorName('z-1/z-2/z.3')).toEqual(true);\n expect(isValidTensorName('1Qux')).toEqual(true);\n expect(isValidTensorName('5-conv/kernel')).toEqual(true);\n });\n\n it('Invalid tensor names: empty', () => {\n expect(isValidTensorName('')).toEqual(false);\n });\n\n it('Invalid tensor names: whitespaces', () => {\n expect(isValidTensorName('a b')).toEqual(false);\n expect(isValidTensorName('ab ')).toEqual(false);\n });\n\n it('Invalid tensor names: forbidden characters', () => {\n expect(isValidTensorName('-foo1')).toEqual(false);\n expect(isValidTensorName('-foo2-')).toEqual(false);\n expect(isValidTensorName('bar3!4')).toEqual(false);\n });\n\n it('Invalid tensor names: invalid first characters', () => {\n expect(isValidTensorName('/foo/bar')).toEqual(false);\n expect(isValidTensorName('.baz')).toEqual(false);\n expect(isValidTensorName('_baz')).toEqual(false);\n });\n\n it('Invalid tensor names: non-ASCII', () => {\n expect(isValidTensorName('フ')).toEqual(false);\n expect(isValidTensorName('ξ')).toEqual(false);\n });\n});\n\ndescribe('getUniqueTensorName', () => {\n it('Adds unique suffixes to tensor names', () => {\n expect(getUniqueTensorName('xx')).toEqual('xx');\n expect(getUniqueTensorName('xx')).toEqual('xx_1');\n expect(getUniqueTensorName('xx')).toEqual('xx_2');\n expect(getUniqueTensorName('xx')).toEqual('xx_3');\n });\n\n it('Correctly handles preexisting unique suffixes on tensor names', () => {\n expect(getUniqueTensorName('yy')).toEqual('yy');\n expect(getUniqueTensorName('yy')).toEqual('yy_1');\n expect(getUniqueTensorName('yy_1')).toEqual('yy_1_1');\n expect(getUniqueTensorName('yy')).toEqual('yy_2');\n expect(getUniqueTensorName('yy_1')).toEqual('yy_1_2');\n expect(getUniqueTensorName('yy_2')).toEqual('yy_2_1');\n expect(getUniqueTensorName('yy')).toEqual('yy_3');\n expect(getUniqueTensorName('yy_1_1')).toEqual('yy_1_1_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-layers/dist/constraints.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts deleted file mode 100644 index 911f81a32..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -/** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ -export declare abstract class Constraint extends serialization.Serializable { - abstract apply(w: Tensor): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface MaxNormArgs { - /** - * Maximum norm for incoming weights - */ - maxValue?: number; - /** - * Axis along which to calculate norms. - * - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * `[rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; -} -export declare class MaxNorm extends Constraint { - /** @nocollapse */ - static readonly className = "MaxNorm"; - private maxValue; - private axis; - private readonly defaultMaxValue; - private readonly defaultAxis; - constructor(args: MaxNormArgs); - apply(w: Tensor): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface UnitNormArgs { - /** - * Axis along which to calculate norms. - * - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * [rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; -} -export declare class UnitNorm extends Constraint { - /** @nocollapse */ - static readonly className = "UnitNorm"; - private axis; - private readonly defaultAxis; - constructor(args: UnitNormArgs); - apply(w: Tensor): Tensor; - getConfig(): serialization.ConfigDict; -} -export declare class NonNeg extends Constraint { - /** @nocollapse */ - static readonly className = "NonNeg"; - apply(w: Tensor): Tensor; -} -export interface MinMaxNormArgs { - /** - * Minimum norm for incoming weights - */ - minValue?: number; - /** - * Maximum norm for incoming weights - */ - maxValue?: number; - /** - * Axis along which to calculate norms. - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * `[rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; - /** - * Rate for enforcing the constraint: weights will be rescaled to yield: - * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`. - * Effectively, this means that rate=1.0 stands for strict - * enforcement of the constraint, while rate<1.0 means that - * weights will be rescaled at each step to slowly move - * towards a value inside the desired interval. - */ - rate?: number; -} -export declare class MinMaxNorm extends Constraint { - /** @nocollapse */ - static readonly className = "MinMaxNorm"; - private minValue; - private maxValue; - private rate; - private axis; - private readonly defaultMinValue; - private readonly defaultMaxValue; - private readonly defaultRate; - private readonly defaultAxis; - constructor(args: MinMaxNormArgs); - apply(w: Tensor): Tensor; - getConfig(): serialization.ConfigDict; -} -/** @docinline */ -export declare type ConstraintIdentifier = 'maxNorm' | 'minMaxNorm' | 'nonNeg' | 'unitNorm' | string; -export declare const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP: { - [identifier in ConstraintIdentifier]: string; -}; -export declare function serializeConstraint(constraint: Constraint): serialization.ConfigDictValue; -export declare function deserializeConstraint(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Constraint; -export declare function getConstraint(identifier: ConstraintIdentifier | serialization.ConfigDict | Constraint): Constraint; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js deleted file mode 100644 index 2350169d4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: keras/contraints.py */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import { epsilon } from './backend/common'; -import { deserializeKerasObject, serializeKerasObject } from './utils/generic_utils'; -/** - * Helper function used by many of the Constraints to find the L2Norms. - */ -function calcL2Norms(w, axis) { - return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true))); -} -/** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ -export class Constraint extends serialization.Serializable { - getConfig() { - return {}; - } -} -export class MaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMaxValue = 2; - this.defaultAxis = 0; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.clipByValue(norms, 0, this.maxValue); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - getConfig() { - return { maxValue: this.maxValue, axis: this.axis }; - } -} -/** @nocollapse */ -MaxNorm.className = 'MaxNorm'; -serialization.registerClass(MaxNorm); -export class UnitNorm extends Constraint { - constructor(args) { - super(); - this.defaultAxis = 0; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis)))); - } - getConfig() { - return { axis: this.axis }; - } -} -/** @nocollapse */ -UnitNorm.className = 'UnitNorm'; -serialization.registerClass(UnitNorm); -export class NonNeg extends Constraint { - apply(w) { - return tfc.relu(w); - } -} -/** @nocollapse */ -NonNeg.className = 'NonNeg'; -serialization.registerClass(NonNeg); -export class MinMaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMinValue = 0.0; - this.defaultMaxValue = 1.0; - this.defaultRate = 1.0; - this.defaultAxis = 0; - this.minValue = - args.minValue != null ? args.minValue : this.defaultMinValue; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.rate = args.rate != null ? args.rate : this.defaultRate; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.add(tfc.mul(this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)), tfc.mul(1.0 - this.rate, norms)); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - getConfig() { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - } -} -/** @nocollapse */ -MinMaxNorm.className = 'MinMaxNorm'; -serialization.registerClass(MinMaxNorm); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -export const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' -}; -export function serializeConstraint(constraint) { - return serializeKerasObject(constraint); -} -export function deserializeConstraint(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); -} -export function getConstraint(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeConstraint(config); - } - else if (identifier instanceof Constraint) { - return identifier; - } - else { - return deserializeConstraint(identifier); - } -} -//# sourceMappingURL=constraints.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-layers/dist/constraints.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map deleted file mode 100644 index 848f240e0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constraints.js","sourceRoot":"","sources":["../src/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0CAA0C;AAE1C,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAEnF;;GAEG;AACH,SAAS,WAAW,CAAC,CAAS,EAAE,IAAY;IAC1C,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAgB,UAAW,SAAQ,aAAa,CAAC,YAAY;IAGjE,SAAS;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAwBD,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAQrC,YAAY,IAAiB;QAC3B,KAAK,EAAE,CAAC;QAJO,oBAAe,GAAG,CAAC,CAAC;QACpB,gBAAW,GAAG,CAAC,CAAC;QAI/B,IAAI,CAAC,QAAQ;YACT,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,IAAI,CA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B,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,YAAY,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UACmC;IAC/D,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,SAAS,GAAG,UAAU,IAAI,yCAAyC,CAAC,CAAC;YACvE,yCAAyC,CAAC,UAAU,CAAC,CAAC,CAAC;YACvD,UAAU,CAAC;QACf,MAAM,MAAM,GAAG,EAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACvC,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;KACtC;SAAM,IAAI,UAAU,YAAY,UAAU,EAAE;QAC3C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC;KAC1C;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\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-layers/dist/constraints_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints_test.js.map deleted file mode 100644 index faeda456c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/constraints_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constraints_test.js","sourceRoot":"","sources":["../src/constraints_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gCAAgC;AAEhC,OAAO,EAA0B,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAuB,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAC9G,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAE9F,eAAe,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAC3C,IAAI,QAAkB,CAAC;IACvB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,QAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QAChB,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClD,kBAAkB,CACd,cAAc,EAAE,QAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAA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QACnB,qCAAqC;QACrC,MAAM,WAAW,GAA2B;YAC1C,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ;YAClE,UAAU,EAAE,YAAY;SACzB,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;YAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,MAAM,GACR,mBAAmB,CAAC,UAAU,CAA6B,CAAC;YAChE,MAAM,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Unit tests for constraints */\n\nimport {serialization, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\n\nimport {ConstraintIdentifier, deserializeConstraint, getConstraint, serializeConstraint} from './constraints';\nimport * as tfl from './index';\nimport {describeMathCPU, expectNoLeakedTensors, expectTensorsClose} from './utils/test_utils';\n\ndescribeMathCPU('Built-in Constraints', () => {\n let initVals: Tensor1D;\n beforeEach(() => {\n initVals = tensor1d(new Float32Array([-1, 2, 0, 4, -5, 6]));\n });\n\n it('NonNeg', () => {\n const constraint = getConstraint('NonNeg');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(\n postConstraint, tensor1d(new Float32Array([0, 2, 0, 4, 0, 6])));\n expectNoLeakedTensors(() => constraint.apply(initVals), 1);\n });\n\n it('MaxNorm', () => {\n const constraint = getConstraint('MaxNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521, 0.4417261043, 0, 0.8834522086,\n -1.104315261, 1.325178313\n ])));\n expectNoLeakedTensors(() => constraint.apply(initVals), 1);\n });\n it('UnitNorm', () => {\n const constraint = getConstraint('UnitNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521 / 2, 0.4417261043 / 2, 0,\n 0.8834522086 / 2, -1.104315261 / 2, 1.325178313 / 2\n ])));\n expectNoLeakedTensors(() => constraint.apply(initVals), 1);\n });\n it('MinMaxNorm', () => {\n const constraint = getConstraint('MinMaxNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521 / 2, 0.4417261043 / 2, 0,\n 0.8834522086 / 2, -1.104315261 / 2, 1.325178313 / 2\n ])));\n expectNoLeakedTensors(() => constraint.apply(initVals), 1);\n });\n\n // Lower camel case.\n it('nonNeg', () => {\n const constraint = getConstraint('nonNeg');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(\n postConstraint, tensor1d(new Float32Array([0, 2, 0, 4, 0, 6])));\n });\n\n it('maxNorm', () => {\n const constraint = getConstraint('maxNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521, 0.4417261043, 0, 0.8834522086,\n -1.104315261, 1.325178313\n ])));\n });\n it('unitNorm', () => {\n const constraint = getConstraint('unitNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521 / 2, 0.4417261043 / 2, 0,\n 0.8834522086 / 2, -1.104315261 / 2, 1.325178313 / 2\n ])));\n });\n it('minMaxNorm', () => {\n const constraint = getConstraint('minMaxNorm');\n const postConstraint = constraint.apply(initVals);\n expectTensorsClose(postConstraint, tensor1d(new Float32Array([\n -0.2208630521 / 2, 0.4417261043 / 2, 0,\n 0.8834522086 / 2, -1.104315261 / 2, 1.325178313 / 2\n ])));\n });\n});\n\ndescribeMathCPU('constraints.get', () => {\n it('by string', () => {\n const constraint = getConstraint('maxNorm');\n const config = serializeConstraint(constraint) as serialization.ConfigDict;\n const nestedConfig = config.config as serialization.ConfigDict;\n expect(nestedConfig.maxValue).toEqual(2);\n expect(nestedConfig.axis).toEqual(0);\n });\n\n it('by string, upper case', () => {\n const constraint = getConstraint('maxNorm');\n const config = serializeConstraint(constraint) as serialization.ConfigDict;\n const nestedConfig = config.config as serialization.ConfigDict;\n expect(nestedConfig.maxValue).toEqual(2);\n expect(nestedConfig.axis).toEqual(0);\n });\n\n it('by existing object', () => {\n const origConstraint = tfl.constraints.nonNeg();\n expect(getConstraint(origConstraint)).toEqual(origConstraint);\n });\n it('by config dict', () => {\n const origConstraint = tfl.constraints.minMaxNorm(\n {minValue: 0, maxValue: 2, rate: 3, axis: 4});\n const constraint = getConstraint(\n serializeConstraint(origConstraint) as serialization.ConfigDict);\n expect(serializeConstraint(constraint))\n .toEqual(serializeConstraint(origConstraint));\n });\n});\n\ndescribe('Constraints Serialization', () => {\n it('Built-ins', () => {\n // Test both types of captialization.\n const constraints: ConstraintIdentifier[] = [\n 'maxNorm', 'nonNeg', 'unitNorm', 'minMaxNorm', 'MaxNorm', 'NonNeg',\n 'UnitNorm', 'MinMaxNorm'\n ];\n for (const name of constraints) {\n const constraint = getConstraint(name);\n const config =\n serializeConstraint(constraint) as serialization.ConfigDict;\n const reconstituted = deserializeConstraint(config);\n expect(reconstituted).toEqual(constraint);\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-layers/dist/engine/container.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts deleted file mode 100644 index 8678c5995..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { NamedTensorMap, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Shape } from '../keras_format/common'; -import { PyJsonDict } from '../keras_format/types'; -import { Kwargs } from '../types'; -import { LayerVariable } from '../variables'; -import { DisposeResult, Layer, Node, SymbolicTensor } from './topology'; -/** Constructor config for Container. */ -export interface ContainerArgs { - inputs: SymbolicTensor | SymbolicTensor[]; - outputs: SymbolicTensor | SymbolicTensor[]; - name?: string; -} -/** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ -export declare abstract class Container extends Layer { - inputs: SymbolicTensor[]; - outputs: SymbolicTensor[]; - inputLayers: Layer[]; - inputLayersNodeIndices: number[]; - inputLayersTensorIndices: number[]; - outputLayers: Layer[]; - outputLayersNodeIndices: number[]; - outputLayersTensorIndices: number[]; - layers: Layer[]; - layersByDepth: { - [depth: string]: Layer[]; - }; - nodesByDepth: { - [depth: string]: Node[]; - }; - internalContainerRefs: Container[]; - containerNodes: Set; - inputNames: string[]; - outputNames: string[]; - feedInputShapes: Shape[]; - protected internalInputShapes: Shape[]; - protected internalOutputShapes: Shape[]; - protected feedInputNames: string[]; - protected feedOutputNames: string[]; - constructor(args: ContainerArgs); - protected assertNotDisposed(): void; - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - dispose(): DisposeResult; - trainable: boolean; - readonly trainableWeights: LayerVariable[]; - readonly nonTrainableWeights: LayerVariable[]; - readonly weights: LayerVariable[]; - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - loadWeights(weights: NamedTensorMap, strict?: boolean): void; - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - protected updatedConfig(): serialization.ConfigDict; - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - toJSON(unused?: any, returnString?: boolean): string | PyJsonDict; - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]): [Tensor[], Tensor[], Shape[]]; - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - private buildNodeConversionMap; - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - getLayer(name?: string, index?: number): Layer; - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses(): Scalar[]; - getConfig(): serialization.ConfigDict; - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: serialization.ConfigDict, fastWeightInit?: boolean): T; - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - readonly stateful: boolean; - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - resetStates(): void; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js deleted file mode 100644 index 19be421b2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: keras/engine/topology.py */ -import { tidy } from '@tensorflow/tfjs-core'; -import { getUid } from '../backend/state'; -import { NotImplementedError, RuntimeError, ValueError } from '../errors'; -import { deserialize as deserializeLayer } from '../layers/serialization'; -import * as generic_utils from '../utils/generic_utils'; -import { convertTsToPythonic } from '../utils/serialization_utils'; -import * as types_utils from '../utils/types_utils'; -import { batchSetValue } from '../variables'; -import { version as layersVersion } from '../version'; -import { execute, FeedDict } from './executor'; -import { InputLayer } from './input_layer'; -import { Layer, Node } from './topology'; -/** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ -export class Container extends Layer { - constructor(args) { - // No args passed to super's constructor. - super({}); - this.containerNodes = new Set(); - this.name = args.name; - if (this.name == null) { - const prefix = this.getClassName().toLowerCase(); - this.name = getUid(prefix); - } - this.supportsMasking = false; - this.trainable_ = true; - // TODO(michaelterry): Initialize perInputLosses/Updates here. - // Container-specific properties. - if (Array.isArray(args.inputs)) { - this.inputs = args.inputs.slice(); - } - else { - this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - this.outputs = args.outputs.slice(); - } - else { - this.outputs = [args.outputs]; - } - // Check for redundancy in inputs. - if (generic_utils.unique(this.inputs).length !== this.inputs.length) { - throw new ValueError('The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - `${this.inputs.map(x => x.name)}`); - } - // Check for redundancy in outputs. - if (generic_utils.unique(this.outputs).length !== this.outputs.length) { - console.warn('The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - `${this.outputs.map(x => x.name)}`); - } - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - this.inputLayers = []; - this.inputLayersNodeIndices = []; - this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - this.outputLayers = []; - this.outputLayersNodeIndices = []; - this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - this.layers = []; - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - this.internalContainerRefs = []; - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - // Build this.outputLayers: - for (const x of this.outputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - this.outputLayers.push(layer); - this.outputLayersNodeIndices.push(nodeIndex); - this.outputLayersTensorIndices.push(tensorIndex); - } - // TODO(michaelterry): Add output mask cache code. - // Build this.inputLayers: - for (const x of this.inputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes'); - generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors'); - this.inputLayers.push(layer); - this.inputLayersNodeIndices.push(nodeIndex); - this.inputLayersTensorIndices.push(tensorIndex); - } - // Build this.inputNames and this.outputNames. - this.inputNames = []; - this.outputNames = []; - this.feedInputShapes = []; - this.feedInputNames = []; - this.feedOutputNames = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError('Input layers to a LayersModel must be InputLayer objects. ' + - `Received inputs: ${args.inputs}. ` + - `Input ${i} (0-based) originates ` + - `from layer type ${layer.getClassName()}.`); - } - this.inputNames.push(layer.name); - this.feedInputShapes.push(layer.batchInputShape); - this.feedInputNames.push(layer.name); - } - for (const layer of this.outputLayers) { - this.outputNames.push(layer.name); - } - this.internalInputShapes = this.inputs.map(x => x.shape); - this.internalOutputShapes = this.outputs.map(x => x.shape); - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - const nodesDepths = {}; - // To recover nodes from their ID. - const nodeIDToNode = {}; - const layersDepths = {}; - // To layers from their ID. - const layerIDToLayer = {}; - const layerIndices = {}; - const nodesInDecreasingDepth = []; - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - const buildMapOfGraph = (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) => { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - const node = layer.inboundNodes[nodeIndex]; - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError(`The tensor ${tensor.name} at layer "${layer.name}" ` + - 'is part of a cycle.'); - } - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - // Update containerNodes. - this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - // Propagate to all previous tensors connected to this node. - const numInboundLayers = node.inboundLayers.length; - for (let i = 0; i < numInboundLayers; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - buildMapOfGraph(x, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - const finishedNodes = []; - const nodesInProgress = []; - for (const x of this.outputs) { - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - const reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); - for (const node of reversedNodesInDecreasingDepth) { - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - let depth = nodesDepths[node.id]; - // Update the depth of the corresponding layer - const previousDepth = (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - // Update the depth of inbound nodes. - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const inboundNode = inboundLayer.inboundNodes[nodeIndex]; - const previousDepth = (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - // Build a dict {depth: list of nodes with this depth} - const nodesByDepth = {}; - for (const nodeID in nodesDepths) { - const depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - // Build a dict {depth: list of layers with this depth} - const layersByDepth = {}; - for (const layerID in layersDepths) { - const depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - // Get sorted list of layer depths. - let depthKeys = Object.keys(layersByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - // Set this.layers and this.layersByDepth. - this.layers = []; - for (const depth of depthKeys) { - const layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort((a, b) => { - const aIndex = layerIndices[a.id]; - const bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (const layer of layersForDepth) { - if (layer instanceof Container) { - this.internalContainerRefs.push(layer); - } - this.layers.push(layer); - } - } - this.layersByDepth = layersByDepth; - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - const computableTensors = this.inputs.slice(); - // To provide a better error msg. - const layersWithCompleteInput = []; - for (const depth of depthKeys) { - for (const node of nodesByDepth[depth]) { - const layer = node.outboundLayer; - if (layer != null) { - for (const x of node.inputTensors) { - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError(`Graph disconnected: cannot obtain value for tensor ${x}` + - ` at layer "${layer.name}". ` + - 'The following previous layers were accessed without ' + - `issue: ${layersWithCompleteInput}`); - } - } - for (const x of node.outputTensors) { - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - // Set this.containerNodes and this.nodesByDepth. - this.nodesByDepth = nodesByDepth; - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - const allNames = this.layers.map(x => x.name); - for (const name of allNames) { - const numOccurrences = allNames.filter(x => x === name).length; - if (numOccurrences !== 1) { - throw new RuntimeError(`The name "${name}" is used ${numOccurrences} times ` + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - } - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - this.inboundNodes = []; - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - inputMasks: this.inputs.map(x => null), - outputMasks: this.outputs.map(x => null), - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs.map(x => x.shape) - }); - this.built = true; - this._refCount = 1; // The ref count of a container always start at 1. - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Container '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - dispose() { - this.assertNotDisposed(); - const result = { refCountAfterDispose: null, numDisposedVariables: 0 }; - if (--this._refCount === 0) { - for (const layer of this.layers) { - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (const container of this.internalContainerRefs) { - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.layers.forEach(layer => { - // tslint:disable-next-line:no-any - layer._trainableWeights - .forEach(w => w.trainable = trainable); - }); - this.trainable_ = trainable; - } - get trainableWeights() { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - if (!this.trainable) { - return []; - } - let weights = []; - for (const layer of this.layers) { - weights = weights.concat(layer.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const layer of this.layers) { - weights.push(...layer.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const layer of this.layers) { - trainableWeights.push(...layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - loadWeights(weights, strict = true) { - const nameToWeight = {}; - let totalWeightsCount = 0; - for (const layer of this.layers) { - for (const weight of layer.weights) { - if (nameToWeight[weight.originalName] != null) { - throw new ValueError(`Duplicate weight name: ${weight.originalName}`); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - const weightValueTuples = []; - for (const name in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - let validatedName = name; - if (nameToWeight[name] == null) { - const tokens = name.split('/'); - const shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name]]); - } - else if (strict) { - throw new ValueError(`Provided weight data has no target variable: ${name}`); - } - delete nameToWeight[validatedName]; - } - if (strict) { - // Check that all weights are set. - const unsetNames = []; - for (const name in nameToWeight) { - unsetNames.push(name); - } - if (unsetNames.length > 0) { - throw new ValueError(`${unsetNames.length} of ${totalWeightsCount} weights are not set: ` + - `${unsetNames}`); - } - } - batchSetValue(weightValueTuples); - } - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - updatedConfig() { - const theConfig = this.getConfig(); - const modelConfig = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - } - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - toJSON(unused, returnString = true) { - const modelConfig = convertTsToPythonic(this.updatedConfig()); - return returnString ? JSON.stringify(modelConfig) : modelConfig; - } - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - call(inputs, kwargs) { - return tidy(() => { - inputs = generic_utils.toList(inputs); - const feedDict = new FeedDict(); - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - return execute(this.outputs, feedDict, kwargs); - }); - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - return tidy(() => { - inputs = generic_utils.toList(inputs); - let masks; - if (mask == null) { - masks = generic_utils.pyListRepeat(null, inputs.length); - } - else { - masks = generic_utils.toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return this.runInternalGraph(inputs, masks)[1]; - }); - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - computeOutputShape(inputShape) { - const inputShapes = types_utils.normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError(`Invalid inputShape argument ${inputShape}: ` + - `model has ${this.inputLayers.length} tensor inputs.`); - } - // TODO(michaelterry): Add caching - const layersToOutputShapes = {}; - for (let i = 0; i < inputShapes.length; i++) { - const layer = this.inputLayers[i]; - const inputShape = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - const shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - const inputShapes = []; - for (let j = 0; j < node.inboundLayers.length; j++) { - const inboundLayer = node.inboundLayers[j]; - const nodeIndex = node.nodeIndices[j]; - const tensorIndex = node.tensorIndices[j]; - const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`; - const inputShape = layersToOutputShapes[shapeKey]; - inputShapes.push(inputShape); - } - const outputShape = layer.computeOutputShape(generic_utils.singletonOrArray(inputShapes)); - const outputShapes = types_utils.normalizeShapeList(outputShape); - const nodeIndex = layer.inboundNodes.indexOf(node); - for (let j = 0; j < outputShapes.length; j++) { - const shapeKey = `${layer.name}_${nodeIndex}_${j}`; - layersToOutputShapes[shapeKey] = outputShapes[j]; - } - } - } - } - // Read final output shapes from layersToOutputShapes. - const outputShapes = []; - const outputShapeKeys = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const tensorIndex = this.outputLayersTensorIndices[i]; - const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`; - outputShapeKeys.push(shapeKey); - } - for (let i = 0; i < outputShapeKeys.length; i++) { - const key = outputShapeKeys[i]; - generic_utils.assert(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - // TODO(michaelterry): Update cache - return generic_utils.singletonOrArray(outputShapes); - } - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - runInternalGraph(inputs, masks) { - if (masks == null) { - masks = generic_utils.pyListRepeat(null, inputs.length); - } - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - const tensorMap = {}; - for (let i = 0; i < this.inputs.length; ++i) { - const x = this.inputs[i]; - const y = inputs[i]; - const mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - const referenceInputTensors = node.inputTensors; - const referenceOutputTensors = node.outputTensors; - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - const computedData = new Array(); - for (const x of referenceInputTensors) { - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - let kwargs = {}; - let computedTensors; - let computedMasks; - let outputTensors; - let outputMasks; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - const [computedTensor, computedMask] = computedData[0]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors = - generic_utils.toList(layer.call(computedTensor, kwargs)); - outputMasks = generic_utils.toList(layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } - else { - computedTensors = computedData.map(x => x[0]); - computedMasks = computedData.map(x => x[1]); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors = - generic_utils.toList(layer.call(computedTensors, kwargs)); - outputMasks = generic_utils.toList(layer.computeMask(computedTensors, computedMasks)); - } - if (layer.activityRegularizer) { - throw new NotImplementedError('LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - // Update tensor map. - for (let i = 0; i < referenceOutputTensors.length; ++i) { - const x = referenceOutputTensors[i]; - const y = outputTensors[i]; - const mask = outputMasks[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - const outputTensors = []; - const outputMasks = []; - const outputShapes = []; - for (const x of this.outputs) { - generic_utils.assert(x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); - const [tensor, mask] = tensorMap[x.id]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - } - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - buildNodeConversionMap(layers) { - const nodeConversionMap = {}; - let keptNodes; - for (const layer of this.layers) { - keptNodes = layer instanceof Container ? 1 : 0; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - } - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - getLayer(name, index) { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError(`Was asked to retrieve layer at index ${index}, but model only ` + - `has ${this.layers.length} layer(s).`); - } - else { - return this.layers[index]; - } - } - else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - for (const layer of this.layers) { - if (layer.name === name) { - return layer; - } - } - throw new ValueError(`No such layer: ${name}`); - } - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tidy(() => { - const losses = []; - for (const layer of this.layers) { - for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (this.containerNodes.has(nodeKey)) { - losses.push(...layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - } - getConfig() { - const config = { name: this.name }; - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - const nodeConversionMap = this.buildNodeConversionMap(this.layers); - // Serialize and save the layers in layerConfigs - const layerConfigs = []; - for (const layer of this.layers) { - const layerClassName = layer.getClassName(); - const layerConfig = layer.getConfig(); - const filteredInboundNodes = []; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const node = layer.inboundNodes[originalNodeIndex]; - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - let kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } - catch (err) { - console.warn(`Layer ${layer.name} was passed ` + - `non-serializable keyword arguments: ` + - `${node.callArgs}. They will not be included ` + - `in the serialized model (and thus will be ` + - `missing at deserialization time).`); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - const nodeData = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - const nodeKey = Container.nodeKey(inboundLayer, nodeIndex); - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - const dict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - const modelInputs = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - const nodeIndex = this.inputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - const modelOutputs = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - } - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - // Layer instances created during - // the graph reconstruction process - const createdLayers = {}; - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - const unprocessedNodes = {}; - function addUnprocessedNode(layer, nodeData) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } - else { - unprocessedNodes[layer.name].push(nodeData); - } - } - function processNode(layer, nodeData) { - const inputTensors = []; - let kwargs; - for (const inputData of nodeData) { - const inboundLayerName = inputData[0]; - const inboundNodeIndex = inputData[1]; - const inboundTensorIndex = inputData[2]; - kwargs = inputData[3] == null ? - {} : - inputData[3]; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply(generic_utils.singletonOrArray(inputTensors), kwargs); // was ** kwargs - } - } - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData) { - const layerName = layerData['name']; - // Instantiate layer. - const layer = deserializeLayer(layerData, config['customObjects'] != null ? - config['customObjects'] : - {}); - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - const inboundNodesData = layerData['inboundNodes']; - inboundNodesData.forEach(nodeData => { - if (!(nodeData instanceof Array)) { - throw new ValueError(`Corrupted configuration, expected array for nodeData: ${nodeData}`); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - // First, we create all layers and enqueue nodes to be processed. - const name = config['name']; - const layersFromConfig = config['layers']; - for (const layerData of layersFromConfig) { - processLayer(layerData); - } - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!generic_utils.isObjectEmpty(unprocessedNodes)) { - for (const layerData of layersFromConfig) { - const layer = createdLayers[layerData['name']]; - if (layer.name in unprocessedNodes) { - const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (const nodeData of currentUnprocessedNodesForLayer) { - processNode(layer, nodeData); - } - } - } - } - const inputTensors = []; - const outputTensors = []; - const inputLayersFromConfig = config['inputLayers']; - for (const layerData of inputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - generic_utils.assert(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - const outputLayersFromConfig = config['outputLayers']; - for (const layerData of outputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - generic_utils.assert(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({ inputs: inputTensors, outputs: outputTensors, name }); - } - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get stateful() { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (const layer of this.layers) { - if (layer.stateful) { - return true; - } - } - return false; - } - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - resetStates() { - tidy(() => { - this.layers.forEach(layer => { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - } -} -//# sourceMappingURL=container.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-layers/dist/engine/container.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map deleted file mode 100644 index 78c78789a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/engine/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+CAA+C;AAE/C,OAAO,EAAgD,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAIxE,OAAO,EAAC,WAAW,IAAI,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,8B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OAKG;IACH,IAAI,QAAQ;QACV,oEAAoE;QACpE,kDAAkD;QAClD,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAI,UAAU,CAChB,4DAA4D;gBAC5D,6DAA6D;gBAC7D,iEAAiE,CAAC,CAAC;SACxE;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACH,WAAW;QACT,IAAI,CAAC,GAAG,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC1B,wBAAwB;gBACxB,IAAI,KAAK,CAAC,QAAQ,EAAE;oBAClB,KAAK,CAAC,WAAW,EAAE,CAAC;iBACrB;gBACD,uBAAuB;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\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-layers/dist/engine/container_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map deleted file mode 100644 index 54640804f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"container_test.js","sourceRoot":"","sources":["../../src/engine/container_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAU,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAC,SAAS,EAAgB,MAAM,aAAa,CAAC;AACrD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAW,eAAe,EAAmC,MAAM,YAAY,CAAC;AAEvF,MAAM,YAAa,SAAQ,GAAG,CAAC,MAAM,CAAC,KAAK;IAEzC,YAAY,IAAe;QACzB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;;AAHM,sBAAS,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CAAC,CAAC;QAC/C,yEAAyE;QACzE,qCAAqC;QACrC,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {memory, ones, scalar, Tensor, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {Kwargs} from '../types';\nimport {describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {Container, ContainerArgs} from './container';\nimport {execute, FeedDict} from './executor';\nimport {CallHook, getSourceInputs, Layer, LayerArgs, SymbolicTensor} from './topology';\n\nclass LayerForTest extends tfl.layers.Layer {\n static className = 'LayerForTest';\n constructor(args: LayerArgs) {\n super(args);\n }\n}\n\nclass ContainerForTest extends Container {\n static className = 'ContainerForTest';\n constructor(args: ContainerArgs) {\n super(args);\n }\n}\n\ndescribeMathCPUAndGPU('Container.fromConfig', () => {\n it('creates a minimal Container from simplest config', () => {\n // tslint:disable:no-any\n const config = {\n name: 'test',\n layers: [] as any[],\n inputLayers: [] as any[],\n outputLayers: [] as any[]\n };\n // tslint:enable\n const container =\n Container.fromConfig(ContainerForTest, config) as Container;\n expect(container.name).toEqual('test');\n });\n\n it('creates a simple network', () => {\n /* python generating code\n a=Input(shape=(32,))\n b=Dense(32)(a)\n model = Container(inputs=a, outputs=b, name=\"test\")\n pprint.pprint(model.get_config())\n */\n const config = {\n inputLayers: [['input_2', 0, 0]],\n layers: [\n {\n className: 'InputLayer',\n config: {\n batchInputShape: [null, 32],\n dtype: 'float32',\n name: 'input_2',\n sparse: false\n },\n inboundNodes: [] as string[][],\n name: 'input_2'\n },\n {\n className: 'Dense',\n config: {\n activation: 'linear',\n activityRegularizer: null as string,\n biasConstraint: null as string,\n biasInitializer: {className: 'Zeros', config: {}},\n biasRegularizer: null as string,\n kernelConstraint: null as string,\n kernelInitializer: {\n className: 'VarianceScaling',\n config: {\n distribution: 'uniform',\n mode: 'fanAvg',\n scale: 1.0,\n seed: null as number\n }\n },\n kernelRegularizer: null as string,\n name: 'dense_2',\n trainable: null as boolean,\n units: 32,\n use_bias: true\n },\n inboundNodes: [[['input_2', 0, 0, {}]]],\n name: 'dense_2'\n }\n ],\n name: 'test',\n outputLayers: [['dense_2', 0, 0]]\n };\n const container =\n Container.fromConfig(ContainerForTest, config) as Container;\n expect(container.name).toEqual('test');\n const allZeros = zeros([1, 32]);\n expectTensorsClose(container.apply(allZeros) as Tensor, allZeros);\n });\n});\n\ndescribeMathCPUAndGPU('Container', () => {\n const inputLayerName = 'inputLayerName';\n const layerName = 'layerName';\n const containerName = 'simpleContainer';\n let inputTensor: tfl.SymbolicTensor;\n let layer: Layer;\n let output: tfl.SymbolicTensor;\n let simpleContainer: Container;\n\n beforeEach(() => {\n inputTensor =\n tfl.input({shape: [1], name: inputLayerName, dtype: 'float32'});\n layer = new LayerForTest({name: layerName});\n output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n simpleContainer = new ContainerForTest(\n {inputs: [inputTensor], outputs: [output], name: containerName});\n });\n\n it('initializes with no inputs or outputs and a default name', () => {\n const container = new ContainerForTest({inputs: [], outputs: []});\n expect(container.name).toMatch(/^container.+$/);\n });\n\n it('initializes with no inputs or outputs and a given name', () => {\n const name = 'xyz';\n const container = new ContainerForTest({inputs: [], outputs: [], name});\n expect(container.name).toMatch(name);\n });\n\n it('throws an exception if same input provided twice', () => {\n const makeContainer = () => {\n // tslint:disable-next-line:no-unused-expression\n new ContainerForTest({inputs: [inputTensor, inputTensor], outputs: []});\n };\n expect(makeContainer).toThrowError(/inputs.*redundant/);\n });\n\n it('throws an exception if graph is disconnected', () => {\n const makeContainer = () => {\n // tslint:disable-next-line:no-unused-expression\n new ContainerForTest({inputs: [], outputs: [output]});\n };\n expect(makeContainer).toThrowError(/disconnected/);\n });\n\n it('creates inputLayers', () => {\n expect(simpleContainer.inputLayers).toEqual([inputTensor.sourceLayer]);\n });\n\n it('creates outputLayers', () => {\n expect(simpleContainer.outputLayers).toEqual([layer]);\n });\n\n it('creates inputNames', () => {\n expect(simpleContainer.inputNames).toEqual([inputLayerName]);\n });\n\n it('creates outputNames', () => {\n expect(simpleContainer.outputNames).toEqual([layerName]);\n });\n\n it('throws exception if given a non-input layer as input', () => {\n const makeContainer = () => {\n // tslint:disable-next-line:no-unused-expression\n new ContainerForTest({inputs: [output], outputs: []});\n };\n expect(makeContainer).toThrowError(/must be InputLayer objects/);\n });\n\n it('creates layers for simplest case', () => {\n expect(simpleContainer.layers).toEqual([inputTensor.sourceLayer, layer]);\n });\n\n it('creates layers when multiple layers specified', () => {\n const layer1 = new LayerForTest({name: 'layer1'});\n const layer2 = new LayerForTest({name: 'layer2'});\n const output =\n layer2.apply(layer1.apply(inputTensor)) as tfl.SymbolicTensor;\n const container =\n new ContainerForTest({inputs: [inputTensor], outputs: [output]});\n expect(container.layers).toEqual([inputTensor.sourceLayer, layer1, layer2]);\n });\n\n it('correctly creates model with shared subgraphs.', () => {\n /*\n The graph:\n\n A\n / \\\n B X\n | |\n C B\n |\n C\n */\n const layerA = new LayerForTest({name: 'A'});\n const layerB = new LayerForTest({name: 'B'});\n const layerC = new LayerForTest({name: 'C'});\n const layerX = new LayerForTest({name: 'X'});\n const aOutput = layerA.apply(inputTensor);\n const output1 = layerC.apply(layerB.apply(aOutput)) as tfl.SymbolicTensor;\n const output2 =\n layerC.apply(layerB.apply(layerX.apply(aOutput))) as tfl.SymbolicTensor;\n\n const container = new ContainerForTest(\n {inputs: [inputTensor], outputs: [output1, output2]});\n\n const compareFunction = (a: Layer, b: Layer) => {\n if (a.name < b.name) {\n return -1;\n } else if (a.name > b.name) {\n return 1;\n } else {\n return 0;\n }\n };\n const sortedLayers = container.layers.slice().sort(compareFunction);\n const expectedSortedLayers = [\n inputTensor.sourceLayer, layerA, layerB, layerC, layerX\n ].sort(compareFunction);\n\n expect(sortedLayers).toEqual(expectedSortedLayers);\n });\n\n it('throws exception if multiple layers have the same name', () => {\n const name = 'abc';\n const layer1 = new LayerForTest({name});\n const layer2 = new LayerForTest({name});\n const output =\n layer2.apply(layer1.apply(inputTensor)) as tfl.SymbolicTensor;\n const makeContainer = () => {\n // tslint:disable-next-line:no-unused-expression\n new ContainerForTest({inputs: [inputTensor], outputs: [output]});\n };\n expect(makeContainer).toThrowError(/layer names should be unique/);\n });\n\n it('weights gets all weights.', () => {\n const inputShape = [1, 6];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.dense({units: 2, useBias: false});\n const layer2 = tfl.layers.dense({units: 1, useBias: true});\n const output = layer2.apply(layer1.apply(inputLayer)) as tfl.SymbolicTensor;\n\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n expect(container.weights.length).toEqual(3);\n expect(container.weights[0].name).toEqual(layer1.weights[0].name);\n expect(container.weights[1].name).toEqual(layer2.weights[0].name);\n expect(container.weights[2].name).toEqual(layer2.weights[1].name);\n });\n\n it('trainableWeights and nonTrainableWeights.', () => {\n const inputShape = [1, 6];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.dense({units: 2, useBias: false});\n const layer2 = tfl.layers.dense({units: 1, useBias: true});\n const output = layer2.apply(layer1.apply(inputLayer)) as tfl.SymbolicTensor;\n\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n expect(container.trainableWeights.length).toEqual(3);\n expect(container.trainableWeights[0].name).toEqual(layer1.weights[0].name);\n expect(container.trainableWeights[1].name).toEqual(layer2.weights[0].name);\n expect(container.trainableWeights[2].name).toEqual(layer2.weights[1].name);\n expect(container.nonTrainableWeights.length).toEqual(0);\n });\n\n it('call() executes all layers.', () => {\n const inputShape = [1, 6];\n const finalShape = [3, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.reshape({name: 'layer1', targetShape: [2, 3]});\n const layer2 =\n tfl.layers.reshape({name: 'layer2', targetShape: finalShape});\n const output = layer2.apply(layer1.apply(inputLayer)) as tfl.SymbolicTensor;\n\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n const result = container.call(ones([1, 1, 6]), {}) as Tensor[];\n const resultShape = [1].concat(finalShape);\n expectTensorsClose(result[0], ones(resultShape));\n });\n\n it('apply() executes all layers with concrete tensors.', () => {\n const inputShape = [1, 6];\n const finalShape = [3, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.reshape({name: 'layer1', targetShape: [2, 3]});\n const layer2 =\n tfl.layers.reshape({name: 'layer2', targetShape: finalShape});\n const output = layer2.apply(layer1.apply(inputLayer)) as tfl.SymbolicTensor;\n\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n const result = container.apply(ones([1, 1, 6])) as Tensor;\n const resultShape = [1].concat(finalShape);\n expectTensorsClose(result, ones(resultShape));\n });\n\n it('apply() executes all layers with symbolic tensors.', () => {\n const inputShape = [1, 6];\n const finalShape = [3, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.reshape({name: 'layer1', targetShape: [2, 3]});\n const layer2 =\n tfl.layers.reshape({name: 'layer2', targetShape: finalShape});\n const output = layer2.apply(layer1.apply(inputLayer)) as tfl.SymbolicTensor;\n\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n\n const newInput = tfl.layers.input({shape: [1, 6]});\n const symbolicResult = container.apply(newInput);\n expect(symbolicResult instanceof tfl.SymbolicTensor).toEqual(true);\n const concreteResult = execute(\n symbolicResult as tfl.SymbolicTensor,\n new FeedDict([{key: newInput, value: ones([1, 1, 6])}]));\n const resultShape = [1].concat(finalShape);\n expectTensorsClose(concreteResult as Tensor, ones(resultShape));\n });\n\n it('computeOutputShape() computes the correct outputShape', () => {\n const inputShape = [2, 3];\n const finalShape = [3, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer = tfl.layers.reshape({targetShape: finalShape});\n const output = layer.apply(inputLayer) as tfl.SymbolicTensor;\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [output]});\n expect(container.computeOutputShape([1].concat(inputShape))).toEqual([\n 1\n ].concat(finalShape));\n });\n\n it('trainableWeights is initially an empty Array', () => {\n expect(simpleContainer.trainableWeights).toEqual([]);\n });\n\n it('trainableWeights tracks only trainable weights', () => {\n const inputShape = [2, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.reshape({targetShape: [4], name: 'reshapeLayer'});\n const layer1Output = layer1.apply(inputLayer) as tfl.SymbolicTensor;\n const layer2 =\n tfl.layers.dense({units: 2, useBias: false, name: 'denseLayer'});\n const layer2Output = layer2.apply(layer1Output) as tfl.SymbolicTensor;\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [layer2Output]});\n expect(container.trainableWeights.length).toEqual(1);\n });\n\n it('stateful is initially false', () => {\n expect(simpleContainer.stateful).toEqual(false);\n });\n\n function createSimpleTwoLayerContainer(): [Container, Layer[]] {\n const inputShape = [2, 2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const layer1 = tfl.layers.reshape({targetShape: [4], name: 'reshapeLayer'});\n const layer1Output = layer1.apply(inputLayer) as tfl.SymbolicTensor;\n const layer2 =\n tfl.layers.dense({units: 2, useBias: false, name: 'denseLayer'});\n const layer2Output = layer2.apply(layer1Output) as tfl.SymbolicTensor;\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [layer2Output]});\n return [container, [container.inputLayers[0], layer1, layer2]];\n }\n\n it('getLayer works by name', () => {\n const [container, layers] = createSimpleTwoLayerContainer();\n expect(container.getLayer(layers[0].name)).toEqual(layers[0]);\n expect(container.getLayer(layers[1].name)).toEqual(layers[1]);\n expect(container.getLayer(layers[2].name)).toEqual(layers[2]);\n });\n\n it('getLayer works by index', () => {\n const [container, layers] = createSimpleTwoLayerContainer();\n expect(container.getLayer(null, 0)).toEqual(layers[0]);\n expect(container.getLayer(null, 1)).toEqual(layers[1]);\n expect(container.getLayer(null, 2)).toEqual(layers[2]);\n });\n\n it('getLayer throws error for nonexistent layer name', () => {\n const [container, layers] = createSimpleTwoLayerContainer();\n expect(\n () => container.getLayer(\n layers[0].name + '_suffixToMakeLayerNameNonexistent'))\n .toThrowError(/No such layer/);\n });\n\n it('getLayer throws error for index out of bound', () => {\n const container = createSimpleTwoLayerContainer()[0];\n expect(() => container.getLayer(null, 3)).toThrowError(/only has 3 layer/);\n });\n\n it('getLayer throws error when neither name or index is specified', () => {\n const container = createSimpleTwoLayerContainer()[0];\n expect(() => container.getLayer())\n .toThrowError(/Provide either a layer name or layer index/);\n });\n});\n\ndescribeMathCPUAndGPU('Container.calculateLosses', () => {\n function createSimpleOneLayerContainer(useRegularizers: boolean):\n [Container, Layer[]] {\n const inputShape = [2];\n const inputLayer = tfl.layers.input({shape: inputShape});\n const kernelRegularizer =\n useRegularizers ? tfl.regularizers.l1({l1: 2}) : null;\n const biasRegularizer =\n useRegularizers ? tfl.regularizers.l2({l2: 3}) : null;\n const denseLayer = tfl.layers.dense({\n units: 2,\n kernelInitializer: 'ones',\n biasInitializer: 'ones',\n kernelRegularizer,\n biasRegularizer,\n name: 'denseLayer'\n });\n const layer2Output = denseLayer.apply(inputLayer) as tfl.SymbolicTensor;\n const container =\n new ContainerForTest({inputs: [inputLayer], outputs: [layer2Output]});\n return [container, [denseLayer]];\n }\n\n it('L1 and L2', () => {\n const container = createSimpleOneLayerContainer(true)[0];\n const losses = container.calculateLosses();\n expect(losses.length).toEqual(2);\n expectTensorsClose(losses[0], scalar(2 * (1 + 1 + 1 + 1)));\n expectTensorsClose(losses[1], scalar(3 * (1 + 1)));\n });\n\n it('No regularizers', () => {\n const container = createSimpleOneLayerContainer(false)[0];\n const losses = container.calculateLosses();\n expect(losses.length).toEqual(0);\n });\n});\n\ndescribe('getSourceInputs()', () => {\n it('returns the single source input', () => {\n const inputTensor = tfl.layers.input({shape: [1]});\n const layer1 = new LayerForTest({name: 'layer1'});\n const layer2 = new LayerForTest({name: 'layer2'});\n const output =\n layer2.apply(layer1.apply(inputTensor)) as tfl.SymbolicTensor;\n expect(getSourceInputs(output)).toEqual([inputTensor]);\n });\n\n it('returns all inputs', () => {\n const input1 = tfl.layers.input({shape: [1], name: 'input1'});\n const input2 = tfl.layers.input({shape: [1], name: 'input2'});\n const layer = new LayerForTest({});\n const output1 = layer.apply(input1) as tfl.SymbolicTensor;\n const output2 = layer.apply(input2) as tfl.SymbolicTensor;\n expect(getSourceInputs(output1)).toEqual([input1]);\n expect(getSourceInputs(output2)).toEqual([input2]);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel-dispose', () => {\n it('Dispose Sequential model frees memory', () => {\n const numTensors0 = memory().numTensors;\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 2, inputShape: [3], activation: 'relu'}));\n model.add(tfl.layers.dense({units: 1}));\n model.build([3, 3]);\n\n const result = model.dispose();\n expect(result.refCountAfterDispose).toEqual(0);\n expect(result.numDisposedVariables).toEqual(4);\n // The four weight variables of the two layers should have been disposed.\n expect(memory().numTensors).toEqual(numTensors0);\n });\n\n it('Dispose Sequential model twice leads to Error', () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 2, inputShape: [3], activation: 'relu'}));\n model.add(tfl.layers.dense({units: 1}));\n model.build([3, 3]);\n\n model.dispose();\n expect(() => model.dispose()).toThrowError(/Container .* already disposed/);\n });\n\n it('Using disposed Sequential model leads to Error', async () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 2, inputShape: [3], activation: 'relu'}));\n model.add(tfl.layers.dense({units: 1, activation: 'sigmoid'}));\n model.build([3, 3]);\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n model.dispose();\n\n const xs = zeros([3, 3]);\n const ys = zeros([3, 1]);\n expect(() => model.predict(xs)).toThrowError(/already disposed/);\n expect(() => model.evaluate(xs, ys)).toThrowError(/already disposed/);\n let errorCaughtDuringFit = false;\n try {\n await model.fit(xs, ys);\n } catch (err) {\n errorCaughtDuringFit = true;\n }\n expect(errorCaughtDuringFit).toEqual(true);\n });\n\n it('Dispose functional model frees memory', () => {\n const input = tfl.input({shape: [4]});\n const dense1 =\n tfl.layers.dense({units: 3}).apply(input) as tfl.SymbolicTensor;\n const dense2 = tfl.layers.dense({units: 2, useBias: false}).apply(input) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input], outputs: [dense1, dense2]});\n // Call predict once to make sure that the model's weights are initialized.\n model.predict(zeros([2, 4]));\n\n const numTensors0 = memory().numTensors;\n const result = model.dispose();\n\n expect(result.refCountAfterDispose).toEqual(0);\n expect(result.numDisposedVariables).toEqual(3);\n // The 2 + 1 = 3 weight variables of the two layers should have been\n // disposed.\n expect(memory().numTensors).toEqual(numTensors0 - 3);\n });\n\n it('Dispose functional model twice leads to Error', () => {\n const input = tfl.input({shape: [4]});\n const dense1 =\n tfl.layers.dense({units: 3}).apply(input) as tfl.SymbolicTensor;\n const dense2 = tfl.layers.dense({units: 2, useBias: false}).apply(input) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input], outputs: [dense1, dense2]});\n // Call predict once to make sure that the model's weights are initialized.\n model.predict(zeros([2, 4]));\n\n model.dispose();\n expect(() => model.dispose()).toThrowError(/Container .* already disposed/);\n });\n\n it('Layer shared between two functional models is not disposed', () => {\n const input1 = tfl.input({shape: [4]});\n const input2 = tfl.input({shape: [4]});\n const sharedDenseLayer = tfl.layers.dense({units: 3, activation: 'relu'});\n const nonSharedDenseLayer1 = tfl.layers.dense({units: 1, useBias: false});\n const nonSharedDenseLayer2 = tfl.layers.dense({units: 1, useBias: false});\n const output1 = nonSharedDenseLayer1.apply(\n sharedDenseLayer.apply(input1)) as tfl.SymbolicTensor;\n const output2 = nonSharedDenseLayer2.apply(\n sharedDenseLayer.apply(input2)) as tfl.SymbolicTensor;\n\n const model1 = tfl.model({inputs: [input1], outputs: [output1]});\n const model2 = tfl.model({inputs: [input2], outputs: [output2]});\n\n // Call predict once to make sure that both models' weights are initialized.\n model1.predict(zeros([2, 4]));\n model2.predict(zeros([2, 4]));\n const xs = zeros([2, 4]);\n\n const numTensors0 = memory().numTensors;\n const result1 = model1.dispose();\n\n expect(result1.refCountAfterDispose).toEqual(0);\n expect(result1.numDisposedVariables).toEqual(1);\n // After model1 is disposed, only the single weight of\n // `nonSharedDenseLayer1` should have been freed.\n expect(memory().numTensors).toEqual(numTensors0 - 1);\n\n // At this point, calling predict() on model1 should fail, but doing the\n // same on model2 should still work.\n expect(() => model1.predict(xs)).toThrowError(/already disposed/);\n const ys = model2.predict(xs) as Tensor;\n expect(ys.shape).toEqual([2, 1]);\n ys.dispose();\n\n const result2 = model2.dispose();\n\n expect(result2.refCountAfterDispose).toEqual(0);\n expect(result2.numDisposedVariables).toEqual(3);\n // After model2 is disposed, the single weight of `nonSharedDenseLayer2`\n // and the two weights o `sharedDenseLayer` should be freed.\n expect(memory().numTensors).toEqual(numTensors0 - 4);\n\n // At this point, calling predict() on both model1 and model2 should fail.\n expect(() => model1.predict(xs)).toThrowError(/already disposed/);\n expect(() => model2.predict(xs)).toThrowError(/already disposed/);\n });\n\n it('Disposing nested sequential model preserves the inner model', () => {\n const innerModel = tfl.sequential();\n innerModel.add(tfl.layers.reshape({targetShape: [10], inputShape: [2, 5]}));\n innerModel.add(tfl.layers.dense({units: 6, activation: 'relu'}));\n innerModel.add(tfl.layers.dense({units: 4, activation: 'relu'}));\n\n const outerModel = tfl.sequential();\n outerModel.add(\n tfl.layers.reshape({targetShape: [2, 5], inputShape: [5, 2]}));\n outerModel.add(innerModel);\n outerModel.add(tfl.layers.dense({units: 3, activation: 'softmax'}));\n\n const xsOuter = zeros([1, 5, 2]);\n const xsInner = zeros([1, 2, 5]);\n outerModel.predict(xsOuter); // Call predict() to initialize the weights.\n const numTensors0 = memory().numTensors;\n\n const result1 = outerModel.dispose();\n\n expect(result1.refCountAfterDispose).toEqual(0);\n expect(result1.numDisposedVariables).toEqual(2);\n // Calling dispose on the outer model should have freed the two weights that\n // belong to only the outer model and not to the inner model.\n expect(memory().numTensors).toEqual(numTensors0 - 2);\n\n // Calling dispose on the outer model again should lead to Error.\n expect(() => outerModel.dispose())\n .toThrowError(/Container .* already disposed/);\n // Calling predict on the outer model should fail.\n expect(() => outerModel.predict(xsOuter)).toThrowError(/already disposed/);\n\n // At this point, the inner model is still usable.\n const ysInner = innerModel.predict(xsInner) as Tensor;\n expect(ysInner.shape).toEqual([1, 4]);\n ysInner.dispose();\n\n // Calling dispose on innerModel should finally freed all the weights.\n const result2 = innerModel.dispose();\n\n expect(result2.refCountAfterDispose).toEqual(0);\n expect(result2.numDisposedVariables).toEqual(4);\n expect(memory().numTensors).toEqual(numTensors0 - 6);\n\n // At this point, the inner model should have become unusable.\n expect(() => innerModel.predict(xsInner)).toThrowError(/already disposed/);\n });\n\n it('Nested model gets the correct kwargs', async () => {\n const innerModel = tfl.sequential();\n const layer =\n tfl.layers.dense({units: 1, inputShape: [5], activation: 'sigmoid'});\n innerModel.add(layer);\n\n const input = tfl.input({shape: [5]});\n const output = innerModel.apply(input) as SymbolicTensor;\n const model = tfl.model({inputs: input, outputs: output});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const kwargsArray: Kwargs[] = [];\n const recordKwargsHook: CallHook = (inputs: Tensor|Tensor[], kwargs: {}) =>\n kwargsArray.push(kwargs);\n layer.setCallHook(recordKwargsHook);\n\n const xs = ones([3, 5]);\n const ys = ones([3, 1]);\n await model.trainOnBatch(xs, ys);\n expect(kwargsArray.length).toEqual(1);\n expect(kwargsArray[0]['training']).toEqual(true);\n });\n it('Dispose Sequential model with a Dropout', () => {\n const numTensors0 = memory().numTensors;\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 2, inputShape: [3], activation: 'relu'}));\n model.add(tfl.layers.dense({units: 1}));\n model.add(tfl.layers.dropout({rate: 0.8}));\n model.build([3, 3]);\n\n const result = model.dispose();\n expect(result.refCountAfterDispose).toEqual(0);\n expect(result.numDisposedVariables).toEqual(4);\n // The four weight variables of the two layers should have been disposed.\n // + the rate from the dropout tensor\n expect(memory().numTensors).toEqual(numTensors0);\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-layers/dist/engine/dataset_fakes.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.d.ts deleted file mode 100644 index e80f6b8f8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { Shape } from '../keras_format/common'; -import { TensorOrArrayOrMap } from '../types'; -import { Dataset, LazyIterator } from './dataset_stub'; -import { FitDatasetElement } from './training_dataset'; -export interface FakeDatasetArgs { - /** - * The shape(s) of the features of a single example. - * - * Use an object mapping name to shape, if more than one feature tensors - * are required. - */ - xShape: Shape | { - [name: string]: Shape; - }; - /** - * The shape of the target(s) of a single exapmle. - */ - yShape: Shape | { - [name: string]: Shape; - }; - /** - * A function that generates preset sequence of X tensors. - * - * This function is invoked each time a new iterator is created. - */ - xTensorsFunc?: () => tfc.Tensor[] | { - [name: string]: tfc.Tensor[]; - }; - /** - * A function that generates preset sequence of Y tensors. - * - * This function is invoked each time a new iterator is created. - */ - yTensorsFunc?: () => tfc.Tensor[] | { - [name: string]: tfc.Tensor[]; - }; - /** - * The size of each batch generated by the iterator. - */ - batchSize: number; - /** - * The number of batches an iterator generates before declaring done to be - * true. - */ - numBatches: number; -} -/** - * A fake dataset with configurable feature and target shapes. - * - * The batch size and # of batches are also configurable. - * - * The iterator from the dataset always generate random-normal float32 values. - */ -export declare class FakeNumericDataset extends Dataset { - readonly args: FakeDatasetArgs; - constructor(args: FakeDatasetArgs); - iterator(): Promise>; -} -export declare class FakeNumericDatasetLegacyArrayForm extends Dataset<[TensorOrArrayOrMap, TensorOrArrayOrMap]> { - readonly args: FakeDatasetArgs; - ds: FakeNumericDataset; - constructor(args: FakeDatasetArgs); - iterator(): Promise>; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.js.map deleted file mode 100644 index 353384e6e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataset_fakes.js","sourceRoot":"","sources":["../../src/engine/dataset_fakes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAK7C,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AA2CrD,SAAS,sBAAsB,CAC3B,SAAiB,EAAE,KAAoC;IAEzD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAClC;SAAM;QACL,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IA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AA2E;AAC3E,4EAA4E;AAC5E,MAAM,OAAO,iCAAkC,SAC3C,OAAiD;IAEnD,YAAqB,IAAqB;QACxC,KAAK,EAAE,CAAC;QADW,SAAI,GAAJ,IAAI,CAAiB;QAExC,IAAI,CAAC,EAAE,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,QAAQ;QAEZ,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,kCAAkC,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF;AAED,MAAM,kCAAmC,SACrC,YAAsD;IACxD,YAA6B,EAAmC;QAC9D,KAAK,EAAE,CAAC;QADmB,OAAE,GAAF,EAAE,CAAiC;IAEhE,CAAC;IAED,KAAK,CAAC,IAAI;QAER,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QACpC,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;SACxE,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\n\nimport {Shape} from '../keras_format/common';\nimport {TensorOrArrayOrMap} from '../types';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {FitDatasetElement} from './training_dataset';\n\nexport interface FakeDatasetArgs {\n /**\n * The shape(s) of the features of a single example.\n *\n * Use an object mapping name to shape, if more than one feature tensors\n * are required.\n */\n xShape: Shape|{[name: string]: Shape};\n\n /**\n * The shape of the target(s) of a single exapmle.\n */\n yShape: Shape|{[name: string]: Shape};\n\n /**\n * A function that generates preset sequence of X tensors.\n *\n * This function is invoked each time a new iterator is created.\n */\n xTensorsFunc?: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]};\n\n /**\n * A function that generates preset sequence of Y tensors.\n *\n * This function is invoked each time a new iterator is created.\n */\n yTensorsFunc?: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]};\n\n /**\n * The size of each batch generated by the iterator.\n */\n batchSize: number;\n\n /**\n * The number of batches an iterator generates before declaring done to be\n * true.\n */\n numBatches: number;\n}\n\nfunction mergeBatchSizeAndShape(\n batchSize: number, shape: Shape|{[name: string]: Shape}): Shape|\n {[name: string]: Shape} {\n if (Array.isArray(shape)) {\n return [batchSize].concat(shape);\n } else {\n const output: {[name: string]: Shape} = {};\n for (const name in shape) {\n output[name] = [batchSize].concat(shape[name]);\n }\n return output;\n }\n}\n\nfunction generateRandomTensorContainer(shape: Shape|{[name: string]: Shape}):\n tfc.Tensor|{[name: string]: tfc.Tensor} {\n let output: tfc.Tensor|{[name: string]: tfc.Tensor};\n if (Array.isArray(shape)) {\n output = tfc.randomNormal(shape);\n } else {\n output = {};\n for (const name in shape) {\n output[name] = tfc.randomNormal(shape[name]);\n }\n }\n return output;\n}\n\nclass FakeNumericIterator extends LazyIterator {\n private xBatchShape: Shape|{[name: string]: Shape};\n private yBatchShape: Shape|{[name: string]: Shape};\n private numBatches: number;\n private batchCount: number;\n private xTensorsFunc: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]};\n private yTensorsFunc: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]};\n private xTensorValues: tfc.Tensor[]|{[name: string]: tfc.Tensor[]};\n private yTensorValues: tfc.Tensor[]|{[name: string]: tfc.Tensor[]};\n private tensorIndex = 0;\n\n constructor(args: FakeDatasetArgs) {\n super();\n this.xBatchShape = mergeBatchSizeAndShape(args.batchSize, args.xShape);\n this.yBatchShape = mergeBatchSizeAndShape(args.batchSize, args.yShape);\n this.numBatches = args.numBatches;\n this.batchCount = 0;\n this.xTensorsFunc = args.xTensorsFunc;\n this.yTensorsFunc = args.yTensorsFunc;\n\n // Sanity check on the preset tensors.\n tfc.util.assert(\n this.xTensorsFunc == null && this.yTensorsFunc == null ||\n this.xTensorsFunc != null && this.yTensorsFunc != null,\n () => 'presetXTensors and presetYTensors must be both null/undefined ' +\n 'or both set.');\n }\n\n async next(): Promise> {\n const done = ++this.batchCount > this.numBatches;\n if (done) {\n return {done, value: null};\n }\n if (this.xTensorsFunc == null) {\n // Generate data randomly.\n return {\n done,\n value: done ? null : {\n xs: generateRandomTensorContainer(this.xBatchShape),\n ys: generateRandomTensorContainer(this.yBatchShape)\n }\n };\n } else {\n // Use preset tensors.\n if ((this.batchCount - 1) % this.numBatches === 0) {\n this.xTensorValues = this.xTensorsFunc();\n this.yTensorValues = this.yTensorsFunc();\n this.tensorIndex = 0;\n }\n const index = this.tensorIndex++;\n\n let xs: tfc.Tensor|{[name: string]: tfc.Tensor};\n if (Array.isArray(this.xTensorValues)) {\n xs = this.xTensorValues[index];\n tfc.util.assert(\n tfc.util.arraysEqual(xs.shape, this.xBatchShape as Shape),\n () => `Shape mismatch: expected: ${\n JSON.stringify(this.xBatchShape)}; ` +\n `actual: ${JSON.stringify((xs as tfc.Tensor).shape)}`);\n } else {\n xs = {};\n for (const key in this.xTensorValues) {\n xs[key] = this.xTensorValues[key][index];\n tfc.util.assert(\n tfc.util.arraysEqual(xs[key].shape, this.xBatchShape as Shape),\n () => `Shape mismatch: expected: ${\n JSON.stringify(this.xBatchShape)}; ` +\n `actual: ${JSON.stringify((xs as tfc.Tensor).shape)}`);\n }\n }\n\n let ys: tfc.Tensor|{[name: string]: tfc.Tensor};\n if (Array.isArray(this.yTensorValues)) {\n // Get preset ys tensors for single-output models.\n ys = this.yTensorValues[index];\n tfc.util.assert(\n tfc.util.arraysEqual(ys.shape, this.yBatchShape as Shape),\n () => `Shape mismatch: expected: ${\n JSON.stringify(this.yBatchShape)}; ` +\n `actual: ${JSON.stringify((ys as tfc.Tensor).shape)}`);\n } else {\n // Get preset ys tensors for multi-output models.\n ys = {};\n this.yBatchShape = this.yBatchShape as {[name: string]: Shape};\n for (const key in this.yTensorValues) {\n ys[key] = this.yTensorValues[key][index];\n tfc.util.assert(\n tfc.util.arraysEqual(ys[key].shape, this.yBatchShape[key]),\n () => `Shape mismatch: expected: ${\n JSON.stringify(this.yBatchShape)}; ` +\n `actual: ${\n JSON.stringify(\n (ys as {[name: string]: tfc.Tensor})[key].shape)}`);\n }\n }\n\n return {done, value: {xs, ys}};\n }\n }\n}\n\n/**\n * A fake dataset with configurable feature and target shapes.\n *\n * The batch size and # of batches are also configurable.\n *\n * The iterator from the dataset always generate random-normal float32 values.\n */\nexport class FakeNumericDataset extends Dataset {\n constructor(readonly args: FakeDatasetArgs) {\n super();\n tfc.util.assert(\n args.batchSize > 0 && Number.isInteger(args.batchSize),\n () =>\n `batchSize must be a positive integer, but got ${args.batchSize}`);\n tfc.util.assert(\n args.numBatches > 0 && Number.isInteger(args.numBatches),\n () =>\n `numBatches must be positive integer, but got ${args.numBatches}`);\n this.size = args.numBatches;\n }\n\n async iterator(): Promise> {\n return new FakeNumericIterator(this.args);\n }\n}\n\n// We can't use Dataset.map(...) because we don't depend on tfjs-data here,\n// so we manually transform the above {xs, ys} dataset to the [xs, ys] form.\nexport class FakeNumericDatasetLegacyArrayForm extends\n Dataset<[TensorOrArrayOrMap, TensorOrArrayOrMap]> {\n ds: FakeNumericDataset;\n constructor(readonly args: FakeDatasetArgs) {\n super();\n this.ds = new FakeNumericDataset(args);\n }\n\n async iterator():\n Promise> {\n const it = await this.ds.iterator();\n return new FakeNumericIteratorLegacyArrayForm(it);\n }\n}\n\nclass FakeNumericIteratorLegacyArrayForm extends\n LazyIterator<[TensorOrArrayOrMap, TensorOrArrayOrMap]> {\n constructor(private readonly it: LazyIterator) {\n super();\n }\n\n async next():\n Promise> {\n const result = await this.it.next();\n return {\n done: result.done,\n value: result.value == null ? null : [result.value.xs, result.value.ys]\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-layers/dist/engine/dataset_fakes_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes_test.js.map deleted file mode 100644 index 09c77d238..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_fakes_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataset_fakes_test.js","sourceRoot":"","sources":["../../src/engine/dataset_fakes_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEnD,qBAAqB,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAC/C,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAClC,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;YAC1B,uEAAuE;YACvE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC1B,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,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BAAkB,CACxB,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;aAC5D,OAAO,EAAE,CAAC;QACf,MAAM,CACF,GAAG,EAAE,CAAC,IAAI,kBAAkB;QACxB,kCAAkC;QAClC,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,KAAY,EAAC,CAAC,CAAC;aACvE,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {NamedTensorMap, Tensor} from '@tensorflow/tfjs-core';\n\nimport {describeMathCPUAndGPU} from '../utils/test_utils';\n\nimport {FakeNumericDataset} from './dataset_fakes';\n\ndescribeMathCPUAndGPU('FakeNumericDataset', () => {\n it('1D features, 1D targets', async () => {\n const dataset = new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 8, numBatches: 5});\n for (let k = 0; k < 2; ++k) {\n // Run twice to make sure that calling iteartor() multiple times works.\n const iterator = await dataset.iterator();\n for (let i = 0; i < 5; ++i) {\n const result = await iterator.next();\n expect((result.value.xs as Tensor).shape).toEqual([8, 3]);\n expect((result.value.ys as Tensor).shape).toEqual([8, 1]);\n expect(result.done).toEqual(false);\n }\n for (let i = 0; i < 3; ++i) {\n const result = await iterator.next();\n expect(result.value).toBeNull();\n expect(result.done).toEqual(true);\n }\n }\n });\n\n it('2D features, 1D targets', async () => {\n const dataset = new FakeNumericDataset(\n {xShape: [3, 4], yShape: [2], batchSize: 8, numBatches: 5});\n for (let k = 0; k < 2; ++k) {\n // Run twice to make sure that calling iteartor() multiple times works.\n const iterator = await dataset.iterator();\n for (let i = 0; i < 5; ++i) {\n const result = await iterator.next();\n expect((result.value.xs as Tensor).shape).toEqual([8, 3, 4]);\n expect((result.value.ys as Tensor).shape).toEqual([8, 2]);\n expect(result.done).toEqual(false);\n }\n for (let i = 0; i < 3; ++i) {\n const result = await iterator.next();\n expect(result.value).toBeNull();\n expect(result.done).toEqual(true);\n }\n }\n });\n\n it('Multiple 2D features, 1D targets', async () => {\n const dataset = new FakeNumericDataset({\n xShape: {'input1': [3, 4], 'input2': [2, 3]},\n yShape: [2],\n batchSize: 8,\n numBatches: 5\n });\n for (let k = 0; k < 2; ++k) {\n // Run twice to make sure that calling iteartor() multiple times works.\n const iterator = await dataset.iterator();\n for (let i = 0; i < 5; ++i) {\n const result = await iterator.next();\n const xs = result.value.xs as NamedTensorMap;\n expect(xs['input1'].shape).toEqual([8, 3, 4]);\n expect(xs['input2'].shape).toEqual([8, 2, 3]);\n expect((result.value.ys as Tensor).shape).toEqual([8, 2]);\n expect(result.done).toEqual(false);\n }\n for (let i = 0; i < 3; ++i) {\n const result = await iterator.next();\n expect(result.value).toBeNull();\n expect(result.done).toEqual(true);\n }\n }\n });\n\n it('Invalid batchSize leads to Error', () => {\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: -8, numBatches: 5}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 8.5, numBatches: 5}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 0, numBatches: 5}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n // tslint:disable-next-line:no-any\n {xShape: [3], yShape: [1], batchSize: 'foo' as any, numBatches: 5}))\n .toThrow();\n });\n\n it('Invalid numBatches leads to Error', () => {\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 8, numBatches: -5}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 8, numBatches: 5.5}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n {xShape: [3], yShape: [1], batchSize: 8, numBatches: 0}))\n .toThrow();\n expect(\n () => new FakeNumericDataset(\n // tslint:disable-next-line:no-any\n {xShape: [3], yShape: [1], batchSize: 8, numBatches: 'foo' as any}))\n .toThrow();\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-layers/dist/engine/dataset_stub.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.d.ts deleted file mode 100644 index 4d8cd6024..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Stub interfaces and classes for testing tf.LayersModel.fitDataset(). - * - * TODO(cais, soergel): Remove this in favor of actual interfaces and classes - * when ready. - */ -export declare abstract class LazyIterator { - abstract next(): Promise>; -} -export declare abstract class Dataset { - abstract iterator(): Promise>; - size: number; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js deleted file mode 100644 index 7f723bdaf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Stub interfaces and classes for testing tf.LayersModel.fitDataset(). - * - * TODO(cais, soergel): Remove this in favor of actual interfaces and classes - * when ready. - */ -export class LazyIterator { -} -export class Dataset { -} -//# sourceMappingURL=dataset_stub.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-layers/dist/engine/dataset_stub.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js.map deleted file mode 100644 index a2916dd40..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/dataset_stub.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataset_stub.js","sourceRoot":"","sources":["../../src/engine/dataset_stub.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH,MAAM,OAAgB,YAAY;CAEjC;AAED,MAAM,OAAgB,OAAO;CAG5B","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Stub interfaces and classes for testing tf.LayersModel.fitDataset().\n *\n * TODO(cais, soergel): Remove this in favor of actual interfaces and classes\n * when ready.\n */\n\nexport abstract class LazyIterator {\n abstract next(): Promise>;\n}\n\nexport abstract class Dataset {\n abstract iterator(): Promise>;\n size: number;\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-layers/dist/engine/executor.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts deleted file mode 100644 index 582e69277..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Executor: Evaluates SymbolicTensor based on feeds. - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { Kwargs } from '../types'; -import { SymbolicTensor } from './topology'; -/** - * A concrete Tensor value for a symbolic tensor as the key. - */ -export interface Feed { - key: SymbolicTensor; - value: Tensor; -} -/** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ -export declare class FeedDict { - private id2Value; - private id2Mask; - private name2Id; - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - constructor(feeds?: Feed[] | FeedDict); - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict; - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - addFeed(feed: Feed): void; - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - hasKey(key: SymbolicTensor): boolean; - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - names(): string[]; - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getValue(key: SymbolicTensor | string): Tensor; - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getMask(key: SymbolicTensor | string): Tensor; - /** Dispose all mask Tensors held by this object. */ - disposeMasks(): void; -} -/** - * Interface for the optional object used for probing the memory - * usage and other statistics during execution. - */ -export interface ExecutionProbe { - /** - * Maximum number of tensors that exist during all steps of the - * execution. Tensor counts are measured at the beginning of every - * step. - */ - maxNumTensors?: number; - /** - * Minimum number of tensors that exist during all steps of the - * execution. Tensor counts are measured at the beginning of every - * step. - */ - minNumTensors?: number; -} -/** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ -export declare function execute(fetches: SymbolicTensor | SymbolicTensor[], feedDict: FeedDict, kwargs?: Kwargs, probe?: ExecutionProbe): Tensor | Tensor[] | [Tensor | Tensor[]]; -export declare type RecipientMap = { - [fetchName: string]: Set; -}; -/** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ -export declare function getTopologicalSortAndRecipientCountsForOneFetch(fetch: SymbolicTensor, feedDict: FeedDict): { - sorted: SymbolicTensor[]; - recipientMap: RecipientMap; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js deleted file mode 100644 index 9ad030902..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js +++ /dev/null @@ -1,444 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Executor: Evaluates SymbolicTensor based on feeds. - */ -import { cast, dispose, memory, util } from '@tensorflow/tfjs-core'; -import { ValueError } from '../errors'; -import { toList } from '../utils/generic_utils'; -import { InputLayer } from './input_layer'; -import { SymbolicTensor } from './topology'; -/** - * Helper function to check the dtype and shape compatibility of a feed value. - */ -function assertFeedCompatibility(key, val) { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return cast(val, key.dtype); - } - catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError(`The dtype of the feed (${val.dtype}) can not be cast to the dtype ` + - `of the key '${key.name}' (${key.dtype}).`); - } -} -/** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ -export class FeedDict { - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - constructor(feeds) { - this.id2Value = {}; - this.id2Mask = {}; - this.name2Id = {}; - if (feeds instanceof FeedDict) { - for (const id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } - else { - if (feeds == null) { - return; - } - for (const feed of feeds) { - this.add(feed.key, feed.value); - } - } - } - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - add(key, value, mask) { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } - else { - throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`); - } - return this; - } - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - addFeed(feed) { - this.add(feed.key, feed.value); - } - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - hasKey(key) { - return this.id2Value[key.id] != null; - } - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - names() { - return Object.keys(this.name2Id); - } - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getValue(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Value[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Value[id]; - } - } - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getMask(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Mask[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Mask[id]; - } - } - /** Dispose all mask Tensors held by this object. */ - disposeMasks() { - if (this.id2Mask != null) { - dispose(this.id2Mask); - } - } -} -// Cache for topologically sorted SymbolicTensors for given execution -// targets (i.e., fetches). -const cachedSorted = {}; -// Cache for recipient count maps for given execution targets (i.e., fetches). -const cachedRecipientCounts = {}; -/** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ -export function execute(fetches, feedDict, kwargs, probe) { - const training = kwargs == null ? false : kwargs['training']; - const arrayFetches = Array.isArray(fetches); - const fetchArray = arrayFetches ? fetches : [fetches]; - const outputNames = fetchArray.map(t => t.name); - const finalOutputs = []; - const feedNames = feedDict.names(); - for (const outputName of outputNames) { - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } - else { - finalOutputs.push(null); - } - } - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - // Check cache. - const fetchAndFeedKey = outputNames.join(',') + '|' + feedDict.names().join(','); - let sorted; - let recipientCounts; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - const internalFeedDict = new FeedDict(feedDict); - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (let i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - const numTensors = memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - const symbolic = sorted[i]; - const srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - const inputValues = []; - const inputMasks = []; - const tensorsToDispose = []; - let maskExists = false; - for (const input of symbolic.inputs) { - const value = internalFeedDict.getValue(input); - const mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - const outputTensors = toList(srcLayer.apply(inputValues, kwargs)); - let outputMask = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - const layerOutputs = getNodeOutputs(symbolic); - const outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (let i = 0; i < outputSymbolicTensors.length; ++i) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) { - internalFeedDict.add(outputSymbolicTensors[i], outputTensors[i], Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - const index = outputNames.indexOf(outputSymbolicTensors[i].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i]; - } - } - if (!training) { - // Clean up Tensors that are no longer needed. - dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - return arrayFetches ? finalOutputs : finalOutputs[0]; -} -/** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCounts(fetches, feedDict) { - util.assert(fetches != null && fetches.length > 0, () => `Expected at least one fetch, got none`); - let finalSorted = []; - let finalRecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - const out = getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } - else { - const visited = new Set(); - for (const fetch of fetches) { - const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict); - // Merge sorted SymbolicTensor Arrays. - for (const symbolicTensor of sorted) { - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - // Merge recipient maps. - for (const name in recipientMap) { - if (finalRecipientMap[name] == null) { - finalRecipientMap[name] = new Set(); - } - recipientMap[name].forEach(recipient => finalRecipientMap[name].add(recipient)); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; -} -function recipientMap2Counts(recipientMap) { - const recipientCounts = {}; - for (const name in recipientMap) { - recipientCounts[name] = recipientMap[name].size; - } - return recipientCounts; -} -/** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ -export function getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict) { - const visited = new Set(); - const sorted = []; - const recipientMap = {}; - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (const key of feedDict.names()) { - visited.add(key); - } - const stack = []; - const marks = []; - // Initial population of stack and marks. - stack.push(fetch); - while (stack.length > 0) { - const top = stack[stack.length - 1]; - if (visited.has(top.name)) { - stack.pop(); - continue; - } - const topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top); - visited.add(top.name); - if (topIsMarked) { - marks.pop(); - } - } - else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (const input of top.inputs) { - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top.name); - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return { sorted, recipientMap }; -} -/** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ -function getNodeOutputs(fetch) { - let layerOutputs; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } - else { - let nodeIndex = null; - for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (const outputTensor of fetch.sourceLayer.inboundNodes[i] - .outputTensors) { - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; -} -//# sourceMappingURL=executor.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-layers/dist/engine/executor.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map deleted file mode 100644 index 66a909878..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/engine/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C;;GAEG;AACH,SAAS,uBAAuB,CAAC,GAAmB,EAAE,GAAW;IAC/D,6BAA6B;IAC7B,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE;QAChD,gDAAgD;QAChD,OAAO,GAAG,CAAC;KACZ;IACD,IAAI;QACF,2CAA2C;QAC3C,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;KAC7B;IAAC,OAAO,GAAG,EAAE;QACZ,iDAAiD;QACjD,MAAM,IAAI,UAAU,CAChB,0BAA0B,GAAG,CAAC,KAAK,iC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AI,EAAE;oBACpC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAU,CAAC;iBAC9C;gBACD,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAEvC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;oBAC3B,SAAS,CAAE,oDAAoD;iBAChE;gBACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACnB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAqB;IAE3C,IAAI,YAA6C,CAAC;IAClD,IAAI,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/C,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;KACzC;SAAM;QACL,IAAI,SAAS,GAAW,IAAI,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAC9D,KAAK,MAAM,YAAY,IAAI,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;iBAClD,aAAa,EAAE;gBACvB,IAAI,YAAY,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE;oBAChC,SAAS,GAAG,CAAC,CAAC;oBACd,MAAM;iBACP;aACF;SACF;QACD,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KACzD;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\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-layers/dist/engine/executor_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor_test.js.map deleted file mode 100644 index 3e9521af9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/executor_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"executor_test.js","sourceRoot":"","sources":["../../src/engine/executor_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEzG,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,OAAO,EAAC,OAAO,EAAkB,QAAQ,EAAE,+CAA+C,EAAC,MAAM,YAAY,CAAC;AAE9G,gBAAgB;AAEhB,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE;IAC/B,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;IAC9D,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,EAAE,CA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AAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,kBAAkB,CACd,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for executor_test.ts.\n */\n\nimport {dispose, memory, ones, Tensor, tensor1d, tensor2d, tensor3d, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {execute, ExecutionProbe, FeedDict, getTopologicalSortAndRecipientCountsForOneFetch} from './executor';\n\n// tslint:enable\n\ndescribeMathCPU('FeedDict', () => {\n const x = tfl.input({shape: [], name: 'x', dtype: 'float32'});\n const y = tfl.input({shape: [], name: 'y', dtype: 'float32'});\n const xValue = tensor1d([42]);\n const yValue = tensor1d([21]);\n\n it('FeedDict from a single Feed', () => {\n const feedDict = new FeedDict([{key: x, value: xValue}]);\n\n expect(feedDict.hasKey(x)).toBe(true);\n expect(feedDict.hasKey(y)).toBe(false);\n expect(feedDict.getValue(x)).toEqual(xValue);\n expect(() => feedDict.getValue(y)).toThrowError();\n });\n it('FeedDict from duplicate Feeds throws error', () => {\n const feed = {key: x, value: xValue};\n expect(() => new FeedDict([feed, feed])).toThrowError(/Duplicate key/);\n });\n it('Add key and value', () => {\n const feedDict = new FeedDict();\n expect(feedDict.hasKey(x)).toBe(false);\n expect(feedDict.hasKey(y)).toBe(false);\n\n expect(feedDict.add(x, xValue)).toEqual(feedDict);\n expect(feedDict.hasKey(x)).toBe(true);\n expect(feedDict.hasKey(y)).toBe(false);\n\n expect(feedDict.add(y, yValue)).toEqual(feedDict);\n expect(feedDict.hasKey(x)).toBe(true);\n expect(feedDict.hasKey(y)).toBe(true);\n expect(feedDict.getValue(x)).toEqual(xValue);\n expect(feedDict.getValue(y)).toEqual(yValue);\n });\n it('getValue by tensor name', () => {\n const feedDict = new FeedDict();\n expect(feedDict.add(x, xValue)).toEqual(feedDict);\n expect(feedDict.add(y, yValue)).toEqual(feedDict);\n\n expect(feedDict.getValue(x.name)).toEqual(xValue);\n expect(feedDict.getValue(y.name)).toEqual(yValue);\n });\n it('Copy constructor', () => {\n const feedDict1 = new FeedDict().add(x, xValue);\n const feedDict2 = new FeedDict(feedDict1);\n expect(feedDict2.hasKey(x)).toBe(true);\n expect(feedDict2.getValue(x)).toEqual(xValue);\n expect(feedDict2.hasKey(y)).toBe(false);\n\n feedDict2.add(y, yValue);\n expect(feedDict2.hasKey(y)).toBe(true);\n expect(feedDict2.getValue(y)).toEqual(yValue);\n expect(feedDict1.hasKey(y)).toBe(false);\n });\n it('Add duplicate key and value leads to error', () => {\n const feedDict = new FeedDict();\n\n expect(feedDict.add(x, xValue)).toEqual(feedDict);\n expect(() => feedDict.add(x, xValue)).toThrowError(/Duplicate key/);\n });\n it('Feeding compatible value with undetermined dimension works', () => {\n const s = tfl.input({shape: [null, 4], name: 's', dtype: 'float32'});\n const sValue = tensor3d([1, 3, 3, 7], [1, 1, 4]);\n const feedDict = new FeedDict([{key: s, value: sValue}]);\n expect(feedDict.getValue(s)).toEqual(sValue);\n });\n});\n\ndescribeMathCPU('getTopologicalSortAndRecipientCountsForOneFetch', () => {\n it('Triangular topology', () => {\n const input = tfl.input({shape: [2, 6]});\n const f1 = tfl.layers.flatten().apply(input) as tfl.SymbolicTensor;\n const r1 = tfl.layers.reLU().apply(f1) as tfl.SymbolicTensor;\n const c1 = tfl.layers.concatenate().apply([f1, r1]) as tfl.SymbolicTensor;\n const relu2 = tfl.layers.reLU().apply(c1) as tfl.SymbolicTensor;\n\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(relu2, new FeedDict());\n expect(sorted).toEqual([input, f1, r1, c1, relu2]);\n expect(recipientMap[input.name].size).toEqual(1);\n expect(recipientMap[f1.name].size).toEqual(2);\n expect(recipientMap[r1.name].size).toEqual(1);\n expect(recipientMap[c1.name].size).toEqual(1);\n });\n\n it('Double triangular topology', () => {\n const input = tfl.input({shape: [2, 6]});\n const f1 = tfl.layers.flatten().apply(input) as tfl.SymbolicTensor;\n const r1 = tfl.layers.reLU().apply(f1) as tfl.SymbolicTensor;\n const c1 = tfl.layers.concatenate().apply([f1, r1]) as tfl.SymbolicTensor;\n const r2 = tfl.layers.reLU().apply(c1) as tfl.SymbolicTensor;\n const c2 = tfl.layers.concatenate().apply([f1, r2]) as tfl.SymbolicTensor;\n const r3 = tfl.layers.reLU().apply(c2) as tfl.SymbolicTensor;\n\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(r3, new FeedDict());\n expect(sorted).toEqual([input, f1, r1, c1, r2, c2, r3]);\n expect(recipientMap[input.name].size).toEqual(1);\n expect(recipientMap[f1.name].size).toEqual(3);\n expect(recipientMap[r1.name].size).toEqual(1);\n expect(recipientMap[c1.name].size).toEqual(1);\n expect(recipientMap[r2.name].size).toEqual(1);\n expect(recipientMap[c2.name].size).toEqual(1);\n });\n});\n\ndescribeMathCPUAndGPU('Executor', () => {\n describe('Linear Graph Topology', () => {\n let x: tfl.SymbolicTensor;\n let y: {};\n let u: tfl.SymbolicTensor;\n let v: {};\n let w: {};\n\n beforeEach(() => {\n x = tfl.input({shape: [2], name: 'fooInput', dtype: 'float32'});\n const denseLayer1 = tfl.layers.dense(\n {units: 5, activation: 'linear', kernelInitializer: 'ones'});\n y = denseLayer1.apply(x);\n u = tfl.input({shape: [2], name: 'footInput', dtype: 'float32'});\n const denseLayer2 = tfl.layers.dense(\n {units: 5, activation: 'linear', kernelInitializer: 'ones'});\n const denseLayer3 = tfl.layers.dense(\n {units: 3, activation: 'linear', kernelInitializer: 'ones'});\n v = denseLayer2.apply(u);\n w = denseLayer3.apply(v as tfl.SymbolicTensor);\n });\n\n it('Execute Input directly', () => {\n const xValue = ones([2, 2]);\n const feedDict = new FeedDict().add(x, xValue);\n expectTensorsClose(\n execute(x, feedDict) as Tensor, tensor2d([1, 1, 1, 1], [2, 2]));\n });\n it('Input to Dense', () => {\n const xValue = ones([2, 2]);\n const feedDict = new FeedDict([{key: x, value: xValue}]);\n expectTensorsClose(\n execute(y as tfl.SymbolicTensor, feedDict) as Tensor,\n tensor2d([2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 5]));\n });\n it('Input to Dense1 to Dense2', () => {\n const uValue = ones([2, 2]);\n const feedDict = new FeedDict([{key: u, value: uValue}]);\n expectTensorsClose(\n execute(w as tfl.SymbolicTensor, feedDict) as Tensor,\n tensor2d([10, 10, 10, 10, 10, 10], [2, 3]));\n });\n it('Feed value to intermediate layers is supported', () => {\n const vValue = ones([3, 5]);\n const feedDict =\n new FeedDict([{key: v as tfl.SymbolicTensor, value: vValue}]);\n expectTensorsClose(\n execute(w as tfl.SymbolicTensor, feedDict) as Tensor,\n tensor2d([5, 5, 5, 5, 5, 5, 5, 5, 5], [3, 3]));\n });\n it('Calling execute without all Input feeds available leads to error',\n () => {\n const feedDict = new FeedDict();\n expect(() => execute(y as tfl.SymbolicTensor, feedDict)).toThrow();\n });\n\n it('Maximum memory use under linear graph topology', () => {\n const input = tfl.input({shape: [2, 3]});\n let y: tfl.SymbolicTensor = input;\n for (let i = 0; i < 10; ++i) {\n y = tfl.layers.reshape({targetShape: i % 2 === 0 ? [6] : [3, 2]})\n .apply(y) as tfl.SymbolicTensor;\n }\n const feedDict = new FeedDict([{key: input, value: zeros([4, 2, 3])}]);\n const numTensors0 = memory().numTensors;\n const probe: ExecutionProbe = {};\n dispose(execute(y, feedDict, null, probe));\n // Assert no memory leak.\n expect(memory().numTensors).toEqual(numTensors0);\n // Assert that intermediate tensors are cleaned up properly during\n // execution.\n expect(probe.maxNumTensors).toBeLessThanOrEqual(numTensors0 + 1);\n });\n });\n\n describe('Diamond Graph Topology', () => {\n it('Calling execute with two fetches and diamond graph works', () => {\n const x = tfl.input({shape: [2], name: 'fooInput', dtype: 'float32'});\n const denseLayer1 = tfl.layers.dense({\n units: 5,\n activation: 'linear',\n kernelInitializer: 'ones',\n name: 'denseLayer1'\n });\n const y = denseLayer1.apply(x);\n const denseLayer2 = tfl.layers.dense({\n units: 4,\n activation: 'linear',\n kernelInitializer: 'ones',\n name: 'denseLayer2'\n });\n const denseLayer3 = tfl.layers.dense({\n units: 3,\n activation: 'linear',\n kernelInitializer: 'ones',\n name: 'denseLayer3'\n });\n const z1 = denseLayer2.apply(y) as tfl.SymbolicTensor;\n const z2 = denseLayer3.apply(y) as tfl.SymbolicTensor;\n\n const xValue = ones([2, 2]);\n const feedDict = new FeedDict([{key: x, value: xValue}]);\n let callCounter = 0;\n denseLayer1.setCallHook(() => {\n callCounter++;\n });\n\n const outputs = execute([z1, z2], feedDict) as Tensor[];\n expectTensorsClose(\n outputs[0], tensor2d([10, 10, 10, 10, 10, 10, 10, 10], [2, 4]));\n expectTensorsClose(\n outputs[1], tensor2d([10, 10, 10, 10, 10, 10], [2, 3]));\n expect(callCounter).toEqual(1);\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-layers/dist/engine/input_layer.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts deleted file mode 100644 index 0a23f0b87..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -import { DisposeResult, Layer, SymbolicTensor } from './topology'; -/** - * Constructor arguments for InputLayer. - * - * Note: You should provide only inputShape or batchInputShape (not both). - * If only inputShape is provided, then the batchInputShape is determined by - * the batchSize argument and the inputShape: [batchSize].concat(inputShape). - */ -export declare interface InputLayerArgs { - /** Input shape, not including the batch axis. */ - inputShape?: Shape; - /** Optional input batch size (integer or null). */ - batchSize?: number; - /** Batch input shape, including the batch axis. */ - batchInputShape?: Shape; - /** Datatype of the input. */ - dtype?: DataType; - /** - * Whether the placeholder created is meant to be sparse. - */ - sparse?: boolean; - /** Name of the layer. */ - name?: string; -} -export declare class InputLayer extends Layer { - /** @nocollapse */ - static readonly className = "InputLayer"; - sparse: boolean; - constructor(args: InputLayerArgs); - apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor; - dispose(): DisposeResult; - getConfig(): serialization.ConfigDict; -} -/** - * Config for the Input function. - * - * Note: You should provide only shape or batchShape (not both). - * If only shape is provided, then the batchShape becomes - * [null].concat(inputShape). - */ -export interface InputConfig { - /** - * A shape, not including the batch size. For instance, `shape=[32]` - * indicates that the expected input will be batches of 32-dimensional - * vectors. - */ - shape?: Shape; - /** - * A shape tuple (integer), including the batch size. For instance, - * `batchShape=[10, 32]` indicates that the expected input will be batches of - * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an - * arbitrary number of 32-dimensional vectors. - */ - batchShape?: Shape; - /** - * An optional name string for the layer. Should be unique in a model (do not - * reuse the same name twice). It will be autogenerated if it isn't provided. - */ - name?: string; - dtype?: DataType; - /** - * A boolean specifying whether the placeholder to be created is sparse. - */ - sparse?: boolean; -} -export declare function Input(config: InputConfig): SymbolicTensor; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js deleted file mode 100644 index db4ef13cb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization } from '@tensorflow/tfjs-core'; -import { getUid } from '../backend/state'; -import { ValueError } from '../errors'; -import { Layer, Node, SymbolicTensor } from './topology'; -export class InputLayer extends Layer { - constructor(args) { - super({ - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }); - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - this.trainable = false; - this.built = true; - this.sparse = args.sparse; - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError('Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - let batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError('An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } - else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } - else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError('Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - const dtype = args.dtype || 'float32'; - this.batchInputShape = batchInputShape; - this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - this.inputSpec = [{ shape: batchInputShape }]; - const inputTensor = new SymbolicTensor(this.dtype, this.batchInputShape, this, [], {}, this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - } - apply(inputs, kwargs) { - throw new ValueError('Cannot pass any input to an ' + - `InputLayer's apply() method. InputLayer name: ${this.name}`); - } - dispose() { - // dispose() for InputLayer is overridden as no-op. - return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; - } - getConfig() { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - } -} -/** @nocollapse */ -InputLayer.className = 'InputLayer'; -serialization.registerClass(InputLayer); -export function Input(config) { - if (config.batchShape == null && config.shape == null) { - throw new Error('Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError('Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - let batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - let dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - const inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype, - sparse: config.sparse - }); - const outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; -} -//# sourceMappingURL=input_layer.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-layers/dist/engine/input_layer.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map deleted file mode 100644 index c319c8a7c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"input_layer.js","sourceRoot":"","sources":["../../src/engine/input_layer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAW,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAIrC,OAAO,EAAgB,KAAK,EAAE,IAAI,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AA2BtE,MAAM,OAAO,UAAW,SAAQ,KAAK;IAInC,YAAY,IAAoB;QAC9B,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;SACjE,CAAC,CAAC;QACH,+CAA+C;QAC/C,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;QAED,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,C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AM,IAAI,UAAU,CAChB,kDAAkD;YAClD,kCAAkC,CAAC,CAAC;KACzC;IACD,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACnC,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;QAC9C,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACzB,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,KAAK,GAAG,SAAS,CAAC;KACnB;IAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;QAChC,eAAe,EAAE,UAAU;QAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IACzD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\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-layers/dist/engine/input_layer_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map deleted file mode 100644 index 8ee70b94d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"input_layer_test.js","sourceRoot":"","sources":["../../src/engine/input_layer_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE3C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAGpC,eAAe,CAAC,YAAY,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;aAClC,YAAY,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;QACnD,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAC,UAAU,EAA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AAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ones} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {describeMathCPU} from '../utils/test_utils';\n\nimport {Input} from './input_layer';\nimport {LayerArgs} from './topology';\n\ndescribeMathCPU('InputLayer', () => {\n it('when initialized to its defaults throws an exception', () => {\n expect(() => tfl.layers.inputLayer({}))\n .toThrowError(/InputLayer should be passed either/);\n });\n describe('initialized with only an inputShape', () => {\n const inputShape = [1];\n const inputLayer = tfl.layers.inputLayer({inputShape});\n\n it('is not trainable.', () => {\n expect(inputLayer.trainable).toBe(false);\n });\n\n it('is built.', () => {\n expect(inputLayer.built).toBe(true);\n });\n\n it('is not sparse.', () => {\n expect(inputLayer.sparse).toBe(false);\n });\n\n it('automatically assigns a name.', () => {\n expect(inputLayer.name).toMatch(/^input.*$/);\n });\n\n it('creates a batchInputShape of [null].concat(inputShape).', () => {\n expect(inputLayer.batchInputShape).toEqual([null].concat(inputShape));\n });\n\n it('has no outboundNodes', () => {\n expect(inputLayer.outboundNodes.length).toEqual(0);\n });\n\n it('has one inboundNode', () => {\n expect(inputLayer.inboundNodes.length).toEqual(1);\n });\n\n describe('creates an inbound Node', () => {\n const inboundNode = inputLayer.inboundNodes[0];\n it('with no inboundLayers, nodeIndices, or tensorIndices', () => {\n expect(inboundNode.inboundLayers.length).toEqual(0);\n expect(inboundNode.nodeIndices.length).toEqual(0);\n expect(inboundNode.tensorIndices.length).toEqual(0);\n });\n\n it('with [null] inputMasks and outputMasks', () => {\n expect(inboundNode.inputMasks).toEqual([null]);\n expect(inboundNode.outputMasks).toEqual([null]);\n });\n\n it('with equal inputShapes and outputShapes', () => {\n expect(inboundNode.inputShapes).toEqual(inboundNode.outputShapes);\n expect(inboundNode.inputShapes).toEqual([[null].concat(inputShape)]);\n });\n\n describe('with a SymbolicTensor', () => {\n const symbolicTensor = inboundNode.inputTensors[0];\n\n it('that is defined.', () => {\n expect(symbolicTensor instanceof tfl.SymbolicTensor).toBe(true);\n });\n\n it('assigned to both the input and outputTensors.', () => {\n expect(inboundNode.inputTensors.length).toEqual(1);\n expect(inboundNode.outputTensors.length).toEqual(1);\n expect(inboundNode.inputTensors).toEqual(inboundNode.outputTensors);\n });\n\n it('with a node and tensorIndex of 0.', () => {\n expect(symbolicTensor.nodeIndex).toEqual(0);\n expect(symbolicTensor.tensorIndex).toEqual(0);\n });\n\n it('with a sourceLayer of the inputLayer.', () => {\n expect(symbolicTensor.sourceLayer).toEqual(inputLayer);\n });\n\n it('with a name matching the inputLayer name.', () => {\n expect(symbolicTensor.name).toEqual(inputLayer.name);\n });\n\n it('with a dtype equal to the inputLayer.', () => {\n expect(symbolicTensor.dtype).toEqual(inputLayer.dtype);\n });\n\n it('with a shape matching the inputLayer.batchInputShape', () => {\n expect(symbolicTensor.shape).toEqual(inputLayer.batchInputShape);\n });\n });\n });\n });\n\n // See https://github.com/tensorflow/tfjs/issues/1341\n it('allow `null` in shape', () => {\n const inputShape = [null, 2];\n const inputs = tfl.layers.inputLayer({inputShape});\n expect(inputs.inputSpec[0].shape).toEqual([null].concat(inputShape));\n });\n\n it('throws an exception if both inputShape and batchInputShape ' +\n 'are specified during initialization.',\n () => {\n expect(\n () => tfl.layers.inputLayer({inputShape: [1], batchInputShape: [1]}))\n .toThrowError(/Only provide the inputShape OR batchInputShape/);\n });\n\n for (const batchSize of [null, 5]) {\n it('initializes with batchSize when inputShape specified', () => {\n const inputShape = [1];\n const inputLayer = tfl.layers.inputLayer({inputShape, batchSize});\n expect(inputLayer.batchInputShape).toEqual([\n batchSize\n ].concat(inputShape));\n });\n }\n\n it('initializes with batchInputShape if specified.', () => {\n const batchInputShape = [1, 2];\n const inputLayer = tfl.layers.inputLayer({batchInputShape});\n expect(inputLayer.batchInputShape).toEqual(batchInputShape);\n });\n\n it('initializes with batchInputShape if null specified for the batch size.',\n () => {\n const batchInputShape = [1, 2];\n const inputLayer = tfl.layers.inputLayer({batchInputShape});\n expect(inputLayer.batchInputShape).toEqual(batchInputShape);\n });\n\n it('throws exception if batchSize and batchInputShape are specified.', () => {\n expect(() => tfl.layers.inputLayer({batchInputShape: [1], batchSize: 5}))\n .toThrowError(/Cannot specify batchSize if batchInputShape/);\n });\n\n for (const sparse of [true, false]) {\n it('uses config.sparse during initialization.', () => {\n const inputLayer =\n tfl.layers.inputLayer({inputShape: [1], sparse});\n expect(inputLayer.sparse).toEqual(sparse);\n });\n }\n\n it('use config.dtype during initialization.', () => {\n const dtype = 'float32';\n const inputLayer = tfl.layers.inputLayer({inputShape: [1], dtype});\n expect(inputLayer.dtype).toEqual(dtype);\n });\n\n it('use config.name during initialization.', () => {\n const name = 'abc';\n const inputLayer = tfl.layers.inputLayer({inputShape: [1], name});\n expect(inputLayer.name).toEqual(name);\n });\n\n it('throws an exception if apply() is called with any input.', () => {\n const inputLayer = tfl.layers.inputLayer({inputShape: [1]});\n const symbolicTensor = new tfl.SymbolicTensor('float32', [2], null, [], {});\n expect(() => inputLayer.apply(symbolicTensor))\n .toThrowError(/Cannot pass any input to an InputLayer's apply/);\n });\n\n it('throws an exception if its inputs differ in shape to what it ' +\n 'was initialized to.',\n () => {\n const inputLayer = tfl.layers.inputLayer({inputShape: [1]});\n const inputs = ones([2, 2]);\n expect(() => inputLayer.apply(inputs)).toThrowError();\n });\n\n it('returns a serializable config.', () => {\n const batchInputShape = [1];\n const dtype = 'float32';\n const sparse = true;\n const name = 'my_name';\n const inputLayer =\n tfl.layers.inputLayer({batchInputShape, dtype, sparse, name});\n expect(inputLayer.getConfig())\n .toEqual({batchInputShape, dtype, sparse, name});\n });\n});\n\nclass LayerForTest extends tfl.layers.Layer {\n static className = 'LayerForTest';\n constructor(args: LayerArgs) {\n super(args);\n }\n}\n\ndescribe('Input()', () => {\n it('throws an exception if neither shape nor batchShape are specified',\n () => {\n expect(() => tfl.layers.input({}))\n .toThrowError(/Please provide to Input either/);\n });\n\n const shape = [1];\n const batchShape = [2, 2];\n const name = 'abc';\n const dtype = 'float32';\n\n it('returns an initialized symbolicTensor given a shape.', () => {\n const symbolicTensor = tfl.layers.input({shape, name, dtype});\n expect(symbolicTensor instanceof tfl.SymbolicTensor).toBe(true);\n expect(symbolicTensor.shape).toEqual([null].concat(shape));\n expect(symbolicTensor.name).toMatch(/abc/);\n expect(symbolicTensor.dtype).toEqual(dtype);\n });\n\n it('returns a SymbolicTensor given a batchShape', () => {\n const symbolicTensor = tfl.layers.input({batchShape});\n expect(symbolicTensor.shape).toEqual(batchShape);\n });\n\n it('throws exception if both shape and batchShape are specified.', () => {\n expect(() => tfl.layers.input({shape, batchShape}))\n .toThrowError(/Please provide either a `shape`/);\n });\n\n it('produces output that can feed into a Layer.', () => {\n const inputTensor = Input({shape, name});\n const otherLayer = new LayerForTest({name: 'firstLayer'});\n const output = otherLayer.apply(inputTensor) as tfl.SymbolicTensor;\n expect(output instanceof tfl.SymbolicTensor).toBe(true);\n expect(output.name).toEqual('firstLayer/firstLayer');\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-layers/dist/engine/topology.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts deleted file mode 100644 index 92fe76386..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts +++ /dev/null @@ -1,709 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint } from '../constraints'; -import { Initializer } from '../initializers'; -import { Shape } from '../keras_format/common'; -import { Regularizer } from '../regularizers'; -import { Kwargs, RegularizerFn } from '../types'; -import { LayerVariable } from '../variables'; -export declare type Op = (x: LayerVariable) => LayerVariable; -/** - * Constructor arguments for InputSpec. - */ -export interface InputSpecArgs { - /** Expected datatype of the input. */ - dtype?: DataType; - /** Expected shape of the input (may include null for unchecked axes). */ - shape?: Shape; - /** Expected rank of the input. */ - ndim?: number; - /** Maximum rank of the input. */ - maxNDim?: number; - /** Minimum rank of the input. */ - minNDim?: number; - /** Dictionary mapping integer axes to a specific dimension value. */ - axes?: { - [axis: number]: number; - }; -} -/** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ -export declare class InputSpec { - /** Expected datatype of the input. */ - dtype?: DataType; - /** Expected shape of the input (may include null for unchecked axes). */ - shape?: Shape; - /** Expected rank of the input. */ - ndim?: number; - /** Maximum rank of the input. */ - maxNDim?: number; - /** Minimum rank of the input. */ - minNDim?: number; - /** Dictionary mapping integer axes to a specific dimension value. */ - axes?: { - [axis: number]: number; - }; - constructor(args: InputSpecArgs); -} -/** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ -export declare class SymbolicTensor { - readonly dtype: DataType; - readonly shape: Shape; - sourceLayer: Layer; - readonly inputs: SymbolicTensor[]; - readonly callArgs: Kwargs; - readonly outputTensorIndex?: number; - readonly id: number; - readonly name: string; - readonly originalName?: string; - /** - * Rank/dimensionality of the tensor. - */ - readonly rank: number; - /** - * Replacement for _keras_history. - */ - nodeIndex: number; - /** - * Replacement for _keras_history. - */ - tensorIndex: number; - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - constructor(dtype: DataType, shape: Shape, sourceLayer: Layer, inputs: SymbolicTensor[], callArgs: Kwargs, name?: string, outputTensorIndex?: number); -} -/** - * Constructor arguments for Node. - */ -export interface NodeArgs { - /** - * The layer that takes `inputTensors` and turns them into `outputTensors`. - * (the node gets created when the `call` method of the layer is called). - */ - outboundLayer: Layer; - /** - * A list of layers, the same length as `inputTensors`, the layers from where - * `inputTensors` originate. - */ - inboundLayers: Layer[]; - /** - * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is - * the origin node of `inputTensors[i]` (necessary since each inbound layer - * might have several nodes, e.g. if the layer is being shared with a - * different data stream). - */ - nodeIndices: number[]; - /** - * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]` - * is the index of `inputTensors[i]` within the output of the inbound layer - * (necessary since each inbound layer might have multiple tensor outputs, - * with each one being independently manipulable). - */ - tensorIndices: number[]; - /** List of input tensors. */ - inputTensors: SymbolicTensor[]; - /** List of output tensors. */ - outputTensors: SymbolicTensor[]; - /** List of input masks (a mask can be a tensor, or null). */ - inputMasks: Tensor[]; - /** List of output masks (a mask can be a tensor, or null). */ - outputMasks: Tensor[]; - /** List of input shape tuples. */ - inputShapes: Shape | Shape[]; - /** List of output shape tuples. */ - outputShapes: Shape | Shape[]; -} -/** - * The type of the return value of Layer.dispose() and Container.dispose(). - */ -export interface DisposeResult { - /** - * Reference count after the dispose call. - */ - refCountAfterDispose: number; - /** - * Number of variables dispose in this dispose call. - */ - numDisposedVariables: number; -} -/** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ -export declare class Node { - callArgs?: Kwargs; - /** - * The layer that takes `inputTensors` and turns them into `outputTensors` - * (the node gets created when the `call` method of the layer is called). - */ - outboundLayer: Layer; - /** - * A list of layers, the same length as `inputTensors`, the layers from where - * `inputTensors` originate. - */ - inboundLayers: Layer[]; - /** - * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is - * the origin node of `inputTensors[i]` (necessary since each inbound layer - * might have several nodes, e.g. if the layer is being shared with a - * different data stream). - */ - nodeIndices: number[]; - /** - * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]` - * is the index of `inputTensors[i]` within the output of the inbound layer - * (necessary since each inbound layer might have multiple tensor outputs, - * with each one being independently manipulable). - */ - tensorIndices: number[]; - /** List of input tensors. */ - inputTensors: SymbolicTensor[]; - /** List of output tensors. */ - outputTensors: SymbolicTensor[]; - /** List of input masks (a mask can be a tensor, or null). */ - inputMasks: Tensor[]; - /** List of output masks (a mask can be a tensor, or null). */ - outputMasks: Tensor[]; - /** List of input shape tuples. */ - inputShapes: Shape | Shape[]; - /** List of output shape tuples. */ - outputShapes: Shape | Shape[]; - readonly id: number; - constructor(args: NodeArgs, callArgs?: Kwargs); - getConfig(): serialization.ConfigDict; -} -/** Constructor arguments for Layer. */ -export declare interface LayerArgs { - /** - * If defined, will be used to create an input layer to insert before this - * layer. If both `inputShape` and `batchInputShape` are defined, - * `batchInputShape` will be used. This argument is only applicable to input - * layers (the first layer of a model). - */ - inputShape?: Shape; - /** - * If defined, will be used to create an input layer to insert before this - * layer. If both `inputShape` and `batchInputShape` are defined, - * `batchInputShape` will be used. This argument is only applicable to input - * layers (the first layer of a model). - */ - batchInputShape?: Shape; - /** - * If `inputShape` is specified and `batchInputShape` is *not* specified, - * `batchSize` is used to construct the `batchInputShape`: `[batchSize, - * ...inputShape]` - */ - batchSize?: number; - /** - * The data-type for this layer. Defaults to 'float32'. - * This argument is only applicable to input layers (the first layer of a - * model). - */ - dtype?: DataType; - /** Name for this layer. */ - name?: string; - /** - * Whether the weights of this layer are updatable by `fit`. - * Defaults to true. - */ - trainable?: boolean; - /** - * Initial weight values of the layer. - */ - weights?: Tensor[]; - /** Legacy support. Do not use for new code. */ - inputDType?: DataType; -} -export declare type CallHook = (inputs: Tensor | Tensor[], kwargs: Kwargs) => void; -/** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ -export declare abstract class Layer extends serialization.Serializable { - /** Name for this layer. Must be unique within a model. */ - name: string; - /** - * List of InputSpec class instances. - * - * Each entry describes one required input: - * - ndim - * - dtype - * A layer with `n` input tensors must have an `inputSpec` of length `n`. - */ - inputSpec: InputSpec[]; - supportsMasking: boolean; - /** Whether the layer weights will be updated during training. */ - protected trainable_: boolean; - batchInputShape: Shape; - dtype: DataType; - initialWeights: Tensor[]; - inboundNodes: Node[]; - outboundNodes: Node[]; - activityRegularizer: Regularizer; - protected _trainableWeights: LayerVariable[]; - private _nonTrainableWeights; - private _losses; - private _updates; - private _built; - private _callHook; - private _addedWeightNames; - readonly id: number; - protected _stateful: boolean; - protected _refCount: number | null; - private fastWeightInitDuringBuild; - constructor(args?: LayerArgs); - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - protected static nodeKey(layer: Layer, nodeIndex: number): string; - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - private getNodeAtIndex; - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - getInputAt(nodeIndex: number): SymbolicTensor | SymbolicTensor[]; - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - getOutputAt(nodeIndex: number): SymbolicTensor | SymbolicTensor[]; - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - readonly input: SymbolicTensor | SymbolicTensor[]; - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - readonly output: SymbolicTensor | SymbolicTensor[]; - readonly losses: RegularizerFn[]; - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses(): Scalar[]; - readonly updates: Tensor[]; - built: boolean; - trainable: boolean; - trainableWeights: LayerVariable[]; - nonTrainableWeights: LayerVariable[]; - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - readonly weights: LayerVariable[]; - readonly stateful: boolean; - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - resetStates(): void; - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - protected assertInputCompatibility(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]): void; - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - protected invokeCallHook(inputs: Tensor | Tensor[], kwargs: Kwargs): void; - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - setCallHook(callHook: CallHook): void; - /** - * Clear call hook. - * This is currently used for testing only. - */ - clearCallHook(): void; - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - protected warnOnIncompatibleInputShape(inputShape: Shape): void; - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - readonly outputShape: Shape | Shape[]; - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - countParams(): number; - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - build(inputShape: Shape | Shape[]): void; - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getWeights(trainableOnly?: boolean): Tensor[]; - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - setWeights(weights: Tensor[]): void; - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - protected addWeight(name: string, shape: Shape, dtype?: DataType, initializer?: Initializer, regularizer?: Regularizer, trainable?: boolean, constraint?: Constraint): LayerVariable; - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - setFastWeightInitDuringBuild(value: boolean): void; - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addLoss(losses: RegularizerFn | RegularizerFn[]): void; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - private addInboundNode; - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getConfig(): serialization.ConfigDict; - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - protected disposeWeights(): number; - protected assertNotDisposed(): void; - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - dispose(): DisposeResult; -} -/** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ -export declare function getSourceInputs(tensor: SymbolicTensor, layer?: Layer, nodeIndex?: number): SymbolicTensor[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js deleted file mode 100644 index 9665bcc35..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js +++ /dev/null @@ -1,1246 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: keras/engine/topology.py */ -import { serialization, tidy, util } from '@tensorflow/tfjs-core'; -import { getNextUniqueTensorId, getUid } from '../backend/state'; -import { getScopedTensorName, getUniqueTensorName, nameScope } from '../common'; -import { AttributeError, NotImplementedError, RuntimeError, ValueError } from '../errors'; -import { getInitializer } from '../initializers'; -import * as generic_utils from '../utils/generic_utils'; -import * as types_utils from '../utils/types_utils'; -import * as variable_utils from '../utils/variable_utils'; -import { batchGetValue, batchSetValue, LayerVariable } from '../variables'; -/** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ -export class InputSpec { - constructor(args) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } - else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } -} -/** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ -export class SymbolicTensor { - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - constructor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { - this.dtype = dtype; - this.shape = shape; - this.sourceLayer = sourceLayer; - this.inputs = inputs; - this.callArgs = callArgs; - this.outputTensorIndex = outputTensorIndex; - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } -} -let _nextNodeID = 0; -/** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ -export class Node { - constructor(args, - // TODO(michaelterry): Define actual type for this. - callArgs) { - this.callArgs = callArgs; - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - // Following 2 properties: input and output shapes. - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - // Add nodes to all layers involved. - for (const layer of args.inboundLayers) { - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - getConfig() { - const inboundNames = []; - for (const layer of this.inboundLayers) { - if (layer != null) { - inboundNames.push(layer.name); - } - else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - } -} -let _nextLayerID = 0; -/** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ -export class Layer extends serialization.Serializable { - constructor(args = {}) { - super(); - this._callHook = null; - this._addedWeightNames = []; - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - this._stateful = false; - this.id = _nextLayerID++; - this.activityRegularizer = null; - this.inputSpec = null; - this.supportsMasking = false; - // These properties will be set upon call of this.build() - this._trainableWeights = []; - this._nonTrainableWeights = []; - this._losses = []; - this._updates = []; - this._built = false; - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - this.inboundNodes = []; - this.outboundNodes = []; - let name = args.name; - if (!name) { - const prefix = this.getClassName(); - name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix); - } - this.name = name; - this.trainable_ = args.trainable == null ? true : args.trainable; - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - let batchInputShape; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } - else if (args.inputShape != null) { - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - this.batchInputShape = batchInputShape; - // Set dtype. - let dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - this.dtype = dtype; - } - if (args.weights != null) { - this.initialWeights = args.weights; - } - else { - this.initialWeights = null; - } - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - this._refCount = null; - this.fastWeightInitDuringBuild = false; - } - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - static nodeKey(layer, nodeIndex) { - return layer.name + '_ib-' + nodeIndex.toString(); - } - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - getNodeAtIndex(nodeIndex, attrName) { - if (this.inboundNodes.length === 0) { - throw new RuntimeError('The layer has never been called ' + - `and thus has no defined ${attrName}.`); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError(`Asked to get ${attrName} at node ${nodeIndex}, ` + - `but the layer has only ${this.inboundNodes.length} inbound nodes.`); - } - return this.inboundNodes[nodeIndex]; - } - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - getInputAt(nodeIndex) { - return generic_utils.singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - getOutputAt(nodeIndex) { - return generic_utils.singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - } - // Properties - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get input() { - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } - else if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' is not connected, no input to return.'); - } - return generic_utils.singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get output() { - if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return generic_utils.singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); - } - get losses() { - return this._losses; - } - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(lossFn => lossFn()); - } - get updates() { - return this._updates; - } - get built() { - return this._built; - } - set built(built) { - this._built = built; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this._trainableWeights.forEach(w => w.trainable = trainable); - this.trainable_ = trainable; - } - get trainableWeights() { - if (this.trainable_) { - return this._trainableWeights.filter(w => w.trainable); - } - else { - return []; - } - } - set trainableWeights(weights) { - this._trainableWeights = weights; - } - get nonTrainableWeights() { - if (this.trainable) { - return this._trainableWeights.filter(w => !w.trainable) - .concat(this._nonTrainableWeights); - } - else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - } - set nonTrainableWeights(weights) { - this._nonTrainableWeights = weights; - } - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - get stateful() { - return this._stateful; - } - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - resetStates() { - if (!this.stateful) { - throw new Error('Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - } - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - assertInputCompatibility(inputs) { - inputs = generic_utils.toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - const inputSpec = generic_utils.toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError(`Layer ${this.name} expects ${inputSpec.length} inputs, ` + - `but it received ${inputs.length} input tensors. ` + - `Input received: ${inputs}`); - } - for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - const x = inputs[inputIndex]; - const spec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - // Check ndim. - const ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}: ` + - `expected ndim=${spec.ndim}, found ndim=${ndim}`); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`); - } - } - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name} ` + - `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`); - } - } - // Check specific shape axes. - if (spec.axes) { - const xShape = x.shape; - for (const key in spec.axes) { - const axis = Number(key); - const value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - const xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected axis ${axis} of input shape to ` + - `have value ${value} but got shape ${xShape}.`); - } - } - } - // Check shape. - if (spec.shape != null) { - for (let i = 0; i < spec.shape.length; ++i) { - const specDim = spec.shape[i]; - const dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected shape=${spec.shape}, ` + - `found shape=${x.shape}.`); - } - } - } - } - } - } - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - call(inputs, kwargs) { - return inputs; - } - invokeCallHook(inputs, kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - } - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - setCallHook(callHook) { - this._callHook = callHook; - } - /** - * Clear call hook. - * This is currently used for testing only. - */ - clearCallHook() { - this._callHook = null; - } - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - apply(inputs, kwargs) { - kwargs = kwargs || {}; - this.assertNotDisposed(); - // Ensure inputs are all the same type. - const inputsList = generic_utils.toList(inputs); - let allAreSymbolic = true; - for (const input of inputsList) { - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - let noneAreSymbolic = true; - for (const input of inputsList) { - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError('Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, () => { - // Handle laying building (weight creating, input spec locking). - if (!this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - this.assertInputCompatibility(inputs); - // Collect input shapes to build layer. - const inputShapes = []; - for (const xElem of generic_utils.toList(inputs)) { - inputShapes.push(xElem.shape); - } - this.build(generic_utils.singletonOrArray(inputShapes)); - this.built = true; - // Load weights that were specified at layer instantiation. - if (this.initialWeights) { - this.setWeights(this.initialWeights); - } - if (this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - this._refCount = 1; - } - } - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - this.assertInputCompatibility(inputs); - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - let output = this.call(inputs, kwargs); - // TODO(michaelterry): Compute the outputMask - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - const outputList = generic_utils.toList(output); - const outputListCopy = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (let x of outputList) { - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = generic_utils.singletonOrArray(outputListCopy); - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Call addInboundNode()? - return output; - } - else { - const inputShape = collectInputShape(inputs); - const outputShape = this.computeOutputShape(inputShape); - let output; - const outputDType = guessOutputDType(inputs); - this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : - inputShape); - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = outputShape - .map((shape, index) => new SymbolicTensor(outputDType, shape, this, generic_utils.toList(inputs), kwargs, this.name, index)); - } - else { - output = new SymbolicTensor(outputDType, outputShape, this, generic_utils.toList(inputs), kwargs, this.name); - } - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); - this._refCount++; - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - return output; - } - }); - } - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - warnOnIncompatibleInputShape(inputShape) { - if (this.batchInputShape == null) { - return; - } - else if (inputShape.length !== this.batchInputShape.length) { - console.warn(`The rank of the input tensor provided (shape: ` + - `${JSON.stringify(inputShape)}) does not match that of the ` + - `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` + - `of the layer ${this.name}`); - } - else { - let dimMismatch = false; - this.batchInputShape.forEach((dimension, i) => { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch = true; - } - }); - if (dimMismatch) { - console.warn(`The shape of the input tensor ` + - `(${JSON.stringify(inputShape)}) does not ` + - `match the expectation of layer ${this.name}: ` + - `${JSON.stringify(this.batchInputShape)}`); - } - } - } - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get outputShape() { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError(`The layer ${this.name} has never been called and thus has no ` + - `defined output shape.`); - } - const allOutputShapes = []; - for (const node of this.inboundNodes) { - const shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - const outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return outputShapes[0]; - } - else { - return outputShapes; - } - } - else { - throw new AttributeError(`The layer ${this.name} has multiple inbound nodes with different ` + - `output shapes. Hence the notion of "output shape" is ill-defined ` + - `for the layer.`); - // TODO(cais): Implement getOutputShapeAt(). - } - } - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - countParams() { - if (!this.built) { - throw new RuntimeError(`You tried to call countParams() on ${this.name}, ` + - `but the layer is not built yet. Build it first by calling ` + - `build(batchInputShape).`); - } - return variable_utils.countParamsInWeights(this.weights); - } - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - build(inputShape) { - this.built = true; - } - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getWeights(trainableOnly = false) { - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - } - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - setWeights(weights) { - tidy(() => { - const params = this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError(`You called setWeights(weights) on layer "${this.name}" ` + - `with a weight list of length ${weights.length}, ` + - `but the layer was expecting ${params.length} weights. ` + - `Provided weights: ${weights}...`); - } - if (params.length === 0) { - return; - } - const weightValueTuples = []; - const paramValues = batchGetValue(params); - for (let i = 0; i < paramValues.length; ++i) { - const pv = paramValues[i]; - const p = params[i]; - const w = weights[i]; - if (!util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError(`Layer weight shape ${pv.shape} ` + - `not compatible with provided weight shape ${w.shape}`); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - } - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addWeight(name, shape, dtype, initializer, regularizer, trainable, constraint) { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError(`Duplicate weight name ${name} for layer ${this.name}`); - } - this._addedWeightNames.push(name); - if (dtype == null) { - dtype = 'float32'; - } - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - const initValue = initializer.apply(shape, dtype); - const weight = new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(() => regularizer.apply(weight.read())); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } - else { - this._nonTrainableWeights.push(weight); - } - return weight; - } - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - setFastWeightInitDuringBuild(value) { - this.fastWeightInitDuringBuild = value; - } - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addLoss(losses) { - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = generic_utils.toList(losses); - if (this._losses !== undefined && this._losses !== null) { - this.losses.push(...losses); - } - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - computeOutputShape(inputShape) { - return inputShape; - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(maskElement => { - if (maskElement != null) { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - }); - } - else { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - } - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - addInboundNode(inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs = null) { - const inputTensorList = generic_utils.toList(inputTensors); - outputTensors = generic_utils.toList(outputTensors); - inputMasks = generic_utils.toList(inputMasks); - outputMasks = generic_utils.toList(outputMasks); - inputShapes = types_utils.normalizeShapeList(inputShapes); - outputShapes = types_utils.normalizeShapeList(outputShapes); - // Collect input tensor(s) coordinates. - const inboundLayers = []; - const nodeIndices = []; - const tensorIndices = []; - for (const x of inputTensorList) { - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers, - nodeIndices, - tensorIndices, - inputTensors: inputTensorList, - outputTensors, - inputMasks, - outputMasks, - inputShapes, - outputShapes - }, kwargs); - // Update tensor history - for (let i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - } - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getConfig() { - const config = { name: this.name, trainable: this.trainable }; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - } - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - disposeWeights() { - this.weights.forEach(weight => weight.dispose()); - return this.weights.length; - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Layer '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - dispose() { - if (!this.built) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been ` + - `built yet.`); - } - if (this._refCount === null) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been used ` + - `yet.`); - } - this.assertNotDisposed(); - let numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - return { refCountAfterDispose: this._refCount, numDisposedVariables }; - } -} -/** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ -function collectInputShape(inputTensors) { - inputTensors = - generic_utils.toList(inputTensors); - const shapes = []; - for (const x of inputTensors) { - shapes.push(x.shape); - } - return generic_utils.singletonOrArray(shapes); -} -/** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ -function guessOutputDType(inputTensors) { - return 'float32'; -} -/** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ -export function getSourceInputs(tensor, layer, nodeIndex) { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } - else { - const node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } - else { - const sourceTensors = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const previousSources = getSourceInputs(x, layer, nodeIndex); - // Avoid input redundancy. - for (const x of previousSources) { - if (sourceTensors.indexOf(x) === -1) { - sourceTensors.push(x); - } - } - } - return sourceTensors; - } - } -} -//# sourceMappingURL=topology.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-layers/dist/engine/topology.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map deleted file mode 100644 index b7c660d87..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"topology.js","sourceRoot":"","sources":["../../src/engine/topology.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+CAA+C;AAE/C,OAAO,EAAmB,aAAa,EAAU,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAC,qBAAqB,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAC,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AACxF,OAAO,EAAC,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAI5D,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAuBzE;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAS;IAcpB,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB;;;UAGE;QACF,IAAI,IAAI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":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\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-layers/dist/engine/topology_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map deleted file mode 100644 index 6ac4d4507..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"topology_test.js","sourceRoot":"","sources":["../../src/engine/topology_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,GAAG,EAAE,MAAM,EAAkB,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAE3G,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAExE,OAAO,EAAC,SAAS,EAAoB,IAAI,EAAiB,MAAM,YAAY,CAAC;AAE7E,MAAM,YAAa,SAAQ,GAAG,CAAC,MAAM,CAAC,KAAK;IAEzC,YAAY,OAAkB,EAAE;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;;AAHM,sBAAS,GAAG,cAAc,CAAC;AAMpC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC;QACpC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,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;QAEhE,MAAM,eAAe,GAAmB,EAAE,CAAC;QAC3C,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;YAC/C,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,KAAK,CAAC;QACrB,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC3C,uBAAuB;IACzB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {eye, memory, NamedTensorMap, ones, Tensor, tensor1d, tensor2d, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport * as initializers from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\nimport {LayerVariable, onesVariable, zerosVariable} from '../variables';\n\nimport {InputSpec, Layer, LayerArgs, Node, SymbolicTensor} from './topology';\n\nclass LayerForTest extends tfl.layers.Layer {\n static className = 'LayerForTest';\n constructor(args: LayerArgs = {}) {\n super(args);\n }\n}\n\ndescribe('InputSpec', () => {\n it('initializes with expected default values.', () => {\n const inputSpec = new InputSpec({});\n expect(inputSpec.dtype).toBeUndefined();\n expect(inputSpec.shape).toBeUndefined();\n expect(inputSpec.ndim).toBeUndefined();\n expect(inputSpec.maxNDim).toBeUndefined();\n expect(inputSpec.minNDim).toBeUndefined();\n expect(inputSpec.axes).toEqual({});\n });\n\n it('initializes with inputSpec.ndim = shape.length when shape is specified.',\n () => {\n const shape = [1, 2, 3];\n const expectedValue = shape.length;\n const inputSpec = new InputSpec({shape: [1, 2, 3], ndim: -1});\n expect(inputSpec.ndim).toEqual(expectedValue);\n });\n\n it('initializes inputSpec.axes when axes specified.', () => {\n const expectedValue = {1: 2};\n const inputSpec = new InputSpec({axes: expectedValue});\n expect(inputSpec.axes).toEqual(expectedValue);\n });\n});\n\ndescribe('Node', () => {\n const outboundLayerName = 'outboundLayer';\n const inboundLayerName = 'inboundLayer';\n const outboundLayer = new LayerForTest({name: outboundLayerName});\n const inboundLayers = [new LayerForTest({name: inboundLayerName})];\n const nodeIndices = [0];\n const tensorIndices = [0];\n const inputTensors = [new tfl.SymbolicTensor('float32', [1], null, [], {})];\n const outputTensors =\n [new tfl.SymbolicTensor('float32', [2, 2], null, [], {})];\n const inputMasks = [zeros([1])];\n const outputMasks = [zeros([1])];\n const inputShapes = [[1]];\n const outputShapes = [[1], [1]];\n const callArgs = {mask: zeros([1])};\n const node = new Node(\n {\n outboundLayer,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n callArgs);\n\n it('initializes object as expected.', () => {\n expect(node.outboundLayer).toEqual(outboundLayer);\n expect(node.inboundLayers).toEqual(inboundLayers);\n expect(node.nodeIndices).toEqual(nodeIndices);\n expect(node.tensorIndices).toEqual(tensorIndices);\n expect(node.inputTensors).toEqual(inputTensors);\n expect(node.outputTensors).toEqual(outputTensors);\n expect(node.inputMasks).toEqual(inputMasks);\n expect(node.outputMasks).toEqual(outputMasks);\n expect(node.inputShapes).toEqual(inputShapes);\n expect(node.outputShapes).toEqual(outputShapes);\n expect(node.callArgs).toEqual(callArgs);\n expect(inboundLayers[0].outboundNodes).toEqual([node]);\n expect(node.outboundLayer.inboundNodes).toEqual([node]);\n });\n\n it('generates expected SerializableNodeConfig.', () => {\n const nodeConfig = node.getConfig();\n expect(nodeConfig.outboundLayer).toEqual(outboundLayerName);\n expect(nodeConfig.inboundLayers).toEqual([inboundLayerName]);\n expect(nodeConfig.nodeIndices).toEqual(nodeIndices);\n expect(nodeConfig.tensorIndices).toEqual(tensorIndices);\n });\n\n it('generates unique IDs', () => {\n const secondNode = new Node(\n {\n outboundLayer,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n callArgs);\n expect(secondNode.id).not.toEqual(node.id);\n });\n});\n\ndescribeMathCPU('Layer', () => {\n describe('initialized to its defaults', () => {\n // TODO(bileschi): This should be tfl.layers.Layer for some future version\n // of TS that doesn't fail to compile.\n let defaultLayer: Layer;\n\n beforeEach(() => {\n defaultLayer = new LayerForTest();\n });\n\n it('has a default layer name of layer_....', () => {\n expect(defaultLayer.name).toMatch(/^layer_.+$/);\n });\n\n it('has null inputSpecs.', () => {\n expect(defaultLayer.inputSpec).toBeNull();\n });\n\n it('does not support masking (supportsMasking == false).', () => {\n expect(defaultLayer.supportsMasking).toEqual(false);\n });\n\n it('is trainable.', () => {\n expect(defaultLayer.trainable).toEqual(true);\n });\n\n it('has an undefined batchInputShape.', () => {\n expect(defaultLayer.batchInputShape).toBeUndefined();\n });\n\n it('has an undefined dtype.', () => {\n expect(defaultLayer.dtype).toBeUndefined();\n });\n\n it('has null initialWeights.', () => {\n expect(defaultLayer.initialWeights).toBeNull();\n });\n\n it('has an empty inboundNodes list.', () => {\n expect(defaultLayer.inboundNodes).toEqual([]);\n });\n\n it('has an empty outboundNodes list.', () => {\n expect(defaultLayer.outboundNodes).toEqual([]);\n });\n\n it('has an empty losses list.', () => {\n expect(defaultLayer.losses).toEqual([]);\n });\n\n it('has an empty updates list.', () => {\n expect(defaultLayer.updates).toEqual([]);\n });\n\n it('is not built (built == false).', () => {\n expect(defaultLayer.built).toEqual(false);\n });\n\n it('has an empty trainableWeights list.', () => {\n expect(defaultLayer.trainableWeights).toEqual([]);\n });\n\n it('has an empty nonTrainableWeights list.', () => {\n expect(defaultLayer.nonTrainableWeights).toEqual([]);\n });\n\n it('has an empty weights list.', () => {\n expect(defaultLayer.weights).toEqual([]);\n });\n\n it('produces a unique ID', () => {\n const secondLayer = new LayerForTest();\n expect(defaultLayer.id).not.toEqual(secondLayer.id);\n });\n\n it('stateful is false by default', () => {\n const layer = new LayerForTest();\n expect(layer.stateful).toBe(false);\n });\n\n it('returns null if it doesn`t support masking and no mask is passed in.',\n () => {\n expect(defaultLayer.computeMask([], null)).toBeNull();\n });\n\n it('throws exception if it doesn`t support masking and a ' +\n 'mask is passed in.',\n () => {\n const mask = ones([1]);\n expect(() => defaultLayer.computeMask([], mask))\n .toThrowError(/does not support masking/);\n });\n\n it('returns the same mask passed in if it supports masking', () => {\n const mask = ones([1]);\n defaultLayer.supportsMasking = true;\n expect(defaultLayer.computeMask([], mask)).toEqual(mask);\n });\n\n it('correctly generates a config for serialization', () => {\n const config = defaultLayer.getConfig();\n expect(config.name).toEqual(defaultLayer.name);\n expect(config.trainable).toEqual(defaultLayer.trainable);\n expect(config.batchInputShape).toBeUndefined();\n expect(config.dtype).toBeUndefined();\n });\n });\n\n describe('A layer with non-default arguments', () => {\n it('initializes layer with given name.', () => {\n const name = 'layer name';\n const layer = new LayerForTest({name});\n expect(layer.name).toMatch(name);\n const config = layer.getConfig();\n expect(config.name).toEqual(layer.name);\n });\n\n for (const trainable of [true, false]) {\n it('initializes layer as trainable, if specified.', () => {\n const layer = new LayerForTest({trainable});\n expect(layer.trainable).toEqual(trainable);\n const config = layer.getConfig();\n expect(config.trainable).toEqual(layer.trainable);\n });\n }\n\n for (const batchInputShape of [[], [1]]) {\n it('initializes batchInputShape to layerConfig.batchInputShape.', () => {\n const layer = new LayerForTest({batchInputShape});\n expect(layer.batchInputShape).toEqual(batchInputShape);\n const config = layer.getConfig();\n expect(config.batchInputShape).toEqual(layer.batchInputShape);\n });\n }\n\n it('initializes batchInputShape to layerConfig.batchInputShape even if ' +\n 'layerConfig.inputShape is defined.',\n () => {\n const batchInputShape = [1];\n const inputShape = [2, 3];\n const layer = new LayerForTest({batchInputShape, inputShape});\n expect(layer.batchInputShape).toEqual(batchInputShape);\n });\n\n for (const [batchSize, inputShape, expectedBatchInputShape] of [\n [null, [], [null]], [null, [1], [null, 1]], [3, [], [3]],\n [3, [1], [3, 1]]]) {\n it('initializes batchInputShape to layerConfig.inputShape.', () => {\n const layer = new LayerForTest(\n {batchSize: batchSize as number, inputShape: inputShape as Shape});\n expect(layer.batchInputShape).toEqual(expectedBatchInputShape as Shape);\n });\n }\n\n it('initializes dtype to float32 if layerConfig.inputShape is set.', () => {\n const layer = new LayerForTest({inputShape: []});\n expect(layer.dtype).toEqual('float32');\n const config = layer.getConfig();\n expect(config.dtype).toEqual(layer.dtype);\n });\n\n it('initializes dtype to float32 if layerConfig.batchInputShape is set.',\n () => {\n const layer = new LayerForTest({batchInputShape: []});\n expect(layer.dtype).toEqual('float32');\n });\n\n it('initializes initialWeights if present.', () => {\n const weights = [zeros([1])];\n const layer = new LayerForTest({weights});\n expect(layer.initialWeights).toEqual(weights);\n });\n\n it('Layer with duplicate weight names throws error', () => {\n class LayerForTest extends tfl.layers.Layer {\n static className = 'LayerForTest';\n constructor(args: LayerArgs = {}) {\n super(args);\n this.addWeight(\n 'foo', [1, 2], 'float32', initializers.getInitializer('zeros'));\n this.addWeight(\n 'foo', [2, 3], 'float32', initializers.getInitializer('zeros'));\n }\n }\n expect(() => new LayerForTest())\n .toThrowError(/[Dd]uplicate weight name/);\n });\n });\n\n it('can be set to built.', () => {\n const layer = new LayerForTest();\n layer.built = true;\n expect(layer.built).toEqual(true);\n });\n\n // Weights used for subsequent tests\n const trainableWeights = [zerosVariable([1])];\n const nonTrainableWeights = [onesVariable([1])];\n it('can set trainableWeights.', () => {\n const layer = new LayerForTest();\n layer.trainableWeights = trainableWeights;\n expect(layer.trainableWeights).toEqual(trainableWeights);\n });\n\n it('doesn\\'t return trainableWeights if layer is not trainable, even ' +\n 'if they exist',\n () => {\n const layer = new LayerForTest({trainable: false});\n layer.trainableWeights = trainableWeights;\n expect(layer.trainableWeights).toEqual([]);\n });\n\n it('can set nonTrainableWeights.', () => {\n const layer = new LayerForTest();\n layer.nonTrainableWeights = nonTrainableWeights;\n expect(layer.nonTrainableWeights).toEqual(nonTrainableWeights);\n });\n\n it('only returns nonTrainableWeights for nonTrainableWeights if the layer ' +\n 'is trainable.',\n () => {\n const layer = new LayerForTest({trainable: true});\n layer.trainableWeights = trainableWeights;\n layer.nonTrainableWeights = nonTrainableWeights;\n expect(layer.nonTrainableWeights).toEqual(nonTrainableWeights);\n });\n\n it('concats trainable and nonTrainableWeights for nonTrainableWeights if ' +\n 'not trainable.',\n () => {\n const layer = new LayerForTest({trainable: false});\n const expectedWeights = trainableWeights.concat(nonTrainableWeights);\n layer.trainableWeights = trainableWeights;\n layer.nonTrainableWeights = nonTrainableWeights;\n expect(layer.nonTrainableWeights).toEqual(expectedWeights);\n });\n\n it('Setting trainable of layer sets Variable.trainable', () => {\n const layer1 = tfl.layers.dense({units: 3});\n layer1.build([4]);\n // The weights should start from a trainable = true state.\n expect(layer1.weights[0].trainable).toEqual(true);\n expect(layer1.weights[1].trainable).toEqual(true);\n layer1.trainable = false;\n expect(layer1.weights[0].trainable).toEqual(false);\n expect(layer1.weights[1].trainable).toEqual(false);\n layer1.trainable = true;\n expect(layer1.weights[0].trainable).toEqual(true);\n expect(layer1.weights[1].trainable).toEqual(true);\n });\n\n for (const trainable of [true, false]) {\n it('concats trainable and nonTrainableWeights for weights regardless of ' +\n 'whether the layer is trainable trainable.',\n () => {\n const layer = new LayerForTest({trainable});\n const expectedWeights = trainableWeights.concat(nonTrainableWeights);\n layer.trainableWeights = trainableWeights;\n layer.nonTrainableWeights = nonTrainableWeights;\n expect(layer.weights).toEqual(expectedWeights);\n });\n }\n\n describe('assertInputCompatibility()', () => {\n function runAssert(\n layer: Layer,\n inputs: Tensor|Tensor[]|tfl.SymbolicTensor|tfl.SymbolicTensor[]) {\n // tslint:disable-next-line:no-any\n (layer as any).assertInputCompatibility(inputs);\n }\n const testInputs = [\n () => ones([1]), () => [ones([1])],\n () => new tfl.SymbolicTensor('float32', [1], null, [], {}),\n () => [new tfl.SymbolicTensor('float32', [1], null, [], {})]\n ];\n\n for (const inputs of testInputs) {\n it('doesn\\'t raise an exception if no inputSpec is provided.', () => {\n const layer = new LayerForTest();\n runAssert(layer, inputs());\n });\n\n it('doesn\\'t raise exception if number of inputs == number of ' +\n 'inputSpecs.',\n () => {\n const inputSpecs = [new InputSpec({})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if number of inputs != number of inputSpecs.',\n () => {\n const inputSpecs = [new InputSpec({}), new InputSpec({})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs()))\n .toThrowError(/expects [0-9]+ inputs/);\n });\n\n it('doesn\\'t raise exception if inputs\\' ndim == inputSpecs.ndim.',\n () => {\n const inputSpecs = [new InputSpec({ndim: 1})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if inputs\\' ndim != inputSpecs.ndim.', () => {\n const inputSpecs = [new InputSpec({ndim: 2})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).toThrowError(/expected ndim=/);\n });\n\n it('doesn\\'t raise exception if inputs\\' ndim <= inputSpecs.maxNdim.',\n () => {\n const inputSpecs = [new InputSpec({maxNDim: 1})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if inputs\\' ndim > inputSpecs.maxNdim.', () => {\n const inputSpecs = [new InputSpec({maxNDim: 0})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs()))\n .toThrowError(/expected max_ndim=/);\n });\n\n it('doesn\\'t raise exception if inputs\\' ndim >= inputSpecs.minNdim.',\n () => {\n const inputSpecs = [new InputSpec({minNDim: 1})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if inputs\\' ndim < inputSpecs.minNdim.', () => {\n const inputSpecs = [new InputSpec({minNDim: 2})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs()))\n .toThrowError(/expected min_ndim=/);\n });\n\n it('doesn\\'t raise exception if inputs\\' dtype == inputSpecs.dtype.',\n () => {\n const inputSpecs = [new InputSpec({dtype: 'float32'})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n // TODO(michaelterry): Add dtype test once more dtypes supported.\n\n it('doesn\\'t raise exception if inputs\\' dimensions == inputSpecs.axes.',\n () => {\n const inputSpecs = [new InputSpec({axes: {0: 1}})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if inputs\\' dimensions != inputSpecs.axes.', () => {\n const inputSpecs = [new InputSpec({axes: {0: 2}})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).toThrowError(/expected axis/);\n });\n\n it('throws exception if inputs\\' dimensions don\\'t have the same ' +\n 'number of inputSpecs.axes.',\n () => {\n const inputSpecs = [new InputSpec({axes: {0: 1, 2: 1}})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs()))\n .toThrowError(/expected axis/);\n });\n\n it('doesn\\'t raise exception if inputs\\' shape == inputSpecs.shape.',\n () => {\n const inputSpecs = [new InputSpec({shape: [1]})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).not.toThrowError();\n });\n\n it('throws exception if inputs\\' shape != inputSpecs.shape.', () => {\n const inputSpecs = [new InputSpec({shape: [2]})];\n const layer = new LayerForTest();\n layer.inputSpec = inputSpecs;\n expect(() => runAssert(layer, inputs())).toThrowError(/expected shape/);\n });\n }\n });\n\n describe('apply() passed 1 SymbolicTensor', () => {\n const firstLayer = new LayerForTest({name: 'firstLayer'});\n const secondLayer = new LayerForTest({name: 'secondLayer'});\n const callArgs = {a: 1};\n const singleSymbolicTensor =\n new tfl.SymbolicTensor('float32', [1], firstLayer, [], {});\n const returnedTensor =\n secondLayer.apply(singleSymbolicTensor, callArgs) as tfl.SymbolicTensor;\n\n it('returns a SymbolicTensor.', () => {\n expect(returnedTensor instanceof tfl.SymbolicTensor).toBe(true);\n });\n\n it('returns a SymbolicTensor with a reference to the source layer.', () => {\n expect(returnedTensor.sourceLayer).toEqual(secondLayer);\n });\n\n it('returns a SymbolicTensor with a reference to the inputs passed ' +\n 'to apply().',\n () => {\n expect(returnedTensor.inputs).toEqual([singleSymbolicTensor]);\n expect(returnedTensor.callArgs).toEqual(callArgs);\n });\n\n it('returns a SymbolicTensor with nodeIndex and tensorIndex set.', () => {\n expect(returnedTensor.nodeIndex).toBeDefined();\n expect(returnedTensor.tensorIndex).toBeDefined();\n });\n\n it('returns a SymbolicTensor with the name set.', () => {\n expect(returnedTensor.name).toMatch(/secondLayer/);\n });\n\n it('is built.', () => {\n expect(secondLayer.built).toBe(true);\n });\n\n it('Incompatible inputShape leads to warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n const layer1 = tfl.layers.dense({units: 2, inputShape: [5]});\n layer1.apply(tfl.input({shape: [4]}));\n expect(recordedWarnMessage)\n .toMatch(/shape of the input tensor .*null,4.* not match .*null,5.*/);\n });\n\n it('Incompatible inputShape leads to warning: batchInputShape', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n const layer1 = tfl.layers.dense({units: 2, batchInputShape: [2, 3, 5]});\n layer1.apply(tfl.input({shape: [4, 5]}));\n expect(recordedWarnMessage)\n .toMatch(\n /shape of the input tensor .*null,4,5.* not match .*2,3,5.*/);\n });\n\n it('Incompatible inputShape rank leads to warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n const layer1 = tfl.layers.dense({units: 2, inputShape: [5]});\n layer1.apply(tfl.input({shape: [4, 3]}));\n expect(recordedWarnMessage)\n .toMatch(/rank .*null,4,3.* does not match .*null,5.*/);\n });\n\n it('Incompatible inputShape rank leads to warning: batchInputShape', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n const layer1 = tfl.layers.dense({units: 2, batchInputShape: [3, 5]});\n layer1.apply(tfl.input({shape: [4, 3]}));\n expect(recordedWarnMessage)\n .toMatch(/rank .*null,4,3.* does not match .*3,5.*/);\n });\n\n it('Compatible inputShape leads to NO warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n const layer1 = tfl.layers.dense({units: 2, inputShape: [5]});\n layer1.apply(tfl.input({shape: [5]}));\n expect(recordedWarnMessage).toEqual(undefined);\n });\n });\n\n describe('apply() passed >1 SymbolicTensor', () => {\n it('throws an exception for multiple symbolic inputs.', () => {\n const firstLayer = new LayerForTest({name: 'first layer'});\n const secondLayer = new LayerForTest({name: 'second layer'});\n const symbolicTensorList = [\n new tfl.SymbolicTensor(\n 'float32', [1], firstLayer, [], {}, 'first_symbolic_tensor'),\n new tfl.SymbolicTensor(\n 'float32', [1], firstLayer, [], {}, 'second_symbolic_tensor')\n ];\n // TODO(michaelterry): Update this once multiple symbolic tensors are\n // allowed.\n expect(() => secondLayer.apply(symbolicTensorList)).toThrowError();\n });\n });\n\n describe('apply() passed SymbolicTensor and Tensor', () => {\n it('throws an exception.', () => {\n const layer = new LayerForTest();\n const inputs = [\n new tfl.SymbolicTensor(\n 'float32', [1], null, [], {}, 'first_symbolic_tensor'),\n ones([1])\n ];\n expect(() => layer.apply(inputs as Tensor[]))\n .toThrowError(/must be all SymbolicTensors or all Tensors/);\n });\n });\n\n it('apply() returns multiple symbolic tensors for multiple ' +\n 'output shapes',\n () => {\n const layer = new LayerForTest();\n const outputShapes = [[1], [2, 3]];\n const input = new tfl.SymbolicTensor('float32', [1], null, [], {});\n // tslint:disable-next-line:no-any\n spyOn((layer as any), 'computeOutputShape').and.callFake(() => {\n return outputShapes;\n });\n const results = layer.apply(input) as tfl.SymbolicTensor[];\n expect(results.length).toEqual(2);\n expect(results.map(x => x.shape)).toEqual(outputShapes);\n expect(results.map(x => x.outputTensorIndex)).toEqual([0, 1]);\n });\n\n describe('apply() passed 1+ Tensors', () => {\n it('returns new values for output if the same as the input.', () => {\n const anArray = ones([1]);\n // Test with both a Tensor and an array of Tensors.\n for (const inputs of [anArray, [anArray, anArray]]) {\n const layer = new LayerForTest();\n const result = layer.apply(inputs) as Tensor | Tensor[];\n\n expect(result instanceof Tensor || (result[0] instanceof Tensor))\n .toBe(true);\n\n expect(layer.built).toBe(true);\n\n if (result instanceof Array) {\n const inputArray = inputs as Tensor[];\n for (let i = 0; i < result.length; i++) {\n expectTensorsClose(result[i], inputArray[i]);\n }\n } else {\n expectTensorsClose(result, inputs as Tensor);\n }\n expect(result === inputs).toBe(false);\n }\n });\n });\n\n describe('initialized with weights at construction time', () => {\n it('sets those weights after calling apply().', () => {\n const initialWeights = eye(2);\n const arrayInput = zeros([1]);\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [1], null, [], {});\n // Test with symbolic and concrete input.\n for (const inputs of [arrayInput, symbolicInput]) {\n const layer = new LayerForTest({weights: [initialWeights]});\n // Fake the build() method to test assignment to initialWeights.\n // tslint:disable-next-line:no-any\n spyOn((layer as any), 'build').and.callFake(() => {\n layer.built = true;\n layer.trainableWeights = [new LayerVariable(zeros([2, 2]))];\n });\n expect(layer.weights.length).toEqual(0);\n layer.apply(inputs);\n expect(layer.weights.length).toEqual(1);\n expectTensorsClose(layer.weights[0].read(), initialWeights);\n }\n });\n });\n\n describe('apply() (nodes)', () => {\n it('doesn\\'t change inboundNodes or outboundNodes when called with ' +\n 'concrete input',\n () => {\n const layer = new LayerForTest();\n expect(layer.inboundNodes.length).toEqual(0);\n expect(layer.outboundNodes.length).toEqual(0);\n layer.apply(eye(1));\n expect(layer.inboundNodes.length).toEqual(0);\n expect(layer.outboundNodes.length).toEqual(0);\n });\n\n it('changes inboundNodes and outboundNodes when called with ' +\n 'symbolic input',\n () => {\n const layer = new LayerForTest();\n const input = new tfl.SymbolicTensor('float32', [1], null, [], {});\n expect(layer.inboundNodes.length).toEqual(0);\n expect(layer.outboundNodes.length).toEqual(0);\n layer.apply(input);\n expect(layer.inboundNodes.length).toEqual(1);\n expect(layer.outboundNodes.length).toEqual(0);\n expect(layer.inboundNodes[0].outboundLayer).toEqual(layer);\n });\n\n it('updates inbound and outboundNodes when there are multiple layers',\n () => {\n const firstLayer = new LayerForTest({name: 'first_layer'});\n const secondLayer = new LayerForTest({name: 'second_layer'});\n const initialInput =\n new tfl.SymbolicTensor('float32', [1], null, [], {});\n const firstOutput = firstLayer.apply(initialInput);\n secondLayer.apply(firstOutput);\n\n expect(firstLayer.inboundNodes.length).toEqual(1);\n expect(firstLayer.outboundNodes.length).toEqual(1);\n expect(secondLayer.inboundNodes.length).toEqual(1);\n expect(secondLayer.outboundNodes.length).toEqual(0);\n expect(firstLayer.outboundNodes[0].outboundLayer).toEqual(secondLayer);\n });\n });\n\n describe('Layer.outputShape', () => {\n it('Layers with one output', () => {\n const layer = tfl.layers.dense({units: 3});\n layer.apply(new tfl.SymbolicTensor('float32', [null, 4], null, [], {}));\n expect(layer.outputShape).toEqual([null, 3]);\n });\n\n it('Layers with two outputs', () => {\n const layer = tfl.layers.simpleRNN({units: 3, returnState: true});\n layer.apply(\n new tfl.SymbolicTensor('float32', [null, 4, 5], null, [], {}));\n expect(layer.outputShape).toEqual([[null, 3], [null, 3]]);\n });\n\n it('Layers with two inboundNodes of the same outputShape', () => {\n const layer = tfl.layers.dense({units: 3});\n layer.apply(new tfl.SymbolicTensor('float32', [null, 4], null, [], {}));\n layer.apply(new tfl.SymbolicTensor('float32', [null, 4], null, [], {}));\n expect(layer.inboundNodes.length).toEqual(2);\n expect(layer.outputShape).toEqual([null, 3]);\n });\n\n it('Layers with two inboundNodes of different outputShapes', () => {\n const layer = tfl.layers.dense({units: 3});\n layer.apply(\n new tfl.SymbolicTensor('float32', [null, 5, 4], null, [], {}));\n layer.apply(\n new tfl.SymbolicTensor('float32', [null, 6, 4], null, [], {}));\n expect(layer.inboundNodes.length).toEqual(2);\n expect(() => layer.outputShape)\n .toThrowError(/has multiple inbound nodes/);\n });\n\n it('Unbuilt layer throws Error', () => {\n const layer = tfl.layers.dense({units: 3});\n expect(() => layer.outputShape).toThrowError(/has never been called/);\n });\n });\n\n describe('Layer.countParams', () => {\n it('Layers with weights', () => {\n const units = 3;\n const inputSize = 4;\n const layer = tfl.layers.dense({units});\n layer.apply(zeros([1, inputSize]));\n const numParams = layer.countParams();\n expect(numParams).toEqual(units * inputSize + units);\n });\n\n it('Layer without weights', () => {\n const layer = tfl.layers.flatten();\n layer.apply(zeros([2, 2, 2]));\n const numParams = layer.countParams();\n expect(numParams).toEqual(0);\n });\n });\n\n describe('setWeights', () => {\n it('throws exception if weights are not the same length ' +\n 'as existing weights',\n () => {\n const layer = new LayerForTest();\n layer.trainableWeights = [new LayerVariable(zeros([2, 2]))];\n const onesTensor = ones([1]);\n expect(() => layer.setWeights([\n onesTensor, onesTensor\n ])).toThrowError(/with a weight list of length/);\n });\n\n it('throws exception if weights are not the same shape ' +\n 'as existing weights',\n () => {\n const layer = new LayerForTest();\n const onesTensor = ones([1]);\n layer.trainableWeights = [new LayerVariable(zeros([2, 2]))];\n expect(() => layer.setWeights([onesTensor]))\n .toThrowError(/not compatible with provided weight shape/);\n });\n\n it('updates weights.', () => {\n const layer = new LayerForTest();\n const onesTensor = ones([1]);\n layer.trainableWeights = [new LayerVariable(zeros([1]))];\n layer.setWeights([onesTensor]);\n expectTensorsClose(layer.trainableWeights[0].read(), onesTensor);\n });\n });\n\n describe('computeOutputShape()', () => {\n it('returns the inputShape in the base class', () => {\n const layer = new LayerForTest();\n const shape = [1];\n expect(layer.computeOutputShape(shape)).toEqual(shape);\n });\n });\n\n describe('input and output properties: ', () => {\n let input: tfl.SymbolicTensor;\n let layer: Layer;\n let output: tfl.SymbolicTensor;\n\n beforeEach(() => {\n input =\n new tfl.SymbolicTensor('float32', [1], null, [], {}, 'firstInput');\n layer = new LayerForTest();\n output = layer.apply(input) as tfl.SymbolicTensor;\n });\n\n it('input retrieves layer\\'s inputs.', () => {\n expect(layer.input).toEqual(input);\n });\n\n it('input retrieves layer\\'s outputs.', () => {\n expect(layer.output).toEqual(output);\n });\n\n it('input throws exception if there is more than one input', () => {\n const secondInput =\n new tfl.SymbolicTensor('float32', [1], null, [], {}, 'secondInput');\n layer.apply(secondInput);\n expect(() => layer.input).toThrowError(/\"layer input\" is ill-defined/);\n });\n\n it('output throws exception if there is more than one output', () => {\n const secondInput =\n new tfl.SymbolicTensor('float32', [1], null, [], {}, 'secondInput');\n layer.apply(secondInput);\n expect(() => layer.output).toThrowError(/\"layer output\" is ill-defined/);\n });\n });\n\n describe('getInputAt and getOutputAt: ', () => {\n let input: tfl.SymbolicTensor;\n let layer: Layer;\n let output: tfl.SymbolicTensor;\n\n beforeEach(() => {\n input =\n new tfl.SymbolicTensor('float32', [1], null, [], {}, 'firstInput');\n layer = new LayerForTest();\n output = layer.apply(input) as tfl.SymbolicTensor;\n });\n\n it('getInputAt() retrieves layer\\'s inputs.', () => {\n expect(layer.getInputAt(0)).toEqual(input);\n });\n\n it('getOutputAt() retrieves layer\\'s outputs.', () => {\n expect(layer.getOutputAt(0)).toEqual(output);\n });\n\n it('getInputAt() throws exception ask for incorrect index.', () => {\n expect(() => layer.getInputAt(1))\n .toThrowError(/Asked to get input at node 1, but/);\n });\n\n it('getOutputAt() throws exception ask for incorrect index.', () => {\n expect(() => layer.getOutputAt(1))\n .toThrowError(/Asked to get output at node 1, but/);\n });\n });\n});\n\ndescribeMathCPUAndGPU('Layer-dispose', () => {\n it('Dispose Dense Layer before build leads to Error', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n expect(() => dense.dispose()).toThrowError(/has not been built/);\n });\n\n it('Dispose Dense Layer after one tensor call frees memory', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n dense.apply(zeros([2, 4]));\n const numTensors0 = memory().numTensors;\n const result = dense.dispose();\n\n expect(result.refCountAfterDispose).toEqual(0);\n expect(result.numDisposedVariables).toEqual(2);\n // Two variables should have been freed: the kernel and the bias.\n expect(memory().numTensors).toEqual(numTensors0 - 2);\n });\n\n it('Symbolic apply() call after Dense disposal leads to Error', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n dense.apply(zeros([2, 4]));\n const result = dense.dispose();\n // This dispose() call should dispose the layer.\n\n expect(result.refCountAfterDispose).toEqual(0);\n expect(result.numDisposedVariables).toEqual(2);\n expect(\n () => dense.apply(\n new tfl.SymbolicTensor('float32', [2, 4], null, [], {})))\n .toThrowError(/Layer .* is already disposed/);\n });\n\n it('Non-symbolic apply() call after Dense disposal leads to Error', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n dense.apply(zeros([2, 4]));\n dense.dispose(); // This dispose() call should dispose the layer.\n\n expect(() => dense.apply(ones([2, 4])))\n .toThrowError(/Layer .* is already disposed/);\n });\n\n it('Calling defRec() repeatedly for two-Node Layer frees memory', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n dense.apply(new tfl.SymbolicTensor('float32', [2, 4], null, [], {}));\n dense.apply(new tfl.SymbolicTensor('float32', [2, 4], null, [], {}));\n const numTensors0 = memory().numTensors;\n\n const result1 = dense.dispose();\n // After the first dispose call, no memory should have been freed.\n expect(memory().numTensors).toEqual(numTensors0);\n expect(result1.refCountAfterDispose).toEqual(1);\n expect(result1.numDisposedVariables).toEqual(0);\n\n const result2 = dense.dispose();\n // After the second dispose call, memory for the kernel and the bias should\n // have been freed.\n expect(memory().numTensors).toEqual(numTensors0 - 2);\n expect(result2.refCountAfterDispose).toEqual(0);\n expect(result2.numDisposedVariables).toEqual(2);\n });\n\n it('Calling dispose on already-disposed Layer leads to Error', () => {\n const dense = tfl.layers.dense({units: 1, inputShape: [4]});\n dense.apply(zeros([2, 4]));\n dense.dispose();\n expect(() => dense.dispose()).toThrowError(/Layer .* is already disposed/);\n });\n\n it('Symbolic apply() call after Flatten disposal leads to Error', () => {\n const dense = tfl.layers.flatten();\n dense.apply(zeros([2, 3, 4]));\n dense.dispose(); // This dispose() call should dispose the layer.\n\n expect(\n () => dense.apply(\n new tfl.SymbolicTensor('float32', [2, 4], null, [], {})))\n .toThrowError(/Layer .* is already disposed/);\n });\n\n it('Non-symbolic apply() call after Flatten disposal leads to Error', () => {\n const dense = tfl.layers.flatten();\n dense.apply(zeros([2, 3, 4]));\n dense.dispose(); // This dispose() call should dispose the layer.\n\n expect(() => dense.apply(zeros([2, 3, 4])))\n .toThrowError(/Layer .* is already disposed/);\n });\n\n it('dispose() call works on Input Layer', () => {\n const input = tfl.layers.input({shape: [2, 3]});\n const output = tfl.layers.reshape({targetShape: [3, 2]}).apply(input) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input], outputs: [output]});\n\n const result = model.dispose();\n // This model, consiting of only an input layer and a reshape layer, does\n // not have any weights to dispose.\n expect(result.numDisposedVariables).toEqual(0);\n expect(() => model.predict(zeros([1, 2, 3])))\n .toThrowError(/already disposed/);\n });\n});\n\ndescribeMathCPUAndGPU('loadWeightsFromNamedTensorMap', () => {\n const inputTensor =\n tfl.layers.input({shape: [3], name: 'inputLayer', dtype: 'float32'});\n\n it('One layer', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6], [3, 2]);\n namedWeightsMap[denseLayer.weights[1].originalName] = tensor1d([10, 20]);\n model.loadWeights(namedWeightsMap);\n expectTensorsClose(\n denseLayer.weights[0].read(), tensor2d([1, 2, 3, 4, 5, 6], [3, 2]));\n expectTensorsClose(denseLayer.weights[1].read(), tensor1d([10, 20]));\n });\n\n it('Mismatching shape throws an error even in non-strict mode', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [4, 2]);\n namedWeightsMap[denseLayer.weights[1].originalName] = tensor1d([10, 20]);\n const strict = false;\n expect(() => model.loadWeights(namedWeightsMap, strict))\n .toThrowError('Shape mismatch: [3,2] vs. [4,2]');\n });\n\n it('Extra weights leads to error', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6], [3, 2]);\n namedWeightsMap[denseLayer.weights[1].originalName] = tensor1d([10, 20]);\n namedWeightsMap['extra'] = tensor1d([10, 20]);\n expect(() => model.loadWeights(namedWeightsMap))\n .toThrowError(/Provided weight data has no target variable: extra/);\n });\n\n it('Extra weights are allowed in non-strict mode', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6], [3, 2]);\n namedWeightsMap[denseLayer.weights[1].originalName] = tensor1d([10, 20]);\n namedWeightsMap['extra'] = tensor1d([10, 20]);\n const strict = false;\n model.loadWeights(namedWeightsMap, strict);\n expectTensorsClose(\n denseLayer.weights[0].read(), tensor2d([1, 2, 3, 4, 5, 6], [3, 2]));\n expectTensorsClose(denseLayer.weights[1].read(), tensor1d([10, 20]));\n });\n\n it('Unset weights leads to error', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6], [3, 2]);\n expect(() => model.loadWeights(namedWeightsMap))\n .toThrowError(/1 of 2 weights are not set: .*bias.*/);\n });\n\n it('Unset weights are allowed in non-strict mode', () => {\n const denseLayer =\n tfl.layers.dense({units: 2, useBias: true, name: 'dense_layer'});\n const output = denseLayer.apply(inputTensor) as SymbolicTensor;\n const model = tfl.model({inputs: inputTensor, outputs: output});\n\n const namedWeightsMap: NamedTensorMap = {};\n namedWeightsMap[denseLayer.weights[0].originalName] =\n tensor2d([1, 2, 3, 4, 5, 6], [3, 2]);\n const strict = false;\n model.loadWeights(namedWeightsMap, strict);\n // No exception thrown.\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-layers/dist/engine/training.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts deleted file mode 100644 index ea9556646..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts +++ /dev/null @@ -1,650 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, Tensor } from '@tensorflow/tfjs-core'; -import { History, ModelLoggingVerbosity } from '../base_callbacks'; -import { Shape } from '../keras_format/common'; -import { TrainingConfig } from '../keras_format/training_config'; -import { LossOrMetricFn, NamedTensor } from '../types'; -import { Container, ContainerArgs } from './container'; -import { Dataset } from './dataset_stub'; -import { DisposeResult } from './topology'; -import { ModelEvaluateDatasetArgs, ModelFitDatasetArgs } from './training_dataset'; -import { ModelFitArgs } from './training_tensors'; -import { ClassWeight, ClassWeightMap } from './training_utils'; -/** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ -export declare function isDataTensor(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; -} | { - [inputName: string]: Tensor[]; -}): boolean; -/** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ -export declare function isDataArray(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}): boolean; -/** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ -export declare function isDataDict(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}): boolean; -/** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ -export declare function standardizeInputData(data: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}, names: string[], shapes?: Shape[], checkBatchAxis?: boolean, exceptionPrefix?: string): Tensor[]; -/** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ -export declare function checkArrayLengths(inputs: Tensor[], targets: Tensor[], weights?: Tensor[]): void; -/** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ -export declare function collectMetrics(metrics: string | LossOrMetricFn | Array | { - [outputName: string]: string | LossOrMetricFn; -}, outputNames: string[]): Array>; -export interface ModelEvaluateArgs { - /** - * Batch size (Integer). If unspecified, it will default to 32. - */ - batchSize?: number; - /** - * Verbosity mode. - */ - verbose?: ModelLoggingVerbosity; - /** - * Tensor of weights to weight the contribution of different samples to the - * loss and metrics. - */ - sampleWeight?: Tensor; - /** - * integer: total number of steps (batches of samples) - * before declaring the evaluation round finished. Ignored with the default - * value of `undefined`. - */ - steps?: number; -} -/** - * Configuration for calls to `LayersModel.compile()`. - */ -export interface ModelCompileArgs { - /** - * An instance of `tf.train.Optimizer` or a string name for an Optimizer. - */ - optimizer: string | Optimizer; - /** - * Object function(s) or name(s) of object function(s). - * If the model has multiple outputs, you can use a different loss - * on each output by passing a dictionary or an Array of losses. - * The loss value that will be minimized by the model will then be the sum - * of all individual losses. - */ - loss: string | string[] | { - [outputName: string]: string; - } | LossOrMetricFn | LossOrMetricFn[] | { - [outputName: string]: LossOrMetricFn; - }; - /** - * List of metrics to be evaluated by the model during training and testing. - * Typically you will use `metrics=['accuracy']`. - * To specify different metrics for different outputs of a multi-output - * model, you could also pass a dictionary. - */ - metrics?: string | LossOrMetricFn | Array | { - [outputName: string]: string | LossOrMetricFn; - }; -} -/** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export declare class LayersModel extends Container implements tfc.InferenceModel { - /** @nocollapse */ - static className: string; - protected optimizer_: Optimizer; - protected isOptimizerOwned: boolean; - loss: string | string[] | { - [outputName: string]: string; - } | LossOrMetricFn | LossOrMetricFn[] | { - [outputName: string]: LossOrMetricFn; - }; - lossFunctions: LossOrMetricFn[]; - private feedOutputShapes; - private feedLossFns; - private collectedTrainableWeights; - private testFunction; - history: History; - protected stopTraining_: boolean; - protected isTraining: boolean; - metrics: string | LossOrMetricFn | Array | { - [outputName: string]: string | LossOrMetricFn; - }; - metricsNames: string[]; - metricsTensors: Array<[LossOrMetricFn, number]>; - private userDefinedMetadata; - constructor(args: ContainerArgs); - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - compile(args: ModelCompileArgs): void; - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - protected checkTrainableWeightsConsistency(): void; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x: Tensor | Tensor[], y: Tensor | Tensor[], args?: ModelEvaluateArgs): Scalar | Scalar[]; - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs): Promise; - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - private checkNumSamples; - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - execute(inputs: Tensor | Tensor[] | NamedTensorMap, outputs: string | string[]): Tensor | Tensor[]; - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - private retrieveSymbolicTensors; - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - private predictLoop; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x: Tensor | Tensor[], args?: ModelPredictArgs): Tensor | Tensor[]; - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predictOnBatch(x: Tensor | Tensor[]): Tensor | Tensor[]; - protected standardizeUserDataXY(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, checkBatchAxis?: boolean, batchSize?: number): [Tensor[], Tensor[]]; - protected standardizeUserData(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, sampleWeight?: Tensor | Tensor[] | { - [outputName: string]: Tensor; - }, classWeight?: ClassWeight | ClassWeight[] | ClassWeightMap, checkBatchAxis?: boolean, batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]>; - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - private testLoop; - protected getDedupedMetricsNames(): string[]; - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - protected makeTrainFunction(): (data: Tensor[]) => Scalar[]; - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - private makeTestFunction; - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - fit(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, args?: ModelFitArgs): Promise; - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - fitDataset(dataset: Dataset, args: ModelFitDatasetArgs): Promise; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - trainOnBatch(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }): Promise; - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - protected getNamedWeights(config?: io.SaveConfig): NamedTensor[]; - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - stopTraining: boolean; - optimizer: Optimizer; - dispose(): DisposeResult; - private getLossIdentifiers; - private getMetricIdentifiers; - protected getTrainingConfig(): TrainingConfig; - loadTrainingConfig(trainingConfig: TrainingConfig): void; - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - save(handlerOrURL: io.IOHandler | string, config?: io.SaveConfig): Promise; - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - setUserDefinedMetadata(userDefinedMetadata: {}): void; - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - getUserDefinedMetadata(): {}; -} -/** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ -/** @doc {heading: 'Models', subheading: 'Classes'} */ -export declare class Functional extends LayersModel { - static className: string; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js deleted file mode 100644 index 0d1275063..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js +++ /dev/null @@ -1,1611 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original Source: engine/training.py */ -import * as tfc from '@tensorflow/tfjs-core'; -import { io, Optimizer, scalar, serialization, Tensor, tensor1d, util } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { nameScope } from '../common'; -import { NotImplementedError, RuntimeError, ValueError } from '../errors'; -import { deserialize } from '../layers/serialization'; -import * as losses from '../losses'; -import * as Metrics from '../metrics'; -import * as optimizers from '../optimizers'; -import { checkUserDefinedMetadata } from '../user_defined_metadata'; -import { count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique } from '../utils/generic_utils'; -import { printSummary } from '../utils/layer_utils'; -import { range } from '../utils/math_utils'; -import { convertPythonicToTs } from '../utils/serialization_utils'; -import { version } from '../version'; -import { Container } from './container'; -import { execute, FeedDict } from './executor'; -import { evaluateDataset, fitDataset } from './training_dataset'; -import { checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, sliceArrays, sliceArraysByIndices } from './training_tensors'; -import { computeWeightedLoss, standardizeClassWeights, standardizeWeights } from './training_utils'; -/** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ -export function isDataTensor(x) { - return x instanceof Tensor; -} -/** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ -export function isDataArray(x) { - return Array.isArray(x); -} -/** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ -export function isDataDict(x) { - return !isDataTensor(x) && !isDataArray(x); -} -/** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ -export function standardizeInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - let gotUnexpectedData = false; - if (isDataArray(data) && data.length > 0) { - gotUnexpectedData = true; - } - else if (isDataDict(data)) { - for (const key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } - else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError(`Error when checking model ${exceptionPrefix} expected no data, ` + - `but got ${data}`); - } - } - return []; - } - if (data == null) { - return names.map(name => null); - } - let arrays; - if (isDataDict(data)) { - data = data; - arrays = []; - for (const name of names) { - if (data[name] == null) { - throw new ValueError(`No data provided for "${name}". Need data for each key in: ` + - `${names}`); - } - arrays.push(data[name]); - } - } - else if (isDataArray(data)) { - data = data; - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `model expected. Expected to see ${names.length} Tensor(s), but ` + - `instead got the following list of Tensor(s): ${data}`); - } - arrays = data; - } - else { - data = data; - if (names.length > 1) { - throw new ValueError(`The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` + - `but only received one Tensor. Found: Tensor with shape ${data.shape}`); - } - arrays = [data]; - } - arrays = ensureTensorsRank2OrHigher(arrays); - // Check shape compatibility. - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s). but got array with ` + - `shape ${array.shape}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have shape [${shapes[i]}], but got array with shape ` + - `[${array.shape}].`); - } - } - } - } - return arrays; -} -/** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ -export function checkArrayLengths(inputs, targets, weights) { - const setX = unique(inputs.map(input => input.shape[0])); - setX.sort(); - const setY = unique(targets.map(target => target.shape[0])); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError(`All input Tensors (x) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(inputs.map(input => input.shape))}`); - } - if (setY.length > 1) { - throw new ValueError(`All target Tensors (y) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(targets.map(target => target.shape))}`); - } - if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) { - throw new ValueError(`Input Tensors should have the same number of samples as target ` + - `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` + - `sample(s).`); - } -} -/** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ -function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { - // TODO(cais): Dedicated test coverage? - const keyLosses = [ - losses.meanSquaredError, losses.binaryCrossentropy, - losses.categoricalCrossentropy - ]; - for (let i = 0; i < targets.length; ++i) { - const y = targets[i]; - const loss = lossFns[i]; - const shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === losses.categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError(`You are passing a target array of shape ${y.shape} while using ` + - `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` + - `expects targets to be binary matrices (1s and 0s) of shape ` + - `[samples, classes].`); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - const slicedYShape = y.shape.slice(1); - const slicedShape = shape.slice(1); - for (let j = 0; j < slicedYShape.length; ++j) { - const targetDim = slicedYShape[j]; - const outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError(`A target Tensor with shape ${y.shape} was passed for an ` + - `output of shape ${shape}, while using a loss function that ` + - `expects targets to have the same shape as the output.`); - } - } - } - } -} -/** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ -function checkInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - let arrays; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `the model expected. Expected to see ${names.length} Tensor(s),` + - ` but instead got ${data.length} Tensors(s).`); - } - arrays = data; - } - else { - if (names.length > 1) { - throw new ValueError(`The model expects ${names.length} ${exceptionPrefix} Tensors, ` + - `but only received one Tensor. Found: array with shape ` + - `${JSON.stringify(data.shape)}.`); - } - arrays = [data]; - } - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s), but got array with ` + - `shape ${JSON.stringify(array.shape)}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ` + - `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` + - `got array with shape ${JSON.stringify(array.shape)}.`); - } - } - } - } - } -} -/** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ -export function collectMetrics(metrics, outputNames) { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(name => []); - } - let wrappedMetrics; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } - else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics; - } - else { - throw new TypeError('Type of metrics argument not understood. Expected an string,' + - `function, Array, or Object, found: ${metrics}`); - } - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map(name => wrappedMetrics); - } - else { - // In this case, metrics is a dict. - const nestedMetrics = []; - for (const name of outputNames) { - let outputMetrics = wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } -} -const LAYERS_MODEL_FORMAT_NAME = 'layers-model'; -/** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export class LayersModel extends Container { - constructor(args) { - super(args); - this.isTraining = false; - } - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - throw new ValueError(`This model has never been called, thus its weights have not been ` + - `created yet. So no summary can be displayed. Build the model ` + - `first (e.g., by calling it on some test data).`); - } - printSummary(this, lineLength, positions, printFn); - } - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - compile(args) { - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - if (typeof args.optimizer === 'string') { - this.optimizer_ = optimizers.getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } - else { - if (!(args.optimizer instanceof Optimizer)) { - throw new ValueError(`User-defined optimizer must be an instance of tf.Optimizer.`); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - // Prepare loss functions. - let lossFunctions = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss; - for (const name in args.loss) { - if (this.outputNames.indexOf(name) === -1) { - throw new ValueError(`Unknown entry in loss dictionary: "${name}". ` + - `Only expected the following keys: ${this.outputNames}`); - } - } - for (const name of this.outputNames) { - if (args.loss[name] == null) { - console.warn(`Output "${name}" is missing from loss dictionary. We assume ` + - `this was done on purpose, and we will not be expecting data ` + - `to be passed to ${name} during training`); - } - lossFunctions.push(losses.get(args.loss[name])); - } - } - else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError(`When passing an Array as loss, it should have one entry per ` + - `model output. The model has ${this.outputs.length} output(s), ` + - `but you passed loss=${args.loss}.`); - } - const theLosses = args.loss; - lossFunctions = theLosses.map(l => losses.get(l)); - } - else { - const lossFunction = losses.get(args.loss); - this.outputs.forEach(_ => { - lossFunctions.push(lossFunction); - }); - } - this.lossFunctions = lossFunctions; - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (let i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - const shape = this.internalOutputShapes[i]; - const name = this.outputNames[i]; - this.feedOutputNames.push(name); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - const skipTargetIndices = []; - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - const weightedLoss = this.lossFunctions[i]; - if (this.outputs.length > 1) { - this.metricsTensors.push([weightedLoss, i]); - this.metricsNames.push(this.outputNames[i] + '_loss'); - } - } - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - const nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - /** - * Helper function used in loop below. - */ - const appendMetric = (outputIndex, metricName, metricTensor) => { - if (this.outputNames.length > 1) { - metricName = this.outputNames[outputIndex] + '_' + metricName; - } - this.metricsNames.push(metricName); - this.metricsTensors.push([metricTensor, outputIndex]); - }; - nameScope('metric', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - const outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - // TODO(cais): Add optional arg `weights` to the following function. - const handleMetrics = (metrics) => { - const metricNamePrefix = ''; - let metricName; - let accFn; - let weightedMetricFn; - // TODO(cais): Use 'weights_' for weighted metrics. - for (const metric of metrics) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - const outputShape = this.internalOutputShapes[i]; - if (outputShape[outputShape.length - 1] === 1 || - this.lossFunctions[i] === losses.binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.binaryAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.binaryCrossentropy; - } - } - else if (this.lossFunctions[i] === - losses.sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.sparseCategoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.sparseCategoricalCrossentropy; - } - } - else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.categoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.categoricalCrossentropy; - } - } - let suffix; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } - else { - const metricFn = Metrics.get(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + Metrics.getLossOrMetricName(metric); - } - // TODO(cais): Add weighting and masking to metricResult. - let metricResult; - nameScope(metricName, () => { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - } - }; - handleMetrics(outputMetrics); - // TODO(cais): Call handleMetrics with weights. - } - }); - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - } - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - checkTrainableWeightsConsistency() { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn('Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - const checkBatchAxis = true; - const standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - const ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - const f = this.testFunction; - const testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } - finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - this.makeTestFunction(); - return evaluateDataset(this, dataset, args); - } - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - checkNumSamples(ins, batchSize, steps, stepsName = 'steps') { - let numSamples; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError(`If ${stepsName} is set, batchSize must be null or undefined.` + - `Got batchSize = ${batchSize}`); - } - } - else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } - else { - numSamples = ins.shape[0]; - } - } - else { - throw new ValueError(`Either the input data should have a defined shape, or ` + - `${stepsName} shoud be specified.`); - } - return numSamples; - } - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - execute(inputs, outputs) { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError('`outputs` is an empty Array, which is not allowed.'); - } - const outputsIsArray = Array.isArray(outputs); - const outputNames = (outputsIsArray ? outputs : [outputs]); - const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - // Format the input into a FeedDict. - const feedDict = new FeedDict(); - if (inputs instanceof Tensor) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError(`The number of inputs provided (${inputs.length}) ` + - `does not match the number of inputs of this model ` + - `(${this.inputs.length}).`); - } - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } - else { - for (const input of this.inputs) { - const tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError(`No value is provided for the model's input ${input.name}`); - } - feedDict.add(input, tensorValue); - } - } - // Run execution. - const executeOutputs = execute(outputSymbolicTensors, feedDict); - return outputsIsArray ? executeOutputs : executeOutputs[0]; - } - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - retrieveSymbolicTensors(symbolicTensorNames) { - const outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); - let outputsRemaining = symbolicTensorNames.length; - for (const layer of this.layers) { - const layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; - const layerOutputNames = layerOutputs.map(output => output.name); - for (let i = 0; i < symbolicTensorNames.length; ++i) { - const index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining > 0) { - const remainingNames = []; - outputSymbolicTensors.forEach((tensor, i) => { - if (tensor == null) { - remainingNames.push(symbolicTensorNames[i]); - } - }); - throw new ValueError(`Cannot find SymbolicTensors for output name(s): ` + - `${JSON.stringify(remainingNames)}`); - } - return outputSymbolicTensors; - } - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - predictLoop(ins, batchSize = 32, verbose = false) { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); - } - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - const batches = makeBatches(numSamples, batchSize); - const outsBatches = this.outputs.map(output => []); - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchOuts = tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - const insBatch = sliceArrays(ins, batchStart, batchEnd); - // Construct the feeds for execute(); - const feeds = []; - if (Array.isArray(insBatch)) { - for (let i = 0; i < insBatch.length; ++i) { - feeds.push({ key: this.inputs[i], value: insBatch[i] }); - } - } - else { - feeds.push({ key: this.inputs[0], value: insBatch }); - } - const feedDict = new FeedDict(feeds); - return execute(this.outputs, feedDict); - }); - batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut)); - } - return singletonOrArray(outsBatches.map(batches => tfc.concat(batches, 0))); - }); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - const xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } - finally { - disposeNewTensors(xsRank2OrHigher, x); - } - } - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predictOnBatch(x) { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - } - standardizeUserDataXY(x, y, checkBatchAxis = true, batchSize) { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError('You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - const outputShapes = []; - for (let i = 0; i < this.feedOutputShapes.length; ++i) { - const outputShape = this.feedOutputShapes[i]; - const lossFn = this.feedLossFns[i]; - if (lossFn === losses.sparseCategoricalCrossentropy) { - outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); - } - else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y, null); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError(`In a stateful network, you should only pass inputs with a ` + - `number of samples that is divisible by the batch size ` + - `${batchSize}. Found: ${x[0].shape[0]} sample(s).`); - } - } - return [x, y]; - } - async standardizeUserData(x, y, sampleWeight, classWeight, checkBatchAxis = true, batchSize) { - const [standardXs, standardYs] = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - let standardSampleWeights = null; - if (classWeight != null) { - const classWeights = standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - for (let i = 0; i < classWeights.length; ++i) { - standardSampleWeights.push(await standardizeWeights(standardYs[i], null, classWeights[i])); - } - } - // TODO(cais): Deal with the case of model.stateful == true. - return [standardXs, standardYs, standardSampleWeights]; - } - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - testLoop(f, ins, batchSize, verbose = 0, steps) { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps'); - const outs = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); - } - else { - const batches = makeBatches(numSamples, batchSize); - const indexArray = tensor1d(range(0, numSamples)); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = K.sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const batchOuts = f(insBatch); - if (batchIndex === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar(0)); - } - } - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - outs[i] = - tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut)); - } - } - for (let i = 0; i < outs.length; ++i) { - outs[i] = tfc.div(outs[i], numSamples); - } - } - return outs; - }); - } - getDedupedMetricsNames() { - const outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - const dedupedOutLabels = []; - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - let newLabel = label; - if (count(outLabels, label) > 1) { - const dupIndex = count(outLabels.slice(0, i), label); - newLabel += `_${dupIndex}`; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - } - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - makeTrainFunction() { - return (data) => { - const lossValues = []; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const sampleWeights = data.slice(this.inputs.length + this.outputs.length, this.inputs.length + this.outputs.length * 2); - const metricsValues = []; - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - const totalLossFunction = () => { - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict, { 'training': true }); - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - let totalLoss; - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - let loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - // TODO(cais): push Scalar instead. - const meanLoss = tfc.mean(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - } - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (let i = 0; i < this.metricsTensors.length; ++i) { - let weightedMetric; - if (this.outputs.length > 1 && i < this.outputs.length) { - weightedMetric = lossValues[i]; - } - else { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - weightedMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - } - tfc.keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - totalLoss = tfc.mean(totalLoss); - // Add regularizer penalties. - this.calculateLosses().forEach(regularizerLoss => { - totalLoss = tfc.add(totalLoss, regularizerLoss); - }); - return totalLoss; - }; - const variables = this.collectedTrainableWeights.map(param => param.read()); - const returnCost = true; - const totalLossValue = this.optimizer_.minimize(totalLossFunction, returnCost, variables); - return [totalLossValue].concat(metricsValues); - }; - } - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - makeTestFunction() { - this.testFunction = (data) => { - return tfc.tidy(() => { - const valOutputs = []; - let totalLoss; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict); - // Compute total loss. - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - const loss = tfc.mean(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (let i = 0; i < this.metricsTensors.length; ++i) { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - const meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric); - } - return valOutputs; - }); - }; - } - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - return fitTensors(this, x, y, args); - } - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fitDataset(dataset, args) { - return fitDataset(this, dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - // TODO(cais): Support sampleWeight and classWeight. - // TODO(cais): Support Dataset objects. - const standardizeOut = await this.standardizeUserData(x, y); - const inputs = standardizeOut[0]; - const targets = standardizeOut[1]; - const trainFunction = this.makeTrainFunction(); - const losses = trainFunction(inputs.concat(targets)); - const lossValues = []; - for (const loss of losses) { - const v = await loss.data(); - lossValues.push(v[0]); - } - tfc.dispose(losses); - return singletonOrArray(lossValues); - } - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - getNamedWeights(config) { - const namedWeights = []; - const trainableOnly = config != null && config.trainableOnly; - const weights = trainableOnly ? this.trainableWeights : this.weights; - const weightValues = this.getWeights(trainableOnly); - for (let i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); - } - return namedWeights; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - this.stopTraining_ = stop; - } - get stopTraining() { - return this.stopTraining_; - } - get optimizer() { - return this.optimizer_; - } - set optimizer(optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - } - dispose() { - const result = super.dispose(); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors; - } - return result; - } - getLossIdentifiers() { - let lossNames; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss); - } - else if (Array.isArray(this.loss)) { - for (const loss of this.loss) { - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = this.loss.map(name => toSnakeCase(name)); - } - else { - const outputNames = Object.keys(this.loss); - lossNames = {}; - const losses = this.loss; - for (const outputName of outputNames) { - if (typeof losses[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses[outputName]); - } - else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - } - getMetricIdentifiers() { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))]; - } - else if (Array.isArray(this.metrics)) { - return this.metrics.map(metric => toSnakeCase(Metrics.getLossOrMetricName(metric))); - } - else { - const metricsIdentifiers = {}; - for (const key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - } - getTrainingConfig() { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - } - loadTrainingConfig(trainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config); - const optimizer = deserialize(tsConfig); - let loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } - else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry)); - } - else if (trainingConfig.loss != null) { - loss = {}; - for (const key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]); - } - } - let metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(metric => toCamelCase(metric)); - } - else if (trainingConfig.metrics != null) { - metrics = {}; - for (const key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - this.compile({ loss, metrics, optimizer }); - } - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async save(handlerOrURL, config) { - if (typeof handlerOrURL === 'string') { - const handlers = io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError(`Cannot find any save handlers for URL '${handlerOrURL}'`); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) save handlers for ` + - `URL '${handlerOrURL}'`); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError('LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - const weightDataAndSpecs = await io.encodeWeights(this.getNamedWeights(config)); - const returnString = false; - const unusedArg = null; - const modelConfig = this.toJSON(unusedArg, returnString); - const modelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: `TensorFlow.js tfjs-layers v${version}`, - convertedBy: null, - }; - const includeOptimizer = config == null ? false : config.includeOptimizer; - if (includeOptimizer && this.optimizer != null) { - modelArtifacts.trainingConfig = this.getTrainingConfig(); - const weightType = 'optimizer'; - const { data: optimizerWeightData, specs: optimizerWeightSpecs } = await io.encodeWeights(await this.optimizer.getWeights(), weightType); - weightDataAndSpecs.specs.push(...optimizerWeightSpecs); - weightDataAndSpecs.data = io.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); - } - if (this.userDefinedMetadata != null) { - // Check serialized size of user-defined metadata. - const checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return handlerOrURL.save(modelArtifacts); - } - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - setUserDefinedMetadata(userDefinedMetadata) { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - } - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - getUserDefinedMetadata() { - return this.userDefinedMetadata; - } -} -// The class name is 'Model' rather than 'LayersModel' for backwards -// compatibility since this class name shows up in the serialization format. -/** @nocollapse */ -LayersModel.className = 'Model'; -serialization.registerClass(LayersModel); -/** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ -/** @doc {heading: 'Models', subheading: 'Classes'} */ -export class Functional extends LayersModel { -} -Functional.className = 'Functional'; -serialization.registerClass(Functional); -//# sourceMappingURL=training.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-layers/dist/engine/training.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map deleted file mode 100644 index 59dffc993..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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UAAW,SAAQ,WAAW;;AAClC,oBAAS,GAAG,YAAY,CAAC;AAElC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.d.ts deleted file mode 100644 index e562dad26..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.d.ts +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Interfaces and methods for training models using TensorFlow.js datasets. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { BaseCallback, CustomCallbackArgs, History, ModelLoggingVerbosity, YieldEveryOptions } from '../base_callbacks'; -import { TensorOrArrayOrMap } from '../types'; -import { Dataset, LazyIterator } from './dataset_stub'; -import { ClassWeight, ClassWeightMap } from './training_utils'; -/** - * Interface for configuring model training based on a dataset object. - */ -export interface ModelFitDatasetArgs { - /** - * (Optional) Total number of steps (batches of samples) before - * declaring one epoch finished and starting the next epoch. It should - * typically be equal to the number of samples of your dataset divided by - * the batch size, so that `fitDataset`() call can utilize the entire dataset. - * If it is not provided, use `done` return value in `iterator.next()` as - * signal to finish an epoch. - */ - batchesPerEpoch?: number; - /** - * Integer number of times to iterate over the training dataset. - */ - epochs: number; - /** - * Verbosity level. - * - * Expected to be 0, 1, or 2. Default: 1. - * - * 0 - No printed message during fit() call. - * 1 - In Node.js (tfjs-node), prints the progress bar, together with - * real-time updates of loss and metric values and training speed. - * In the browser: no action. This is the default. - * 2 - Not implemented yet. - */ - verbose?: ModelLoggingVerbosity; - /** - * List of callbacks to be called during training. - * Can have one or more of the following callbacks: - * - `onTrainBegin(logs)`: called when training starts. - * - `onTrainEnd(logs)`: called when training ends. - * - `onEpochBegin(epoch, logs)`: called at the start of every epoch. - * - `onEpochEnd(epoch, logs)`: called at the end of every epoch. - * - `onBatchBegin(batch, logs)`: called at the start of every batch. - * - `onBatchEnd(batch, logs)`: called at the end of every batch. - * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds - * with the current epoch, batch and logs. The logs are the same - * as in `onBatchEnd()`. Note that `onYield` can skip batches or - * epochs. See also docs for `yieldEvery` below. - */ - callbacks?: BaseCallback[] | CustomCallbackArgs | CustomCallbackArgs[]; - /** - * Data on which to evaluate the loss and any model - * metrics at the end of each epoch. The model will not be trained on this - * data. This could be any of the following: - * - * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`, - * an array of Tensors, or a map of string to Tensor. - * - Similarly, an array ` [xVal, yVal, valSampleWeights]` - * (not implemented yet). - * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`, - * where `xs` and `ys` are the feature and label tensors, respectively. - * - * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be - * sliced into batches during validation, using the parameter - * `validationBatchSize` (which defaults to 32). The entirety of the - * `tf.Tensor` objects will be used in the validation. - * - * If `validationData` is a dataset object, and the `validationBatches` - * parameter is specified, the validation will use `validationBatches` batches - * drawn from the dataset object. If `validationBatches` parameter is not - * specified, the validation will stop when the dataset is exhausted. - * - * The model will not be trained on this data. - */ - validationData?: [TensorOrArrayOrMap, TensorOrArrayOrMap] | [TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap] | Dataset; - /** - * Optional batch size for validation. - * - * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not - * a dataset object. - * - * If not specified, its value defaults to 32. - */ - validationBatchSize?: number; - /** - * (Optional) Only relevant if `validationData` is specified and is a dataset - * object. - * - * Total number of batches of samples to draw from `validationData` for - * validation purpose before stopping at the end of every epoch. If not - * specified, `evaluateDataset` will use `iterator.next().done` as signal to - * stop validation. - */ - validationBatches?: number; - /** - * Configures the frequency of yielding the main thread to other tasks. - * - * In the browser environment, yielding the main thread can improve the - * responsiveness of the page during training. In the Node.js environment, - * it can ensure tasks queued in the event loop can be handled in a timely - * manner. - * - * The value can be one of the following: - * - `'auto'`: The yielding happens at a certain frame rate (currently set - * at 125ms). This is the default. - * - `'batch'`: yield every batch. - * - `'epoch'`: yield every epoch. - * - a `number`: Will yield every `number` milliseconds. - * - `'never'`: never yield. (But yielding can still happen through `await - * nextFrame()` calls in custom callbacks.) - */ - yieldEvery?: YieldEveryOptions; - /** - * Epoch at which to start training (useful for resuming a previous training - * run). When this is used, `epochs` is the index of the "final epoch". - * The model is not trained for a number of iterations given by `epochs`, - * but merely until the epoch of index `epochs` is reached. - */ - initialEpoch?: number; - /** - * Optional object mapping class indices (integers) to - * a weight (float) to apply to the model's loss for the samples from this - * class during training. This can be useful to tell the model to "pay more - * attention" to samples from an under-represented class. - * - * If the model has multiple outputs, a class weight can be specified for - * each of the outputs by setting this field an array of weight object - * or a object that maps model output names (e.g., `model.outputNames[0]`) - * to weight objects. - */ - classWeight?: ClassWeight | ClassWeight[] | ClassWeightMap; -} -export interface FitDatasetElement { - xs: TensorOrArrayOrMap; - ys: TensorOrArrayOrMap; -} -/** - * Interface for configuring model evaluation based on a dataset object. - */ -export interface ModelEvaluateDatasetArgs { - /** - * Number of batches to draw from the dataset object before ending the - * evaluation. - */ - batches?: number; - /** - * Verbosity mode. - */ - verbose?: ModelLoggingVerbosity; -} -export declare function fitDataset(model: any, dataset: Dataset, args: ModelFitDatasetArgs): Promise; -export declare function evaluateDataset(model: any, dataset: Dataset | LazyIterator, args: ModelEvaluateDatasetArgs): Promise; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js deleted file mode 100644 index a82ee78e4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js +++ /dev/null @@ -1,351 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Interfaces and methods for training models using TensorFlow.js datasets. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { scalar } from '@tensorflow/tfjs-core'; -import { configureCallbacks, standardizeCallbacks } from '../base_callbacks'; -import { NotImplementedError, ValueError } from '../errors'; -import { disposeTensorsInLogs } from '../logs'; -import { singletonOrArray, toList } from '../utils/generic_utils'; -import { standardizeClassWeights, standardizeWeights } from './training_utils'; -// Default batch size used during tensor-based validation. -const DEFAULT_VALIDATION_BATCH_SIZE = 32; -/** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ -function standardizeDataIteratorOutput( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, iteratorOut) { - let xs; - let ys; - const iteratorOutObj = iteratorOut; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - tfc.util.assert(xs != null && ys != null, () => 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - `${iteratorOut}`); - const flattenedXs = flattenTensorOrArrayOrMap('input', model.inputNames, xs); - const flattenedYs = flattenTensorOrArrayOrMap('output', model.outputNames, ys); - const batchSize = flattenedXs[0].shape[0]; - tfc.util.assert(flattenedXs.length === model.inputs.length, () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` + - `provides ${flattenedXs.length} inputs. (Expected input keys: ` + - `${JSON.stringify(model.inputNames)})`); - tfc.util.assert(flattenedYs.length === model.outputs.length, () => `LayersModel has ${model.outputs.length} outputs, but the dataset ` + - `provides ${flattenedYs.length} outputs. (Expected output keys: ` + - `${JSON.stringify(model.outputNames)})`); - for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - tfc.util.assert(flattenedXs[xIndex].shape[0] === batchSize, () => `Batch size mismatch: input ` + - `${model.inputNames[xIndex]} has ${flattenedXs[xIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - tfc.util.assert(flattenedYs[yIndex].shape[0] === batchSize, () => `Batch size mismatch: output ` + - `${model.outputNames[yIndex]} has ${flattenedYs[yIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - return { xs: flattenedXs, ys: flattenedYs }; -} -function flattenTensorOrArrayOrMap(inputOrOutput, names, values) { - if (values instanceof tfc.Tensor) { - return [values]; - } - else if (Array.isArray(values)) { - tfc.util.assert(values.length === names.length, () => `Received an array of ${values.length} Tensors, but expected ${names.length} to match the ${inputOrOutput} keys ${names}.`); - return values; - } - else { - const result = []; - // Check that all the required keys are available. - for (const name of names) { - if (values[name] == null) { - throw new ValueError(`The feature data generated by the dataset lacks the required ` + - `${inputOrOutput} key '${name}'.`); - } - result.push(values[name]); - } - return result; - } -} -function standardizeTensorValidationData(data) { - if (data.length === 3) { - throw new NotImplementedError('Validation with sample weights is not implemented yet.'); - } - return { xs: data[0], ys: data[1] }; -} -export async function fitDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - const hasBatchesPerEpoch = args.batchesPerEpoch != null; - tfc.util.assert(model.optimizer != null, () => 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'); - tfc.util.assert(args != null, () => `For fitDataset(), the 2nd argument (config) is required, ` + - `but it is not provided in this call.`); - tfc.util.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), () => `For fitDataset(), config.epochs is expected to be a positive ` + - `integer, but got ${args.epochs}`); - tfc.util.assert(!hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` + - `positive integer if specified, but got ${args.batchesPerEpoch}`); - tfc.util.assert( - // tslint:disable-next-line:no-any - args['validationSplit'] == null, () => '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'); - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - try { - const doValidation = args.validationData != null; - let valXs; - let valYs; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - tfc.util.assert(args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), () => `For fitDataset() with dataset-based validation, ` + - `config.validationBatches is expected not to be provided, ` + - `or to be a positive integer, ` + - `but got ${args.validationBatches}`); - } - else { - const validationData = standardizeTensorValidationData(args.validationData); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let callbackMetrics; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const verbose = args.verbose == null ? 1 : args.verbose; - const { callbackList, history } = configureCallbacks(callbacks, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - let epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - let dataIterator = await dataset.iterator(); - while (epoch < args.epochs) { - const epochLogs = {}; - await callbackList.onEpochBegin(epoch); - let stepsDone = 0; - let batchIndex = 0; - if (!hasBatchesPerEpoch) { - dataIterator = await dataset.iterator(); - } - while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) { - const iteratorOut = await dataIterator.next(); - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn('You provided `batchesPerEpoch` as ' + - `${args.batchesPerEpoch}, ` + - 'but your dataset iterator ran out of data after ' + - `${stepsDone} batches; ` + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - `${args.batchesPerEpoch * args.epochs} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - break; - } - if (iteratorOut.value != null) { - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const batchLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - await callbackList.onBatchBegin(batchIndex, batchLogs); - const sampleWeights = []; - if (args.classWeight != null) { - const standardClassWeights = standardizeClassWeights(args.classWeight, model.outputNames); - for (let i = 0; i < standardClassWeights.length; ++i) { - sampleWeights.push(await standardizeWeights(ys[i], null, standardClassWeights[i])); - } - } - // Train on batch. - const ins = xs.concat(ys).concat(sampleWeights); - const outs = trainFunction(ins); - tfc.dispose(ins); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - } - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - batchIndex++; - stepsDone++; - } - if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done) { - // Epoch finished. Perform validation. - if (doValidation) { - let valOuts; - if (isDatasetObject(args.validationData)) { - valOuts = toList(await model.evaluateDataset(args.validationData, { batches: args.validationBatches })); - } - else { - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - } - for (let i = 0; i < model.metricsNames.length; ++i) { - epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i]; - } - } - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - break; - } - if (model.stopTraining_) { - break; - } - } - await callbackList.onEpochEnd(epoch, epochLogs); - epoch++; - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; - } - finally { - model.isTraining = false; - } -} -/** Helper function that determines number of steps (batches) per epoch. */ -function getStepsPerEpoch(dataset, args) { - // Attempt to determine # of batches in an epoch. - let stepsPerEpoch = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } - else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; -} -// Check if provided object is a Dataset object by checking its .iterator -// element. -function isDatasetObject(dataset) { - return (typeof dataset.iterator === 'function'); -} -// Check if provided object is a LazyIterator object by checking it's .next -// element. -function isLazyIteratorObject(iterator) { - return (typeof iterator.next === 'function'); -} -export async function evaluateDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - args = args || {}; - const hasBatches = args.batches != null; - const f = model.testFunction; - let outs = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - tfc.util.assert(!hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), () => 'Test loop expects `batches` to be a positive integer, but ' + - `received ${JSON.stringify(args.batches)}`); - const dataIterator = isLazyIteratorObject(dataset) ? - dataset : - await dataset.iterator(); - // Keeps track of number of examples used in this evaluation. - let numExamples = 0; - let batch = 0; - while (hasBatches ? batch < args.batches : true) { - const iteratorOut = await dataIterator.next(); - outs = tfc.tidy(() => { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const xsAndYs = xs.concat(ys); - const batchOuts = tfc.tidy(() => f(xsAndYs)); - tfc.dispose(xsAndYs); - if (batch === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar(0)); - } - } - const batchSize = xsAndYs[0].shape[0]; - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - const oldScalar = outs[i]; - outs[i] = - tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut))); - if (batch > 0) { - tfc.dispose(oldScalar); - } - } - tfc.dispose(batchOuts); - numExamples += batchSize; - ++batch; - } - return outs; - }); - if (iteratorOut.done) { - if (hasBatches) { - console.warn('Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - `batches (in this case, ${args.batches} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - break; - } - } - for (let i = 0; i < outs.length; ++i) { - const oldScalar = outs[i]; - outs[i] = tfc.div(outs[i], numExamples); - tfc.dispose(oldScalar); - } - return singletonOrArray(outs); -} -//# sourceMappingURL=training_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-layers/dist/engine/training_dataset.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js.map deleted file mode 100644 index 00659e78e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_dataset.js","sourceRoot":"","sources":["../../src/engine/training_dataset.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAe,kBAAkB,EAAsD,oBAAoB,EAAoB,MAAM,mBA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vB,WAAW,IAAI,SAAS,CAAC;gBAEzB,EAAE,KAAK,CAAC;aACT;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,IAAI,WAAW,CAAC,IAAI,EAAE;YACpB,IAAI,UAAU,EAAE;gBACd,OAAO,CAAC,IAAI,CACR,kEAAkE;oBAClE,8CAA8C;oBAC9C,0CAA0C;oBAC1C,0BAA0B,IAAI,CAAC,OAAO,aAAa;oBACnD,0DAA0D;oBAC1D,eAAe,CAAC,CAAC;aACtB;YACD,MAAM;SACP;KACF;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QACxC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACxB;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\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-layers/dist/engine/training_dataset_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset_test.js.map deleted file mode 100644 index 6738b6cd2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_dataset_test.js","sourceRoot":"","sources":["../../src/engine/training_dataset_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAC,cAAc,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEnD,SAAS,gBAAgB;IACvB,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;IAC/B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CACtB,EAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qBAAqB,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACnD,kCAAkC;IAClC,EAAE;IACF,QAAQ;IACR,qBAAqB;IACrB,0BAA0B;IAC1B,EAAE;IACF,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;IACb,EAAE;IACF,uDAAuD;IACvD,uDAAuD;IACvD,2EAA2E;IAC3E,EAAE;IACF,gCAAgC;IAChC,mCAAmC;IACnC,SAAS;IACT,uBAAuB;IACvB,m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E,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtD,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAiB,CAAC;QACzE,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACpC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7C,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAC5C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrB,GAAG,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for training.ts, focusing on the tf.LayersModel.fitDataset() and\n * tf.LayersModel.evaluateDataset() methods.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {util} from '@tensorflow/tfjs-core';\n\nimport {CustomCallback, DEFAULT_YIELD_EVERY_MS} from '../base_callbacks';\nimport * as tfl from '../index';\nimport {Logs} from '../logs';\nimport {describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {FakeNumericDataset} from './dataset_fakes';\n\nfunction createDenseModel(): tfl.LayersModel {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 1, inputShape: [1], kernelInitializer: 'zeros'}));\n return model;\n}\n\ndescribeMathCPUAndGPU('LayersModel.fitDataset', () => {\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // history = model.fit(dataset, steps_per_epoch=num_batches, epochs=epochs)\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('1 input, 1 output, no metric, no validation, with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n });\n\n it('1 input, 1 output, no metric, no validation, no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution():\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error',\n // optimizer='sgd',\n // metrics=['acc'])\n //\n // history = model.fit(dataset, steps_per_epoch=num_batches, epochs=epochs)\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('1 input, 1 output, 1 metric, no validation, with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n });\n\n it('1 input, 1 output, 1 metric, no validation, no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n });\n\n // Reference Python tf.keras code.\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution():\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n // val_xs = np.zeros([batch_size * 2, 1])\n // val_ys = np.zeros([batch_size * 2, 1])\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error', optimizer='sgd',\n // metrics=['accuracy'])\n //\n // class CustomCallback(tf.keras.callbacks.Callback):\n // def on_epoch_end(self, epoch, logs):\n // print('epoch = %d; logs = %s' % (epoch, logs))\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // validation_steps=2,\n // validation_data=(val_xs, val_ys),\n // callbacks=[CustomCallback()])\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('1 input, 1 output, 1 metric, tensor validation, callback, ' +\n 'with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n const valXs = tfc.zeros([batchSize * 2, 1]);\n const valYs = tfc.zeros([batchSize * 2, 1]);\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(\n dataset,\n {batchesPerEpoch, epochs: 1, validationData: [valXs, valYs]});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const epochEndValLosses: number[] = [];\n const epochEndValAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: [valXs, valYs],\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n epochEndValLosses.push(logs.val_loss);\n epochEndValAccs.push(logs.val_acc);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'loss', 'acc', 'val_loss', 'val_acc'\n ].sort());\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011799);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1);\n expect(history.history.val_acc[1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(epochEndValLosses.length).toEqual(2);\n expect(epochEndValLosses[0]).toBeCloseTo(0.003321);\n expect(epochEndValLosses[1]).toBeCloseTo(0.011799);\n expect(epochEndValAccs.length).toEqual(2);\n expect(epochEndValAccs[0]).toBeCloseTo(1);\n expect(epochEndValAccs[1]).toBeCloseTo(1);\n });\n\n it('1 input, 1 output, 1 metric, tensor validation, callback, ' +\n 'no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n const valXs = tfc.zeros([batchSize * 2, 1]);\n const valYs = tfc.zeros([batchSize * 2, 1]);\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(\n dataset, {epochs: 1, validationData: [valXs, valYs]});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const epochEndValLosses: number[] = [];\n const epochEndValAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n epochs,\n validationData: [valXs, valYs],\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n epochEndValLosses.push(logs.val_loss);\n epochEndValAccs.push(logs.val_acc);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'loss', 'acc', 'val_loss', 'val_acc'\n ].sort());\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011799);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1);\n expect(history.history.val_acc[1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(epochEndValLosses.length).toEqual(2);\n expect(epochEndValLosses[0]).toBeCloseTo(0.003321);\n expect(epochEndValLosses[1]).toBeCloseTo(0.011799);\n expect(epochEndValAccs.length).toEqual(2);\n expect(epochEndValAccs[0]).toBeCloseTo(1);\n expect(epochEndValAccs[1]).toBeCloseTo(1);\n });\n\n it('Earlier logs are not overwritten', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n const trainLogs: Logs[] = [];\n await model.fitDataset(dataset, {\n epochs,\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n trainLogs.push(logs);\n }\n }\n });\n expect(trainLogs.length).toEqual(2);\n // Assert that the the first log and the second logs do not overwrite each\n // other.\n expect(trainLogs[0].loss).not.toEqual(trainLogs[1].loss);\n });\n\n it('dataset.size != null feeds stepPerEpoch to callbacks', async () => {\n const batchSize = 8;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let recordedSteps: number;\n class TestCallback extends CustomCallback {\n constructor() {\n super({\n onTrainBegin: async (logs?: Logs) => {\n recordedSteps = this.params.steps as number;\n }\n });\n }\n }\n\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n const epochs = 1;\n await model.fitDataset(dataset, {epochs, callbacks: new TestCallback()});\n\n expect(dataset.size).toEqual(batchesPerEpoch);\n expect(recordedSteps).toEqual(batchesPerEpoch);\n });\n\n it('explicit stepPerEpoch overrides dataset.size for callbacks', async () => {\n const batchSize = 8;\n const numBatches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let recordedSteps: number;\n class TestCallback extends CustomCallback {\n constructor() {\n super({\n onTrainBegin: async (logs?: Logs) => {\n recordedSteps = this.params.steps as number;\n }\n });\n }\n }\n\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n const epochs = 1;\n await model.fitDataset(dataset, {\n epochs,\n batchesPerEpoch: numBatches - 1,\n callbacks: new TestCallback()\n });\n\n expect(dataset.size).toEqual(numBatches);\n expect(recordedSteps).toEqual(numBatches - 1);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n // val_xs = np.zeros([batch_size * 2, 1])\n // val_ys = np.zeros([batch_size * 2, 1])\n // val_dataset = tf.data.Dataset.from_tensor_slices(\n // (val_xs, val_ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01),\n // metrics=['accuracy'])\n //\n // class CustomCallback(tf.keras.callbacks.Callback):\n // def on_batch_end(self, batch, logs):\n // print('batch = %d; logs = %s' % (batch, logs))\n //\n // def on_epoch_end(self, epoch, logs):\n // print('epoch = %d; logs = %s' % (epoch, logs))\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // batch_size=4,\n // validation_steps=2,\n // validation_data=val_dataset,\n // callbacks=[CustomCallback()])\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('1 input, 1 output, 1 metric, dataset validation, callback, ' +\n 'with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training dataset.\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation dataset.\n const valXTensorsFunc = () =>\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1])];\n const valYTensorsFunc = () =>\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1])];\n const valDataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc: valXTensorsFunc,\n yTensorsFunc: valYTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: valDataset,\n validationBatches: batchesPerEpoch * epochs\n });\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const epochEndValLosses: number[] = [];\n const epochEndValAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: valDataset,\n validationBatches: batchesPerEpoch * epochs,\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n epochEndValLosses.push(logs.val_loss);\n epochEndValAccs.push(logs.val_acc);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'loss', 'acc', 'val_loss', 'val_acc'\n ].sort());\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011799);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1);\n expect(history.history.val_acc[1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(epochEndValLosses.length).toEqual(2);\n expect(epochEndValLosses[0]).toBeCloseTo(0.003321);\n expect(epochEndValLosses[1]).toBeCloseTo(0.011799);\n expect(epochEndValAccs.length).toEqual(2);\n expect(epochEndValAccs[0]).toBeCloseTo(1);\n expect(epochEndValAccs[1]).toBeCloseTo(1);\n });\n\n it('1 input, 1 output, 1 metric, dataset validation, callback, ' +\n 'no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training dataset.\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation dataset.\n const valXTensorsFunc = () =>\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1])];\n const valYTensorsFunc = () =>\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1]),\n tfc.zeros([batchSize, 1])];\n const valDataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc: valXTensorsFunc,\n yTensorsFunc: valYTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(dataset, {epochs, validationData: valDataset});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const epochEndValLosses: number[] = [];\n const epochEndValAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n epochs,\n validationData: valDataset,\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n epochEndValLosses.push(logs.val_loss);\n epochEndValAccs.push(logs.val_acc);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'loss', 'acc', 'val_loss', 'val_acc'\n ].sort());\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011799);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1);\n expect(history.history.val_acc[1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(epochEndValLosses.length).toEqual(2);\n expect(epochEndValLosses[0]).toBeCloseTo(0.003321);\n expect(epochEndValLosses[1]).toBeCloseTo(0.011799);\n expect(epochEndValAccs.length).toEqual(2);\n expect(epochEndValAccs[0]).toBeCloseTo(1);\n expect(epochEndValAccs[1]).toBeCloseTo(1);\n });\n\n it('Memory leak check with metric and validation, with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 3;\n const batchesPerEpoch = 3;\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs\n });\n const valXs = tfc.zeros([batchSize * 2, 1]);\n const valYs = tfc.zeros([batchSize * 2, 1]);\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(\n dataset,\n {batchesPerEpoch, epochs: 1, validationData: [valXs, valYs]});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: [valXs, valYs],\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('Memory leak check with metric and validation, no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 3;\n const batchesPerEpoch = 3;\n const dataset = new FakeNumericDataset(\n {xShape: [1], yShape: [1], batchSize, numBatches: batchesPerEpoch});\n const valXs = tfc.zeros([batchSize * 2, 1]);\n const valYs = tfc.zeros([batchSize * 2, 1]);\n\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n await model.fitDataset(\n dataset, {epochs: 1, validationData: [valXs, valYs]});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n await model.fitDataset(dataset, {\n epochs,\n validationData: [valXs, valYs],\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n }\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n // Refence Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution():\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error', optimizer='sgd',\n // metrics=['accuracy'])\n //\n // class CustomCallback(tf.keras.callbacks.Callback):\n // def on_batch_end(self, batch, logs):\n // print('batch = %d; logs = %s' % (batch, logs))\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // callbacks=[CustomCallback()])\n // print(history.history)\n // ```\n it('1 input, 1 output, 1 metric, no validation, callback, ' +\n 'with batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n let onTrainBeginCalls = 0;\n let onTrainEndCalls = 0;\n const epochBeginEpochs: number[] = [];\n const epochEndEpochs: number[] = [];\n const batchBeginBatches: number[] = [];\n const batchEndBatches: number[] = [];\n const epochEndLosses: number[] = [];\n const epochEndAccs: number[] = [];\n const batchEndLosses: number[] = [];\n const batchEndAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n callbacks: {\n onTrainBegin: async () => {\n onTrainBeginCalls++;\n },\n onTrainEnd: async () => {\n onTrainEndCalls++;\n },\n onEpochBegin: async (epoch) => {\n epochBeginEpochs.push(epoch);\n },\n onEpochEnd: async (epoch, logs) => {\n epochEndEpochs.push(epoch);\n epochEndLosses.push(logs.loss);\n epochEndAccs.push(logs.acc);\n },\n onBatchBegin: async (batch, logs) => {\n batchBeginBatches.push(batch);\n },\n onBatchEnd: async (batch, logs) => {\n batchEndBatches.push(batch);\n batchEndLosses.push(logs.loss);\n batchEndAccs.push(logs.acc);\n },\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(onTrainBeginCalls).toEqual(1);\n expect(onTrainEndCalls).toEqual(1);\n expect(epochBeginEpochs).toEqual([0, 1]);\n expect(epochEndEpochs).toEqual([0, 1]);\n expect(batchBeginBatches).toEqual([0, 1, 2, 0, 1, 2]);\n expect(batchEndBatches).toEqual([0, 1, 2, 0, 1, 2]);\n expect(epochEndLosses.length).toEqual(2);\n expect(epochEndLosses[0]).toBeCloseTo(0.923649);\n expect(epochEndLosses[1]).toBeCloseTo(0.722993);\n expect(epochEndAccs.length).toEqual(2);\n expect(epochEndAccs[0]).toBeCloseTo(0);\n expect(epochEndAccs[1]).toBeCloseTo(0);\n expectTensorsClose(\n batchEndLosses, [1, 0.9216, 0.849347, 0.782758, 0.721390, 0.664832]);\n });\n\n it('1 input, 1 output, 1 metric, no validation, callback, no batchesPerEpoch',\n async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n let onTrainBeginCalls = 0;\n let onTrainEndCalls = 0;\n const epochBeginEpochs: number[] = [];\n const epochEndEpochs: number[] = [];\n const batchBeginBatches: number[] = [];\n const batchEndBatches: number[] = [];\n const epochEndLosses: number[] = [];\n const epochEndAccs: number[] = [];\n const batchEndLosses: number[] = [];\n const batchEndAccs: number[] = [];\n const history = await model.fitDataset(dataset, {\n epochs,\n callbacks: {\n onTrainBegin: async () => {\n onTrainBeginCalls++;\n },\n onTrainEnd: async () => {\n onTrainEndCalls++;\n },\n onEpochBegin: async (epoch) => {\n epochBeginEpochs.push(epoch);\n },\n onEpochEnd: async (epoch, logs) => {\n epochEndEpochs.push(epoch);\n epochEndLosses.push(logs.loss);\n epochEndAccs.push(logs.acc);\n },\n onBatchBegin: async (batch, logs) => {\n batchBeginBatches.push(batch);\n },\n onBatchEnd: async (batch, logs) => {\n batchEndBatches.push(batch);\n batchEndLosses.push(logs.loss);\n batchEndAccs.push(logs.acc);\n },\n }\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.923649);\n expect(history.history.loss[1]).toBeCloseTo(0.722993);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n\n expect(onTrainBeginCalls).toEqual(1);\n expect(onTrainEndCalls).toEqual(1);\n expect(epochBeginEpochs).toEqual([0, 1]);\n expect(epochEndEpochs).toEqual([0, 1]);\n expect(batchBeginBatches).toEqual([0, 1, 2, 0, 1, 2]);\n expect(batchEndBatches).toEqual([0, 1, 2, 0, 1, 2]);\n expect(epochEndLosses.length).toEqual(2);\n expect(epochEndLosses[0]).toBeCloseTo(0.923649);\n expect(epochEndLosses[1]).toBeCloseTo(0.722993);\n expect(epochEndAccs.length).toEqual(2);\n expect(epochEndAccs[0]).toBeCloseTo(0);\n expect(epochEndAccs[1]).toBeCloseTo(0);\n expectTensorsClose(\n batchEndLosses, [1, 0.9216, 0.849347, 0.782758, 0.721390, 0.664832]);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // input1 = tf.keras.Input(shape = [1], name = 'x1')\n // input2 = tf.keras.Input(shape = [1], name = 'x2')\n // concat = tf.keras.layers.concatenate([input1, input2])\n // y = tf.keras.layers.Dense(\n // 1, kernel_initializer = 'zeros')(concat)\n // model = tf.keras.Model(inputs = [input1, input2], outputs = y)\n // model.compile(\n // loss = 'mean_squared_error', optimizer = 'sgd', metrics =\n // ['accuracy'])\n // model.summary()\n // print(input1.name)\n // print(input2.name)\n //\n // xs1 = np.ones([batch_size * num_batches * epochs, 1])\n // xs2 = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // ({'x1': xs1, 'x2': xs2}, ys)).batch(batch_size)\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs)\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('2 inputs, 1 output, 1 metric, no validation, with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n it('2 inputs, 1 output, 1 metric, no validation, no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss', 'acc']);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // input1 = tf.keras.Input(shape = [1], name = 'x1')\n // input2 = tf.keras.Input(shape = [1], name = 'x2')\n // concat = tf.keras.layers.concatenate([input1, input2])\n // y = tf.keras.layers.Dense(\n // 1, kernel_initializer = 'zeros')(concat)\n // model = tf.keras.Model(inputs = [input1, input2], outputs = y)\n // model.compile(\n // loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01),\n // metrics=['accuracy'])\n // model.summary()\n // print(input1.name)\n // print(input2.name)\n //\n // xs1 = np.ones([batch_size * num_batches * epochs, 1])\n // xs2 = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // ({'x1': xs1, 'x2': xs2}, ys)).batch(batch_size)\n //\n // val_xs = [np.zeros([batch_size, 1]),\n // np.zeros([batch_size, 1])]\n // val_ys = np.zeros([batch_size, 1])\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // batch_size=batch_size,\n // validation_data=[val_xs, val_ys])\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('2 inputs, 1 output, 1 metric, tensor array validation, ' +\n 'with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs: tfc.Tensor[] =\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1])];\n const valYs = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors\n // (for the memory-leak check below).\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'acc', 'loss', 'val_acc', 'val_loss'\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003189);\n expect(history.history.val_loss[1]).toBeCloseTo(0.010687);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1.0);\n expect(history.history.val_acc[1]).toBeCloseTo(1.0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n it('2 inputs, 1 output, 1 metric, tensor array validation, ' +\n 'no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs: tfc.Tensor[] =\n [tfc.zeros([batchSize, 1]), tfc.zeros([batchSize, 1])];\n const valYs = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'acc', 'loss', 'val_acc', 'val_loss'\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003189);\n expect(history.history.val_loss[1]).toBeCloseTo(0.010687);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1.0);\n expect(history.history.val_acc[1]).toBeCloseTo(1.0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // input1 = tf.keras.Input(shape = [1], name = 'x1')\n // input2 = tf.keras.Input(shape = [1], name = 'x2')\n // concat = tf.keras.layers.concatenate([input1, input2])\n // y = tf.keras.layers.Dense(\n // 1, kernel_initializer = 'zeros')(concat)\n // model = tf.keras.Model(inputs = [input1, input2], outputs = y)\n // model.compile(\n // loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01),\n // metrics=['accuracy'])\n // model.summary()\n // print(input1.name)\n // print(input2.name)\n //\n // xs1 = np.ones([batch_size * num_batches * epochs, 1])\n // xs2 = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // ({'x1': xs1, 'x2': xs2}, ys)).batch(batch_size)\n //\n // val_xs = {\n // 'x1': np.zeros([batch_size, 1]),\n // 'x2': np.zeros([batch_size, 1])\n // }\n // val_ys = np.zeros([batch_size, 1])\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // batch_size=batch_size,\n // validation_data=[val_xs, val_ys])\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // ```\n it('2 input, 1 output, 1 metric, tensor array validation, ' +\n 'with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs: tfc.NamedTensorMap = {};\n valXs[input1.name] = tfc.zeros([batchSize, 1]);\n valXs[input2.name] = tfc.zeros([batchSize, 1]);\n const valYs = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'acc', 'loss', 'val_acc', 'val_loss'\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003189);\n expect(history.history.val_loss[1]).toBeCloseTo(0.010687);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1.0);\n expect(history.history.val_acc[1]).toBeCloseTo(1.0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n it('2 input, 1 output, 1 metric, tensor array validation, ' +\n 'no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs: tfc.NamedTensorMap = {};\n valXs[input1.name] = tfc.zeros([batchSize, 1]);\n valXs[input2.name] = tfc.zeros([batchSize, 1]);\n const valYs = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history).sort()).toEqual([\n 'acc', 'loss', 'val_acc', 'val_loss'\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.888116);\n expect(history.history.loss[1]).toBeCloseTo(0.612685);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0);\n expect(history.history.acc[1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003189);\n expect(history.history.val_loss[1]).toBeCloseTo(0.010687);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1.0);\n expect(history.history.val_acc[1]).toBeCloseTo(1.0);\n expectTensorsClose(model.getWeights()[0], [0.103377, 0.103377]);\n expectTensorsClose(model.getWeights()[1], [0.103377]);\n });\n\n it('2 input, 1 missing input in dataset, with batchesPerEpoch', async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n // Note: input2 is missing from the data, by intention.\n return output;\n };\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'The feature data generated by the dataset lacks the required ' +\n `input key '${input2.name}'.`);\n });\n\n it('2 input, 1 missing input in dataset, no batchesPerEpoch', async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n // Note: input2 is missing from the data, by intention.\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {epochs});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'The feature data generated by the dataset lacks the required ' +\n `input key '${input2.name}'.`);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // x = tf.keras.Input(shape=[1], name='x')\n //\n // output1 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(x)\n // output2 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(x)\n //\n // model = tf.keras.Model(inputs=x, outputs=[output1, output2])\n // model.compile(\n // loss = 'mean_squared_error', optimizer = 'sgd', metrics =\n // ['accuracy'])\n // model.summary()\n // output1_name = model.output_names[0]\n // output2_name = model.output_names[1]\n // print(output1_name)\n // print(output2_name)\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys1 = np.ones([batch_size * num_batches * epochs, 1])\n // ys2 = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // (xs, {output1_name: ys1, output2_name: ys2})).batch(batch_size)\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs)\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // print(model.get_weights()[2])\n // print(model.get_weights()[3])\n // ```\n it('1 input, 2 outputs, 1 metric, no validation, with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([\n tfc.zeros([1, 1]), tfc.zeros([1]), tfc.zeros([1, 1]), tfc.zeros([1])\n ]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n\n expect(Object.keys(history.history)).toEqual([\n 'loss', output1LossName, output2LossName, output1AccName,\n output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.847297);\n expect(history.history.loss[1]).toBeCloseTo(1.445986);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n expectTensorsClose(model.getWeights()[2], [0.108621]);\n expectTensorsClose(model.getWeights()[3], [0.108621]);\n });\n\n it('1 input, 2 outputs, 1 metric, no validation, no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([\n tfc.zeros([1, 1]), tfc.zeros([1]), tfc.zeros([1, 1]), tfc.zeros([1])\n ]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {epochs});\n\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n\n expect(Object.keys(history.history)).toEqual([\n 'loss', output1LossName, output2LossName, output1AccName,\n output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.847297);\n expect(history.history.loss[1]).toBeCloseTo(1.445986);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n expectTensorsClose(model.getWeights()[2], [0.108621]);\n expectTensorsClose(model.getWeights()[3], [0.108621]);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // x = tf.keras.Input(shape=[1], name='x')\n //\n // output1 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(x)\n // output2 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(x)\n //\n // model = tf.keras.Model(inputs=x, outputs=[output1, output2])\n // model.compile(\n // loss = 'mean_squared_error', optimizer = 'sgd', metrics =\n // ['accuracy'])\n // model.summary()\n // output1_name = model.output_names[0]\n // output2_name = model.output_names[1]\n // print(output1_name)\n // print(output2_name)\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys1 = np.ones([batch_size * num_batches * epochs, 1])\n // ys2 = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // (xs, {output1_name: ys1, output2_name: ys2})).batch(batch_size)\n //\n // val_xs = np.zeros([batch_size, 1])\n // val_ys = {output1_name: np.zeros([batch_size, 1]),\n // output1_name: np.zeros([batch_size, 1])}\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // validation_data=[val_xs, val_ys])\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // print(model.get_weights()[2])\n // print(model.get_weights()[3])\n // ```\n it('1 input, 2 outputs, 1 metric, tensor array validation, ' +\n 'with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs = tfc.zeros([batchSize, 1]);\n const valYs: tfc.NamedTensorMap = {};\n valYs[model.outputNames[0]] = tfc.zeros([batchSize, 1]);\n valYs[model.outputNames[1]] = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([\n tfc.zeros([1, 1]), tfc.zeros([1]), tfc.zeros([1, 1]), tfc.zeros([1])\n ]);\n\n const history = await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n const valOutput1AccName = 'val_' + output1AccName;\n const valOutput1LossName = 'val_' + output1LossName;\n const valOutput2AccName = 'val_' + output2AccName;\n const valOutput2LossName = 'val_' + output2LossName;\n\n expect(Object.keys(history.history)).toEqual([\n 'val_loss', valOutput1LossName, valOutput2LossName, valOutput1AccName,\n valOutput2AccName, 'loss', output1LossName, output2LossName,\n output1AccName, output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.847297);\n expect(history.history.loss[1]).toBeCloseTo(1.445986);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput1LossName].length).toEqual(2);\n expect(history.history[valOutput1LossName][0]).toBeCloseTo(0.006642);\n expect(history.history[valOutput1LossName][1]).toBeCloseTo(0.023597);\n expect(history.history[valOutput2LossName].length).toEqual(2);\n expect(history.history[valOutput2LossName][0]).toBeCloseTo(0.003321);\n expect(history.history[valOutput2LossName][1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput1AccName].length).toEqual(2);\n expect(history.history[valOutput1AccName][0]).toBeCloseTo(0.003321);\n expect(history.history[valOutput1AccName][1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput2AccName].length).toEqual(2);\n expect(history.history[valOutput2AccName][0]).toBeCloseTo(1);\n expect(history.history[valOutput2AccName][1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n expectTensorsClose(model.getWeights()[2], [0.108621]);\n expectTensorsClose(model.getWeights()[3], [0.108621]);\n });\n\n it('1 input, 2 outputs, 1 metric, tensor array validation, ' +\n 'no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Validation data.\n const valXs = tfc.zeros([batchSize, 1]);\n const valYs: tfc.NamedTensorMap = {};\n valYs[model.outputNames[0]] = tfc.zeros([batchSize, 1]);\n valYs[model.outputNames[1]] = tfc.zeros([batchSize, 1]);\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {\n epochs: 1,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n model.setWeights([\n tfc.zeros([1, 1]), tfc.zeros([1]), tfc.zeros([1, 1]), tfc.zeros([1])\n ]);\n\n const history = await model.fitDataset(dataset, {\n epochs,\n validationData: [valXs, valYs],\n validationBatchSize: batchSize\n });\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n const valOutput1AccName = 'val_' + output1AccName;\n const valOutput1LossName = 'val_' + output1LossName;\n const valOutput2AccName = 'val_' + output2AccName;\n const valOutput2LossName = 'val_' + output2LossName;\n\n expect(Object.keys(history.history)).toEqual([\n 'val_loss', valOutput1LossName, valOutput2LossName, valOutput1AccName,\n valOutput2AccName, 'loss', output1LossName, output2LossName,\n output1AccName, output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.847297);\n expect(history.history.loss[1]).toBeCloseTo(1.445986);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.923648);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.722993);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.003321);\n expect(history.history.val_loss[1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput1LossName].length).toEqual(2);\n expect(history.history[valOutput1LossName][0]).toBeCloseTo(0.006642);\n expect(history.history[valOutput1LossName][1]).toBeCloseTo(0.023597);\n expect(history.history[valOutput2LossName].length).toEqual(2);\n expect(history.history[valOutput2LossName][0]).toBeCloseTo(0.003321);\n expect(history.history[valOutput2LossName][1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput1AccName].length).toEqual(2);\n expect(history.history[valOutput1AccName][0]).toBeCloseTo(0.003321);\n expect(history.history[valOutput1AccName][1]).toBeCloseTo(0.011798);\n expect(history.history[valOutput2AccName].length).toEqual(2);\n expect(history.history[valOutput2AccName][0]).toBeCloseTo(1);\n expect(history.history[valOutput2AccName][1]).toBeCloseTo(1);\n expectTensorsClose(model.getWeights()[0], [0.108621]);\n expectTensorsClose(model.getWeights()[1], [0.108621]);\n expectTensorsClose(model.getWeights()[2], [0.108621]);\n expectTensorsClose(model.getWeights()[3], [0.108621]);\n });\n\n it('2 outputs, 1 missing output in dataset, with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'The feature data generated by the dataset lacks the required ' +\n `output key '${model.outputNames[1]}'.`);\n });\n\n it('2 outputs, 1 missing output in dataset, no batchesPerEpoch', async () => {\n // Create a functional model with 2 outputs.\n const x = tfl.layers.input({shape: [1]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros'}).apply(x) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: x, outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {epochs});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'The feature data generated by the dataset lacks the required ' +\n `output key '${model.outputNames[1]}'.`);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // input1 = tf.keras.Input(shape=[1], name='x1')\n // input2 = tf.keras.Input(shape=[1], name='x2')\n // concat = tf.keras.layers.concatenate([input1, input2])\n //\n // output1 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(concat)\n // output2 = tf.keras.layers.Dense(\n // 1, kernel_initializer='zeros')(concat)\n //\n // model = tf.keras.Model(\n // inputs=[input1, input2],\n // outputs=[output1, output2])\n // model.compile(\n // loss = 'mean_squared_error', optimizer = 'sgd', metrics =\n // ['accuracy'])\n // model.summary()\n // output1_name = model.output_names[0]\n // output2_name = model.output_names[1]\n // print(x1)\n // print(x2)\n // print(output1_name)\n // print(output2_name)\n //\n // xs1 = np.ones([batch_size * num_batches * epochs, 1])\n // xs2 = np.ones([batch_size * num_batches * epochs, 1])\n // ys1 = np.ones([batch_size * num_batches * epochs, 1])\n // ys2 = np.ones([batch_size * num_batches * epochs, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // ({\n // x1: xs1,\n // x2: xs2\n // },{\n // output1_name: ys1,\n // output2_name: ys2\n // })).batch(batch_size)\n //\n // history = model.fit(dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs)\n // print(history.history)\n // print(model.get_weights()[0])\n // print(model.get_weights()[1])\n // print(model.get_weights()[2])\n // print(model.get_weights()[3])\n // ```\n it('2 inputs, 2 outputs, 1 metric, no validation, with batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs and 2 outputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const output1 = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const output2 = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([\n tfc.zeros([2, 1]), tfc.zeros([1]), tfc.zeros([2, 1]), tfc.zeros([1])\n ]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n\n expect(Object.keys(history.history)).toEqual([\n 'loss', output1LossName, output2LossName, output1AccName,\n output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.776232);\n expect(history.history.loss[1]).toBeCloseTo(1.225369);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.888116);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.612684);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.888116);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.612684);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.103376, 0.103376]);\n expectTensorsClose(model.getWeights()[1], [0.103376]);\n expectTensorsClose(model.getWeights()[2], [0.103376, 0.103376]);\n expectTensorsClose(model.getWeights()[3], [0.103376]);\n });\n\n it('2 inputs, 2 outputs, 1 metric, no validation, no batchesPerEpoch',\n async () => {\n // Create a functional model with 2 inputs and 2 outputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const output1 = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const output2 = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training data.\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[model.outputNames[0]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n\n const yShape: {[name: string]: number[]} = {};\n yShape[model.outputNames[0]] = [1];\n yShape[model.outputNames[1]] = [1];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape,\n batchSize,\n numBatches: batchesPerEpoch,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {epochs: 1});\n model.setWeights([\n tfc.zeros([2, 1]), tfc.zeros([1]), tfc.zeros([2, 1]), tfc.zeros([1])\n ]);\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fitDataset(dataset, {epochs});\n\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n const output1AccName = model.outputNames[0] + '_acc';\n const output1LossName = model.outputNames[0] + '_loss';\n const output2AccName = model.outputNames[1] + '_acc';\n const output2LossName = model.outputNames[1] + '_loss';\n\n expect(Object.keys(history.history)).toEqual([\n 'loss', output1LossName, output2LossName, output1AccName,\n output2AccName\n ]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(1.776232);\n expect(history.history.loss[1]).toBeCloseTo(1.225369);\n expect(history.history[output1LossName].length).toEqual(2);\n expect(history.history[output1LossName][0]).toBeCloseTo(0.888116);\n expect(history.history[output1LossName][1]).toBeCloseTo(0.612684);\n expect(history.history[output2LossName].length).toEqual(2);\n expect(history.history[output2LossName][0]).toBeCloseTo(0.888116);\n expect(history.history[output2LossName][1]).toBeCloseTo(0.612684);\n expect(history.history[output1AccName].length).toEqual(2);\n expect(history.history[output1AccName][0]).toBeCloseTo(0);\n expect(history.history[output1AccName][1]).toBeCloseTo(0);\n expect(history.history[output2AccName].length).toEqual(2);\n expect(history.history[output2AccName][0]).toBeCloseTo(0);\n expect(history.history[output2AccName][1]).toBeCloseTo(0);\n expectTensorsClose(model.getWeights()[0], [0.103376, 0.103376]);\n expectTensorsClose(model.getWeights()[1], [0.103376]);\n expectTensorsClose(model.getWeights()[2], [0.103376, 0.103376]);\n expectTensorsClose(model.getWeights()[3], [0.103376]);\n });\n\n it('Exhausting iterator with batchesPerEpoch throws warning', async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const batchSize = 8;\n const batchesPerEpoch = 3;\n const dataset = new FakeNumericDataset(\n {xShape: [1], yShape: [1], batchSize, numBatches: batchesPerEpoch});\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1});\n model.setWeights([tfc.zeros([1, 1]), tfc.zeros([1])]);\n const warningMessages: string[] = [];\n spyOn(console, 'warn')\n .and.callFake((msg: string) => warningMessages.push(msg));\n const numTensors0 = tfc.memory().numTensors;\n const epochs = 3;\n const history = await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n expect(Object.keys(history.history)).toEqual(['loss']);\n // Only the loss value from the first epoch should be logged.\n // The 2nd and 3rd epochs are cut short because of dataset iterator\n // exhaustion.\n expect(history.history.loss.length).toEqual(1);\n expect(warningMessages.length).toEqual(2);\n expect(warningMessages[0])\n .toMatch(/You provided `batchesPerEpoch` as .* 9 batches/);\n expect(warningMessages[1])\n .toMatch(/You provided `batchesPerEpoch` as .* 9 batches/);\n });\n\n it('Calling fitDataset() without calling compile() errors', async () => {\n const model = createDenseModel();\n\n const batchSize = 8;\n const numBatches = 3;\n const epochs = 2;\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches,\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {epochs});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual('The model needs to be compiled before being used.');\n });\n\n it('Wrong validationBatches leads to Error', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n // Training dataset.\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs\n });\n // Validation dataset.\n const valDataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs\n });\n // Do a burn-in call to account for initialization of cached\n // tensors (for the memory-leak check below).\n let errorCaught: Error;\n try {\n await model.fitDataset(dataset, {\n batchesPerEpoch,\n epochs,\n validationData: valDataset,\n validationBatches: 0\n });\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toMatch(/fitDataset.*dataset-based validation.*not to be provided.*0/);\n });\n\n it('Calling fitDataset with validationSplit leads to Error', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 3;\n\n // Training dataset.\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs\n });\n\n let errorCaught: Error;\n try {\n await model.fitDataset(\n dataset,\n // tslint:disable-next-line:no-any\n {epochs: 1, batchesPerEpoch: 2, validationSplit: 0.25} as any);\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toMatch(/.*validationSplit.*not supported.*validationData/);\n });\n\n class StopAfterNBatches extends tfl.Callback {\n private readonly batchesToTrain: number;\n constructor(epochsToTrain: number) {\n super();\n this.batchesToTrain = epochsToTrain;\n }\n\n async onBatchEnd(batch: number, logs?: Logs) {\n if (batch === this.batchesToTrain - 1) {\n this.model.stopTraining = true;\n }\n }\n }\n\n it('Stop training resets at start of LayersModel.fitDataset()', async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const epochs = 2;\n const batchesPerEpoch = 1;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n // Order 2 epochs of training, but the training should stop after only one\n // epochs due to the callback that orders the training to stop after one\n // batches.\n let history = await model.fitDataset(\n dataset,\n {batchesPerEpoch, epochs, callbacks: [new StopAfterNBatches(1)]});\n expect(history.history.loss.length).toEqual(1);\n\n // Running fitDataset again should now run to completion\n history = await model.fitDataset(dataset, {batchesPerEpoch, epochs});\n expect(history.history.loss.length).toEqual(2);\n });\n\n it('onYield with yieldEvery: auto', async () => {\n const wait = DEFAULT_YIELD_EVERY_MS;\n const timeBetweenCalls = [\n 0,\n 1,\n 1,\n wait + 1, // Should call.\n wait + 1, // Should call.\n 1,\n 1,\n ];\n let counter = 0;\n let prevTime = 0;\n spyOn(util, 'now').and.callFake(() => {\n prevTime += timeBetweenCalls[counter++];\n return prevTime;\n });\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const epochs = 2;\n const batchSize = 8;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n ];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n ];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: 3,\n xTensorsFunc,\n yTensorsFunc,\n });\n const onYieldEpochIds: number[] = [];\n const onYieldBatchesIds: number[] = [];\n\n const history = await model.fitDataset(dataset, {\n epochs,\n callbacks: {\n onYield: async (epoch, batch, _logs) => {\n onYieldBatchesIds.push(batch);\n onYieldEpochIds.push(epoch);\n }\n }\n });\n expect(history.history.loss.length).toEqual(epochs);\n // There are 5 batches in total (1 batch per epoch). We expect next frame\n // to be called twice, after epoch 1 and after epoch 2.\n expect(nextFrameCallCount).toBe(2);\n expect(onYieldEpochIds).toEqual([0, 1]);\n expect(onYieldBatchesIds).toEqual([2, 0]);\n });\n\n it('fails when onYield is provided, but yieldEvery is never', async done => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const epochs = 2;\n const batchSize = 8;\n const xTensorsFunc = () =>\n [tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n ];\n const yTensorsFunc = () =>\n [tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1]),\n ];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: 3,\n xTensorsFunc,\n yTensorsFunc,\n });\n try {\n await model.fitDataset(dataset, {\n epochs,\n yieldEvery: 'never',\n callbacks: {onYield: async (_epoch, _batch, _logs) => {}},\n });\n done.fail('Model.fit should fail');\n } catch {\n done();\n }\n });\n});\n\n// TODO(cais): The corresponding test for predict() and evaluate().\n\ndescribeMathCPUAndGPU('LayersModel.evaluateDataset', () => {\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n //\n // xs = np.ones([batch_size * num_batches, 1])\n // ys = np.ones([batch_size * num_batches, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01))\n //\n // out = model.evaluate(dataset, steps=3, verbose=0)\n // print(out)\n // ```\n it('1 input, 1 output, no metric, with batches specified', async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n tfc.dispose(\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar[]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut =\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar;\n const expectedLoss = tfc.scalar(1.0);\n expectTensorsClose(evalOut, expectedLoss);\n tfc.dispose(evalOut);\n tfc.dispose(expectedLoss);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('1 input, 1 output, no metric, no batches specified', async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n tfc.dispose(await model.evaluateDataset(dataset, {}) as tfc.Scalar[]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut = await model.evaluateDataset(dataset, {}) as tfc.Scalar;\n const expectedLoss = tfc.scalar(1.0);\n expectTensorsClose(evalOut, expectedLoss);\n tfc.dispose(evalOut);\n tfc.dispose(expectedLoss);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n //\n // xs = np.ones([batch_size * num_batches, 1])\n // ys = np.ones([batch_size * num_batches, 1])\n // dataset = tf.data.Dataset.from_tensor_slices((xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01),\n // metrics=['accuracy'])\n //\n // out = model.evaluate(dataset, steps=3, verbose=0)\n // print(out)\n // ```\n it('1 input, 1 output, 1 metric, with batches specified', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc']});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n tfc.dispose(\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar[]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut =\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar[];\n expect(evalOut.length).toEqual(2);\n const expectedLoss = tfc.scalar(1.0);\n const expectedAcc = tfc.scalar(0.0);\n expectTensorsClose(evalOut[0], expectedLoss);\n expectTensorsClose(evalOut[1], expectedAcc);\n tfc.dispose(evalOut);\n tfc.dispose([expectedLoss, expectedAcc]);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('1 input, 1 output, 1 metric, no batches specified', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc']});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n tfc.dispose(await model.evaluateDataset(dataset, {}) as tfc.Scalar[]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut = await model.evaluateDataset(dataset, {}) as tfc.Scalar[];\n expect(evalOut.length).toEqual(2);\n const expectedLoss = tfc.scalar(1.0);\n const expectedAcc = tfc.scalar(0.0);\n expectTensorsClose(evalOut[0], expectedLoss);\n expectTensorsClose(evalOut[1], expectedAcc);\n tfc.dispose(evalOut);\n tfc.dispose([expectedLoss, expectedAcc]);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('1 input, 1 output, 1 metric, no batches, only 1 arg', async () => {\n const model = createDenseModel();\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc']});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below). Use 1-arg call.\n tfc.dispose(await model.evaluateDataset(dataset) as tfc.Scalar[]);\n\n const numTensors0 = tfc.memory().numTensors;\n // Use 1-arg call, omitting the config object.\n const evalOut = await model.evaluateDataset(dataset) as tfc.Scalar[];\n expect(evalOut.length).toEqual(2);\n const expectedLoss = tfc.scalar(1.0);\n const expectedAcc = tfc.scalar(0.0);\n expectTensorsClose(evalOut[0], expectedLoss);\n expectTensorsClose(evalOut[1], expectedAcc);\n tfc.dispose(evalOut);\n tfc.dispose([expectedLoss, expectedAcc]);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('1 input, 1 output, iterator exhaustion with batches', async () => {\n const model = createDenseModel();\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 8;\n const batches = 3;\n const dataset = new FakeNumericDataset(\n {xShape: [1], yShape: [1], batchSize, numBatches: batches});\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n tfc.dispose(\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar[]);\n\n const warningMessages: string[] = [];\n spyOn(console, 'warn')\n .and.callFake((msg: string) => warningMessages.push(msg));\n\n const numTensors0 = tfc.memory().numTensors;\n tfc.dispose(await model.evaluateDataset(dataset, {batches: batches + 2}));\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n expect(warningMessages.length).toEqual(1);\n expect(warningMessages[0])\n .toMatch(\n /dataset iterator ran out of data during evaluate.* 5 batches/);\n });\n\n // Reference Python tf.keras code:\n //\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // batch_size = 8\n // num_batches = 3\n //\n // xs1 = np.ones([batch_size * num_batches, 1])\n // xs2 = np.ones([batch_size * num_batches, 1])\n // ys = np.ones([batch_size * num_batches, 1])\n // dataset = tf.data.Dataset.from_tensor_slices(\n // ({'input1': xs1, 'input2': xs2}, ys)).batch(batch_size)\n //\n // input1 = tf.keras.Input(shape=[1], name='input1')\n // input2 = tf.keras.Input(shape=[1], name='input2')\n // concat = tf.keras.layers.concatenate([input1, input2])\n // output = tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // kernel_initializer='zeros').apply(concat)\n // model = tf.keras.Model(inputs=[input1, input2], outputs=output)\n // model.compile(loss='mean_squared_error',\n // optimizer=tf.train.GradientDescentOptimizer(0.01),\n // metrics=['accuracy'])\n //\n // out = model.evaluate(dataset, steps=3, verbose=0)\n // print(out)\n // ```\n it('2 inputs, 1 output, 1 metric, no validation, with batches specified',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.evaluateDataset(dataset, {batches});\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut =\n await model.evaluateDataset(dataset, {batches}) as tfc.Scalar[];\n const expectedLoss = tfc.scalar(1.0);\n const expectedAcc = tfc.scalar(0.0);\n expectTensorsClose(evalOut[0], expectedLoss);\n expectTensorsClose(evalOut[1], expectedAcc);\n tfc.dispose(evalOut);\n tfc.dispose([expectedLoss, expectedAcc]);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('2 inputs, 1 output, 1 metric, no validation, no batches specified',\n async () => {\n // Create a functional model with 2 inputs.\n const input1 = tfl.layers.input({shape: [1]});\n const input2 = tfl.layers.input({shape: [1]});\n const concat = tfl.layers.concatenate().apply([input1, input2]);\n const y = tfl.layers.dense({units: 1, kernelInitializer: 'zeros'})\n .apply(concat) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['accuracy']});\n\n const batchSize = 8;\n const batches = 3;\n const xTensorsFunc = () => {\n const output: {[name: string]: tfc.Tensor[]} = {};\n output[input1.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n output[input2.name] = [\n tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]),\n tfc.ones([batchSize, 1])\n ];\n return output;\n };\n const yTensorsFunc =\n () => [tfc.ones([batchSize, 1]), tfc.ones([batchSize, 1]), tfc.ones([\n batchSize, 1\n ])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batches,\n xTensorsFunc,\n yTensorsFunc\n });\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.evaluateDataset(dataset, {});\n model.setWeights([tfc.zeros([2, 1]), tfc.zeros([1])]);\n\n const numTensors0 = tfc.memory().numTensors;\n const evalOut = await model.evaluateDataset(dataset, {}) as tfc.Scalar[];\n const expectedLoss = tfc.scalar(1.0);\n const expectedAcc = tfc.scalar(0.0);\n expectTensorsClose(evalOut[0], expectedLoss);\n expectTensorsClose(evalOut[1], expectedAcc);\n tfc.dispose(evalOut);\n tfc.dispose([expectedLoss, expectedAcc]);\n const numTensors1 = tfc.memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\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-layers/dist/engine/training_tensors.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.d.ts deleted file mode 100644 index 5a101a943..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor, Tensor1D } from '@tensorflow/tfjs-core'; -import { BaseCallback, CustomCallbackArgs, History, ModelLoggingVerbosity, YieldEveryOptions } from '../base_callbacks'; -import { ClassWeight, ClassWeightMap } from './training_utils'; -/** - * Interface configuration model training based on data as `tf.Tensor`s. - */ -export interface ModelFitArgs { - /** - * Number of samples per gradient update. If unspecified, it - * will default to 32. - */ - batchSize?: number; - /** - * Integer number of times to iterate over the training data arrays. - */ - epochs?: number; - /** - * Verbosity level. - * - * Expected to be 0, 1, or 2. Default: 1. - * - * 0 - No printed message during fit() call. - * 1 - In Node.js (tfjs-node), prints the progress bar, together with - * real-time updates of loss and metric values and training speed. - * In the browser: no action. This is the default. - * 2 - Not implemented yet. - */ - verbose?: ModelLoggingVerbosity; - /** - * List of callbacks to be called during training. - * Can have one or more of the following callbacks: - * - `onTrainBegin(logs)`: called when training starts. - * - `onTrainEnd(logs)`: called when training ends. - * - `onEpochBegin(epoch, logs)`: called at the start of every epoch. - * - `onEpochEnd(epoch, logs)`: called at the end of every epoch. - * - `onBatchBegin(batch, logs)`: called at the start of every batch. - * - `onBatchEnd(batch, logs)`: called at the end of every batch. - * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds - * with the current epoch, batch and logs. The logs are the same - * as in `onBatchEnd()`. Note that `onYield` can skip batches or - * epochs. See also docs for `yieldEvery` below. - */ - callbacks?: BaseCallback[] | CustomCallbackArgs | CustomCallbackArgs[]; - /** - * Float between 0 and 1: fraction of the training data - * to be used as validation data. The model will set apart this fraction of - * the training data, will not train on it, and will evaluate the loss and - * any model metrics on this data at the end of each epoch. - * The validation data is selected from the last samples in the `x` and `y` - * data provided, before shuffling. - */ - validationSplit?: number; - /** - * Data on which to evaluate the loss and any model - * metrics at the end of each epoch. The model will not be trained on this - * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal, - * valSampleWeights]. The model will not be trained on this data. - * `validationData` will override `validationSplit`. - */ - validationData?: [Tensor | Tensor[], Tensor | Tensor[]] | [Tensor | Tensor[], Tensor | Tensor[], Tensor | Tensor[]]; - /** - * Whether to shuffle the training data before each epoch. Has - * no effect when `stepsPerEpoch` is not `null`. - */ - shuffle?: boolean; - /** - * Optional object mapping class indices (integers) to - * a weight (float) to apply to the model's loss for the samples from this - * class during training. This can be useful to tell the model to "pay more - * attention" to samples from an under-represented class. - * - * If the model has multiple outputs, a class weight can be specified for - * each of the outputs by setting this field an array of weight object - * or a object that maps model output names (e.g., `model.outputNames[0]`) - * to weight objects. - */ - classWeight?: ClassWeight | ClassWeight[] | ClassWeightMap; - /** - * Optional array of the same length as x, containing - * weights to apply to the model's loss for each sample. In the case of - * temporal data, you can pass a 2D array with shape (samples, - * sequenceLength), to apply a different weight to every timestep of every - * sample. In this case you should make sure to specify - * sampleWeightMode="temporal" in compile(). - */ - sampleWeight?: Tensor; - /** - * Epoch at which to start training (useful for resuming a previous training - * run). When this is used, `epochs` is the index of the "final epoch". - * The model is not trained for a number of iterations given by `epochs`, - * but merely until the epoch of index `epochs` is reached. - */ - initialEpoch?: number; - /** - * Total number of steps (batches of samples) before - * declaring one epoch finished and starting the next epoch. When training - * with Input Tensors such as TensorFlow data tensors, the default `null` is - * equal to the number of unique samples in your dataset divided by the - * batch size, or 1 if that cannot be determined. - */ - stepsPerEpoch?: number; - /** - * Only relevant if `stepsPerEpoch` is specified. Total number of steps - * (batches of samples) to validate before stopping. - */ - validationSteps?: number; - /** - * Configures the frequency of yielding the main thread to other tasks. - * - * In the browser environment, yielding the main thread can improve the - * responsiveness of the page during training. In the Node.js environment, - * it can ensure tasks queued in the event loop can be handled in a timely - * manner. - * - * The value can be one of the following: - * - `'auto'`: The yielding happens at a certain frame rate (currently set - * at 125ms). This is the default. - * - `'batch'`: yield every batch. - * - `'epoch'`: yield every epoch. - * - any `number`: yield every `number` milliseconds. - * - `'never'`: never yield. (yielding can still happen through `await - * nextFrame()` calls in custom callbacks.) - */ - yieldEvery?: YieldEveryOptions; -} -export declare function checkBatchSize(batchSize: number): void; -/** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ -export declare function sliceArrays(arrays: Tensor | Tensor[], start: number, stop: number): Tensor | Tensor[]; -/** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ -export declare function sliceArraysByIndices(arrays: Tensor | Tensor[], indices: Tensor1D): Tensor | Tensor[]; -/** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ -export declare function makeBatches(size: number, batchSize: number): Array<[number, number]>; -export declare function fitTensors(model: any, x: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}, args?: ModelFitArgs): Promise; -/** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ -export declare function ensureTensorsRank2OrHigher(tensors: Tensor | Tensor[]): Tensor[]; -/** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ -export declare function disposeNewTensors(tensors: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}, refTensors: Tensor | Tensor[] | { - [inputName: string]: Tensor; -}): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js deleted file mode 100644 index 27dc87ff6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js +++ /dev/null @@ -1,437 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Interfaces and methods for training models using tf.Tensor objects. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { Tensor, tensor1d, util } from '@tensorflow/tfjs-core'; -import { expandDims, gather, sliceAlongFirstAxis } from '../backend/tfjs_backend'; -import { configureCallbacks, standardizeCallbacks } from '../base_callbacks'; -import { NotImplementedError, ValueError } from '../errors'; -import { disposeTensorsInLogs } from '../logs'; -import { range } from '../utils/math_utils'; -export function checkBatchSize(batchSize) { - tfc.util.assert(batchSize > 0 && Number.isInteger(batchSize), () => `batchSize is required to be a positive integer, but got ${batchSize}`); -} -/** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ -export function sliceArrays(arrays, start, stop) { - if (arrays == null) { - return [null]; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start)); - } - else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } -} -/** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ -export function sliceArraysByIndices(arrays, indices) { - return tfc.tidy(() => { - if (arrays == null) { - return null; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceArraysByIndices(array, indices)); - } - else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); -} -/** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ -export function makeBatches(size, batchSize) { - const output = []; - let batchStart = 0; - let batchEnd = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; -} -/** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ -async function fitLoop( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - // TODO(cais): Change const to let below when implementing validation. - let doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - const numTrainSamples = model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - let indexArray; - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - if (verbose == null) { - verbose = 1; - } - const { callbackList, history } = configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - // TODO(cais): Take care of callbacks.validation_data as in PyKeras. - // TODO(cais): Pre-convert feeds for performance as in PyKeras. - for (let epoch = initialEpoch; epoch < epochs; ++epoch) { - await callbackList.onEpochBegin(epoch); - const epochLogs = {}; - if (stepsPerEpoch != null) { - throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); - } - else { - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } - else if (shuffle) { - util.shuffle(indexArray); - } - // Convert the potentially shuffled indices to Tensor1D, to avoid the - // cost of repeated creation of Array1Ds later on. - const epochIndexArray1D = tensor1d(indexArray); - const batches = makeBatches(numTrainSamples, batchSize); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchLogs = {}; - await callbackList.onBatchBegin(batchIndex, batchLogs); - tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis(epochIndexArray1D, batchStart, batchEnd - batchStart); - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const outs = f(insBatch); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - if (batchIndex === batches.length - 1) { // Last batch. - if (doValidation) { - const valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = valOuts[i]; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - if (model.stopTraining_) { - break; - } - // TODO(cais): return outs as list of Tensor. - } - epochIndexArray1D.dispose(); - } - // TODO(cais): Run validation at the end of the epoch. - await callbackList.onEpochEnd(epoch, epochLogs); - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; -} -export async function fitTensors( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, x, y, args = {}) { - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - let inputs; - let targets; - let inputValX; - let inputValY; - let valX; - let valY; - let sampleWeights; - try { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // Validate user data. - // TODO(cais): Support sampleWeight. - const checkBatchAxis = false; - const standardizedOuts = await model.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize); - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - // Prepare validation data. - let doValidation = false; - let valIns; - if (args.validationData != null && args.validationData.length > 0) { - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } - else if (args.validationData.length === 3) { - throw new NotImplementedError('validationData including sample weights is not supported yet.'); - } - else { - throw new ValueError(`When passing validation data, it must contain 2 (valX, valY) ` + - `or 3 (valX, valY, valSampleWeight) items; ` + - `${args.validationData} is invalid.`); - } - const checkBatchAxis = true; - const valStandardized = await model.standardizeUserData(inputValX, inputValY, null, /** Unused sample weights. */ null, /** Unused class weights. */ checkBatchAxis, batchSize); - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - // Porting Note: In tfjs-layers, inputs[0] is always a Tensor. - const splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - const originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize); - inputs = sliceArrays(inputs, 0, splitAt); - valY = sliceArrays(targets, splitAt, originalBatchSize); - targets = sliceArrays(targets, 0, splitAt); - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - const ins = inputs.concat(targets).concat(sampleWeights); - model.checkTrainableWeightsConsistency(); - // TODO(cais): Handle use_learning_phase and learning_phase? - // Porting Note: Here we see a key deviation of tfjs-layers from - // Keras. - // Due to the imperative nature of tfjs-layers' backend (tfjs-core), - // we do not construct symbolic computation graphs to embody the - // training process. Instead, we define a function that performs the - // training action. In PyKeras, the data (inputs and targets) are fed - // through graph placeholders. In tfjs-layers, the data are fed as - // function arguments. Since the function are defined below in the - // scope, we don't have equivalents of PyKeras's - // `_make_train_funciton`. - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let valFunction; - let callbackMetrics; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const out = await fitLoop(model, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); - return out; - } - finally { - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX, inputValX); - disposeNewTensors(valY, inputValY); - if (sampleWeights != null) { - tfc.dispose(sampleWeights); - } - } - // TODO(cais): Add value to outLabels. -} -/** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ -export function ensureTensorsRank2OrHigher(tensors) { - const outs = []; - if (tensors instanceof Tensor) { - tensors = [tensors]; - } - // Make Tensors at least 2D. - for (let i = 0; i < tensors.length; ++i) { - const tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims(tensor, 1)); - } - else if (tensor.rank === 0) { - throw new Error('Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } - else { - outs.push(tensor); - } - } - return outs; -} -/** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ -// TODO(cais, kangyizhang): Deduplicate with tfjs-data. -export function disposeNewTensors(tensors, refTensors) { - if (tensors == null) { - return; - } - const oldTensorIds = []; - if (refTensors instanceof Tensor) { - oldTensorIds.push(refTensors.id); - } - else if (Array.isArray(refTensors)) { - refTensors.forEach(t => oldTensorIds.push(t.id)); - } - else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in refTensors) { - const oldTensor = refTensors[name]; - oldTensorIds.push(oldTensor.id); - } - } - const tensorsToDispose = []; - if (tensors instanceof Tensor) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } - else if (Array.isArray(tensors)) { - tensors.forEach(t => { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } - else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in tensors) { - const tensor = tensors[name]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - tensorsToDispose.forEach(t => { - if (!t.isDisposed) { - t.dispose(); - } - }); -} -//# sourceMappingURL=training_tensors.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-layers/dist/engine/training_tensors.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js.map deleted file mode 100644 index 7d4758b28..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_tensors.js","sourceRoot":"","sources":["../../src/engine/training_tensors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAS,MAAM,EAAY,QAAQ,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE/E,OAAO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C,CAAC;YACnC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACjC;KACF;IAED,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,IAAI,OAAO,YAAY,MAAM,EAAE;QAC7B,IAAI,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YAC3C,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAChC;KACF;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAClB,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBACrC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,OAAO,IAAI,IAAI,EAAE;QAC1B,oDAAoD;QACpD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC1C,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC/B;SACF;KACF;IAED,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC3B,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE;YACjB,CAAC,CAAC,OAAO,EAAE,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\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-layers/dist/engine/training_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map deleted file mode 100644 index 3e52f63df..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_test.js","sourceRoot":"","sources":["../../src/engine/training_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAkB,IAAI,EAAU,MAAM,EAAE,YAAY,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAE/K,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,cAAc,EAAsB,sBAAsB,EAAS,MAAM,mBAAmB,CAAC;AACrG,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,K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M,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAC;QACtC,MAAM,MAAM,GAAmB,EAAE,CAAC;QAClC,MAAM,CAAE,KAAK,CAAC,KAAwB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CACT,MAAM,EACL,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAA6B,CAAC,IAAI,CACxC,CAAC;QAC/B,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for training.ts\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, mean, memory, mul, NamedTensorMap, ones, Scalar, scalar, SGDOptimizer, Tensor, tensor1d, tensor2d, tensor3d, test_util, util, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {CustomCallback, CustomCallbackArgs, DEFAULT_YIELD_EVERY_MS, Params} from '../base_callbacks';\nimport * as tfl from '../index';\nimport * as logs from '../logs';\nimport {Logs, UnresolvedLogs} from '../logs';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {pyListRepeat, stringsEqual, unique} from '../utils/generic_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, describeMathGPU, expectTensorsClose} from '../utils/test_utils';\n\n// TODO(bileschi): Use external version of Layer.\nimport {Layer, SymbolicTensor} from './topology';\nimport {checkArrayLengths, collectMetrics, isDataArray, isDataDict, isDataTensor, standardizeInputData} from './training';\nimport {makeBatches, sliceArraysByIndices} from './training_tensors';\n\ndescribeMathCPU('isDataTensor', () => {\n const x = tfc.tensor2d([[3.14]]);\n\n it('Positive case', () => {\n expect(isDataTensor(x)).toEqual(true);\n });\n it('Negative cases', () => {\n expect(isDataTensor([x, x])).toEqual(false);\n expect(isDataTensor({'Pie': x})).toEqual(false);\n expect(isDataTensor({})).toEqual(false);\n });\n});\n\ndescribeMathCPU('isDataArray', () => {\n const x = tfc.tensor2d([[3.14]]);\n\n it('Positive case', () => {\n expect(isDataArray([x, x])).toEqual(true);\n expect(isDataArray([])).toEqual(true);\n });\n it('Negative cases', () => {\n expect(isDataArray(x)).toEqual(false);\n expect(isDataArray({'Pie': x})).toEqual(false);\n expect(isDataArray({})).toEqual(false);\n });\n});\n\ndescribeMathCPU('isDataDict', () => {\n const x = tfc.tensor2d([[3.14]]);\n it('Positive case', () => {\n expect(isDataDict({'Pie': x})).toEqual(true);\n expect(isDataDict({})).toEqual(true);\n });\n it('Negative cases', () => {\n expect(isDataDict(x)).toEqual(false);\n expect(isDataDict([x, x])).toEqual(false);\n expect(isDataDict([])).toEqual(false);\n });\n});\n\ndescribeMathCPU('standardizeInputData', () => {\n const getX = () => tfc.tensor2d([[42]]);\n const getY = () => tfc.tensor2d([[21]]);\n\n it('Singleton Tensor, Array of one name', () => {\n const outputs = standardizeInputData(getX(), ['Foo']);\n expect(outputs.length).toEqual(1);\n expectTensorsClose(outputs[0], getX());\n });\n it('Array of one Tensor, Array of one name', () => {\n const outputs = standardizeInputData([getX()], ['Foo']);\n expect(outputs.length).toEqual(1);\n expectTensorsClose(outputs[0], getX());\n });\n it('Array of two Tensors, Array of two names', () => {\n const outputs = standardizeInputData([getX(), getY()], ['Foo', 'Bar']);\n expect(outputs.length).toEqual(2);\n expectTensorsClose(outputs[0], getX());\n expectTensorsClose(outputs[1], getY());\n });\n it('Dict of two Tensors, Array of two names', () => {\n const outputs =\n standardizeInputData({'Foo': getX(), 'Bar': getY()}, ['Foo', 'Bar']);\n expect(outputs.length).toEqual(2);\n expectTensorsClose(outputs[0], getX());\n expectTensorsClose(outputs[1], getY());\n });\n it('Unexpected data leads to exception: singleton Tensor', () => {\n expect(() => standardizeInputData(getX(), []))\n .toThrowError(/expected no data/);\n });\n it('Unexpected data leads to exception: Array of two Tensors', () => {\n expect(() => standardizeInputData([getX(), getY()], []))\n .toThrowError(/expected no data/);\n });\n it('Unexpected data leads to exception: Dict', () => {\n expect(() => standardizeInputData({'Pie': getX()}, []))\n .toThrowError(/expected no data/);\n });\n it('Length mismatch: 1 singleton Scalar vs two names', () => {\n expect(() => standardizeInputData(getX(), ['Foo', 'Bar']))\n .toThrowError(/expects 2 Tensor.* but only received one/);\n });\n it('Length mismatch: Array of 2 Scalars vs one name', () => {\n expect(() => standardizeInputData([getX(), scalar(-42)], ['Foo']))\n .toThrowError(/Expected to see 1 Tensor/);\n });\n it('Length mismatch: Dict of 1 Scalar vs 2 names', () => {\n expect(() => standardizeInputData({'Foo': getX()}, ['Foo', 'Bar']))\n .toThrowError(/No data provided for \\\"Bar\\\"/);\n });\n});\n\ndescribeMathCPU('checkArrayLengths', () => {\n it('Batch mismatch in inputs', () => {\n const inputs = [zeros([2, 1]), zeros([3, 1])];\n const targets = [zeros([2, 1]), zeros([2, 1])];\n expect(() => checkArrayLengths(inputs, targets))\n .toThrowError(/All input .* should have the same number of samples/);\n });\n it('Batch mismatch in targets', () => {\n const inputs = [zeros([2, 1]), zeros([2, 1])];\n const targets = [zeros([2, 1]), zeros([3, 1])];\n expect(() => checkArrayLengths(inputs, targets))\n .toThrowError(/All target .* should have the same number of samples/);\n });\n it('Batch mismatch between inputs and targets', () => {\n const inputs = [zeros([2, 1]), zeros([2, 1])];\n const targets = [zeros([3, 1]), zeros([3, 1])];\n expect(() => checkArrayLengths(inputs, targets))\n .toThrowError(\n /Input Tensors should have the same number of samples as target/);\n });\n});\n\ndescribeMathCPUAndGPU('collectMetrics', () => {\n it('shortcut strings name', () => {\n const metrics = 'mse';\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(1);\n expect(collectedMetrics[0][0]).toEqual('mse');\n });\n it('metric function', () => {\n const metrics = tfl.metrics.meanSquaredError;\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(1);\n expect(collectedMetrics[0][0]).toEqual(metrics);\n });\n it('Array of shortcut string names', () => {\n const metrics = ['mse', 'crossentropy'];\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(2);\n expect(collectedMetrics[0][0]).toEqual('mse');\n expect(collectedMetrics[0][1]).toEqual('crossentropy');\n });\n it('Array of metric functions', () => {\n const metrics = [tfl.metrics.meanSquaredError, tfl.metrics.precision];\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(2);\n expect(collectedMetrics[0][0]).toEqual(metrics[0]);\n expect(collectedMetrics[0][1]).toEqual(metrics[1]);\n });\n it('Array of mixing shortcut string names and metric functions', () => {\n const metrics = ['mse', tfl.metrics.precision];\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(2);\n expect(collectedMetrics[0][0]).toEqual('mse');\n expect(collectedMetrics[0][1]).toEqual(metrics[1]);\n });\n it('Dict of shortcut string names', () => {\n const metrics = {'output': 'mse'};\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(1);\n expect(collectedMetrics[0][0]).toEqual('mse');\n });\n it('Dict of metric functions', () => {\n const metrics = {'output': tfl.metrics.meanSquaredError};\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(1);\n expect(collectedMetrics[0][0]).toEqual(metrics['output']);\n });\n it('metrics null', () => {\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics(null, outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(0);\n });\n it('metrics is array, length = 0', () => {\n const outputNames = ['output'];\n const collectedMetrics = collectMetrics([], outputNames);\n expect(collectedMetrics.length).toEqual(1);\n expect(collectedMetrics[0].length).toEqual(0);\n });\n it('multiple output names', () => {\n const metrics = ['mse'];\n const outputNames = ['output1', 'output2'];\n const collectedMetrics = collectMetrics(metrics, outputNames);\n expect(collectedMetrics.length).toEqual(2);\n expect(collectedMetrics[0].length).toEqual(1);\n expect(collectedMetrics[0][0]).toEqual('mse');\n expect(collectedMetrics[1].length).toEqual(1);\n expect(collectedMetrics[1][0]).toEqual('mse');\n });\n});\n\ndescribeMathCPUAndGPU('sliceArraysByIndices', () => {\n it('Single 2D', () => {\n const x = tensor2d([[1, 2], [3, 4], [5, 6]], [3, 2]);\n const y = sliceArraysByIndices(x, tensor1d([0, 2])) as Tensor;\n expectTensorsClose(y, tensor2d([[1, 2], [5, 6]], [2, 2]));\n });\n it('Array of two 2Ds', () => {\n const xs = [\n tensor2d([[1, 2], [3, 4], [5, 6]], [3, 2]),\n tensor2d([[10, 20], [30, 40], [50, 60]], [3, 2])\n ];\n const ys = sliceArraysByIndices(xs, tensor1d([0, 2])) as Tensor[];\n expect(ys.length).toEqual(2);\n expectTensorsClose(ys[0], tensor2d([[1, 2], [5, 6]], [2, 2]));\n expectTensorsClose(ys[1], tensor2d([[10, 20], [50, 60]], [2, 2]));\n });\n it('Array of two 3Ds', () => {\n const xs = [\n tensor3d([[[1]], [[2]], [[3]]], [3, 1, 1]),\n tensor3d([[[10]], [[20]], [[30]]], [3, 1, 1]),\n ];\n const ys = sliceArraysByIndices(xs, tensor1d([0, 2])) as Tensor[];\n expect(ys.length).toEqual(2);\n expectTensorsClose(ys[0], tensor3d([[[1]], [[3]]], [2, 1, 1]));\n expectTensorsClose(ys[1], tensor3d([[[10]], [[30]]], [2, 1, 1]));\n });\n it('null array input', () => {\n expect(sliceArraysByIndices(null, tensor1d([0, 2]))).toBeNull();\n });\n it('casts indices automatically', () => {\n const x = tensor2d([[1, 2], [3, 4], [5, 6]], [3, 2]);\n const y =\n sliceArraysByIndices(x, tensor1d([0.1, 2.0], 'float32')) as Tensor;\n expectTensorsClose(y, tensor2d([[1, 2], [5, 6]], [2, 2]));\n });\n});\n\ndescribe('makeBatches', () => {\n it('divisible', () => {\n expect(makeBatches(6, 3)).toEqual([[0, 3], [3, 6]]);\n });\n\n it('indivisible', () => {\n expect(makeBatches(7, 3)).toEqual([[0, 3], [3, 6], [6, 7]]);\n expect(makeBatches(2, 4)).toEqual([[0, 2]]);\n });\n\n it('empty size', () => {\n expect(makeBatches(0, 4)).toEqual([]);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.predict', () => {\n it('1 input, 1 output', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer1', dtype: 'float32'});\n const layer = tfl.layers.reshape({targetShape: [2, 6]});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output], name: 'model1x1'});\n const xs = ones([10, 3, 4]);\n const ys = model.predict(xs, {batchSize: 4}) as Tensor;\n expectTensorsClose(ys, ones([10, 2, 6]));\n });\n\n it('1D tensors as inputs', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n\n const xs = ones([10]); // A batch of 10.\n // Do a burn-in call first.\n tfc.dispose(model.predict(xs, {batchSize: 4}));\n const numTensors0 = memory().numTensors;\n const ys = model.predict(xs, {batchSize: 4}) as Tensor;\n expect(ys.shape).toEqual([10, 1]);\n ys.dispose();\n // Assert no memory leak.\n expect(memory().numTensors).toEqual(numTensors0);\n });\n\n it('1 input, 1 output, tensor as input argument', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer1', dtype: 'float32'});\n const layer = tfl.layers.reshape({targetShape: [2, 6]});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output], name: 'model1x1'});\n const xs = ones([10, 3, 4]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, ones([10, 2, 6]));\n });\n\n it('1 input as Array, 1 output', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer1', dtype: 'float32'});\n const layer = tfl.layers.reshape({targetShape: [2, 6]});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output], name: 'model1x1'});\n const xs = ones([10, 3, 4]);\n const ys = model.predict([xs], {batchSize: 4}) as Tensor;\n expectTensorsClose(ys, ones([10, 2, 6]));\n });\n\n it('1 input, 2 outputs', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer2', dtype: 'float32'});\n const layer1 = tfl.layers.reshape({targetShape: [2, 6]});\n const layer2 = tfl.layers.flatten();\n const output1 = layer1.apply(inputTensor) as tfl.SymbolicTensor;\n const output2 = layer2.apply(output1) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output1, output2], name: 'model1x2'});\n const xs = ones([10, 3, 4]);\n const ys = model.predict(xs, {batchSize: 4}) as Tensor[];\n expect(ys.length).toEqual(2);\n expectTensorsClose(ys[0], ones([10, 2, 6]));\n expectTensorsClose(ys[1], ones([10, 12]));\n });\n\n it('2 inputs, 2 outputs', () => {\n const inputTensor1 = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer3', dtype: 'float32'});\n const inputTensor2 = tfl.layers.input(\n {shape: [3, 3], name: 'inputLayer4', dtype: 'float32'});\n const layer1 = tfl.layers.reshape({targetShape: [2, 6]});\n const layer2 = tfl.layers.flatten();\n const output1 = layer1.apply(inputTensor1) as tfl.SymbolicTensor;\n const output2 = layer2.apply(inputTensor2) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel({\n inputs: [inputTensor1, inputTensor2],\n outputs: [output1, output2],\n name: 'model2x2'\n });\n const xs1 = ones([10, 3, 4]);\n const xs2 = ones([10, 3, 3]);\n const ys = model.predict([xs1, xs2], {batchSize: 4}) as Tensor[];\n expect(ys.length).toEqual(2);\n expectTensorsClose(ys[0], ones([10, 2, 6]));\n expectTensorsClose(ys[1], ones([10, 9]));\n });\n\n it('Incorrect number of inputs leads to exception: 1 vs 2', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer_inc_1', dtype: 'float32'});\n const layer = tfl.layers.reshape({targetShape: [2, 6]});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output], name: 'model_inc_1x1'});\n const xs1 = ones([10, 3, 4]);\n\n expect(() => model.predict([\n xs1, xs1\n ])).toThrowError(/.*Expected.*1 Tensor.*got 2 Tensor.*/);\n });\n\n it('Incorrect number of inputs leads to exception: 2 vs 3', () => {\n const inputTensor1 = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer_inc_3', dtype: 'float32'});\n const inputTensor2 = tfl.layers.input(\n {shape: [3, 3], name: 'inputLayer_inc_4', dtype: 'float32'});\n const layer1 = tfl.layers.reshape({targetShape: [2, 6]});\n const layer2 = tfl.layers.flatten();\n const output1 = layer1.apply(inputTensor1) as tfl.SymbolicTensor;\n const output2 = layer2.apply(inputTensor2) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel({\n inputs: [inputTensor1, inputTensor2],\n outputs: [output1, output2],\n name: 'model_inc_2x2'\n });\n const xs1 = ones([10, 3, 4]);\n\n expect(() => model.predict([\n xs1, xs1, xs1\n ])).toThrowError(/.*Expected.*2 Tensor.*got 3 Tensor.*/);\n });\n\n it('Incorrect input shape leads to exception', () => {\n const inputTensor = tfl.layers.input(\n {shape: [3, 4], name: 'inputLayer_inc_1', dtype: 'float32'});\n const layer = tfl.layers.reshape({targetShape: [2, 6]});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel(\n {inputs: [inputTensor], outputs: [output], name: 'model_inc_1x1'});\n const xs1 = ones([2, 4, 3]);\n\n expect(() => model.predict(xs1))\n .toThrowError(/.*expected.* shape \\[null,3,4\\].*but got.*\\[2,4,3\\]/);\n });\n\n it('Invalid batchSize value leads to Error', () => {\n const model = tfl.sequential(\n {layers: [tfl.layers.dense({units: 1, inputShape: [2]})]});\n const xs = tfc.zeros([5, 2]);\n expect(() => model.predict(xs, {batchSize: 0}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got 0/);\n expect(() => model.predict(xs, {batchSize: -2}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got -2/);\n expect(() => model.predict(xs, {batchSize: 3.14}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got 3\\.14/);\n // tslint:disable-next-line:no-any\n expect(() => model.predict(xs, {batchSize: 'a' as any}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got a/);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.fit', () => {\n const inputSize = 4; // Input vector size for model with one input.\n const inputSize1 = 3; // 1st input vector size for model with two inputs.\n const inputSize2 = 4; // 2nd input vector size for model with two inputs.\n const numSamples = 5; // Number of samples in a batch.\n\n const inputTensor = tfl.layers.input(\n {shape: [inputSize], name: 'inputLayer1', dtype: 'float32'});\n const inputTensor1 = tfl.layers.input(\n {shape: [inputSize1], name: 'inputLayer1of2', dtype: 'float32'});\n const inputTensor2 = tfl.layers.input(\n {shape: [inputSize2], name: 'inputLayer2of2', dtype: 'float32'});\n\n // For model with one input.\n let model: tfl.LayersModel;\n let inputs: Tensor;\n let targets: Tensor;\n\n // For model with two inputs (and two outputs).\n let twoOutputModel: tfl.LayersModel;\n let inputs1: Tensor;\n let inputs2: Tensor;\n let targets1: Tensor;\n let targets2: Tensor;\n\n function createDenseModelAndData(\n useBias = false,\n kernelRegularizer?: string|Regularizer,\n biasRegularizer?: string|Regularizer,\n ): void {\n const layer = tfl.layers.dense(\n {units: 1, useBias, kernelInitializer: 'ones', kernelRegularizer});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n }\n\n function createDenseCategoricalModelAndData(useBias = false): void {\n const layer =\n tfl.layers.dense({units: 2, useBias, kernelInitializer: 'ones'});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n inputs = ones([numSamples, inputSize]);\n targets = K.oneHot(ones([numSamples]), 2);\n }\n\n function createTwoLayerDenseModelAndData(useBias = false): [Layer, Layer] {\n const layer1 =\n tfl.layers.dense({units: 10, useBias, kernelInitializer: 'ones'});\n const layer2 =\n tfl.layers.dense({units: 1, useBias, kernelInitializer: 'ones'});\n const output =\n layer2.apply(layer1.apply(inputTensor)) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n return [layer1, layer2];\n }\n\n function createDenseModelWithTwoOutputsAndData(): void {\n const layer1 =\n tfl.layers.dense({units: 1, useBias: false, kernelInitializer: 'ones'});\n const layer2 =\n tfl.layers.dense({units: 1, useBias: false, kernelInitializer: 'ones'});\n const output1 = layer1.apply(inputTensor1) as tfl.SymbolicTensor;\n const output2 = layer2.apply(inputTensor2) as tfl.SymbolicTensor;\n twoOutputModel = new tfl.LayersModel(\n {inputs: [inputTensor1, inputTensor2], outputs: [output1, output2]});\n inputs1 = ones([numSamples, inputSize1]);\n inputs2 = ones([numSamples, inputSize2]);\n targets1 = ones([numSamples, 1]);\n targets2 = ones([numSamples, 1]);\n }\n\n it('1 input, 1 output, dense, 1 weight, string optimizer, 1 batch',\n async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n\n expect(history.epoch).toEqual([0]);\n const newWeightsValue = model.trainableWeights[0].read();\n\n const lr = 0.01; // This is the default learning rate of SGD.\n const expectedValueArray =\n pyListRepeat([1.0 - (inputSize - 1) * 2 * lr], inputSize);\n expectTensorsClose(\n newWeightsValue, tensor2d(expectedValueArray, [inputSize, 1]));\n });\n\n it('1D tensor as inputs, targets and validationData', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n\n // Use 1D tensor shapes.\n inputs = ones([numSamples]);\n targets = ones([numSamples]);\n const valInputs = ones([numSamples]);\n const valTargets = ones([numSamples]);\n\n // Do a burn-in run before checking memory to give any cached\n // tensors a chance to be created first.\n await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 2,\n validationData: [valInputs, valTargets]\n });\n\n for (let i = 0; i < 2; ++i) {\n const numTensors0 = memory().numTensors;\n const history = await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 2,\n validationData: [valInputs, valTargets]\n });\n expect(memory().numTensors).toEqual(numTensors0);\n // Assert no memory leak.\n expect(history.epoch).toEqual([0, 1]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.val_loss.length).toEqual(2);\n }\n });\n\n it('training with cosineProximity loss', async () => {\n createDenseCategoricalModelAndData();\n model.compile({optimizer: 'SGD', loss: 'cosineProximity'});\n // Use batchSize === numSamples to get exactly one batch.\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n expect(history.epoch).toEqual([0, 1]);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.val_loss.length).toEqual(2);\n test_util.expectArraysClose(\n history.history['loss'] as number[],\n [-0.70710688829422, -0.7077317237854004]);\n test_util.expectArraysClose(\n history.history['val_loss'] as number[],\n [-0.70710688829422, -0.7077317237854004]);\n });\n\n it('training with custom loss', async () => {\n // Use the following Python code snippet to get reference values\n // for assertion:\n //\n // ```python\n // import keras\n // import keras.backend as K;\n // import numpy as np\n //\n // def abs_diff_loss(x, y):\n // return K.mean(K.abs(x - y))\n //\n // input1 = keras.Input(shape=[4])\n // layer = keras.layers.Dense(\n // units=1, use_bias=False, kernel_initializer='ones')\n // output = layer(input1)\n // model = keras.Model(input1, output)\n // model.compile(optimizer='SGD', loss=abs_diff_loss)\n // inputs = np.ones([5, 4])\n // targets = np.ones([5])\n // history = model.fit(\n // inputs, targets, batch_size=5, epochs=2,\n // validation_split=0.2)\n // print(history.history)\n // ```\n\n createDenseModelAndData();\n\n const absDiffLoss = (x: Tensor, y: Tensor) => mean(abs(x.sub(y)));\n\n model.compile({optimizer: 'SGD', loss: absDiffLoss});\n // Use batchSize === numSamples to get exactly one batch.\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n test_util.expectArraysClose(history.history['loss'] as number[], [3, 2.96]);\n test_util.expectArraysClose(\n history.history['val_loss'] as number[], [2.96, 2.92]);\n });\n\n it('Using only x and y input arguments', async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history = await model.fit(inputs, targets, {epochs: 10});\n // 100 is the default number of epochs.\n expect(history.epoch.length).toEqual(10);\n for (let i = 0; i < 10; ++i) {\n expect(history.epoch[i]).toEqual(i);\n }\n });\n\n it('Default LayersModel.fit epochs is 1', async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history = await model.fit(inputs, targets);\n expect(history.epoch.length).toEqual(1);\n expect(history.epoch[0]).toEqual(0);\n });\n\n it('1 input, 1 output, dense, 1 weight, string optimizer, 2 epochs',\n async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 2});\n expect(history.epoch).toEqual([0, 1]);\n });\n\n it('1 input, 1 output, dense, 1 weight, string optimizer, 2 epochs, ' +\n '1 initialEpoch',\n async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, initialEpoch: 1});\n expect(history.epoch).toEqual([1]);\n expect(history.history.loss.length).toEqual(1);\n });\n\n it('Training with Dropout layer', async () => {\n const inputSize = 2;\n const batchSize = 4;\n const input = tfl.layers.input({shape: [inputSize]});\n const dense1 =\n tfl.layers.dense({units: 2, kernelInitializer: 'ones', useBias: false});\n const dropout = tfl.layers.dropout({rate: 0.5});\n const dense2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'ones', useBias: false});\n const output =\n dense2.apply(dropout.apply(dense1.apply(input))) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel({inputs: input, outputs: output});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const x = ones([batchSize, inputSize]);\n const y = ones([batchSize, 1]);\n await model.fit(x, y, {batchSize, epochs: 1});\n });\n\n it('Calling fit twice in a row leads to Error', async () => {\n createDenseModelAndData();\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Do not use `await` in the following `model.fit` call, so that\n // the two model.fit() calls may interleave.\n const firstFit =\n model.fit(inputs, targets, {batchSize: numSamples, epochs: 8});\n let errorCaught: Error;\n try {\n await model.fit(inputs, targets);\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'Cannot start training because another fit() call is ongoing.');\n await firstFit;\n });\n\n const validationSplits = [0.2, 0.01];\n for (const validationSplit of validationSplits) {\n const testTitle =\n '1 input, 1 output, dense, 1 weight, string optimizer, 2 epochs, ' +\n `validationSplit=${validationSplit}`;\n it(testTitle, async () => {\n createDenseModelAndData();\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history = await model.fit(\n inputs, targets, {batchSize: numSamples, epochs: 2, validationSplit});\n expect(history.epoch).toEqual([0, 1]);\n const losses = history.history['loss'];\n expect(losses.length).toEqual(2);\n const valLosses = history.history['val_loss'];\n expect(valLosses.length).toEqual(2);\n // Reference values of the losses can be obtained from PyKeras:\n // ```python\n // import keras\n // import numpy as np\n // input1 = keras.Input(shape=[4])\n // layer = keras.layers.Dense(\n // units=1, use_bias=False, kernel_initializer='ones')\n // output = layer(input1)\n // model = keras.Model(input1, output)\n // model.compile(optimizer='SGD', loss='mean_squared_error')\n // inputs = np.ones([5, 4])\n // targets = np.ones([5])\n // history = model.fit(\n // inputs, targets, batch_size=5, epochs=2,\n // validation_split=0.2)\n // print(history.history)\n // ```\n expectTensorsClose(losses as number[], [9, 7.617599964141846]);\n expectTensorsClose(\n valLosses as number[], [7.617599964141846, 6.447536945343018]);\n });\n }\n\n it('1 input, 1 output, dense, 1 weight, string optimizer, 2 epochs, ' +\n 'use validationData',\n async () => {\n createDenseModelAndData();\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history = await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 2,\n validationData: [zeros(inputs.shape as [number, number]), targets]\n });\n expect(history.epoch).toEqual([0, 1]);\n const losses = history.history['loss'];\n expect(losses.length).toEqual(2);\n const valLosses = history.history['val_loss'];\n expect(valLosses.length).toEqual(2);\n expectTensorsClose(losses as number[], [9, 7.617599964141846]);\n });\n\n it('1 input, 1 output, dense, 1 weight, string optimizer, 2 epochs, ' +\n 'validationSplit = 0.2, with additional metric',\n async () => {\n createDenseModelAndData();\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['accuracy']});\n expect(model.metricsNames).toEqual(['loss', 'acc']);\n const history = await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 2,\n validationSplit: 0.2,\n });\n\n expect(history.epoch).toEqual([0, 1]);\n const losses = history.history['loss'];\n expect(losses.length).toEqual(2);\n const valLosses = history.history['val_loss'];\n expect(valLosses.length).toEqual(2);\n expectTensorsClose(losses as number[], [9, 7.617599964141846]);\n expectTensorsClose(\n valLosses as number[], [7.617599964141846, 6.447536945343018]);\n });\n\n it('Return sequences; Fit with metric', async () => {\n // The golden values for history used in the assertion below can be obtained\n // with the following Python Keras code.\n // Ran with Python Keras verion 2.1.2 and TensorFlow (CPU) version\n // 1.7.0-dev20180226.\n // ```python\n // import keras\n // import numpy as np\n //\n // sequenceLength = 3\n // inputSize = 4\n // dataSize = 16\n // validationSplit = 0.5\n // batchSize = 3\n // outputSize = 2\n //\n // model = keras.Sequential()\n //\n // model.add(keras.layers.SimpleRNN(\n // outputSize,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // use_bias=False,\n // return_sequences=True,\n // input_shape=[sequenceLength, inputSize]))\n // model.add(keras.layers.TimeDistributed(\n // keras.layers.Dense(\n // outputSize,\n // kernel_initializer='ones',\n // use_bias=False)))\n //\n // model.compile(optimizer='sgd',\n // loss='categorical_crossentropy',\n // metrics=['accuracy'])\n // history = model.fit(np.ones([dataSize, sequenceLength, inputSize]),\n // np.ones([dataSize, sequenceLength, outputSize]),\n // batch_size=batchSize,\n // epochs=2,\n // validation_split=validationSplit)\n // print(history.history)\n // ```\n\n const sequenceLength = 3;\n const inputSize = 4;\n const dataSize = 16;\n const validationSplit = 0.5;\n const batchSize = 3;\n // So there are 8 examples for train and validation, respectivly. The actual\n // batches during training and validation will be 3, 3 and 2. This tests the\n // correct averaging of the loss values happens without broadcasting.\n const outputSize = 2;\n const simpleRNN = tfl.layers.simpleRNN({\n units: outputSize,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n useBias: false,\n returnSequences: true,\n });\n const timeDistributed = tfl.layers.timeDistributed({\n layer: tfl.layers.dense(\n {units: outputSize, kernelInitializer: 'ones', useBias: false})\n });\n const input = tfl.layers.input({shape: [sequenceLength, inputSize]});\n const output =\n timeDistributed.apply(simpleRNN.apply(input)) as tfl.SymbolicTensor;\n const model = new tfl.LayersModel({inputs: input, outputs: output});\n model.compile({\n optimizer: 'sgd',\n loss: 'categoricalCrossentropy',\n metrics: ['accuracy'],\n });\n const history = await model.fit(\n ones([dataSize, sequenceLength, inputSize]),\n ones([dataSize, sequenceLength, outputSize]), {\n batchSize,\n epochs: 1,\n validationSplit,\n });\n expectTensorsClose(\n history.history['loss'] as number[], [1.3862943649291992]);\n expectTensorsClose(\n history.history['val_loss'] as number[], [1.3862943649291992]);\n expectTensorsClose(history.history['acc'] as number[], [1.0]);\n expectTensorsClose(history.history['val_acc'] as number[], [1.0]);\n });\n\n // TODO(cais): Test metric as a \"dict\", for models with >1 outputs.\n\n const metricsToTest: string[][] = [['acc'], ['accuracy']];\n // TODO(cais): Add 'acc', 'accuracy' and assertion acc_1, acc_2.\n for (const metrics of metricsToTest) {\n const testTitle = `categoricalCrossentropy model, validationSplit = 0.2, ` +\n `${JSON.stringify(metrics)}`;\n it(testTitle, async () => {\n createDenseCategoricalModelAndData();\n model.compile(\n {optimizer: 'SGD', loss: 'categoricalCrossentropy', metrics});\n if (stringsEqual(metrics, ['acc']) ||\n stringsEqual(metrics, ['accuracy'])) {\n expect(model.metricsNames).toEqual(['loss', 'acc']);\n } else if (stringsEqual(metrics, ['acc', 'accuracy'])) {\n expect(model.metricsNames).toEqual(['loss', 'acc', 'acc']);\n }\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n const losses = history.history['loss'];\n expectTensorsClose(\n losses as number[], [0.6931471824645996, 0.6918979287147522]);\n const valLosses = history.history['val_loss'];\n expectTensorsClose(\n valLosses as number[], [0.6918979287147522, 0.6906517744064331]);\n const acc = history.history['acc'];\n expectTensorsClose(acc as number[], [0, 1]);\n const valAcc = history.history['val_acc'];\n expectTensorsClose(valAcc as number[], [1, 1]);\n });\n }\n\n it('categoricalCrossentropy model, validationSplit = 0.2, ' +\n 'tf.metrics.meanSquareError metric function',\n async () => {\n createDenseCategoricalModelAndData();\n model.compile({\n optimizer: 'SGD',\n loss: 'categoricalCrossentropy',\n metrics: tfl.metrics.meanSquaredError\n });\n expect(model.metricsNames).toEqual(['loss', 'meanSquaredError']);\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n const losses = history.history['loss'];\n expectTensorsClose(\n losses as number[], [0.6931471824645996, 0.6918979287147522]);\n const meanSquareError = history.history['meanSquaredError'];\n expectTensorsClose(\n meanSquareError as number[], [12.5, 12.495024681091309]);\n });\n\n it('categoricalCrossentropy model, validationSplit = 0.2, ' +\n 'tf.metrics.meanSquareError metric function && acc',\n async () => {\n createDenseCategoricalModelAndData();\n model.compile({\n optimizer: 'SGD',\n loss: 'categoricalCrossentropy',\n metrics: [tfl.metrics.meanSquaredError, 'acc']\n });\n expect(model.metricsNames).toEqual(['loss', 'meanSquaredError', 'acc']);\n const history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n const losses = history.history['loss'];\n expectTensorsClose(\n losses as number[], [0.6931471824645996, 0.6918979287147522]);\n const meanSquareError = history.history['meanSquaredError'];\n expectTensorsClose(\n meanSquareError as number[], [12.5, 12.495024681091309]);\n const acc = history.history['acc'];\n expectTensorsClose(acc as number[], [0, 1]);\n });\n\n it('Two layers, freeze one layer', async () => {\n // The golden values used below can be obtained with the following PyKeras\n // code.\n // ```python\n // import keras\n // import numpy as np\n //\n // input_size = 4\n // num_samples = 5\n //\n // input_tensor = keras.Input([input_size], name='inputLayer1')\n // layer1 = keras.layers.Dense(\n // units=10, use_bias=False, kernel_initializer='ones')\n // layer2 = keras.layers.Dense(\n // units=1, use_bias=False, kernel_initializer='ones')\n // output = layer2(layer1(input_tensor))\n // model = keras.Model(input_tensor, output)\n //\n // inputs = np.ones([num_samples, input_size])\n // targets = np.ones([num_samples, 1])\n //\n // optimizer = keras.optimizers.SGD(lr=1e-2)\n // model.compile(optimizer=optimizer, loss='mean_squared_error')\n // history = model.fit(inputs,\n // targets,\n // batch_size=num_samples,\n // epochs=2,\n // validation_split=0.2)\n //\n // print(history.history)\n // print(layer1.get_weights())\n // print(layer2.get_weights())\n //\n // # Freeze layer 1.\n // layer1.trainable = False\n // model.compile(optimizer=optimizer, loss='mean_squared_error')\n // history = model.fit(inputs,\n // targets,\n // batch_size=num_samples,\n // epochs=2,\n // validation_split=0.2)\n //\n // print(history.history)\n // print(layer1.get_weights())\n // print(layer2.get_weights())\n // ```\n const layers = createTwoLayerDenseModelAndData();\n const layer1 = layers[0];\n const layer2 = layers[1];\n const optimizer = new SGDOptimizer(1e-2);\n model.compile({optimizer, loss: 'meanSquaredError'});\n let history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n let losses = history.history['loss'];\n expectTensorsClose(losses as number[], [1521.0, 386.35842895507812]);\n let valLosses = history.history['val_loss'];\n expectTensorsClose(\n valLosses as number[], [386.35848999023438, 1808.7342529296875]);\n expectTensorsClose(\n layer1.getWeights()[0], mul(scalar(-0.61341441), ones([4, 10])));\n expectTensorsClose(\n layer2.getWeights()[0], mul(scalar(-1.77405429), ones([10, 1])));\n\n // Freeze the 1st layer and compile the model again.\n layer1.trainable = false;\n model.compile({optimizer, loss: 'meanSquaredError'});\n\n history = await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 2, validationSplit: 0.2});\n losses = history.history['loss'];\n expectTensorsClose(\n losses as number[], [1808.7342529296875, 75.336509704589844]);\n valLosses = history.history['val_loss'];\n expectTensorsClose(\n valLosses as number[], [75.336524963378906, 3.1378798484802246]);\n // Expect no change in the value of layer1's kernel, due to the freezing.\n expectTensorsClose(\n layer1.getWeights()[0], mul(scalar(-0.61341441), ones([4, 10])));\n // Expect change in the value of layer2's kernel.\n expectTensorsClose(\n layer2.getWeights()[0], mul(scalar(-0.11295), ones([10, 1])));\n });\n\n it('Setting trainable of layer from fit callback', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n activation: 'relu',\n inputShape: [4],\n kernelInitializer: 'ones'\n }));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n expect(model.trainableWeights.length).toEqual(4);\n const xs = tfc.ones([5, 4]);\n const ys = tfc.ones([5, 1]);\n const layer1KernelValues: Float32Array[] = [];\n const layer2KernelValues: Float32Array[] = [];\n await model.fit(xs, ys, {\n epochs: 3,\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n layer1KernelValues.push(\n model.layers[0].getWeights()[0].dataSync() as Float32Array);\n layer2KernelValues.push(\n model.layers[1].getWeights()[0].dataSync() as Float32Array);\n // Freeze the first dense layer after the 2nd epoch and unfreeze it\n // after the 3rd epoch.\n if (epoch === 1) {\n model.layers[0].trainable = false;\n } else if (epoch === 2) {\n model.layers[0].trainable = true;\n }\n if (epoch > 0) {\n // The 2nd dense layer is never frozen. So its kernel should\n // be updated in every training epoch.\n // TODO(cais): Use `expectArraysNotClose()` when available.\n expect(tensor1d(layer2KernelValues[epoch])\n .sub(tensor1d(layer2KernelValues[epoch - 1]))\n .abs()\n .max()\n .dataSync()[0])\n .toBeGreaterThan(0);\n }\n // The 1st dense layer is frozen after the 2nd epoch (epoch === 1),\n // and is then unfrozen after the 3rd (epoch === 2).\n // So its kernel value should not change between epoch === 1 and epoch\n // === 2.\n if (epoch === 2) {\n expect(tensor1d(layer1KernelValues[epoch])\n .sub(tensor1d(layer1KernelValues[epoch - 1]))\n .abs()\n .max()\n .dataSync()[0])\n .toEqual(0);\n } else if (epoch > 0) {\n expect(tensor1d(layer1KernelValues[epoch])\n .sub(tensor1d(layer1KernelValues[epoch - 1]))\n .abs()\n .max()\n .dataSync()[0])\n .toBeGreaterThan(0);\n }\n }\n }\n });\n });\n\n it('Unknown metric', () => {\n createDenseCategoricalModelAndData();\n expect(() => model.compile({\n optimizer: 'SGD',\n loss: 'categoricalCrossentropy',\n metrics: ['foo']\n })).toThrowError(/Unknown metric foo/);\n });\n\n it('1 input, 1 output, dense, 2 weights, string optimizer, 1 batch',\n async () => {\n createDenseModelAndData(true);\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n expect(history.epoch).toEqual([0]);\n\n expect(model.trainableWeights.length).toEqual(2);\n const lr = 0.01; // This is the default learning rate of SGD.\n const newKernelValue = model.trainableWeights[0].read();\n const expectedKernelArray =\n pyListRepeat([1.0 - (inputSize - 1) * 2 * lr], inputSize);\n expectTensorsClose(\n newKernelValue, tensor2d(expectedKernelArray, [inputSize, 1]));\n const newBiasValue = model.trainableWeights[1].read();\n const expectedBiasArray = [0.0 - (inputSize - 1) * 2 * lr];\n expectTensorsClose(newBiasValue, tensor1d(expectedBiasArray));\n });\n\n it('1 input, 1 output, dense, 1 weight, optimizer object, 1 batch',\n async () => {\n createDenseModelAndData();\n\n // Use a custom learning rate for SGD.\n const lr = 0.025;\n model.compile(\n {optimizer: new SGDOptimizer(lr), loss: 'meanSquaredError'});\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n expect(history.epoch).toEqual([0]);\n const newWeightsValue = model.trainableWeights[0].read();\n\n const expectedValueArray =\n pyListRepeat([1.0 - (inputSize - 1) * 2 * lr], inputSize);\n expectTensorsClose(\n newWeightsValue, tensor2d(expectedValueArray, [inputSize, 1]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // input1 = keras.Input(shape=[2])\n // output1 = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False)(input1)\n // output2 = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False)(input1)\n // model = keras.Model(input1, [output1, output2])\n //\n // model.compile(loss={model.output_names[0]: 'mean_squared_error',\n // model.output_names[1]: 'mean_absolute_error'},\n // optimizer='sgd')\n //\n // xs = np.ones([2, 2])\n // ys1 = np.zeros([2, 1])\n // ys2 = np.zeros([2, 1])\n // history = model.fit(xs, [ys1, ys2], epochs=1)\n // print(history.history)\n // ```\n it('2 outputs, losses by output name', async () => {\n const input1 = tfl.input({shape: [2]});\n const output1 =\n tfl.layers.dense({units: 1, kernelInitializer: 'ones', useBias: false})\n .apply(input1) as SymbolicTensor;\n const output2 =\n tfl.layers.dense({units: 1, kernelInitializer: 'ones', useBias: false})\n .apply(input1) as SymbolicTensor;\n const model = tfl.model({inputs: input1, outputs: [output1, output2]});\n const loss: {[outputName: string]: string} = {};\n loss[model.outputNames[0]] = 'meanSquaredError';\n loss[model.outputNames[1]] = 'meanAbsoluteError';\n model.compile({loss, optimizer: 'sgd'});\n\n const xs = ones([2, 2]);\n const ys1 = zeros([2, 1]);\n const ys2 = zeros([2, 1]);\n const history = await model.fit(xs, [ys1, ys2], {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(6);\n expect(history.history[`${model.outputNames[0]}_loss`][0]).toBeCloseTo(4);\n expect(history.history[`${model.outputNames[1]}_loss`][0]).toBeCloseTo(2);\n });\n\n it('2 inputs, 2 outputs, dense, optimizer object, 1 batch', async () => {\n createDenseModelWithTwoOutputsAndData();\n\n const lr = 0.01;\n twoOutputModel.compile({\n optimizer: new SGDOptimizer(lr),\n loss: ['meanSquaredError', 'meanSquaredError']\n });\n const trainableWeights = twoOutputModel.trainableWeights;\n let newWeightsValue1 = trainableWeights[0].read();\n let newWeightsValue2 = trainableWeights[1].read();\n await twoOutputModel.fit(\n [inputs1, inputs2], [targets1, targets2],\n {batchSize: numSamples, epochs: 1});\n\n expect(twoOutputModel.trainableWeights.length).toEqual(2);\n newWeightsValue1 = twoOutputModel.trainableWeights[0].read();\n newWeightsValue2 = twoOutputModel.trainableWeights[1].read();\n\n // Check the weight updates to layer1.\n const expectedValueArray1 =\n pyListRepeat([1.0 - (inputSize1 - 1) * 2 * lr], inputSize1);\n expectTensorsClose(\n newWeightsValue1, tensor2d(expectedValueArray1, [inputSize1, 1]));\n // Check the weight updates to layer2 (different from those to\n // layer1).\n const expectedValueArray2 =\n pyListRepeat([1.0 - (inputSize2 - 1) * 2 * lr], inputSize2);\n expectTensorsClose(\n newWeightsValue2, tensor2d(expectedValueArray2, [inputSize2, 1]));\n });\n\n const isCustomCallbackArgs = [false, true];\n const isCustomCallbackArray = [false, true];\n for (const isArgs of isCustomCallbackArgs) {\n for (const isArray of isCustomCallbackArray) {\n const testTitle = `Fit with custom callback object: isConfig=${\n isArgs}, isArray=${isArray}`;\n it(testTitle, async () => {\n createDenseModelAndData();\n const trainBeginLogs: Logs[] = [];\n const trainEndLogs: Logs[] = [];\n const epochBeginEpochs: number[] = [];\n const epochEndEpochs: number[] = [];\n const batchBeginBatches: number[] = [];\n const batchEndBatches: number[] = [];\n const batchEndLosses: number[] = [];\n const epochEndLosses: number[] = [];\n const customCallbackArgs: CustomCallbackArgs = {\n onTrainBegin: async (logs?: Logs) => {\n trainBeginLogs.push(logs);\n },\n onTrainEnd: async (logs?: Logs) => {\n trainEndLogs.push(logs);\n },\n onEpochBegin: async (epoch: number, logs?: Logs) => {\n epochBeginEpochs.push(epoch);\n },\n onEpochEnd: async (epoch: number, logs?: Logs) => {\n epochEndEpochs.push(epoch);\n epochEndLosses.push(logs['loss']);\n },\n onBatchBegin: async (batch: number, logs?: Logs) => {\n batchBeginBatches.push(batch);\n },\n onBatchEnd: async (batch: number, logs?: Logs) => {\n batchEndBatches.push(batch);\n batchEndLosses.push(logs['loss']);\n }\n };\n const customCallback = isArgs ? customCallbackArgs :\n new CustomCallback(customCallbackArgs);\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n await model.fit(inputs, targets, {\n batchSize: 2,\n epochs: 2,\n callbacks: isArray ? [customCallback] : customCallback,\n });\n expect(trainBeginLogs.length).toEqual(1);\n expect(trainEndLogs.length).toEqual(1);\n expect(epochBeginEpochs).toEqual([0, 1]);\n expect(epochEndEpochs).toEqual([0, 1]);\n expect(batchBeginBatches).toEqual([0, 1, 2, 0, 1, 2]);\n expect(batchEndBatches).toEqual([0, 1, 2, 0, 1, 2]);\n\n // The optimization problem is a convex one (a single Dense layer),\n // the learning rate low (default 0.01 for SGD). So it should be fine to\n // assert monotonic assert monotonic decrease in loss value.\n expect(batchEndLosses.length).toEqual(6);\n for (let i = 1; i < batchEndLosses.length; ++i) {\n expect(batchEndLosses[i]).toBeLessThan(batchEndLosses[i - 1]);\n }\n expect(epochEndLosses.length).toEqual(2);\n expect(epochEndLosses[1]).toBeLessThan(epochEndLosses[0]);\n });\n }\n }\n\n it('Using custom regularizer', async () => {\n // The golden values used for assertion can be obtained with PyKeras code:\n //\n // ```python\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential([\n // keras.layers.Dense(\n // 1, kernel_initializer='ones', use_bias=False, input_shape=[4],\n // kernel_regularizer=keras.regularizers.l1_l2(1, 1))\n // ]);\n //\n // xs = np.ones([5, 4])\n // ys = np.ones([5, 1])\n //\n // model.compile(optimizer='sgd', loss='mean_squared_error')\n //\n // history = model.fit(xs, ys, epochs=2)\n // print(model.get_weights()[0])\n // print(history.history)\n //\n // ```\n createDenseModelAndData(false, tfl.regularizers.l1l2({l1: 1, l2: 1}));\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 2});\n expectTensorsClose(\n model.layers[1].getWeights()[0],\n tensor2d([0.829, 0.829, 0.829, 0.829], [4, 1]));\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(17);\n expect(history.history.loss[1]).toBeCloseTo(13.92);\n });\n\n it('Using string regularizer', async () => {\n // The golden values used for assertion can be obtained with PyKeras code:\n //\n // ```python\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential([\n // keras.layers.Dense(\n // 1, kernel_initializer='ones', use_bias=False, input_shape=[4],\n // kernel_regularizer='l1l2')\n // ]);\n //\n // xs = np.ones([5, 4])\n // ys = np.ones([5, 1])\n //\n // model.compile(optimizer='sgd', loss='mean_squared_error')\n //\n // history = model.fit(xs, ys, epochs=2)\n // print(model.get_weights()[0])\n // print(history.history)\n //\n // ```\n createDenseModelAndData(false, 'l1l2');\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n const history =\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 2});\n expectTensorsClose(\n model.layers[1].getWeights()[0],\n tensor2d([0.884, 0.884, 0.884, 0.884], [4, 1]));\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(9.08);\n expect(history.history.loss[1]).toBeCloseTo(7.68);\n });\n\n it('and then set weights to new weights', async () => {\n createDenseModelAndData(false, 'l1l2');\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 2});\n const w = zeros([4, 1]);\n model.layers[1].setWeights([w]);\n expectTensorsClose(model.layers[1].getWeights()[0], w);\n });\n\n it('and then set weights to own weights', async () => {\n createDenseModelAndData(false, 'l1l2');\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 2});\n const w = model.layers[1].getWeights()[0];\n model.layers[1].setWeights([w]);\n expectTensorsClose(model.layers[1].getWeights()[0], w);\n });\n\n class CustomCallbackForTest extends tfl.CustomCallback {\n constructor(readonly recordedParams: Params[]) {\n super({\n onTrainBegin: async () => {\n recordedParams.push(this.params);\n }\n });\n }\n }\n\n it('Custom callback params: no validation', async () => {\n createDenseModelAndData();\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const recordedParams: Params[] = [];\n const epochs = 3;\n const batchSize = 2;\n await model.fit(inputs, targets, {\n epochs,\n batchSize,\n callbacks: new CustomCallbackForTest(recordedParams)\n });\n expect(recordedParams[0].epochs).toEqual(epochs);\n expect(recordedParams[0].initialEpoch).toEqual(0);\n expect(recordedParams[0].samples).toEqual(inputs.shape[0]);\n expect(recordedParams[0].steps).toEqual(null);\n expect(recordedParams[0].batchSize).toEqual(batchSize);\n expect(recordedParams[0].doValidation).toEqual(false);\n expect(recordedParams[0].metrics).toEqual(['loss']);\n });\n\n it('Custom callback params: has validation', async () => {\n createDenseModelAndData();\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const recordedParams: Params[] = [];\n const epochs = 3;\n const batchSize = 2;\n const validationSplit = 0.2;\n await model.fit(inputs, targets, {\n epochs,\n batchSize,\n validationSplit,\n callbacks: new CustomCallbackForTest(recordedParams)\n });\n expect(recordedParams[0].epochs).toEqual(epochs);\n expect(recordedParams[0].initialEpoch).toEqual(0);\n expect(recordedParams[0].samples)\n .toEqual(Math.round(inputs.shape[0] * (1 - validationSplit)));\n expect(recordedParams[0].steps).toEqual(null);\n expect(recordedParams[0].batchSize).toEqual(batchSize);\n expect(recordedParams[0].doValidation).toEqual(true);\n expect(recordedParams[0].metrics).toEqual(['loss', 'val_loss']);\n });\n\n class StopAfterNEpochs extends tfl.Callback {\n private readonly epochsToTrain: number;\n constructor(epochsToTrain: number) {\n super();\n this.epochsToTrain = epochsToTrain;\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (epoch === this.epochsToTrain - 1) {\n this.model.stopTraining = true;\n }\n }\n }\n\n it('Stop training at the end of an epoch: Functional model', async () => {\n createDenseModelAndData(true);\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Order 10 epochs of training, but the training should stop after two\n // epochs due to the callback.\n const history = await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 10,\n callbacks: [new StopAfterNEpochs(2)]\n });\n expect(history.history.loss.length).toEqual(2);\n });\n\n class StopAfterNBatches extends tfl.Callback {\n private readonly batchesToTrain: number;\n constructor(batchesToTrain: number) {\n super();\n this.batchesToTrain = batchesToTrain;\n }\n\n async onBatchEnd(batch: number, logs?: Logs) {\n if (batch === this.batchesToTrain - 1) {\n this.model.stopTraining = true;\n }\n }\n }\n\n it('Stop training at the end of a batch: Sequential model', async () => {\n const sequentialModel = tfl.sequential();\n sequentialModel.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', inputShape: [inputSize]}));\n // numSamples is 5.\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n sequentialModel.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Order 10 epochs of training, but the training should stop after only one\n // epochs due to the callback that orders the training to stop after two\n // batches. The first epoch should have five batches due to a batchSize\n // of 1.\n const history = await sequentialModel.fit(\n inputs, targets,\n {batchSize: 1, epochs: 10, callbacks: [new StopAfterNBatches(2)]});\n expect(history.history.loss.length).toEqual(1);\n });\n\n it('Stop LayersModel.fit() using non-class object callback function',\n async () => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n\n let numEpochsDone = 0;\n const epochs = 8;\n const stopAfterEpoch = 3;\n let history = await model.fit(inputs, targets, {\n epochs,\n callbacks: {\n onEpochEnd: async (epoch: number, logs?: UnresolvedLogs) => {\n numEpochsDone++;\n if (epoch === stopAfterEpoch) {\n model.stopTraining = true;\n }\n }\n }\n });\n expect(numEpochsDone).toEqual(stopAfterEpoch + 1);\n expect(history.history.loss.length).toEqual(stopAfterEpoch + 1);\n\n // Check that model.fit can still be called after force stopping.\n history = await model.fit(inputs, targets, {epochs: 2});\n expect(history.history.loss.length).toEqual(2);\n });\n\n it('Stop training resets at start of LayersModel.fit()', async () => {\n const sequentialModel = tfl.sequential();\n sequentialModel.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', inputShape: [inputSize]}));\n // numSamples is 5.\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n sequentialModel.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Order 10 epochs of training, but the training should stop after only one\n // epochs due to the callback that orders the training to stop after two\n // batches. The first epoch should have five batches due to a batchSize\n // of 1.\n let history = await sequentialModel.fit(\n inputs, targets,\n {batchSize: 1, epochs: 10, callbacks: [new StopAfterNBatches(2)]});\n expect(history.history.loss.length).toEqual(1);\n\n // Running fit again should now run to completion\n history =\n await sequentialModel.fit(inputs, targets, {batchSize: 1, epochs: 10});\n expect(history.history.loss.length).toEqual(10);\n });\n\n it('Model.dispose() cleans up owned optimizer: Functional', async () => {\n const input1 = tfl.input({shape: [2]});\n const input2 = tfl.input({shape: [2]});\n const y1 = tfl.layers.add().apply([input1, input2]);\n const y2 = tfl.layers.concatenate().apply([input1, input2]);\n const output1 =\n tfl.layers\n .dense({units: 1, activation: 'linear', kernelInitializer: 'zeros'})\n .apply(y1) as tfl.SymbolicTensor;\n const output2 =\n tfl.layers\n .dense(\n {units: 1, activation: 'sigmoid', kernelInitializer: 'zeros'})\n .apply(y2) as tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n model.compile(\n {loss: ['meanSquaredError', 'binaryCrossentropy'], optimizer: 'adam'});\n\n const xs: Tensor[] = [zeros([4, 2]), zeros([4, 2])];\n const ys: Tensor[] = [zeros([4, 1]), zeros([4, 1])];\n\n await model.fit(xs, ys, {epochs: 1});\n const numTensors1 = memory().numTensors;\n\n const disposalResult = model.dispose();\n const numTensors2 = memory().numTensors;\n // The optimizerNumGlobalVariables comes from the intrinsic weights of the\n // ADAM optimizer, e.g., accBeta1, accBeta2.\n const optimizerNumGlobalVariables = 2;\n // The optimizerNumVariablesPerWeight comes from accumulatedFirstMoment and\n // accumulatedSecondMoment, which are computed per model weight.\n const optimizerNumVariablesPerWeight = 2;\n const numModelWeights = 4;\n expect(disposalResult.numDisposedVariables)\n .toEqual(\n numModelWeights + optimizerNumGlobalVariables +\n numModelWeights * optimizerNumVariablesPerWeight);\n expect(disposalResult.refCountAfterDispose).toEqual(0);\n expect(numTensors1 - numTensors2)\n .toEqual(\n numModelWeights + optimizerNumGlobalVariables +\n numModelWeights * optimizerNumVariablesPerWeight);\n });\n\n it('Model.dispose() cleans up owned optimizer: Sequential', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [2]}));\n model.compile({loss: 'meanSquaredError', optimizer: 'adam'});\n\n const xs = zeros([4, 2]);\n const ys = zeros([4, 1]);\n\n await model.fit(xs, ys, {epochs: 1});\n const numTensors1 = memory().numTensors;\n\n const disposalResult = model.dispose();\n const numTensors2 = memory().numTensors;\n\n // The optimizerNumGlobalVariables comes from the intrinsic weights of the\n // ADAM optimizer, e.g., accBeta1, accBeta2.\n const optimizerNumGlobalVariables = 2;\n // The optimizerNumVariablesPerWeight comes from accumulatedFirstMoment and\n // accumulatedSecondMoment, which are computed per model weight.\n const optimizerNumVariablesPerWeight = 2;\n const numModelWeights = 2;\n expect(disposalResult.numDisposedVariables)\n .toEqual(\n numModelWeights + optimizerNumGlobalVariables +\n numModelWeights * optimizerNumVariablesPerWeight);\n expect(disposalResult.refCountAfterDispose).toEqual(0);\n expect(numTensors1 - numTensors2)\n .toEqual(\n numModelWeights + optimizerNumGlobalVariables +\n numModelWeights * optimizerNumVariablesPerWeight);\n });\n\n it('Model.dispose() skips non-owned optimizer: Functional', async () => {\n const input1 = tfl.input({shape: [2]});\n const input2 = tfl.input({shape: [2]});\n const y1 = tfl.layers.add().apply([input1, input2]);\n const y2 = tfl.layers.concatenate().apply([input1, input2]);\n const output1 =\n tfl.layers\n .dense({units: 1, activation: 'linear', kernelInitializer: 'zeros'})\n .apply(y1) as tfl.SymbolicTensor;\n const output2 =\n tfl.layers\n .dense(\n {units: 1, activation: 'sigmoid', kernelInitializer: 'zeros'})\n .apply(y2) as tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n const optimizer = new tfc.AdamOptimizer(1e-3, 0.9, 0.999, 1e-6);\n model.compile(\n {loss: ['meanSquaredError', 'binaryCrossentropy'], optimizer});\n\n const xs: Tensor[] = [zeros([4, 2]), zeros([4, 2])];\n const ys: Tensor[] = [zeros([4, 1]), zeros([4, 1])];\n\n await model.fit(xs, ys, {epochs: 1});\n const numTensors1 = memory().numTensors;\n\n const disposalResult = model.dispose();\n const numTensors2 = memory().numTensors;\n // Only the weights of the model (not including the optimizer) should have\n // been disposed.\n expect(disposalResult.numDisposedVariables).toEqual(4);\n expect(disposalResult.refCountAfterDispose).toEqual(0);\n expect(numTensors1 - numTensors2).toEqual(4);\n });\n\n it('Model.dispose() skips non-owned optimizer: Sequential', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [2]}));\n const optimizer = new tfc.AdamOptimizer(1e-3, 0.9, 0.999, 1e-6);\n model.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = zeros([4, 2]);\n const ys = zeros([4, 1]);\n\n await model.fit(xs, ys, {epochs: 1});\n const numTensors1 = memory().numTensors;\n\n const disposalResult = model.dispose();\n const numTensors2 = memory().numTensors;\n\n // Only the Model's own weights should have been disposed.\n expect(disposalResult.numDisposedVariables).toEqual(2);\n expect(disposalResult.refCountAfterDispose).toEqual(0);\n expect(numTensors1 - numTensors2).toEqual(2);\n });\n\n it('Invalid dict loss: nonexistent output name', () => {\n createDenseModelAndData();\n expect(() => model.compile({\n optimizer: 'SGD',\n loss: {'Foo': 'meanSquaredError'}\n })).toThrowError(/Unknown entry in loss dictionary:.*Foo.*/);\n });\n\n it('Invalid Array loss: missing loss for an output', () => {\n createDenseModelWithTwoOutputsAndData();\n expect(() => twoOutputModel.compile({\n optimizer: 'SGD',\n loss: ['meanSquaredError']\n })).toThrowError(/should have one entry per model output.*has 2 output/);\n });\n\n it('Calling fit without compile leads to error', () => {\n createDenseModelAndData(true);\n const fitPromise =\n model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n fitPromise.catch(error => {\n expect(error.message).toContain('You must compile a model before');\n });\n });\n\n it('Invalid batchSize leads to Error', async () => {\n createDenseModelAndData();\n const badBatchSizeValues: Array = [0, -1, 3.14, 'a'];\n for (const batchSize of badBatchSizeValues) {\n let errorCaught: Error;\n try {\n // tslint:disable-next-line:no-any\n await model.fit(inputs, targets, {batchSize: batchSize as any});\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(`batchSize is required to be a positive integer, but got ${\n batchSize}`);\n }\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.fit with training-sensitive layers', () => {\n it('Correct training arg during fit/evaluate/predict', async () => {\n const inputTensor =\n tfl.layers.input({shape: [1], name: 'inputLayer1', dtype: 'float32'});\n const layer1 = tfl.layers.dense({units: 1});\n const layer2 = tfl.layers.dropout({rate: 0.5});\n\n // Hook the dropout layer to observe the training arg values during the\n // fit(), evaluate() and predict() calls.\n const dropoutLayerTrainingFlags: boolean[] = [];\n const recordDropoutTrainingArgHook =\n (inputs: Tensor|Tensor[], kwargs: Kwargs) => {\n dropoutLayerTrainingFlags.push(kwargs.training as boolean);\n };\n layer2.setCallHook(recordDropoutTrainingArgHook);\n\n const output =\n layer2.apply(layer1.apply(inputTensor)) as tfl.SymbolicTensor;\n const model =\n new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const xs = ones([4, 1]);\n const ys = ones([4, 1]);\n\n // 1. Call fit: Dropout layer should be called twice, with training as\n // true.\n await model.fit(xs, ys, {epochs: 2, batchSize: 4});\n expect(dropoutLayerTrainingFlags).toEqual([true, true]);\n\n // 2. Call evaluate, Dropout layer should be called once, without\n // training defined.\n model.evaluate(xs, ys, {batchSize: 4});\n expect(dropoutLayerTrainingFlags).toEqual([true, true, undefined]);\n\n // 3. Call predict, Dropout layer should be called once, without training\n // defined.\n model.predict(xs, {batchSize: 4});\n expect(dropoutLayerTrainingFlags).toEqual([\n true, true, undefined, undefined\n ]);\n });\n});\n\ndescribeMathCPUAndGPU(\n 'LayersModel.predict and LayersModel.evaluate: No memory leak', () => {\n const inputSize = 4; // Input vector size for model with one input.\n\n const inputTensor = tfl.layers.input(\n {shape: [inputSize], name: 'inputLayer1', dtype: 'float32'});\n let model: tfl.LayersModel;\n let inputs: Tensor;\n let targets: Tensor;\n\n function createDenseModelAndData(\n numSamples: number,\n kernelRegularizer?: string|Regularizer,\n biasRegularizer?: string|Regularizer,\n ): void {\n const layer = tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', kernelRegularizer});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n }\n\n it('predict: Single batch', () => {\n const numExamples = 5;\n const batchSize = 32; // batchSize >= numExamples ==> a single batch.\n createDenseModelAndData(numExamples);\n // Burn-in call.\n let out = model.predict(inputs, {batchSize}) as Tensor;\n out.dispose();\n const numTensors0 = memory().numTensors;\n\n // Actual call.\n out = model.predict(inputs, {batchSize}) as Tensor;\n out.dispose();\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('predict: Two batches', () => {\n const numExamples = 5;\n const batchSize = 3; // batchSize < numExamples ==> multiple batches.\n createDenseModelAndData(numExamples);\n // Burn-in call.\n let out = model.predict(inputs, {batchSize}) as Tensor;\n out.dispose();\n const numTensors0 = memory().numTensors;\n\n // Actual call.\n out = model.predict(inputs, {batchSize}) as Tensor;\n out.dispose();\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('evaluate: Single batch, no metric', () => {\n const numExamples = 5;\n createDenseModelAndData(numExamples);\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const batchSize = 32; // batchSize >= numExamples ==> a single batch.\n // Burn-in call.\n let out = model.evaluate(inputs, targets, {batchSize}) as Tensor;\n out.dispose();\n const numTensors0 = memory().numTensors;\n\n // Actual call.\n out = model.evaluate(inputs, targets, {batchSize}) as Tensor;\n out.dispose();\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('evaluate: Two batches, no metric', () => {\n const numExamples = 5;\n createDenseModelAndData(numExamples);\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const batchSize = 3; // batchSize < numExamples ==> multiple batches.\n // Burn-in call.\n let out = model.evaluate(inputs, targets, {batchSize}) as Tensor;\n out.dispose();\n const numTensors0 = memory().numTensors;\n\n // Actual call.\n out = model.evaluate(inputs, targets, {batchSize}) as Tensor;\n out.dispose();\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n\n it('evaluate: Two batches, with metric', () => {\n const numExamples = 5;\n createDenseModelAndData(numExamples);\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mae']});\n const batchSize = 3; // batchSize < numExamples ==> multiple batches.\n // Burn-in call.\n let out = model.evaluate(inputs, targets, {batchSize}) as Tensor[];\n out.forEach(tensor => tensor.dispose());\n const numTensors0 = memory().numTensors;\n\n // Actual call.\n out = model.evaluate(inputs, targets, {batchSize}) as Tensor[];\n out.forEach(tensor => tensor.dispose());\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n });\n });\n\ndescribeMathCPUAndGPU('LayersModel.fit: No memory leak', () => {\n const inputSize = 4; // Input vector size for model with one input.\n const numSamples = 5; // Number of samples in a batch.\n\n const inputTensor = tfl.layers.input(\n {shape: [inputSize], name: 'inputLayer1', dtype: 'float32'});\n let model: tfl.LayersModel;\n let inputs: Tensor;\n let targets: Tensor;\n let valInputs: Tensor;\n let valTargets: Tensor;\n\n function createDenseModelAndData(\n useBias = false,\n kernelRegularizer?: string|Regularizer,\n biasRegularizer?: string|Regularizer,\n ): void {\n const layer = tfl.layers.dense(\n {units: 1, useBias, kernelInitializer: 'ones', kernelRegularizer});\n const output = layer.apply(inputTensor) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: [inputTensor], outputs: [output]});\n inputs = ones([numSamples, inputSize]);\n targets = ones([numSamples, 1]);\n valInputs = zeros([numSamples, inputSize]);\n valTargets = zeros([numSamples, 1]);\n }\n\n it('Repeated fit calls leads to no memory leak: no validation or metrics',\n async (done) => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: batchSize=1, ' +\n 'no validation or metrics',\n async done => {\n createDenseModelAndData();\n\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n const batchSize = 1; // Use batchSize = 1.\n await model.fit(inputs, targets, {batchSize, epochs: 1});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(inputs, targets, {batchSize, epochs: 1});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: with metrics', async done => {\n createDenseModelAndData();\n\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mse']});\n // Use batchSize === numSamples to get exactly one batch.\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(inputs, targets, {batchSize: numSamples, epochs: 1});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: validationSplit',\n async done => {\n createDenseModelAndData();\n\n const validationSplit = 0.4;\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationSplit});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationSplit});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: validationData',\n async done => {\n createDenseModelAndData();\n\n const validationData: [Tensor, Tensor] = [valInputs, valTargets];\n model.compile({optimizer: 'SGD', loss: 'meanSquaredError'});\n // Use batchSize === numSamples to get exactly one batch.\n await model.fit(\n inputs, targets, {batchSize: numSamples, epochs: 1, validationData});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationData});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: metrics & validationSplit',\n async done => {\n createDenseModelAndData();\n\n const validationSplit = 0.4;\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mse']});\n // Use batchSize === numSamples to get exactly one batch.\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationSplit});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationSplit});\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Repeated fit calls leads to no memory leak: batchSize=2, ' +\n 'metrics & validationSplit',\n async done => {\n createDenseModelAndData();\n\n const validationSplit = 0.4;\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mse']});\n const batchSize = 2; // Use batchSize < numSamples.\n const epochsPerIter = 2;\n await model.fit(\n inputs, targets, {batchSize, epochs: 1, validationSplit});\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 2; ++i) {\n const history = await model.fit(\n inputs, targets,\n {batchSize, epochs: epochsPerIter, validationSplit});\n expect(history.history['loss'].length).toEqual(epochsPerIter);\n expect(history.history['val_loss'].length).toEqual(epochsPerIter);\n expect(history.history['mse'].length).toEqual(epochsPerIter);\n expect(history.history['val_mse'].length).toEqual(epochsPerIter);\n const numTensorsNow = memory().numTensors;\n if (numTensorsNow > numTensors0) {\n done.fail(\n `Memory leak detected during fit(): Leaked ` +\n `${numTensorsNow - numTensors0} tensor(s) after the ` +\n `${i + 1}-th fit() call.`);\n }\n }\n done();\n });\n\n it('Fit with onEpochEnd callback: no memory leak: validation & metrics',\n async done => {\n createDenseModelAndData();\n\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mse']});\n const validationSplit = 0.4;\n\n // First, perform a burn-in call.\n await model.fit(\n inputs, targets,\n {batchSize: numSamples, epochs: 1, validationSplit});\n const numTensors0 = memory().numTensors;\n\n // Perform actual testing calls.\n const numFitCalls = 2;\n for (let n = 0; n < numFitCalls; ++n) {\n const tensorCounts: number[] = [];\n await model.fit(inputs, targets, {\n batchSize: numSamples,\n epochs: 4,\n validationSplit,\n callbacks: {\n onEpochEnd: async () => {\n tensorCounts.push(memory().numTensors);\n }\n }\n });\n expect(tensorCounts.length).toEqual(4);\n if (unique(tensorCounts).length !== 1) {\n done.fail(\n `Detected WebGL memory leak during fit() call with ` +\n `onEpochEnd callback: tensor counts: ${tensorCounts}.`);\n }\n const numTensors1 = memory().numTensors;\n if (numTensors1 > numTensors0) {\n done.fail(\n `Detected memory leak of ${numTensors1 - numTensors0} ` +\n `tensor(s) after fit() call ${n + 1} of ${numFitCalls} ` +\n `with onEpochEnd callback.`);\n }\n }\n done();\n });\n\n it('Fit with onBatchEnd callback: no memory leak: validation & metrics',\n async done => {\n createDenseModelAndData();\n\n model.compile(\n {optimizer: 'SGD', loss: 'meanSquaredError', metrics: ['mse']});\n const validationSplit = 0.4;\n const epochs = 3;\n const batchesPerEpoch = numSamples * (1 - validationSplit);\n\n // First, perform a burn-in call.\n await model.fit(inputs, targets, {\n batchSize: 1,\n epochs,\n validationSplit,\n });\n const numTensors0 = memory().numTensors;\n\n // Perform actual testing calls.\n for (let n = 0; n < 2; ++n) {\n const tensorCounts: number[] = [];\n await model.fit(inputs, targets, {\n batchSize: 1,\n epochs,\n validationSplit,\n callbacks: {\n onBatchEnd: async (batch: number, logs: Logs) => {\n tensorCounts.push(memory().numTensors);\n }\n }\n });\n for (let epochIndex = 0; epochIndex < epochs; ++epochIndex) {\n // Get the tensor counts within an epoch (i.e., from the first\n // batch till the penultimate one.) Assert that the counts are\n // constant, i.e., no increase in the tensor count within the\n // epoch. N.B.: Even though the tensor count is expected to be\n // constant across batches, across epochs, the count will increase,\n // due to the per-epoch loss and metric values stored for the\n // returned history object, which are currently downloaded via\n // data() calls only at the end of the fit() call.\n const beginBatch = batchesPerEpoch * epochIndex;\n const endBatch = batchesPerEpoch * (epochIndex + 1);\n const inEpochTensorCounts =\n tensorCounts.slice(beginBatch, endBatch - 1);\n if (unique(inEpochTensorCounts).length !== 1) {\n done.fail(\n `Detected WebGL memory leak within epoch ${epochIndex + 1} ` +\n `of ${epochs} of the fit() call with ` +\n `onBatchEnd callback: tensor counts: ${inEpochTensorCounts}.`);\n }\n }\n expect(tensorCounts.length).toEqual(batchesPerEpoch * epochs);\n const numTensors1 = memory().numTensors;\n if (numTensors1 > numTensors0) {\n done.fail(\n `Detected memory leak of ${numTensors1 - numTensors0} ` +\n `tensor(s) after fit() call with callback.`);\n }\n }\n done();\n });\n});\n\ndescribeMathGPU('LayersModel.fit: yieldEvery', () => {\n function createDummyModel(inputSize: number): tfl.LayersModel {\n const model = tfl.sequential();\n const layerSize = 10;\n model.add(tfl.layers.dense(\n {units: layerSize, inputShape: [inputSize], activation: 'relu'}));\n model.add(tfl.layers.dense({units: 1}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n return model;\n }\n\n it('auto: 1 batch per epoch; 5 epochs', async () => {\n const wait = DEFAULT_YIELD_EVERY_MS;\n const timeBetweenCalls = [\n 0,\n 1,\n wait + 1, // Should call.\n wait + 1, // Should call.\n 1,\n 1,\n ];\n let counter = 0;\n let prevTime = 0;\n spyOn(util, 'now').and.callFake(() => {\n prevTime += timeBetweenCalls[counter++];\n return prevTime;\n });\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 2;\n const numExamples = 10;\n const epochs = 5;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const onYieldEpochIds: number[] = [];\n const onYieldBatchesIds: number[] = [];\n const history = await model.fit(xs, ys, {\n epochs,\n batchSize: numExamples,\n callbacks: {\n onYield: async (epoch, batch, _logs) => {\n onYieldBatchesIds.push(batch);\n onYieldEpochIds.push(epoch);\n }\n }\n });\n expect(history.history.loss.length).toEqual(epochs);\n // There are 5 batches in total (1 batch per epoch). We expect next frame\n // to be called twice, after epoch 1 and after epoch 2.\n expect(nextFrameCallCount).toBe(2);\n expect(onYieldEpochIds).toEqual([1, 2]);\n expect(onYieldBatchesIds).toEqual([0, 0]);\n });\n\n it('auto: 2 batches per epoch; 4 epochs', async () => {\n const yieldEvery = DEFAULT_YIELD_EVERY_MS;\n const timeBetweenCalls = [\n 0,\n 1,\n yieldEvery + 1, // Should call.\n yieldEvery + 1, // Should call.\n 1,\n yieldEvery + 1, // SHould call.\n yieldEvery + 1, // Should call.\n 1,\n 1,\n ];\n let counter = 0;\n let prevTime = 0;\n spyOn(util, 'now').and.callFake(() => {\n prevTime += timeBetweenCalls[counter++];\n return prevTime;\n });\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 2;\n const numExamples = 10;\n const epochs = 4;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const onYieldEpochIds: number[] = [];\n const onYieldBatchesIds: number[] = [];\n const history = await model.fit(xs, ys, {\n epochs,\n batchSize: numExamples / 2,\n callbacks: {\n onYield: async (epoch, batch, _logs) => {\n onYieldBatchesIds.push(batch);\n onYieldEpochIds.push(epoch);\n }\n }\n });\n expect(history.history.loss.length).toEqual(epochs);\n // There are 8 batches in total (2 batches per epoch). We expect next\n // frame to be called 3 times, after (epoch 0, batch 1), (epoch 1, batch 0)\n // (epoch 2, batch 0) and (epoch 2, batch 1).\n expect(nextFrameCallCount).toBe(4);\n expect(onYieldEpochIds).toEqual([0, 1, 2, 2]);\n expect(onYieldBatchesIds).toEqual([1, 0, 0, 1]);\n });\n\n it('yieldEvery: 5, 1 batch per epoch; 5 epochs', async () => {\n const yieldEvery = 5;\n const timeBetweenCalls = [\n 0, 1,\n yieldEvery + 1, // Should call.\n 1, yieldEvery + 1, // Should call.\n yieldEvery + 1, // Should call.\n ];\n let counter = 0;\n let prevTime = 0;\n spyOn(util, 'now').and.callFake(() => {\n prevTime += timeBetweenCalls[counter++];\n return prevTime;\n });\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 2;\n const numExamples = 10;\n const epochs = 5;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const onYieldEpochIds: number[] = [];\n const onYieldBatchesIds: number[] = [];\n const history = await model.fit(xs, ys, {\n epochs,\n batchSize: numExamples,\n yieldEvery,\n callbacks: {\n onYield: async (epoch, batch, _logs) => {\n onYieldBatchesIds.push(batch);\n onYieldEpochIds.push(epoch);\n }\n }\n });\n expect(history.history.loss.length).toEqual(epochs);\n // There are 5 batches in total (1 batch per epoch). We expect next frame\n // to be called 3 times, after epoch 1, epoch 3 and epoch 4.\n expect(nextFrameCallCount).toBe(3);\n expect(onYieldEpochIds).toEqual([1, 3, 4]);\n expect(onYieldBatchesIds).toEqual([0, 0, 0]);\n });\n\n it('fails when onYield is provided, but yieldEvery is never', async done => {\n const inputSize = 2;\n const numExamples = 10;\n const epochs = 5;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n try {\n await model.fit(xs, ys, {\n epochs,\n batchSize: numExamples,\n yieldEvery: 'never',\n callbacks: {onYield: async (_epoch, _batch, _logs) => {}}\n });\n done.fail('Model.fit should fail');\n } catch {\n done();\n }\n });\n\n it('batch: uneven 9 batches per epoch; 2 epochs', async () => {\n const presetBatchTimestamps = [0, 2, 4, 6, 8, 10];\n let counter = 0;\n spyOn(util, 'now').and.callFake(() => presetBatchTimestamps[counter++]);\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 1;\n const numExamples = 10;\n const epochs = 2;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const history =\n await model.fit(xs, ys, {epochs, batchSize: 4, yieldEvery: 'batch'});\n expect(history.history.loss.length).toEqual(epochs);\n // There are `ceil(10 / 4)` batches per epoch.\n expect(nextFrameCallCount).toEqual(Math.ceil(10 / 4) * epochs);\n });\n\n it('epoch: 10 batches per epoch; 2 epochs', async () => {\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 5;\n const numExamples = 10;\n const epochs = 2;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const history = await model.fit(\n xs, ys, {epochs, batchSize: numExamples / 10, yieldEvery: 'epoch'});\n expect(history.history.loss.length).toEqual(epochs);\n expect(nextFrameCallCount).toEqual(epochs);\n });\n\n it('never: 2 batches per epoch; 20 epochs', async () => {\n let nextFrameCallCount = 0;\n spyOn(tfc, 'nextFrame').and.callFake(async () => {\n nextFrameCallCount++;\n });\n\n const inputSize = 5;\n const numExamples = 10;\n const epochs = 4;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n const history = await model.fit(\n xs, ys, {epochs, batchSize: numExamples / 2, yieldEvery: 'never'});\n expect(history.history.loss.length).toEqual(epochs);\n // Due to yieldEvery = 'never', no `await nextFrame()` call should have\n // happened.\n expect(nextFrameCallCount).toEqual(0);\n });\n\n it('resolveScalarInLogs is not called if no custom callbacks', async () => {\n const inputSize = 1;\n const numExamples = 10;\n const batchSize = 2;\n const epochs = 2;\n const model = createDummyModel(inputSize);\n const xs = ones([numExamples, inputSize]);\n const ys = ones([numExamples, 1]);\n\n const spy = spyOn(logs, 'resolveScalarsInLogs').and.callThrough();\n await model.fit(xs, ys, {epochs, batchSize, yieldEvery: 'never'});\n expect(spy).not.toHaveBeenCalled();\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.trainOnBatch', () => {\n // Reference Python Keras code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Dense(\n // 1, input_shape=[3], kernel_initializer='zeros'))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // batch_size = 4\n // xs = np.ones([batch_size, 3])\n // ys = np.ones([batch_size, 1])\n //\n // for _ in range(3):\n // loss = model.train_on_batch(xs, ys)\n // print(loss)\n // ```\n it('Sequential MLP: correctness', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 1, inputShape: [3], kernelInitializer: 'zeros'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const batchSize = 4;\n const xs = tfc.ones([batchSize, 3]);\n const ys = tfc.ones([batchSize, 1]);\n let loss = await model.trainOnBatch(xs, ys) as number;\n expect(loss).toBeCloseTo(1.0);\n loss = await model.trainOnBatch(xs, ys) as number;\n expect(loss).toBeCloseTo(0.8464);\n loss = await model.trainOnBatch(xs, ys) as number;\n expect(loss).toBeCloseTo(0.716393);\n });\n\n // Reference Python Keras code:\n // ```py\n // import keras\n // import numpy as np\n //\n // input1 = keras.Input(shape=[2])\n // input2 = keras.Input(shape=[2])\n // y1 = keras.layers.Add()([input1, input2])\n // y2 = keras.layers.Concatenate()([input1, input2])\n // output1 = keras.layers.Dense(\n // units=1,\n // activation='linear',\n // kernel_initializer='zeros')(y1)\n // output2 = keras.layers.Dense(\n // units=1,\n // activation='sigmoid',\n // kernel_initializer='zeros')(y2)\n // model = keras.Model(inputs=[input1, input2], outputs=[output1, output2])\n // model.compile(loss=['mean_squared_error', 'binary_crossentropy'],\n // optimizer='sgd')\n //\n // batch_size = 4\n // xs1 = np.ones([batch_size, 2])\n // xs2 = np.ones([batch_size, 2])\n // ys1 = np.ones([batch_size, 1])\n // ys2 = np.ones([batch_size, 1])\n //\n // for _ in range(3):\n // losses = model.train_on_batch([xs1, xs2], [ys1, ys2])\n // print(losses)\n // ```\n it('Functional two inputs and two outputs: correctness', async () => {\n const input1 = tfl.input({shape: [2]});\n const input2 = tfl.input({shape: [2]});\n const y1 = tfl.layers.add().apply([input1, input2]);\n const y2 = tfl.layers.concatenate().apply([input1, input2]);\n const output1 =\n tfl.layers\n .dense({units: 1, activation: 'linear', kernelInitializer: 'zeros'})\n .apply(y1) as tfl.SymbolicTensor;\n const output2 =\n tfl.layers\n .dense(\n {units: 1, activation: 'sigmoid', kernelInitializer: 'zeros'})\n .apply(y2) as tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n model.compile(\n {loss: ['meanSquaredError', 'binaryCrossentropy'], optimizer: 'sgd'});\n\n const batchSize = 4;\n const xs1 = tfc.ones([batchSize, 2]);\n const xs2 = tfc.ones([batchSize, 2]);\n const ys1 = tfc.ones([batchSize, 1]);\n const ys2 = tfc.ones([batchSize, 1]);\n let losses = await model.trainOnBatch([xs1, xs2], [ys1, ys2]) as number[];\n expect(losses.length).toEqual(3);\n expect(losses[0]).toBeCloseTo(1.6931472);\n expect(losses[1]).toBeCloseTo(1.0);\n expect(losses[2]).toBeCloseTo(0.6931472);\n losses = await model.trainOnBatch([xs1, xs2], [ys1, ys2]) as number[];\n expect(losses.length).toEqual(3);\n expect(losses[0]).toBeCloseTo(1.3531253);\n expect(losses[1]).toBeCloseTo(0.6724);\n expect(losses[2]).toBeCloseTo(0.68072534);\n losses = await model.trainOnBatch([xs1, xs2], [ys1, ys2]) as number[];\n expect(losses.length).toEqual(3);\n expect(losses[0]).toBeCloseTo(1.1207337);\n expect(losses[1]).toBeCloseTo(0.45212176);\n expect(losses[2]).toBeCloseTo(0.66861194);\n });\n\n // Reference Python Keras code.\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Dense(\n // 3, input_shape=[2], activation='softmax', kernel_initializer='ones'))\n // model.compile(loss='categorical_crossentropy', optimizer='sgd')\n //\n // xs = np.array([[0.5, 0.5], [1, 1], [0, 1]], dtype=np.float32)\n // ys = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=np.float32)\n //\n // for _ in range(3):\n // loss = model.train_on_batch(xs, ys)\n // print(loss)\n // ```\n it('Categorical: Correctness and no memory leak', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n activation: 'softmax',\n kernelInitializer: 'ones'\n }));\n model.compile({loss: 'categoricalCrossentropy', optimizer: 'sgd'});\n\n const xs = tfc.tensor2d([[0.5, 0.5], [1, 1], [0, 1]]);\n const ys = tfc.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]]);\n // Perform burn-in.\n model.trainOnBatch(xs, ys);\n const numTensors0 = memory().numTensors;\n for (let i = 0; i < 3; ++i) {\n const loss = await model.trainOnBatch(xs, ys);\n tfc.tidy(() => {\n if (i === 0) {\n expect(loss).toBeCloseTo(1.0986123);\n } else if (i === 1) {\n expect(loss).toBeCloseTo(1.0978721);\n } else {\n expect(loss).toBeCloseTo(1.0971345);\n }\n });\n // Assert no tensor memory leak.\n expect(memory().numTensors).toBeLessThanOrEqual(numTensors0);\n }\n });\n\n // Reference Python Keras code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Dense(\n // units=3,\n // input_shape=[2],\n // activation='softmax',\n // kernel_initializer='ones'\n // ))\n // model.compile(\n // loss='sparse_categorical_crossentropy',\n // optimizer='sgd',\n // metrics=['acc'])\n // model.summary()\n //\n // xs = np.array([[0, 0.5], [0.5, 1], [0, 1]], dtype=np.float32)\n // ys = np.array([[2], [1], [0]], dtype=np.float32)\n //\n // for _ in range(3):\n // print(model.train_on_batch(xs, ys))\n // ```\n it('Sparse categorical: w/ metrics: correctness and no leak', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n activation: 'softmax',\n kernelInitializer: 'ones'\n }));\n model.compile({\n loss: 'sparseCategoricalCrossentropy',\n optimizer: 'sgd',\n metrics: ['acc']\n });\n\n const xs = tfc.tensor2d([[0, 0.5], [0.5, 1], [0, 1]]);\n const ys = tfc.tensor2d([[2], [1], [0]]);\n\n for (let i = 0; i < 3; ++i) {\n const [loss, acc] = await model.trainOnBatch(xs, ys) as number[];\n if (i === 0) {\n expect(loss).toBeCloseTo(1.0986123);\n expect(acc).toBeCloseTo(0.3333333);\n } else if (i === 1) {\n expect(loss).toBeCloseTo(1.0982422);\n expect(acc).toBeCloseTo(0.6666667);\n } else if (i === 2) {\n expect(loss).toBeCloseTo(1.0978734);\n expect(acc).toBeCloseTo(0.6666667);\n }\n }\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.evaluate', () => {\n const numExamples = 8;\n const inputSize = 2;\n const outputSize = 1;\n let model: tfl.LayersModel;\n let x: Tensor;\n let y: Tensor;\n function prepModel() {\n const input = tfl.layers.input({shape: [inputSize]});\n const dense = tfl.layers.dense(\n {units: outputSize, kernelInitializer: 'ones', useBias: false});\n const output = dense.apply(input) as tfl.SymbolicTensor;\n model = new tfl.LayersModel({inputs: input, outputs: output});\n }\n function prepData() {\n x = ones([numExamples, inputSize]);\n y = ones([numExamples, outputSize]);\n }\n\n it('Calling evaluate before compile leads to error', () => {\n prepModel();\n prepData();\n\n expect(() => model.evaluate(x, y))\n .toThrowError(/must compile a model before/);\n });\n\n const metricsValues: string[][] = [null, ['mse']];\n const batchSizes = [null, 4, 16];\n for (const metrics of metricsValues) {\n for (const batchSize of batchSizes) {\n const testTitle =\n `metrics=${JSON.stringify(metrics)}, batchSize=${batchSize}`;\n it(testTitle, () => {\n prepModel();\n prepData();\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError', metrics});\n const losses = model.evaluate(x, y, {batchSize});\n if (metrics == null) {\n expectTensorsClose(losses as Scalar, scalar(1));\n } else {\n const lossesArray = losses as Scalar[];\n expect(lossesArray.length).toEqual(2);\n expectTensorsClose(lossesArray[0], scalar(1));\n expectTensorsClose(lossesArray[1], scalar(1));\n }\n });\n }\n }\n\n it('1D tensors as inputs and targets', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape: [1]}));\n model.compile(\n {loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc']});\n\n const xs = ones([10]); // A batch of 10, as a 1D tensor.\n const ys = zeros([10]); // A batch of 10, as a 1D tensor.\n // Do a burn-in call first.\n tfc.dispose(model.evaluate(xs, ys, {batchSize: 4}));\n const numTensors0 = memory().numTensors;\n const evalOuts = model.evaluate(xs, ys, {batchSize: 4}) as Tensor[];\n expect(evalOuts.length).toEqual(2); // Loss and acc.\n expect(evalOuts[0].shape).toEqual([]); // Loss as a scalar.\n expect(evalOuts[1].shape).toEqual([]); // Acc as a scalar.\n tfc.dispose(evalOuts);\n // Assert no memory leak.\n expect(memory().numTensors).toEqual(numTensors0);\n });\n\n it('Invalid batchSize value leads to Error', () => {\n prepModel();\n prepData();\n expect(() => model.evaluate(x, y, {batchSize: 0}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got 0/);\n expect(() => model.evaluate(x, y, {batchSize: -2}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got -2/);\n expect(() => model.evaluate(x, y, {batchSize: 3.14}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got 3\\.14/);\n // tslint:disable-next-line:no-any\n expect(() => model.evaluate(x, y, {batchSize: 'a' as any}))\n .toThrowError(\n /batchSize is required to be a positive integer, but got a/);\n });\n});\n\ndescribe('LayersModel trainable setter and getter', () => {\n it('Setting trainable does not affect Layers', () => {\n const model = tfl.sequential({\n layers: [\n tfl.layers.flatten({inputShape: [2, 5]}),\n // Initially non-trainable.\n tfl.layers.dense({units: 3, activation: 'relu', trainable: false}),\n tfl.layers.dense({units: 1}),\n ]\n });\n\n model.trainable = false;\n expect(model.trainable).toEqual(false);\n // The trainable property of the layers should be unaffected.\n expect(model.layers[0].trainable).toEqual(true);\n expect(model.layers[1].trainable).toEqual(false);\n expect(model.layers[2].trainable).toEqual(true);\n\n model.trainable = true;\n expect(model.trainable).toEqual(true);\n expect(model.layers[0].trainable).toEqual(true);\n expect(model.layers[1].trainable).toEqual(false);\n expect(model.layers[2].trainable).toEqual(true);\n });\n\n it('Setting trainable of model sets trainable bit of Variable', async () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 3, activation: 'relu', inputShape: [4]}));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.trainable = false;\n expect(model.layers[0].weights[0].trainable).toEqual(false);\n expect(model.layers[0].weights[1].trainable).toEqual(false);\n expect(model.layers[1].weights[0].trainable).toEqual(false);\n expect(model.layers[1].weights[1].trainable).toEqual(false);\n model.trainable = true;\n expect(model.layers[0].weights[0].trainable).toEqual(true);\n expect(model.layers[0].weights[1].trainable).toEqual(true);\n expect(model.layers[1].weights[0].trainable).toEqual(true);\n expect(model.layers[1].weights[1].trainable).toEqual(true);\n });\n\n it('model.trainable respects layer.trainable', async () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.dense({units: 3, activation: 'relu', inputShape: [4]}));\n model.add(tfl.layers.dense({units: 1}));\n expect(model.trainableWeights.length).toEqual(4);\n model.layers[0].trainable = false;\n expect(model.trainableWeights.length).toEqual(2);\n model.trainable = false;\n expect(model.trainableWeights.length).toEqual(0);\n model.trainable = true;\n expect(model.trainableWeights.length).toEqual(2);\n model.layers[0].trainable = true;\n expect(model.trainableWeights.length).toEqual(4);\n model.trainable = false;\n expect(model.trainableWeights.length).toEqual(0);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.execute', () => {\n function createFunctionalModel():\n [tfl.LayersModel, {[name: string]: tfl.SymbolicTensor}] {\n const input1 = tfl.input({shape: [2, 3]});\n const reshape1 = tfl.layers.reshape({targetShape: [3, 2]}).apply(input1) as\n tfl.SymbolicTensor;\n const input2 = tfl.input({shape: [3, 4]});\n const concat =\n tfl.layers.concatenate({axis: -1}).apply([reshape1, input2]) as\n tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: concat});\n\n return [model, {input1, reshape1, input2, concat}];\n }\n\n function createSequentialModel(): tfl.Sequential {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 6,\n inputShape: [4],\n kernelInitializer: 'zeros',\n useBias: false\n }));\n model.add(tfl.layers.dense(\n {units: 3, kernelInitializer: 'zeros', useBias: false}));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n return model;\n }\n\n it('Functional model: single output', () => {\n const [model, layers] = createFunctionalModel();\n const inputs = [zeros([1, 2, 3]), zeros([1, 3, 4])];\n const outputs = model.execute(inputs, layers['reshape1'].name) as Tensor;\n expectTensorsClose(outputs, zeros([1, 3, 2]));\n });\n\n it('Functional model: multiple outputs', () => {\n const [model, layers] = createFunctionalModel();\n const inputs = [zeros([1, 2, 3]), zeros([1, 3, 4])];\n const outputs = model.execute(inputs, [\n layers['reshape1'].name, layers['concat'].name, layers['input2'].name\n ]) as Tensor[];\n expectTensorsClose(outputs[0], zeros([1, 3, 2]));\n expectTensorsClose(outputs[1], zeros([1, 3, 6]));\n expectTensorsClose(outputs[2], zeros([1, 3, 4]));\n });\n\n it('Functional model: Dictionary of inputs', () => {\n const [model, layers] = createFunctionalModel();\n const inputName1 = model.inputs[0].name;\n const inputName2 = model.inputs[1].name;\n const inputs: NamedTensorMap = {};\n inputs[inputName1] = zeros([1, 2, 3]);\n inputs[inputName2] = zeros([1, 3, 4]);\n const outputs = model.execute(inputs, [\n layers['reshape1'].name, layers['concat'].name, layers['input2'].name\n ]) as Tensor[];\n expectTensorsClose(outputs[0], zeros([1, 3, 2]));\n expectTensorsClose(outputs[1], zeros([1, 3, 6]));\n expectTensorsClose(outputs[2], zeros([1, 3, 4]));\n });\n\n it('Functional model: missing input in dictionary throws Error', () => {\n const [model, layers] = createFunctionalModel();\n const inputName2 = model.inputs[1].name;\n const inputs: NamedTensorMap = {};\n inputs[inputName2] = zeros([1, 3, 4]);\n expect(() => model.execute(inputs, layers['reshape1'].name))\n .toThrowError(/No value is provided for .* input/);\n });\n\n it('Functional model: Incorrect number of inputs throws Error', () => {\n const [model, layers] = createFunctionalModel();\n const inputs = [zeros([1, 2, 3])];\n expect(() => model.execute(inputs, layers['reshape1'].name))\n .toThrowError(/The number of inputs provided \\(1\\) does not match .*2/);\n });\n\n it('Functional model: nonexistent tensor name throws Error', () => {\n const [model, layers] = createFunctionalModel();\n const inputs = [zeros([1, 2, 3]), zeros([1, 3, 4])];\n const nonexistentTensorName =\n layers['reshape1'].name + Math.random().toFixed(4);\n expect(() => model.execute(inputs, nonexistentTensorName))\n .toThrowError(/Cannot find SymbolicTensors for output name/);\n expect(() => model.execute(inputs, [\n layers['reshape1'].name, nonexistentTensorName\n ])).toThrowError(/Cannot find SymbolicTensors for output name/);\n });\n\n it('Functional model: empty outputs string throws Error', () => {\n const model = createFunctionalModel()[0];\n const inputs = [zeros([1, 2, 3]), zeros([1, 3, 4])];\n expect(() => model.execute(inputs, [])).toThrowError(/empty Array/);\n });\n\n it('Sequential model: singleton input', () => {\n const model = createSequentialModel();\n const input = zeros([2, 4]);\n const outputs = model.execute(input, [\n (model.layers[2].output as tfl.SymbolicTensor).name,\n (model.layers[1].output as tfl.SymbolicTensor).name,\n (model.layers[0].output as tfl.SymbolicTensor).name,\n ]) as Tensor[];\n expectTensorsClose(outputs[0], zeros([2, 1]));\n expectTensorsClose(outputs[1], zeros([2, 3]));\n expectTensorsClose(outputs[2], zeros([2, 6]));\n });\n\n it('Sequential model: length-1 Array input', () => {\n const model = createSequentialModel();\n const input = [zeros([2, 4])];\n const output = model.execute(\n input,\n (model.layers[1].output as tfl.SymbolicTensor).name,\n ) as Tensor;\n expectTensorsClose(output, zeros([2, 3]));\n });\n\n it('Sequential model: length-1 dictionary input', () => {\n const model = createSequentialModel();\n const inputs: NamedTensorMap = {};\n inputs[(model.input as SymbolicTensor).name] = zeros([2, 4]);\n const output = model.execute(\n inputs,\n (model.layers[1].output as tfl.SymbolicTensor).name,\n ) as Tensor;\n expectTensorsClose(output, zeros([2, 3]));\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-layers/dist/engine/training_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.d.ts deleted file mode 100644 index c386174d9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -/** - * For multi-class classification problems, this object is designed to store a - * mapping from class index to the "weight" of the class, where higher weighted - * classes have larger impact on loss, accuracy, and other metrics. - * - * This is useful for cases in which you want the model to "pay more attention" - * to examples from an under-represented class, e.g., in unbalanced datasets. - */ -export declare type ClassWeight = { - [classIndex: number]: number; -}; -/** - * Class weighting for a model with multiple outputs. - * - * This object maps each output name to a class-weighting object. - */ -export declare type ClassWeightMap = { - [outputName: string]: ClassWeight; -}; -/** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ -export declare function standardizeClassWeights(classWeight: ClassWeight | ClassWeight[] | ClassWeightMap, outputNames: string[]): ClassWeight[]; -export declare function standardizeSampleWeights(classWeight: ClassWeight | ClassWeight[] | ClassWeightMap, outputNames: string[]): ClassWeight[]; -/** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ -export declare function standardizeWeights(y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight, sampleWeightMode?: 'temporal'): Promise; -/** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ -export declare function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor): Tensor; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js deleted file mode 100644 index b196a62f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { dispose, mul, tensor1d, tidy } from '@tensorflow/tfjs-core'; -function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) { - const numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(name => null); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } - else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [xWeight[outputNames[0]]]; - } - else { - return [xWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error(`Provided ${weightType} is an array of ${xWeight.length} ` + - `element(s), but the model has ${numOutputs} outputs. ` + - `Make sure a set of weights is provided for each model output.`); - } - return xWeight; - } - else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof xWeight[Object.keys(xWeight)[0]] === - 'object') { - const output = []; - outputNames.forEach(outputName => { - if (outputName in xWeight) { - output.push(xWeight[outputName]); - } - else { - output.push(null); - } - }); - return output; - } - else { - throw new Error(`The model has multiple (${numOutputs}) outputs, ` + - `so ${weightType} must be either an array with ` + - `${numOutputs} elements or an object with ${outputNames} keys. ` + - `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`); - } -} -/** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ -export function standardizeClassWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight'); -} -export function standardizeSampleWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'sampleWeight'); -} -/** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ -export async function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) { - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - if (classWeight != null) { - // Apply class weights per sample. - const yClasses = tidy(() => { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone(); - } - else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - const axis = 1; - return y.argMax(axis); - } - else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } - else { - throw new Error(`Encountered unexpected last-dimension size (${y.shape[1]}) ` + - `during handling of class weights. The size is expected to be ` + - `>= 1.`); - } - } - else { - throw new Error(`Unexpected rank of target (y) tensor (${y.rank}) during ` + - `handling of class weights. The rank is expected to be 1 or 2.`); - } - }); - const yClassIndices = Array.from(await yClasses.data()); - dispose(yClasses); - const classSampleWeight = []; - yClassIndices.forEach(classIndex => { - if (classWeight[classIndex] == null) { - throw new Error(`classWeight must contain all classes in the training data. ` + - `The class ${classIndex} exists in the data but not in ` + - `classWeight`); - } - else { - classSampleWeight.push(classWeight[classIndex]); - } - }); - return tensor1d(classSampleWeight, 'float32'); - } - else { - return null; - } -} -/** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ -export function computeWeightedLoss(losses, sampleWeights) { - return mul(losses, sampleWeights); -} -//# sourceMappingURL=training_utils.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-layers/dist/engine/training_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js.map deleted file mode 100644 index 4a2416d30..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_utils.js","sourceRoot":"","sources":["../../src/engine/training_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,OAAO,EA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,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;KAC/C;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,aAAqB;IACvE,OAAO,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\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-layers/dist/engine/training_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils_test.js.map deleted file mode 100644 index 78cb2d271..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_utils_test.js","sourceRoot":"","sources":["../../src/engine/training_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAA8B,uBAAuB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAE1G,eAAe,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,WAAW,GAAgB,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAC,CAAC;QACvD,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC;QACxC,MAAM,iBAAiB,GAAG,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,yEAAyE;QACzE,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QACrD,kBAAkB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,EAAE,EA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,EAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {memory, tensor1d, tensor2d} from '@tensorflow/tfjs-core';\n\nimport {describeMathCPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\ndescribeMathCPU('standardizeWeights', () => {\n it('classWeights with 1D class-index target', async () => {\n const y = tensor1d([0, 1, 2, 1, 0]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 2: 0.1};\n const numTensors0 = memory().numTensors;\n const classSampleWeight = await standardizeWeights(y, null, classWeight);\n // Assert no memory leak. The extra tensor is `classSampleWeight` itself.\n expect(memory().numTensors).toEqual(numTensors0 + 1);\n expectTensorsClose(classSampleWeight, tensor1d([10, 1, 0.1, 1, 10]));\n expect(y.isDisposed).toEqual(false);\n });\n\n it('classWeights with 2D class-index target', async () => {\n const y = tensor2d([[3], [2], [0]]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 2: 0.1, 3: 0.01};\n const numTensors0 = memory().numTensors;\n const classSampleWeight = await standardizeWeights(y, null, classWeight);\n // Assert no memory leak. The extra tensor is `classSampleWeight` itself.\n expect(memory().numTensors).toEqual(numTensors0 + 1);\n expectTensorsClose(classSampleWeight, tensor1d([0.01, 0.1, 10]));\n expect(y.isDisposed).toEqual(false);\n });\n\n it('classWeights with 2D one-hot target', async () => {\n const y = tensor2d([[0, 0, 0, 1], [0, 0, 1, 0], [1, 0, 0, 0]]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 2: 0.1, 3: 0.01};\n const numTensors0 = memory().numTensors;\n const classSampleWeight = await standardizeWeights(y, null, classWeight);\n // Assert no memory leak. The extra tensor is `classSampleWeight` itself.\n expect(memory().numTensors).toEqual(numTensors0 + 1);\n expectTensorsClose(classSampleWeight, tensor1d([0.01, 0.1, 10]));\n expect(y.isDisposed).toEqual(false);\n });\n\n it('classWeights with 1D class-index target: Missing class', async () => {\n const y = tensor1d([0, 1, 2, 3, 2, 1, 0]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 2: 0.1};\n\n let caughtError: Error;\n try {\n await standardizeWeights(y, null, classWeight);\n } catch (error) {\n caughtError = error;\n }\n expect(caughtError.message)\n .toMatch(/classWeight must contain all classes.* class 3 .*/);\n });\n\n it('classWeights with 2D class-index target: Missing class', async () => {\n const y = tensor2d([[3], [2], [0], [4]]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 2: 0.1, 3: 0.01};\n\n let caughtError: Error;\n try {\n await standardizeWeights(y, null, classWeight);\n } catch (error) {\n caughtError = error;\n }\n expect(caughtError.message)\n .toMatch(/classWeight must contain all classes.* class 4 .*/);\n });\n\n it('classWeights with 2D one-hot target: missing weight', async () => {\n const y = tensor2d([[0, 0, 0, 1], [0, 0, 1, 0], [1, 0, 0, 0]]);\n const classWeight: ClassWeight = {0: 10, 1: 1, 3: 0.01};\n\n let caughtError: Error;\n try {\n await standardizeWeights(y, null, classWeight);\n } catch (error) {\n caughtError = error;\n }\n expect(caughtError.message)\n .toMatch(/classWeight must contain all classes.* class 2 .*/);\n });\n});\n\ndescribe('standardizeClassWeights', () => {\n it('One output, ClassWeight singleton', () => {\n const outputNames = ['output1'];\n const classWeight: ClassWeight = {0: 1, 1: 2};\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}]);\n });\n\n it('One output, ClassWeight array', () => {\n const outputNames = ['output1'];\n const classWeight: ClassWeight[] = [{0: 1, 1: 2}];\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}]);\n });\n\n it('One output, ClassWeight dict', () => {\n const outputNames = ['output1'];\n const classWeight: ClassWeightMap = {'output1': {0: 1, 1: 2}};\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}]);\n });\n\n it('Two outputs, ClassWeight array', () => {\n const outputNames = ['output1', 'output2'];\n const classWeight: ClassWeight[] = [{0: 1, 1: 2}, {0: 10, 1: 20}];\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}, {0: 10, 1: 20}]);\n });\n\n it('Two outputs, ClassWeight dict', () => {\n const outputNames = ['output1', 'output2'];\n const classWeight:\n ClassWeightMap = {'output2': {0: 10, 1: 20}, 'output1': {0: 1, 1: 2}};\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}, {0: 10, 1: 20}]);\n });\n\n it('Two outputs, ClassWeight singleton leads to Error', () => {\n const outputNames = ['output1', 'output2'];\n const classWeight: ClassWeight = {0: 10, 1: 20};\n expect(() => standardizeClassWeights(classWeight, outputNames))\n .toThrowError(/.*has multiple \\(2\\) outputs.*/);\n });\n\n it('Three outputs, ClassWeight array missing element', () => {\n const outputNames = ['output1', 'output2', 'output3'];\n const classWeight: ClassWeight[] = [{0: 1, 1: 2}, {0: 10, 1: 20}];\n expect(() => standardizeClassWeights(classWeight, outputNames))\n .toThrowError(\n /.*classWeight is an array of 2 element.* model has 3 outputs/);\n });\n\n it('Three outputs, ClassWeight dict missing element is okay', () => {\n const outputNames = ['output1', 'output2', 'output3'];\n const classWeight:\n ClassWeightMap = {'output1': {0: 1, 1: 2}, 'output3': {0: 10, 1: 20}};\n const output = standardizeClassWeights(classWeight, outputNames);\n expect(output).toEqual([{0: 1, 1: 2}, null, {0: 10, 1: 20}]);\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-layers/dist/engine/training_weighted_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_weighted_test.js.map deleted file mode 100644 index f173c1981..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/engine/training_weighted_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_weighted_test.js","sourceRoot":"","sources":["../../src/engine/training_weighted_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4DAA4D;AAE5D,OAAO,EAAC,MAAM,EAAE,IAAI,EAAU,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEnF,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAGnD,qBAAqB,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAC/D,yBAAyB;IACzB,QAAQ;IACR,qBAAqB;IACrB,0BAA0B;IAC1B,EAAE;IACF,gCAAgC;IAChC,mCAAmC;IACnC,eAAe;IACf,uBAAuB;IACvB,kCAAkC;IAClC,6BAA6B;IAC7B,iDAAiD;IACjD,iCAAiC;IACjC,wDAAwD;IACxD,kBAAkB;IAClB,EAAE;IACF,wEAAwE;IACxE,kCAAkC;IAClC,4BAA4B;IAC5B,4BAA4B;IAC5B,4BAA4B;IAC5B,4BAA4B;IAC5B,4BAA4B;IAC5B,+CAA+C;IAC/C,EAAE;IACF,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,4BAA4B;IAC5B,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,gCAAgC;IAChC,MAAM;IACN,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAC/B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC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AAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAErC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Unit tests for training with {sample, class} weights. */\n\nimport {memory, ones, Tensor, tensor2d, train, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\n\nimport {describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\nimport {FakeNumericDataset} from './dataset_fakes';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\ndescribeMathCPUAndGPU('LayersModel.fit() with classWeight', () => {\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // units=3,\n // input_shape=[2],\n // kernel_initializer='zeros',\n // activation='softmax'))\n // model.compile(loss='categorical_crossentropy',\n // metrics=['acc'],\n // optimizer=tf.keras.optimizers.SGD(1.0))\n // model.summary()\n //\n // xs = np.array([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]],\n // dtype=np.float32)\n // ys = np.array([[1, 0, 0],\n // [1, 0, 0],\n // [0, 1, 0],\n // [0, 1, 0],\n // [0, 0, 1],\n // [0, 0, 1]], dtype=np.float32)\n //\n // model.fit(xs,\n // ys,\n // epochs=2,\n // class_weight=[{\n // 0: 1,\n // 1: 10,\n // 2: 1\n // }])\n // print(model.get_weights()[0])\n // ```\n it('One output, multi-class, one-hot encoding', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n }));\n model.compile({\n loss: 'categoricalCrossentropy',\n metrics: ['acc'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]]);\n const ys = tensor2d(\n [[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 1, 0], [0, 0, 1], [0, 0, 1]]);\n const numTensors0 = memory().numTensors;\n const history = await model.fit(\n xs, ys, {epochs: 2, classWeight: [{0: 1, 1: 10, 2: 1}]});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(4.3944);\n expect(history.history.loss[1]).toBeCloseTo(5.3727);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0.3333);\n expect(history.history.acc[1]).toBeCloseTo(0.6667);\n });\n\n it('One output, multi-class, one-hot encoding, batchSize = 2', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n }));\n model.compile({\n loss: 'categoricalCrossentropy',\n metrics: ['acc'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]]);\n const ys = tensor2d(\n [[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 1, 0], [0, 0, 1], [0, 0, 1]]);\n const numTensors0 = memory().numTensors;\n const history = await model.fit(xs, ys, {\n epochs: 2,\n batchSize: 2,\n shuffle: false,\n classWeight: [{0: 1, 1: 10, 2: 1}]\n });\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(59.2691);\n expect(history.history.loss[1]).toBeCloseTo(10.7454);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0.3333);\n expect(history.history.acc[1]).toBeCloseTo(0.3333);\n });\n\n it('One output, multi-class, one-hot encoding, validationData', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n }));\n model.compile({\n loss: 'categoricalCrossentropy',\n metrics: ['acc'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]]);\n const ys = tensor2d(\n [[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 1, 0], [0, 0, 1], [0, 0, 1]]);\n const numTensors0 = memory().numTensors;\n const history = await model.fit(xs, ys, {\n epochs: 2,\n classWeight: [{0: 1, 1: 10, 2: 1}],\n validationData: [xs, ys]\n });\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(4.3944);\n expect(history.history.loss[1]).toBeCloseTo(5.3727);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0.3333);\n expect(history.history.acc[1]).toBeCloseTo(0.6667);\n\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(5.3727);\n expect(history.history.val_loss[1]).toBeCloseTo(5.3727);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(0.6667);\n expect(history.history.val_acc[1]).toBeCloseTo(0.6667);\n });\n\n it('One output, multi-class, one-hot encoding, validationSplit', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n }));\n model.compile({\n loss: 'categoricalCrossentropy',\n metrics: ['acc'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]]);\n const ys = tensor2d(\n [[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 1, 0], [0, 0, 1], [0, 0, 1]]);\n const numTensors0 = memory().numTensors;\n const history = await model.fit(\n xs, ys,\n {epochs: 2, classWeight: [{0: 1, 1: 10, 2: 1}], validationSplit: 0.5});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(4.3944);\n expect(history.history.loss[1]).toBeCloseTo(10.7454);\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(0.6667);\n expect(history.history.acc[1]).toBeCloseTo(0.3333);\n\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(2.9903e-05);\n expect(history.history.val_loss[1]).toBeCloseTo(2.9903e-05);\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(1);\n expect(history.history.val_acc[1]).toBeCloseTo(1);\n });\n\n it('One output, multi-class, sparse encoding', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n }));\n model.compile(\n {loss: 'sparseCategoricalCrossentropy', optimizer: train.sgd(1)});\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, -10], [2, -20]]);\n const ys = tensor2d([[0], [0], [1], [1], [2], [2]]);\n const numTensors0 = memory().numTensors;\n const history =\n await model.fit(xs, ys, {epochs: 2, classWeight: {0: 1, 1: 10, 2: 1}});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(4.3944);\n expect(history.history.loss[1]).toBeCloseTo(5.3727);\n });\n\n // Reference Python code.\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // units=1,\n // input_shape=[2],\n // kernel_initializer='zeros',\n // activation='sigmoid'))\n // model.compile(loss='binary_crossentropy',\n // optimizer=tf.keras.optimizers.SGD(1.0))\n // model.summary()\n //\n // xs = np.array([[0, 1], [0, 2], [1, 10], [1, 20]],\n // dtype=np.float32)\n // ys = np.array([[0], [0], [1], [1]], dtype=np.float32)\n //\n // # model.fit(xs, ys, epochs=1)\n // model.fit(xs,\n // ys,\n // epochs=3,\n // class_weight=[{\n // 0: 0.1,\n // 1: 0.9\n // }])\n // print(model.get_weights()[0])\n // ```\n it('One output, binary classes, sparse encoding', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 1,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n }));\n model.compile({loss: 'binaryCrossentropy', optimizer: train.sgd(1)});\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20]]);\n const ys = tensor2d([[0], [0], [1], [1]]);\n const numTensors0 = memory().numTensors;\n const history =\n await model.fit(xs, ys, {epochs: 2, classWeight: [{0: 0.1, 1: 0.9}]});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(2);\n // These loss values are different than what the values would be\n // if there is no class weighting.\n expect(history.history.loss[0]).toBeCloseTo(0.3466);\n expect(history.history.loss[1]).toBeCloseTo(0.2611);\n });\n\n // Python Reference Code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // inp = tf.keras.Input(shape=[2])\n // y1 = tf.keras.layers.Dense(\n // units=3,\n // input_shape=[2],\n // kernel_initializer='zeros',\n // activation='softmax')(inp)\n // y2 = tf.keras.layers.Dense(\n // units=1,\n // input_shape=[2],\n // kernel_initializer='zeros',\n // activation='sigmoid')(inp)\n // model = tf.keras.Model(inp, [y1, y2])\n // model.compile(\n // loss=['sparse_categorical_crossentropy', 'binary_crossentropy'],\n // optimizer=tf.keras.optimizers.SGD(1.0))\n // model.summary()\n //\n // xs = np.array(\n // [[0, 1], [0, 2], [1, 10], [1, 20], [2, 10], [2, 20]],\n // dtype=np.float32)\n // y1s = np.array(\n // [[0], [0], [1], [1], [2], [2]], dtype=np.float32)\n // y2s = np.array(\n // [[0], [0], [1], [1], [1], [1]], dtype=np.float32)\n //\n // # model.fit(xs, ys, epochs=1)\n // model.fit(xs,\n // [y1s, y2s],\n // epochs=3,\n // class_weight=[{\n // 0: 0.1,\n // 1: 0.2,\n // 2: 0.7\n // }, {\n // 0: 0.1,\n // 1: 0.9\n // }])\n // ```\n it('Two outputs, classWeight as array', async () => {\n const inp = tfl.input({shape: [2]});\n const y1 = tfl.layers\n .dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const y2 = tfl.layers\n .dense({\n units: 1,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: inp, outputs: [y1, y2]});\n model.compile({\n loss: ['sparseCategoricalCrossentropy', 'binaryCrossentropy'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, 10], [2, 20]]);\n const y1s = tensor2d([[0], [0], [1], [1], [2], [2]]);\n const y2s = tensor2d([[0], [0], [1], [1], [1], [1]]);\n\n const numTensors0 = memory().numTensors;\n const history = await model.fit(\n xs, [y1s, y2s],\n {epochs: 3, classWeight: [{0: 0.1, 1: 0.2, 2: 0.7}, {0: 0.1, 1: 0.9}]});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(0.8052);\n expect(history.history.loss[1]).toBeCloseTo(1.4887);\n expect(history.history.loss[2]).toBeCloseTo(1.4782);\n const lossKey0 = `${model.outputNames[0]}_loss`;\n expect(history.history[lossKey0].length).toEqual(3);\n expect(history.history[lossKey0][0]).toBeCloseTo(0.3662);\n expect(history.history[lossKey0][1]).toBeCloseTo(1.2553);\n expect(history.history[lossKey0][2]).toBeCloseTo(1.2485);\n const lossKey1 = `${model.outputNames[1]}_loss`;\n expect(history.history[lossKey1].length).toEqual(3);\n expect(history.history[lossKey1][0]).toBeCloseTo(0.4390);\n expect(history.history[lossKey1][1]).toBeCloseTo(0.2333);\n expect(history.history[lossKey1][2]).toBeCloseTo(0.2297);\n });\n\n it('Two outputs, classWeight as array, one being null', async () => {\n const inp = tfl.input({shape: [2]});\n const y1 = tfl.layers\n .dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const y2 = tfl.layers\n .dense({\n units: 1,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: inp, outputs: [y1, y2]});\n model.compile({\n loss: ['sparseCategoricalCrossentropy', 'binaryCrossentropy'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, 10], [2, 20]]);\n const y1s = tensor2d([[0], [0], [1], [1], [2], [2]]);\n const y2s = tensor2d([[0], [0], [1], [1], [1], [1]]);\n\n const numTensors0 = memory().numTensors;\n const history = await model.fit(\n xs, [y1s, y2s],\n {epochs: 3, classWeight: [null, {0: 0.1, 1: 0.9}], shuffle: false});\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n // Note that the following values don't match results from Python,\n // which is a bug in Python TensorFlow / tf.keras. But the final\n // kernel value does match Python results. (See b/136123157).\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(1.5376);\n expect(history.history.loss[1]).toBeCloseTo(3.1466);\n expect(history.history.loss[2]).toBeCloseTo(7.9620);\n const lossKey0 = `${model.outputNames[0]}_loss`;\n expect(history.history[lossKey0].length).toEqual(3);\n expect(history.history[lossKey0][0]).toBeCloseTo(1.0986);\n expect(history.history[lossKey0][1]).toBeCloseTo(2.9113);\n expect(history.history[lossKey0][2]).toBeCloseTo(7.7323);\n const lossKey1 = `${model.outputNames[1]}_loss`;\n expect(history.history[lossKey1].length).toEqual(3);\n expect(history.history[lossKey1][0]).toBeCloseTo(0.4390);\n expect(history.history[lossKey1][1]).toBeCloseTo(0.2333);\n expect(history.history[lossKey1][2]).toBeCloseTo(0.2298);\n expectTensorsClose(model.getWeights()[0], tensor2d([\n [-0.3333333, -0.03197281, 0.3653062],\n [-2.0025878, 1.9823718, 0.02021614]\n ]));\n });\n\n it('Two outputs, classWeight as map, one output no weighting', async () => {\n const inp = tfl.input({shape: [2]});\n const y1 = tfl.layers\n .dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const y2 = tfl.layers\n .dense({\n units: 1,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: inp, outputs: [y1, y2]});\n model.compile({\n loss: ['sparseCategoricalCrossentropy', 'binaryCrossentropy'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, 10], [2, 20]]);\n const y1s = tensor2d([[0], [0], [1], [1], [2], [2]]);\n const y2s = tensor2d([[0], [0], [1], [1], [1], [1]]);\n\n const numTensors0 = memory().numTensors;\n const history = await model.fit(xs, [y1s, y2s], {\n epochs: 3,\n classWeight: {\n [model.outputNames[1]]: {0: 0.1, 1: 0.9},\n },\n shuffle: false\n });\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n // Note that the following values don't match results from Python,\n // which is a bug in Python TensorFlow / tf.keras. But the final\n // kernel value does match Python results.\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(1.5376);\n expect(history.history.loss[1]).toBeCloseTo(3.1466);\n expect(history.history.loss[2]).toBeCloseTo(7.9620);\n const lossKey0 = `${model.outputNames[0]}_loss`;\n expect(history.history[lossKey0].length).toEqual(3);\n expect(history.history[lossKey0][0]).toBeCloseTo(1.0986);\n expect(history.history[lossKey0][1]).toBeCloseTo(2.9113);\n expect(history.history[lossKey0][2]).toBeCloseTo(7.7323);\n const lossKey1 = `${model.outputNames[1]}_loss`;\n expect(history.history[lossKey1].length).toEqual(3);\n expect(history.history[lossKey1][0]).toBeCloseTo(0.4390);\n expect(history.history[lossKey1][1]).toBeCloseTo(0.2333);\n expect(history.history[lossKey1][2]).toBeCloseTo(0.2298);\n expectTensorsClose(model.getWeights()[0], tensor2d([\n [-0.3333333, -0.03197281, 0.3653062],\n [-2.0025878, 1.9823718, 0.02021614]\n ]));\n });\n\n it('Two outputs, classWeight as map', async () => {\n const inp = tfl.input({shape: [2]});\n const y1 = tfl.layers\n .dense({\n units: 3,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'softmax'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const y2 = tfl.layers\n .dense({\n units: 1,\n inputShape: [2],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: inp, outputs: [y1, y2]});\n model.compile({\n loss: ['sparseCategoricalCrossentropy', 'binaryCrossentropy'],\n optimizer: train.sgd(1)\n });\n\n const xs = tensor2d([[0, 1], [0, 2], [1, 10], [1, 20], [2, 10], [2, 20]]);\n const y1s = tensor2d([[0], [0], [1], [1], [2], [2]]);\n const y2s = tensor2d([[0], [0], [1], [1], [1], [1]]);\n\n const numTensors0 = memory().numTensors;\n const history = await model.fit(xs, [y1s, y2s], {\n epochs: 3,\n classWeight: {\n [model.outputNames[0]]: {0: 0.1, 1: 0.2, 2: 0.7},\n [model.outputNames[1]]: {0: 0.1, 1: 0.9}\n }\n });\n expect(memory().numTensors).toEqual(numTensors0); // Assert no memory leak.\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(0.8052);\n expect(history.history.loss[1]).toBeCloseTo(1.4887);\n expect(history.history.loss[2]).toBeCloseTo(1.4782);\n const lossKey0 = `${model.outputNames[0]}_loss`;\n expect(history.history[lossKey0].length).toEqual(3);\n expect(history.history[lossKey0][0]).toBeCloseTo(0.3662);\n expect(history.history[lossKey0][1]).toBeCloseTo(1.2553);\n expect(history.history[lossKey0][2]).toBeCloseTo(1.2485);\n const lossKey1 = `${model.outputNames[1]}_loss`;\n expect(history.history[lossKey1].length).toEqual(3);\n expect(history.history[lossKey1][0]).toBeCloseTo(0.4390);\n expect(history.history[lossKey1][1]).toBeCloseTo(0.2333);\n expect(history.history[lossKey1][2]).toBeCloseTo(0.2297);\n });\n});\n\ndescribeMathCPUAndGPU('LayersModel.fitDataset() with classWeight', () => {\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.concatenate([\n // np.zeros([int(batch_size * num_batches * epochs / 2), 1]),\n // np.ones([int(batch_size * num_batches * epochs / 2), 1])],\n // axis=0)\n //\n // dataset = tf.data.Dataset.from_tensor_slices(\n // (xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // activation='sigmoid',\n // kernel_initializer='zeros'))\n // model.compile(loss='binary_crossentropy',\n // metrics=['acc'],\n // optimizer='sgd')\n //\n // history = model.fit(\n // dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // class_weight={0: 0.1, 1: 2})\n // print(history.history)\n // ```\n it('One output, binary crossentropy, acc metric', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 1,\n inputShape: [1],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n }));\n model.compile(\n {loss: 'binaryCrossentropy', metrics: ['acc'], optimizer: 'sgd'});\n\n const batchSize = 8;\n const batchesPerEpoch = 3;\n const epochs = 2;\n const xTensorsFunc = () =>\n [ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [zeros([batchSize, 1]), zeros([batchSize, 1]), zeros([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n const classWeight: ClassWeight = {0: 0.1, 1: 2};\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1, classWeight});\n model.setWeights([zeros([1, 1]), zeros([1])]);\n\n const numTensors0 = memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs, classWeight});\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n // The loss and acc values are different if no classWeight is used.\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.0693);\n expect(history.history.loss[1]).toBeCloseTo(1.3695);\n\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(1);\n expect(history.history.acc[1]).toBeCloseTo(0.6667);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys = np.concatenate([\n // np.zeros([int(batch_size * num_batches * epochs / 2), 1]),\n // np.ones([int(batch_size * num_batches * epochs / 2), 1])],\n // axis=0)\n //\n // dataset = tf.data.Dataset.from_tensor_slices(\n // (xs, ys)).batch(batch_size)\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // activation='sigmoid',\n // kernel_initializer='zeros'))\n // model.compile(loss='binary_crossentropy',\n // metrics=['acc'],\n // optimizer='sgd')\n //\n // history = model.fit(\n // dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // class_weight={0: 0.1, 1: 2})\n // print(history.history)\n // ```\n it('One output, binary crossentropy,validation', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 1,\n inputShape: [1],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n }));\n model.compile(\n {loss: 'binaryCrossentropy', metrics: ['acc'], optimizer: 'sgd'});\n\n const batchSize = 8;\n const batchesPerEpoch = 3;\n const epochs = 2;\n const xTensorsFunc = () =>\n [ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])];\n const yTensorsFunc = () =>\n [zeros([batchSize, 1]), zeros([batchSize, 1]), zeros([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])];\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: [1],\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n const classWeight: ClassWeight = {0: 0.1, 1: 2};\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(\n dataset,\n {batchesPerEpoch, epochs: 1, classWeight, validationData: dataset});\n model.setWeights([zeros([1, 1]), zeros([1])]);\n\n const numTensors0 = memory().numTensors;\n const history = await model.fitDataset(\n dataset,\n {batchesPerEpoch, epochs, classWeight, validationData: dataset});\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n // The loss and acc values are different if no classWeight is used.\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.0693);\n expect(history.history.loss[1]).toBeCloseTo(1.3695);\n\n expect(history.history.acc.length).toEqual(2);\n expect(history.history.acc[0]).toBeCloseTo(1);\n expect(history.history.acc[1]).toBeCloseTo(0.6667);\n\n expect(history.history.val_loss.length).toEqual(2);\n expect(history.history.val_loss[0]).toBeCloseTo(0.693148);\n expect(history.history.val_loss[1]).toBeCloseTo(0.693546);\n\n expect(history.history.val_acc.length).toEqual(2);\n expect(history.history.val_acc[0]).toBeCloseTo(0.5);\n expect(history.history.val_acc[1]).toBeCloseTo(0.5);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // batch_size = 8\n // num_batches = 3\n // epochs = 2\n //\n // xs = np.ones([batch_size * num_batches * epochs, 1])\n // ys1 = np.concatenate([\n // np.zeros([int(batch_size * num_batches * epochs / 2), 1]),\n // np.ones([int(batch_size * num_batches * epochs / 2), 1])],\n // axis=0)\n // ys2 = np.concatenate([\n // np.ones([int(batch_size * num_batches * epochs / 2), 1]),\n // np.zeros([int(batch_size * num_batches * epochs / 2), 1])],\n // axis=0)\n //\n // dataset = tf.data.Dataset.from_tensor_slices(\n // (xs, {'out1': ys1, 'out2': ys2})).batch(batch_size)\n //\n // inp = tf.keras.Input(shape=[1])\n // out1 = tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // activation='sigmoid',\n // kernel_initializer='zeros',\n // name='out1')(inp)\n // out2 = tf.keras.layers.Dense(\n // 1,\n // input_shape=[1],\n // activation='sigmoid',\n // kernel_initializer='zeros',\n // name='out2')(inp)\n //\n // model = tf.keras.Model(inp, [out1, out2])\n // model.compile(\n // loss=['binary_crossentropy', 'binary_crossentropy'],\n // optimizer='sgd')\n //\n // history = model.fit(\n // dataset,\n // steps_per_epoch=num_batches,\n // epochs=epochs,\n // class_weight=[{0: 0.1, 1: 2}, {0: 5, 1: 0.5}])\n // print(history.history)\n // ```\n it('Two outputs, binary crossentropy, acc metric', async () => {\n const inp = tfl.input({shape: [1]});\n const out1 = tfl.layers\n .dense({\n units: 1,\n inputShape: [1],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const out2 = tfl.layers\n .dense({\n units: 1,\n inputShape: [1],\n kernelInitializer: 'zeros',\n activation: 'sigmoid'\n })\n .apply(inp) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: inp, outputs: [out1, out2]});\n model.compile(\n {loss: ['binaryCrossentropy', 'binaryCrossentropy'], optimizer: 'sgd'});\n\n const batchSize = 8;\n const batchesPerEpoch = 3;\n const epochs = 2;\n const xTensorsFunc = () =>\n [ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])];\n const yTensorsFunc = () => {\n const output: {[name: string]: Tensor[]} = {};\n output[model.outputNames[0]] = [\n zeros([batchSize, 1]), zeros([batchSize, 1]), zeros([batchSize, 1]),\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1])\n ];\n output[model.outputNames[1]] = [\n ones([batchSize, 1]), ones([batchSize, 1]), ones([batchSize, 1]),\n zeros([batchSize, 1]), zeros([batchSize, 1]), zeros([batchSize, 1])\n ];\n return output;\n };\n const dataset = new FakeNumericDataset({\n xShape: [1],\n yShape: {[model.outputNames[0]]: [1], [model.outputNames[1]]: [1]},\n batchSize,\n numBatches: batchesPerEpoch * epochs,\n xTensorsFunc,\n yTensorsFunc\n });\n\n const classWeight: ClassWeightMap = {\n [model.outputNames[0]]: {0: 0.1, 1: 2},\n [model.outputNames[1]]: {0: 5, 1: 0.5}\n };\n\n // Do a burn-in call to account for initialization of cached tensors (for\n // the memory-leak check below).\n await model.fitDataset(dataset, {batchesPerEpoch, epochs: 1, classWeight});\n // model.setWeights([zeros([1, 1]), zeros([1])]);\n\n const numTensors0 = memory().numTensors;\n const history =\n await model.fitDataset(dataset, {batchesPerEpoch, epochs, classWeight});\n const numTensors1 = memory().numTensors;\n expect(numTensors1).toEqual(numTensors0);\n\n // The loss and acc values are different if no classWeight is used.\n const totalLoss = history.history.loss;\n expect(totalLoss.length).toEqual(2);\n expect(totalLoss[0]).toBeCloseTo(0.4146);\n expect(totalLoss[1]).toBeCloseTo(4.7882);\n\n const loss0 = history.history[`${model.outputNames[0]}_loss`];\n expect(loss0.length).toEqual(2);\n expect(loss0[0]).toBeCloseTo(0.0693);\n expect(loss0[1]).toBeCloseTo(1.3695);\n\n const loss1 = history.history[`${model.outputNames[1]}_loss`];\n expect(loss1.length).toEqual(2);\n expect(loss1[0]).toBeCloseTo(0.3453);\n expect(loss1[1]).toBeCloseTo(3.4158);\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-layers/dist/errors.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts deleted file mode 100644 index 3544f8418..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ -/** - * Equivalent of Python's AttributeError. - */ -export declare class AttributeError extends Error { - constructor(message?: string); -} -/** - * Equivalent of Python's RuntimeError. - */ -export declare class RuntimeError extends Error { - constructor(message?: string); -} -/** - * Equivalent of Python's ValueError. - */ -export declare class ValueError extends Error { - constructor(message?: string); -} -/** - * Equivalent of Python's NotImplementedError. - */ -export declare class NotImplementedError extends Error { - constructor(message?: string); -} -/** - * Equivalent of Python's AssertionError. - */ -export declare class AssertionError extends Error { - constructor(message?: string); -} -/** - * Equivalent of Python's IndexError. - */ -export declare class IndexError extends Error { - constructor(message?: string); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js deleted file mode 100644 index 7576a19fe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ -// tslint:enable -/** - * Equivalent of Python's AttributeError. - */ -export class AttributeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AttributeError.prototype); - } -} -/** - * Equivalent of Python's RuntimeError. - */ -export class RuntimeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, RuntimeError.prototype); - } -} -/** - * Equivalent of Python's ValueError. - */ -export class ValueError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, ValueError.prototype); - } -} -/** - * Equivalent of Python's NotImplementedError. - */ -export class NotImplementedError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, NotImplementedError.prototype); - } -} -/** - * Equivalent of Python's AssertionError. - */ -export class AssertionError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AssertionError.prototype); - } -} -/** - * Equivalent of Python's IndexError. - */ -export class IndexError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, IndexError.prototype); - } -} -//# sourceMappingURL=errors.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-layers/dist/errors.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map deleted file mode 100644 index c961cb614..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,gBAAgB;AAEhB;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\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-layers/dist/errors_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map deleted file mode 100644 index e234b914f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors_test.js","sourceRoot":"","sources":["../src/errors_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,cAAc,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAElE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,yCAAyC;IACzC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE;QAClE,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,MAAM,GAAG,GAAG,cAAc,CAAC;YAC3B,MAAM,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;YAC7B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/B,MAAM,CAAC,CAAC,YAAY,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {AttributeError, RuntimeError, ValueError} from './errors';\n\ndescribe('Error classes', () => {\n // tslint:disable-next-line:variable-name\n for (const SomeClass of [AttributeError, RuntimeError, ValueError]) {\n it('pass instanceof tests.', () => {\n const msg = 'Some message';\n const e = new SomeClass(msg);\n expect(e.message).toEqual(msg);\n expect(e instanceof SomeClass).toBe(true);\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-layers/dist/exports.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts deleted file mode 100644 index 7d24970ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts +++ /dev/null @@ -1,238 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Exported functions. - */ -import { io } from '@tensorflow/tfjs-core'; -import { BaseCallbackConstructor } from './base_callbacks'; -import { ContainerArgs } from './engine/container'; -import { InputConfig } from './engine/input_layer'; -import { SymbolicTensor } from './engine/topology'; -import { LayersModel } from './engine/training'; -import { Sequential, SequentialArgs } from './models'; -/** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export declare function model(args: ContainerArgs): LayersModel; -/** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export declare function sequential(config?: SequentialArgs): Sequential; -/** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ -export declare function loadLayersModel(pathOrIOHandler: string | io.IOHandler, options?: io.LoadOptions): Promise; -/** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ -export declare function input(config: InputConfig): SymbolicTensor; -export declare function registerCallbackConstructor(verbosityLevel: number, callbackConstructor: BaseCallbackConstructor): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js deleted file mode 100644 index 11dbbc414..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { CallbackConstructorRegistry } from './base_callbacks'; -import { Input, } from './engine/input_layer'; -import { LayersModel } from './engine/training'; -import { loadLayersModelInternal, Sequential } from './models'; -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// LayersModel and related factory methods. -/** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export function model(args) { - return new LayersModel(args); -} -/** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export function sequential(config) { - return new Sequential(config); -} -/** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ -export function loadLayersModel(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); -} -/** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ -export function input(config) { - return Input(config); -} -export function registerCallbackConstructor(verbosityLevel, callbackConstructor) { - CallbackConstructorRegistry.registerCallbackConstructor(verbosityLevel, callbackConstructor); -} -//# sourceMappingURL=exports.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-layers/dist/exports.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map deleted file mode 100644 index 61ab8c52f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,EAA0B,2BAA2B,EAAC,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAC,KAAK,GAAe,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,uBAAuB,EAAE,UAAU,EAAiB,MAAM,UAAU,CAAC;AAE7E,wEAAwE;AACxE,wEAAwE;AACxE,kBAAkB;AAElB,2CAA2C;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,KAAK,CAAC,IAAmB;IACvC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,UAAU,UAAU,CAAC,MAAuB;IAChD,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,MAAM,UAAU,eAAe,CAC3B,eAAoC,EACpC,OAAwB;IAC1B,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,GAAG,EAAE,CAAC;KACd;IACD,OAAO,uBAAuB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,KAAK,CAAC,MAAmB;IACvC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,2BAA2B,CACvC,cAAsB,EACtB,mBAA4C;IAC9C,2BAA2B,CAAC,2BAA2B,CACnD,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\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-layers/dist/exports_constraints.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts deleted file mode 100644 index 134ed9e3d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Constraint, MaxNormArgs, MinMaxNormArgs, UnitNormArgs } from './constraints'; -/** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ -export declare function maxNorm(args: MaxNormArgs): Constraint; -/** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export declare function unitNorm(args: UnitNormArgs): Constraint; -/** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export declare function nonNeg(): Constraint; -/** @doc {heading: 'Constraints', namespace: 'constraints'} */ -export declare function minMaxNorm(config: MinMaxNormArgs): Constraint; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js deleted file mode 100644 index c56ce65a6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:disable-next-line:max-line-length -import { MaxNorm, MinMaxNorm, NonNeg, UnitNorm } from './constraints'; -/** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ -export function maxNorm(args) { - return new MaxNorm(args); -} -/** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export function unitNorm(args) { - return new UnitNorm(args); -} -/** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export function nonNeg() { - return new NonNeg(); -} -/** @doc {heading: 'Constraints', namespace: 'constraints'} */ -export function minMaxNorm(config) { - return new MinMaxNorm(config); -} -//# sourceMappingURL=exports_constraints.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-layers/dist/exports_constraints.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map deleted file mode 100644 index 885ee2fdf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_constraints.js","sourceRoot":"","sources":["../src/exports_constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,2CAA2C;AAC3C,OAAO,EAAa,OAAO,EAAe,UAAU,EAAkB,MAAM,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;AAE3H;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO,CAAC,IAAiB;IACvC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAkB;IACzC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,IAAI,MAAM,EAAE,CAAC;AACtB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,MAAsB;IAC/C,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\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-layers/dist/exports_initializers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts deleted file mode 100644 index a2267876a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstantArgs, IdentityArgs, Initializer, OrthogonalArgs, RandomNormalArgs, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormalArgs, VarianceScalingArgs, Zeros } from './initializers'; -/** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function zeros(): Zeros; -/** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function ones(): Initializer; -/** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function constant(args: ConstantArgs): Initializer; -/** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function randomUniform(args: RandomUniformArgs): Initializer; -/** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function randomNormal(args: RandomNormalArgs): Initializer; -/** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function truncatedNormal(args: TruncatedNormalArgs): Initializer; -/** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function identity(args: IdentityArgs): Initializer; -/** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export declare function varianceScaling(config: VarianceScalingArgs): Initializer; -/** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function glorotUniform(args: SeedOnlyInitializerArgs): Initializer; -/** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function glorotNormal(args: SeedOnlyInitializerArgs): Initializer; -/** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function heNormal(args: SeedOnlyInitializerArgs): Initializer; -/** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export declare function heUniform(args: SeedOnlyInitializerArgs): Initializer; -/** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function leCunNormal(args: SeedOnlyInitializerArgs): Initializer; -/** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function leCunUniform(args: SeedOnlyInitializerArgs): Initializer; -/** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export declare function orthogonal(args: OrthogonalArgs): Initializer; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js deleted file mode 100644 index a85b948be..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:disable-next-line:max-line-length -import { Constant, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, LeCunNormal, LeCunUniform, Ones, Orthogonal, RandomNormal, RandomUniform, TruncatedNormal, VarianceScaling, Zeros } from './initializers'; -/** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function zeros() { - return new Zeros(); -} -/** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function ones() { - return new Ones(); -} -/** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function constant(args) { - return new Constant(args); -} -/** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function randomUniform(args) { - return new RandomUniform(args); -} -/** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function randomNormal(args) { - return new RandomNormal(args); -} -/** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function truncatedNormal(args) { - return new TruncatedNormal(args); -} -/** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function identity(args) { - return new Identity(args); -} -/** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export function varianceScaling(config) { - return new VarianceScaling(config); -} -/** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function glorotUniform(args) { - return new GlorotUniform(args); -} -/** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function glorotNormal(args) { - return new GlorotNormal(args); -} -/** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function heNormal(args) { - return new HeNormal(args); -} -/** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export function heUniform(args) { - return new HeUniform(args); -} -/** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function leCunNormal(args) { - return new LeCunNormal(args); -} -/** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function leCunUniform(args) { - return new LeCunUniform(args); -} -/** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function orthogonal(args) { - return new Orthogonal(args); -} -//# sourceMappingURL=exports_initializers.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-layers/dist/exports_initializers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map deleted file mode 100644 index c1c1eac28..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_initializers.js","sourceRoot":"","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OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,IAA6B;IACxD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,IAA6B;IACpD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,IAA6B;IACrD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,IAA6B;IACvD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,IAA6B;IACxD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,IAAoB;IAC7C,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\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-layers/dist/exports_layers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts deleted file mode 100644 index ff49541bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts +++ /dev/null @@ -1,1469 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { InputLayer, InputLayerArgs } from './engine/input_layer'; -import { Layer, LayerArgs } from './engine/topology'; -import { input } from './exports'; -import { ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs } from './layers/advanced_activations'; -import { Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs } from './layers/convolutional'; -import { DepthwiseConv2D, DepthwiseConv2DLayerArgs } from './layers/convolutional_depthwise'; -import { ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs } from './layers/convolutional_recurrent'; -import { Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig } from './layers/core'; -import { Embedding, EmbeddingLayerArgs } from './layers/embeddings'; -import { Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply } from './layers/merge'; -import { AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs } from './layers/noise'; -import { BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs } from './layers/normalization'; -import { ZeroPadding2D, ZeroPadding2DLayerArgs } from './layers/padding'; -import { AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs } from './layers/pooling'; -import { GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs } from './layers/recurrent'; -import { Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs } from './layers/wrappers'; -/** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ -export declare function inputLayer(args: InputLayerArgs): InputLayer; -/** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function elu(args?: ELULayerArgs): ELU; -/** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function reLU(args?: ReLULayerArgs): ReLU; -/** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function leakyReLU(args?: LeakyReLULayerArgs): LeakyReLU; -/** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function prelu(args?: PReLULayerArgs): PReLU; -/** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function softmax(args?: SoftmaxLayerArgs): Softmax; -/** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export declare function thresholdedReLU(args?: ThresholdedReLULayerArgs): ThresholdedReLU; -/** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function conv1d(args: ConvLayerArgs): Conv1D; -/** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function conv2d(args: ConvLayerArgs): Conv2D; -/** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function conv2dTranspose(args: ConvLayerArgs): Conv2DTranspose; -/** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function conv3d(args: ConvLayerArgs): Conv3D; -export declare function conv3dTranspose(args: ConvLayerArgs): Layer; -/** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function separableConv2d(args: SeparableConvLayerArgs): SeparableConv2D; -/** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function cropping2D(args: Cropping2DLayerArgs): Cropping2D; -/** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function upSampling2d(args: UpSampling2DLayerArgs): UpSampling2D; -/** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export declare function depthwiseConv2d(args: DepthwiseConv2DLayerArgs): DepthwiseConv2D; -/** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function activation(args: ActivationLayerArgs): Activation; -/** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function dense(args: DenseLayerArgs): Dense; -/** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function dropout(args: DropoutLayerArgs): Dropout; -/** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function spatialDropout1d(args: SpatialDropout1DLayerConfig): SpatialDropout1D; -/** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function flatten(args?: FlattenLayerArgs): Flatten; -/** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function repeatVector(args: RepeatVectorLayerArgs): RepeatVector; -/** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function reshape(args: ReshapeLayerArgs): Reshape; -/** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function permute(args: PermuteLayerArgs): Permute; -/** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export declare function embedding(args: EmbeddingLayerArgs): Embedding; -/** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function add(args?: LayerArgs): Add; -/** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function average(args?: LayerArgs): Average; -/** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function concatenate(args?: ConcatenateLayerArgs): Concatenate; -/** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function maximum(args?: LayerArgs): Maximum; -/** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function minimum(args?: LayerArgs): Minimum; -/** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function multiply(args?: LayerArgs): Multiply; -/** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export declare function dot(args: DotLayerArgs): Dot; -/** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export declare function batchNormalization(args?: BatchNormalizationLayerArgs): BatchNormalization; -/** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export declare function layerNormalization(args?: LayerNormalizationLayerArgs): LayerNormalization; -/** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ -export declare function zeroPadding2d(args?: ZeroPadding2DLayerArgs): ZeroPadding2D; -/** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function averagePooling1d(args: Pooling1DLayerArgs): AveragePooling1D; -export declare function avgPool1d(args: Pooling1DLayerArgs): AveragePooling1D; -export declare function avgPooling1d(args: Pooling1DLayerArgs): AveragePooling1D; -/** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function averagePooling2d(args: Pooling2DLayerArgs): AveragePooling2D; -export declare function avgPool2d(args: Pooling2DLayerArgs): AveragePooling2D; -export declare function avgPooling2d(args: Pooling2DLayerArgs): AveragePooling2D; -/** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function averagePooling3d(args: Pooling3DLayerArgs): AveragePooling3D; -export declare function avgPool3d(args: Pooling3DLayerArgs): AveragePooling3D; -export declare function avgPooling3d(args: Pooling3DLayerArgs): AveragePooling3D; -/** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function globalAveragePooling1d(args?: LayerArgs): GlobalAveragePooling1D; -/** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function globalAveragePooling2d(args: GlobalPooling2DLayerArgs): GlobalAveragePooling2D; -/** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function globalMaxPooling1d(args?: LayerArgs): GlobalMaxPooling1D; -/** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function globalMaxPooling2d(args: GlobalPooling2DLayerArgs): GlobalMaxPooling2D; -/** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function maxPooling1d(args: Pooling1DLayerArgs): MaxPooling1D; -/** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function maxPooling2d(args: Pooling2DLayerArgs): MaxPooling2D; -/** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export declare function maxPooling3d(args: Pooling3DLayerArgs): MaxPooling3D; -/** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function gru(args: GRULayerArgs): GRU; -/** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function gruCell(args: GRUCellLayerArgs): GRUCell; -/** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function lstm(args: LSTMLayerArgs): LSTM; -/** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function lstmCell(args: LSTMCellLayerArgs): LSTMCell; -/** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function simpleRNN(args: SimpleRNNLayerArgs): SimpleRNN; -/** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function simpleRNNCell(args: SimpleRNNCellLayerArgs): SimpleRNNCell; -/** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export declare function convLstm2d(args: ConvLSTM2DArgs): ConvLSTM2D; -/** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export declare function convLstm2dCell(args: ConvLSTM2DCellArgs): ConvLSTM2DCell; -/** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function rnn(args: RNNLayerArgs): RNN; -/** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export declare function stackedRNNCells(args: StackedRNNCellsArgs): StackedRNNCells; -/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ -export declare function bidirectional(args: BidirectionalLayerArgs): Bidirectional; -/** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ -export declare function timeDistributed(args: WrapperLayerArgs): TimeDistributed; -export declare const globalMaxPool1d: typeof globalMaxPooling1d; -export declare const globalMaxPool2d: typeof globalMaxPooling2d; -export declare const maxPool1d: typeof maxPooling1d; -export declare const maxPool2d: typeof maxPooling2d; -export { Layer, RNN, RNNCell, input }; -/** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export declare function gaussianNoise(args: GaussianNoiseArgs): GaussianNoise; -/** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export declare function gaussianDropout(args: GaussianDropoutArgs): GaussianDropout; -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export declare function alphaDropout(args: AlphaDropoutArgs): AlphaDropout; -/** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ -export declare function masking(args?: MaskingArgs): Masking; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js deleted file mode 100644 index d04056e0e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js +++ /dev/null @@ -1,1625 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { InputLayer } from './engine/input_layer'; -import { Layer } from './engine/topology'; -import { input } from './exports'; -import { ELU, LeakyReLU, PReLU, ReLU, Softmax, ThresholdedReLU } from './layers/advanced_activations'; -import { Conv1D, Conv2D, Conv2DTranspose, Conv3D, Cropping2D, SeparableConv2D, UpSampling2D, Conv3DTranspose } from './layers/convolutional'; -import { DepthwiseConv2D } from './layers/convolutional_depthwise'; -import { ConvLSTM2D, ConvLSTM2DCell } from './layers/convolutional_recurrent'; -import { Activation, Dense, Dropout, Flatten, Masking, Permute, RepeatVector, Reshape, SpatialDropout1D } from './layers/core'; -import { Embedding } from './layers/embeddings'; -import { Add, Average, Concatenate, Dot, Maximum, Minimum, Multiply } from './layers/merge'; -import { AlphaDropout, GaussianDropout, GaussianNoise } from './layers/noise'; -import { BatchNormalization, LayerNormalization } from './layers/normalization'; -import { ZeroPadding2D } from './layers/padding'; -import { AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, MaxPooling1D, MaxPooling2D, MaxPooling3D } from './layers/pooling'; -import { GRU, GRUCell, LSTM, LSTMCell, RNN, RNNCell, SimpleRNN, SimpleRNNCell, StackedRNNCells } from './layers/recurrent'; -import { Bidirectional, TimeDistributed } from './layers/wrappers'; -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// Input Layer. -/** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ -export function inputLayer(args) { - return new InputLayer(args); -} -// Advanced Activation Layers. -/** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function elu(args) { - return new ELU(args); -} -/** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function reLU(args) { - return new ReLU(args); -} -/** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function leakyReLU(args) { - return new LeakyReLU(args); -} -/** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function prelu(args) { - return new PReLU(args); -} -/** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function softmax(args) { - return new Softmax(args); -} -/** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function thresholdedReLU(args) { - return new ThresholdedReLU(args); -} -// Convolutional Layers. -/** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv1d(args) { - return new Conv1D(args); -} -/** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv2d(args) { - return new Conv2D(args); -} -/** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv2dTranspose(args) { - return new Conv2DTranspose(args); -} -/** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv3d(args) { - return new Conv3D(args); -} -export function conv3dTranspose(args) { - return new Conv3DTranspose(args); -} -/** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function separableConv2d(args) { - return new SeparableConv2D(args); -} -/** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function cropping2D(args) { - return new Cropping2D(args); -} -/** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function upSampling2d(args) { - return new UpSampling2D(args); -} -// Convolutional(depthwise) Layers. -/** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function depthwiseConv2d(args) { - return new DepthwiseConv2D(args); -} -// Basic Layers. -/** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function activation(args) { - return new Activation(args); -} -/** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function dense(args) { - return new Dense(args); -} -/** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function dropout(args) { - return new Dropout(args); -} -/** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function spatialDropout1d(args) { - return new SpatialDropout1D(args); -} -/** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function flatten(args) { - return new Flatten(args); -} -/** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function repeatVector(args) { - return new RepeatVector(args); -} -/** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function reshape(args) { - return new Reshape(args); -} -/** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function permute(args) { - return new Permute(args); -} -/** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function embedding(args) { - return new Embedding(args); -} -// Merge Layers. -/** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function add(args) { - return new Add(args); -} -/** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function average(args) { - return new Average(args); -} -/** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function concatenate(args) { - return new Concatenate(args); -} -/** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function maximum(args) { - return new Maximum(args); -} -/** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function minimum(args) { - return new Minimum(args); -} -/** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function multiply(args) { - return new Multiply(args); -} -/** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function dot(args) { - return new Dot(args); -} -// Normalization Layers. -/** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export function batchNormalization(args) { - return new BatchNormalization(args); -} -/** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export function layerNormalization(args) { - return new LayerNormalization(args); -} -// Padding Layers. -/** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ -export function zeroPadding2d(args) { - return new ZeroPadding2D(args); -} -// Pooling Layers. -/** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling1d(args) { - return new AveragePooling1D(args); -} -export function avgPool1d(args) { - return averagePooling1d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling1d(args) { - return averagePooling1d(args); -} -/** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling2d(args) { - return new AveragePooling2D(args); -} -export function avgPool2d(args) { - return averagePooling2d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling2d(args) { - return averagePooling2d(args); -} -/** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling3d(args) { - return new AveragePooling3D(args); -} -export function avgPool3d(args) { - return averagePooling3d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling3d(args) { - return averagePooling3d(args); -} -/** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalAveragePooling1d(args) { - return new GlobalAveragePooling1D(args); -} -/** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalAveragePooling2d(args) { - return new GlobalAveragePooling2D(args); -} -/** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalMaxPooling1d(args) { - return new GlobalMaxPooling1D(args); -} -/** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalMaxPooling2d(args) { - return new GlobalMaxPooling2D(args); -} -/** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling1d(args) { - return new MaxPooling1D(args); -} -/** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling2d(args) { - return new MaxPooling2D(args); -} -/** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling3d(args) { - return new MaxPooling3D(args); -} -// Recurrent Layers. -/** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function gru(args) { - return new GRU(args); -} -/** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function gruCell(args) { - return new GRUCell(args); -} -/** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function lstm(args) { - return new LSTM(args); -} -/** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function lstmCell(args) { - return new LSTMCell(args); -} -/** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function simpleRNN(args) { - return new SimpleRNN(args); -} -/** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function simpleRNNCell(args) { - return new SimpleRNNCell(args); -} -/** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export function convLstm2d(args) { - return new ConvLSTM2D(args); -} -/** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export function convLstm2dCell(args) { - return new ConvLSTM2DCell(args); -} -/** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function rnn(args) { - return new RNN(args); -} -/** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function stackedRNNCells(args) { - return new StackedRNNCells(args); -} -// Wrapper Layers. -/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ -export function bidirectional(args) { - return new Bidirectional(args); -} -/** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ -export function timeDistributed(args) { - return new TimeDistributed(args); -} -// Aliases for pooling. -export const globalMaxPool1d = globalMaxPooling1d; -export const globalMaxPool2d = globalMaxPooling2d; -export const maxPool1d = maxPooling1d; -export const maxPool2d = maxPooling2d; -export { Layer, RNN, RNNCell, input /* alias for tf.input */ }; -/** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function gaussianNoise(args) { - return new GaussianNoise(args); -} -/** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function gaussianDropout(args) { - return new GaussianDropout(args); -} -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function alphaDropout(args) { - return new AlphaDropout(args); -} -/** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ -export function masking(args) { - return new Masking(args); -} -//# sourceMappingURL=exports_layers.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-layers/dist/exports_layers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map deleted file mode 100644 index f65782316..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_layers.js","sourceRoot":"","sources":["../src/exports_layers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,UAAU,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,KAAK,EAAY,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,GAAG,EAAgB,SAAS,EAAsB,KAAK,EAAkB,IAAI,EAAiB,OAAO,EAAoB,eAAe,EAA2B,MAAM,+BAA+B,CAAC;AACjN,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAiB,UAAU,EAAuB,eAAe,EAA0B,YAAY,EAAyB,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAC9N,OAAO,EAAC,eAAe,EAA2B,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAC,UAAU,EAAkB,cAAc,EAAqB,MAAM,kCAAkC,CAAC;AAChH,OAAO,EAAC,UAAU,EAAuB,KAAK,EAAkB,OAAO,EAAoB,OAAO,EAAoB,OAAO,EAAe,OAAO,EAAoB,YAAY,EAAyB,OAAO,EAAoB,gBAAgB,EAA8B,MAAM,eAAe,CAAC;AAC3S,OAAO,EAAC,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAwB,GAAG,EAAgB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC9H,OAAO,EAAC,YAAY,EAAoB,eAAe,EAAuB,aAAa,E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IACxC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\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-layers/dist/exports_metrics.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts deleted file mode 100644 index 368520d7b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -/** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function sparseCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function precision(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function recall(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function meanAbsolutePercentageError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function MAPE(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function mape(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export declare function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function MSE(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function mse(yTrue: Tensor, yPred: Tensor): Tensor; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js deleted file mode 100644 index c5d49498c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js +++ /dev/null @@ -1,289 +0,0 @@ -import * as losses from './losses'; -import * as metrics from './metrics'; -/** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function binaryAccuracy(yTrue, yPred) { - return metrics.binaryAccuracy(yTrue, yPred); -} -/** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function binaryCrossentropy(yTrue, yPred) { - return metrics.binaryCrossentropy(yTrue, yPred); -} -/** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function sparseCategoricalAccuracy(yTrue, yPred) { - return metrics.sparseCategoricalAccuracy(yTrue, yPred); -} -/** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function categoricalAccuracy(yTrue, yPred) { - return metrics.categoricalAccuracy(yTrue, yPred); -} -/** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function categoricalCrossentropy(yTrue, yPred) { - return metrics.categoricalCrossentropy(yTrue, yPred); -} -/** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function precision(yTrue, yPred) { - return metrics.precision(yTrue, yPred); -} -/** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function recall(yTrue, yPred) { - return metrics.recall(yTrue, yPred); -} -/** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function cosineProximity(yTrue, yPred) { - return losses.cosineProximity(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanAbsoluteError(yTrue, yPred) { - return losses.meanAbsoluteError(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanAbsolutePercentageError(yTrue, yPred) { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} -export function MAPE(yTrue, yPred) { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} -export function mape(yTrue, yPred) { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} -/** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanSquaredError(yTrue, yPred) { - return losses.meanSquaredError(yTrue, yPred); -} -export function MSE(yTrue, yPred) { - return losses.meanSquaredError(yTrue, yPred); -} -export function mse(yTrue, yPred) { - return losses.meanSquaredError(yTrue, yPred); -} -//# sourceMappingURL=exports_metrics.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-layers/dist/exports_metrics.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map deleted file mode 100644 index 9d151769d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_metrics.js","sourceRoot":"","sources":["../src/exports_metrics.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,KAAa;IAC5D,OAAO,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,2BAA2B,CACvC,KAAa,EAAE,KAAa;IAC9B,OAAO,MAAM,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,KAAa;IAC/C,OAAO,MAAM,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,KAAa;IAC/C,OAAO,MAAM,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,KAAa;IAC3D,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,KAAa;IAC9C,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,KAAa;IAC9C,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\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-layers/dist/exports_models.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.d.ts deleted file mode 100644 index 219f457be..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export { modelFromJSON } from './models'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js deleted file mode 100644 index e749b765b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export { modelFromJSON } from './models'; -//# sourceMappingURL=exports_models.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-layers/dist/exports_models.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js.map deleted file mode 100644 index e8597db5a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_models.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_models.js","sourceRoot":"","sources":["../src/exports_models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nexport {modelFromJSON} from './models';\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts deleted file mode 100644 index fadc245a4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { L1Args, L1L2Args, L2Args, Regularizer } from './regularizers'; -/** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export declare function l1l2(config?: L1L2Args): Regularizer; -/** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export declare function l1(config?: L1Args): Regularizer; -/** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export declare function l2(config?: L2Args): Regularizer; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js deleted file mode 100644 index 573210564..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as regularizers from './regularizers'; -// tslint:disable-next-line:max-line-length -import { L1L2 } from './regularizers'; -/** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l1l2(config) { - return new L1L2(config); -} -/** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l1(config) { - return regularizers.l1(config); -} -/** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l2(config) { - return regularizers.l2(config); -} -//# sourceMappingURL=exports_regularizers.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-layers/dist/exports_regularizers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map deleted file mode 100644 index e3e8edce9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exports_regularizers.js","sourceRoot":"","sources":["../src/exports_regularizers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,2CAA2C;AAC3C,OAAO,EAAS,IAAI,EAAgC,MAAM,gBAAgB,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,MAAiB;IACpC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,MAAe;IAChC,OAAO,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,MAAe;IAChC,OAAO,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\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-layers/dist/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts deleted file mode 100644 index f77a2344d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import '@tensorflow/tfjs-core'; -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -import * as constraints from './exports_constraints'; -import * as initializers from './exports_initializers'; -import * as layers from './exports_layers'; -import * as metrics from './exports_metrics'; -import * as models from './exports_models'; -import * as regularizers from './exports_regularizers'; -export { CallbackList, CustomCallback, CustomCallbackArgs, History } from './base_callbacks'; -export { Callback, callbacks, EarlyStopping, EarlyStoppingCallbackArgs } from './callbacks'; -export { InputSpec, SymbolicTensor } from './engine/topology'; -export { LayersModel, ModelCompileArgs, ModelEvaluateArgs } from './engine/training'; -export { ModelFitDatasetArgs } from './engine/training_dataset'; -export { ModelFitArgs } from './engine/training_tensors'; -export { ClassWeight, ClassWeightMap } from './engine/training_utils'; -export { input, loadLayersModel, model, registerCallbackConstructor, sequential } from './exports'; -export { Shape } from './keras_format/common'; -export { GRUCellLayerArgs, GRULayerArgs, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNLayerArgs, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs } from './layers/recurrent'; -export { Logs } from './logs'; -export { ModelAndWeightsConfig, Sequential, SequentialArgs } from './models'; -export { LayerVariable } from './variables'; -export { version as version_layers } from './version'; -export { constraints, initializers, layers, metrics, models, regularizers }; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js deleted file mode 100644 index 238cec1a2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import '@tensorflow/tfjs-core'; -// tslint:disable-next-line:no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -// This file lists all exports of TensorFlow.js Layers -import * as constraints from './exports_constraints'; -import * as initializers from './exports_initializers'; -import * as layers from './exports_layers'; -import * as metrics from './exports_metrics'; -import * as models from './exports_models'; -import * as regularizers from './exports_regularizers'; -export { CallbackList, CustomCallback, History } from './base_callbacks'; -export { Callback, callbacks, EarlyStopping } from './callbacks'; -export { InputSpec, SymbolicTensor } from './engine/topology'; -export { LayersModel } from './engine/training'; -export { input, loadLayersModel, model, registerCallbackConstructor, sequential } from './exports'; -export { RNN } from './layers/recurrent'; -export { Sequential } from './models'; -export { LayerVariable } from './variables'; -export { version as version_layers } from './version'; -export { constraints, initializers, layers, metrics, models, regularizers }; -//# 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-layers/dist/index.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js.map deleted file mode 100644 index 49978b788..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,gDAAgD;AAChD,OAAO,wEAAwE,CAAC;AAChF,iDAAiD;AACjD,OAAO,mDAAmD,CAAC;AAE3D,sDAAsD;AAEtD,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAC,YAAY,EAAE,cAAc,EAAsB,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAsC,MAAM,mBAAmB,CAAC;AAInF,OAAO,EAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,2BAA2B,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAmE,GAAG,EAA2D,MAAM,oBAAoB,CAAC;AAEnK,OAAO,EAAwB,UAAU,EAAiB,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport '@tensorflow/tfjs-core';\n// tslint:disable-next-line:no-imports-from-dist\nimport '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops';\n// tslint:disable-next-line: no-imports-from-dist\nimport '@tensorflow/tfjs-core/dist/register_all_gradients';\n\n// This file lists all exports of TensorFlow.js Layers\n\nimport * as constraints from './exports_constraints';\nimport * as initializers from './exports_initializers';\nimport * as layers from './exports_layers';\nimport * as metrics from './exports_metrics';\nimport * as models from './exports_models';\nimport * as regularizers from './exports_regularizers';\n\nexport {CallbackList, CustomCallback, CustomCallbackArgs, History} from './base_callbacks';\nexport {Callback, callbacks, EarlyStopping, EarlyStoppingCallbackArgs} from './callbacks';\nexport {InputSpec, SymbolicTensor} from './engine/topology';\nexport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nexport {ModelFitDatasetArgs} from './engine/training_dataset';\nexport {ModelFitArgs} from './engine/training_tensors';\nexport {ClassWeight, ClassWeightMap} from './engine/training_utils';\nexport {input, loadLayersModel, model, registerCallbackConstructor, sequential} from './exports';\nexport {Shape} from './keras_format/common';\nexport {GRUCellLayerArgs, GRULayerArgs, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNLayerArgs, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs} from './layers/recurrent';\nexport {Logs} from './logs';\nexport {ModelAndWeightsConfig, Sequential, SequentialArgs} from './models';\nexport {LayerVariable} from './variables';\nexport {version as version_layers} from './version';\nexport {constraints, initializers, layers, metrics, models, regularizers};\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts deleted file mode 100644 index ec64683e0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Shape } from './keras_format/common'; -import { Distribution, FanMode } from './keras_format/initializer_config'; -export declare function checkFanMode(value?: string): void; -export declare function checkDistribution(value?: string): void; -/** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ -export declare abstract class Initializer extends serialization.Serializable { - fromConfigUsesCustomObjects(): boolean; - /** - * Generate an initial value. - * @param shape - * @param dtype - * @return The init value. - */ - abstract apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export declare class Zeros extends Initializer { - /** @nocollapse */ - static className: string; - apply(shape: Shape, dtype?: DataType): Tensor; -} -export declare class Ones extends Initializer { - /** @nocollapse */ - static className: string; - apply(shape: Shape, dtype?: DataType): Tensor; -} -export interface ConstantArgs { - /** The value for each element in the variable. */ - value: number; -} -export declare class Constant extends Initializer { - /** @nocollapse */ - static className: string; - private value; - constructor(args: ConstantArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface RandomUniformArgs { - /** Lower bound of the range of random values to generate. */ - minval?: number; - /** Upper bound of the range of random values to generate. */ - maxval?: number; - /** Used to seed the random generator. */ - seed?: number; -} -export declare class RandomUniform extends Initializer { - /** @nocollapse */ - static className: string; - readonly DEFAULT_MINVAL = -0.05; - readonly DEFAULT_MAXVAL = 0.05; - private minval; - private maxval; - private seed; - constructor(args: RandomUniformArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface RandomNormalArgs { - /** Mean of the random values to generate. */ - mean?: number; - /** Standard deviation of the random values to generate. */ - stddev?: number; - /** Used to seed the random generator. */ - seed?: number; -} -export declare class RandomNormal extends Initializer { - /** @nocollapse */ - static className: string; - readonly DEFAULT_MEAN = 0; - readonly DEFAULT_STDDEV = 0.05; - private mean; - private stddev; - private seed; - constructor(args: RandomNormalArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface TruncatedNormalArgs { - /** Mean of the random values to generate. */ - mean?: number; - /** Standard deviation of the random values to generate. */ - stddev?: number; - /** Used to seed the random generator. */ - seed?: number; -} -export declare class TruncatedNormal extends Initializer { - /** @nocollapse */ - static className: string; - readonly DEFAULT_MEAN = 0; - readonly DEFAULT_STDDEV = 0.05; - private mean; - private stddev; - private seed; - constructor(args: TruncatedNormalArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface IdentityArgs { - /** - * Multiplicative factor to apply to the identity matrix. - */ - gain?: number; -} -export declare class Identity extends Initializer { - /** @nocollapse */ - static className: string; - private gain; - constructor(args: IdentityArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface VarianceScalingArgs { - /** Scaling factor (positive float). */ - scale?: number; - /** Fanning mode for inputs and outputs. */ - mode?: FanMode; - /** Probabilistic distribution of the values. */ - distribution?: Distribution; - /** Random number generator seed. */ - seed?: number; -} -export declare class VarianceScaling extends Initializer { - /** @nocollapse */ - static className: string; - private scale; - private mode; - private distribution; - private seed; - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - constructor(args: VarianceScalingArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -export interface SeedOnlyInitializerArgs { - /** Random number generator seed. */ - seed?: number; -} -export declare class GlorotUniform extends VarianceScaling { - /** @nocollapse */ - static className: string; - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export declare class GlorotNormal extends VarianceScaling { - /** @nocollapse */ - static className: string; - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export declare class HeNormal extends VarianceScaling { - /** @nocollapse */ - static className: string; - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export declare class HeUniform extends VarianceScaling { - /** @nocollapse */ - static className: string; - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export declare class LeCunNormal extends VarianceScaling { - /** @nocollapse */ - static className: string; - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export declare class LeCunUniform extends VarianceScaling { - /** @nocollapse */ - static className: string; - constructor(args?: SeedOnlyInitializerArgs); - getClassName(): string; -} -export interface OrthogonalArgs extends SeedOnlyInitializerArgs { - /** - * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1. - */ - gain?: number; -} -export declare class Orthogonal extends Initializer { - /** @nocollapse */ - static className: string; - readonly DEFAULT_GAIN = 1; - protected readonly gain: number; - protected readonly seed: number; - constructor(args?: OrthogonalArgs); - apply(shape: Shape, dtype?: DataType): Tensor; - getConfig(): serialization.ConfigDict; -} -/** @docinline */ -export declare type InitializerIdentifier = 'constant' | 'glorotNormal' | 'glorotUniform' | 'heNormal' | 'heUniform' | 'identity' | 'leCunNormal' | 'leCunUniform' | 'ones' | 'orthogonal' | 'randomNormal' | 'randomUniform' | 'truncatedNormal' | 'varianceScaling' | 'zeros' | string; -export declare const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: { - [identifier in InitializerIdentifier]: string; -}; -export declare function serializeInitializer(initializer: Initializer): serialization.ConfigDictValue; -export declare function getInitializer(identifier: InitializerIdentifier | Initializer | serialization.ConfigDict): Initializer; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js deleted file mode 100644 index 9591b80d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js +++ /dev/null @@ -1,489 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { eye, linalg, mul, ones, randomUniform, scalar, serialization, tidy, truncatedNormal, zeros } from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import { checkDataFormat } from './common'; -import { NotImplementedError, ValueError } from './errors'; -import { VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES } from './keras_format/initializer_config'; -import { checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject } from './utils/generic_utils'; -import { arrayProd } from './utils/math_utils'; -export function checkFanMode(value) { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); -} -export function checkDistribution(value) { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); -} -/** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ -export class Initializer extends serialization.Serializable { - fromConfigUsesCustomObjects() { - return false; - } - getConfig() { - return {}; - } -} -export class Zeros extends Initializer { - apply(shape, dtype) { - return zeros(shape, dtype); - } -} -/** @nocollapse */ -Zeros.className = 'Zeros'; -serialization.registerClass(Zeros); -export class Ones extends Initializer { - apply(shape, dtype) { - return ones(shape, dtype); - } -} -/** @nocollapse */ -Ones.className = 'Ones'; -serialization.registerClass(Ones); -export class Constant extends Initializer { - constructor(args) { - super(); - if (typeof args !== 'object') { - throw new ValueError(`Expected argument of type ConstantConfig but got ${args}`); - } - if (args.value === undefined) { - throw new ValueError(`config must have value set but got ${args}`); - } - this.value = args.value; - } - apply(shape, dtype) { - return tidy(() => mul(scalar(this.value), ones(shape, dtype))); - } - getConfig() { - return { - value: this.value, - }; - } -} -/** @nocollapse */ -Constant.className = 'Constant'; -serialization.registerClass(Constant); -export class RandomUniform extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MINVAL = -0.05; - this.DEFAULT_MAXVAL = 0.05; - this.minval = args.minval || this.DEFAULT_MINVAL; - this.maxval = args.maxval || this.DEFAULT_MAXVAL; - this.seed = args.seed; - } - apply(shape, dtype) { - return randomUniform(shape, this.minval, this.maxval, dtype); - } - getConfig() { - return { minval: this.minval, maxval: this.maxval, seed: this.seed }; - } -} -/** @nocollapse */ -RandomUniform.className = 'RandomUniform'; -serialization.registerClass(RandomUniform); -export class RandomNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`randomNormal does not support dType ${dtype}.`); - } - return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } -} -/** @nocollapse */ -RandomNormal.className = 'RandomNormal'; -serialization.registerClass(RandomNormal); -export class TruncatedNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`truncatedNormal does not support dType ${dtype}.`); - } - return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } -} -/** @nocollapse */ -TruncatedNormal.className = 'TruncatedNormal'; -serialization.registerClass(TruncatedNormal); -export class Identity extends Initializer { - constructor(args) { - super(); - this.gain = args.gain != null ? args.gain : 1.0; - } - apply(shape, dtype) { - return tidy(() => { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError('Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } - else { - return mul(this.gain, eye(shape[0])); - } - }); - } - getConfig() { - return { gain: this.gain }; - } -} -/** @nocollapse */ -Identity.className = 'Identity'; -serialization.registerClass(Identity); -/** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ -function computeFans(shape, dataFormat = 'channelsLast') { - let fanIn; - let fanOut; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } - else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - const receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } - else if (dataFormat === 'channelsLast') { - const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } - else { - const shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - return [fanIn, fanOut]; -} -export class VarianceScaling extends Initializer { - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - constructor(args) { - super(); - if (args.scale < 0.0) { - throw new ValueError(`scale must be a positive float. Got: ${args.scale}`); - } - this.scale = args.scale == null ? 1.0 : args.scale; - this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(this.mode); - this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(this.distribution); - this.seed = args.seed; - } - apply(shape, dtype) { - const fans = computeFans(shape); - const fanIn = fans[0]; - const fanOut = fans[1]; - let scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } - else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } - else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - if (this.distribution === 'normal') { - const stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`${this.getClassName()} does not support dType ${dtype}.`); - } - return truncatedNormal(shape, 0, stddev, dtype, this.seed); - } - else { - const limit = Math.sqrt(3 * scale); - return randomUniform(shape, -limit, limit, dtype); - } - } - getConfig() { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - } -} -/** @nocollapse */ -VarianceScaling.className = 'VarianceScaling'; -serialization.registerClass(VarianceScaling); -export class GlorotUniform extends VarianceScaling { - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -GlorotUniform.className = 'GlorotUniform'; -serialization.registerClass(GlorotUniform); -export class GlorotNormal extends VarianceScaling { - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -GlorotNormal.className = 'GlorotNormal'; -serialization.registerClass(GlorotNormal); -export class HeNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -HeNormal.className = 'HeNormal'; -serialization.registerClass(HeNormal); -export class HeUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -HeUniform.className = 'HeUniform'; -serialization.registerClass(HeUniform); -export class LeCunNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -LeCunNormal.className = 'LeCunNormal'; -serialization.registerClass(LeCunNormal); -export class LeCunUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -LeCunUniform.className = 'LeCunNormal'; -serialization.registerClass(LeCunUniform); -export class Orthogonal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_GAIN = 1; - this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain; - this.seed = args.seed; - if (this.seed != null) { - throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); - } - } - apply(shape, dtype) { - return tidy(() => { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn(`Orthogonal initializer is being called on a matrix with more ` + - `than 2000 (${shape[0] * shape[1]}) elements: ` + - `Slowness may result.`); - } - // TODO(cais): Add seed support. - const normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - const a = K.randomNormal(normalizedShape, 0, 1, 'float32'); - let q = linalg.gramSchmidt(a); - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return mul(this.gain, q); - }); - } - getConfig() { - return { - gain: this.gain, - seed: this.seed, - }; - } -} -/** @nocollapse */ -Orthogonal.className = 'Orthogonal'; -serialization.registerClass(Orthogonal); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -export const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' -}; -function deserializeInitializer(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); -} -export function serializeInitializer(initializer) { - return serializeKerasObject(initializer); -} -export function getInitializer(identifier) { - if (typeof identifier === 'string') { - const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } - else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } - else if (className === 'HeNormal') { - return new HeNormal(); - } - else if (className === 'HeUniform') { - return new HeUniform(); - } - else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } - else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } - else { - const config = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } - else if (identifier instanceof Initializer) { - return identifier; - } - else { - return deserializeInitializer(identifier); - } -} -//# sourceMappingURL=initializers.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-layers/dist/initializers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map deleted file mode 100644 index 0115a895c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"initializers.js","sourceRoot":"","sources":["../src/initializers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAW,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAoB,IAAI,EAAE,eAAe,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAE7J,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAwB,yBAAyB,EAAE,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAC1H,OAAO,EAAC,yBAAyB,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAE7C,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,yBAAyB,CAAC,qBAAqB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,yBAAyB,CAAC,yBAAyB,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAgB,WAAY,SAAQ,aAAa,CAAC,YAAY;IAC3D,2BAA2B;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IASD,SAAS;QACP,OA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,oBAAoB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UACwB;IACrD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,SAAS,GAAG,UAAU,IAAI,0CAA0C,CAAC,CAAC;YACxE,0CAA0C,CAAC,UAAU,CAAC,CAAC,CAAC;YACxD,UAAU,CAAC;QACf;;8CAEsC;QACtC,IAAI,SAAS,KAAK,cAAc,EAAE;YAChC,OAAO,IAAI,YAAY,EAAE,CAAC;SAC3B;aAAM,IAAI,SAAS,KAAK,eAAe,EAAE;YACxC,OAAO,IAAI,aAAa,EAAE,CAAC;SAC5B;aAAM,IAAI,SAAS,KAAK,UAAU,EAAE;YACnC,OAAO,IAAI,QAAQ,EAAE,CAAC;SACvB;aAAM,IAAI,SAAS,KAAK,WAAW,EAAE;YACpC,OAAO,IAAI,SAAS,EAAE,CAAC;SACxB;aAAM,IAAI,SAAS,KAAK,aAAa,EAAE;YACtC,OAAO,IAAI,WAAW,EAAE,CAAC;SAC1B;aAAM,IAAI,SAAS,KAAK,cAAc,EAAE;YACvC,OAAO,IAAI,YAAY,EAAE,CAAC;SAC3B;aAAM;YACL,MAAM,MAAM,GAA6B,EAAE,CAAC;YAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;YAChC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACtB,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;SACvC;KACF;SAAM,IAAI,UAAU,YAAY,WAAW,EAAE;QAC5C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;KAC3C;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\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-layers/dist/initializers_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map deleted file mode 100644 index 6142df878..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"initializers_test.js","sourceRoot":"","sources":["../src/initializers_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,GAAG,EAAE,YAAY,EAAmC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEnG,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACtH,OAAO,EAAC,yBAAyB,EAAE,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAEnG,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAEjJ,eAAe,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;QACZ,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,KAAK,CAA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,CAAC,CAAC,CAAC;QAC3D,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAY,CAAC,KAAK,CAAC;aAClE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for initializers.\n */\n\nimport {eye, randomNormal, serialization, Tensor, Tensor2D, tensor2d} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport {checkDistribution, checkFanMode, getInitializer, serializeInitializer, VarianceScaling} from './initializers';\nimport {VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport * as math_utils from './utils/math_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectNoLeakedTensors, expectTensorsClose, expectTensorsValuesInRange} from './utils/test_utils';\n\ndescribeMathCPU('Zeros initializer', () => {\n it('1D', () => {\n const init = getInitializer('zeros');\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n\n it('1D, upper case', () => {\n const init = getInitializer('Zeros');\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n\n it('2D', () => {\n const init = getInitializer('zeros');\n const weights = init.apply([2, 2], 'float32');\n expect(weights.shape).toEqual([2, 2]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('zeros').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('Ones initializer', () => {\n it('1D', () => {\n const init = getInitializer('ones');\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([1, 1, 1]));\n });\n\n it('1D, upper case', () => {\n const init = getInitializer('Ones');\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([1, 1, 1]));\n });\n\n it('2D', () => {\n const init = getInitializer('ones');\n const weights = init.apply([2, 2], 'float32');\n expect(weights.shape).toEqual([2, 2]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([1, 1, 1, 1]));\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('ones').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('Constant initializer', () => {\n it('1D, from config dict', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Constant', config: {value: 5}};\n const init = getInitializer(initializerConfig);\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([5, 5, 5]));\n });\n\n it('1D, from builder function', () => {\n const init = tfl.initializers.constant({value: 5});\n const weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([5, 5, 5]));\n });\n\n it('1D, from builder function: passing a direct value throws error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.initializers.constant(5 as any))\n .toThrowError(/Expected.*ConstantConfig/);\n });\n\n it('2D, from config dict', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Constant', config: {value: 5}};\n const init = getInitializer(initializerConfig);\n const weights = init.apply([2, 2], 'float32');\n expect(weights.shape).toEqual([2, 2]);\n expect(weights.dtype).toEqual('float32');\n expect(weights.dataSync()).toEqual(new Float32Array([5, 5, 5, 5]));\n });\n\n it('Does not leak', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Constant', config: {value: 5}};\n expectNoLeakedTensors(\n () => getInitializer(initializerConfig).apply([3]), 1);\n });\n});\n\ndescribeMathCPU('Identity initializer', () => {\n it('1D', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Identity', config: {gain: 5}};\n const init = getInitializer(initializerConfig);\n expect(() => init.apply([4])).toThrowError(/2D square/);\n });\n\n it('1D, from config', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Identity', config: {gain: 5}};\n const init = getInitializer(initializerConfig);\n expect(() => init.apply([4])).toThrowError(/2D square/);\n });\n\n it('2D', () => {\n const initializerConfig:\n serialization.ConfigDict = {className: 'Identity', config: {gain: 5}};\n const init = getInitializer(initializerConfig);\n const weights = init.apply([2, 2], 'float32');\n expect(weights.shape).toEqual([2, 2]);\n expect(weights.dtype).toEqual('float32');\n expectTensorsClose(weights, tensor2d([5, 0, 0, 5], [2, 2]));\n });\n});\n\ndescribeMathCPU('RandomUniform initializer', () => {\n const shape = [7, 2];\n it('default', () => {\n const init = getInitializer('randomUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -0.05, 0.05);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('RandomUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -0.05, 0.05);\n });\n\n it('with configured min max val', () => {\n const initializerConfig: serialization.ConfigDict = {\n className: 'RandomUniform',\n config: {minval: 17, maxval: 47}\n };\n const init = getInitializer(initializerConfig);\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, 17, 47);\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('RandomUniform').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('RandomNormal initializer', () => {\n const shape = [7, 2];\n it('default', () => {\n const init = getInitializer('randomNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n // TODO(bileschi): Add test to assert the values match expectations.\n });\n\n it('default, upper case', () => {\n const init = getInitializer('RandomNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n // TODO(bileschi): Add test to assert the values match expectations.\n });\n\n it('with configured min max val', () => {\n const initializerConfig: serialization.ConfigDict = {\n className: 'RandomNormal',\n config: {mean: 1.0, stddev: 0.001}\n };\n const init = getInitializer(initializerConfig);\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n // TODO(bileschi): Add test to assert the values match expectations.\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('RandomNormal').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('HeNormal initializer', () => {\n const shape = [7, 2];\n const stddev = Math.sqrt(2 / shape[0]);\n it('default', () => {\n const init = getInitializer('heNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -2 * stddev, 2 * stddev);\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('HeNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -2 * stddev, 2 * stddev);\n });\n\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('HeNormal').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('HeUniform initializer', () => {\n const shape = [7, 2];\n const bound = Math.sqrt(6 / shape[0]);\n it('default', () => {\n const init = getInitializer('heUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -bound, bound);\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('HeUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -bound, bound);\n });\n\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('heUniform').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('LecunNormal initializer', () => {\n const shape = [7, 2];\n const stddev = Math.sqrt(1 / shape[0]);\n it('default', () => {\n const init = getInitializer('leCunNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -2 * stddev, 2 * stddev);\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('LeCunNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -2 * stddev, 2 * stddev);\n });\n\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('LeCunNormal').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('LeCunUniform initializer', () => {\n const shape = [7, 2];\n const bound = Math.sqrt(3 / shape[0]);\n it('default', () => {\n const init = getInitializer('leCunUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -bound, bound);\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('LeCunUniform');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -bound, bound);\n });\n\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('LeCunUniform').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('TruncatedNormal initializer', () => {\n const shape = [7, 2];\n it('default', () => {\n const init = getInitializer('truncatedNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -0.1, 0.1);\n });\n\n it('default, upper case', () => {\n const init = getInitializer('TruncatedNormal');\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, -0.1, 0.1);\n });\n\n it('with configured min max val', () => {\n const initializerConfig: serialization.ConfigDict = {\n className: 'TruncatedNormal',\n config: {mean: 1.0, stddev: 0.5}\n };\n const init = getInitializer(initializerConfig);\n const weights = init.apply(shape, 'float32');\n expect(weights.shape).toEqual(shape);\n expect(weights.dtype).toEqual('float32');\n expectTensorsValuesInRange(weights, 0.0, 2.0);\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(\n () => getInitializer('TruncatedNormal').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('Glorot uniform initializer', () => {\n ['glorotUniform', 'GlorotUniform'].forEach(initializer => {\n it('1D ' + initializer, () => {\n const init = getInitializer(initializer);\n let weights = init.apply([3], 'float32');\n expect(weights.shape).toEqual([3]);\n expect(weights.dtype).toEqual('float32');\n let scale = 1 / ((Math.sqrt(3) + Math.sqrt(3)) / 2);\n let limit = Math.sqrt(3 * scale);\n expect(math_utils.max(weights.dataSync() as Float32Array))\n .toBeLessThan(limit);\n expect(math_utils.min(weights.dataSync() as Float32Array))\n .toBeGreaterThan(-limit);\n\n weights = init.apply([30], 'float32');\n expect(weights.shape).toEqual([30]);\n expect(weights.dtype).toEqual('float32');\n scale = 1 / ((Math.sqrt(30) + Math.sqrt(30)) / 2);\n limit = Math.sqrt(3 * scale);\n expect(math_utils.max(weights.dataSync() as Float32Array))\n .toBeLessThan(limit);\n expect(math_utils.min(weights.dataSync() as Float32Array))\n .toBeGreaterThan(-limit);\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n });\n\n it('2D ' + initializer, () => {\n const init = getInitializer(initializer);\n let weights = init.apply([2, 2], 'float32');\n expect(weights.shape).toEqual([2, 2]);\n expect(weights.dtype).toEqual('float32');\n let scale = 1 / ((Math.sqrt(2) + Math.sqrt(2)) / 2);\n let limit = Math.sqrt(3 * scale);\n expect(math_utils.max(weights.dataSync() as Float32Array))\n .toBeLessThan(limit);\n expect(math_utils.min(weights.dataSync() as Float32Array))\n .toBeGreaterThan(-limit);\n\n weights = init.apply([20, 20], 'float32');\n expect(weights.shape).toEqual([20, 20]);\n expect(weights.dtype).toEqual('float32');\n scale = 1 / ((Math.sqrt(20) + Math.sqrt(20)) / 2);\n limit = Math.sqrt(3 * scale);\n expect(math_utils.max(weights.dataSync() as Float32Array))\n .toBeLessThan(limit);\n expect(math_utils.min(weights.dataSync() as Float32Array))\n .toBeGreaterThan(-limit);\n });\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('GlorotUniform').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('VarianceScaling initializer', () => {\n ['varianceScaling', 'VarianceScaling'].forEach(initializer => {\n it('Default argument values', () => {\n const init = getInitializer(initializer);\n const config = init.getConfig();\n expect(config['scale']).toEqual(1);\n expect(config['mode']).toEqual('fanIn');\n expect(config['distribution']).toEqual('normal');\n expect(config['seed']).toEqual(undefined);\n });\n });\n\n ['uniform', 'normal', 'truncatedNormal'].forEach(distribution => {\n it('Can be constructed from config dict', () => {\n const baseInit = getInitializer('varianceScaling');\n const baseConfig = baseInit.getConfig();\n baseConfig.distribution = distribution;\n const newInit = new VarianceScaling(baseConfig);\n const newConfig = newInit.getConfig();\n expect(newConfig['distribution']).toEqual(baseConfig['distribution']);\n });\n });\n});\n\ndescribeMathCPU('Glorot normal initializer', () => {\n ['glorotNormal', 'GlorotNormal'].forEach(initializer => {\n it('1D ' + initializer, () => {\n const init = getInitializer(initializer);\n const NUM_TRIALS = 4;\n const varianceArr1: number[] = [];\n const varianceArr2: number[] = [];\n\n for (let i = 0; i < NUM_TRIALS; ++i) {\n let weights = init.apply([30], 'float32');\n expect(weights.shape).toEqual([30]);\n expect(weights.dtype).toEqual('float32');\n varianceArr1.push(\n math_utils.variance(weights.dataSync() as Float32Array));\n\n weights = init.apply([1200], 'float32');\n expect(weights.shape).toEqual([1200]);\n expect(weights.dtype).toEqual('float32');\n varianceArr2.push(\n math_utils.variance(weights.dataSync() as Float32Array));\n expect(init.getClassName()).toEqual(VarianceScaling.className);\n }\n\n const variance1 = math_utils.median(varianceArr1);\n const variance2 = math_utils.median(varianceArr2);\n expect(variance2).toBeLessThan(variance1);\n });\n\n it('2D ' + initializer, () => {\n const init = getInitializer(initializer);\n const NUM_TRIALS = 4;\n const varianceArr1: number[] = [];\n const varianceArr2: number[] = [];\n\n for (let i = 0; i < NUM_TRIALS; ++i) {\n let weights = init.apply([5, 6], 'float32');\n expect(weights.shape).toEqual([5, 6]);\n expect(weights.dtype).toEqual('float32');\n varianceArr1.push(\n math_utils.variance(weights.dataSync() as Float32Array));\n\n weights = init.apply([30, 50], 'float32');\n expect(weights.shape).toEqual([30, 50]);\n expect(weights.dtype).toEqual('float32');\n varianceArr2.push(\n math_utils.variance(weights.dataSync() as Float32Array));\n }\n\n const variance1 = math_utils.median(varianceArr1);\n const variance2 = math_utils.median(varianceArr2);\n expect(variance2).toBeLessThan(variance1);\n });\n });\n it('Does not leak', () => {\n expectNoLeakedTensors(() => getInitializer('GlorotNormal').apply([3]), 1);\n });\n});\n\ndescribeMathCPU('initializers.get', () => {\n it('by string', () => {\n const initializer = getInitializer('glorotNormal');\n const config =\n serializeInitializer(initializer) as serialization.ConfigDict;\n const nestedConfig = config.config as serialization.ConfigDict;\n expect(nestedConfig.scale).toEqual(1.0);\n expect(nestedConfig.mode).toEqual('fanAvg');\n expect(nestedConfig.distribution).toEqual('normal');\n });\n it('by existing object', () => {\n const origInit = tfl.initializers.zeros();\n const initializer = getInitializer(origInit);\n expect(initializer).toEqual(origInit);\n });\n it('by config dict', () => {\n const origInit = tfl.initializers.glorotUniform({seed: 10});\n const initializer = getInitializer(\n serializeInitializer(origInit) as serialization.ConfigDict);\n expect(serializeInitializer(initializer))\n .toEqual(serializeInitializer(origInit));\n });\n});\n\ndescribe('Invalid intializer identifier', () => {\n it('Throws exception', () => {\n expect(() => {\n getInitializer('invalid_initializer_id');\n }).toThrowError();\n });\n});\n\ndescribe('checkFanMode', () => {\n it('Valid values', () => {\n const extendedValues = VALID_FAN_MODE_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkFanMode(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkFanMode('foo')).toThrowError(/foo/);\n try {\n checkFanMode('bad');\n } catch (e) {\n expect(e).toMatch('FanMode');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_FAN_MODE_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribe('checkDistribution', () => {\n it('Valid values', () => {\n const extendedValues = VALID_DISTRIBUTION_VALUES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkDistribution(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkDistribution('foo')).toThrowError(/foo/);\n try {\n checkDistribution('bad');\n } catch (e) {\n expect(e).toMatch('Distribution');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_DISTRIBUTION_VALUES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribeMathCPUAndGPU('Orthogonal Initializer', () => {\n it('2x2', () => {\n const init = getInitializer('Orthogonal');\n const w = init.apply([2, 2], 'float32') as Tensor2D;\n expect(w.shape).toEqual([2, 2]);\n expect(w.dtype).toEqual('float32');\n // Assert that columns of w are orthogonal (w is a unitary matrix).\n expectTensorsClose(w.transpose().matMul(w), eye(2));\n });\n\n it('1x1 with gain', () => {\n const init = tfl.initializers.orthogonal({gain: 3});\n const w = init.apply([1, 1], 'float32') as Tensor2D;\n expect(w.shape).toEqual([1, 1]);\n expect(w.dtype).toEqual('float32');\n // Assert that columns of w are orthogonal (w is a unitary matrix) and the\n // gain has been reflected.\n expectTensorsClose(w.transpose().matMul(w), tensor2d([[9]], [1, 1]));\n });\n\n it('4x2', () => {\n const init = getInitializer('Orthogonal');\n const w = init.apply([4, 2], 'float32') as Tensor2D;\n expect(w.shape).toEqual([4, 2]);\n expect(w.dtype).toEqual('float32');\n // Assert that columns of w are orthogonal.\n expectTensorsClose(w.transpose().matMul(w), eye(2));\n });\n\n it('2x4', () => {\n const init = getInitializer('Orthogonal');\n const w = init.apply([2, 4], 'float32') as Tensor2D;\n expect(w.shape).toEqual([2, 4]);\n expect(w.dtype).toEqual('float32');\n const wT: Tensor2D = w.transpose();\n // Assert that columns of w are orthogonal.\n expectTensorsClose(w.matMul(wT), eye(2));\n });\n\n it('64x64', () => {\n // Disable console warning during this test.\n // Silence the large-size orthogonal matrix warnings.\n spyOn(console, 'warn').and.callFake((message: string) => {});\n const n = 64;\n const init = getInitializer('Orthogonal');\n const w = init.apply([n, n], 'float32') as Tensor2D;\n expect(w.shape).toEqual([n, n]);\n expect(w.dtype).toEqual('float32');\n // Assert that columns of w are orthogonal.\n const wT: Tensor2D = w.transpose();\n expectTensorsClose(w.matMul(wT), eye(n));\n });\n it('Does not leak', () => {\n const init = getInitializer('Orthogonal');\n expectNoLeakedTensors(() => init.apply([3, 3]), 1);\n });\n\n it('Deserialize model containing GlorotUniform initializer', () => {\n // From https://github.com/tensorflow/tfjs/issues/798\n const testModelJSON =\n // tslint:disable-next-line:max-line-length\n `{\"modelTopology\": {\"keras_version\": \"2.1.6-tf\", \"backend\": \"tensorflow\", \"model_config\": {\"class_name\": \"Model\", \"config\": {\"name\": \"emoji_autoencoder\", \"layers\": [{\"name\": \"input_1\", \"class_name\": \"InputLayer\", \"config\": {\"batch_input_shape\": [null, 128, 128, 1], \"dtype\": \"float32\", \"sparse\": false, \"name\": \"input_1\"}, \"inbound_nodes\": []}, {\"name\": \"Encoder\", \"class_name\": \"Model\", \"config\": {\"name\": \"Encoder\", \"layers\": [{\"name\": \"input_128x128\", \"class_name\": \"InputLayer\", \"config\": {\"batch_input_shape\": [null, 128, 128, 1], \"dtype\": \"float32\", \"sparse\": false, \"name\": \"input_128x128\"}, \"inbound_nodes\": []}, {\"name\": \"Convolution1\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"Convolution1\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 16, \"kernel_size\": [5, 5], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"input_128x128\", 0, 0, {}]]]}, {\"name\": \"shrink_64x64\", \"class_name\": \"MaxPooling2D\", \"config\": {\"name\": \"shrink_64x64\", \"trainable\": true, \"dtype\": \"float32\", \"pool_size\": [2, 2], \"padding\": \"same\", \"strides\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"Convolution1\", 0, 0, {}]]]}, {\"name\": \"Convolution2\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"Convolution2\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 8, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"shrink_64x64\", 0, 0, {}]]]}, {\"name\": \"shrink_32x32\", \"class_name\": \"MaxPooling2D\", \"config\": {\"name\": \"shrink_32x32\", \"trainable\": true, \"dtype\": \"float32\", \"pool_size\": [2, 2], \"padding\": \"same\", \"strides\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"Convolution2\", 0, 0, {}]]]}, {\"name\": \"Convolution3\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"Convolution3\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 8, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"shrink_32x32\", 0, 0, {}]]]}, {\"name\": \"shrink_8x8\", \"class_name\": \"MaxPooling2D\", \"config\": {\"name\": \"shrink_8x8\", \"trainable\": true, \"dtype\": \"float32\", \"pool_size\": [4, 4], \"padding\": \"same\", \"strides\": [4, 4], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"Convolution3\", 0, 0, {}]]]}, {\"name\": \"conv2d\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"conv2d\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 4, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"shrink_8x8\", 0, 0, {}]]]}, {\"name\": \"shrink_4x4\", \"class_name\": \"MaxPooling2D\", \"config\": {\"name\": \"shrink_4x4\", \"trainable\": true, \"dtype\": \"float32\", \"pool_size\": [2, 2], \"padding\": \"same\", \"strides\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"conv2d\", 0, 0, {}]]]}, {\"name\": \"matrix-to-vector\", \"class_name\": \"Flatten\", \"config\": {\"name\": \"matrix-to-vector\", \"trainable\": true, \"dtype\": \"float32\", \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"shrink_4x4\", 0, 0, {}]]]}, {\"name\": \"link_flat_to_64x1\", \"class_name\": \"Dense\", \"config\": {\"name\": \"link_flat_to_64x1\", \"trainable\": true, \"dtype\": \"float32\", \"units\": 64, \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"matrix-to-vector\", 0, 0, {}]]]}, {\"name\": \"output_8x1\", \"class_name\": \"Dense\", \"config\": {\"name\": \"output_8x1\", \"trainable\": true, \"dtype\": \"float32\", \"units\": 8, \"activation\": \"tanh\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"link_flat_to_64x1\", 0, 0, {}]]]}], \"input_layers\": [[\"input_128x128\", 0, 0]], \"output_layers\": [[\"output_8x1\", 0, 0]]}, \"inbound_nodes\": [[[\"input_1\", 0, 0, {}]]]}, {\"name\": \"Decoder\", \"class_name\": \"Model\", \"config\": {\"name\": \"Decoder\", \"layers\": [{\"name\": \"input_8x1\", \"class_name\": \"InputLayer\", \"config\": {\"batch_input_shape\": [null, 8], \"dtype\": \"float32\", \"sparse\": false, \"name\": \"input_8x1\"}, \"inbound_nodes\": []}, {\"name\": \"activate_input\", \"class_name\": \"Dense\", \"config\": {\"name\": \"activate_input\", \"trainable\": true, \"dtype\": \"float32\", \"units\": 64, \"activation\": \"tanh\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"input_8x1\", 0, 0, {}]]]}, {\"name\": \"link_reshape_64x1\", \"class_name\": \"Dense\", \"config\": {\"name\": \"link_reshape_64x1\", \"trainable\": true, \"dtype\": \"float32\", \"units\": 64, \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"activate_input\", 0, 0, {}]]]}, {\"name\": \"reshape_8x8\", \"class_name\": \"Reshape\", \"config\": {\"name\": \"reshape_8x8\", \"trainable\": true, \"dtype\": \"float32\", \"target_shape\": [8, 8, 1]}, \"inbound_nodes\": [[[\"link_reshape_64x1\", 0, 0, {}]]]}, {\"name\": \"conv2d_1\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"conv2d_1\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 8, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"reshape_8x8\", 0, 0, {}]]]}, {\"name\": \"grow_16x16\", \"class_name\": \"UpSampling2D\", \"config\": {\"name\": \"grow_16x16\", \"trainable\": true, \"dtype\": \"float32\", \"size\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"conv2d_1\", 0, 0, {}]]]}, {\"name\": \"conv2d_2\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"conv2d_2\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 8, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"grow_16x16\", 0, 0, {}]]]}, {\"name\": \"grow_32x32\", \"class_name\": \"UpSampling2D\", \"config\": {\"name\": \"grow_32x32\", \"trainable\": true, \"dtype\": \"float32\", \"size\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"conv2d_2\", 0, 0, {}]]]}, {\"name\": \"conv2d_3\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"conv2d_3\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 8, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"grow_32x32\", 0, 0, {}]]]}, {\"name\": \"grow_64x64\", \"class_name\": \"UpSampling2D\", \"config\": {\"name\": \"grow_64x64\", \"trainable\": true, \"dtype\": \"float32\", \"size\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"conv2d_3\", 0, 0, {}]]]}, {\"name\": \"conv2d_4\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"conv2d_4\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 16, \"kernel_size\": [3, 3], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"relu\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"grow_64x64\", 0, 0, {}]]]}, {\"name\": \"grow_128x128\", \"class_name\": \"UpSampling2D\", \"config\": {\"name\": \"grow_128x128\", \"trainable\": true, \"dtype\": \"float32\", \"size\": [2, 2], \"data_format\": \"channels_last\"}, \"inbound_nodes\": [[[\"conv2d_4\", 0, 0, {}]]]}, {\"name\": \"output_128x128\", \"class_name\": \"Conv2D\", \"config\": {\"name\": \"output_128x128\", \"trainable\": true, \"dtype\": \"float32\", \"filters\": 1, \"kernel_size\": [5, 5], \"strides\": [1, 1], \"padding\": \"same\", \"data_format\": \"channels_last\", \"dilation_rate\": [1, 1], \"activation\": \"tanh\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null, \"dtype\": \"float32\"}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {\"dtype\": \"float32\"}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}, \"inbound_nodes\": [[[\"grow_128x128\", 0, 0, {}]]]}], \"input_layers\": [[\"input_8x1\", 0, 0]], \"output_layers\": [[\"output_128x128\", 0, 0]]}, \"inbound_nodes\": [[[\"Encoder\", 1, 0, {}]]]}], \"input_layers\": [[\"input_1\", 0, 0]], \"output_layers\": [[\"Decoder\", 1, 0]]}}, \"training_config\": {\"optimizer_config\": {\"class_name\": \"Adadelta\", \"config\": {\"lr\": 1.0, \"rho\": 0.95, \"decay\": 0.0, \"epsilon\": 1e-07}}, \"loss\": \"mean_squared_error\", \"metrics\": [], \"weighted_metrics\": null, \"sample_weight_mode\": null, \"loss_weights\": null}}, \"weightsManifest\": [{\"paths\": [\"group1-shard1of1\"], \"weights\": [{\"name\": \"activate_input/kernel\", \"shape\": [8, 64], \"dtype\": \"float32\"}, {\"name\": \"activate_input/bias\", \"shape\": [64], \"dtype\": \"float32\"}, {\"name\": \"link_reshape_64x1/kernel\", \"shape\": [64, 64], \"dtype\": \"float32\"}, {\"name\": \"link_reshape_64x1/bias\", \"shape\": [64], \"dtype\": \"float32\"}, {\"name\": \"conv2d_1/kernel\", \"shape\": [3, 3, 1, 8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_1/bias\", \"shape\": [8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_2/kernel\", \"shape\": [3, 3, 8, 8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_2/bias\", \"shape\": [8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_3/kernel\", \"shape\": [3, 3, 8, 8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_3/bias\", \"shape\": [8], \"dtype\": \"float32\"}, {\"name\": \"conv2d_4/kernel\", \"shape\": [3, 3, 8, 16], \"dtype\": \"float32\"}, {\"name\": \"conv2d_4/bias\", \"shape\": [16], \"dtype\": \"float32\"}, {\"name\": \"output_128x128/kernel\", \"shape\": [5, 5, 16, 1], \"dtype\": \"float32\"}, {\"name\": \"output_128x128/bias\", \"shape\": [1], \"dtype\": \"float32\"}, {\"name\": \"Convolution1/kernel\", \"shape\": [5, 5, 1, 16], \"dtype\": \"float32\"}, {\"name\": \"Convolution1/bias\", \"shape\": [16], \"dtype\": \"float32\"}, {\"name\": \"Convolution2/kernel\", \"shape\": [3, 3, 16, 8], \"dtype\": \"float32\"}, {\"name\": \"Convolution2/bias\", \"shape\": [8], \"dtype\": \"float32\"}, {\"name\": \"Convolution3/kernel\", \"shape\": [3, 3, 8, 8], \"dtype\": \"float32\"}, {\"name\": \"Convolution3/bias\", \"shape\": [8], \"dtype\": \"float32\"}, {\"name\": \"conv2d/kernel\", \"shape\": [3, 3, 8, 4], \"dtype\": \"float32\"}, {\"name\": \"conv2d/bias\", \"shape\": [4], \"dtype\": \"float32\"}, {\"name\": \"link_flat_to_64x1/kernel\", \"shape\": [64, 64], \"dtype\": \"float32\"}, {\"name\": \"link_flat_to_64x1/bias\", \"shape\": [64], \"dtype\": \"float32\"}, {\"name\": \"output_8x1/kernel\", \"shape\": [64, 8], \"dtype\": \"float32\"}, {\"name\": \"output_8x1/bias\", \"shape\": [8], \"dtype\": \"float32\"}]}]}`;\n const modelConfig = convertPythonicToTs(\n JSON.parse(testModelJSON).modelTopology.model_config);\n\n const model = deserialize(modelConfig as PyJsonDict) as tfl.LayersModel;\n expect(model.layers.length).toEqual(3);\n expect(model.layers[0] instanceof tfl.LayersModel).toEqual(false);\n expect(model.layers[1] instanceof tfl.LayersModel).toEqual(true);\n expect(model.layers[2] instanceof tfl.LayersModel).toEqual(true);\n expect(model.inputs[0].shape).toEqual([null, 128, 128, 1]);\n expect(model.outputs[0].shape).toEqual([null, 128, 128, 1]);\n expect((model.predict(randomNormal([1, 128, 128, 1])) as Tensor).shape)\n .toEqual([1, 128, 128, 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-layers/dist/keras_format/activation_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.d.ts deleted file mode 100644 index 4236d2a44..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * List of all known activation names. - */ -export declare const activationOptions: ("softmax" | "elu" | "linear" | "relu" | "relu6" | "selu" | "sigmoid" | "softplus" | "softsign" | "tanh" | "swish" | "mish" | "hard_sigmoid")[]; -/** - * A type representing the strings that are valid loss names. - */ -export declare type ActivationSerialization = typeof activationOptions[number]; -/** @docinline */ -export declare type ActivationIdentifier = 'elu' | 'hardSigmoid' | 'linear' | 'relu' | 'relu6' | 'selu' | 'sigmoid' | 'softmax' | 'softplus' | 'softsign' | 'tanh' | 'swish' | 'mish'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js deleted file mode 100644 index 5f9f30eac..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { stringLiteralArray } from './utils'; -/** - * List of all known activation names. - */ -export const activationOptions = stringLiteralArray([ - 'elu', 'hard_sigmoid', 'linear', 'relu', 'relu6', 'selu', 'sigmoid', - 'softmax', 'softplus', 'softsign', 'tanh', 'swish', 'mish' -]); -//# sourceMappingURL=activation_config.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-layers/dist/keras_format/activation_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js.map deleted file mode 100644 index efe7230d5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/activation_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"activation_config.js","sourceRoot":"","sources":["../../src/keras_format/activation_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;IAClD,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS;IACnE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAC3D,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {stringLiteralArray} from './utils';\n\n/**\n * List of all known activation names.\n */\nexport const activationOptions = stringLiteralArray([\n 'elu', 'hard_sigmoid', 'linear', 'relu', 'relu6', 'selu', 'sigmoid',\n 'softmax', 'softplus', 'softsign', 'tanh', 'swish', 'mish'\n]);\n\n/**\n * A type representing the strings that are valid loss names.\n */\nexport type ActivationSerialization = typeof activationOptions[number];\n\n// Sad that we have to do all this just for hard_sigmoid vs. hardSigmoid.\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type ActivationIdentifier = 'elu'|'hardSigmoid'|'linear'|'relu'|'relu6'|\n 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|'swish'|'mish';\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.d.ts deleted file mode 100644 index a04ffa608..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** @docalias (null | number)[] */ -export declare type Shape = Array; -export declare type DataType = 'float32' | 'int32' | 'bool' | 'complex64' | 'string'; -/** @docinline */ -export declare type DataFormat = 'channelsFirst' | 'channelsLast'; -export declare const VALID_DATA_FORMAT_VALUES: string[]; -export declare type InterpolationFormat = 'nearest' | 'bilinear'; -export declare const VALID_INTERPOLATION_FORMAT_VALUES: string[]; -export declare type DataFormatSerialization = 'channels_first' | 'channels_last'; -/** @docinline */ -export declare type PaddingMode = 'valid' | 'same' | 'causal'; -export declare const VALID_PADDING_MODE_VALUES: string[]; -/** @docinline */ -export declare type PoolMode = 'max' | 'avg'; -export declare const VALID_POOL_MODE_VALUES: string[]; -/** @docinline */ -export declare type BidirectionalMergeMode = 'sum' | 'mul' | 'concat' | 'ave'; -export declare const VALID_BIDIRECTIONAL_MERGE_MODES: string[]; -/** @docinline */ -export declare type SampleWeightMode = 'temporal'; -export declare const VALID_SAMPLE_WEIGHT_MODES: string[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js deleted file mode 100644 index ba9014880..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; -export const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; -export const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; -export const VALID_POOL_MODE_VALUES = ['max', 'avg']; -export const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; -export const VALID_SAMPLE_WEIGHT_MODES = ['temporal']; -//# sourceMappingURL=common.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-layers/dist/keras_format/common.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js.map deleted file mode 100644 index eb27f4dbd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/keras_format/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAMzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAIrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAIrD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAI/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.d.ts deleted file mode 100644 index 0ec24de6e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseSerialization } from './types'; -export declare type MaxNormConfig = { - max_value?: number; - axis?: number; -}; -export declare type MaxNormSerialization = BaseSerialization<'MaxNorm', MaxNormConfig>; -export declare type UnitNormConfig = { - axis?: number; -}; -export declare type UnitNormSerialization = BaseSerialization<'UnitNorm', UnitNormConfig>; -export declare type NonNegSerialization = BaseSerialization<'NonNeg', null>; -export declare type MinMaxNormConfig = { - min_value?: number; - max_value?: number; - axis?: number; - rate?: number; -}; -export declare type MinMaxNormSerialization = BaseSerialization<'MinMaxNorm', MinMaxNormConfig>; -export declare type ConstraintSerialization = MaxNormSerialization | NonNegSerialization | UnitNormSerialization | MinMaxNormSerialization; -export declare type ConstraintClassName = ConstraintSerialization['class_name']; -/** - * A string array of valid Constraint class names. - * - * This is guaranteed to match the `ConstraintClassName` union type. - */ -export declare const constraintClassNames: ConstraintClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js deleted file mode 100644 index d337ff95e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. -/** - * A string array of valid Constraint class names. - * - * This is guaranteed to match the `ConstraintClassName` union type. - */ -export const constraintClassNames = ['MaxNorm', 'UnitNorm', 'NonNeg', 'MinMaxNorm']; -//# sourceMappingURL=constraint_config.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-layers/dist/keras_format/constraint_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js.map deleted file mode 100644 index 7171ffac2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/constraint_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constraint_config.js","sourceRoot":"","sources":["../../src/keras_format/constraint_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoCH,4EAA4E;AAC5E,6EAA6E;AAC7E,6CAA6C;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC7B,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\nexport type MaxNormConfig = {\n max_value?: number;\n axis?: number;\n};\n\nexport type MaxNormSerialization = BaseSerialization<'MaxNorm', MaxNormConfig>;\n\nexport type UnitNormConfig = {\n axis?: number;\n};\n\nexport type UnitNormSerialization =\n BaseSerialization<'UnitNorm', UnitNormConfig>;\n\nexport type NonNegSerialization = BaseSerialization<'NonNeg', null>;\n\nexport type MinMaxNormConfig = {\n min_value?: number;\n max_value?: number;\n axis?: number;\n rate?: number;\n};\n\nexport type MinMaxNormSerialization =\n BaseSerialization<'MinMaxNorm', MinMaxNormConfig>;\n\n// Update constraintClassNames below in concert with this.\nexport type ConstraintSerialization = MaxNormSerialization|NonNegSerialization|\n UnitNormSerialization|MinMaxNormSerialization;\n\nexport type ConstraintClassName = ConstraintSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Constraint class names.\n *\n * This is guaranteed to match the `ConstraintClassName` union type.\n */\nexport const constraintClassNames: ConstraintClassName[] =\n ['MaxNorm', 'UnitNorm', 'NonNeg', 'MinMaxNorm'];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.d.ts deleted file mode 100644 index c8b83f946..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseSerialization } from './types'; -/** @docinline */ -export declare type FanMode = 'fanIn' | 'fanOut' | 'fanAvg'; -export declare const VALID_FAN_MODE_VALUES: string[]; -export declare type FanModeSerialization = 'fan_in' | 'fan_out' | 'fan_avg'; -/** @docinline */ -export declare type Distribution = 'normal' | 'uniform' | 'truncatedNormal'; -export declare const VALID_DISTRIBUTION_VALUES: string[]; -export declare type DistributionSerialization = 'normal' | 'uniform' | 'truncated_normal'; -export declare type ZerosSerialization = BaseSerialization<'Zeros', {}>; -export declare type OnesSerialization = BaseSerialization<'Ones', {}>; -export declare type ConstantConfig = { - value: number; -}; -export declare type ConstantSerialization = BaseSerialization<'Constant', ConstantConfig>; -export declare type RandomNormalConfig = { - mean?: number; - stddev?: number; - seed?: number; -}; -export declare type RandomNormalSerialization = BaseSerialization<'RandomNormal', RandomNormalConfig>; -export declare type RandomUniformConfig = { - minval?: number; - maxval?: number; - seed?: number; -}; -export declare type RandomUniformSerialization = BaseSerialization<'RandomUniform', RandomUniformConfig>; -export declare type TruncatedNormalConfig = { - mean?: number; - stddev?: number; - seed?: number; -}; -export declare type TruncatedNormalSerialization = BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>; -export declare type VarianceScalingConfig = { - scale?: number; - mode?: FanModeSerialization; - distribution?: DistributionSerialization; - seed?: number; -}; -export declare type VarianceScalingSerialization = BaseSerialization<'VarianceScaling', VarianceScalingConfig>; -export declare type OrthogonalConfig = { - seed?: number; - gain?: number; -}; -export declare type OrthogonalSerialization = BaseSerialization<'Orthogonal', OrthogonalConfig>; -export declare type IdentityConfig = { - gain?: number; -}; -export declare type IdentitySerialization = BaseSerialization<'Identity', IdentityConfig>; -export declare type InitializerSerialization = ZerosSerialization | OnesSerialization | ConstantSerialization | RandomUniformSerialization | RandomNormalSerialization | TruncatedNormalSerialization | IdentitySerialization | VarianceScalingSerialization | OrthogonalSerialization; -export declare type InitializerClassName = InitializerSerialization['class_name']; -/** - * A string array of valid Initializer class names. - * - * This is guaranteed to match the `InitializerClassName` union type. - */ -export declare const initializerClassNames: InitializerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js deleted file mode 100644 index d134875f8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; -export const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform', 'truncatedNormal']; -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. -/** - * A string array of valid Initializer class names. - * - * This is guaranteed to match the `InitializerClassName` union type. - */ -export const initializerClassNames = [ - 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform', - 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity' -]; -//# sourceMappingURL=initializer_config.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-layers/dist/keras_format/initializer_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js.map deleted file mode 100644 index ecd28f0d5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"initializer_config.js","sourceRoot":"","sources":["../../src/keras_format/initializer_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAOnE,MAAM,CAAC,MAAM,yBAAyB,GAClC,CAAC,QAAQ,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;AA4E7C,4EAA4E;AAC5E,6EAA6E;AAC7E,6CAA6C;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe;IAC5D,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU;CAC/D,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\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-layers/dist/keras_format/input_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.d.ts deleted file mode 100644 index c2cfc14f8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType } from '@tensorflow/tfjs-core'; -import { Shape } from './common'; -import { BaseLayerSerialization } from './topology_config'; -export declare type InputLayerConfig = { - name?: string; - input_shape?: Shape; - batch_size?: number; - batch_input_shape?: Shape; - dtype?: DataType; - sparse?: boolean; -}; -export declare type InputLayerSerialization = BaseLayerSerialization<'InputLayer', InputLayerConfig>; -export declare type InputLayerClassName = InputLayerSerialization['class_name']; -/** - * A string array of valid InputLayer class names. - * - * This is guaranteed to match the `InputLayerClassName` union type. - */ -export declare const inputLayerClassNames: InputLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js deleted file mode 100644 index 0d8db3410..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid InputLayer class names. - * - * This is guaranteed to match the `InputLayerClassName` union type. - */ -export const inputLayerClassNames = [ - 'InputLayer', -]; -//# sourceMappingURL=input_config.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-layers/dist/keras_format/input_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js.map deleted file mode 100644 index 354c5af7f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/input_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"input_config.js","sourceRoot":"","sources":["../../src/keras_format/input_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwBH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA0B;IACzD,YAAY;CACb,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType} from '@tensorflow/tfjs-core';\nimport {Shape} from './common';\nimport {BaseLayerSerialization} from './topology_config';\n\nexport type InputLayerConfig = {\n name?: string;\n input_shape?: Shape;\n batch_size?: number;\n batch_input_shape?: Shape;\n dtype?: DataType;\n sparse?: boolean;\n};\n\n// This really should be BaseSerialization because an input layer has no\n// inbound_nodes. But, that makes type safety more difficult.\n\n// Update inputLayerClassNames below in concert with this.\nexport type InputLayerSerialization =\n BaseLayerSerialization<'InputLayer', InputLayerConfig>;\n\nexport type InputLayerClassName = InputLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid InputLayer class names.\n *\n * This is guaranteed to match the `InputLayerClassName` union type.\n */\nexport const inputLayerClassNames: InputLayerClassName[] = [\n 'InputLayer',\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-layers/dist/keras_format/keras_class_names.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.d.ts deleted file mode 100644 index 56cd7036e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstraintSerialization } from './constraint_config'; -import { InitializerSerialization } from './initializer_config'; -import { LayerSerialization } from './layers/layer_serialization'; -import { OptimizerSerialization } from './optimizer_config'; -import { RegularizerSerialization } from './regularizer_config'; -/** - * A type representing all possible Serializations of Keras objects, including - * Layers, Constraints, Optimizers, etc. - */ -export declare type KerasSerialization = LayerSerialization | ConstraintSerialization | InitializerSerialization | RegularizerSerialization | OptimizerSerialization; -/** - * A type representing all valid values of `class_name` in a Keras JSON file - * (regardless of context, which will naturally further restrict the valid - * values). - */ -export declare type KerasClassName = KerasSerialization['class_name']; -export declare const kerasClassNames: KerasClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js deleted file mode 100644 index ac2ddcfd6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { constraintClassNames } from './constraint_config'; -import { initializerClassNames } from './initializer_config'; -import { layerClassNames } from './layers/layer_serialization'; -import { optimizerClassNames } from './optimizer_config'; -import { regularizerClassNames } from './regularizer_config'; -export const kerasClassNames = [ - ...layerClassNames, ...constraintClassNames, ...initializerClassNames, - ...regularizerClassNames, ...optimizerClassNames -]; -//# sourceMappingURL=keras_class_names.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-layers/dist/keras_format/keras_class_names.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js.map deleted file mode 100644 index 66310c3c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/keras_class_names.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keras_class_names.js","sourceRoot":"","sources":["../../src/keras_format/keras_class_names.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,oBAAoB,EAA0B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAA2B,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAC,eAAe,EAAqB,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAC,mBAAmB,EAAyB,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAC,qBAAqB,EAA2B,MAAM,sBAAsB,CAAC;AAgBrF,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,GAAG,eAAe,EAAE,GAAG,oBAAoB,EAAE,GAAG,qBAAqB;IACrE,GAAG,qBAAqB,EAAE,GAAG,mBAAmB;CACjD,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {constraintClassNames, ConstraintSerialization} from './constraint_config';\nimport {initializerClassNames, InitializerSerialization} from './initializer_config';\nimport {layerClassNames, LayerSerialization} from './layers/layer_serialization';\nimport {optimizerClassNames, OptimizerSerialization} from './optimizer_config';\nimport {regularizerClassNames, RegularizerSerialization} from './regularizer_config';\n\n/**\n * A type representing all possible Serializations of Keras objects, including\n * Layers, Constraints, Optimizers, etc.\n */\nexport type KerasSerialization = LayerSerialization|ConstraintSerialization|\n InitializerSerialization|RegularizerSerialization|OptimizerSerialization;\n\n/**\n * A type representing all valid values of `class_name` in a Keras JSON file\n * (regardless of context, which will naturally further restrict the valid\n * values).\n */\nexport type KerasClassName = KerasSerialization['class_name'];\n\nexport const kerasClassNames: KerasClassName[] = [\n ...layerClassNames, ...constraintClassNames, ...initializerClassNames,\n ...regularizerClassNames, ...optimizerClassNames\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-layers/dist/keras_format/layers/advanced_activation_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.d.ts deleted file mode 100644 index 572e9de46..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface ReLULayerConfig extends LayerConfig { - max_value?: number; -} -export declare type ReLULayerSerialization = BaseLayerSerialization<'ReLU', ReLULayerConfig>; -export interface LeakyReLULayerConfig extends LayerConfig { - alpha?: number; -} -export declare type LeakyReLULayerSerialization = BaseLayerSerialization<'LeakyReLU', LeakyReLULayerConfig>; -export interface PReLULayerConfig extends LayerConfig { - alpha_initializer?: InitializerSerialization; - alpha_regularizer?: RegularizerSerialization; - alpha_constraint?: ConstraintSerialization; - shared_axes?: number | number[]; -} -export declare type PReLULayerSerialization = BaseLayerSerialization<'PReLU', PReLULayerConfig>; -export interface ELULayerConfig extends LayerConfig { - alpha?: number; -} -export declare type ELULayerSerialization = BaseLayerSerialization<'ELU', ELULayerConfig>; -export interface ThresholdedReLULayerConfig extends LayerConfig { - theta?: number; -} -export declare type ThresholdedReLULayerSerialization = BaseLayerSerialization<'ThresholdedReLU', ThresholdedReLULayerConfig>; -export interface SoftmaxLayerConfig extends LayerConfig { - axis?: number; -} -export declare type SoftmaxLayerSerialization = BaseLayerSerialization<'Softmax', SoftmaxLayerConfig>; -export declare type AdvancedActivationLayerSerialization = ReLULayerSerialization | LeakyReLULayerSerialization | PReLULayerSerialization | ELULayerSerialization | ThresholdedReLULayerSerialization | SoftmaxLayerSerialization; -export declare type AdvancedActivationLayerClassName = AdvancedActivationLayerSerialization['class_name']; -/** - * A string array of valid AdvancedActivationLayer class names. - * - * This is guaranteed to match the `AdvancedActivationLayerClassName` union - * type. - */ -export declare const advancedActivationLayerClassNames: AdvancedActivationLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js deleted file mode 100644 index 48e9074f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid AdvancedActivationLayer class names. - * - * This is guaranteed to match the `AdvancedActivationLayerClassName` union - * type. - */ -export const advancedActivationLayerClassNames = [ - 'ReLU', - 'LeakyReLU', - 'PReLU', - 'ELU', - 'ThresholdedReLU', - 'Softmax', -]; -//# sourceMappingURL=advanced_activation_serialization.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-layers/dist/keras_format/layers/advanced_activation_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js.map deleted file mode 100644 index dd79b2ba8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/advanced_activation_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"advanced_activation_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/advanced_activation_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4DH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAAiC,GACL;IACnC,MAAM;IACN,WAAW;IACX,OAAO;IACP,KAAK;IACL,iBAAiB;IACjB,SAAS;CACV,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface ReLULayerConfig extends LayerConfig {\n max_value?: number;\n}\n\nexport type ReLULayerSerialization =\n BaseLayerSerialization<'ReLU', ReLULayerConfig>;\n\nexport interface LeakyReLULayerConfig extends LayerConfig {\n alpha?: number;\n}\n\nexport type LeakyReLULayerSerialization =\n BaseLayerSerialization<'LeakyReLU', LeakyReLULayerConfig>;\n\nexport interface PReLULayerConfig extends LayerConfig {\n alpha_initializer?: InitializerSerialization;\n alpha_regularizer?: RegularizerSerialization;\n alpha_constraint?: ConstraintSerialization;\n shared_axes?: number|number[];\n}\n\nexport type PReLULayerSerialization =\n BaseLayerSerialization<'PReLU', PReLULayerConfig>;\n\nexport interface ELULayerConfig extends LayerConfig {\n alpha?: number;\n}\n\nexport type ELULayerSerialization =\n BaseLayerSerialization<'ELU', ELULayerConfig>;\n\nexport interface ThresholdedReLULayerConfig extends LayerConfig {\n theta?: number;\n}\n\nexport type ThresholdedReLULayerSerialization =\n BaseLayerSerialization<'ThresholdedReLU', ThresholdedReLULayerConfig>;\n\nexport interface SoftmaxLayerConfig extends LayerConfig {\n axis?: number;\n}\n\nexport type SoftmaxLayerSerialization =\n BaseLayerSerialization<'Softmax', SoftmaxLayerConfig>;\n\n// Update advancedActivationLayerClassNames below in concert with this.\nexport type AdvancedActivationLayerSerialization = ReLULayerSerialization|\n LeakyReLULayerSerialization|PReLULayerSerialization|ELULayerSerialization|\n ThresholdedReLULayerSerialization|SoftmaxLayerSerialization;\n\nexport type AdvancedActivationLayerClassName =\n AdvancedActivationLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid AdvancedActivationLayer class names.\n *\n * This is guaranteed to match the `AdvancedActivationLayerClassName` union\n * type.\n */\nexport const advancedActivationLayerClassNames:\n AdvancedActivationLayerClassName[] = [\n 'ReLU',\n 'LeakyReLU',\n 'PReLU',\n 'ELU',\n 'ThresholdedReLU',\n 'Softmax',\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-layers/dist/keras_format/layers/convolutional_depthwise_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.d.ts deleted file mode 100644 index 1eccb480a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization } from '../topology_config'; -import { BaseConvLayerConfig } from './convolutional_serialization'; -export interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig { - kernel_size: number | [number, number]; - depth_multiplier?: number; - depthwise_initializer?: InitializerSerialization; - depthwise_constraint?: ConstraintSerialization; - depthwise_regularizer?: RegularizerSerialization; -} -export declare type DepthwiseConv2DLayerSerialization = BaseLayerSerialization<'DepthwiseConv2D', DepthwiseConv2DLayerConfig>; -export declare type ConvolutionalDepthwiseLayerSerialization = DepthwiseConv2DLayerSerialization; -export declare type ConvolutionalDepthwiseLayerClassName = ConvolutionalDepthwiseLayerSerialization['class_name']; -/** - * A string array of valid ConvolutionalDepthwiseLayer class names. - * - * This is guaranteed to match the `ConvolutionalDepthwiseLayerClassName` union - * type. - */ -export declare const convolutionalDepthwiseLayerClassNames: ConvolutionalDepthwiseLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js deleted file mode 100644 index ad18b5fbb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid ConvolutionalDepthwiseLayer class names. - * - * This is guaranteed to match the `ConvolutionalDepthwiseLayerClassName` union - * type. - */ -export const convolutionalDepthwiseLayerClassNames = [ - 'DepthwiseConv2D', -]; -//# sourceMappingURL=convolutional_depthwise_serialization.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-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js.map deleted file mode 100644 index f02de0774..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_depthwise_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_depthwise_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/convolutional_depthwise_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0BH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qCAAqC,GACL;IACvC,iBAAiB;CAClB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization} from '../topology_config';\nimport {BaseConvLayerConfig} from './convolutional_serialization';\n\nexport interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig {\n kernel_size: number|[number, number];\n depth_multiplier?: number;\n depthwise_initializer?: InitializerSerialization;\n depthwise_constraint?: ConstraintSerialization;\n depthwise_regularizer?: RegularizerSerialization;\n}\n\n// Update depthwiseConv2DLayerClassNames below in concert with this.\nexport type DepthwiseConv2DLayerSerialization =\n BaseLayerSerialization<'DepthwiseConv2D', DepthwiseConv2DLayerConfig>;\n\nexport type ConvolutionalDepthwiseLayerSerialization =\n DepthwiseConv2DLayerSerialization;\n\nexport type ConvolutionalDepthwiseLayerClassName =\n ConvolutionalDepthwiseLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid ConvolutionalDepthwiseLayer class names.\n *\n * This is guaranteed to match the `ConvolutionalDepthwiseLayerClassName` union\n * type.\n */\nexport const convolutionalDepthwiseLayerClassNames:\n ConvolutionalDepthwiseLayerClassName[] = [\n 'DepthwiseConv2D',\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-layers/dist/keras_format/layers/convolutional_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.d.ts deleted file mode 100644 index e4ccd2078..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataFormatSerialization, PaddingMode } from '../common'; -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface BaseConvLayerConfig extends LayerConfig { - kernel_size: number | number[]; - strides?: number | number[]; - padding?: PaddingMode; - data_format?: DataFormatSerialization; - dilation_rate?: number | [number] | [number, number]; - activation?: string; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - kernel_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; -} -export interface ConvLayerConfig extends BaseConvLayerConfig { - filters: number; -} -export declare type Conv1DLayerSerialization = BaseLayerSerialization<'Conv1D', ConvLayerConfig>; -export declare type Conv2DLayerSerialization = BaseLayerSerialization<'Conv2D', ConvLayerConfig>; -export declare type Conv2DTransposeLayerSerialization = BaseLayerSerialization<'Conv2DTranspose', ConvLayerConfig>; -export interface SeparableConvLayerConfig extends ConvLayerConfig { - depth_multiplier?: number; - depthwise_initializer?: InitializerSerialization; - pointwise_initializer?: InitializerSerialization; - depthwise_regularizer?: RegularizerSerialization; - pointwise_regularizer?: RegularizerSerialization; - depthwise_constraint?: ConstraintSerialization; - pointwise_constraint?: ConstraintSerialization; -} -export declare type SeparableConv2DLayerSerialization = BaseLayerSerialization<'SeparableConv2D', ConvLayerConfig>; -export interface Cropping2DLayerConfig extends LayerConfig { - cropping: number | [number, number] | [[number, number], [number, number]]; - data_format?: DataFormatSerialization; -} -export declare type Cropping2DLayerSerialization = BaseLayerSerialization<'Cropping2D', Cropping2DLayerConfig>; -export interface UpSampling2DLayerConfig extends LayerConfig { - size?: number[]; - data_format?: DataFormatSerialization; -} -export declare type UpSampling2DLayerSerialization = BaseLayerSerialization<'UpSampling2D', UpSampling2DLayerConfig>; -export declare type ConvolutionalLayerSerialization = Conv1DLayerSerialization | Conv2DLayerSerialization | Conv2DTransposeLayerSerialization | SeparableConv2DLayerSerialization | Cropping2DLayerSerialization | UpSampling2DLayerSerialization; -export declare type ConvolutionalLayerClassName = ConvolutionalLayerSerialization['class_name']; -/** - * A string array of valid ConvolutionalLayer class names. - * - * This is guaranteed to match the `ConvolutionalLayerClassName` union type. - */ -export declare const convolutionalLayerClassNames: ConvolutionalLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js deleted file mode 100644 index 4cafb72e1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid ConvolutionalLayer class names. - * - * This is guaranteed to match the `ConvolutionalLayerClassName` union type. - */ -export const convolutionalLayerClassNames = [ - 'Conv1D', - 'Conv2D', - 'Conv2DTranspose', - 'Cropping2D', - 'SeparableConv2D', - 'UpSampling2D', -]; -//# sourceMappingURL=convolutional_serialization.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-layers/dist/keras_format/layers/convolutional_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js.map deleted file mode 100644 index de966776b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/convolutional_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/convolutional_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4EH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkC;IACzE,QAAQ;IACR,QAAQ;IACR,iBAAiB;IACjB,YAAY;IACZ,iBAAiB;IACjB,cAAc;CACf,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataFormatSerialization, PaddingMode} from '../common';\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface BaseConvLayerConfig extends LayerConfig {\n kernel_size: number|number[];\n strides?: number|number[];\n padding?: PaddingMode;\n data_format?: DataFormatSerialization;\n dilation_rate?: number|[number]|[number, number];\n activation?: string;\n use_bias?: boolean;\n kernel_initializer?: InitializerSerialization;\n bias_initializer?: InitializerSerialization;\n kernel_constraint?: ConstraintSerialization;\n bias_constraint?: ConstraintSerialization;\n kernel_regularizer?: RegularizerSerialization;\n bias_regularizer?: RegularizerSerialization;\n activity_regularizer?: RegularizerSerialization;\n}\n\nexport interface ConvLayerConfig extends BaseConvLayerConfig {\n filters: number;\n}\n\nexport type Conv1DLayerSerialization =\n BaseLayerSerialization<'Conv1D', ConvLayerConfig>;\n\nexport type Conv2DLayerSerialization =\n BaseLayerSerialization<'Conv2D', ConvLayerConfig>;\n\nexport type Conv2DTransposeLayerSerialization =\n BaseLayerSerialization<'Conv2DTranspose', ConvLayerConfig>;\n\nexport interface SeparableConvLayerConfig extends ConvLayerConfig {\n depth_multiplier?: number;\n depthwise_initializer?: InitializerSerialization;\n pointwise_initializer?: InitializerSerialization;\n depthwise_regularizer?: RegularizerSerialization;\n pointwise_regularizer?: RegularizerSerialization;\n depthwise_constraint?: ConstraintSerialization;\n pointwise_constraint?: ConstraintSerialization;\n}\n\nexport type SeparableConv2DLayerSerialization =\n BaseLayerSerialization<'SeparableConv2D', ConvLayerConfig>;\n\nexport interface Cropping2DLayerConfig extends LayerConfig {\n cropping: number|[number, number]|[[number, number], [number, number]];\n data_format?: DataFormatSerialization;\n}\n\nexport type Cropping2DLayerSerialization =\n BaseLayerSerialization<'Cropping2D', Cropping2DLayerConfig>;\n\nexport interface UpSampling2DLayerConfig extends LayerConfig {\n size?: number[];\n data_format?: DataFormatSerialization;\n}\n\nexport type UpSampling2DLayerSerialization =\n BaseLayerSerialization<'UpSampling2D', UpSampling2DLayerConfig>;\n\n// Update convolutionalLayerClassNames below in concert with this.\nexport type ConvolutionalLayerSerialization =\n Conv1DLayerSerialization|Conv2DLayerSerialization|\n Conv2DTransposeLayerSerialization|SeparableConv2DLayerSerialization|\n Cropping2DLayerSerialization|UpSampling2DLayerSerialization;\n\nexport type ConvolutionalLayerClassName =\n ConvolutionalLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid ConvolutionalLayer class names.\n *\n * This is guaranteed to match the `ConvolutionalLayerClassName` union type.\n */\nexport const convolutionalLayerClassNames: ConvolutionalLayerClassName[] = [\n 'Conv1D',\n 'Conv2D',\n 'Conv2DTranspose',\n 'Cropping2D',\n 'SeparableConv2D',\n 'UpSampling2D',\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-layers/dist/keras_format/layers/core_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.d.ts deleted file mode 100644 index 031024267..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ActivationSerialization } from '../activation_config'; -import { Shape } from '../common'; -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface DropoutLayerConfig extends LayerConfig { - rate: number; - noise_shape?: number[]; - seed?: number; -} -export declare type DropoutLayerSerialization = BaseLayerSerialization<'Dropout', DropoutLayerConfig>; -export interface DenseLayerConfig extends LayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - input_dim?: number; - kernel_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - kernel_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; -} -export declare type DenseLayerSerialization = BaseLayerSerialization<'Dense', DenseLayerConfig>; -export declare type FlattenLayerSerialization = BaseLayerSerialization<'Flatten', LayerConfig>; -export interface ActivationLayerConfig extends LayerConfig { - activation: ActivationSerialization; -} -export declare type ActivationLayerSerialization = BaseLayerSerialization<'Activation', ActivationLayerConfig>; -export interface RepeatVectorLayerConfig extends LayerConfig { - n: number; -} -export declare type RepeatVectorLayerSerialization = BaseLayerSerialization<'RepeatVector', RepeatVectorLayerConfig>; -export interface ReshapeLayerConfig extends LayerConfig { - target_shape: Shape; -} -export declare type ReshapeLayerSerialization = BaseLayerSerialization<'Reshape', ReshapeLayerConfig>; -export interface PermuteLayerConfig extends LayerConfig { - dims: number[]; -} -export declare type PermuteLayerSerialization = BaseLayerSerialization<'Permute', PermuteLayerConfig>; -export interface MaskingLayerConfig extends LayerConfig { - maskValue: number; -} -export declare type MaskingLayerSerialization = BaseLayerSerialization<'Masking', MaskingLayerConfig>; -export declare type CoreLayerSerialization = DropoutLayerSerialization | DenseLayerSerialization | FlattenLayerSerialization | ActivationLayerSerialization | RepeatVectorLayerSerialization | ReshapeLayerSerialization | PermuteLayerSerialization | MaskingLayerSerialization; -export declare type CoreLayerClassName = CoreLayerSerialization['class_name']; -/** - * A string array of valid CoreLayer class names. - * - * This is guaranteed to match the `CoreLayerClassName` union type. - */ -export declare const coreLayerClassNames: CoreLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js deleted file mode 100644 index 433204ebb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid CoreLayer class names. - * - * This is guaranteed to match the `CoreLayerClassName` union type. - */ -export const coreLayerClassNames = [ - 'Activation', - 'Dense', - 'Dropout', - 'Flatten', - 'Permute', - 'RepeatVector', - 'Reshape', -]; -//# sourceMappingURL=core_serialization.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-layers/dist/keras_format/layers/core_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js.map deleted file mode 100644 index ed48fe2c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/core_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/core_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkFH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,YAAY;IACZ,OAAO;IACP,SAAS;IACT,SAAS;IACT,SAAS;IACT,cAAc;IACd,SAAS;CACV,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ActivationSerialization} from '../activation_config';\nimport {Shape} from '../common';\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface DropoutLayerConfig extends LayerConfig {\n rate: number;\n noise_shape?: number[];\n seed?: number;\n}\n\nexport type DropoutLayerSerialization =\n BaseLayerSerialization<'Dropout', DropoutLayerConfig>;\n\nexport interface DenseLayerConfig extends LayerConfig {\n units: number;\n activation?: ActivationSerialization;\n use_bias?: boolean;\n input_dim?: number;\n kernel_initializer?: InitializerSerialization;\n bias_initializer?: InitializerSerialization;\n kernel_constraint?: ConstraintSerialization;\n bias_constraint?: ConstraintSerialization;\n kernel_regularizer?: RegularizerSerialization;\n bias_regularizer?: RegularizerSerialization;\n activity_regularizer?: RegularizerSerialization;\n}\n\nexport type DenseLayerSerialization =\n BaseLayerSerialization<'Dense', DenseLayerConfig>;\n\nexport type FlattenLayerSerialization =\n BaseLayerSerialization<'Flatten', LayerConfig>;\n\nexport interface ActivationLayerConfig extends LayerConfig {\n activation: ActivationSerialization;\n}\n\nexport type ActivationLayerSerialization =\n BaseLayerSerialization<'Activation', ActivationLayerConfig>;\n\nexport interface RepeatVectorLayerConfig extends LayerConfig {\n n: number;\n}\n\nexport type RepeatVectorLayerSerialization =\n BaseLayerSerialization<'RepeatVector', RepeatVectorLayerConfig>;\n\nexport interface ReshapeLayerConfig extends LayerConfig {\n target_shape: Shape;\n}\n\nexport type ReshapeLayerSerialization =\n BaseLayerSerialization<'Reshape', ReshapeLayerConfig>;\n\nexport interface PermuteLayerConfig extends LayerConfig {\n dims: number[];\n}\n\nexport type PermuteLayerSerialization =\n BaseLayerSerialization<'Permute', PermuteLayerConfig>;\n\nexport interface MaskingLayerConfig extends LayerConfig {\n maskValue: number;\n}\n\nexport type MaskingLayerSerialization =\n BaseLayerSerialization<'Masking', MaskingLayerConfig>;\n\n// Update coreLayerClassNames below in concert with this.\nexport type CoreLayerSerialization =\n DropoutLayerSerialization|DenseLayerSerialization|FlattenLayerSerialization|\n ActivationLayerSerialization|RepeatVectorLayerSerialization|\n ReshapeLayerSerialization|PermuteLayerSerialization|\n MaskingLayerSerialization;\n\nexport type CoreLayerClassName = CoreLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid CoreLayer class names.\n *\n * This is guaranteed to match the `CoreLayerClassName` union type.\n */\nexport const coreLayerClassNames: CoreLayerClassName[] = [\n 'Activation',\n 'Dense',\n 'Dropout',\n 'Flatten',\n 'Permute',\n 'RepeatVector',\n 'Reshape',\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-layers/dist/keras_format/layers/embeddings_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.d.ts deleted file mode 100644 index c175be393..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface EmbeddingLayerConfig extends LayerConfig { - input_dim: number; - output_dim: number; - embeddings_initializer?: InitializerSerialization; - embeddings_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; - embeddings_constraint?: ConstraintSerialization; - mask_zero?: boolean; - input_length?: number | number[]; -} -export declare type EmbeddingLayerSerialization = BaseLayerSerialization<'Embedding', EmbeddingLayerConfig>; -export declare type EmbeddingLayerClassName = EmbeddingLayerSerialization['class_name']; -/** - * A string array of valid EmbeddingLayer class names. - * - * This is guaranteed to match the `EmbeddingLayerClassName` union type. - */ -export declare const embeddingLayerClassNames: EmbeddingLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js deleted file mode 100644 index 02bd0ea26..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid EmbeddingLayer class names. - * - * This is guaranteed to match the `EmbeddingLayerClassName` union type. - */ -export const embeddingLayerClassNames = [ - 'Embedding', -]; -//# sourceMappingURL=embeddings_serialization.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-layers/dist/keras_format/layers/embeddings_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js.map deleted file mode 100644 index aaa4de2ce..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/embeddings_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"embeddings_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/embeddings_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwBH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,WAAW;CACZ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface EmbeddingLayerConfig extends LayerConfig {\n input_dim: number;\n output_dim: number;\n embeddings_initializer?: InitializerSerialization;\n embeddings_regularizer?: RegularizerSerialization;\n activity_regularizer?: RegularizerSerialization;\n embeddings_constraint?: ConstraintSerialization;\n mask_zero?: boolean;\n input_length?: number|number[];\n}\n\n// Update embeddingLayerClassNames below in concert with this.\nexport type EmbeddingLayerSerialization =\n BaseLayerSerialization<'Embedding', EmbeddingLayerConfig>;\n\nexport type EmbeddingLayerClassName = EmbeddingLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid EmbeddingLayer class names.\n *\n * This is guaranteed to match the `EmbeddingLayerClassName` union type.\n */\nexport const embeddingLayerClassNames: EmbeddingLayerClassName[] = [\n 'Embedding',\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-layers/dist/keras_format/layers/layer_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.d.ts deleted file mode 100644 index 224042179..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { InputLayerSerialization } from '../input_config'; -import { AdvancedActivationLayerSerialization } from './advanced_activation_serialization'; -import { ConvolutionalDepthwiseLayerSerialization } from './convolutional_depthwise_serialization'; -import { ConvolutionalLayerSerialization } from './convolutional_serialization'; -import { CoreLayerSerialization } from './core_serialization'; -import { EmbeddingLayerSerialization } from './embeddings_serialization'; -import { MergeLayerSerialization } from './merge_serialization'; -import { NormalizationLayerSerialization } from './normalization_serialization'; -import { PaddingLayerSerialization } from './padding_serialization'; -import { PoolingLayerSerialization } from './pooling_serialization'; -import { RecurrentLayerSerialization } from './recurrent_serialization'; -export declare type LayerSerialization = AdvancedActivationLayerSerialization | ConvolutionalDepthwiseLayerSerialization | ConvolutionalLayerSerialization | CoreLayerSerialization | EmbeddingLayerSerialization | MergeLayerSerialization | NormalizationLayerSerialization | PaddingLayerSerialization | PoolingLayerSerialization | RecurrentLayerSerialization | InputLayerSerialization; -export declare type LayerClassName = LayerSerialization['class_name']; -/** - * A string array of valid Layer class names. - * - * This is guaranteed to match the `LayerClassName` union type. - */ -export declare const layerClassNames: LayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js deleted file mode 100644 index 985f911ce..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { inputLayerClassNames } from '../input_config'; -import { advancedActivationLayerClassNames } from './advanced_activation_serialization'; -import { convolutionalDepthwiseLayerClassNames } from './convolutional_depthwise_serialization'; -import { convolutionalLayerClassNames } from './convolutional_serialization'; -import { coreLayerClassNames } from './core_serialization'; -import { embeddingLayerClassNames } from './embeddings_serialization'; -import { mergeLayerClassNames } from './merge_serialization'; -import { normalizationLayerClassNames } from './normalization_serialization'; -import { paddingLayerClassNames } from './padding_serialization'; -import { poolingLayerClassNames } from './pooling_serialization'; -import { recurrentLayerClassNames } from './recurrent_serialization'; -/** - * A string array of valid Layer class names. - * - * This is guaranteed to match the `LayerClassName` union type. - */ -export const layerClassNames = [ - ...advancedActivationLayerClassNames, - ...convolutionalDepthwiseLayerClassNames, ...convolutionalLayerClassNames, - ...coreLayerClassNames, ...embeddingLayerClassNames, ...mergeLayerClassNames, - ...normalizationLayerClassNames, ...paddingLayerClassNames, - ...poolingLayerClassNames, ...recurrentLayerClassNames, - ...inputLayerClassNames -]; -//# sourceMappingURL=layer_serialization.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-layers/dist/keras_format/layers/layer_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js.map deleted file mode 100644 index 5e2641a59..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/layer_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"layer_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/layer_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,oBAAoB,EAA0B,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAC,iCAAiC,EAAuC,MAAM,qCAAqC,CAAC;AAC5H,OAAO,EAAC,qCAAqC,EAA2C,MAAM,yCAAyC,CAAC;AACxI,OAAO,EAAC,4BAA4B,EAAkC,MAAM,+BAA+B,CAAC;AAC5G,OAAO,EAAC,mBAAmB,EAAyB,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAC,wBAAwB,EAA8B,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAC,oBAAoB,EAA0B,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAC,4BAA4B,EAAkC,MAAM,+BAA+B,CAAC;AAC5G,OAAO,EAAC,sBAAsB,EAA4B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAC,sBAAsB,EAA4B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAC,wBAAwB,EAA8B,MAAM,2BAA2B,CAAC;AAWhG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,GAAG,iCAAiC;IACpC,GAAG,qCAAqC,EAAE,GAAG,4BAA4B;IACzE,GAAG,mBAAmB,EAAE,GAAG,wBAAwB,EAAE,GAAG,oBAAoB;IAC5E,GAAG,4BAA4B,EAAE,GAAG,sBAAsB;IAC1D,GAAG,sBAAsB,EAAE,GAAG,wBAAwB;IACtD,GAAG,oBAAoB;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {inputLayerClassNames, InputLayerSerialization} from '../input_config';\nimport {advancedActivationLayerClassNames, AdvancedActivationLayerSerialization} from './advanced_activation_serialization';\nimport {convolutionalDepthwiseLayerClassNames, ConvolutionalDepthwiseLayerSerialization} from './convolutional_depthwise_serialization';\nimport {convolutionalLayerClassNames, ConvolutionalLayerSerialization} from './convolutional_serialization';\nimport {coreLayerClassNames, CoreLayerSerialization} from './core_serialization';\nimport {embeddingLayerClassNames, EmbeddingLayerSerialization} from './embeddings_serialization';\nimport {mergeLayerClassNames, MergeLayerSerialization} from './merge_serialization';\nimport {normalizationLayerClassNames, NormalizationLayerSerialization} from './normalization_serialization';\nimport {paddingLayerClassNames, PaddingLayerSerialization} from './padding_serialization';\nimport {poolingLayerClassNames, PoolingLayerSerialization} from './pooling_serialization';\nimport {recurrentLayerClassNames, RecurrentLayerSerialization} from './recurrent_serialization';\n\nexport type LayerSerialization = AdvancedActivationLayerSerialization|\n ConvolutionalDepthwiseLayerSerialization|ConvolutionalLayerSerialization|\n CoreLayerSerialization|EmbeddingLayerSerialization|MergeLayerSerialization|\n NormalizationLayerSerialization|PaddingLayerSerialization|\n PoolingLayerSerialization|RecurrentLayerSerialization|\n InputLayerSerialization;\n\nexport type LayerClassName = LayerSerialization['class_name'];\n\n/**\n * A string array of valid Layer class names.\n *\n * This is guaranteed to match the `LayerClassName` union type.\n */\nexport const layerClassNames: LayerClassName[] = [\n ...advancedActivationLayerClassNames,\n ...convolutionalDepthwiseLayerClassNames, ...convolutionalLayerClassNames,\n ...coreLayerClassNames, ...embeddingLayerClassNames, ...mergeLayerClassNames,\n ...normalizationLayerClassNames, ...paddingLayerClassNames,\n ...poolingLayerClassNames, ...recurrentLayerClassNames,\n ...inputLayerClassNames\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-layers/dist/keras_format/layers/merge_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.d.ts deleted file mode 100644 index 82684bf40..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export declare type AddLayerSerialization = BaseLayerSerialization<'Add', LayerConfig>; -export declare type MultiplyLayerSerialization = BaseLayerSerialization<'Multiply', LayerConfig>; -export declare type AverageLayerSerialization = BaseLayerSerialization<'Average', LayerConfig>; -export declare type MaximumLayerSerialization = BaseLayerSerialization<'Maximum', LayerConfig>; -export declare type MinimumLayerSerialization = BaseLayerSerialization<'Minimum', LayerConfig>; -export interface ConcatenateLayerConfig extends LayerConfig { - axis?: number; -} -export declare type ConcatenateLayerSerialization = BaseLayerSerialization<'Concatenate', ConcatenateLayerConfig>; -export interface DotLayerConfig extends LayerConfig { - axes: number | [number, number]; - normalize?: boolean; -} -export declare type DotLayerSerialization = BaseLayerSerialization<'Dot', DotLayerConfig>; -export declare type MergeLayerSerialization = AddLayerSerialization | MultiplyLayerSerialization | AverageLayerSerialization | MaximumLayerSerialization | MinimumLayerSerialization | ConcatenateLayerSerialization | DotLayerSerialization; -export declare type MergeLayerClassName = MergeLayerSerialization['class_name']; -/** - * A string array of valid MergeLayer class names. - * - * This is guaranteed to match the `MergeLayerClassName` union type. - */ -export declare const mergeLayerClassNames: MergeLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js deleted file mode 100644 index 361384b39..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid MergeLayer class names. - * - * This is guaranteed to match the `MergeLayerClassName` union type. - */ -export const mergeLayerClassNames = [ - 'Add', - 'Average', - 'Concatenate', - 'Dot', - 'Maximum', - 'Minimum', - 'Multiply', -]; -//# sourceMappingURL=merge_serialization.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-layers/dist/keras_format/layers/merge_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js.map deleted file mode 100644 index 9e07dda40..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/merge_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"merge_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/merge_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyCH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA0B;IACzD,KAAK;IACL,SAAS;IACT,aAAa;IACb,KAAK;IACL,SAAS;IACT,SAAS;IACT,UAAU;CACX,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport type AddLayerSerialization = BaseLayerSerialization<'Add', LayerConfig>;\n\nexport type MultiplyLayerSerialization =\n BaseLayerSerialization<'Multiply', LayerConfig>;\n\nexport type AverageLayerSerialization =\n BaseLayerSerialization<'Average', LayerConfig>;\n\nexport type MaximumLayerSerialization =\n BaseLayerSerialization<'Maximum', LayerConfig>;\n\nexport type MinimumLayerSerialization =\n BaseLayerSerialization<'Minimum', LayerConfig>;\n\nexport interface ConcatenateLayerConfig extends LayerConfig {\n axis?: number;\n}\n\nexport type ConcatenateLayerSerialization =\n BaseLayerSerialization<'Concatenate', ConcatenateLayerConfig>;\n\nexport interface DotLayerConfig extends LayerConfig {\n axes: number|[number, number];\n normalize?: boolean;\n}\n\nexport type DotLayerSerialization =\n BaseLayerSerialization<'Dot', DotLayerConfig>;\n\n// Update mergeLayerClassNames below in concert with this.\nexport type MergeLayerSerialization =\n AddLayerSerialization|MultiplyLayerSerialization|AverageLayerSerialization|\n MaximumLayerSerialization|MinimumLayerSerialization|\n ConcatenateLayerSerialization|DotLayerSerialization;\n\nexport type MergeLayerClassName = MergeLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid MergeLayer class names.\n *\n * This is guaranteed to match the `MergeLayerClassName` union type.\n */\nexport const mergeLayerClassNames: MergeLayerClassName[] = [\n 'Add',\n 'Average',\n 'Concatenate',\n 'Dot',\n 'Maximum',\n 'Minimum',\n 'Multiply',\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-layers/dist/keras_format/layers/normalization_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.d.ts deleted file mode 100644 index 845d388aa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface BatchNormalizationLayerConfig extends LayerConfig { - axis?: number; - momentum?: number; - epsilon?: number; - center?: boolean; - scale?: boolean; - beta_initializer?: InitializerSerialization; - gamma_initializer?: InitializerSerialization; - moving_mean_initializer?: InitializerSerialization; - moving_variance_initializer?: InitializerSerialization; - beta_constraint?: ConstraintSerialization; - gamma_constraint?: ConstraintSerialization; - beta_regularizer?: RegularizerSerialization; - gamma_regularizer?: RegularizerSerialization; -} -export declare type BatchNormalizationLayerSerialization = BaseLayerSerialization<'BatchNormalization', BatchNormalizationLayerConfig>; -export declare type NormalizationLayerSerialization = BatchNormalizationLayerSerialization; -export declare type NormalizationLayerClassName = NormalizationLayerSerialization['class_name']; -/** - * A string array of valid NormalizationLayer class names. - * - * This is guaranteed to match the `NormalizationLayerClassName` union - * type. - */ -export declare const normalizationLayerClassNames: NormalizationLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js deleted file mode 100644 index 49ff795df..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid NormalizationLayer class names. - * - * This is guaranteed to match the `NormalizationLayerClassName` union - * type. - */ -export const normalizationLayerClassNames = [ - 'BatchNormalization', -]; -//# sourceMappingURL=normalization_serialization.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-layers/dist/keras_format/layers/normalization_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js.map deleted file mode 100644 index 6c3c55251..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/normalization_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"normalization_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/normalization_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiCH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkC;IACzE,oBAAoB;CACrB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface BatchNormalizationLayerConfig extends LayerConfig {\n axis?: number;\n momentum?: number;\n epsilon?: number;\n center?: boolean;\n scale?: boolean;\n beta_initializer?: InitializerSerialization;\n gamma_initializer?: InitializerSerialization;\n moving_mean_initializer?: InitializerSerialization;\n moving_variance_initializer?: InitializerSerialization;\n beta_constraint?: ConstraintSerialization;\n gamma_constraint?: ConstraintSerialization;\n beta_regularizer?: RegularizerSerialization;\n gamma_regularizer?: RegularizerSerialization;\n}\n\n// Update batchNormalizationLayerClassNames below in concert with this.\nexport type BatchNormalizationLayerSerialization =\n BaseLayerSerialization<'BatchNormalization', BatchNormalizationLayerConfig>;\n\nexport type NormalizationLayerSerialization =\n BatchNormalizationLayerSerialization;\n\nexport type NormalizationLayerClassName =\n NormalizationLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid NormalizationLayer class names.\n *\n * This is guaranteed to match the `NormalizationLayerClassName` union\n * type.\n */\nexport const normalizationLayerClassNames: NormalizationLayerClassName[] = [\n 'BatchNormalization',\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-layers/dist/keras_format/layers/padding_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.d.ts deleted file mode 100644 index 69673cccd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataFormatSerialization } from '../common'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface ZeroPadding2DLayerConfig extends LayerConfig { - padding?: number | [number, number] | [[number, number], [number, number]]; - data_format?: DataFormatSerialization; -} -export declare type ZeroPadding2DLayerSerialization = BaseLayerSerialization<'ZeroPadding2D', ZeroPadding2DLayerConfig>; -export declare type PaddingLayerSerialization = ZeroPadding2DLayerSerialization; -export declare type PaddingLayerClassName = PaddingLayerSerialization['class_name']; -/** - * A string array of valid PaddingLayer class names. - * - * This is guaranteed to match the `PaddingLayerClassName` union type. - */ -export declare const paddingLayerClassNames: PaddingLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js deleted file mode 100644 index d36112fe9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid PaddingLayer class names. - * - * This is guaranteed to match the `PaddingLayerClassName` union type. - */ -export const paddingLayerClassNames = [ - 'ZeroPadding2D', -]; -//# sourceMappingURL=padding_serialization.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-layers/dist/keras_format/layers/padding_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js.map deleted file mode 100644 index db59a2cb7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/padding_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/padding_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,eAAe;CAChB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataFormatSerialization} from '../common';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface ZeroPadding2DLayerConfig extends LayerConfig {\n padding?: number|[number, number]|[[number, number], [number, number]];\n data_format?: DataFormatSerialization;\n}\n\n// Update paddingLayerClassNames below in concert with this.\nexport type ZeroPadding2DLayerSerialization =\n BaseLayerSerialization<'ZeroPadding2D', ZeroPadding2DLayerConfig>;\n\nexport type PaddingLayerSerialization = ZeroPadding2DLayerSerialization;\n\nexport type PaddingLayerClassName = PaddingLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid PaddingLayer class names.\n *\n * This is guaranteed to match the `PaddingLayerClassName` union type.\n */\nexport const paddingLayerClassNames: PaddingLayerClassName[] = [\n 'ZeroPadding2D',\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-layers/dist/keras_format/layers/pooling_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.d.ts deleted file mode 100644 index 4dfe8ce52..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataFormatSerialization, PaddingMode } from '../common'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -export interface Pooling1DLayerConfig extends LayerConfig { - pool_size?: [number]; - strides?: [number]; - padding?: PaddingMode; -} -export declare type MaxPooling1DLayerSerialization = BaseLayerSerialization<'MaxPooling1D', Pooling1DLayerConfig>; -export declare type AveragePooling1DLayerSerialization = BaseLayerSerialization<'AveragePooling1D', Pooling1DLayerConfig>; -export interface Pooling2DLayerConfig extends LayerConfig { - pool_size?: number | [number, number]; - strides?: number | [number, number]; - padding?: PaddingMode; - data_format?: DataFormatSerialization; -} -export declare type MaxPooling2DLayerSerialization = BaseLayerSerialization<'MaxPooling2D', Pooling2DLayerConfig>; -export declare type AveragePooling2DLayerSerialization = BaseLayerSerialization<'AveragePooling2D', Pooling2DLayerConfig>; -export declare type GlobalAveragePooling1DLayerSerialization = BaseLayerSerialization<'GlobalAveragePooling1D', LayerConfig>; -export declare type GlobalMaxPooling1DLayerSerialization = BaseLayerSerialization<'GlobalMaxPooling1D', LayerConfig>; -export interface GlobalPooling2DLayerConfig extends LayerConfig { - data_format?: DataFormatSerialization; -} -export declare type GlobalAveragePooling2DLayerSerialization = BaseLayerSerialization<'GlobalAveragePooling2D', GlobalPooling2DLayerConfig>; -export declare type GlobalMaxPooling2DLayerSerialization = BaseLayerSerialization<'GlobalMaxPooling2D', GlobalPooling2DLayerConfig>; -export declare type PoolingLayerSerialization = MaxPooling1DLayerSerialization | AveragePooling1DLayerSerialization | MaxPooling2DLayerSerialization | AveragePooling2DLayerSerialization | GlobalAveragePooling1DLayerSerialization | GlobalMaxPooling1DLayerSerialization | GlobalAveragePooling2DLayerSerialization | GlobalMaxPooling2DLayerSerialization; -export declare type PoolingLayerClassName = PoolingLayerSerialization['class_name']; -/** - * A string array of valid PoolingLayer class names. - * - * This is guaranteed to match the `PoolingLayerClassName` union type. - */ -export declare const poolingLayerClassNames: PoolingLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js deleted file mode 100644 index f248048fa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid PoolingLayer class names. - * - * This is guaranteed to match the `PoolingLayerClassName` union type. - */ -export const poolingLayerClassNames = [ - 'AveragePooling1D', - 'AveragePooling2D', - 'GlobalAveragePooling1D', - 'GlobalAveragePooling2D', - 'GlobalMaxPooling1D', - 'GlobalMaxPooling2D', - 'MaxPooling1D', - 'MaxPooling2D', -]; -//# sourceMappingURL=pooling_serialization.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-layers/dist/keras_format/layers/pooling_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js.map deleted file mode 100644 index f13140919..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/pooling_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pooling_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/pooling_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwDH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,kBAAkB;IAClB,kBAAkB;IAClB,wBAAwB;IACxB,wBAAwB;IACxB,oBAAoB;IACpB,oBAAoB;IACpB,cAAc;IACd,cAAc;CACf,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataFormatSerialization, PaddingMode} from '../common';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\n\nexport interface Pooling1DLayerConfig extends LayerConfig {\n pool_size?: [number];\n strides?: [number];\n padding?: PaddingMode;\n}\n\nexport type MaxPooling1DLayerSerialization =\n BaseLayerSerialization<'MaxPooling1D', Pooling1DLayerConfig>;\n\nexport type AveragePooling1DLayerSerialization =\n BaseLayerSerialization<'AveragePooling1D', Pooling1DLayerConfig>;\n\nexport interface Pooling2DLayerConfig extends LayerConfig {\n pool_size?: number|[number, number];\n strides?: number|[number, number];\n padding?: PaddingMode;\n data_format?: DataFormatSerialization;\n}\n\nexport type MaxPooling2DLayerSerialization =\n BaseLayerSerialization<'MaxPooling2D', Pooling2DLayerConfig>;\n\nexport type AveragePooling2DLayerSerialization =\n BaseLayerSerialization<'AveragePooling2D', Pooling2DLayerConfig>;\n\nexport type GlobalAveragePooling1DLayerSerialization =\n BaseLayerSerialization<'GlobalAveragePooling1D', LayerConfig>;\n\nexport type GlobalMaxPooling1DLayerSerialization =\n BaseLayerSerialization<'GlobalMaxPooling1D', LayerConfig>;\n\nexport interface GlobalPooling2DLayerConfig extends LayerConfig {\n data_format?: DataFormatSerialization;\n}\n\nexport type GlobalAveragePooling2DLayerSerialization = BaseLayerSerialization<\n 'GlobalAveragePooling2D', GlobalPooling2DLayerConfig>;\n\nexport type GlobalMaxPooling2DLayerSerialization =\n BaseLayerSerialization<'GlobalMaxPooling2D', GlobalPooling2DLayerConfig>;\n\n// Update poolingLayerClassNames below in concert with this.\nexport type PoolingLayerSerialization = MaxPooling1DLayerSerialization|\n AveragePooling1DLayerSerialization|MaxPooling2DLayerSerialization|\n AveragePooling2DLayerSerialization|GlobalAveragePooling1DLayerSerialization|\n GlobalMaxPooling1DLayerSerialization|\n GlobalAveragePooling2DLayerSerialization|\n GlobalMaxPooling2DLayerSerialization;\n\nexport type PoolingLayerClassName = PoolingLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid PoolingLayer class names.\n *\n * This is guaranteed to match the `PoolingLayerClassName` union type.\n */\nexport const poolingLayerClassNames: PoolingLayerClassName[] = [\n 'AveragePooling1D',\n 'AveragePooling2D',\n 'GlobalAveragePooling1D',\n 'GlobalAveragePooling2D',\n 'GlobalMaxPooling1D',\n 'GlobalMaxPooling2D',\n 'MaxPooling1D',\n 'MaxPooling2D',\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-layers/dist/keras_format/layers/recurrent_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.d.ts deleted file mode 100644 index c2b324863..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ActivationSerialization } from '../activation_config'; -import { ConstraintSerialization } from '../constraint_config'; -import { InitializerSerialization } from '../initializer_config'; -import { RegularizerSerialization } from '../regularizer_config'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -import { BaseSerialization } from '../types'; -export interface BaseRNNLayerConfig extends LayerConfig { - cell?: RNNCellSerialization | RNNCellSerialization[]; - return_sequences?: boolean; - return_state?: boolean; - go_backwards?: boolean; - stateful?: boolean; - unroll?: boolean; - input_dim?: number; - input_length?: number; -} -export interface SimpleRNNCellConfig extends LayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - recurrent_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_regularizer?: RegularizerSerialization; - recurrent_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - kernel_constraint?: ConstraintSerialization; - recurrent_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - dropout?: number; - recurrent_dropout?: number; -} -export declare type SimpleRNNCellSerialization = BaseSerialization<'SimpleRNNCell', SimpleRNNCellConfig>; -export interface SimpleRNNLayerConfig extends BaseRNNLayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - recurrent_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_regularizer?: RegularizerSerialization; - recurrent_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - kernel_constraint?: ConstraintSerialization; - recurrent_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - dropout?: number; - recurrent_dropout?: number; -} -export declare type SimpleRNNLayerSerialization = BaseLayerSerialization<'SimpleRNN', SimpleRNNLayerConfig>; -export interface GRUCellConfig extends SimpleRNNCellConfig { - recurrent_activation?: string; - implementation?: number; -} -export declare type GRUCellSerialization = BaseSerialization<'GRUCell', GRUCellConfig>; -export interface GRULayerConfig extends SimpleRNNLayerConfig { - recurrent_activation?: ActivationSerialization; - implementation?: number; -} -export declare type GRULayerSerialization = BaseLayerSerialization<'GRU', GRULayerConfig>; -export interface LSTMCellConfig extends SimpleRNNCellConfig { - recurrent_activation?: ActivationSerialization; - unit_forget_bias?: boolean; - implementation?: number; -} -export declare type LSTMCellSerialization = BaseSerialization<'LSTMCell', LSTMCellConfig>; -export interface LSTMLayerConfig extends SimpleRNNLayerConfig { - recurrent_activation?: ActivationSerialization; - unit_forget_bias?: boolean; - implementation?: number; -} -export declare type LSTMLayerSerialization = BaseLayerSerialization<'LSTM', LSTMLayerConfig>; -export interface StackedRNNCellsConfig extends LayerConfig { - cells: RNNCellSerialization[]; -} -export declare type StackedRNNCellsSerialization = BaseSerialization<'StackedRNNCells', StackedRNNCellsConfig>; -export declare type RNNCellSerialization = SimpleRNNCellSerialization | GRUCellSerialization | LSTMCellSerialization | StackedRNNCellsSerialization; -export declare type RecurrentLayerSerialization = SimpleRNNLayerSerialization | LSTMLayerSerialization | GRULayerSerialization; -export declare type RecurrentLayerClassName = RecurrentLayerSerialization['class_name']; -/** - * A string array of valid RecurrentLayer class names. - * - * This is guaranteed to match the `RecurrentLayerClassName` union type. - */ -export declare const recurrentLayerClassNames: RecurrentLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js deleted file mode 100644 index 852c1a107..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid RecurrentLayer class names. - * - * This is guaranteed to match the `RecurrentLayerClassName` union type. - */ -export const recurrentLayerClassNames = [ - 'GRU', - 'LSTM', - 'SimpleRNN', -]; -//# sourceMappingURL=recurrent_serialization.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-layers/dist/keras_format/layers/recurrent_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js.map deleted file mode 100644 index c5e885859..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/recurrent_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recurrent_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/recurrent_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8GH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,KAAK;IACL,MAAM;IACN,WAAW;CACZ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ActivationSerialization} from '../activation_config';\nimport {ConstraintSerialization} from '../constraint_config';\nimport {InitializerSerialization} from '../initializer_config';\nimport {RegularizerSerialization} from '../regularizer_config';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\nimport {BaseSerialization} from '../types';\n\nexport interface BaseRNNLayerConfig extends LayerConfig {\n cell?: RNNCellSerialization|RNNCellSerialization[];\n return_sequences?: boolean;\n return_state?: boolean;\n go_backwards?: boolean;\n stateful?: boolean;\n unroll?: boolean;\n input_dim?: number;\n input_length?: number;\n}\n\nexport interface SimpleRNNCellConfig extends LayerConfig {\n units: number;\n activation?: ActivationSerialization;\n use_bias?: boolean;\n kernel_initializer?: InitializerSerialization;\n recurrent_initializer?: InitializerSerialization;\n bias_initializer?: InitializerSerialization;\n kernel_regularizer?: RegularizerSerialization;\n recurrent_regularizer?: RegularizerSerialization;\n bias_regularizer?: RegularizerSerialization;\n kernel_constraint?: ConstraintSerialization;\n recurrent_constraint?: ConstraintSerialization;\n bias_constraint?: ConstraintSerialization;\n dropout?: number;\n recurrent_dropout?: number;\n}\n\nexport type SimpleRNNCellSerialization =\n BaseSerialization<'SimpleRNNCell', SimpleRNNCellConfig>;\n\nexport interface SimpleRNNLayerConfig extends BaseRNNLayerConfig {\n units: number;\n activation?: ActivationSerialization;\n use_bias?: boolean;\n kernel_initializer?: InitializerSerialization;\n recurrent_initializer?: InitializerSerialization;\n bias_initializer?: InitializerSerialization;\n kernel_regularizer?: RegularizerSerialization;\n recurrent_regularizer?: RegularizerSerialization;\n bias_regularizer?: RegularizerSerialization;\n kernel_constraint?: ConstraintSerialization;\n recurrent_constraint?: ConstraintSerialization;\n bias_constraint?: ConstraintSerialization;\n dropout?: number;\n recurrent_dropout?: number;\n}\n\nexport type SimpleRNNLayerSerialization =\n BaseLayerSerialization<'SimpleRNN', SimpleRNNLayerConfig>;\n\nexport interface GRUCellConfig extends SimpleRNNCellConfig {\n recurrent_activation?: string;\n implementation?: number;\n}\n\nexport type GRUCellSerialization = BaseSerialization<'GRUCell', GRUCellConfig>;\n\nexport interface GRULayerConfig extends SimpleRNNLayerConfig {\n recurrent_activation?: ActivationSerialization;\n implementation?: number;\n}\n\nexport type GRULayerSerialization =\n BaseLayerSerialization<'GRU', GRULayerConfig>;\n\nexport interface LSTMCellConfig extends SimpleRNNCellConfig {\n recurrent_activation?: ActivationSerialization;\n unit_forget_bias?: boolean;\n implementation?: number;\n}\n\nexport type LSTMCellSerialization =\n BaseSerialization<'LSTMCell', LSTMCellConfig>;\n\nexport interface LSTMLayerConfig extends SimpleRNNLayerConfig {\n recurrent_activation?: ActivationSerialization;\n unit_forget_bias?: boolean;\n implementation?: number;\n}\nexport type LSTMLayerSerialization =\n BaseLayerSerialization<'LSTM', LSTMLayerConfig>;\n\nexport interface StackedRNNCellsConfig extends LayerConfig {\n // TODO(soergel): consider whether we can avoid improperly mixing\n // Simple / LSTM / GRU cells here and in the above Layer serializations.\n cells: RNNCellSerialization[];\n}\n\nexport type StackedRNNCellsSerialization =\n BaseSerialization<'StackedRNNCells', StackedRNNCellsConfig>;\n\nexport type RNNCellSerialization = SimpleRNNCellSerialization|\n GRUCellSerialization|LSTMCellSerialization|StackedRNNCellsSerialization;\n\n// Update recurrentLayerClassNames below in concert with this.\nexport type RecurrentLayerSerialization =\n SimpleRNNLayerSerialization|LSTMLayerSerialization|GRULayerSerialization;\n\nexport type RecurrentLayerClassName = RecurrentLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid RecurrentLayer class names.\n *\n * This is guaranteed to match the `RecurrentLayerClassName` union type.\n */\nexport const recurrentLayerClassNames: RecurrentLayerClassName[] = [\n 'GRU',\n 'LSTM',\n 'SimpleRNN',\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-layers/dist/keras_format/layers/wrappers_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.d.ts deleted file mode 100644 index cfbc63a8b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BidirectionalMergeMode } from '../common'; -import { BaseLayerSerialization, LayerConfig } from '../topology_config'; -import { LayerSerialization } from './layer_serialization'; -import { RecurrentLayerSerialization } from './recurrent_serialization'; -export declare type TimeDistributedLayerSerialization = BaseLayerSerialization<'TimeDistributed', TimeDistributedLayerConfig>; -export interface TimeDistributedLayerConfig extends LayerConfig { - layer: LayerSerialization; -} -export declare type BidirectionalLayerSerialization = BaseLayerSerialization<'Bidirectional', BidirectionalLayerConfig>; -export interface BidirectionalLayerConfig extends LayerConfig { - layer: RecurrentLayerSerialization; - merge_mode?: BidirectionalMergeMode; -} -export declare type WrapperLayerSerialization = TimeDistributedLayerSerialization | BidirectionalLayerSerialization; -export declare type WrapperLayerClassName = WrapperLayerSerialization['class_name']; -/** - * A string array of valid WrapperLayer class names. - * - * This is guaranteed to match the `WrapperLayerClassName` union type. - */ -export declare const wrapperLayerClassNames: WrapperLayerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js deleted file mode 100644 index 11fc47508..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid WrapperLayer class names. - * - * This is guaranteed to match the `WrapperLayerClassName` union type. - */ -export const wrapperLayerClassNames = [ - 'Bidirectional', - 'TimeDistributed', -]; -//# sourceMappingURL=wrappers_serialization.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-layers/dist/keras_format/layers/wrappers_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js.map deleted file mode 100644 index cf7069d4a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/layers/wrappers_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers_serialization.js","sourceRoot":"","sources":["../../../src/keras_format/layers/wrappers_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4BH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,eAAe;IACf,iBAAiB;CAClB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BidirectionalMergeMode} from '../common';\nimport {BaseLayerSerialization, LayerConfig} from '../topology_config';\nimport {LayerSerialization} from './layer_serialization';\nimport {RecurrentLayerSerialization} from './recurrent_serialization';\n\nexport type TimeDistributedLayerSerialization =\n BaseLayerSerialization<'TimeDistributed', TimeDistributedLayerConfig>;\n\nexport interface TimeDistributedLayerConfig extends LayerConfig {\n layer: LayerSerialization;\n}\n\nexport type BidirectionalLayerSerialization =\n BaseLayerSerialization<'Bidirectional', BidirectionalLayerConfig>;\n\nexport interface BidirectionalLayerConfig extends LayerConfig {\n layer: RecurrentLayerSerialization;\n merge_mode?: BidirectionalMergeMode;\n}\n\n// Update wrapperLayerClassNames below in concert with this.\nexport type WrapperLayerSerialization =\n TimeDistributedLayerSerialization|BidirectionalLayerSerialization;\n\nexport type WrapperLayerClassName = WrapperLayerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid WrapperLayer class names.\n *\n * This is guaranteed to match the `WrapperLayerClassName` union type.\n */\nexport const wrapperLayerClassNames: WrapperLayerClassName[] = [\n 'Bidirectional',\n 'TimeDistributed',\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-layers/dist/keras_format/loss_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.d.ts deleted file mode 100644 index 474f04d46..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * List of all known loss names. - */ -export declare const lossOptions: ("mean_squared_error" | "mean_absolute_error" | "mean_absolute_percentage_error" | "mean_squared_logarithmic_error" | "squared_hinge" | "hinge" | "categorical_hinge" | "logcosh" | "categorical_crossentropy" | "sparse_categorical_crossentropy" | "kullback_leibler_divergence" | "poisson" | "cosine_proximity")[]; -/** - * A type representing the strings that are valid loss names. - */ -export declare type LossIdentifier = typeof lossOptions[number]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js deleted file mode 100644 index d998f17c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { stringLiteralArray } from './utils'; -/** - * List of all known loss names. - */ -export const lossOptions = stringLiteralArray([ - 'mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error', - 'mean_squared_logarithmic_error', 'squared_hinge', 'hinge', - 'categorical_hinge', 'logcosh', 'categorical_crossentropy', - 'sparse_categorical_crossentropy', 'kullback_leibler_divergence', 'poisson', - 'cosine_proximity' -]); -//# sourceMappingURL=loss_config.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-layers/dist/keras_format/loss_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js.map deleted file mode 100644 index 25a6dc3b3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/loss_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"loss_config.js","sourceRoot":"","sources":["../../src/keras_format/loss_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;IAC5C,oBAAoB,EAAE,qBAAqB,EAAE,gCAAgC;IAC7E,gCAAgC,EAAE,eAAe,EAAE,OAAO;IAC1D,mBAAmB,EAAE,SAAS,EAAE,0BAA0B;IAC1D,iCAAiC,EAAE,6BAA6B,EAAE,SAAS;IAC3E,kBAAkB;CACnB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {stringLiteralArray} from './utils';\n\n/**\n * List of all known loss names.\n */\nexport const lossOptions = stringLiteralArray([\n 'mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error',\n 'mean_squared_logarithmic_error', 'squared_hinge', 'hinge',\n 'categorical_hinge', 'logcosh', 'categorical_crossentropy',\n 'sparse_categorical_crossentropy', 'kullback_leibler_divergence', 'poisson',\n 'cosine_proximity'\n]);\n\n/**\n * A type representing the strings that are valid loss names.\n */\nexport type LossIdentifier = typeof lossOptions[number];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.d.ts deleted file mode 100644 index 99ca35ff0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { LayerSerialization } from './layers/layer_serialization'; -import { TensorKeyArray } from './node_config'; -import { TrainingConfig } from './training_config'; -import { BaseSerialization } from './types'; -export declare type ModelConfig = { - name: string; - layers: LayerSerialization[]; - input_layers: TensorKeyArray[]; - output_layers: TensorKeyArray[]; -}; -/** - * A standard Keras JSON 'Model' configuration. - */ -export interface ModelSerialization extends BaseSerialization<'Model', ModelConfig> { - backend?: string; - keras_version?: string; -} -export declare type SequentialConfig = { - layers: LayerSerialization[]; -}; -/** - * A standard Keras JSON 'Sequential' configuration. - */ -export interface SequentialSerialization extends BaseSerialization<'Sequential', SequentialConfig> { - backend?: string; - keras_version?: string; -} -/** - * A legacy Keras JSON 'Sequential' configuration. - * - * It was a bug that Keras Sequential models were recorded with - * model_config.config as an array of layers, instead of a dict containing a - * 'layers' entry. While the bug has been fixed, we still need to be able to - * read this legacy format. - */ -export declare type LegacySequentialSerialization = { - class_name: 'Sequential'; - config: LayerSerialization[]; - backend?: string; - keras_version?: string; -}; -/** - * Contains the description of a KerasModel, as well as the configuration - * necessary to train that model. - */ -export declare type KerasFileSerialization = { - model_config: ModelSerialization | SequentialSerialization | LegacySequentialSerialization; - training_config: TrainingConfig; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js deleted file mode 100644 index 793df6677..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -//# sourceMappingURL=model_serialization.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-layers/dist/keras_format/model_serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js.map deleted file mode 100644 index 76c201fb6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/model_serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"model_serialization.js","sourceRoot":"","sources":["../../src/keras_format/model_serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerSerialization} from './layers/layer_serialization';\nimport {TensorKeyArray} from './node_config';\nimport {TrainingConfig} from './training_config';\nimport {BaseSerialization} from './types';\n\nexport type ModelConfig = {\n name: string,\n layers: LayerSerialization[],\n input_layers: TensorKeyArray[],\n output_layers: TensorKeyArray[],\n};\n\n/**\n * A standard Keras JSON 'Model' configuration.\n */\nexport interface ModelSerialization extends\n BaseSerialization<'Model', ModelConfig> {\n backend?: string;\n keras_version?: string;\n}\n\nexport type SequentialConfig = {\n layers: LayerSerialization[]\n};\n\n/**\n * A standard Keras JSON 'Sequential' configuration.\n */\nexport interface SequentialSerialization extends\n BaseSerialization<'Sequential', SequentialConfig> {\n backend?: string;\n keras_version?: string;\n}\n\n/**\n * A legacy Keras JSON 'Sequential' configuration.\n *\n * It was a bug that Keras Sequential models were recorded with\n * model_config.config as an array of layers, instead of a dict containing a\n * 'layers' entry. While the bug has been fixed, we still need to be able to\n * read this legacy format.\n */\nexport type LegacySequentialSerialization = {\n // Note this cannot extend `BaseSerialization` because of the bug.\n class_name: 'Sequential';\n\n config: LayerSerialization[];\n backend?: string;\n keras_version?: string;\n};\n\n/**\n * Contains the description of a KerasModel, as well as the configuration\n * necessary to train that model.\n */\nexport type KerasFileSerialization = {\n // aka ModelTopology?\n model_config: ModelSerialization|SequentialSerialization|\n LegacySequentialSerialization;\n training_config: TrainingConfig;\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-layers/dist/keras_format/node_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.d.ts deleted file mode 100644 index 2817b1cec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { PyJsonDict } from './types'; -/** - * The unique string name of a Layer. - */ -export declare type LayerName = string; -/** - * The index of a Node, identifying a specific invocation of a given Layer. - */ -export declare type NodeIndex = number; -/** - * The index of a Tensor output by a given Node of a given Layer. - */ -export declare type TensorIndex = number; -/** - * Arguments to the apply(...) method that produced a specific Node. - */ -export interface NodeArgs extends PyJsonDict { -} -/** - * A reference to a specific Tensor, given by its Layer name, Node index, and - * output index, including the apply() arguments associated with the Node. - * - * This is used in `NodeConfig` to specify the inputs to each Node. - */ -export declare type TensorKeyWithArgsArray = [LayerName, NodeIndex, TensorIndex, NodeArgs]; -/** - * A reference to a specific Tensor, given by its Layer name, Node index, and - * output index. - * - * This does not include the apply() arguments associated with the Node. It is - * used in the LayersModel config to specify the inputLayers and outputLayers. - * It seems to be an idiosyncrasy of Python Keras that the node arguments are - * not included here. - */ -export declare type TensorKeyArray = [LayerName, NodeIndex, TensorIndex]; -/** - * A Keras JSON entry representing a Node, i.e. a specific instance of a Layer. - * - * By Keras JSON convention, a Node is specified as an array of Tensor keys - * (i.e., references to Tensors output by other Layers) providing the inputs to - * this Layer in order. - */ -export declare type NodeConfig = TensorKeyWithArgsArray[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js deleted file mode 100644 index 26c23c8d5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -//# sourceMappingURL=node_config.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-layers/dist/keras_format/node_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js.map deleted file mode 100644 index 4dbe96608..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/node_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"node_config.js","sourceRoot":"","sources":["../../src/keras_format/node_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {PyJsonDict} from './types';\n\n/**\n * The unique string name of a Layer.\n */\nexport type LayerName = string;\n\n/**\n * The index of a Node, identifying a specific invocation of a given Layer.\n */\nexport type NodeIndex = number;\n\n/**\n * The index of a Tensor output by a given Node of a given Layer.\n */\nexport type TensorIndex = number;\n\n/**\n * Arguments to the apply(...) method that produced a specific Node.\n */\n// tslint:disable-next-line:no-empty-interface\nexport interface NodeArgs extends PyJsonDict {}\n\n/**\n * A reference to a specific Tensor, given by its Layer name, Node index, and\n * output index, including the apply() arguments associated with the Node.\n *\n * This is used in `NodeConfig` to specify the inputs to each Node.\n */\nexport type TensorKeyWithArgsArray =\n [LayerName, NodeIndex, TensorIndex, NodeArgs];\n\n// TODO(soergel): verify behavior of Python Keras; maybe PR to standardize it.\n/**\n * A reference to a specific Tensor, given by its Layer name, Node index, and\n * output index.\n *\n * This does not include the apply() arguments associated with the Node. It is\n * used in the LayersModel config to specify the inputLayers and outputLayers.\n * It seems to be an idiosyncrasy of Python Keras that the node arguments are\n * not included here.\n */\nexport type TensorKeyArray = [LayerName, NodeIndex, TensorIndex];\n\n/**\n * A Keras JSON entry representing a Node, i.e. a specific instance of a Layer.\n *\n * By Keras JSON convention, a Node is specified as an array of Tensor keys\n * (i.e., references to Tensors output by other Layers) providing the inputs to\n * this Layer in order.\n */\nexport type NodeConfig = TensorKeyWithArgsArray[];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.d.ts deleted file mode 100644 index bec7e182c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseSerialization } from './types'; -export declare type AdadeltaOptimizerConfig = { - learning_rate: number; - rho: number; - epsilon: number; -}; -export declare type AdadeltaSerialization = BaseSerialization<'Adadelta', AdadeltaOptimizerConfig>; -export declare type AdagradOptimizerConfig = { - learning_rate: number; - initial_accumulator_value?: number; -}; -export declare type AdagradSerialization = BaseSerialization<'Adagrad', AdagradOptimizerConfig>; -export declare type AdamOptimizerConfig = { - learning_rate: number; - beta1: number; - beta2: number; - epsilon?: number; -}; -export declare type AdamSerialization = BaseSerialization<'Adam', AdamOptimizerConfig>; -export declare type AdamaxOptimizerConfig = { - learning_rate: number; - beta1: number; - beta2: number; - epsilon?: number; - decay?: number; -}; -export declare type AdamaxSerialization = BaseSerialization<'Adamax', AdamaxOptimizerConfig>; -export declare type MomentumOptimizerConfig = { - learning_rate: number; - momentum: number; - use_nesterov?: boolean; -}; -export declare type MomentumSerialization = BaseSerialization<'Momentum', MomentumOptimizerConfig>; -export declare type RMSPropOptimizerConfig = { - learning_rate: number; - decay?: number; - momentum?: number; - epsilon?: number; - centered?: boolean; -}; -export declare type RMSPropSerialization = BaseSerialization<'RMSProp', RMSPropOptimizerConfig>; -export declare type SGDOptimizerConfig = { - learning_rate: number; -}; -export declare type SGDSerialization = BaseSerialization<'SGD', SGDOptimizerConfig>; -export declare type OptimizerSerialization = AdadeltaSerialization | AdagradSerialization | AdamSerialization | AdamaxSerialization | MomentumSerialization | RMSPropSerialization | SGDSerialization; -export declare type OptimizerClassName = OptimizerSerialization['class_name']; -/** - * A string array of valid Optimizer class names. - * - * This is guaranteed to match the `OptimizerClassName` union type. - */ -export declare const optimizerClassNames: OptimizerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js deleted file mode 100644 index 56aa09bfe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. -/** - * A string array of valid Optimizer class names. - * - * This is guaranteed to match the `OptimizerClassName` union type. - */ -export const optimizerClassNames = ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Momentum', 'RMSProp', 'SGD']; -//# sourceMappingURL=optimizer_config.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-layers/dist/keras_format/optimizer_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js.map deleted file mode 100644 index d9f8d52e2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/optimizer_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optimizer_config.js","sourceRoot":"","sources":["../../src/keras_format/optimizer_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiFH,4EAA4E;AAC5E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC5B,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// Because of the limitations in the current Keras spec, there is no clear\n// definition of what may or may not be the configuration of an optimizer.\n//\n// For now we'll represent the ones available in TF.js--but it will take more\n// thought to get this right in a cross-platform way.\n//\n// See internal issue: b/121033602\n\n// TODO(soergel): This is a stopgap that needs further thought.\n// Does it belong here?\n// Does it belong in tfjs-core?\n// See also the dormant https://github.com/tensorflow/tfjs-core/pull/1404\n\nexport type AdadeltaOptimizerConfig = {\n learning_rate: number; rho: number; epsilon: number;\n};\n\nexport type AdadeltaSerialization =\n BaseSerialization<'Adadelta', AdadeltaOptimizerConfig>;\n\nexport type AdagradOptimizerConfig = {\n learning_rate: number;\n initial_accumulator_value?: number;\n};\n\nexport type AdagradSerialization =\n BaseSerialization<'Adagrad', AdagradOptimizerConfig>;\n\nexport type AdamOptimizerConfig = {\n learning_rate: number; beta1: number; beta2: number;\n epsilon?: number;\n};\n\nexport type AdamSerialization = BaseSerialization<'Adam', AdamOptimizerConfig>;\n\nexport type AdamaxOptimizerConfig = {\n learning_rate: number; beta1: number; beta2: number;\n epsilon?: number;\n decay?: number;\n};\n\nexport type AdamaxSerialization =\n BaseSerialization<'Adamax', AdamaxOptimizerConfig>;\n\nexport type MomentumOptimizerConfig = {\n // extends SGDOptimizerConfig {\n learning_rate: number; momentum: number;\n use_nesterov?: boolean;\n};\n\nexport type MomentumSerialization =\n BaseSerialization<'Momentum', MomentumOptimizerConfig>;\n\nexport type RMSPropOptimizerConfig = {\n learning_rate: number;\n decay?: number;\n momentum?: number;\n epsilon?: number;\n centered?: boolean;\n};\n\nexport type RMSPropSerialization =\n BaseSerialization<'RMSProp', RMSPropOptimizerConfig>;\n\nexport type SGDOptimizerConfig = {\n learning_rate: number;\n};\n\nexport type SGDSerialization = BaseSerialization<'SGD', SGDOptimizerConfig>;\n\n// Update optimizerClassNames below in concert with this.\nexport type OptimizerSerialization = AdadeltaSerialization|AdagradSerialization|\n AdamSerialization|AdamaxSerialization|MomentumSerialization|\n RMSPropSerialization|SGDSerialization;\n\nexport type OptimizerClassName = OptimizerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid.\n\n/**\n * A string array of valid Optimizer class names.\n *\n * This is guaranteed to match the `OptimizerClassName` union type.\n */\nexport const optimizerClassNames: OptimizerClassName[] =\n ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Momentum', 'RMSProp', 'SGD'];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.d.ts deleted file mode 100644 index 2aabe8e64..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { BaseSerialization } from './types'; -export declare type L1L2Config = { - l1?: number; - l2?: number; -}; -export declare type L1L2Serialization = BaseSerialization<'L1L2', L1L2Config>; -export declare type RegularizerSerialization = L1L2Serialization; -export declare type RegularizerClassName = RegularizerSerialization['class_name']; -/** - * A string array of valid Regularizer class names. - * - * This is guaranteed to match the `RegularizerClassName` union type. - */ -export declare const regularizerClassNames: RegularizerClassName[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js deleted file mode 100644 index efeacf04f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. -/** - * A string array of valid Regularizer class names. - * - * This is guaranteed to match the `RegularizerClassName` union type. - */ -export const regularizerClassNames = ['L1L2']; -//# sourceMappingURL=regularizer_config.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-layers/dist/keras_format/regularizer_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js.map deleted file mode 100644 index 2bcc8db2b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/regularizer_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regularizer_config.js","sourceRoot":"","sources":["../../src/keras_format/regularizer_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,4EAA4E;AAC5E,6EAA6E;AAC7E,6CAA6C;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA2B,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\nexport type L1L2Config = {\n l1?: number;\n l2?: number;\n};\n\nexport type L1L2Serialization = BaseSerialization<'L1L2', L1L2Config>;\n\n// Update regularizerClassNames below in concert with this.\nexport type RegularizerSerialization = L1L2Serialization;\n\nexport type RegularizerClassName = RegularizerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Regularizer class names.\n *\n * This is guaranteed to match the `RegularizerClassName` union type.\n */\nexport const regularizerClassNames: RegularizerClassName[] = ['L1L2'];\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts deleted file mode 100644 index b7797191f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType } from '@tensorflow/tfjs-core'; -import { Shape } from './common'; -import { NodeConfig } from './node_config'; -import { BaseSerialization, PyJson, PyJsonDict } from './types'; -/** Constructor arguments for Layer. */ -export interface LayerConfig extends PyJsonDict { - input_shape?: Shape; - batch_input_shape?: Shape; - batch_size?: number; - dtype?: DataType; - name?: string; - trainable?: boolean; - input_dtype?: DataType; -} -/** - * Converts a subtype of `LayerConfig` to a variant with restricted keys. - * - * This is a bit tricky because `keyof` obtains only local fields, not inherited - * fields. Thus, this type combines the keys from the `LayerConfig` supertype - * with those of the specific subtype. - * - * See ./types.ts for an explanation of the PyJson type. - */ -export declare type JsonLayer = C & LayerConfig & PyJson | Extract>; -/** - * A Keras JSON entry representing a layer. - * - * The Keras JSON convention is to provide the `class_name` (i.e., the layer - * type) at the top level, and then to place the layer-specific configuration in - * a `config` subtree. These layer-specific configurations are provided by - * subtypes of `LayerConfig`. Thus, this `*Serialization` has a type parameter - * giving the specific type of the wrapped `LayerConfig`. - */ -export interface BaseLayerSerialization extends BaseSerialization> { - name: string; - inbound_nodes?: NodeConfig[]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js deleted file mode 100644 index c0c610474..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -//# sourceMappingURL=topology_config.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-layers/dist/keras_format/topology_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js.map deleted file mode 100644 index 8eb05eabc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/topology_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"topology_config.js","sourceRoot":"","sources":["../../src/keras_format/topology_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType} from '@tensorflow/tfjs-core';\n\nimport {Shape} from './common';\nimport {NodeConfig} from './node_config';\nimport {BaseSerialization, PyJson, PyJsonDict} from './types';\n\n/** Constructor arguments for Layer. */\nexport interface LayerConfig extends PyJsonDict {\n input_shape?: Shape;\n batch_input_shape?: Shape;\n batch_size?: number;\n dtype?: DataType;\n name?: string;\n trainable?: boolean;\n input_dtype?: DataType;\n}\n\n/**\n * Converts a subtype of `LayerConfig` to a variant with restricted keys.\n *\n * This is a bit tricky because `keyof` obtains only local fields, not inherited\n * fields. Thus, this type combines the keys from the `LayerConfig` supertype\n * with those of the specific subtype.\n *\n * See ./types.ts for an explanation of the PyJson type.\n */\nexport type JsonLayer = C&LayerConfig&\n PyJson|Extract>;\n\n/**\n * A Keras JSON entry representing a layer.\n *\n * The Keras JSON convention is to provide the `class_name` (i.e., the layer\n * type) at the top level, and then to place the layer-specific configuration in\n * a `config` subtree. These layer-specific configurations are provided by\n * subtypes of `LayerConfig`. Thus, this `*Serialization` has a type parameter\n * giving the specific type of the wrapped `LayerConfig`.\n */\nexport interface BaseLayerSerialization\n extends BaseSerialization> {\n name: string;\n inbound_nodes?: NodeConfig[];\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-layers/dist/keras_format/training_config.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts deleted file mode 100644 index efbfb89e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { SampleWeightMode } from './common'; -import { LossIdentifier } from './loss_config'; -import { OptimizerSerialization } from './optimizer_config'; -import { PyJsonDict } from './types'; -export declare type MetricsIdentifier = string; -/** - * a type for valid values of the `loss_weights` field. - */ -export declare type LossWeights = number[] | { - [key: string]: number; -}; -/** - * Configuration of the Keras trainer. This includes the configuration to the - * optimizer, the loss, any metrics to be calculated, etc. - */ -export interface TrainingConfig extends PyJsonDict { - optimizer_config: OptimizerSerialization; - loss: LossIdentifier | LossIdentifier[] | { - [key: string]: LossIdentifier; - }; - metrics?: MetricsIdentifier[] | { - [key: string]: MetricsIdentifier; - }; - weighted_metrics?: MetricsIdentifier[]; - sample_weight_mode?: SampleWeightMode; - loss_weights?: LossWeights; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js deleted file mode 100644 index 9e27fb045..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=training_config.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-layers/dist/keras_format/training_config.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js.map deleted file mode 100644 index 14f064b85..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/training_config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"training_config.js","sourceRoot":"","sources":["../../src/keras_format/training_config.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {SampleWeightMode} from './common';\nimport {LossIdentifier} from './loss_config';\nimport {OptimizerSerialization} from './optimizer_config';\nimport {PyJsonDict} from './types';\n\n// TODO(soergel): flesh out known metrics options\nexport type MetricsIdentifier = string;\n\n/**\n * a type for valid values of the `loss_weights` field.\n */\nexport type LossWeights = number[]|{[key: string]: number};\n\n/**\n * Configuration of the Keras trainer. This includes the configuration to the\n * optimizer, the loss, any metrics to be calculated, etc.\n */\nexport interface TrainingConfig extends PyJsonDict {\n // tslint:disable-next-line:no-any\n optimizer_config: OptimizerSerialization;\n loss: LossIdentifier|LossIdentifier[]|{[key: string]: LossIdentifier};\n metrics?: MetricsIdentifier[]|{[key: string]: MetricsIdentifier};\n weighted_metrics?: MetricsIdentifier[];\n sample_weight_mode?: SampleWeightMode;\n loss_weights?: LossWeights;\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-layers/dist/keras_format/types.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.d.ts deleted file mode 100644 index debe567a5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * A value within the JSON-serialized form of a serializable object. - * - * The keys of any nested dicts should be in snake_case (i.e., using Python - * naming conventions) for compatibility with Python Keras. - * - * @see PyJsonDict - */ -export declare type PyJsonValue = boolean | number | string | null | PyJsonArray | PyJsonDict; -/** - * A key-value dict within the JSON-serialized form of a serializable object. - * - * Serialization/deserialization uses stringified-JSON as the storage - * representation. Typically this should be used for materialized JSON - * stored on disk or sent/received over the wire. - * - * The keys of this dict and of any nested dicts should be in snake_case (i.e., - * using Python naming conventions) for compatibility with Python Keras. - * - * Internally this is normally converted to a ConfigDict that has CamelCase keys - * (using TypeScript naming conventions) and support for Enums. - */ -export interface PyJsonDict { - [key: string]: PyJsonValue; -} -/** - * A key-value dict like @see PyJsonDict, but with restricted keys. - * - * This makes it possible to create subtypes that have only the specified - * fields, while requiring that the values are JSON-compatible. - * - * That is in contrast to extending `PyJsonDict`, or using an intersection type - * `Foo & PyJsonDict`. In both of those cases, the fields of Foo are actually - * allowed to be of types that are incompatible with `PyJsonValue`. Worse, the - * index signature of `PyJsonValue` means that *any* key is accepted: eg. - * `const foo: Foo = ...; foo.bogus = 12; const x = foo.bogus` works for both - * reading and assignment, even if `bogus` is not a field of the type `Foo`, - * because the index signature inherited from `PyJsonDict` accepts all strings. - * - * Here, we *both* restrict the keys to known values, *and* guarantee that the - * values associated with those keys are compatible with `PyJsonValue`. - * - * This guarantee is easiest to apply via an additional incantation: - * - * ``` - * export interface Foo extends PyJson { - * a: SomeType; - * b: SomeOtherType; - * } - * ``` - * - * Now instances of `Foo` have *only* the fields `a` and `b`, and furthermore, - * if either the type `SomeType` or `SomeOtherType` is incompatible with - * `PyJsonValue`, the compiler produces a typing error. - */ -export declare type PyJson = { - [x in Keys]?: PyJsonValue; -}; -/** - * An array of values within the JSON-serialized form of a serializable object. - * - * The keys of any nested dicts should be in snake_case (i.e., using Python - * naming conventions) for compatibility with Python Keras. - * - * @see PyJsonDict - */ -export interface PyJsonArray extends Array { -} -/** - * A Keras JSON entry representing a Keras object such as a Layer. - * - * The Keras JSON convention is to provide the `class_name` (e.g., the layer - * type) at the top level, and then to place the class-specific configuration in - * a `config` subtree. These class-specific configurations are provided by - * subtypes of `PyJsonDict`. Thus, this `*Serialization` has a type parameter - * giving the specific type of the wrapped `PyJsonDict`. - */ -export interface BaseSerialization>> extends PyJsonDict { - class_name: N; - config: T; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js deleted file mode 100644 index 68c605505..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -//# 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-layers/dist/keras_format/types.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js.map deleted file mode 100644 index 16ef68361..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/keras_format/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * A value within the JSON-serialized form of a serializable object.\n *\n * The keys of any nested dicts should be in snake_case (i.e., using Python\n * naming conventions) for compatibility with Python Keras.\n *\n * @see PyJsonDict\n */\nexport type PyJsonValue = boolean|number|string|null|PyJsonArray|PyJsonDict;\n\n/**\n * A key-value dict within the JSON-serialized form of a serializable object.\n *\n * Serialization/deserialization uses stringified-JSON as the storage\n * representation. Typically this should be used for materialized JSON\n * stored on disk or sent/received over the wire.\n *\n * The keys of this dict and of any nested dicts should be in snake_case (i.e.,\n * using Python naming conventions) for compatibility with Python Keras.\n *\n * Internally this is normally converted to a ConfigDict that has CamelCase keys\n * (using TypeScript naming conventions) and support for Enums.\n */\nexport interface PyJsonDict {\n [key: string]: PyJsonValue;\n}\n\n/**\n * A key-value dict like @see PyJsonDict, but with restricted keys.\n *\n * This makes it possible to create subtypes that have only the specified\n * fields, while requiring that the values are JSON-compatible.\n *\n * That is in contrast to extending `PyJsonDict`, or using an intersection type\n * `Foo & PyJsonDict`. In both of those cases, the fields of Foo are actually\n * allowed to be of types that are incompatible with `PyJsonValue`. Worse, the\n * index signature of `PyJsonValue` means that *any* key is accepted: eg.\n * `const foo: Foo = ...; foo.bogus = 12; const x = foo.bogus` works for both\n * reading and assignment, even if `bogus` is not a field of the type `Foo`,\n * because the index signature inherited from `PyJsonDict` accepts all strings.\n *\n * Here, we *both* restrict the keys to known values, *and* guarantee that the\n * values associated with those keys are compatible with `PyJsonValue`.\n *\n * This guarantee is easiest to apply via an additional incantation:\n *\n * ```\n * export interface Foo extends PyJson {\n * a: SomeType;\n * b: SomeOtherType;\n * }\n * ```\n *\n * Now instances of `Foo` have *only* the fields `a` and `b`, and furthermore,\n * if either the type `SomeType` or `SomeOtherType` is incompatible with\n * `PyJsonValue`, the compiler produces a typing error.\n */\nexport type PyJson = {\n [x in Keys]?: PyJsonValue;\n};\n\n/**\n * An array of values within the JSON-serialized form of a serializable object.\n *\n * The keys of any nested dicts should be in snake_case (i.e., using Python\n * naming conventions) for compatibility with Python Keras.\n *\n * @see PyJsonDict\n */\nexport interface PyJsonArray extends Array {}\n\n/**\n * A Keras JSON entry representing a Keras object such as a Layer.\n *\n * The Keras JSON convention is to provide the `class_name` (e.g., the layer\n * type) at the top level, and then to place the class-specific configuration in\n * a `config` subtree. These class-specific configurations are provided by\n * subtypes of `PyJsonDict`. Thus, this `*Serialization` has a type parameter\n * giving the specific type of the wrapped `PyJsonDict`.\n */\nexport interface BaseSerialization<\n N extends string, T extends PyJson>> extends\n PyJsonDict {\n // The above type voodoo does this:\n // * `keyof T` obtains the known keys of the specific config type.\n // `keyof` returns `string | number | symbol`; see\n // (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html)\n // * `Extract` selects the string values. This amounts to\n // assuming that we are dealing with a type with string keys, as opposed to\n // an array. In our usage, this assumption always holds.\n // * `PyJson>` is a type whose keys are constrained\n // to the provided ones, and whose values must be JSON-compatible.\n // * `T extends PyJson> means that we can provide any\n // config type with known keys, provided that the associated values are\n // JSON-compatible.\n //\n // The upshot is that we can extend `BaseSerialization` with whatever config\n // type `T` that we like-- remaining confident that the result can be\n // trivially rendered as JSON, because the compiler will produce a typing\n // error if that guarantee does not hold.\n //\n // To test this, try adding a field with a non-JSON-like value (e.g., Tensor)\n // to any subclass of `BaseSerialization`. A compilation error will result.\n class_name: N;\n config: T;\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-layers/dist/keras_format/utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.d.ts deleted file mode 100644 index 280ca3b80..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Infers a string union type from an array of string literals, and returns - * the array as an array of that type. - * - * For instance: - * - * ``` - * const fruits = stringLiteralArray(['apple', 'banana', 'orange']); - * type Fruit = typeof activationOptions[number]; - * ``` - * - * now `Fruit` is the union type `'apple'|'banana'|'orange'`. - * - * https://stackoverflow.com/questions/52085454/typescript-define-a-union-type-from-an-array-of-strings/52085658 - */ -export declare function stringLiteralArray(a: T[]): T[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js deleted file mode 100644 index e8f889f25..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Infers a string union type from an array of string literals, and returns - * the array as an array of that type. - * - * For instance: - * - * ``` - * const fruits = stringLiteralArray(['apple', 'banana', 'orange']); - * type Fruit = typeof activationOptions[number]; - * ``` - * - * now `Fruit` is the union type `'apple'|'banana'|'orange'`. - * - * https://stackoverflow.com/questions/52085454/typescript-define-a-union-type-from-an-array-of-strings/52085658 - */ -export function stringLiteralArray(a) { - return a; -} -//# sourceMappingURL=utils.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-layers/dist/keras_format/utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js.map deleted file mode 100644 index 6e7d31173..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/keras_format/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/keras_format/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAmB,CAAM;IACzD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Infers a string union type from an array of string literals, and returns\n * the array as an array of that type.\n *\n * For instance:\n *\n * ```\n * const fruits = stringLiteralArray(['apple', 'banana', 'orange']);\n * type Fruit = typeof activationOptions[number];\n * ```\n *\n * now `Fruit` is the union type `'apple'|'banana'|'orange'`.\n *\n * https://stackoverflow.com/questions/52085454/typescript-define-a-union-type-from-an-array-of-strings/52085658\n */\nexport function stringLiteralArray(a: T[]) {\n return a;\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-layers/dist/layers/advanced_activation_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map deleted file mode 100644 index f67e9a445..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"advanced_activation_test.js","sourceRoot":"","sources":["../../src/layers/advanced_activation_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,IAAI,EAAU,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AA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AAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;QACnC,kBAAkB,CACd,CAAC,EACD,QAAQ,CACJ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit Tests for Advanced Activation Layers.\n */\n\nimport {ones, Tensor, tensor1d, tensor2d, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\ndescribeMathCPU('ReLU: Symbolic', () => {\n it('Correct output shape', () => {\n const layer = tfl.layers.reLU({});\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.reLU({maxValue: 28});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.reLU(tsConfig);\n expect(layerPrime.getConfig().maxValue).toEqual(28);\n });\n});\n\ndescribeMathCPUAndGPU('ReLU: Tensor', () => {\n it('No maxValue', () => {\n const layer = tfl.layers.reLU();\n const x = tensor2d([[-100, -200], [0, 300], [200, 200]]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor2d([[0, 0], [0, 300], [200, 200]]));\n });\n\n it('Finite maxValue', () => {\n const layer = tfl.layers.reLU({maxValue: 250});\n const x = tensor1d([-100, -200, 0, 300, 200, 200]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor1d([0, 0, 0, 250, 200, 200]));\n });\n});\n\ndescribeMathCPU('PReLU: Symbolic', () => {\n it('Correct output shape: no-arg constructor', () => {\n const layer = tfl.layers.prelu();\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n\n it('Correct output shape: constructor with arg', () => {\n const layer = tfl.layers.prelu({});\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n\n it('Serialization round trip', () => {\n const layer =\n tfl.layers.prelu({alphaInitializer: 'ones', sharedAxes: [1, 2]});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.prelu(tsConfig);\n expect(layerPrime.getConfig().sharedAxes).toEqual([1, 2]);\n });\n});\n\ndescribeMathCPUAndGPU('PReLU: Tensor', () => {\n it('Forward pass', () => {\n const layer = tfl.layers.prelu({alphaInitializer: 'ones'});\n const x = tensor2d([[-100, -200], [0, 300], [200, 200]]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor2d([[-100, -200], [0, 300], [200, 200]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Dense(\n // 3, kernel_initializer='ones', input_shape=[4]))\n // model.add(keras.layers.PReLU(alpha_initializer='ones'))\n // model.add(keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(optimizer='sgd', loss='mean_squared_error')\n //\n // xs = -np.ones([2, 4])\n // ys = np.zeros([2, 1])\n // history = model.fit(xs, ys, batch_size=2, epochs=3)\n // print(history.history)\n // print(model.get_weights()[2])\n // ```\n it('Training: no sharedAxes', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 3, kernelInitializer: 'ones', inputShape: [4]}));\n model.add(tfl.layers.prelu({alphaInitializer: 'ones'}));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n\n const xs = ones([2, 4]).neg();\n const ys = zeros([2, 1]);\n const history = await model.fit(xs, ys, {batchSize: 2, epochs: 3});\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(144);\n expect(history.history.loss[1]).toBeCloseTo(0.051329);\n expect(history.history.loss[2]).toBeCloseTo(0.049144);\n expectTensorsClose(\n model.getWeights()[2], tensor1d([0.0410104, 0.0410104, 0.0410104]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Dense(\n // 3, kernel_initializer='ones', input_shape=[2, 2]))\n // model.add(keras.layers.PReLU(alpha_initializer='ones', shared_axes=[1]))\n // model.add(keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(optimizer='sgd', loss='mean_squared_error')\n //\n // xs = -np.ones([2, 2, 2])\n // ys = np.zeros([2, 2, 1])\n // history = model.fit(xs, ys, batch_size=2, epochs=3)\n // print(history.history)\n // print(model.get_weights()[2])\n // ```\n it('Training, with sharedAxes', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 3, kernelInitializer: 'ones', inputShape: [2, 2]}));\n model.add(tfl.layers.prelu({alphaInitializer: 'ones', sharedAxes: [1]}));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n\n const xs = ones([2, 2, 2]).neg();\n const ys = zeros([2, 2, 1]);\n const history = await model.fit(xs, ys, {batchSize: 2, epochs: 3});\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(36);\n expect(history.history.loss[1]).toBeCloseTo(7.408153);\n expect(history.history.loss[2]).toBeCloseTo(4.190359);\n expectTensorsClose(\n model.getWeights()[2], tensor2d([[0.648351, 0.648351, 0.648351]]));\n });\n});\n\ndescribeMathCPU('leakyReLU: Symbolic', () => {\n it('Correct output shape', () => {\n const layer = tfl.layers.leakyReLU({alpha: 0.1});\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n});\n\ndescribeMathCPUAndGPU('leakyReLU: Tensor', () => {\n it('alpha = default 0.3', () => {\n const layer = tfl.layers.leakyReLU();\n const x = tensor2d([[-1, -2], [0, 3]], [2, 2]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor2d([[-0.3, -0.6], [0, 3]], [2, 2]));\n });\n\n it('alpha = 0.1', () => {\n const layer = tfl.layers.leakyReLU({alpha: 0.1});\n const x = tensor2d([[-1, -2], [0, 3]], [2, 2]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor2d([[-0.1, -0.2], [0, 3]], [2, 2]));\n });\n});\n\ndescribeMathCPU('elu: Symbolic', () => {\n it('Correct output shape', () => {\n const layer = tfl.layers.elu();\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n});\n\ndescribeMathCPUAndGPU('elu: Tensor', () => {\n it('alpha = default 1.0', () => {\n const layer = tfl.layers.elu({});\n const x = tensor2d([[-1, -2], [0, 3]], [2, 2]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(\n y, tensor2d([[Math.exp(-1) - 1, Math.exp(-2) - 1], [0, 3]], [2, 2]));\n });\n});\n\ndescribeMathCPU('thresholdedReLU: Symbolic', () => {\n it('Correct output shape', () => {\n const layer = tfl.layers.thresholdedReLU();\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n});\n\ndescribeMathCPUAndGPU('thresholdedReLU: Tensor', () => {\n it('theta = default 1.0', () => {\n const layer = tfl.layers.thresholdedReLU({});\n const x = tensor2d([[-1, 0], [1, 3]], [2, 2]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(y, tensor2d([[0, 0], [0, 3]], [2, 2]));\n });\n});\n\ndescribeMathCPU('softmax: Symbolic', () => {\n const axisValues = [0, 1, 2, -1, null];\n for (const axis of axisValues) {\n it(`Correct output shape, axis=${axis}`, () => {\n const layer = tfl.layers.softmax({axis});\n const x = new tfl.SymbolicTensor('float32', [2, 3, 4], null, null, null);\n const y = layer.apply(x) as tfl.SymbolicTensor;\n expect(y.shape).toEqual(x.shape);\n });\n }\n});\n\ndescribeMathCPUAndGPU('softmax: Tensor', () => {\n it('theta = default 1.0', () => {\n const layer = tfl.layers.softmax({});\n const x = tensor2d([[0, 1], [5, 5]], [2, 2]);\n const y = layer.apply(x) as Tensor;\n expectTensorsClose(\n y,\n tensor2d(\n [[1 / (1 + Math.E), Math.E / (1 + Math.E)], [0.5, 0.5]], [2, 2]));\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-layers/dist/layers/advanced_activations.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts deleted file mode 100644 index 7c8962cc2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Advanced activation layers. - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint } from '../constraints'; -import { Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { Shape } from '../keras_format/common'; -import { Regularizer } from '../regularizers'; -import { Kwargs } from '../types'; -export declare interface ReLULayerArgs extends LayerArgs { - /** - * Float, the maximum output value. - */ - maxValue?: number; -} -export declare class ReLU extends Layer { - /** @nocollapse */ - static className: string; - maxValue: number; - constructor(args?: ReLULayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare interface LeakyReLULayerArgs extends LayerArgs { - /** - * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`. - */ - alpha?: number; -} -export declare class LeakyReLU extends Layer { - /** @nocollapse */ - static className: string; - readonly alpha: number; - readonly DEFAULT_ALPHA = 0.3; - constructor(args?: LeakyReLULayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare interface PReLULayerArgs extends LayerArgs { - /** - * Initializer for the learnable alpha. - */ - alphaInitializer?: Initializer | InitializerIdentifier; - /** - * Regularizer for the learnable alpha. - */ - alphaRegularizer?: Regularizer; - /** - * Constraint for the learnable alpha. - */ - alphaConstraint?: Constraint; - /** - * The axes along which to share learnable parameters for the activation - * function. For example, if the incoming feature maps are from a 2D - * convolution with output shape `[numExamples, height, width, channels]`, - * and you wish to share parameters across space (height and width) so that - * each filter channels has only one set of parameters, set - * `shared_axes: [1, 2]`. - */ - sharedAxes?: number | number[]; -} -export declare class PReLU extends Layer { - /** @nocollapse */ - static className: string; - private readonly alphaInitializer; - private readonly alphaRegularizer; - private readonly alphaConstraint; - private readonly sharedAxes; - private alpha; - readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier; - constructor(args?: PReLULayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface ELULayerArgs extends LayerArgs { - /** - * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`. - */ - alpha?: number; -} -export declare class ELU extends Layer { - /** @nocollapse */ - static className: string; - readonly alpha: number; - readonly DEFAULT_ALPHA = 1; - constructor(args?: ELULayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare interface ThresholdedReLULayerArgs extends LayerArgs { - /** - * Float >= 0. Threshold location of activation. - */ - theta?: number; -} -export declare class ThresholdedReLU extends Layer { - /** @nocollapse */ - static className: string; - readonly theta: number; - readonly DEFAULT_THETA = 1; - constructor(args?: ThresholdedReLULayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare interface SoftmaxLayerArgs extends LayerArgs { - /** - * Integer, axis along which the softmax normalization is applied. - * Defaults to `-1` (i.e., the last axis). - */ - axis?: number; -} -export declare class Softmax extends Layer { - /** @nocollapse */ - static className: string; - readonly axis: number; - readonly softmax: (t: Tensor, a?: number) => Tensor; - readonly DEFAULT_AXIS = 1; - constructor(args?: SoftmaxLayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js deleted file mode 100644 index 632b0df08..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Advanced activation layers. - */ -import { clipByValue, elu, leakyRelu, prelu, relu, serialization } from '@tensorflow/tfjs-core'; -import { Softmax as softmaxActivation } from '../activations'; -import { cast } from '../backend/tfjs_backend'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { InputSpec, Layer } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -export class ReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maxValue = args.maxValue; - } - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - let output = relu(inputs); - if (this.maxValue != null) { - output = clipByValue(output, 0, this.maxValue); - } - return output; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { maxValue: this.maxValue }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ReLU.className = 'ReLU'; -serialization.registerClass(ReLU); -export class LeakyReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 0.3; - if (args == null) { - args = {}; - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return leakyRelu(x, this.alpha); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -LeakyReLU.className = 'LeakyReLU'; -serialization.registerClass(LeakyReLU); -export class PReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA_INITIALIZER = 'zeros'; - if (args == null) { - args = {}; - } - this.supportsMasking = true; - this.alphaInitializer = - getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); - this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - this.sharedAxes = null; - } - else if (Array.isArray(args.sharedAxes)) { - this.sharedAxes = args.sharedAxes; - } - else if (typeof args.sharedAxes === 'number') { - this.sharedAxes = [args.sharedAxes]; - } - else { - throw new ValueError(`Expected sharedAxes to be a number or an array of numbers, ` + - `but got ${args.sharedAxes}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const paramShape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (const i of this.sharedAxes) { - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight('alpha', paramShape, 'float32', this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - const axes = {}; - if (this.sharedAxes != null) { - for (let i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes, - })]; - this.built = true; - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - return prelu(inputs, this.alpha.read()); - } - getConfig() { - const config = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -PReLU.className = 'PReLU'; -serialization.registerClass(PReLU); -export class ELU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 1.0; - if (args == null) { - args = {}; - } - if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) { - throw new NotImplementedError(`Non-default alpha value (${args.alpha}) is not supported by the ` + - `ELU layer yet.`); - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return elu(x); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ELU.className = 'ELU'; -serialization.registerClass(ELU); -export class ThresholdedReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_THETA = 1.0; - if (args == null) { - args = {}; - } - this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return x.mul(cast(x.greater(this.theta), 'float32')); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { theta: this.theta }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ThresholdedReLU.className = 'ThresholdedReLU'; -serialization.registerClass(ThresholdedReLU); -export class Softmax extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_AXIS = 1.0; - if (args == null) { - args = {}; - } - this.softmax = new softmaxActivation().apply; - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { axis: this.axis }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Softmax.className = 'Softmax'; -serialization.registerClass(Softmax); -//# sourceMappingURL=advanced_activations.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-layers/dist/layers/advanced_activations.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map deleted file mode 100644 index a52e755d8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"advanced_activations.js","sourceRoot":"","sources":["../../src/layers/advanced_activations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAEtG,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAa,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAC,SAAS,EAAE,KAAK,EAAY,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAsC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAAC,cAAc,EAAe,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAU7E,MAAM,OAAO,IAAK,SAAQ,KAAK;IAK7B,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,I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ACpC,CAAC;IAED,kBAAkB,CAAC,UAAyB;QAC1C,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAA6B,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC;QAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;;AA7BD,kBAAkB;AACX,iBAAS,GAAG,SAAS,CAAC;AA8B/B,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts deleted file mode 100644 index 4ad3393bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts +++ /dev/null @@ -1,401 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { fused, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Activation } from '../activations'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { InputSpec, Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { ActivationIdentifier } from '../keras_format/activation_config'; -import { DataFormat, InterpolationFormat, PaddingMode, Shape } from '../keras_format/common'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs } from '../types'; -import { LayerVariable } from '../variables'; -/** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ -export declare function preprocessConv2DInput(x: Tensor, dataFormat: DataFormat): Tensor; -/** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ -export declare function preprocessConv3DInput(x: Tensor, dataFormat: DataFormat): Tensor; -/** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export declare function conv1dWithBias(x: Tensor, kernel: Tensor, bias: Tensor, strides?: number, padding?: string, dataFormat?: DataFormat, dilationRate?: number): Tensor; -/** - * 1D-convolution. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export declare function conv1d(x: Tensor, kernel: Tensor, strides?: number, padding?: string, dataFormat?: DataFormat, dilationRate?: number): Tensor; -/** - * 2D Convolution - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 2D pooling. - */ -export declare function conv2d(x: Tensor, kernel: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor; -/** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ -export declare function conv2dWithBiasActivation(x: Tensor, kernel: Tensor, bias: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number], activation?: fused.Activation): Tensor; -/** - * 3D Convolution. - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 3D convolution. - */ -export declare function conv3d(x: Tensor, kernel: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor; -/** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ -export declare function conv3dWithBias(x: Tensor, kernel: Tensor, bias: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor; -/** - * Base LayerConfig for depthwise and non-depthwise convolutional layers. - */ -export declare interface BaseConvLayerArgs extends LayerArgs { - /** - * The dimensions of the convolution window. If kernelSize is a number, the - * convolutional window will be square. - */ - kernelSize: number | number[]; - /** - * The strides of the convolution in each dimension. If strides is a number, - * strides in both dimensions are equal. - * - * Specifying any stride value != 1 is incompatible with specifying any - * `dilationRate` value != 1. - */ - strides?: number | number[]; - /** - * Padding mode. - */ - padding?: PaddingMode; - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape `(batch, channels, - * ...)`. - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; - /** - * The dilation rate to use for the dilated convolution in each dimension. - * Should be an integer or array of two or three integers. - * - * Currently, specifying any `dilationRate` value != 1 is incompatible with - * specifying any `strides` value != 1. - */ - dilationRate?: number | [number] | [number, number] | [number, number, number]; - /** - * Activation function of the layer. - * - * If you don't specify the activation, none is applied. - */ - activation?: ActivationIdentifier; - /** - * Whether the layer uses a bias vector. Defaults to `true`. - */ - useBias?: boolean; - /** - * Initializer for the convolutional kernel weights matrix. - */ - kernelInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier | Initializer; - /** - * Constraint for the convolutional kernel weights. - */ - kernelConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint for the bias vector. - */ - biasConstraint?: ConstraintIdentifier | Constraint; - /** - * Regularizer function applied to the kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier | Regularizer; -} -/** - * LayerConfig for non-depthwise convolutional layers. - * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D, - * Conv3D). - */ -export declare interface ConvLayerArgs extends BaseConvLayerArgs { - /** - * The dimensionality of the output space (i.e. the number of filters in the - * convolution). - */ - filters: number; -} -/** - * Abstract convolution layer. - */ -export declare abstract class BaseConv extends Layer { - protected readonly rank: number; - protected readonly kernelSize: number[]; - protected readonly strides: number[]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - protected readonly activation: Activation; - protected readonly useBias: boolean; - protected readonly dilationRate: number[]; - protected readonly biasInitializer?: Initializer; - protected readonly biasConstraint?: Constraint; - protected readonly biasRegularizer?: Regularizer; - protected bias: LayerVariable; - readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; - constructor(rank: number, args: BaseConvLayerArgs); - protected static verifyArgs(args: BaseConvLayerArgs): void; - getConfig(): serialization.ConfigDict; -} -/** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ -export declare abstract class Conv extends BaseConv { - protected readonly filters: number; - protected kernel: LayerVariable; - protected readonly kernelInitializer?: Initializer; - protected readonly kernelConstraint?: Constraint; - protected readonly kernelRegularizer?: Regularizer; - constructor(rank: number, args: ConvLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; - protected static verifyArgs(args: ConvLayerArgs): void; -} -export declare class Conv2D extends Conv { - /** @nocollapse */ - static className: string; - constructor(args: ConvLayerArgs); - getConfig(): serialization.ConfigDict; - protected static verifyArgs(args: ConvLayerArgs): void; -} -export declare class Conv3D extends Conv { - /** @nocollapse */ - static className: string; - constructor(args: ConvLayerArgs); - getConfig(): serialization.ConfigDict; - protected static verifyArgs(args: ConvLayerArgs): void; -} -export declare class Conv2DTranspose extends Conv2D { - /** @nocollapse */ - static className: string; - inputSpec: InputSpec[]; - constructor(args: ConvLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare class Conv3DTranspose extends Conv3D { - /** @nocollapse */ - static className: string; - inputSpec: InputSpec[]; - constructor(args: ConvLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} -export declare interface SeparableConvLayerArgs extends ConvLayerArgs { - /** - * The number of depthwise convolution output channels for each input - * channel. - * The total number of depthwise convolution output channels will be equal - * to `filtersIn * depthMultiplier`. Default: 1. - */ - depthMultiplier?: number; - /** - * Initializer for the depthwise kernel matrix. - */ - depthwiseInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the pointwise kernel matrix. - */ - pointwiseInitializer?: InitializerIdentifier | Initializer; - /** - * Regularizer function applied to the depthwise kernel matrix. - */ - depthwiseRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the pointwise kernel matrix. - */ - pointwiseRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Constraint function applied to the depthwise kernel matrix. - */ - depthwiseConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint function applied to the pointwise kernel matrix. - */ - pointwiseConstraint?: ConstraintIdentifier | Constraint; -} -export declare class SeparableConv extends Conv { - /** @nocollapse */ - static className: string; - readonly depthMultiplier: number; - protected readonly depthwiseInitializer?: Initializer; - protected readonly depthwiseRegularizer?: Regularizer; - protected readonly depthwiseConstraint?: Constraint; - protected readonly pointwiseInitializer?: Initializer; - protected readonly pointwiseRegularizer?: Regularizer; - protected readonly pointwiseConstraint?: Constraint; - readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier; - readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier; - protected depthwiseKernel: LayerVariable; - protected pointwiseKernel: LayerVariable; - constructor(rank: number, config?: SeparableConvLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class SeparableConv2D extends SeparableConv { - /** @nocollapse */ - static className: string; - constructor(args?: SeparableConvLayerArgs); -} -export declare class Conv1D extends Conv { - /** @nocollapse */ - static className: string; - constructor(args: ConvLayerArgs); - getConfig(): serialization.ConfigDict; - protected static verifyArgs(args: ConvLayerArgs): void; -} -export declare interface Cropping2DLayerArgs extends LayerArgs { - /** - * Dimension of the cropping along the width and the height. - * - If integer: the same symmetric cropping - * is applied to width and height. - * - If list of 2 integers: - * interpreted as two different - * symmetric cropping values for height and width: - * `[symmetric_height_crop, symmetric_width_crop]`. - * - If a list of 2 list of 2 integers: - * interpreted as - * `[[top_crop, bottom_crop], [left_crop, right_crop]]` - */ - cropping: number | [number, number] | [[number, number], [number, number]]; - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape - * `(batch, channels, ...)` - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; -} -export declare class Cropping2D extends Layer { - /** @nocollapse */ - static className: string; - protected readonly cropping: [[number, number], [number, number]]; - protected readonly dataFormat: DataFormat; - constructor(args: Cropping2DLayerArgs); - computeOutputShape(inputShape: Shape): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface UpSampling2DLayerArgs extends LayerArgs { - /** - * The upsampling factors for rows and columns. - * - * Defaults to `[2, 2]`. - */ - size?: number[]; - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `"channelsLast"` corresponds to inputs with shape - * `[batch, ..., channels]` - * - * `"channelsFirst"` corresponds to inputs with shape `[batch, channels, - * ...]`. - * - * Defaults to `"channelsLast"`. - */ - dataFormat?: DataFormat; - /** - * The interpolation mechanism, one of `"nearest"` or `"bilinear"`, default - * to `"nearest"`. - */ - interpolation?: InterpolationFormat; -} -export declare class UpSampling2D extends Layer { - /** @nocollapse */ - static className: string; - protected readonly DEFAULT_SIZE: number[]; - protected readonly size: number[]; - protected readonly dataFormat: DataFormat; - protected readonly interpolation: InterpolationFormat; - constructor(args: UpSampling2DLayerArgs); - computeOutputShape(inputShape: Shape): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js deleted file mode 100644 index 657b82731..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js +++ /dev/null @@ -1,973 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Convolutional Layers - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import { getActivation, serializeActivation } from '../activations'; -import { imageDataFormat } from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import { checkDataFormat, checkInterpolationFormat, checkPaddingMode } from '../common'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { InputSpec, Layer } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import { convOutputLength, deconvLength, normalizeArray } from '../utils/conv_utils'; -import * as generic_utils from '../utils/generic_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -/** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ -export function preprocessConv2DInput(x, dataFormat) { - // TODO(cais): Cast type to float32 if not. - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } - else { - return x; - } - }); -} -/** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ -export function preprocessConv3DInput(x, dataFormat) { - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } - else { - return x; - } - }); -} -/** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export function conv1dWithBias(x, kernel, bias, strides = 1, padding = 'valid', dataFormat, dilationRate = 1) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError(`The input of a conv1dWithBias operation should be 3, but is ` + - `${x.shape.length} instead.`); - } - if (kernel.shape.length !== 3) { - throw new ValueError(`The kernel for a conv1dWithBias operation should be 3, but is ` + - `${kernel.shape.length} instead`); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError(`The bias for a conv1dWithBias operation should be 1, but is ` + - `${kernel.shape.length} instead`); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - let y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = K.biasAdd(y, bias); - } - return y; - }); -} -/** - * 1D-convolution. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export function conv1d(x, kernel, strides = 1, padding = 'valid', dataFormat, dilationRate = 1) { - return tidy(() => { - checkDataFormat(dataFormat); - return conv1dWithBias(x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} -/** - * 2D Convolution - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 2D pooling. - */ -export function conv2d(x, kernel, strides = [1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - checkDataFormat(dataFormat); - return conv2dWithBiasActivation(x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} -/** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ -export function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = 'valid', dataFormat, dilationRate, activation = null) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects input to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - let y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.fused.conv2d({ - x: y, - filter: kernel, - strides: strides, - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias, - activation - }); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} -/** - * 3D Convolution. - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 3D convolution. - */ -export function conv3d(x, kernel, strides = [1, 1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - checkDataFormat(dataFormat); - return conv3dWithBias(x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} -/** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ -export function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError(`conv3dWithBias expects input to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - let y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.conv3d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = K.biasAdd(y, bias); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); - } - return y; - }); -} -/** - * Abstract convolution layer. - */ -export class BaseConv extends Layer { - constructor(rank, args) { - super(args); - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - BaseConv.verifyArgs(args); - this.rank = rank; - generic_utils.assertPositiveInteger(this.rank, 'rank'); - if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) { - throw new NotImplementedError(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is ` + - `not implemented yet.`); - } - this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - this.strides = normalizeArray(args.strides == null ? 1 : args.strides, rank, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.activation = getActivation(args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.biasConstraint = getConstraint(args.biasConstraint); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.dilationRate = normalizeArray(args.dilationRate == null ? 1 : args.dilationRate, rank, 'dilationRate'); - if (this.rank === 1 && - (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) { - throw new ValueError(`dilationRate must be a number or an array of a single number ` + - `for 1D convolution, but received ` + - `${JSON.stringify(this.dilationRate)}`); - } - else if (this.rank === 2) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = [this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 2) { - throw new ValueError(`dilationRate must be a number or array of two numbers for 2D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - else if (this.rank === 3) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = - [this.dilationRate, this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 3) { - throw new ValueError(`dilationRate must be a number or array of three numbers for 3D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - } - static verifyArgs(args) { - // Check config.kernelSize type and shape. - generic_utils.assert('kernelSize' in args, `required key 'kernelSize' not in config`); - if (typeof args.kernelSize !== 'number' && - !generic_utils.checkArrayTypeAndLength(args.kernelSize, 'number', 1, 3)) { - throw new ValueError(`BaseConv expects config.kernelSize to be number or number[] with ` + - `length 1, 2, or 3, but received ${JSON.stringify(args.kernelSize)}.`); - } - } - getConfig() { - const config = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ -export class Conv extends BaseConv { - constructor(rank, args) { - super(rank, args); - this.kernel = null; - Conv.verifyArgs(args); - this.filters = args.filters; - generic_utils.assertPositiveInteger(this.filters, 'filters'); - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([inputDim, this.filters]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.inputSpec = [{ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } }]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs; - const biasValue = this.bias == null ? null : this.bias.read(); - const fusedActivationName = generic_utils.mapActivationToFusedKernel(this.activation.getClassName()); - if (fusedActivationName != null && this.rank === 2) { - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate, fusedActivationName); - } - else { - if (this.rank === 1) { - outputs = conv1dWithBias(inputs, this.kernel.read(), biasValue, this.strides[0], this.padding, this.dataFormat, this.dilationRate[0]); - } - else if (this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else if (this.rank === 3) { - outputs = conv3dWithBias(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else { - throw new NotImplementedError('convolutions greater than 3D are not implemented yet.'); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const newSpace = []; - const space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (let i = 0; i < space.length; ++i) { - const newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - let outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } - else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - } - getConfig() { - const config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - static verifyArgs(args) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError(`Convolution layer expected config.filters to be a 'number' > 0 ` + - `but got ${JSON.stringify(args.filters)}`); - } - } -} -export class Conv2D extends Conv { - constructor(args) { - super(2, args); - Conv2D.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !generic_utils.checkArrayTypeAndLength(args.kernelSize, 'number', 1, 2)) { - throw new ValueError(`Conv2D expects config.kernelSize to be number or number[] with ` + - `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -/** @nocollapse */ -Conv2D.className = 'Conv2D'; -serialization.registerClass(Conv2D); -export class Conv3D extends Conv { - constructor(args) { - super(3, args); - Conv3D.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError(`Conv3D expects config.kernelSize to be number or` + - ` [number, number, number], but received ${JSON.stringify(args.kernelSize)}.`); - } - } - } -} -/** @nocollapse */ -Conv3D.className = 'Conv3D'; -serialization.registerClass(Conv3D); -export class Conv2DTranspose extends Conv2D { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv2DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 4) { - throw new ValueError('Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 4, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - if (this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } - else { - hAxis = 1; - wAxis = 2; - } - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - // Infer the dynamic output shape. - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - const outputShape = [batchSize, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 1]); - } - let outputs = tfc.conv2dTranspose(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 3, 1, 2]); - } - if (this.bias != null) { - outputs = - K.biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -/** @nocollapse */ -Conv2DTranspose.className = 'Conv2DTranspose'; -serialization.registerClass(Conv2DTranspose); -export class Conv3DTranspose extends Conv3D { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv3DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 5) { - throw new ValueError('Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 5, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - let dAxis; - if (this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } - else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - const depth = inputShape[dAxis]; - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - // Infer the dynamic output shape. - const outDepth = deconvLength(depth, strideD, kernelD, this.padding); - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Same as `conv2dTranspose`. We always assumes channelsLast. - const outputShape = [batchSize, outDepth, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 4, 1]); - } - let outputs = tfc.conv3dTranspose(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]); - } - if (this.bias !== null) { - outputs = - K.biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation !== null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let depthAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } - else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -/** @nocollapse */ -Conv3DTranspose.className = 'Conv3DTranspose'; -serialization.registerClass(Conv3DTranspose); -export class SeparableConv extends Conv { - constructor(rank, config) { - super(rank, config); - this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; - this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; - this.depthwiseKernel = null; - this.pointwiseKernel = null; - if (config.filters == null) { - throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError(`SeparableConv${this.rank}D supports only padding modes: ` + - `'same' and 'valid', but received ${JSON.stringify(config.padding)}`); - } - this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); - this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); - this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError(`Inputs to SeparableConv${this.rank}D should have rank ` + - `${this.rank + 2}, but received input shape: ` + - `${JSON.stringify(inputShape)}`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError(`The channel dimension of the inputs should be defined, ` + - `but found ${JSON.stringify(inputShape[channelAxis])}`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); - const pointwiseKernelShape = []; - for (let i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - const trainable = true; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); - } - else { - this.bias = null; - } - this.inputSpec = - [new InputSpec({ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let output; - if (this.rank === 1) { - throw new NotImplementedError('1D separable convolution is not implemented yet.'); - } - else if (this.rank === 2) { - if (this.dataFormat === 'channelsFirst') { - inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - output = tfc.separableConv2d(inputs, this.depthwiseKernel.read(), this.pointwiseKernel.read(), this.strides, this.padding, this.dilationRate, 'NHWC'); - } - if (this.useBias) { - output = K.biasAdd(output, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - if (this.dataFormat === 'channelsFirst') { - output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - } -} -/** @nocollapse */ -SeparableConv.className = 'SeparableConv'; -export class SeparableConv2D extends SeparableConv { - constructor(args) { - super(2, args); - } -} -/** @nocollapse */ -SeparableConv2D.className = 'SeparableConv2D'; -serialization.registerClass(SeparableConv2D); -export class Conv1D extends Conv { - constructor(args) { - super(1, args); - Conv1D.verifyArgs(args); - this.inputSpec = [{ ndim: 3 }]; - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['dataFormat']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !generic_utils.checkArrayTypeAndLength(args.kernelSize, 'number', 1, 1)) { - throw new ValueError(`Conv1D expects config.kernelSize to be number or number[] with ` + - `length 1, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -/** @nocollapse */ -Conv1D.className = 'Conv1D'; -serialization.registerClass(Conv1D); -export class Cropping2D extends Layer { - constructor(args) { - super(args); - if (typeof args.cropping === 'number') { - this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } - else if (typeof args.cropping[0] === 'number') { - this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1], args.cropping[1]] - ]; - } - else { - this.cropping = args.cropping; - } - this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - this.inputSpec = [{ ndim: 4 }]; - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } - else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - const hSliced = K.sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2); - return K.sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3); - } - else { - const hSliced = K.sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3); - return K.sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4); - } - }); - } - getConfig() { - const config = { cropping: this.cropping, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Cropping2D.className = 'Cropping2D'; -serialization.registerClass(Cropping2D); -export class UpSampling2D extends Layer { - constructor(args) { - super(args); - this.DEFAULT_SIZE = [2, 2]; - this.inputSpec = [{ ndim: 4 }]; - this.size = args.size == null ? this.DEFAULT_SIZE : args.size; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(this.interpolation); - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - const height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; - const width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } - else { - const height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; - const width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - if (this.dataFormat === 'channelsFirst') { - input = tfc.transpose(input, [0, 2, 3, 1]); - const height = this.size[0] * inputShape[2]; - const width = this.size[1] * inputShape[3]; - const resized = this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return tfc.transpose(resized, [0, 3, 1, 2]); - } - else { - const height = this.size[0] * inputShape[1]; - const width = this.size[1] * inputShape[2]; - return this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - } - getConfig() { - const config = { size: this.size, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -UpSampling2D.className = 'UpSampling2D'; -serialization.registerClass(UpSampling2D); -//# sourceMappingURL=convolutional.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-layers/dist/layers/convolutional.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map deleted file mode 100644 index 46d497502..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional.js","sourceRoot":"","sources":["../../src/layers/convolutional.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAA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I,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC3C,OAAO,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC;oBACrC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC9C,KAAK,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;;AA9DD,kBAAkB;AACX,sBAAS,GAAG,cAAc,CAAC;AA+DpC,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.d.ts deleted file mode 100644 index 2fd85ab9d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { DataFormat, Shape } from '../keras_format/common'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs } from '../types'; -import { BaseConv, BaseConvLayerArgs } from './convolutional'; -/** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ -export declare function depthwiseConv2d(x: Tensor, depthwiseKernel: Tensor, strides?: [number, number], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor; -export declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs { - /** - * An integer or Array of 2 integers, specifying the width and height of the - * 2D convolution window. Can be a single integer to specify the same value - * for all spatial dimensions. - */ - kernelSize: number | [number, number]; - /** - * The number of depthwise convolution output channels for each input - * channel. - * The total number of depthwise convolution output channels will be equal to - * `filtersIn * depthMultiplier`. - * Default: 1. - */ - depthMultiplier?: number; - /** - * Initializer for the depthwise kernel matrix. - * Default: GlorotNormal. - */ - depthwiseInitializer?: InitializerIdentifier | Initializer; - /** - * Constraint for the depthwise kernel matrix. - */ - depthwiseConstraint?: ConstraintIdentifier | Constraint; - /** - * Regulzarizer function for the depthwise kernel matrix. - */ - depthwiseRegularizer?: RegularizerIdentifier | Regularizer; -} -export declare class DepthwiseConv2D extends BaseConv { - /** @nocollapse */ - static className: string; - private readonly depthMultiplier; - private readonly depthwiseInitializer; - private readonly depthwiseConstraint; - private readonly depthwiseRegularizer; - private depthwiseKernel; - constructor(args: DepthwiseConv2DLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js deleted file mode 100644 index fff5db0c7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Depthwise Convolutional Layers - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import { imageDataFormat } from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import { checkDataFormat } from '../common'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import { convOutputLength } from '../utils/conv_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -import { BaseConv, preprocessConv2DInput } from './convolutional'; -/** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ -export function depthwiseConv2d(x, depthwiseKernel, strides = [1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - let y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError(`Input for depthwiseConv2d is required to be 4-D, but is instead ` + - `${x.rank}-D`); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError(`depthwiseKernel is required to be 4-D, but is instead ` + - `${depthwiseKernel.rank}-D`); - } - y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} -export class DepthwiseConv2D extends BaseConv { - constructor(args) { - super(2, args); - this.depthwiseKernel = null; - this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - this.depthwiseInitializer = getInitializer(args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError(`Inputs to DepthwiseConv2D should have rank 4. ` + - `Received input shape: ${JSON.stringify(inputShape)}.`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + - `be defined, but is not (${inputShape[channelAxis]}).`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs = depthwiseConv2d(inputs, this.depthwiseKernel.read(), this.strides, this.padding, this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (this.useBias) { - outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - const cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - const outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - const outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); - const outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } - else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - } - getConfig() { - const config = super.getConfig(); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - } -} -/** @nocollapse */ -DepthwiseConv2D.className = 'DepthwiseConv2D'; -serialization.registerClass(DepthwiseConv2D); -//# sourceMappingURL=convolutional_depthwise.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-layers/dist/layers/convolutional_depthwise.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map deleted file mode 100644 index a3556cfee..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_depthwise.js","sourceRoot":"","sources":["../../src/layers/convolutional_depthwise.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH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,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,gBAAgB,CAC5B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,IAAI,IAAI,CAAC,UAAU,KAAK,eAAe,EAAE;YACvC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SACtD;aAAM;YACL,uCAAuC;YACvC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;SACtD;IACH,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;QACjD,MAAM,CAAC,sBAAsB,CAAC;YAC1B,oBAAoB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACpD,MAAM,CAAC,sBAAsB,CAAC;YAC1B,oBAAoB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACpD,MAAM,CAAC,qBAAqB,CAAC;YACzB,mBAAmB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAnGD,kBAAkB;AACX,yBAAS,GAAG,iBAAiB,CAAC;AAoGvC,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map deleted file mode 100644 index af136e5d0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_depthwise_test.js","sourceRoot":"","sources":["../../src/layers/convolutional_depthwise_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAS,QAAQ,EAAW,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,qBAAqB,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC5C,MAAM,SAAS,GAAG,CAAC,CAAC;gBAClB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAA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,CAAC;YACf,UAAU,EAAE,cAAc;YAC1B,OAAO,EAAE,KAAK;YACd,oBAAoB,EAAE,MAAM;YAC5B,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;QACzC,MAAM,SAAS,GACX,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzE,kBAAkB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,kCAAkC;QAClC,MAAM,CAAC,CAAC,OAAU,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,EAAS,CAAC,CAAC;aACxD,YAAY,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM;QACF,kCAAkC;QAClC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,EAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAQ,CAAC,CAAC;aAC1D,YAAY,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for convolutional_depthwise.ts.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tensor4d, Tensor4D} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {InitializerIdentifier} from '../initializers';\nimport {DataFormat, PaddingMode} from '../keras_format/common';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {depthwiseConv2d} from './convolutional_depthwise';\n\ndescribeMathCPUAndGPU('depthwiseConv2d', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const paddingModes: PaddingMode[] = [undefined, 'same', 'valid'];\n const stridesArray = [1, 2];\n const depthMultipliers = [1, 2];\n\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n for (const stride of stridesArray) {\n for (const depthMultiplier of depthMultipliers) {\n const testTitle = `stride=${stride}, ${paddingMode}, ` +\n `${dataFormat}, depthMultiplier=${depthMultiplier}`;\n it(testTitle, () => {\n let x: Tensor = tensor4d(x4by4Data, [1, 1, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n let kernel: Tensor4D;\n if (depthMultiplier === 1) {\n kernel = tensor4d([1, 0, 0, -1], [2, 2, 1, 1]);\n } else if (depthMultiplier === 2) {\n // Two kernels of the same absolute values but opposite signs:\n // [[1, 0], [0, -1]] and [[-1, 0], [0, 1]].\n kernel = tensor4d([1, -1, 0, 0, 0, 0, -1, 1], [2, 2, 1, 2]);\n }\n const y = depthwiseConv2d(\n x, kernel, [stride, stride], 'valid', dataFormat);\n\n let yExpected: Tensor;\n if (stride === 1) {\n if (depthMultiplier === 1) {\n yExpected = tensor4d(\n [[[[-30, -30, -30], [50, 90, 130], [30, 30, 30]]]],\n [1, 1, 3, 3]);\n } else if (depthMultiplier === 2) {\n yExpected = tensor4d(\n [[\n [[-30, -30, -30], [50, 90, 130], [30, 30, 30]],\n [[30, 30, 30], [-50, -90, -130], [-30, -30, -30]]\n ]],\n [1, 2, 3, 3]);\n }\n } else if (stride === 2) {\n if (depthMultiplier === 1) {\n yExpected = tensor4d([[[[-30, -30], [30, 30]]]], [1, 1, 2, 2]);\n } else if (depthMultiplier === 2) {\n yExpected = tensor4d(\n [[[[-30, -30], [30, 30]], [[30, 30], [-30, -30]]]],\n [1, 2, 2, 2]);\n }\n }\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 1]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n }\n\n it('Non-4D kernel leads to exception', () => {\n const x = tfc.zeros([1, 1, 4, 4]);\n expect(() => depthwiseConv2d(x, tfc.zeros([1, 2, 2]), [1, 1]))\n .toThrowError(/.* is required to be 4-D, but is instead 3-D/);\n });\n});\n\ndescribeMathCPU('DepthwiseConv2D-Symbolic', () => {\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const kernelSizes: [number, [number, number]] = [2, [2, 2]];\n const depthMultipliers = [1, 3];\n const paddingModes: PaddingMode[] = ['valid', 'same'];\n\n for (const dataFormat of dataFormats) {\n for (const kernelSize of kernelSizes) {\n for (const depthMultiplier of depthMultipliers) {\n for (const padding of paddingModes) {\n const testTitle = `dataFormat=${dataFormat}, ` +\n `kernelSize=${JSON.stringify(kernelSize)}, ` +\n `depthMultiplier=${depthMultiplier}, ` +\n `paddingMode=${padding}`;\n it(testTitle, () => {\n const depthwiseConvLayer = tfl.layers.depthwiseConv2d(\n {dataFormat, kernelSize, depthMultiplier, padding});\n const inputShape = dataFormat === 'channelsFirst' ? [1, 8, 10, 10] :\n [1, 10, 10, 8];\n const symbolicInput =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n const symbolicOutput =\n depthwiseConvLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n const outputImageSize = padding === 'valid' ? 9 : 10;\n let expectedShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape =\n [1, 8 * depthMultiplier, outputImageSize, outputImageSize];\n } else {\n expectedShape =\n [1, outputImageSize, outputImageSize, 8 * depthMultiplier];\n }\n expect(symbolicOutput.shape).toEqual(expectedShape);\n });\n }\n }\n }\n }\n\n it('Non-4D Array Input leads to exception', () => {\n const depthwiseConvLayer = tfl.layers.depthwiseConv2d({kernelSize: 2});\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [1, 10, 10], null, [], null);\n expect(() => depthwiseConvLayer.apply(symbolicInput))\n .toThrowError(\n /Inputs to DepthwiseConv2D should have rank 4\\. Received .*/);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.depthwiseConv2d(\n {kernelSize: 3, depthMultiplier: 4, activation: 'relu'});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.depthwiseConv2d(tsConfig);\n const configPrime = layerPrime.getConfig();\n expect(configPrime.kernelSize).toEqual([3, 3]);\n expect(configPrime.depthMultiplier).toEqual(4);\n expect(configPrime.activation).toEqual('relu');\n });\n});\n\ndescribeMathCPUAndGPU('DepthwiseConv2D-Tensor:', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n\n const depthMultipliers = [1, 2];\n const useBiases = [false];\n const biasInitializers: InitializerIdentifier[] = ['zeros', 'ones'];\n\n for (const depthMultiplier of depthMultipliers) {\n for (const useBias of useBiases) {\n for (const biasInitializer of biasInitializers) {\n const testTitle =\n `channelsFirst, depthMultiplier=${depthMultiplier}, ` +\n `useBias=${useBias}, biasInitializer=${biasInitializer}, ` +\n `activation=relu`;\n it(testTitle, () => {\n const x = tensor4d(x4by4Data, [1, 1, 4, 4]);\n const conv2dLayer = tfl.layers.depthwiseConv2d({\n kernelSize: [2, 2],\n depthMultiplier,\n strides: [2, 2],\n dataFormat: 'channelsFirst',\n useBias,\n depthwiseInitializer: 'ones',\n biasInitializer,\n activation: 'relu'\n });\n const y = conv2dLayer.apply(x) as Tensor;\n\n let yExpectedShape: [number, number, number, number];\n let yExpectedData: number[];\n if (depthMultiplier === 1) {\n yExpectedShape = [1, 1, 2, 2];\n yExpectedData = [100, 260, -100, -260];\n } else if (depthMultiplier === 2) {\n yExpectedShape = [1, 2, 2, 2];\n yExpectedData = [100, 260, -100, -260, 100, 260, -100, -260];\n }\n if (useBias && biasInitializer === 'ones') {\n yExpectedData = yExpectedData.map(element => element + 1);\n }\n // relu.\n yExpectedData =\n yExpectedData.map(element => element >= 0 ? element : 0);\n const yExpected = tensor4d(yExpectedData, yExpectedShape);\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n it('channelsLast', () => {\n // Convert input to channelsLast.\n const x = tfc.transpose(tensor4d(x4by4Data, [1, 1, 4, 4]), [0, 2, 3, 1]);\n const conv2dLayer = tfl.layers.depthwiseConv2d({\n depthMultiplier: 2,\n kernelSize: [2, 2],\n strides: [2, 2],\n dataFormat: 'channelsLast',\n useBias: false,\n depthwiseInitializer: 'ones',\n activation: 'linear'\n });\n const y = conv2dLayer.apply(x) as Tensor;\n const yExpected =\n tensor4d([100, 100, 260, 260, -100, -100, -260, -260], [1, 2, 2, 2]);\n expectTensorsClose(y, yExpected);\n });\n\n it('missing config.kernelSize throws exception', () => {\n // tslint:disable-next-line:no-any\n expect((filters: 1) => tfl.layers.depthwiseConv2d({} as any))\n .toThrowError(/kernelSize/);\n });\n it('bad config.kernelSize throws exception', () => {\n expect(\n // tslint:disable-next-line:no-any\n () => tfl.layers.depthwiseConv2d({kernelSize: [1]} as any))\n .toThrowError(/kernelSize/);\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-layers/dist/layers/convolutional_recurrent.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.d.ts deleted file mode 100644 index 7b234bb38..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { Tensor } from '@tensorflow/tfjs-core'; -import { Activation } from '../activations'; -import { Constraint } from '../constraints'; -import { Initializer } from '../initializers'; -import { DataFormat, PaddingMode, Shape } from '../keras_format/common'; -import { Regularizer } from '../regularizers'; -import { Kwargs } from '../types'; -import { BaseRNNLayerArgs, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, SimpleRNNCellLayerArgs } from './recurrent'; -declare interface ConvRNN2DCellArgs extends Omit { - /** - * The dimensionality of the output space (i.e. the number of filters in the - * convolution). - */ - filters: number; - /** - * The dimensions of the convolution window. If kernelSize is a number, the - * convolutional window will be square. - */ - kernelSize: number | number[]; - /** - * The strides of the convolution in each dimension. If strides is a number, - * strides in both dimensions are equal. - * - * Specifying any stride value != 1 is incompatible with specifying any - * `dilationRate` value != 1. - */ - strides?: number | number[]; - /** - * Padding mode. - */ - padding?: PaddingMode; - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape `(batch, channels, - * ...)`. - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; - /** - * The dilation rate to use for the dilated convolution in each dimension. - * Should be an integer or array of two or three integers. - * - * Currently, specifying any `dilationRate` value != 1 is incompatible with - * specifying any `strides` value != 1. - */ - dilationRate?: number | [number] | [number, number]; -} -declare abstract class ConvRNN2DCell extends RNNCell { - readonly filters: number; - readonly kernelSize: number[]; - readonly strides: number[]; - readonly padding: PaddingMode; - readonly dataFormat: DataFormat; - readonly dilationRate: number[]; - readonly activation: Activation; - readonly useBias: boolean; - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - readonly dropout: number; - readonly recurrentDropout: number; -} -declare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs, ConvRNN2DCellArgs { -} -/** - * Base class for convolutional-recurrent layers. - */ -declare class ConvRNN2D extends RNN { - /** @nocollapse */ - static className: string; - readonly cell: ConvRNN2DCell; - constructor(args: ConvRNN2DLayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape): Shape | Shape[]; - getInitialState(inputs: tfc.Tensor): tfc.Tensor[]; - resetStates(states?: Tensor | Tensor[], training?: boolean): void; - protected computeSingleOutputShape(inputShape: Shape): Shape; -} -export declare interface ConvLSTM2DCellArgs extends Omit, ConvRNN2DCellArgs { -} -export declare class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell { - /** @nocollapse */ - static className: string; - readonly filters: number; - readonly kernelSize: number[]; - readonly strides: number[]; - readonly padding: PaddingMode; - readonly dataFormat: DataFormat; - readonly dilationRate: number[]; - constructor(args: ConvLSTM2DCellArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[]; - getConfig(): tfc.serialization.ConfigDict; - inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode): tfc.Tensor; - recurrentConv(x: Tensor, w: Tensor): tfc.Tensor; -} -export declare interface ConvLSTM2DArgs extends Omit, ConvRNN2DLayerArgs { -} -export declare class ConvLSTM2D extends ConvRNN2D { - /** @nocollapse */ - static className: string; - constructor(args: ConvLSTM2DArgs); - /** @nocollapse */ - static fromConfig(cls: tfc.serialization.SerializableConstructor, config: tfc.serialization.ConfigDict): T; -} -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js deleted file mode 100644 index ea618001c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -import * as tfc from '@tensorflow/tfjs-core'; -import { util } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { checkDataFormat, checkPaddingMode } from '../common'; -import { InputSpec } from '../engine/topology'; -import { AttributeError, NotImplementedError, ValueError } from '../errors'; -import { Initializer } from '../initializers'; -import { convOutputLength, normalizeArray } from '../utils/conv_utils'; -import { assertPositiveInteger } from '../utils/generic_utils'; -import { getExactlyOneShape } from '../utils/types_utils'; -import { generateDropoutMask, LSTMCell, RNN, RNNCell } from './recurrent'; -class ConvRNN2DCell extends RNNCell { -} -/** - * Base class for convolutional-recurrent layers. - */ -class ConvRNN2D extends RNN { - constructor(args) { - if (args.unroll) { - throw new NotImplementedError('Unrolling is not possible with convolutional RNNs.'); - } - if (Array.isArray(args.cell)) { - throw new NotImplementedError('It is not possible at the moment to stack convolutional cells.'); - } - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - computeOutputShape(inputShape) { - let outShape = this.computeSingleOutputShape(inputShape); - if (!this.returnSequences) { - outShape = [outShape[0], ...outShape.slice(2)]; - } - if (this.returnState) { - outShape = - [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])]; - } - return outShape; - } - getInitialState(inputs) { - return tfc.tidy(() => { - const { stateSize } = this.cell; - const inputShape = inputs.shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const initialState = tfc.zeros(stateShape); - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - return [initialState]; - }); - } - resetStates(states, training = false) { - tfc.tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const inputShape = this.inputSpec[0].shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const batchSize = inputShape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.getStates() == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } - else { - this.states_ = [tfc.zeros(stateShape)]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } - else { - this.states_[0] = tfc.zeros(stateShape); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - tfc.dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const expectedShape = stateShape; - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - computeSingleOutputShape(inputShape) { - const { dataFormat, filters, kernelSize, padding, strides, dilationRate } = this.cell; - const isChannelsFirst = dataFormat === 'channelsFirst'; - const h = inputShape[isChannelsFirst ? 3 : 2]; - const w = inputShape[isChannelsFirst ? 4 : 3]; - const hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - const wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); - const outShape = [ - ...inputShape.slice(0, 2), - ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters]) - ]; - return outShape; - } -} -/** @nocollapse */ -ConvRNN2D.className = 'ConvRNN2D'; -export class ConvLSTM2DCell extends LSTMCell { - constructor(args) { - const { filters, kernelSize, strides, padding, dataFormat, dilationRate, } = args; - super(Object.assign({}, args, { units: filters })); - this.filters = filters; - assertPositiveInteger(this.filters, 'filters'); - this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize')); - this.strides = normalizeArray(strides || 1, 2, 'strides'); - this.strides.forEach(stride => assertPositiveInteger(stride, 'strides')); - this.padding = padding || 'valid'; - checkPaddingMode(this.padding); - this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(this.dataFormat); - this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - this.dilationRate.forEach(rate => assertPositiveInteger(rate, 'dilationRate')); - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const numOfKernels = 4; - const kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - const recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - this.recurrentKernel = this.addWeight('recurrent_kernel', recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - let biasInitializer; - if (this.unitForgetBias) { - const init = this.biasInitializer; - const filters = this.filters; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - const biasI = init.apply([filters]); - const biasF = tfc.ones([filters]); - const biasCAndO = init.apply([filters * 2]); - return K.concatenate([biasI, biasF, biasCAndO]); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (inputs.length !== 3) { - throw new ValueError(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] || false; - const x = inputs[0]; // Current input - const hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - const numOfKernels = 4; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(x), - rate: this.dropout, - training, - count: numOfKernels - }); - } - const dropoutMask = this.dropoutMask; - const applyDropout = (x, mask, index) => { - if (!mask || !mask[index]) { - return x; - } - return tfc.mul(mask[index], x); - }; - let xI = applyDropout(x, dropoutMask, 0); - let xF = applyDropout(x, dropoutMask, 1); - let xC = applyDropout(x, dropoutMask, 2); - let xO = applyDropout(x, dropoutMask, 3); - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: numOfKernels - }); - } - const recDropoutMask = this.recurrentDropoutMask; - let hI = applyDropout(hTMinus1, recDropoutMask, 0); - let hF = applyDropout(hTMinus1, recDropoutMask, 1); - let hC = applyDropout(hTMinus1, recDropoutMask, 2); - let hO = applyDropout(hTMinus1, recDropoutMask, 3); - const kernelChannelAxis = 3; - const [kernelI, kernelF, kernelC, kernelO] = tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis); - const [biasI, biasF, biasC, biasO] = this.useBias ? - tfc.split(this.bias.read(), numOfKernels) : - [null, null, null, null]; - xI = this.inputConv(xI, kernelI, biasI, this.padding); - xF = this.inputConv(xF, kernelF, biasF, this.padding); - xC = this.inputConv(xC, kernelC, biasC, this.padding); - xO = this.inputConv(xO, kernelO, biasO, this.padding); - const [recKernelI, recKernelF, recKernelC, recKernelO] = tfc.split(this.recurrentKernel.read(), numOfKernels, kernelChannelAxis); - hI = this.recurrentConv(hI, recKernelI); - hF = this.recurrentConv(hF, recKernelF); - hC = this.recurrentConv(hC, recKernelC); - hO = this.recurrentConv(hO, recKernelO); - const i = this.recurrentActivation.apply(tfc.add(xI, hI)); - const f = this.recurrentActivation.apply(tfc.add(xF, hF)); - const c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(tfc.add(xC, hC)))); - const h = tfc.mul(this.recurrentActivation.apply(tfc.add(xO, hO)), this.activation.apply(c)); - return [h, h, c]; - }); - } - getConfig() { - const _a = super.getConfig(), { 'units': _ } = _a, baseConfig = __rest(_a, ['units']); - const config = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - return Object.assign({}, baseConfig, config); - } - inputConv(x, w, b, padding) { - const out = tfc.conv2d(x, w, this.strides, (padding || 'valid'), this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', this.dilationRate); - if (b) { - return K.biasAdd(out, b, this.dataFormat); - } - return out; - } - recurrentConv(x, w) { - const strides = 1; - return tfc.conv2d(x, w, strides, 'same', this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - } -} -/** @nocollapse */ -ConvLSTM2DCell.className = 'ConvLSTM2DCell'; -tfc.serialization.registerClass(ConvLSTM2DCell); -export class ConvLSTM2D extends ConvRNN2D { - constructor(args) { - const cell = new ConvLSTM2DCell(args); - super(Object.assign({}, args, { cell })); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } -} -/** @nocollapse */ -ConvLSTM2D.className = 'ConvLSTM2D'; -tfc.serialization.registerClass(ConvLSTM2D); -//# sourceMappingURL=convolutional_recurrent.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-layers/dist/layers/convolutional_recurrent.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js.map deleted file mode 100644 index d0a3f5fc2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_recurrent.js","sourceRoot":"","sources":["../../src/layers/convolutional_recurrent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAS,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAmB,mBAAmB,EAAE,QAAQ,EAAoC,GAAG,EAAE,OAAO,EAAuC,MAAM,aAAa,CAAC;AAsDlK,MAAe,aAAc,SAAQ,OAAO;CAyB3C;AAKD;;GAEG;AACH,MAAM,SAAU,SAAQ,G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AM,CAAC,UAAU,CACb,GAAiD,EACjD,MAAoC;QACtC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;;AAdD,kBAAkB;AACX,oBAAS,GAAG,YAAY,CAAC;AAgBlC,GAAG,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent_test.js.map deleted file mode 100644 index 367154bea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"convolutional_recurrent_test.js","sourceRoot":"","sources":["../../src/layers/convolutional_recurrent_test.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;;;;;;;;;;;;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErF,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,IAAI,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAC,2BAA2B,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAI/F,qBAAqB,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;QACjD,MAAM,cAAc,GAAG,CAAC,CAAC;QACzB,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,MAAM,QAAQ,GAAG,CAAC,CAAC;QAE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\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serializeActivation, Tanh} from '../activations';\nimport {NonNeg, serializeConstraint, UnitNorm} from '../constraints';\n\nimport {sequential} from '../exports';\nimport * as tfl from '../index';\nimport {GlorotUniform, HeUniform, Ones, serializeInitializer} from '../initializers';\nimport {DataFormat, PaddingMode} from '../keras_format/common';\nimport {modelFromJSON} from '../models';\nimport {L1L2, serializeRegularizer} from '../regularizers';\nimport {getCartesianProductOfValues} from '../utils/generic_utils';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {ConvLSTM2DArgs, ConvLSTM2DCellArgs} from './convolutional_recurrent';\n\ndescribeMathCPUAndGPU('ConvLSTM2DCell', () => {\n /**\n * The tensor values (output, h, c) can be obtained by the following Python\n * code\n *\n * sequence_len = 1\n * data_size = 8\n * data_channel = 3\n *\n * data_format = \"channels_first\"\n * filters = 9\n * kernel_size = 5\n * padding = \"same\"\n *\n * inputs = np.ones([1, sequence_len, data_channel, data_size, data_size])\n *\n * x = keras.Input(batch_shape=inputs.shape)\n *\n * kwargs = {'data_format': data_format,\n * 'return_state': True,\n * 'filters': filters,\n * 'kernel_size': kernel_size,\n * 'padding': padding}\n *\n * layer = keras.layers.ConvLSTM2D(kernel_initializer='ones',\n * bias_initializer=\"ones\", recurrent_initializer='ones', **kwargs)\n * layer.build(inputs.shape)\n *\n * outputs = layer(x)\n *\n * model = keras.models.Model(x, outputs)\n *\n * y = model.predict(inputs)\n *\n * y[0].mean(), y[1].mean(), y[2].mean()\n */\n describe('should return the correct outputs', () => {\n const sequenceLength = 1;\n const inputSize = 8;\n const channels = 3;\n\n const dataFormatValues: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const filterValues = [3, 5, 9];\n const kernelSizeValues = [3, 5];\n const paddingValues: PaddingMode[] = ['valid', 'same'];\n\n const testArgs = getCartesianProductOfValues(\n dataFormatValues,\n filterValues,\n kernelSizeValues,\n paddingValues,\n ) as Array<[DataFormat, number, number, PaddingMode]>;\n\n for (const [dataFormat, filters, kernelSize, padding] of testArgs) {\n const testTitle = `for dataFormat=${dataFormat}, filters=${\n filters}, kernelSize=${kernelSize}, padding=${padding}`;\n\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [sequenceLength, channels, inputSize, inputSize] :\n [sequenceLength, inputSize, inputSize, channels];\n\n const x = tfc.ones(inputShape);\n\n const cell = tfl.layers.convLstm2dCell({\n dataFormat,\n filters,\n kernelSize,\n padding,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n });\n\n cell.build(x.shape);\n\n const outputSize =\n padding === 'same' ? inputSize : (inputSize - kernelSize + 1);\n\n const outShape = dataFormat === 'channelsFirst' ?\n [sequenceLength, filters, outputSize, outputSize] :\n [sequenceLength, outputSize, outputSize, filters];\n\n const initialH = tfc.zeros(outShape);\n\n const initialC = tfc.zeros(outShape);\n\n const [o, h, c] = cell.call([x, initialH, initialC], {});\n\n expect(o.shape).toEqual(outShape);\n expect(h.shape).toEqual(outShape);\n expect(c.shape).toEqual(outShape);\n\n expectTensorsClose(o.mean().flatten(), tfc.tensor1d([0.7615942]));\n expectTensorsClose(h.mean().flatten(), tfc.tensor1d([0.7615942]));\n expectTensorsClose(c.mean().flatten(), tfc.tensor1d([1]));\n });\n }\n });\n});\n\ndescribeMathCPU('ConvLSTM2D Symbolic', () => {\n const dtype = 'float32';\n\n const batchSize = 8;\n const sequenceLength = 10;\n const inputSize = 8;\n const channels = 3;\n\n const inputShape = [\n batchSize,\n sequenceLength,\n inputSize,\n inputSize,\n channels,\n ];\n\n const filters = 5;\n const kernelSize = [3, 3];\n\n const outputSize = inputSize - kernelSize[0] + 1;\n\n describe('should return the correct output shape', () => {\n it('for returnSequences=false, returnState=false', () => {\n const input =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n const convLstm = tfl.layers.convLstm2d({filters, kernelSize});\n const output = convLstm.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([8, 6, 6, 5]);\n });\n\n it('for returnSequences=false, returnState=true', () => {\n const returnState = true;\n\n const input = new tfl.SymbolicTensor(dtype, inputShape, null, [], null);\n\n const convLstm =\n tfl.layers.convLstm2d({filters, kernelSize, returnState});\n\n const output = convLstm.apply(input) as tfl.SymbolicTensor[];\n\n const outputShape = [batchSize, outputSize, outputSize, filters];\n\n expect(output.length).toEqual(3);\n expect(output[0].shape).toEqual(outputShape);\n expect(output[1].shape).toEqual(outputShape);\n expect(output[2].shape).toEqual(outputShape);\n });\n\n it('for returnSequences=true, returnState=false', () => {\n const returnSequences = true;\n\n const input = new tfl.SymbolicTensor(dtype, inputShape, null, [], null);\n\n const convLstm =\n tfl.layers.convLstm2d({filters, kernelSize, returnSequences});\n\n const output = convLstm.apply(input) as tfl.SymbolicTensor;\n\n const outputShape =\n [batchSize, sequenceLength, outputSize, outputSize, filters];\n\n expect(output.shape).toEqual(outputShape);\n });\n\n it('for returnSequences=true, returnState=true', () => {\n const returnSequences = true;\n const returnState = true;\n\n const input = new tfl.SymbolicTensor(dtype, inputShape, null, [], null);\n\n const convLstm = tfl.layers.convLstm2d(\n {filters, kernelSize, returnSequences, returnState});\n\n const output = convLstm.apply(input) as tfl.SymbolicTensor[];\n\n const outputShape =\n [batchSize, sequenceLength, outputSize, outputSize, filters];\n\n const stateShape = [batchSize, outputSize, outputSize, filters];\n\n expect(output.length).toEqual(3);\n expect(output[0].shape).toEqual(outputShape);\n expect(output[1].shape).toEqual(stateShape);\n expect(output[2].shape).toEqual(stateShape);\n });\n });\n\n it('should contain the correct number of weights', () => {\n const input = new tfl.SymbolicTensor(dtype, inputShape, null, [], null);\n\n const convLstm = tfl.layers.convLstm2d(\n {filters, kernelSize, returnSequences: true, returnState: true});\n\n convLstm.apply(input);\n\n expect(convLstm.trainable).toEqual(true);\n expect(convLstm.trainableWeights.length).toEqual(3);\n expect(convLstm.nonTrainableWeights.length).toEqual(0);\n expect(convLstm.weights.length).toEqual(3);\n });\n\n describe('should build the correct layer from exported config', () => {\n for (const implementation of [1, 2]) {\n it(`for implementation=${implementation}`, () => {\n const layer = tfl.layers.convLstm2d({\n filters,\n kernelSize,\n inputShape: inputShape.slice(1),\n implementation,\n padding: 'same',\n returnSequences: true,\n });\n\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n\n const tsConfig = convertPythonicToTs(pythonicConfig);\n\n const layerPrime =\n tfl.layers.convLstm2d(tsConfig as unknown as ConvLSTM2DArgs);\n\n expect(layerPrime.getConfig().filters).toEqual(filters);\n expect(layerPrime.getConfig().kernelSize).toEqual(kernelSize);\n expect(layerPrime.getConfig().implementation).toEqual(implementation);\n });\n }\n });\n\n describe('should return equal outputs with loaded model', () => {\n it('for simple model', async () => {\n const model = tfl.sequential();\n\n const layer = tfl.layers.convLstm2d({\n filters,\n kernelSize,\n padding: 'same',\n inputShape: inputShape.slice(1),\n returnSequences: true,\n });\n\n model.add(layer);\n\n const x = tfc.randomNormal(inputShape);\n\n const y = model.predict(x) as tfc.Tensor;\n\n let savedArtifacts: tfc.io.ModelArtifacts;\n\n await model.save(tfc.io.withSaveHandler(async (artifacts) => {\n savedArtifacts = artifacts;\n return null;\n }));\n\n const loadedModel =\n await tfl.loadLayersModel(tfc.io.fromMemory(savedArtifacts));\n\n const yPrime = loadedModel.predict(x) as tfc.Tensor;\n\n expect(model.inputs[0].shape).toEqual(loadedModel.inputs[0].shape);\n expect(model.outputs[0].shape).toEqual(loadedModel.outputs[0].shape);\n expectTensorsClose(yPrime, y);\n });\n\n it('for more complex model', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.convLstm2d({\n filters,\n kernelSize,\n inputShape: inputShape.slice(1),\n }));\n model.add(tfl.layers.dropout({rate: 0.2}));\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense({units: 256, activation: 'relu'}));\n model.add(tfl.layers.dropout({rate: 0.3}));\n model.add(tfl.layers.dense({units: 6, activation: 'softmax'}));\n\n const x = tfc.randomNormal(inputShape);\n\n const y = model.predict(x) as tfc.Tensor;\n\n let savedArtifacts: tfc.io.ModelArtifacts;\n\n await model.save(tfc.io.withSaveHandler(async (artifacts) => {\n savedArtifacts = artifacts;\n return null;\n }));\n\n const loadedModel =\n await tfl.loadLayersModel(tfc.io.fromMemory(savedArtifacts));\n\n const yPrime = loadedModel.predict(x) as tfc.Tensor;\n\n expect(model.inputs[0].shape).toEqual(loadedModel.inputs[0].shape);\n expect(model.outputs[0].shape).toEqual(loadedModel.outputs[0].shape);\n expectTensorsClose(yPrime, y);\n });\n });\n});\n\ndescribeMathCPUAndGPU('ConvLSTM2D Tensor', () => {\n const filters = 5;\n const kernelSize = 3;\n\n const batchSize = 4;\n const sequenceLength = 2;\n const inputSize = 5;\n const channels = 3;\n\n const inputShape =\n [batchSize, sequenceLength, inputSize, inputSize, channels];\n\n const outputSize = inputSize - kernelSize + 1;\n\n describe('should run as expected', () => {\n const dropoutValues = [0.0, 0.1];\n const recurrentDropoutValues = [0.0, 0.1];\n const trainingValues = [true, false];\n const implementationValues = [1, 2];\n\n const args = getCartesianProductOfValues(\n dropoutValues,\n recurrentDropoutValues,\n trainingValues,\n implementationValues,\n ) as Array<[number, number, boolean, number]>;\n\n for (const [dropout, recurrentDropout, training, implementation] of args) {\n const testTitle = `for dropout=${dropout}, recurrentDropout=${\n recurrentDropout},implementation=${implementation}, training=${\n training}, implementation=${implementation}`;\n\n it(testTitle, () => {\n const convLstm = tfl.layers.convLstm2d({\n filters,\n kernelSize,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n dropout,\n recurrentDropout,\n implementation,\n });\n\n const input = tfc.ones(inputShape);\n\n spyOn(tfc, 'dropout').and.callThrough();\n let dropoutCall = 0;\n if (dropout !== 0.0 && training) {\n dropoutCall += 4;\n }\n if (recurrentDropout !== 0.0 && training) {\n dropoutCall += 4;\n }\n\n let numTensors = 0;\n\n for (let i = 0; i < 2; i++) {\n tfc.dispose(convLstm.apply(input, {training}) as tfc.Tensor);\n\n expect(tfc.dropout).toHaveBeenCalledTimes((i + 1) * dropoutCall);\n\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n\n it('for stateful forward');\n });\n\n describe('should return the correct outputs', () => {\n const returnStateValues = [true, false];\n const returnSequencesValues = [true, false];\n const implementationValues = [1, 2];\n\n const args = getCartesianProductOfValues(\n returnStateValues,\n returnSequencesValues,\n implementationValues,\n ) as Array<[boolean, boolean, number]>;\n\n for (const [returnState, returnSequences, implementation] of args) {\n const testTitle = `for returnState=${returnState}, returnSequences=${\n returnSequences}, implementation=${implementation}`;\n\n it(testTitle, () => {\n const convLstm = tfl.layers.convLstm2d({\n filters,\n kernelSize,\n returnState,\n returnSequences,\n implementation,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n });\n\n const input = tfc.ones(inputShape);\n\n let output = convLstm.apply(input);\n\n const expectedOutputValueAtT0 = 0.76159424;\n const expectedOutputValueAtT1 = 0.96402746;\n const expectedH = expectedOutputValueAtT1;\n const expectedC = 2.0;\n\n let expectedOutput: tfc.Tensor;\n if (returnSequences) {\n const outputAtT0 = tfc.mul(\n tfc.scalar(expectedOutputValueAtT0),\n tfc.ones([batchSize, 1, outputSize, outputSize, filters]));\n\n const outputAtT1 = tfc.mul(\n tfc.scalar(expectedOutputValueAtT1),\n tfc.ones([batchSize, 1, outputSize, outputSize, filters]));\n\n expectedOutput = tfc.concat([outputAtT0, outputAtT1], 1);\n } else {\n expectedOutput = tfc.mul(\n tfc.scalar(expectedOutputValueAtT1),\n tfc.ones([batchSize, outputSize, outputSize, filters]));\n }\n\n if (returnState) {\n output = output as tfc.Tensor[];\n\n expect(output.length).toEqual(3);\n\n expectTensorsClose(output[0], expectedOutput);\n\n expectTensorsClose(\n output[1],\n tfc.mul(\n tfc.scalar(expectedH),\n tfc.ones([batchSize, outputSize, outputSize, filters])));\n expectTensorsClose(\n output[2],\n tfc.mul(\n tfc.scalar(expectedC),\n tfc.ones([batchSize, outputSize, outputSize, filters])));\n } else {\n output = output as tfc.Tensor;\n\n expectTensorsClose(output, expectedOutput);\n }\n });\n }\n\n it('for nested model', () => {\n const model = tfl.sequential();\n\n const nestedModel = tfl.sequential();\n\n nestedModel.add(tfl.layers.convLstm2d({\n filters,\n kernelSize,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n batchInputShape: inputShape\n }));\n\n model.add(nestedModel);\n\n const input = tfc.ones(inputShape);\n\n const output = model.apply(input) as tfc.Tensor;\n\n const expectedOutput = tfc.mul(\n tfc.scalar(0.96402746),\n tfc.ones([batchSize, outputSize, outputSize, filters]));\n\n expectTensorsClose(output, expectedOutput);\n });\n });\n});\n\n// TODO: Add GPU test once Gather supports 5 rank tensor.\ndescribeMathCPU('should run BPTT correctly', () => {\n const filters = 3;\n const kernelSize = 3;\n const padding = 'same';\n\n const batchSize = 4;\n const sequenceLength = 2;\n const inputSize = 5;\n const channels = 1;\n\n const inputShape =\n [batchSize, sequenceLength, inputSize, inputSize, channels];\n\n /**\n * batch_size = 4\n * sequence_len = 2\n * data_size = 5\n * data_channel = 1\n *\n * filters = 3\n * kernel_size = 3\n * padding = \"same\"\n *\n * kwargs = {'filters': filters, 'kernel_size': kernel_size, 'padding':\n * padding, 'batch_input_shape': [batch_size, sequence_len, data_size,\n * data_size, data_channel], 'stateful': True}\n *\n * model = keras.Sequential()\n *\n * model.add(keras.layers.ConvLSTM2D(kernel_initializer='ones',\n * bias_initializer=\"ones\", recurrent_initializer='ones', **kwargs))\n *\n * model.add(keras.layers.Flatten())\n *\n * model.add(keras.layers.Dense(units=1, kernel_initializer='zeros',\n * use_bias=False))\n *\n * model.compile(loss='mean_squared_error', optimizer='sgd')\n *\n * xs_1 = np.ones([batch_size, sequence_len, data_size, data_size,\n * data_channel])\n * xs_2 = np.zeros([batch_size, sequence_len, data_size, data_size,\n * data_channel])\n * xs = np.concatenate([xs_1, xs_2], 0)\n *\n * ys = np.array([[1], [1], [1], [1], [0], [0], [0], [0]])\n *\n * history = model.fit(xs, ys, batch_size=batch_size, shuffle=False, epochs=3)\n * print(history.history)\n */\n it('for stateful BPTT', async () => {\n const model = tfl.sequential();\n\n model.add(tfl.layers.convLstm2d({\n filters,\n kernelSize,\n padding,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n stateful: true,\n batchInputShape: inputShape\n }));\n\n model.add(tfl.layers.flatten());\n\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const input = tfc.concat([tfc.ones(inputShape), tfc.zeros(inputShape)], 0);\n\n const output = tfc.tensor([1, 1, 1, 1, 0, 0, 0, 0]);\n\n const history =\n await model.fit(input, output, {batchSize, shuffle: false, epochs: 3});\n\n expect(history.history.loss.length).toBe(3);\n expect(history.history.loss[0]).toBeCloseTo(1.5441135168075562);\n expect(history.history.loss[1]).toBeCloseTo(3.209195613861084);\n expect(history.history.loss[2]).toBeCloseTo(3.7930736541748047);\n });\n\n /**\n * batch_size = 4\n * sequence_len = 2\n * data_size = 5\n * data_channel = 1\n *\n * filters = 3\n * kernel_size = 3\n * padding = \"same\"\n *\n * kwargs = {'filters': filters, 'kernel_size': kernel_size, 'padding':\n * padding, 'batch_input_shape': [batch_size, sequence_len, data_size,\n * data_size, data_channel]}\n *\n * model = keras.Sequential()\n *\n * model.add(keras.layers.ConvLSTM2D(kernel_initializer='ones',\n * bias_initializer=\"ones\", recurrent_initializer='ones', **kwargs))\n *\n * model.add(keras.layers.Flatten())\n *\n * model.add(keras.layers.Dense(units=1, kernel_initializer='zeros',\n * use_bias=False))\n *\n * model.compile(loss='mean_squared_error', optimizer='sgd')\n *\n * xs_1 = np.ones([batch_size, sequence_len, data_size, data_size,\n * data_channel])\n * xs_2 = np.zeros([batch_size, sequence_len, data_size,\n * data_size, data_channel])\n * xs = np.concatenate([xs_1, xs_2], 0)\n *\n * ys = np.array([[1], [1], [1], [1], [0], [0], [0], [0]])\n *\n * history = model.fit(xs, ys, batch_size=batch_size, shuffle=False, epochs=3)\n * print(history.history)\n */\n it('for normal BPTT', async () => {\n const model = tfl.sequential();\n\n model.add(tfl.layers.convLstm2d({\n filters,\n kernelSize,\n padding,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n batchInputShape: inputShape\n }));\n\n model.add(tfl.layers.flatten());\n\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const input = tfc.concat([tfc.ones(inputShape), tfc.zeros(inputShape)], 0);\n\n const output = tfc.tensor([1, 1, 1, 1, 0, 0, 0, 0]);\n\n const history =\n await model.fit(input, output, {batchSize, shuffle: false, epochs: 3});\n\n expect(history.history.loss.length).toBe(3);\n expect(history.history.loss[0]).toBeCloseTo(1.367607831954956);\n expect(history.history.loss[1]).toBeCloseTo(1.9423290491104126);\n expect(history.history.loss[2]).toBeCloseTo(2.00433349609375);\n });\n\n /**\n * batch_size = 4\n * sequence_len = 2\n * data_size = 5\n * data_channel = 1\n *\n * filters = 3\n * kernel_size = 3\n * padding = \"same\"\n *\n * kwargs = {'filters': filters, 'kernel_size': kernel_size, 'padding':\n * padding, 'batch_input_shape': [batch_size, sequence_len, data_size,\n * data_size, data_channel]}\n *\n * model = keras.Sequential()\n *\n * model.add(keras.layers.ConvLSTM2D(kernel_initializer='ones',\n * bias_initializer=\"ones\", recurrent_initializer='ones', **kwargs))\n *\n * model.add(keras.layers.Flatten())\n *\n * model.add(keras.layers.Dense(units=1, kernel_initializer='zeros',\n * use_bias=False))\n *\n * model.compile(loss='mean_squared_error', optimizer='sgd')\n *\n * xs_1 = np.ones([batch_size, sequence_len, data_size, data_size,\n * data_channel])\n * xs_2 = np.zeros([batch_size, sequence_len, data_size,\n * data_size, data_channel])\n * xs = np.concatenate([xs_1, xs_2], 0)\n *\n * ys = np.array([[1], [1], [1], [1], [0], [0], [0], [0]])\n *\n * model.fit(xs, ys, batch_size=batch_size, shuffle=False, epochs=2)\n *\n * history = model.fit(xs, ys, batch_size=batch_size, shuffle=False, epochs=3)\n * print(history.history)\n */\n it('with no leak', async () => {\n const model = tfl.sequential();\n\n model.add(tfl.layers.convLstm2d({\n filters,\n kernelSize,\n padding,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n batchInputShape: inputShape\n }));\n\n model.add(tfl.layers.flatten());\n\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const input = tfc.concat([tfc.ones(inputShape), tfc.zeros(inputShape)], 0);\n\n const output = tfc.tensor([1, 1, 1, 1, 0, 0, 0, 0]);\n\n // Serves as burn-in call for subsequent tracking of memory leak.\n await model.fit(input, output, {epochs: 2, batchSize, shuffle: false});\n\n const numTensors0 = tfc.memory().numTensors;\n const history =\n await model.fit(input, output, {epochs: 3, batchSize, shuffle: false});\n const numTensors1 = tfc.memory().numTensors;\n\n // Assert no memory leak.\n expect(numTensors1).toEqual(numTensors0);\n expect(history.history.loss.length).toEqual(3);\n expect(history.history.loss[0]).toBeCloseTo(2.00433349609375);\n expect(history.history.loss[1]).toBeCloseTo(2.0098776817321777);\n expect(history.history.loss[2]).toBeCloseTo(2.0099055767059326);\n });\n});\n\ndescribeMathCPU('ConvLSTM2D Serialization and Deserialization', () => {\n const cellConfig: ConvLSTM2DCellArgs = {\n filters: 32,\n kernelSize: 3,\n dataFormat: 'channelsLast',\n dilationRate: 2,\n padding: 'same',\n strides: 2,\n activation: 'tanh',\n recurrentActivation: 'tanh',\n useBias: true,\n kernelInitializer: 'glorotUniform',\n recurrentInitializer: 'heUniform',\n biasInitializer: 'ones',\n kernelRegularizer: 'l1l2',\n recurrentRegularizer: 'l1l2',\n biasRegularizer: 'l1l2',\n kernelConstraint: 'unitNorm',\n recurrentConstraint: 'unitNorm',\n biasConstraint: 'nonNeg',\n dropout: 0.1,\n recurrentDropout: 0.2,\n name: 'cell_1',\n batchSize: 12,\n batchInputShape: [12, 8, 8],\n inputShape: [8, 8],\n dtype: 'int32',\n inputDType: 'int32',\n trainable: true,\n implementation: 1,\n unitForgetBias: true,\n };\n\n const expectedCellConfigPrime = {\n name: 'cell_1',\n trainable: true,\n batchInputShape: [12, 8, 8],\n dtype: 'int32',\n filters: 32,\n kernelSize: [3, 3],\n dataFormat: 'channelsLast',\n dilationRate: [2, 2],\n padding: 'same',\n strides: [2, 2],\n activation: serializeActivation(new Tanh()),\n recurrentActivation: serializeActivation(new Tanh()),\n useBias: true,\n kernelInitializer: serializeInitializer(new GlorotUniform()),\n recurrentInitializer: serializeInitializer(new HeUniform()),\n biasInitializer: serializeInitializer(new Ones()),\n kernelRegularizer: serializeRegularizer(new L1L2()),\n recurrentRegularizer: serializeRegularizer(new L1L2()),\n biasRegularizer: serializeRegularizer(new L1L2()),\n activityRegularizer: serializeRegularizer(null),\n kernelConstraint: serializeConstraint(new UnitNorm({})),\n recurrentConstraint: serializeConstraint(new UnitNorm({})),\n biasConstraint: serializeConstraint(new NonNeg()),\n implementation: 1,\n unitForgetBias: true,\n };\n\n describe('ConvLSTM2DCell.getConfig', () => {\n it('should return the expected values', () => {\n const cell = tfl.layers.convLstm2dCell(cellConfig);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual(expectedCellConfigPrime);\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n\n describe('ConvLSTM2D.getConfig', () => {\n it('should return the expected values', () => {\n const config: ConvLSTM2DArgs = {\n ...cellConfig,\n name: 'layer_1',\n ...{\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: false,\n goBackwards: true,\n inputDim: 8,\n inputLength: 8,\n } as Omit\n };\n\n const cell = tfl.layers.convLstm2d(config);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual({\n ...expectedCellConfigPrime,\n name: 'layer_1',\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: false,\n goBackwards: true,\n });\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n\n it('should return equal outputs before and after', async () => {\n const model = sequential();\n\n const batchSize = 8;\n const sequenceLength = 1;\n const inputSize = 8;\n const channels = 3;\n\n const filters = 5;\n const kernelSize = 3;\n\n const layer = tfl.layers.convLstm2d({\n filters,\n kernelSize,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n returnSequences: true,\n dataFormat: 'channelsFirst',\n inputShape: [sequenceLength, channels, inputSize, inputSize]\n });\n\n model.add(layer);\n\n const x =\n tfc.ones([batchSize, sequenceLength, channels, inputSize, inputSize]);\n\n const y = model.predict(x) as tfc.Tensor;\n\n const json = model.toJSON(null, false);\n\n const modelPrime = await modelFromJSON({modelTopology: json});\n\n const yPrime = modelPrime.predict(x) as tfc.Tensor;\n\n expectTensorsClose(yPrime, y);\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-layers/dist/layers/convolutional_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map deleted file mode 100644 index 3605e81b7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map +++ /dev/null @@ -1 +0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CAAC;oBACvC,OAAO;oBACP,UAAU;oBACV,OAAO;oBACP,OAAO;oBACP,UAAU;oBACV,iBAAiB,EAAE,MAAM;oBACzB,eAAe,EAAE,MAAM;iBACxB,CAAC,CAAC;gBAEH,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBACpC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;gBACnC,IAAI,UAAU,KAAK,cAAc,EAAE;oBACjC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAClE;qBAAM;oBACL,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAClE;YACH,CAAC,CAAC,CAAC;SACJ;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for convolutional.ts.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor, tensor1d, tensor3d, tensor4d, tensor5d, util} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {InitializerIdentifier} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {describeMathCPU, describeMathCPUAndGPU, describeMathGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {conv1d, conv1dWithBias, conv2d, conv2dWithBiasActivation, conv3d, conv3dWithBias} from './convolutional';\n\ndescribeMathCPUAndGPU('conv1dWithBias', () => {\n const xLength4Data = [10, 20, 40, 80];\n const kernelLength2Data = [1, -1];\n const biasScalarData = 2.2;\n // In the basic case, this convolves [10, 20, 40, 80] with the kernel [1, -1],\n // producing [-10, -20, -40], and adds the bias 2.2, producing\n // [-7.8, -17.8, -37.7]. The test is reproduced for either 1 or 2 output\n // channels, and several reasonable data formats.\n\n const outChannelsArray = [1, 2];\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const paddingModes: PaddingMode[] = [undefined, 'same', 'valid'];\n const stride = 1;\n\n for (const outChannels of outChannelsArray) {\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n const testTitle = `outChannels=${outChannels}, stride=${stride}, ` +\n `${paddingMode}, ${dataFormat}`;\n it(testTitle, () => {\n let x: Tensor = tensor3d(xLength4Data, [1, 4, 1]);\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NWC -> NCW.\n }\n\n let kernelData: number[] = [];\n let biasData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n kernelData = kernelData.concat(kernelLength2Data);\n biasData = biasData.concat([biasScalarData + i]);\n }\n const kernel = tfc.transpose(\n tensor3d(kernelData, [1, outChannels, 2]), [2, 0, 1]);\n const bias = tensor1d(biasData);\n\n const y =\n conv1dWithBias(x, kernel, bias, stride, paddingMode, dataFormat);\n\n let yExpectedShape: [number, number, number];\n let yExpectedData: number[];\n if (paddingMode === 'valid' || paddingMode === undefined) {\n if (outChannels === 1) {\n yExpectedShape = [1, 3, 1];\n yExpectedData = [-7.8, -17.8, -37.8];\n } else if (outChannels === 2) {\n yExpectedShape = [1, 3, 2];\n yExpectedData = [-7.8, -6.8, -17.8, -16.8, -37.8, -36.8];\n }\n } else if (paddingMode === 'same') {\n if (outChannels === 1) {\n yExpectedShape = [1, 4, 1];\n yExpectedData = [-7.8, -17.8, -37.8, 82.2];\n } else if (outChannels === 2) {\n yExpectedShape = [1, 4, 2];\n yExpectedData =\n [-7.8, -6.8, -17.8, -16.8, -37.8, -36.8, 82.2, 83.2];\n }\n }\n expectTensorsClose(y, tensor3d(yExpectedData, yExpectedShape));\n });\n }\n }\n }\n});\n\ndescribeMathCPUAndGPU('conv1d', () => {\n const xLength4Data = [10, 20, 40, 80];\n const kernelLength2Data = [1, -1];\n\n const outChannels = 2;\n const dataFormat = 'channelsLast';\n const paddingMode = 'valid';\n const strides = [2, 1];\n const dilations = [1, 2];\n const expectations = [[-10, -10, -40, -40], [-30, -30, -60, -60]];\n\n for (let i = 0; i < strides.length; ++i) {\n const stride = strides[i];\n const dilationRate = dilations[i];\n const expectation = expectations[i];\n const testTitle = `outChannels=${outChannels}, stride=${stride}, ` +\n `${paddingMode}, dilationRate=${dilationRate}, ${dataFormat}`;\n it(testTitle, () => {\n const x = tensor3d(xLength4Data, [1, 4, 1]);\n let kernelData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n kernelData = kernelData.concat(kernelLength2Data);\n }\n const kernel =\n tfc.transpose(tensor3d(kernelData, [1, outChannels, 2]), [2, 0, 1]);\n const y =\n conv1d(x, kernel, stride, paddingMode, dataFormat, dilationRate);\n expectTensorsClose(y, tensor3d(expectation, [1, 2, 2]));\n });\n }\n});\n\ndescribeMathCPUAndGPU('conv2d', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n const kernel2by2Data = [1, 0, 0, -1];\n\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const paddingModes: PaddingMode[] = [undefined, 'same', 'valid'];\n const stridesArray = [1, 2];\n\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n for (const stride of stridesArray) {\n const testTitle = `stride=${stride}, ${paddingMode}, ` +\n `${dataFormat}`;\n it(testTitle, () => {\n let x: Tensor = tensor4d(x4by4Data, [1, 1, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n const kernel = tensor4d(kernel2by2Data, [2, 2, 1, 1]);\n const y = conv2d(x, kernel, [stride, stride], 'valid', dataFormat);\n\n let yExpected: Tensor;\n if (stride === 1) {\n yExpected = tensor4d(\n [[[[-30, -30, -30], [50, 90, 130], [30, 30, 30]]]],\n [1, 1, 3, 3]);\n } else if (stride === 2) {\n yExpected = tensor4d([[[[-30, -30], [30, 30]]]], [1, 1, 2, 2]);\n }\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 1]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n it('Invalid filters leads to Error', () => {\n expect(() => tfl.layers.conv2d({filters: 2.5, kernelSize: 3}))\n .toThrowError(/filters.*positive integer.*2\\.5\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('conv2dWithBiasActivation', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n const kernel2by2Data = [1, 0, 0, -1];\n const biasScalarData = [2.2];\n\n const outChannelsArray = [2, 3];\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const paddingModes: PaddingMode[] = [undefined, 'same', 'valid'];\n const stridesArray = [1, 2];\n\n for (const outChannels of outChannelsArray) {\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n for (const stride of stridesArray) {\n const testTitle = `outChannels=${outChannels}, stride=${stride}, ` +\n `${paddingMode}, ${dataFormat}`;\n it(testTitle, () => {\n let x: Tensor = tensor4d(x4by4Data, [1, 1, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n let kernelData: number[] = [];\n let biasData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n kernelData = kernelData.concat(kernel2by2Data);\n biasData = biasData.concat(biasScalarData);\n }\n const kernel = tfc.transpose(\n tensor4d(kernelData, [outChannels, 2, 2, 1]), [1, 2, 3, 0]);\n const bias = tensor1d(biasData);\n\n const y = conv2dWithBiasActivation(\n x, kernel, bias, [stride, stride], 'valid', dataFormat);\n\n let yExpectedShape: [number, number, number, number];\n let yExpectedDataPerChannel: number[];\n if (stride === 1) {\n yExpectedShape = [1, outChannels, 3, 3];\n yExpectedDataPerChannel =\n [-30, -30, -30, 50, 90, 130, 30, 30, 30];\n } else if (stride === 2) {\n yExpectedShape = [1, outChannels, 2, 2];\n yExpectedDataPerChannel = [-30, -30, 30, 30];\n }\n for (let i = 0; i < yExpectedDataPerChannel.length; ++i) {\n yExpectedDataPerChannel[i] += biasScalarData[0];\n }\n let yExpectedData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n yExpectedData = yExpectedData.concat(yExpectedDataPerChannel);\n }\n let yExpected: Tensor = tensor4d(yExpectedData, yExpectedShape);\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 1]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n }\n});\n\ndescribeMathCPU('Conv2D Layers: Symbolic', () => {\n const filtersArray = [1, 64];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const kernelSizes = [[2, 2], [3, 4]];\n // In this test suite, `undefined` means strides is the same as kernelSize.\n const stridesArray = [undefined, 1];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const dataFormat of dataFormats) {\n for (const kernelSize of kernelSizes) {\n for (const stride of stridesArray) {\n const strides = stride || kernelSize;\n const testTitle = `filters=${filters}, kernelSize=${\n JSON.stringify(kernelSize)}, ` +\n `strides=${JSON.stringify(strides)}, ` +\n `${dataFormat}, ${padding}`;\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, 11, 9] :\n [2, 11, 9, 16];\n const symbolicInput =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const conv2dLayer = tfl.layers.conv2d({\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n });\n\n const output =\n conv2dLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n let outputRows: number;\n let outputCols: number;\n if (stride === undefined) { // Same strides as kernelSize.\n outputRows = kernelSize[0] === 2 ? 5 : 3;\n if (padding === 'same') {\n outputRows++;\n }\n outputCols = kernelSize[1] === 2 ? 4 : 2;\n if (padding === 'same') {\n outputCols++;\n }\n } else { // strides: 1.\n outputRows = kernelSize[0] === 2 ? 10 : 9;\n if (padding === 'same') {\n outputRows += kernelSize[0] - 1;\n }\n outputCols = kernelSize[1] === 2 ? 8 : 6;\n if (padding === 'same') {\n outputCols += kernelSize[1] - 1;\n }\n }\n let expectedShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape = [2, filters, outputRows, outputCols];\n } else {\n expectedShape = [2, outputRows, outputCols, filters];\n }\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n }\n\n it('missing config.kernelSize throws exception', () => {\n // tslint:disable-next-line:no-any\n expect((filters: 1) => tfl.layers.conv2d({filters: 1} as any))\n .toThrowError(/kernelSize/);\n });\n it('bad config.kernelSize shape throws exception', () => {\n expect(() => tfl.layers.conv2d({filters: 1, kernelSize: [1, 1, 1]}))\n .toThrowError(\n /kernelSize argument must be an integer or tuple of 2 integers/);\n });\n it('bad config.kernelSize shape throws exception', () => {\n expect(() => tfl.layers.conv2d({filters: 1, kernelSize: [1, 1, 1, 1]}))\n .toThrowError(\n /kernelSize to be number or number\\[\\] with length 1, 2, or 3/);\n });\n it('missing config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv2d({kernelSize: 1} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n it('bad config.filters value throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv2d({kernelSize: 1, filters: 0} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n});\n\ndescribeMathCPUAndGPU('Conv2D Layer: Tensor', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n\n const useBiases = [false, true];\n const biasInitializers: InitializerIdentifier[] = ['zeros', 'ones'];\n const activations: ActivationIdentifier[] = [null, 'linear', 'relu'];\n\n for (const useBias of useBiases) {\n for (const biasInitializer of biasInitializers) {\n for (const activation of activations) {\n const testTitle =\n `useBias=${useBias}, biasInitializer=${biasInitializer}, ` +\n `activation=${activation}`;\n it(testTitle, () => {\n const x = tensor4d(x4by4Data, [1, 1, 4, 4]);\n const conv2dLayer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: [2, 2],\n dataFormat: 'channelsFirst',\n useBias,\n kernelInitializer: 'ones',\n biasInitializer,\n activation\n });\n const y = conv2dLayer.apply(x) as Tensor;\n\n let yExpectedData = [100, 260, -100, -260];\n if (useBias && biasInitializer === 'ones') {\n yExpectedData = yExpectedData.map(element => element + 1);\n }\n if (activation === 'relu') {\n yExpectedData =\n yExpectedData.map(element => element >= 0 ? element : 0);\n }\n const yExpected = tensor4d(yExpectedData, [1, 1, 2, 2]);\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n it('CHANNEL_LAST', () => {\n // Convert input to CHANNEL_LAST.\n const x = tfc.transpose(tensor4d(x4by4Data, [1, 1, 4, 4]), [0, 2, 3, 1]);\n const conv2dLayer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: [2, 2],\n dataFormat: 'channelsLast',\n useBias: false,\n kernelInitializer: 'ones',\n activation: 'linear'\n });\n const y = conv2dLayer.apply(x) as Tensor;\n const yExpected = tensor4d([100, 260, -100, -260], [1, 2, 2, 1]);\n expectTensorsClose(y, yExpected);\n });\n\n const dilationRateValues: Array = [2, [2, 2]];\n for (const dilationRate of dilationRateValues) {\n it(`CHANNEL_LAST, dilationRate=${dilationRate}`, () => {\n const x = tensor4d(\n [[\n [\n [0.89240986], [0.54892443], [0.24670805], [0.03983783],\n [0.56602233]\n ],\n\n [\n [0.21421895], [0.58529864], [0.60060781], [0.66895784],\n [0.08855761]\n ],\n\n [\n [0.56657235], [0.25803428], [0.17971111], [0.65166403],\n [0.70492866]\n ],\n\n [\n [0.46641512], [0.05765411], [0.52517211], [0.62557303],\n [0.30612501]\n ],\n\n [\n [0.8406994], [0.56932724], [0.96028134], [0.34666753],\n [0.04458038]\n ]\n ]],\n [1, 5, 5, 1]);\n const conv2dLayer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: 1,\n dataFormat: 'channelsLast',\n useBias: false,\n kernelInitializer: 'ones',\n activation: 'linear',\n dilationRate\n });\n const y = conv2dLayer.apply(x) as Tensor;\n const yExpected = tensor4d(\n [[\n [[1.8854014], [1.4984605], [1.6973702]],\n\n [[1.8064139], [1.9374835], [1.5204625]],\n\n [[2.547264], [1.8256931], [1.8895016]]\n ]],\n [1, 3, 3, 1]);\n expectTensorsClose(y, yExpected);\n });\n }\n\n const explicitDefaultDilations: Array = [1, [1, 1]];\n for (const explicitDefaultDilation of explicitDefaultDilations) {\n const testTitle = 'Explicit default dilation rate: ' +\n JSON.stringify(explicitDefaultDilation);\n it(testTitle, () => {\n const conv2dLayer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: [2, 2],\n dataFormat: 'channelsFirst',\n useBias: false,\n kernelInitializer: 'ones',\n dilationRate: explicitDefaultDilation\n });\n const x = tensor4d(x4by4Data, [1, 1, 4, 4]);\n const y = conv2dLayer.apply(x) as Tensor;\n const yExpected = tensor4d([100, 260, -100, -260], [1, 1, 2, 2]);\n expectTensorsClose(y, yExpected);\n });\n }\n});\n\ndescribeMathCPUAndGPU('conv3d', () => {\n // # The following TensorFlow Python code is used to verify the results of\n // # the 3D convolutions.\n //\n // ```python\n // import numpy as np\n // import tensorflow as tf\n // tf.enable_eager_execution()\n //\n // x = np.arange(64, dtype=np.float32).reshape(1, 4, 4, 4, 1)\n // # Shape of kernel is (height, width, depth, input_ch, output_ch)\n // kernel = np.array([\n // 1, 1, 1, -1, -1, 1, 1, 1\n // ], dtype=np.float32).reshape(2, 2, 2, 1, 1)\n //\n // # Strides (1, 1, 1)\n // outputs = tf.nn.conv3d(\n // input=x, filter=kernel, strides=[1, 1, 1, 1, 1], padding='VALID')\n // outputs.numpy().flatten()\n // # Output:\n // # array([ 42., 46., 50., 58., 62., 66., 74., 78., 82., 106.,\n // # 110., 114., 122., 126., 130., 138., 142., 146., 170., 174.,\n // # 178., 186., 190., 194., 202., 206., 210.], dtype=float32)\n // outputs.numpy().shape # (1, 3, 3, 3, 1)\n //\n // # Strides (2, 2, 2)\n // outputs = tf.nn.conv3d(\n // input=x, filter=kernel, strides=[1, 2, 2, 2, 1], padding='VALID')\n // outputs.numpy().flatten()\n // # Output:\n // # array([ 42., 50., 74., 82., 170., 178., 202., 210.], dtype=float32)\n // outputs.numpy().shape # (1, 2, 2, 2, 1)\n // ```\n\n const x4by4by4Data = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63\n ];\n const kernel2by2by2Data = [1, 1, 1, -1, -1, 1, 1, 1];\n\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const paddingModes: PaddingMode[] = [undefined, 'same', 'valid'];\n const stridesArray = [1, 2];\n\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n for (const stride of stridesArray) {\n const testTitle = `stride=${stride}, ${paddingMode}, ` +\n `${dataFormat}`;\n it(testTitle, () => {\n let x = tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n }\n const kernel = tensor5d(kernel2by2by2Data, [2, 2, 2, 1, 1]);\n const y =\n conv3d(x, kernel, [stride, stride, stride], 'valid', dataFormat);\n\n let yExpected: Tensor;\n if (stride === 1) {\n // See validation Python code in comment above.\n yExpected = tensor5d(\n [\n 42., 46., 50., 58., 62., 66., 74., 78., 82.,\n 106., 110., 114., 122., 126., 130., 138., 142., 146.,\n 170., 174., 178., 186., 190., 194., 202., 206., 210.\n ],\n [1, 1, 3, 3, 3]);\n } else if (stride === 2) {\n // See validation Python code in comment above.\n yExpected = tensor5d(\n [42., 50., 74., 82., 170., 178., 202., 210.], [1, 1, 2, 2, 2]);\n }\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 4, 1]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n const biasScalarData = [2.2];\n const outChannelsArray = [2, 3];\n\n for (const outChannels of outChannelsArray) {\n for (const dataFormat of dataFormats) {\n for (const paddingMode of paddingModes) {\n for (const stride of stridesArray) {\n const testTitle = `outChannels=${outChannels}, stride=${stride}, ` +\n `${paddingMode}, ${dataFormat}`;\n it(testTitle, () => {\n let x: Tensor = tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n }\n\n let kernelData: number[] = [];\n let biasData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n kernelData = kernelData.concat(kernel2by2by2Data);\n biasData = biasData.concat(biasScalarData);\n }\n const kernel = tfc.transpose(\n tensor5d(kernelData, [outChannels, 2, 2, 2, 1]),\n [1, 2, 3, 4, 0]);\n const bias = tensor1d(biasData);\n\n const y = conv3dWithBias(\n x, kernel, bias, [stride, stride, stride], 'valid', dataFormat);\n\n let yExpectedShape: [number, number, number, number, number];\n let yExpectedDataPerChannel: number[];\n if (stride === 1) {\n yExpectedShape = [1, outChannels, 3, 3, 3];\n // See validation Python code above.\n yExpectedDataPerChannel = [\n 42., 46., 50., 58., 62., 66., 74., 78., 82.,\n 106., 110., 114., 122., 126., 130., 138., 142., 146.,\n 170., 174., 178., 186., 190., 194., 202., 206., 210.\n ];\n } else if (stride === 2) {\n yExpectedShape = [1, outChannels, 2, 2, 2];\n // See validation Python code above.\n yExpectedDataPerChannel =\n [42., 50., 74., 82., 170., 178., 202., 210.];\n }\n for (let i = 0; i < yExpectedDataPerChannel.length; ++i) {\n yExpectedDataPerChannel[i] += biasScalarData[0];\n }\n let yExpectedData: number[] = [];\n for (let i = 0; i < outChannels; ++i) {\n yExpectedData = yExpectedData.concat(yExpectedDataPerChannel);\n }\n let yExpected: Tensor = tensor5d(yExpectedData, yExpectedShape);\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 4, 1]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n }\n});\n\ndescribeMathCPU('Conv3D Layers: Symbolic', () => {\n const filtersArray = [1, 64];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const kernelSizes = [[2, 2, 2], [3, 4, 4]];\n // In this test suite, `undefined` means strides is the same as kernelSize.\n const stridesArray = [undefined, 1];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const dataFormat of dataFormats) {\n for (const kernelSize of kernelSizes) {\n for (const stride of stridesArray) {\n const strides = stride || kernelSize;\n const testTitle = `filters=${filters}, kernelSize=${\n JSON.stringify(kernelSize)}, ` +\n `strides=${JSON.stringify(strides)}, ` +\n `${dataFormat}, ${padding}`;\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, 11, 9, 9] :\n [2, 11, 9, 9, 16];\n const symbolicInput =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const conv3dLayer = tfl.layers.conv3d({\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n });\n\n const output =\n conv3dLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n let outputRows: number;\n let outputCols: number;\n let outputDepth: number;\n if (stride === undefined) { // Same strides as kernelSize.\n outputRows = kernelSize[0] === 2 ? 5 : 3;\n if (padding === 'same') {\n outputRows++;\n }\n outputCols = kernelSize[1] === 2 ? 4 : 2;\n if (padding === 'same') {\n outputCols++;\n }\n outputDepth = kernelSize[2] === 2 ? 4 : 2;\n if (padding === 'same') {\n outputDepth++;\n }\n } else { // strides: 1.\n outputRows = kernelSize[0] === 2 ? 10 : 9;\n if (padding === 'same') {\n outputRows += kernelSize[0] - 1;\n }\n outputCols = kernelSize[1] === 2 ? 8 : 6;\n if (padding === 'same') {\n outputCols += kernelSize[1] - 1;\n }\n outputDepth = kernelSize[2] === 2 ? 8 : 6;\n if (padding === 'same') {\n outputDepth += kernelSize[1] - 1;\n }\n }\n let expectedShape: [number, number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape =\n [2, filters, outputRows, outputCols, outputDepth];\n } else {\n expectedShape =\n [2, outputRows, outputCols, outputDepth, filters];\n }\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n }\n\n it('Invalid filters leads to Error', () => {\n expect(() => tfl.layers.conv3d({filters: 2.5, kernelSize: 3}))\n .toThrowError(/filters.*positive integer.*2\\.5\\.$/);\n });\n it('missing config.kernelSize throws exception', () => {\n // tslint:disable-next-line:no-any\n expect((filters: 1) => tfl.layers.conv3d({filters: 1} as any))\n .toThrowError(/kernelSize/);\n });\n it('scalar config.kernelSize shape does not throw exception', () => {\n expect(() => tfl.layers.conv3d({filters: 1, kernelSize: 1}))\n .not.toThrowError();\n });\n it('bad config.kernelSize shape throws exception', () => {\n expect(() => tfl.layers.conv3d({filters: 1, kernelSize: [1, 1]}))\n .toThrowError(\n /kernelSize argument must be an integer or tuple of 3 integers/);\n });\n it('bad config.kernelSize shape throws exception', () => {\n expect(() => tfl.layers.conv2d({filters: 1, kernelSize: [1, 1, 1, 1]}))\n .toThrowError(\n /kernelSize to be number or number\\[\\] with length 1, 2, or 3/);\n });\n it('missing config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv3d({kernelSize: 1} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n it('bad config.filters value throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv3d({kernelSize: 1, filters: 0} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n});\n\ndescribeMathCPUAndGPU('Conv3D Layer: Tensor', () => {\n // # The following TensorFlow Python code is used to verify the results of\n // # the 3D convolution layer.\n //\n // ```python\n // import numpy as np\n // import tensorflow as tf\n // tf.enable_eager_execution()\n //\n // x = np.arange(64, dtype=np.float32).reshape(1, 4, 4, 4, 1)\n // layer = tf.keras.layers.Conv3D(\n // filters=1, kernel_size=(2, 2, 2), strides=(2, 2, 2),\n // use_bias=True, kernel_initializer='ones', bias_initializer='zeros')\n // outputs = layer(x)\n // outputs.numpy().flatten()\n // # Output:\n // # array([ 84., 100., 148., 164., 340., 356., 404., 420.], dtype=float32)\n // outputs.numpy().shape\n // # Output:\n // # (1, 2, 2, 2, 1)\n // # TensorFlow Keras (Python) does not have a CPU implementation for channels\n // # first yet, so the validation code uses channels last. Axes 1 and 4 would\n // # be swapped to get channels first.\n // ```\n\n const x4by4by4Data = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63\n ];\n\n const useBiases = [false, true];\n const biasInitializers: InitializerIdentifier[] = ['zeros', 'ones'];\n const activations: ActivationIdentifier[] = [null, 'linear', 'relu'];\n\n for (const useBias of useBiases) {\n for (const biasInitializer of biasInitializers) {\n for (const activation of activations) {\n const testTitle =\n `useBias=${useBias}, biasInitializer=${biasInitializer}, ` +\n `activation=${activation}`;\n it(testTitle, () => {\n const x = tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]);\n const conv3dLayer = tfl.layers.conv3d({\n filters: 1,\n kernelSize: [2, 2, 2],\n strides: [2, 2, 2],\n dataFormat: 'channelsFirst',\n useBias,\n kernelInitializer: 'ones',\n biasInitializer,\n activation\n });\n const y = conv3dLayer.apply(x) as Tensor;\n // See validation Python code above.\n let yExpectedData = [84., 100., 148., 164., 340., 356., 404., 420.];\n if (useBias && biasInitializer === 'ones') {\n yExpectedData = yExpectedData.map(element => element + 1);\n }\n if (activation === 'relu') {\n yExpectedData =\n yExpectedData.map(element => element >= 0 ? element : 0);\n }\n const yExpected = tensor5d(yExpectedData, [1, 1, 2, 2, 2]);\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n it('CHANNEL_LAST', () => {\n // Convert input to CHANNEL_LAST.\n const x =\n tfc.transpose(tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]), [0, 2, 3, 4, 1]);\n const conv3dLayer = tfl.layers.conv3d({\n filters: 1,\n kernelSize: [2, 2, 2],\n strides: [2, 2, 2],\n dataFormat: 'channelsLast',\n useBias: false,\n kernelInitializer: 'ones',\n activation: 'linear'\n });\n const y = conv3dLayer.apply(x) as Tensor;\n // See validation Python code above.\n const yExpected = tensor5d(\n [84., 100., 148., 164., 340., 356., 404., 420.], [1, 2, 2, 2, 1]);\n expectTensorsClose(y, yExpected);\n });\n\n // # The following TensorFlow Python code is used to verify the results of\n // # the 3D convolution layer with dilation.\n //\n // ```python\n // import numpy as np\n // import tensorflow as tf\n // tf.enable_eager_execution()\n //\n // np.random.seed(42)\n // x = np.random.rand(1, 4, 4, 4, 1)\n // layer = tf.keras.layers.Conv3D(\n // filters=1, kernel_size=(2, 2, 2), strides=1, dilation_rate=2,\n // use_bias=False, kernel_initializer='ones', activation='linear')\n // outputs = layer(x)\n // outputs.numpy().flatten()\n // # Output:\n // # array([2.91534395, 6.38913542, 2.78770771, 3.1383292 , 3.04194573,\n // # 3.59669644, 4.85877068, 3.16763418])\n // outputs.numpy().shape\n // # Output:\n // # (1, 2, 2, 2, 1)\n // ```\n\n const dilationRateValues: Array =\n [2, [2, 2, 2]];\n for (const dilationRate of dilationRateValues) {\n it(`CHANNEL_LAST, dilationRate=${dilationRate}`, () => {\n const x = tensor5d(\n [\n 0.37454012, 0.95071431, 0.73199394, 0.59865848, 0.15601864,\n 0.15599452, 0.05808361, 0.86617615, 0.60111501, 0.70807258,\n 0.02058449, 0.96990985, 0.83244264, 0.21233911, 0.18182497,\n 0.18340451, 0.30424224, 0.52475643, 0.43194502, 0.29122914,\n 0.61185289, 0.13949386, 0.29214465, 0.36636184, 0.45606998,\n 0.78517596, 0.19967378, 0.51423444, 0.59241457, 0.04645041,\n 0.60754485, 0.17052412, 0.06505159, 0.94888554, 0.96563203,\n 0.80839735, 0.30461377, 0.09767211, 0.68423303, 0.44015249,\n 0.12203823, 0.49517691, 0.03438852, 0.9093204, 0.25877998,\n 0.66252228, 0.31171108, 0.52006802, 0.54671028, 0.18485446,\n 0.96958463, 0.77513282, 0.93949894, 0.89482735, 0.59789998,\n 0.92187424, 0.0884925, 0.19598286, 0.04522729, 0.32533033,\n 0.38867729, 0.27134903, 0.82873751, 0.35675333\n ],\n [1, 4, 4, 4, 1]);\n const conv3dLayer = tfl.layers.conv3d({\n filters: 1,\n kernelSize: [2, 2, 2],\n strides: 1,\n dataFormat: 'channelsLast',\n useBias: false,\n kernelInitializer: 'ones',\n activation: 'linear',\n dilationRate\n });\n const y = conv3dLayer.apply(x) as Tensor;\n // See validation Python code above.\n const yExpected = tensor5d(\n [\n 2.91534395, 6.38913542, 2.78770771, 3.1383292, 3.04194573,\n 3.59669644, 4.85877068, 3.16763418\n ],\n [1, 2, 2, 2, 1]);\n expectTensorsClose(y, yExpected);\n });\n }\n\n const explicitDefaultDilations: Array =\n [1, [1, 1, 1]];\n for (const explicitDefaultDilation of explicitDefaultDilations) {\n const testTitle = 'Explicit default dilation rate: ' +\n JSON.stringify(explicitDefaultDilation);\n it(testTitle, () => {\n const conv3dLayer = tfl.layers.conv3d({\n filters: 1,\n kernelSize: [2, 2, 2],\n strides: [2, 2, 2],\n dataFormat: 'channelsFirst',\n useBias: false,\n kernelInitializer: 'ones',\n dilationRate: explicitDefaultDilation\n });\n const x = tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]);\n const y = conv3dLayer.apply(x) as Tensor;\n const yExpected = tensor5d(\n [84., 100., 148., 164., 340., 356., 404., 420.], [1, 1, 2, 2, 2]);\n expectTensorsClose(y, yExpected);\n });\n }\n});\n\ndescribeMathCPU('Conv2DTranspose: Symbolic', () => {\n const filtersArray = [1, 64];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const kernelSizes = [2, [2, 2], [3, 4]];\n const stridesArray = [undefined, 2];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const kernelSize of kernelSizes) {\n for (const strides of stridesArray) {\n const testTitle = `filters=${filters}, paddingMode=${padding},` +\n `kernelSize=${JSON.stringify(kernelSize)}, strides=${strides}`;\n it(testTitle, () => {\n const inputShape = [2, 11, 9, 16];\n const x =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const layer = tfl.layers.conv2dTranspose(\n {filters, kernelSize, padding, strides});\n const y = layer.apply(x) as tfl.SymbolicTensor;\n\n let expectedShape: [number, number, number, number];\n if (strides === undefined) {\n if (padding === 'valid' || padding === undefined) {\n if (kernelSize as number === 2 ||\n util.arraysEqual(kernelSize as number[], [2, 2])) {\n expectedShape = [2, 12, 10, filters];\n } else if (util.arraysEqual(kernelSize as number[], [3, 4])) {\n expectedShape = [2, 13, 12, filters];\n }\n } else if (padding === 'same') {\n expectedShape = [2, 11, 9, filters];\n }\n } else {\n if (padding === 'valid' || padding === undefined) {\n if (kernelSize as number === 2 ||\n util.arraysEqual(kernelSize as number[], [2, 2])) {\n expectedShape = [2, 22, 18, filters];\n } else if (util.arraysEqual(kernelSize as number[], [3, 4])) {\n expectedShape = [2, 23, 20, filters];\n }\n } else if (padding === 'same') {\n expectedShape = [2, 22, 18, filters];\n }\n }\n expect(y.shape).toEqual(expectedShape);\n });\n }\n }\n }\n }\n\n it('Correct weight names', () => {\n const x = new tfl.SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n const layer = tfl.layers.conv2dTranspose({filters: 2, kernelSize: [3, 3]});\n layer.apply(x); // Let the layer build first.\n\n expect(layer.weights.length).toEqual(2);\n expect(layer.weights[0].name.indexOf('/kernel')).toBeGreaterThan(0);\n expect(layer.weights[1].name.indexOf('/bias')).toBeGreaterThan(0);\n });\n});\n\ndescribeMathCPUAndGPU('Conv2DTranspose: Tensor', () => {\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const stridesArray = [2, [2, 2]];\n for (const dataFormat of dataFormats) {\n for (const strides of stridesArray) {\n const testTitle =\n `filters=8, kernelSize=[2,2], padding=valid, strides=${strides}` +\n `dataFormat=${dataFormat}`;\n it(testTitle, () => {\n const filters = 8;\n const kernelSize = [2, 2];\n const padding = 'valid';\n const strides = 2;\n const layer = tfl.layers.conv2dTranspose({\n filters,\n kernelSize,\n padding,\n strides,\n dataFormat,\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n });\n\n const x = tfc.ones([2, 3, 4, 2]);\n const y = layer.apply(x) as Tensor;\n if (dataFormat === 'channelsLast') {\n expectTensorsClose(y, tfc.ones([2, 6, 8, 8]).mul(scalar(3)));\n } else {\n expectTensorsClose(y, tfc.ones([2, 8, 8, 4]).mul(scalar(4)));\n }\n });\n }\n }\n});\n\ndescribeMathCPU('Conv1D Layers: Symbolic', () => {\n const filtersArray = [1, 4];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const stridesArray = [undefined, 1];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const strides of stridesArray) {\n const testTitle = `filters=${filters}, padding=${padding}, ` +\n `strides=${strides}`;\n it(testTitle, () => {\n const inputShape = [2, 8, 3];\n const symbolicInput =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const conv1dLayer = tfl.layers.conv1d({\n filters,\n kernelSize: 2,\n strides,\n padding,\n dataFormat: 'channelsLast',\n });\n\n const output = conv1dLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n const expectedShape = [2, 7, filters];\n if (padding === 'same') {\n expectedShape[1] = 8;\n }\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n\n it('bad config.kernelSize shape throws exception', () => {\n expect(() => tfl.layers.conv1d({filters: 1, kernelSize: [1, 1]}))\n .toThrowError(/kernelSize.*1/);\n });\n});\n\ndescribeMathCPUAndGPU('Conv1D Layer: Tensor', () => {\n const xLength4Data = [10, -30, -50, 70];\n // In the most basic case, applying an all-ones convolutional kernel to\n // the 1D input above gives [-20, -80, 20]. Then adding all-ones bias to\n // it gives [-19, -79, 21].\n\n const stridesValues = [1, 2];\n const activations: ActivationIdentifier[] = ['linear', 'relu'];\n for (const strides of stridesValues) {\n for (const activation of activations) {\n const testTitle = `useBias=true, biasInitializer=ones, ` +\n `activation=${activation}; strides=${strides}`;\n it(testTitle, () => {\n const x = tensor3d(xLength4Data, [1, 4, 1]);\n const conv1dLayer = tfl.layers.conv1d({\n filters: 1,\n kernelSize: 2,\n strides,\n dataFormat: 'channelsLast',\n useBias: true,\n kernelInitializer: 'ones',\n biasInitializer: 'ones',\n activation\n });\n const y = conv1dLayer.apply(x) as Tensor;\n\n let yExpectedShape: [number, number, number];\n let yExpectedData: number[];\n if (strides === 1) {\n yExpectedShape = [1, 3, 1];\n yExpectedData = [-19, -79, 21];\n } else {\n yExpectedShape = [1, 2, 1];\n yExpectedData = [-19, 21];\n }\n if (activation === 'relu') {\n yExpectedData = yExpectedData.map(x => x > 0 ? x : 0);\n }\n const yExpected = tensor3d(yExpectedData, yExpectedShape);\n expectTensorsClose(y, yExpected);\n });\n }\n }\n\n const dilationRates: Array = [2, [2]];\n for (const dilationRate of dilationRates) {\n it(`dilationRate = ${dilationRate}`, () => {\n const x = tensor3d(\n [\n 0.0024236, 0.54829558, 0.47628448, 0.2971449, 0.7984293, 0.71802861,\n 0.53109141, 0.85882819\n ],\n [1, 8, 1]);\n const conv1dLayer = tfl.layers.conv1d({\n filters: 1,\n kernelSize: 2,\n strides: 1,\n useBias: true,\n kernelInitializer: 'ones',\n biasInitializer: 'ones',\n dilationRate,\n });\n const y = conv1dLayer.apply(x) as Tensor;\n const yExpected = tensor3d(\n [1.478708, 1.8454404, 2.2747138, 2.0151734, 2.3295207, 2.5768569],\n [1, 6, 1]);\n expectTensorsClose(y, yExpected);\n });\n }\n\n it('missing config.kernelSize throws exception', () => {\n // tslint:disable-next-line:no-any\n expect((filters: 1) => tfl.layers.conv1d({filters: 1} as any))\n .toThrowError(/required key 'kernelSize' not in config/);\n });\n it('bad config.kernelSize throws exception', () => {\n expect(() => tfl.layers.conv1d({filters: 1, kernelSize: [1, 1, 1]}))\n .toThrowError(\n /kernelSize argument must be an integer or tuple of 1 integers/);\n });\n it('missing config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv1d({kernelSize: 1} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n it('bad config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.conv1d({kernelSize: 1, filters: 0} as any))\n .toThrowError(/filters to be a 'number' > 0/);\n });\n});\n\ndescribeMathCPU('SeparableConv2D Layers: Symbolic', () => {\n const filtersArray = [1, 8];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const kernelSizes = [[2, 2], [3, 4]];\n // In this test suite, `undefined` means strides is the same as kernelSize.\n const stridesArray = [undefined, 1];\n const dilationRates = [undefined, 2];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const dataFormat of dataFormats) {\n for (const kernelSize of kernelSizes) {\n for (const stride of stridesArray) {\n for (const dilationRate of dilationRates) {\n const strides = stride || kernelSize;\n const testTitle = `filters=${filters}, kernelSize=${\n JSON.stringify(kernelSize)}, ` +\n `strides=${JSON.stringify(strides)}, ` +\n `dataFormat=${dataFormat}, padding=${padding}, ` +\n `dilationRate=${dilationRate}`;\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, 11, 9] :\n [2, 11, 9, 16];\n const symbolicInput = new tfl.SymbolicTensor(\n 'float32', inputShape, null, [], null);\n\n const layer = tfl.layers.separableConv2d({\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n });\n\n const output = layer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n let outputRows: number;\n let outputCols: number;\n if (dilationRate == null) {\n if (stride === undefined) { // Same strides as kernelSize.\n outputRows = kernelSize[0] === 2 ? 5 : 3;\n if (padding === 'same') {\n outputRows++;\n }\n outputCols = kernelSize[1] === 2 ? 4 : 2;\n if (padding === 'same') {\n outputCols++;\n }\n } else { // strides: 1.\n outputRows = kernelSize[0] === 2 ? 10 : 9;\n if (padding === 'same') {\n outputRows += kernelSize[0] - 1;\n }\n outputCols = kernelSize[1] === 2 ? 8 : 6;\n if (padding === 'same') {\n outputCols += kernelSize[1] - 1;\n }\n }\n } else {\n if (padding === 'same') {\n if (stride === undefined) { // Same strides as kernelSize.\n outputRows = kernelSize[0] === 2 ? 6 : 4;\n outputCols = kernelSize[1] === 2 ? 5 : 3;\n } else { // strides: 1.\n outputRows = 11;\n outputCols = 9;\n }\n } else {\n if (stride === undefined) { // Same strides as kernelSize.\n outputRows = kernelSize[0] === 2 ? 5 : 3;\n outputCols = kernelSize[1] === 2 ? 4 : 1;\n } else { // strides: 1.\n outputRows = kernelSize[0] === 2 ? 9 : 7;\n outputCols = kernelSize[1] === 2 ? 7 : 3;\n }\n }\n }\n let expectedShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape = [2, filters, outputRows, outputCols];\n } else {\n expectedShape = [2, outputRows, outputCols, filters];\n }\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n }\n }\n\n it('Incorrect input rank throws error', () => {\n const layer = tfl.layers.separableConv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: 1,\n });\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [2, 3, 4], null, [], null);\n expect(() => layer.apply(symbolicInput)).toThrowError(/rank 4/);\n });\n\n it('Undefined channel axis throws error', () => {\n const layer = tfl.layers.separableConv2d({\n filters: 1,\n kernelSize: [2, 2],\n strides: 1,\n });\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [1, , 2, 3, null], null, [], null);\n expect(() => layer.apply(symbolicInput))\n .toThrowError(/channel dimension .* should be defined/);\n });\n});\n\ndescribeMathGPU('SeparableConv2D Layer: Tensor', () => {\n const x5by5Data = [\n 1, 3, 5, 7, 9, 2, 4, 6, 8, 10, -1, -3, -5,\n -7, -9, -2, -4, -6, -8, -10, -1, 1, -1, 1, -1\n ];\n\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const dilationRates: number[] = [undefined, 2];\n const useBiases = [false, true];\n const biasInitializers: InitializerIdentifier[] = ['zeros', 'ones'];\n const activations: ActivationIdentifier[] = [null, 'linear', 'relu'];\n\n for (const dataFormat of dataFormats) {\n for (const dilationRate of dilationRates) {\n for (const useBias of useBiases) {\n for (const biasInitializer of biasInitializers) {\n for (const activation of activations) {\n const testTitle = `dataFormat=${dataFormat}, ` +\n `dilationRate=${dilationRate}, ` +\n `useBias=${useBias}, biasInitializer=${biasInitializer}, ` +\n `activation=${activation}`;\n it(testTitle, () => {\n let x = tensor4d(x5by5Data, [1, 5, 5, 1]);\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n\n const conv2dLayer = tfl.layers.separableConv2d({\n depthMultiplier: 1,\n filters: 1,\n kernelSize: [2, 2],\n strides: 1,\n dilationRate,\n dataFormat,\n useBias,\n depthwiseInitializer: 'ones',\n pointwiseInitializer: 'ones',\n biasInitializer,\n activation\n });\n const y = conv2dLayer.apply(x) as Tensor;\n\n let yExpectedData: number[];\n if (dilationRate === 2) {\n yExpectedData = [0, 0, 0, 0, 0, 0, -8, -8, -16];\n } else {\n yExpectedData = [\n 10, 18, 26, 34, 2, 2, 2, 2, -10, -18, -26, -34, -6, -10, -14,\n -18\n ];\n }\n if (useBias && biasInitializer === 'ones') {\n yExpectedData = yExpectedData.map(element => element + 1);\n }\n if (activation === 'relu') {\n yExpectedData =\n yExpectedData.map(element => element >= 0 ? element : 0);\n }\n\n let yExpected = dilationRate === 2 ?\n tensor4d(yExpectedData, [1, 3, 3, 1]) :\n tensor4d(yExpectedData, [1, 4, 4, 1]);\n if (dataFormat === 'channelsFirst') {\n // NHWC -> NCHW.\n yExpected = tfc.transpose(yExpected, [0, 3, 1, 2]);\n }\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n }\n }\n it('missing config.kernelSize throws exception', () => {\n // tslint:disable-next-line:no-any\n expect((filters: 1) => tfl.layers.separableConv2d({filters: 1} as any))\n .toThrowError(/kernelSize/);\n });\n it('bad config.kernelSize throws exception', () => {\n expect(\n () => tfl.layers.separableConv2d({filters: 1, kernelSize: [1, 1, 1]}))\n .toThrowError(/kernelSize/);\n });\n it('missing config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.separableConv2d({kernelSize: 1} as any))\n .toThrowError(/filters/);\n });\n it('bad config.filters throws exception', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.separableConv2d({kernelSize: 1, filters: 0} as any))\n .toThrowError(/filters/);\n });\n});\n\ndescribeMathCPUAndGPU('Cropping2D Layer', () => {\n it('check with undefined channels type', () => {\n const layer = tfl.layers.cropping2D({cropping: [[1, 0], [1, 0]]});\n const x = tensor4d(\n [\n [[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]],\n ],\n [1, 3, 3, 1]);\n\n const y = tensor4d(\n [\n [[[5], [6]], [[8], [9]]],\n ],\n [1, 2, 2, 1]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('check with channels last', () => {\n const layer = tfl.layers.cropping2D(\n {cropping: [[1, 1], [1, 1]], dataFormat: 'channelsLast'});\n const x = tensor4d(\n [\n [[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]],\n ],\n [1, 3, 3, 1]);\n const y = tensor4d(\n [\n [[[5]]],\n ],\n [1, 1, 1, 1]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('check with channels first', () => {\n const layer = tfl.layers.cropping2D(\n {cropping: [[1, 1], [1, 1]], dataFormat: 'channelsFirst'});\n const x = tensor4d(\n [\n [[[1, 2, 3], [3, 4, 5], [6, 7, 8]]],\n ],\n [1, 1, 3, 3]);\n const y = tensor4d(\n [\n [[[4]]],\n ],\n [1, 1, 1, 1]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('check with non-square tensor', () => {\n const layer = tfl.layers.cropping2D(\n {cropping: [[1, 1], [1, 1]], dataFormat: 'channelsFirst'});\n const x = tensor4d(\n [\n [[[1, 2, 3, 4], [3, 4, 5, 6], [6, 7, 8, 9]]],\n ],\n [1, 1, 3, 4]);\n const y = tensor4d(\n [\n [[[4, 5]]],\n ],\n [1, 1, 1, 2]);\n\n expect(layer.computeOutputShape(x.shape)).toEqual(y.shape);\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n});\n\ndescribeMathCPU('UpSampling2D Layer: Symbolic', () => {\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const interpolatinFormats: InterpolationFormat[] = ['nearest', 'bilinear'];\n const sizes = [undefined, [2, 2]];\n const undeterminedDimensionArray: string[] = [null, 'height', 'both'];\n\n for (const dataFormat of dataFormats) {\n for (const interpolation of interpolatinFormats) {\n for (const size of sizes) {\n for (const undeterminedDimension of undeterminedDimensionArray) {\n const testTitle = `size = ${size}, ${dataFormat}, ${interpolation}` +\n `undetermined dimension = ${\n JSON.stringify(undeterminedDimension)}`;\n it(testTitle, () => {\n let inputShape: Shape;\n if (undeterminedDimension == null) {\n inputShape = dataFormat === 'channelsFirst' ? [2, 16, 11, 9] :\n [2, 11, 9, 16];\n } else if (undeterminedDimension === 'height') {\n inputShape = dataFormat === 'channelsFirst' ? [2, 16, null, 9] :\n [2, null, 9, 16];\n } else if (undeterminedDimension === 'both') {\n inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, null, null] :\n [2, null, null, 16];\n }\n const symbolicInput =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const upSampling2dLayer = tfl.layers.upSampling2d({\n size,\n dataFormat,\n interpolation,\n });\n\n const output =\n upSampling2dLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n let outputRows: number;\n let outputCols: number;\n if (size === undefined) {\n outputRows = 2;\n outputCols = 2;\n } else {\n outputRows = size[0];\n outputCols = size[1];\n }\n let expectedShape: [number, number, number, number];\n if (undeterminedDimension == null) {\n if (dataFormat === 'channelsFirst') {\n outputRows *= inputShape[2];\n outputCols *= inputShape[3];\n expectedShape = [2, 16, outputRows, outputCols];\n } else {\n outputRows *= inputShape[1];\n outputCols *= inputShape[2];\n expectedShape = [2, outputRows, outputCols, 16];\n }\n } else if (undeterminedDimension === 'height') {\n if (dataFormat === 'channelsFirst') {\n outputCols *= inputShape[3];\n expectedShape = [2, 16, null, outputCols];\n } else {\n outputCols *= inputShape[2];\n expectedShape = [2, null, outputCols, 16];\n }\n } else if (undeterminedDimension === 'both') {\n if (dataFormat === 'channelsFirst') {\n expectedShape = [2, 16, null, null];\n } else {\n outputCols *= inputShape[2];\n expectedShape = [2, null, null, 16];\n }\n }\n\n expect(output.shape).toEqual(expectedShape);\n });\n }\n }\n }\n }\n});\n\ndescribeMathCPUAndGPU('UpSampling2D Layer', () => {\n it('check with default values', () => {\n const layer = tfl.layers.upSampling2d({});\n const x = tensor4d(\n [\n [[[1], [2]], [[3], [4]]],\n ],\n [1, 2, 2, 1]);\n\n const y = tensor4d(\n [\n [\n [[1], [1], [2], [2]], [[1], [1], [2], [2]], [[3], [3], [4], [4]],\n [[3], [3], [4], [4]]\n ],\n ],\n [1, 4, 4, 1]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('channels last', () => {\n const layer =\n tfl.layers.upSampling2d({size: [2, 2], dataFormat: 'channelsLast'});\n const x = tensor4d(\n [\n [[[1], [2]], [[3], [4]]],\n ],\n [1, 2, 2, 1]);\n\n const y = tensor4d(\n [\n [\n [[1], [1], [2], [2]], [[1], [1], [2], [2]], [[3], [3], [4], [4]],\n [[3], [3], [4], [4]]\n ],\n ],\n [1, 4, 4, 1]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('channels first', () => {\n const layer =\n tfl.layers.upSampling2d({size: [2, 2], dataFormat: 'channelsFirst'});\n const x = tensor4d(\n [\n [[[1, 2], [3, 4]]],\n ],\n [1, 1, 2, 2]);\n\n const y = tensor4d(\n [\n [[[1, 1, 2, 2], [1, 1, 2, 2], [3, 3, 4, 4], [3, 3, 4, 4]]],\n ],\n [1, 1, 4, 4]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('varying input image sizes', () => {\n const layer =\n tfl.layers.upSampling2d({size: [2, 2], dataFormat: 'channelsLast'});\n const x1 = tensor4d(\n [\n [[[1], [2]], [[3], [4]]],\n ],\n [1, 2, 2, 1]);\n const y1 = tensor4d(\n [\n [\n [[1], [1], [2], [2]], [[1], [1], [2], [2]], [[3], [3], [4], [4]],\n [[3], [3], [4], [4]]\n ],\n ],\n [1, 4, 4, 1]);\n expectTensorsClose(layer.apply(x1, null) as Tensor, y1);\n\n const x2 = tensor4d(\n [\n [[[1], [2]]],\n ],\n [1, 1, 2, 1]);\n\n const y2 = tensor4d(\n [\n [\n [[1], [1], [2], [2]],\n [[1], [1], [2], [2]],\n ],\n ],\n [1, 2, 4, 1]);\n expectTensorsClose(layer.apply(x2, null) as Tensor, y2);\n });\n it('interpolation bilinear', () => {\n const layer =\n tfl.layers.upSampling2d({size: [2, 2], interpolation: 'bilinear'});\n const x = tensor4d(\n [\n [[[1], [2]], [[3], [4]]],\n ],\n [1, 2, 2, 1]);\n const y = tensor4d(\n [\n [\n [[1], [1.5], [2], [2]], [[2], [2.5], [3], [3]],\n [[3], [3.5], [4], [4]], [[3], [3.5], [4], [4]]\n ],\n ],\n [1, 4, 4, 1]);\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n\n it('interpolation nearest', () => {\n const layer = tfl.layers.upSampling2d(\n {size: [2, 2], dataFormat: 'channelsFirst', interpolation: 'nearest'});\n const x = tensor4d(\n [\n [[[1, 2], [3, 4]]],\n ],\n [1, 1, 2, 2]);\n\n const y = tensor4d(\n [\n [[[1, 1, 2, 2], [1, 1, 2, 2], [3, 3, 4, 4], [3, 3, 4, 4]]],\n ],\n [1, 1, 4, 4]);\n\n expectTensorsClose(layer.apply(x, null) as Tensor, y);\n });\n});\n\ndescribeMathCPU('Conv3DTranspose: Symbolic', () => {\n const filtersArray = [1, 64];\n const paddingModes: PaddingMode[] = ['valid', 'same'];\n const kernelSizes = [[2, 2, 2], [3, 4, 4]];\n const stridesArray = [1, 3];\n\n for (const filters of filtersArray) {\n for (const padding of paddingModes) {\n for (const kernelSize of kernelSizes) {\n for (const strides of stridesArray) {\n const testTitle = `filters=${filters}, paddingMode=${padding},` +\n `kernelSize=${JSON.stringify(kernelSize)}, strides=${strides}`;\n it(testTitle, () => {\n const inputShape = [1, 2, 11, 9, 16];\n const x =\n new tfl.SymbolicTensor('float32', inputShape, null, [], null);\n\n const layer = tfl.layers.conv3dTranspose(\n {filters, kernelSize, padding, strides});\n const y = layer.apply(x) as tfl.SymbolicTensor;\n\n let expectedShape: [number, number, number, number, number];\n if (strides === 1) {\n if (padding === 'same') {\n expectedShape = [1, 2, 11, 9, filters];\n } else {\n if (kernelSize[0] === 2) {\n expectedShape = [1, 3, 12, 10, filters];\n } else {\n expectedShape = [1, 4, 14, 12, filters];\n }\n }\n } else if (strides === 3) {\n if (padding === 'same') {\n expectedShape = [1, 6, 33, 27, filters];\n } else {\n if (kernelSize[0] === 2) {\n expectedShape = [1, 6, 33, 27, filters];\n } else {\n expectedShape = [1, 6, 34, 28, filters];\n }\n }\n }\n expect(y.shape).toEqual(expectedShape);\n });\n }\n }\n }\n }\n\n it('Correct weight names', () => {\n const x =\n new tfl.SymbolicTensor('float32', [1, 2, 3, 4, 5], null, [], null);\n const layer =\n tfl.layers.conv3dTranspose({filters: 2, kernelSize: [3, 3, 3]});\n layer.apply(x); // Let the layer build first.\n\n expect(layer.weights.length).toEqual(2);\n expect(layer.weights[0].name.indexOf('/kernel')).toBeGreaterThan(0);\n expect(layer.weights[1].name.indexOf('/bias')).toBeGreaterThan(0);\n });\n});\n\ndescribeMathCPUAndGPU('Conv3DTranspose: Tensor', () => {\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const stridesArray = [1, 2];\n for (const dataFormat of dataFormats) {\n for (const strides of stridesArray) {\n const testTitle =\n `filters=8, kernelSize=[2,2], padding=valid, strides=${strides}` +\n `dataFormat=${dataFormat}`;\n it(testTitle, () => {\n const filters = 8;\n const kernelSize = [2, 2, 2];\n const padding = 'valid';\n const strides = 2;\n const layer = tfl.layers.conv3dTranspose({\n filters,\n kernelSize,\n padding,\n strides,\n dataFormat,\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n });\n\n const x = tfc.ones([2, 3, 4, 5, 2]);\n const y = layer.apply(x) as Tensor;\n if (dataFormat === 'channelsLast') {\n expectTensorsClose(y, tfc.ones([2, 6, 8, 10, 8]).mul(scalar(3)));\n } else {\n expectTensorsClose(y, tfc.ones([2, 8, 8, 10, 4]).mul(scalar(4)));\n }\n });\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-layers/dist/layers/core.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts deleted file mode 100644 index fe4b32e8e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts +++ /dev/null @@ -1,235 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Basic Layers. - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Activation as ActivationFn } from '../activations'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { DisposeResult, Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { ActivationIdentifier } from '../keras_format/activation_config'; -import { DataFormat, Shape } from '../keras_format/common'; -import { LayerConfig } from '../keras_format/topology_config'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs } from '../types'; -export declare interface DropoutLayerArgs extends LayerArgs { - /** Float between 0 and 1. Fraction of the input units to drop. */ - rate: number; - /** - * Integer array representing the shape of the binary dropout mask that will - * be multiplied with the input. - * - * For instance, if your inputs have shape `(batchSize, timesteps, features)` - * and you want the dropout mask to be the same for all timesteps, you can use - * `noise_shape=(batch_size, 1, features)`. - */ - noiseShape?: number[]; - /** An integer to use as random seed. */ - seed?: number; -} -export declare class Dropout extends Layer { - /** @nocollapse */ - static className: string; - private readonly rate; - private readonly noiseShape; - private readonly seed; - constructor(args: DropoutLayerArgs); - protected getNoiseShape(input: Tensor): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; - dispose(): DisposeResult; -} -export declare interface DenseLayerArgs extends LayerArgs { - /** Positive integer, dimensionality of the output space. */ - units: number; - /** - * Activation function to use. - * - * If unspecified, no activation is applied. - */ - activation?: ActivationIdentifier; - /** Whether to apply a bias. */ - useBias?: boolean; - /** - * Initializer for the dense kernel weights matrix. - */ - kernelInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier | Initializer; - /** - * If specified, defines inputShape as `[inputDim]`. - */ - inputDim?: number; - /** - * Constraint for the kernel weights. - */ - kernelConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint for the bias vector. - */ - biasConstraint?: ConstraintIdentifier | Constraint; - /** - * Regularizer function applied to the dense kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier | Regularizer; -} -export interface SpatialDropout1DLayerConfig extends LayerConfig { - /** Float between 0 and 1. Fraction of the input units to drop. */ - rate: number; - /** An integer to use as random seed. */ - seed?: number; -} -export declare class SpatialDropout1D extends Dropout { - /** @nocollapse */ - static className: string; - constructor(args: SpatialDropout1DLayerConfig); - protected getNoiseShape(input: Tensor): Shape; -} -export declare class Dense extends Layer { - /** @nocollapse */ - static className: string; - private units; - private activation; - private useBias; - private kernelInitializer; - private biasInitializer; - private kernel; - private bias; - readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; - private readonly kernelConstraint?; - private readonly biasConstraint?; - private readonly kernelRegularizer?; - private readonly biasRegularizer?; - constructor(args: DenseLayerArgs); - build(inputShape: Shape | Shape[]): void; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface FlattenLayerArgs extends LayerArgs { - /** Image data format: channeLast (default) or channelFirst. */ - dataFormat?: DataFormat; -} -export declare class Flatten extends Layer { - private dataFormat; - /** @nocollapse */ - static className: string; - constructor(args?: FlattenLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface ActivationLayerArgs extends LayerArgs { - /** - * Name of the activation function to use. - */ - activation: ActivationIdentifier; -} -export declare class Activation extends Layer { - /** @nocollapse */ - static className: string; - activation: ActivationFn; - constructor(args: ActivationLayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface ReshapeLayerArgs extends LayerArgs { - /** The target shape. Does not include the batch axis. */ - targetShape: Shape; -} -export declare interface RepeatVectorLayerArgs extends LayerArgs { - /** - * The integer number of times to repeat the input. - */ - n: number; -} -export declare class RepeatVector extends Layer { - /** @nocollapse */ - static className: string; - readonly n: number; - constructor(args: RepeatVectorLayerArgs); - computeOutputShape(inputShape: Shape): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class Reshape extends Layer { - /** @nocollapse */ - static className: string; - private targetShape; - constructor(args: ReshapeLayerArgs); - private isUnknown; - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - private fixUnknownDimension; - computeOutputShape(inputShape: Shape): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface PermuteLayerArgs extends LayerArgs { - /** - * Array of integers. Permutation pattern. Does not include the - * sample (batch) dimension. Index starts at 1. - * For instance, `[2, 1]` permutes the first and second dimensions - * of the input. - */ - dims: number[]; -} -export declare class Permute extends Layer { - /** @nocollapse */ - static className: string; - readonly dims: number[]; - private readonly dimsIncludingBatch; - constructor(args: PermuteLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface MaskingArgs extends LayerArgs { - /** - * Masking Value. Defaults to `0.0`. - */ - maskValue?: number; -} -export declare class Masking extends Layer { - /** @nocollapse */ - static className: string; - maskValue: number; - constructor(args?: MaskingArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): { - maskValue: number; - }; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js deleted file mode 100644 index 0d410d2aa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js +++ /dev/null @@ -1,461 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Basic Layers. - */ -import { any, notEqual, serialization, tidy, transpose, util } from '@tensorflow/tfjs-core'; -import { getActivation, serializeActivation } from '../activations'; -import * as K from '../backend/tfjs_backend'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { InputSpec, Layer } from '../engine/topology'; -import { ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import { assertPositiveInteger, mapActivationToFusedKernel } from '../utils/generic_utils'; -import { arrayProd, range } from '../utils/math_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -export class Dropout extends Layer { - constructor(args) { - super(args); - this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - this.noiseShape = args.noiseShape; - this.seed = args.seed; - this.supportsMasking = true; - } - getNoiseShape(input) { - if (this.noiseShape == null) { - return this.noiseShape; - } - const inputShape = input.shape; - const noiseShape = []; - for (let i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (0 < this.rate && this.rate < 1) { - const training = kwargs['training'] == null ? false : kwargs['training']; - const noiseShape = this.getNoiseShape(input); - const output = K.inTrainPhase(() => K.dropout(input, this.rate, noiseShape, this.seed), () => input, training); - return output; - } - return inputs; - }); - } - getConfig() { - const config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - dispose() { - return super.dispose(); - } -} -/** @nocollapse */ -Dropout.className = 'Dropout'; -serialization.registerClass(Dropout); -export class SpatialDropout1D extends Dropout { - constructor(args) { - super(args); - this.inputSpec = [{ ndim: 3 }]; - } - getNoiseShape(input) { - const inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - } -} -/** @nocollapse */ -SpatialDropout1D.className = 'SpatialDropout1D'; -serialization.registerClass(SpatialDropout1D); -export class Dense extends Layer { - constructor(args) { - super(args); - // Default activation: Linear (none). - this.activation = null; - this.useBias = true; - this.kernel = null; - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - this.batchInputShape = [batchSize, args.inputDim]; - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation); - if (args.useBias != null) { - this.useBias = args.useBias; - } - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.supportsMasking = true; - this.inputSpec = [{ minNDim: 2 }]; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - } - this.inputSpec = [{ minNDim: 2, axes: { [-1]: inputLastDim } }]; - this.built = true; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - const input = getExactlyOneTensor(inputs); - const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); - let output; - if (fusedActivationName != null) { - output = K.dot(input, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); - } - else { - output = K.dot(input, this.kernel.read()); - if (this.bias != null) { - output = K.biasAdd(output, this.bias.read()); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - } - return output; - }); - } - getConfig() { - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Dense.className = 'Dense'; -serialization.registerClass(Dense); -export class Flatten extends Layer { - constructor(args) { - args = args || {}; - super(args); - this.inputSpec = [{ minNDim: 3 }]; - this.dataFormat = args.dataFormat; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - for (const dim of inputShape.slice(1)) { - if (dim == null) { - throw new ValueError(`The shape of the input to "Flatten" is not fully defined ` + - `(got ${inputShape.slice(1)}). Make sure to pass a complete ` + - `"input_shape" or "batch_input_shape" argument to the first ` + - `layer in your model.`); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - let input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsFirst' && input.rank > 1) { - const permutation = [0]; - for (let i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - return K.batchFlatten(input); - }); - } - getConfig() { - const config = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Flatten.className = 'Flatten'; -serialization.registerClass(Flatten); -export class Activation extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.activation = getActivation(args.activation); - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - return this.activation.apply(input); - }); - } - getConfig() { - const config = { activation: serializeActivation(this.activation) }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Activation.className = 'Activation'; -serialization.registerClass(Activation); -export class RepeatVector extends Layer { - constructor(args) { - super(args); - this.n = args.n; - this.inputSpec = [{ ndim: 2 }]; - } - computeOutputShape(inputShape) { - return [inputShape[0], this.n, inputShape[1]]; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - return K.repeat(inputs, this.n); - }); - } - getConfig() { - const config = { - n: this.n, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -RepeatVector.className = 'RepeatVector'; -serialization.registerClass(RepeatVector); -export class Reshape extends Layer { - constructor(args) { - super(args); - this.targetShape = args.targetShape; - // Make sure that all unknown dimensions are represented as `null`. - for (let i = 0; i < this.targetShape.length; ++i) { - if (this.isUnknown(this.targetShape[i])) { - this.targetShape[i] = null; - } - } - } - isUnknown(dim) { - return dim < 0 || dim == null; - } - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - fixUnknownDimension(inputShape, outputShape) { - const errorMsg = 'Total size of new array must be unchanged.'; - const finalShape = outputShape.slice(); - let known = 1; - let unknown = null; - for (let i = 0; i < finalShape.length; ++i) { - const dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } - else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } - else { - known *= dim; - } - } - const originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } - else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - return finalShape; - } - computeOutputShape(inputShape) { - let anyUnknownDims = false; - for (let i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } - else { - return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const outputShape = inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - return input.reshape(outputShape); - }); - } - getConfig() { - const config = { - targetShape: this.targetShape, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Reshape.className = 'Reshape'; -serialization.registerClass(Reshape); -export class Permute extends Layer { - constructor(args) { - super(args); - if (args.dims == null) { - throw new Error('Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error('Permute constructor requires `dims` to be an Array, but received ' + - `${args.dims} instead.`); - } - // Check the validity of the permutation indices. - const expectedSortedIndices = range(1, args.dims.length + 1); - if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error('Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - this.dims = args.dims; - this.dimsIncludingBatch = [0].concat(this.dims); - this.inputSpec = [new InputSpec({ ndim: this.dims.length + 1 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - this.dims.forEach((dim, i) => { - outputShape[i + 1] = inputShape[dim]; - }); - return outputShape; - } - call(inputs, kwargs) { - return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - } - getConfig() { - const config = { - dims: this.dims, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Permute.className = 'Permute'; -serialization.registerClass(Permute); -export class Masking extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } - else { - this.maskValue = 0; - } - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { maskValue: this.maskValue }; - Object.assign(config, baseConfig); - return config; - } - computeMask(inputs, mask) { - const input = getExactlyOneTensor(inputs); - const axis = -1; - return any(notEqual(input, this.maskValue), axis); - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const axis = -1; - const keepDims = true; - const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims); - const output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - } -} -/** @nocollapse */ -Masking.className = 'Masking'; -serialization.registerClass(Masking); -//# sourceMappingURL=core.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-layers/dist/layers/core.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map deleted file mode 100644 index 8ca153858..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/layers/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAU,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAA6B,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC9F,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAmC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAgB,SAAS,EAAE,KAAK,EAAY,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AACrC,OAAO,EAAC,cAAc,EAAsC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAIzG,OAAO,EAAC,cAAc,EAAsC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAqB7E,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAOhC,YAAY,IAAsB;QAChC,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAA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CAAC,KAAK,CAAC,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;;AAzCD,kBAAkB;AACX,iBAAS,GAAG,SAAS,CAAC;AA0C/B,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map deleted file mode 100644 index c362051c0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core_test.js","sourceRoot":"","sources":["../../src/layers/core_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAErG,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9B,MAAM,cAAc,GAAG;QACrB,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;QAC1D,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;QAC9D,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EA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KAAK,EAAE,CAAC,EAAE,oBAAoB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC;QAE1E,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAW,CAAC;QACvC,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for core.ts.\n */\nimport {mul, ones, scalar, Tensor, tensor2d, tensor3d, tensor4d, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {SymbolicTensor} from '../engine/topology';\nimport * as tfl from '../index';\nimport {InitializerIdentifier} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {pyListRepeat} from '../utils/generic_utils';\nimport {arrayProd} from '../utils/math_utils';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\ndescribe('Dropout Layer: Symbolic', () => {\n const dropoutRates = [0, 0.5];\n const symbolicInputs = [\n new tfl.SymbolicTensor('float32', [10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null),\n ];\n\n for (const rate of dropoutRates) {\n for (const symbolicInput of symbolicInputs) {\n const testTitle = `dropoutRate=${rate}; ` +\n `input shape=${JSON.stringify(symbolicInput.shape)}`;\n it(testTitle, () => {\n const dropoutLayer = tfl.layers.dropout({rate});\n const output = dropoutLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.dtype).toEqual(symbolicInput.dtype);\n expect(output.shape).toEqual(symbolicInput.shape);\n expect(output.sourceLayer).toEqual(dropoutLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n }\n }\n});\n\ndescribeMathCPUAndGPU('Dropout Layer', () => {\n describe('tensor', () => {\n const inputShape = [2, 3, 4];\n const trainingValues = [false, true];\n const dropoutRates = [0, 0.5];\n const noiseShapes = [null, inputShape, [2, 3, 1]];\n const seed = 0;\n\n for (const training of trainingValues) {\n for (const rate of dropoutRates) {\n for (const noiseShape of noiseShapes) {\n const testTitle = `training=${training}, dropoutRate=${rate}, ` +\n `noiseShape=${JSON.stringify(noiseShape)}`;\n it(testTitle, () => {\n const x = ones(inputShape);\n const dropoutLayer = tfl.layers.dropout({rate, noiseShape, seed});\n const y = dropoutLayer.apply(x, {training}) as Tensor;\n expect(x.dtype).toEqual(y.dtype);\n expect(x.shape).toEqual(y.shape);\n const xValue = x.dataSync();\n const yValue = y.dataSync();\n let nKept = 0;\n if (noiseShape === noiseShapes[2]) { // customized noiseShape\n for (let i = 0; i < x.shape[0]; ++i) {\n for (let j = 0; j < x.shape[1]; ++j) {\n const maskedValue =\n yValue[i * x.shape[1] * x.shape[2] + j * x.shape[2]];\n for (let k = 0; k < x.shape[2]; ++k) {\n const indice =\n i * x.shape[1] * x.shape[2] + j * x.shape[2] + k;\n if (training) {\n if (maskedValue === 0) {\n expect(yValue[indice]).toEqual(0);\n } else {\n nKept++;\n expect(yValue[indice]).toBeCloseTo(1 / (1 - rate));\n }\n } else {\n nKept++;\n expect(yValue[indice]).toEqual(1);\n }\n }\n }\n }\n } else { // default noiseShape\n for (let i = 0; i < xValue.length; ++i) {\n if (yValue[i] !== 0) {\n nKept++;\n if (training) {\n expect(yValue[i]).toBeCloseTo(1 / (1 - rate));\n } else {\n expect(yValue[i]).toBeCloseTo(1);\n }\n }\n }\n }\n const numel = K.countParams(x);\n if (rate === 0 || !training) {\n expect(nKept).toEqual(numel);\n } else {\n expect(nKept).toBeLessThan(numel);\n }\n });\n }\n }\n }\n });\n\n describe('tensor with seed', () => {\n it('get specific value.', () => {\n const training = true;\n const rate = 0.5;\n const noiseShape = [2, 3, 4];\n const x = ones([2, 3, 4]);\n const seed = 23;\n const dropoutLayer = tfl.layers.dropout({rate, noiseShape, seed});\n const y = dropoutLayer.apply(x, {training}) as Tensor;\n const yValuesExpected = [\n 0, 2, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 0, 2, 2, 2, 0\n ];\n expectTensorsClose(y, tensor3d(yValuesExpected, [2, 3, 4]));\n });\n });\n});\n\ndescribeMathCPUAndGPU('SpatialDropout1D Layer', () => {\n for (const training of [false, true]) {\n for (const rate of [0.5, 0]) {\n it(`Forward: rate=${rate}; training=${training}`, () => {\n const layer = tfl.layers.spatialDropout1d({rate, seed: 1337});\n const xs = ones([2, 3, 4]);\n const ys = layer.apply(xs, {training}) as Tensor;\n if (!training || rate === 0) {\n expectTensorsClose(ys, xs);\n } else {\n expectTensorsClose(ys, tensor3d([\n [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],\n [[0, 2, 0, 0], [0, 2, 0, 0], [0, 2, 0, 0]]\n ]));\n }\n });\n }\n }\n\n it('Incorrect input shape: Symbolic', () => {\n const layer = tfl.layers.spatialDropout1d({rate: 0.5});\n const x = new SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n expect(() => layer.apply(x))\n .toThrowError(/.*expected ndim=3.*found ndim=4.*/);\n });\n\n it('Incorrect input shape: Concrete Tensor', () => {\n const layer = tfl.layers.spatialDropout1d({rate: 0.5});\n const x = ones([1, 2, 3, 4]);\n expect(() => layer.apply(x))\n .toThrowError(/.*expected ndim=3.*found ndim=4.*/);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.spatialDropout1d({rate: 0.3, seed: 1337});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.spatialDropout1d(tsConfig);\n expect(layerPrime.getConfig().rate).toEqual(0.3);\n expect(layerPrime.getConfig().seed).toEqual(1337);\n });\n});\n\ndescribeMathCPU('Dense Layer: Symbolic', () => {\n const units = 3;\n const activations: ActivationIdentifier[] =\n [null, 'linear', 'relu', 'softmax'];\n const symbolicInputs = [\n new tfl.SymbolicTensor('float32', [10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [14, 12, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 12, 10, 4], null, [], null),\n ];\n\n for (const activation of activations) {\n for (const symbolicInput of symbolicInputs) {\n it(`Generates correct symbolic output: ` +\n `activation=${activation}, ` +\n `input shape=${JSON.stringify(symbolicInput.shape)}`,\n () => {\n const denseLayer = tfl.layers.dense({units, activation});\n const output = denseLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n\n const expectedShape = symbolicInput.shape;\n expectedShape[expectedShape.length - 1] = units;\n expect(output.shape).toEqual(expectedShape);\n expect(output.sourceLayer).toEqual(denseLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n }\n }\n\n it('2D cascade: With undetermined dimension', () => {\n const input1 = new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n const denseLayer1 = tfl.layers.dense({units: 3});\n const output1 = denseLayer1.apply(input1) as tfl.SymbolicTensor;\n\n const denseLayer2 = tfl.layers.dense({units: 6});\n const output2 = denseLayer2.apply(output1) as tfl.SymbolicTensor;\n\n expect(output1.shape).toEqual([null, 3]);\n expect(output1.sourceLayer).toEqual(denseLayer1);\n expect(output1.inputs).toEqual([input1]);\n expect(output2.shape).toEqual([null, 6]);\n expect(output2.sourceLayer).toEqual(denseLayer2);\n expect(output2.inputs).toEqual([output1]);\n });\n\n it('Using 1D input leads to error', () => {\n const input = new tfl.SymbolicTensor('float32', [4], null, [], null);\n const denseLayer = tfl.layers.dense({units: 3});\n expect(() => denseLayer.apply(input)).toThrowError();\n });\n\n it('Different rank but compatible shape works', () => {\n const denseLayer = tfl.layers.dense({units: 3});\n const input1 = new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n const input2 =\n new tfl.SymbolicTensor('float32', [null, 6, 4], null, [], null);\n const output1 = denseLayer.apply(input1) as tfl.SymbolicTensor;\n expect(output1.shape).toEqual([null, 3]);\n expect(output1.sourceLayer).toEqual(denseLayer);\n expect(output1.inputs).toEqual([input1]);\n\n const output2 = denseLayer.apply(input2) as tfl.SymbolicTensor;\n expect(output2.shape).toEqual([null, 6, 3]);\n expect(output2.sourceLayer).toEqual(denseLayer);\n expect(output2.inputs).toEqual([input2]);\n });\n\n it('2D incompatible shape leads to error', () => {\n const denseLayer = tfl.layers.dense({units: 3});\n const input1 = new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n const input2 = new tfl.SymbolicTensor('float32', [null, 5], null, [], null);\n const output1 = denseLayer.apply(input1) as tfl.SymbolicTensor;\n expect(output1.shape).toEqual([null, 3]);\n expect(output1.sourceLayer).toEqual(denseLayer);\n expect(output1.inputs).toEqual([input1]);\n\n expect(() => {\n // tslint:disable-next-line:no-unused-expression\n denseLayer.apply(input2);\n }).toThrowError(/incompatible with layer .* axis -1/);\n });\n\n it('Invalid kernelInitializer', () => {\n expect(() => {\n // tslint:disable-next-line:no-unused-expression\n tfl.layers.dense({units: 4, kernelInitializer: 'invalid_initializer!'});\n }).toThrowError(/Unknown initializer/);\n });\n\n it('Invalid activation', () => {\n expect(() => {\n // tslint:disable-next-line:no-unused-expression no-any\n tfl.layers.dense({units: 4, activation: 'invalid_activation!' as any});\n }).toThrowError(/Unknown activation/);\n });\n\n it('Invalid units leads to Error', () => {\n expect(() => tfl.layers.dense({\n units: 10.9\n })).toThrowError(/units.*positive integer.*10\\.9\\.$/);\n expect(() => tfl.layers.dense({\n units: 0.5\n })).toThrowError(/units.*positive integer.*0\\.5\\.$/);\n expect(() => tfl.layers.dense({\n units: 0\n })).toThrowError(/units.*positive integer.*0\\.$/);\n expect(() => tfl.layers.dense({\n units: -2\n })).toThrowError(/units.*positive integer.*-2\\.$/);\n expect(() => tfl.layers.dense({\n // tslint:disable-next-line:no-any\n units: '2' as any\n })).toThrowError(/units.*positive integer.*\\\"2\\\"\\.$/);\n expect(() => tfl.layers.dense({\n // tslint:disable-next-line:no-any\n units: [] as any\n })).toThrowError('units is unexpectedly an empty array.');\n });\n});\n\ndescribeMathCPUAndGPU('Dense Layer: Tensor', () => {\n const units = 6;\n const useBiases = [null, false, true];\n const biasInitializers: InitializerIdentifier[] = ['zeros', 'ones'];\n const activations: ActivationIdentifier[] =\n [null, 'linear', 'relu', 'softmax'];\n const inputLastDims = [5, 8];\n // TODO(cais): Test Tensor1D, Tensor3D, Tensor4D once those are supported by\n // the backend.\n\n for (const useBias of useBiases) {\n for (const biasInitializer of biasInitializers) {\n for (const activation of activations) {\n for (const inputLastDim of inputLastDims) {\n it(`Call once: useBias=${useBias}, ` +\n `biasInitializer=${biasInitializer}, ` +\n `activation=${activation}, ` +\n `inputLastDim=${JSON.stringify(inputLastDim)}`,\n () => {\n const input = ones([2, inputLastDim]);\n const denseLayer = tfl.layers.dense({\n units,\n useBias,\n biasInitializer,\n activation,\n kernelInitializer: 'ones'\n });\n let expectedElementValue: number;\n if (activation === 'softmax') {\n expectedElementValue = 1 / units;\n } else {\n expectedElementValue = input.shape[input.shape.length - 1];\n if (useBias !== false && biasInitializer === 'ones') {\n expectedElementValue += 1;\n }\n }\n const expectedShape = input.shape.slice();\n expectedShape[expectedShape.length - 1] = units;\n let expectedOutput;\n if (input.rank === 2) {\n expectedOutput = tensor2d(\n pyListRepeat(\n expectedElementValue, arrayProd(expectedShape)),\n [expectedShape[0], expectedShape[1]]);\n }\n expectTensorsClose(\n denseLayer.apply(input, null) as Tensor, expectedOutput);\n });\n }\n }\n }\n }\n\n it('Calling apply again with incompatible shape leads to error', () => {\n const input1 = ones([2, 2]); // First call.\n const input2 = ones([3, 2]); // Okay.\n const input3 = ones([3, 3]); // Leads to error.\n\n const denseLayer = tfl.layers.dense({units: 4, kernelInitializer: 'ones'});\n expectTensorsClose(\n denseLayer.apply(input1) as Tensor,\n tensor2d([2, 2, 2, 2, 2, 2, 2, 2], [2, 4]));\n expectTensorsClose(\n denseLayer.apply(input2) as Tensor,\n tensor2d([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [3, 4]));\n expect(() => denseLayer.apply(input3)).toThrowError();\n });\n it('Calling apply with compatible symbolic input after Tensor input works',\n () => {\n const concreteInput = ones([2, 2]);\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [2, 2], null, [], null);\n const denseLayer =\n tfl.layers.dense({units: 4, kernelInitializer: 'ones'});\n\n expectTensorsClose(\n denseLayer.apply(concreteInput) as Tensor,\n tensor2d([2, 2, 2, 2, 2, 2, 2, 2], [2, 4]));\n\n const symbolicOuptut =\n denseLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(symbolicOuptut.shape).toEqual([2, 4]);\n expect(symbolicOuptut.sourceLayer).toEqual(denseLayer);\n expect(symbolicOuptut.inputs).toEqual([symbolicInput]);\n });\n it('Calling apply with incompatible symbolic input after Tensor', () => {\n const concreteInput = ones([2, 2]);\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [2, 3], null, [], null);\n const denseLayer = tfl.layers.dense({units: 4, kernelInitializer: 'ones'});\n\n expectTensorsClose(\n denseLayer.apply(concreteInput) as Tensor,\n tensor2d([2, 2, 2, 2, 2, 2, 2, 2], [2, 4]));\n\n expect(() => {\n // tslint:disable-next-line:no-unused-expression\n denseLayer.apply(symbolicInput);\n }).toThrowError(/incompatible with layer .* axis -1/);\n });\n});\n\ndescribe('Flatten Layer: Symbolic', () => {\n const symbolicInputs = [\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [14, 12, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 10, 4], null, [], null),\n new tfl.SymbolicTensor('float32', [null, 12, 10, 4], null, [], null),\n ];\n\n for (const symbolicInput of symbolicInputs) {\n it(`Generates correct symbolic output: no-arg constructor: ` +\n `input shape=${JSON.stringify(symbolicInput.shape)}`,\n () => {\n const flattenLayer = tfl.layers.flatten();\n const output = flattenLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n const expectedShape =\n [symbolicInput.shape[0], arrayProd(symbolicInput.shape, 1)];\n expect(output.shape).toEqual(expectedShape);\n expect(output.sourceLayer).toEqual(flattenLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it(`Generates correct symbolic output: empty one-arg constructor: ` +\n `input shape=${JSON.stringify(symbolicInput.shape)}`,\n () => {\n const flattenLayer = tfl.layers.flatten({});\n const output = flattenLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n const expectedShape =\n [symbolicInput.shape[0], arrayProd(symbolicInput.shape, 1)];\n expect(output.shape).toEqual(expectedShape);\n expect(output.sourceLayer).toEqual(flattenLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n }\n\n it('2D tfl.SymbolicTensor leads to error', () => {\n const flattenLayer = tfl.layers.flatten();\n const x = new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n expect(() => flattenLayer.apply(x)).toThrowError();\n });\n\n it('3D with undetermined input size leads to error', () => {\n const flattenLayer = tfl.layers.flatten({});\n const x = new tfl.SymbolicTensor('float32', [8, 4, null], null, [], null);\n expect(() => flattenLayer.apply(x)).toThrowError(/not fully defined/);\n });\n it('Serialization round trip', () => {\n const layer = tfl.layers.flatten({dataFormat: 'channelsFirst'});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.flatten(tsConfig);\n expect(layerPrime.getConfig().dataFormat).toEqual('channelsFirst');\n });\n});\n\ndescribeMathCPUAndGPU('Flatten Layer: Tensor', () => {\n it('Attempt to apply on Tensor2D leads to error', () => {\n const flattenLayer = tfl.layers.flatten();\n const x = tensor2d([[1, 3], [3, 3]], [2, 2]);\n expect(() => flattenLayer.apply(x)).toThrowError();\n });\n it('Flattens Tensor3D', () => {\n const flattenLayer = tfl.layers.flatten();\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n const expectedOutput =\n tensor2d([[10, 20, 30, 40], [-10, -20, -30, -40]], [2, 4]);\n expectTensorsClose(flattenLayer.apply(x, null) as Tensor, expectedOutput);\n });\n it('Flattens Tensor4D', () => {\n const flattenLayer = tfl.layers.flatten();\n const x = tensor4d(\n [\n [[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]],\n [[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]\n ],\n [2, 2, 2, 2]);\n const expectedOutput = tensor2d(\n [10, 20, 30, 40, -10, -20, -30, -40, 1, 2, 3, 4, -1, -2, -3, -4],\n [2, 8]);\n expectTensorsClose(flattenLayer.apply(x, null) as Tensor, expectedOutput);\n });\n it('Flattens Tensor4D, channelFirst', () => {\n const flattenLayer = tfl.layers.flatten({dataFormat: 'channelsFirst'});\n const x = tensor4d(\n [\n [[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]],\n [[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]\n ],\n [2, 2, 2, 2]);\n const expectedOutput = tensor2d(\n [10, -10, 20, -20, 30, -30, 40, -40, 1, -1, 2, -2, 3, -3, 4, -4],\n [2, 8]);\n expectTensorsClose(flattenLayer.apply(x, null) as Tensor, expectedOutput);\n });\n});\n\ndescribeMathCPUAndGPU('Activation Layer: Tensor', () => {\n const inputShape = [1];\n\n it('linear', () => {\n const x = mul(scalar(10), ones(inputShape));\n const layer = tfl.layers.activation({activation: 'linear'});\n const output = layer.apply(x) as Tensor;\n expectTensorsClose(output, x);\n });\n\n it('relu', () => {\n const x = mul(scalar(-5), ones(inputShape));\n const expectedValue = zeros(inputShape);\n const layer = tfl.layers.activation({activation: 'relu'});\n const output = layer.apply(x) as Tensor;\n expectTensorsClose(output, expectedValue);\n });\n\n it('sigmoid', () => {\n const val = 10;\n const x = mul(scalar(val), ones(inputShape));\n const expectedValue =\n mul(scalar(1 / (1 + Math.exp(-1 * val))), ones(inputShape));\n const layer = tfl.layers.activation({activation: 'sigmoid'});\n const output = layer.apply(x) as Tensor;\n expectTensorsClose(output, expectedValue);\n });\n\n it('softmax', () => {\n const x = mul(scalar(10), ones(inputShape));\n const expectedValue = ones(inputShape);\n const layer = tfl.layers.activation({activation: 'softmax'});\n const output = layer.apply(x) as Tensor;\n expectTensorsClose(output, expectedValue);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.activation({activation: 'relu'});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.activation(tsConfig);\n expect(layerPrime.getConfig().activation).toEqual('relu');\n });\n});\n\ndescribe('RepeatVector Layer: Symbolic', () => {\n it('All dimensions known.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [3, 4], null, [], null);\n const repeatVectorLayer = tfl.layers.repeatVector({n: 2});\n const output = repeatVectorLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([3, 2, 4]);\n expect(output.sourceLayer).toEqual(repeatVectorLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n});\n\ndescribeMathCPUAndGPU('RepeatVector Layer: Tensor', () => {\n it('With 2D tensor', () => {\n const repeatVectorLayer = tfl.layers.repeatVector({n: 3});\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const expectedOutput = tensor3d(\n [[[10, 20], [10, 20], [10, 20]], [[30, 40], [30, 40], [30, 40]]],\n [2, 3, 2]);\n expectTensorsClose(\n repeatVectorLayer.apply(x, null) as Tensor, expectedOutput);\n });\n});\n\ndescribe('Reshape Layer: Symbolic', () => {\n it('All dimensions known.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null);\n const targetShape = [5, 8];\n const flattenLayer = tfl.layers.reshape({targetShape});\n const output = flattenLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([12, 5, 8]);\n expect(output.sourceLayer).toEqual(flattenLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it('One unknown dimension.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null);\n const targetShape = [5, null];\n const flattenLayer = tfl.layers.reshape({targetShape});\n const output = flattenLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([12, 5, 8]);\n expect(output.sourceLayer).toEqual(flattenLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it('Incompatible size.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null);\n const targetShape = [8, 8];\n const flattenLayer = tfl.layers.reshape({targetShape});\n expect(() => flattenLayer.apply(symbolicInput))\n .toThrowError(/Total size of new array must be unchanged/);\n });\n\n it('Two unknown dimensions.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null);\n const targetShape: number[] = [null, null];\n const flattenLayer = tfl.layers.reshape({targetShape});\n expect(() => flattenLayer.apply(symbolicInput))\n .toThrowError(/Can only specifiy one unknown dimension/);\n });\n\n it('One unknown with indivisible size.', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null);\n const targetShape = [7, null];\n const flattenLayer = tfl.layers.reshape({targetShape});\n expect(() => flattenLayer.apply(symbolicInput))\n .toThrowError(/Total size of new array must be unchanged/);\n });\n\n it('Serialization round-trip', () => {\n const layer = tfl.layers.reshape({targetShape: [2, 3]});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.reshape(tsConfig);\n expect(layerPrime.getConfig().targetShape).toEqual([2, 3]);\n });\n});\n\ndescribeMathCPUAndGPU('Reshape Layer: Tensor', () => {\n it('Reshape Tensor3D to Tensor3D: All dimensions known', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [4, 1]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n const expectedOutput =\n tensor3d([10, 20, 30, 40, -10, -20, -30, -40], [2, 4, 1]);\n expectTensorsClose(reshapeLayer.apply(x, null) as Tensor, expectedOutput);\n });\n\n it('Reshape Tensor3D to Tensor2D: All dimensions known', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [4]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n const expectedOutput =\n tensor2d([10, 20, 30, 40, -10, -20, -30, -40], [2, 4]);\n expectTensorsClose(reshapeLayer.apply(x, null) as Tensor, expectedOutput);\n });\n\n it('Reshape Tensor2D to Tensor3D: All dimensions known', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [3, 2]});\n const x = tensor2d(\n [[10, 20, 30, 40, 50, 60], [-10, -20, -30, -40, -50, -60]], [2, 6]);\n const expectedOutput = tensor3d(\n [10, 20, 30, 40, 50, 60, -10, -20, -30, -40, -50, -60], [2, 3, 2]);\n expectTensorsClose(reshapeLayer.apply(x, null) as Tensor, expectedOutput);\n });\n\n for (const unknownDim of [-1, null]) {\n it(`Reshape Tensor2D to Tensor3D: Last dimension unknown as ${unknownDim}`,\n () => {\n const reshapeLayer =\n tfl.layers.reshape({targetShape: [3, unknownDim]});\n const x = tensor2d(\n [[10, 20, 30, 40, 50, 60], [-10, -20, -30, -40, -50, -60]],\n [2, 6]);\n const expectedOutput = tensor3d(\n [10, 20, 30, 40, 50, 60, -10, -20, -30, -40, -50, -60], [2, 3, 2]);\n expectTensorsClose(\n reshapeLayer.apply(x, null) as Tensor, expectedOutput);\n });\n\n it(`Reshape Tensor2D to Tensor3D: First dimension unknown as ${unknownDim}`,\n () => {\n const reshapeLayer =\n tfl.layers.reshape({targetShape: [unknownDim, 3]});\n const x = tensor2d(\n [[10, 20, 30, 40, 50, 60], [-10, -20, -30, -40, -50, -60]],\n [2, 6]);\n const expectedOutput = tensor3d(\n [10, 20, 30, 40, 50, 60, -10, -20, -30, -40, -50, -60], [2, 2, 3]);\n expectTensorsClose(\n reshapeLayer.apply(x, null) as Tensor, expectedOutput);\n });\n }\n\n it('Known but incompatible dimensions', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [3, 3]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n expect(() => reshapeLayer.apply(x, null))\n .toThrowError(/Total size of new array must be unchanged/);\n });\n\n it('Unknown and incompatible dimensions', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [3, null]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n expect(() => reshapeLayer.apply(x, null))\n .toThrowError(/Total size of new array must be unchanged/);\n });\n\n it('More than one unknown dimension.', () => {\n const reshapeLayer = tfl.layers.reshape({targetShape: [null, null]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n expect(() => reshapeLayer.apply(x, null))\n .toThrowError(/Can only specifiy one unknown dimension/);\n });\n});\n\ndescribe('Permute Layer: Symbolic', () => {\n it('1D Trivial', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n const dims = [1];\n const permuteLayer = tfl.layers.permute({dims});\n const output = permuteLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 4]);\n expect(output.sourceLayer).toEqual(permuteLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it('2D', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [null, 4, 6], null, [], null);\n const dims = [2, 1];\n const permuteLayer = tfl.layers.permute({dims});\n const output = permuteLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 6, 4]);\n expect(output.sourceLayer).toEqual(permuteLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it('3D', () => {\n const symbolicInput =\n new tfl.SymbolicTensor('float32', [null, 4, 6, 8], null, [], null);\n const dims = [3, 1, 2];\n const permuteLayer = tfl.layers.permute({dims});\n const output = permuteLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 8, 4, 6]);\n expect(output.sourceLayer).toEqual(permuteLayer);\n expect(output.inputs).toEqual([symbolicInput]);\n });\n\n it('Missing dims config leads to Error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.permute({} as any)).toThrowError(/dims.* missing/);\n });\n\n it('Non-Array dims config leads to Error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.permute({dims: 1} as any))\n .toThrowError(/requires.*dims.* to be an Array/);\n });\n\n it('Non-consecutive dims values leads to Error', () => {\n expect(() => tfl.layers.permute({\n dims: [1, 3]\n })).toThrowError(/Invalid permutation .*dims/);\n });\n\n it('Repeating dims values leads to Error', () => {\n expect(() => tfl.layers.permute({\n dims: [1, 1, 3]\n })).toThrowError(/Invalid permutation .*dims/);\n });\n\n it('Dims values containing 0 leads to Error', () => {\n expect(() => tfl.layers.permute({\n dims: [0, 1, 2]\n })).toThrowError(/Invalid permutation .*dims/);\n });\n\n it('Serialization round-trip', () => {\n const layer = tfl.layers.permute({dims: [1, 3, 2]});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.permute(tsConfig);\n expect(layerPrime.getConfig().dims).toEqual([1, 3, 2]);\n });\n});\n\ndescribe('Masking Layer: Symbolic', () => {\n it('computeOutputShape', () => {\n const layer = tfl.layers.masking();\n const inputShape = [null, 4, 6];\n const outputShape = layer.computeOutputShape(inputShape);\n expect(outputShape).toEqual([null, 4, 6]);\n });\n\n it('Serialization round-trip', () => {\n const layer = tfl.layers.masking({maskValue: -3});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.masking(tsConfig);\n expect(layerPrime.getConfig().maskValue).toEqual(-3);\n });\n});\n\ndescribeMathCPUAndGPU('Permute Layer: Tensor', () => {\n it('2D', () => {\n const permuteLayer = tfl.layers.permute({dims: [2, 1]});\n const x =\n tensor3d([[[10, 20], [30, 40]], [[-10, -20], [-30, -40]]], [2, 2, 2]);\n const expectedOutput =\n tensor3d([[[10, 30], [20, 40]], [[-10, -30], [-20, -40]]], [2, 2, 2]);\n expectTensorsClose(permuteLayer.apply(x) as Tensor, expectedOutput);\n });\n});\n\ndescribeMathCPUAndGPU('Masking Layer: Tensor', () => {\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Masking(input_shape=[3, 2]))\n // model.add(tf.keras.layers.SimpleRNN(\n // units=1,\n // recurrent_initializer='ones',\n // kernel_initializer='ones'))\n //\n // xs = np.array([[[1, 1], [1, 0], [0, 0]]], dtype=np.float32)\n // print(xs.shape)\n // ys = model.predict(xs)\n //\n // print(ys)\n // ```\n it('3D, default maskValue', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.masking({inputShape: [3, 2]}));\n model.add(tfl.layers.simpleRNN(\n {units: 1, recurrentInitializer: 'ones', kernelInitializer: 'ones'}));\n\n const xs = tensor3d([[[1, 1], [1, 0], [0, 0]]]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, tensor2d([[0.961396]]));\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Masking(mask_value=-1, input_shape=[3, 2]))\n // model.add(tf.keras.layers.SimpleRNN(\n // units=1,\n // recurrent_initializer='ones',\n // kernel_initializer='ones'))\n //\n // xs = np.array([[[1, 1], [1, -1], [-1, -1]]], dtype=np.float32)\n // print(xs.shape)\n // ys = model.predict(xs)\n //\n // print(ys)\n // ```\n it('3D, custom maskValue', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.masking({maskValue: -1, inputShape: [3, 2]}));\n model.add(tfl.layers.simpleRNN(\n {units: 1, recurrentInitializer: 'ones', kernelInitializer: 'ones'}));\n\n const xs = tensor3d([[[1, 1], [1, -1], [-1, -1]]]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, tensor2d([[0.746068]]));\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-layers/dist/layers/embeddings.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts deleted file mode 100644 index b02c6afea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Embedding Layer. - * - * Original source: keras/constraints.py - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { Shape } from '../keras_format/common'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs } from '../types'; -export declare interface EmbeddingLayerArgs extends LayerArgs { - /** - * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1. - */ - inputDim: number; - /** - * Integer >= 0. Dimension of the dense embedding. - */ - outputDim: number; - /** - * Initializer for the `embeddings` matrix. - */ - embeddingsInitializer?: InitializerIdentifier | Initializer; - /** - * Regularizer function applied to the `embeddings` matrix. - */ - embeddingsRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Constraint function applied to the `embeddings` matrix. - */ - embeddingsConstraint?: ConstraintIdentifier | Constraint; - /** - * Whether the input value 0 is a special "padding" value that should be - * masked out. This is useful when using recurrent layers which may take - * variable length input. - * - * If this is `True` then all subsequent layers in the model need to support - * masking or an exception will be raised. If maskZero is set to `True`, as a - * consequence, index 0 cannot be used in the vocabulary (inputDim should - * equal size of vocabulary + 1). - */ - maskZero?: boolean; - /** - * Length of input sequences, when it is constant. - * - * This argument is required if you are going to connect `flatten` then - * `dense` layers upstream (without it, the shape of the dense outputs cannot - * be computed). - */ - inputLength?: number | number[]; -} -export declare class Embedding extends Layer { - /** @nocollapse */ - static className: string; - private inputDim; - private outputDim; - private embeddingsInitializer; - private maskZero; - private inputLength; - private embeddings; - readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier; - private readonly embeddingsRegularizer?; - private readonly embeddingsConstraint?; - constructor(args: EmbeddingLayerArgs); - build(inputShape: Shape | Shape[]): void; - protected warnOnIncompatibleInputShape(inputShape: Shape): void; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js deleted file mode 100644 index 7ac068d42..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Embedding Layer. - * - * Original source: keras/constraints.py - */ -import { notEqual, serialization, tidy, zerosLike } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { Layer } from '../engine/topology'; -import { ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import * as generic_utils from '../utils/generic_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -export class Embedding extends Layer { - constructor(args) { - super(args); - this.embeddings = null; - this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - this.batchInputShape = [batchSize, null]; - } - else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - this.batchInputShape = - [batchSize].concat(generic_utils.toList(args.inputLength)); - } - } - this.inputDim = args.inputDim; - generic_utils.assertPositiveInteger(this.inputDim, 'inputDim'); - this.outputDim = args.outputDim; - generic_utils.assertPositiveInteger(this.outputDim, 'outputDim'); - this.embeddingsInitializer = getInitializer(args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER); - this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - this.maskZero = args.maskZero; - this.supportsMasking = args.maskZero; - this.inputLength = args.inputLength; - } - build(inputShape) { - this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); - this.built = true; - } - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - warnOnIncompatibleInputShape(inputShape) { } - computeMask(inputs, mask) { - return tidy(() => { - if (!this.maskZero) { - return null; - } - else { - inputs = getExactlyOneTensor(inputs); - return notEqual(inputs, zerosLike(inputs)); - } - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return [...inputShape, this.outputDim]; - } - // inputLength can be an array if input is 3D or higher. - const inLens = generic_utils.toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else { - let i = 0; - for (let k = 0; k < inLens.length; ++k) { - const s1 = inLens[k]; - const s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0], ...inLens, this.outputDim]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - let input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = K.cast(input, 'int32'); - } - const output = K.gather(this.embeddings.read(), input.as1D()); - return output.reshape(getExactlyOneShape(this.computeOutputShape(input.shape))); - }); - } - getConfig() { - const config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Embedding.className = 'Embedding'; -serialization.registerClass(Embedding); -//# sourceMappingURL=embeddings.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-layers/dist/layers/embeddings.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map deleted file mode 100644 index d1fac24c2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"embeddings.js","sourceRoot":"","sources":["../../src/layers/embeddings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAU,IAAI,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAmC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAC,KAAK,EAAY,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AACrC,OAAO,EAAC,cAAc,E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AAS,GAAG,WAAW,CAAC;AAoIjC,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map deleted file mode 100644 index dbc30c6de..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"embeddings_test.js","sourceRoot":"","sources":["../../src/layers/embeddings_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAmB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAExE,MAAM,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC;AAEtD,eAAe,CAAC,wCAAwC,EAAE,GAAG,EAAE;IAC7D,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,CAAC,CA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* @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for embedding.ts.\n */\n\nimport {DataType, Tensor, tensor2d, tensor3d, test_util} from '@tensorflow/tfjs-core';\n\nimport * as tfl from '../index';\nimport {describeMathCPU, expectTensorsClose} from '../utils/test_utils';\n\nconst expectArraysClose = test_util.expectArraysClose;\n\ndescribeMathCPU('Embedding Layers: Symbolic 1D, 2D & 3D', () => {\n const inputShapes = [[1], [5], [1, 20], [2, 3, 4]];\n const outputDims = [1, 7, 47];\n const batchDim = 17;\n const inputDim = 100;\n for (const inputShape of inputShapes) {\n for (const outputDim of outputDims) {\n const testTitle = `inputShape=${inputShape}, outputDim=${outputDim}`;\n it(testTitle, () => {\n const embeddingLayer = tfl.layers.embedding({inputDim, outputDim});\n const fullInputShape = [batchDim].concat(inputShape);\n const symbolicInput =\n new tfl.SymbolicTensor('float32', fullInputShape, null, [], null);\n const output =\n embeddingLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n const expectedShape = [batchDim].concat(inputShape).concat([outputDim]);\n expect(output.shape).toEqual(expectedShape);\n });\n }\n }\n\n it('Invalid inputDim leads to Error', () => {\n expect(() => tfl.layers.embedding({inputDim: 12.5, outputDim: 4}))\n .toThrowError(/inputDim.*positive integer.*12\\.5\\.$/);\n expect(() => tfl.layers.embedding({inputDim: 0, outputDim: 4}))\n .toThrowError(/inputDim.*positive integer.*0\\.$/);\n expect(() => tfl.layers.embedding({inputDim: -123, outputDim: 4}))\n .toThrowError(/inputDim.*positive integer.*-123\\.$/);\n });\n\n it('Invalid outputDim leads to Error', () => {\n expect(() => tfl.layers.embedding({inputDim: 8, outputDim: 16.5}))\n .toThrowError(/outputDim.*positive integer.*16\\.5\\.$/);\n expect(() => tfl.layers.embedding({inputDim: 8, outputDim: 0}))\n .toThrowError(/outputDim.*positive integer.*0\\.$/);\n expect(() => tfl.layers.embedding({inputDim: 8, outputDim: -32}))\n .toThrowError(/outputDim.*positive integer.*-32\\.$/);\n });\n});\n\ndescribeMathCPU('Embedding Layers: With explicit inputLength', () => {\n const inputShape = [null, 4, 5];\n const outputDim = 7;\n const inputLengths = [[null, 4, 5], [null, null, 5], [null, null, null]];\n const batchDim = 17;\n for (const inputLength of inputLengths) {\n const testTitle = `inputLength=${inputLength}`;\n it(testTitle, () => {\n const inputDim = 100;\n const embeddingLayer =\n tfl.layers.embedding({inputDim, outputDim, inputLength});\n const fullInputShape = [batchDim].concat(inputShape);\n const symbolicInput =\n new tfl.SymbolicTensor('float32', fullInputShape, null, [], null);\n const output = embeddingLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n const expectedShape = [batchDim].concat(inputShape).concat([outputDim]);\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n});\n\ndescribeMathCPU('Embedding Layers: Tensor', () => {\n it('check value equality', () => {\n const x = tensor3d([0, 5, 1, 1, 1, 1, 1, 1], [1, 2, 4]);\n const embeddingLayer = tfl.layers.embedding(\n {inputDim: 6, outputDim: 3, embeddingsInitializer: 'randomUniform'});\n const y = embeddingLayer.apply(x) as Tensor;\n const yExpectedShape = [1, 2, 4, 3];\n expect(y.shape).toEqual(yExpectedShape);\n const weights = embeddingLayer.getWeights()[0];\n expect(embeddingLayer.computeOutputShape(x.shape)).toEqual(yExpectedShape);\n // Collect embedded output elements.\n const yData0 = y.slice([0, 0, 0, 0], [1, 1, 1, 3]).dataSync();\n const yData1 = y.slice([0, 0, 1, 0], [1, 1, 1, 3]).dataSync();\n const yData2 = y.slice([0, 0, 2, 0], [1, 1, 1, 3]).dataSync();\n const yData3 = y.slice([0, 0, 3, 0], [1, 1, 1, 3]).dataSync();\n // Collect sample embedding rows.\n const wData0 = weights.slice([0, 0], [1, 3]).dataSync();\n const wData1 = weights.slice([1, 0], [1, 3]).dataSync();\n const wData5 = weights.slice([5, 0], [1, 3]).dataSync();\n // First output should match first embedding row.\n expectArraysClose(yData0, wData0);\n // First output should *not* match second embedding row\n expect(() => {\n expectArraysClose(yData0, wData1);\n }).toThrow();\n // Second output should match 6th embedding row.\n expectArraysClose(yData1, wData5);\n // Second output should *not* match first embedding row.\n expect(() => {\n expectArraysClose(yData1, wData0);\n }).toThrow();\n // Third output should match fourth output (same embedding index);\n expectArraysClose(yData2, yData3);\n });\n\n const dtypes: DataType[] = ['int32', 'float32'];\n for (const dtype of dtypes) {\n it(`Works with '${dtype}' dtype input`, () => {\n // Input values are [0, 0, 1] with type 'float32'\n const x = tensor2d([[0], [0], [1]], [3, 1], dtype);\n const embeddingLayer = tfl.layers.embedding(\n {inputDim: 6, outputDim: 4, embeddingsInitializer: 'randomUniform'});\n const y = embeddingLayer.apply(x) as Tensor;\n // Collect embedded output elements.\n const yData0 = y.slice([0, 0, 0], [1, 1, 3]).dataSync();\n const yData1 = y.slice([1, 0, 0], [1, 1, 3]).dataSync();\n const yData2 = y.slice([2, 0, 0], [1, 1, 3]).dataSync();\n // First output should match second output.\n expectArraysClose(yData0, yData1);\n // First output should not match third output.\n expect(() => {\n expectArraysClose(yData0, yData2);\n }).toThrow();\n });\n\n it('computeMask: maskZero = false', () => {\n const embeddingLayer = tfl.layers.embedding({\n inputDim: 6,\n outputDim: 4,\n embeddingsInitializer: 'randomUniform',\n maskZero: false\n });\n const x = tensor2d([[0], [0], [2]], [3, 1], dtype);\n const y = embeddingLayer.computeMask(x);\n expect(y).toBeNull();\n });\n\n it('computeMask: maskZero = true', () => {\n const embeddingLayer = tfl.layers.embedding({\n inputDim: 6,\n outputDim: 4,\n embeddingsInitializer: 'randomUniform',\n maskZero: true\n });\n const x = tensor2d([[0], [0], [2]], [3, 1], dtype);\n const y = embeddingLayer.computeMask(x);\n expectTensorsClose(y, tensor2d([[0], [0], [1]], [3, 1], 'bool'));\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-layers/dist/layers/merge.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts deleted file mode 100644 index 13a1332ae..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts +++ /dev/null @@ -1,404 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Layer, LayerArgs, SymbolicTensor } from '../engine/topology'; -import { Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -/** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ -export declare abstract class Merge extends Layer { - protected reshapeRequired: boolean; - constructor(args?: LayerArgs); - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - protected mergeFunction(inputs: Tensor[]): Tensor; - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - private computeElementwiseOpOutputShape; - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; -} -export declare class Add extends Merge { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - protected mergeFunction(inputs: Tensor[]): Tensor; -} -/** - * Calculate the element-wise sum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Add` layer, by using no input argument - * or a single configuration argument. The resultant `Add` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const addLayer = tf.layers.add(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = addLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.add([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.add([input1, input2]).print(); - * // Gives [[11, 22], [33, 44]]. - * - */ -export declare function add(config?: SymbolicTensor[] | Tensor[] | LayerArgs): Layer | SymbolicTensor | Tensor; -export declare class Multiply extends Merge { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - protected mergeFunction(inputs: Tensor[]): Tensor; -} -/** - * Calculate the element-wise product of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Multiply` layer, by using no input argument - * or a single configuration argument. The resultant `Multiply` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const multiplyLayer = tf.layers.multiply(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = multiplyLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.multiply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.multiply([input1, input2]).print(); - * // Gives [[10, 40], [90, 160]]. - * - */ -export declare function multiply(config?: SymbolicTensor[] | Tensor[] | LayerArgs): Layer | SymbolicTensor | Tensor; -export declare class Average extends Merge { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - protected mergeFunction(inputs: Tensor[]): Tensor; -} -/** - * Calculate the element-wise arithmetic mean of inputs, which all have the same - * shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Average` layer, by using no input argument - * or a single configuration argument. The resultant `Average` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const averageLayer = tf.layers.average(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = averageLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.average([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.average([input1, input2]).print(); - * // Gives [[5.5, 11], [16.5, 22]]. - * - */ -export declare function average(config?: SymbolicTensor[] | Tensor[] | LayerArgs): Layer | SymbolicTensor | Tensor; -export declare class Maximum extends Merge { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - protected mergeFunction(inputs: Tensor[]): Tensor; -} -/** - * Calculate the element-wise maximum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Maximum` layer, by using no input argument - * or a single configuration argument. The resultant `Maximum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const maximumLayer = tf.layers.maximum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = maximumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.maximum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.maximum([input1, input2]).print(); - * // Gives [[10, 20], [30, 40]]. - * - */ -export declare function maximum(config?: SymbolicTensor[] | Tensor[] | LayerArgs): Layer | SymbolicTensor | Tensor; -export declare class Minimum extends Merge { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - protected mergeFunction(inputs: Tensor[]): Tensor; -} -/** - * Calculate the element-wise minimum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Minimum` layer, by using no input argument - * or a single configuration argument. The resultant `Minimum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const minimumLayer = tf.layers.minimum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = minimumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.minimum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.minimum([input1, input2]).print(); - * // Gives [[1, 2], [3, 4]]. - * - */ -export declare function minimum(config?: SymbolicTensor[] | Tensor[] | LayerArgs): Layer | SymbolicTensor | Tensor; -export declare interface ConcatenateLayerArgs extends LayerArgs { - /** - * Axis along which to concatenate. - */ - axis?: number; -} -export declare class Concatenate extends Merge { - /** @nocollapse */ - static className: string; - readonly DEFAULT_AXIS = -1; - private readonly axis; - constructor(args?: ConcatenateLayerArgs); - build(inputShape: Shape | Shape[]): void; - protected mergeFunction(inputs: Tensor[]): Tensor; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; - getConfig(): serialization.ConfigDict; -} -/** - * Concatenate an `Array` of inputs. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Concatenate` layer, by using no input argument - * or a single configuration argument. The resultant `Concatenate` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const concatLayer = tf.layers.concatenate(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = concatLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 7], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = tf.layers.concatenate([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); - * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]); - * tf.layers.concatenate([input1, input2]).print(); - * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]]. - * - */ -export declare function concatenate(config?: SymbolicTensor[] | Tensor[] | ConcatenateLayerArgs): Layer | SymbolicTensor | Tensor; -export declare interface DotLayerArgs extends LayerArgs { - /** - * Axis or axes along which the dot product will be taken. - * - * Integer or an Array of integers. - */ - axes: number | [number, number]; - /** - * Whether to L2-normalize samples along the dot product axis - * before taking the dot product. - * - * If set to `true`, the output of the dot product isthe cosine - * proximity between the two samples. - */ - normalize?: boolean; -} -export declare class Dot extends Merge { - /** @nocollapse */ - static className: string; - private axes; - private normalize; - constructor(args: DotLayerArgs); - build(inputShape: Shape | Shape[]): void; - protected mergeFunction(inputs: Tensor[]): Tensor; - private interpretAxes; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js deleted file mode 100644 index bff53ca91..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js +++ /dev/null @@ -1,981 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Merge Layers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy, util } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { Layer } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { l2Normalize } from '../losses'; -import * as generic_utils from '../utils/generic_utils'; -import * as mathUtils from '../utils/math_utils'; -import { getExactlyOneShape } from '../utils/types_utils'; -/** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ -export class Merge extends Layer { - constructor(args) { - super(args || {}); - this.supportsMasking = true; - } - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - mergeFunction(inputs) { - throw new NotImplementedError(); - } - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - computeElementwiseOpOutputShape(shape1, shape2) { - if (shape1 == null || shape2 == null) { - return null; - } - else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } - else if (shape2.length === 0) { - return shape1; - } - const outputShape = shape1.slice(0, shape1.length - shape2.length); - for (let k = 0; k < shape2.length; ++k) { - const i = shape1[shape1.length - shape2.length + k]; - const j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } - else if (i === 1) { - outputShape.push(j); - } - else if (j === 1) { - outputShape.push(i); - } - else { - if (i !== j) { - throw new ValueError('Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - } - build(inputShape) { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape; - if (inputShape.length < 2) { - throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + - ` Got ${inputShape.length} input(s).`); - } - // Make sure that there is at most one unique batch size among the input - // shapes. - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = generic_utils.unique(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError(`Can not merge tensors with different batch sizes. ` + - `Got tensors with shapes: ${JSON.stringify(inputShape)}.`); - } - let outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - const allRanks = inputShape.map(shape => shape.length); - if (inputShape.indexOf(null) === -1 && - generic_utils.unique(allRanks).length === 1) { - this.reshapeRequired = false; - } - else { - this.reshapeRequired = true; - } - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (this.reshapeRequired) { - const reshapedInputs = []; - const inputDims = inputs.map(input => input.rank); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - const maxNDim = mathUtils.max(inputDims); - for (let x of inputs) { - const xNDim = x.rank; - for (let k = 0; k < maxNDim - xNDim; ++k) { - x = K.expandDims(x, 1); - } - reshapedInputs.push(x); - } - return this.mergeFunction(reshapedInputs); - } - else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - let transposed = false; - for (const x of inputs) { - const xNDim = x.rank; - if (xNDim == null) { - const xShape = x.shape; - const batchSize = xShape[0]; - const newShape = xShape.slice(1).concat([batchSize]); - let xTransposed = x.reshape([batchSize].concat(mathUtils.arrayProd(xShape.slice(1)))); - xTransposed = tfc.transpose(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } - else if (xNDim > 1) { - const dims = mathUtils.range(1, xNDim).concat([0]); - reshapedInputs.push(tfc.transpose(x, dims)); - transposed = true; - } - else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - let y = this.mergeFunction(reshapedInputs); - const yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - const yShape = y.shape; - const yNDim = yShape.length; - const batchSize = yShape[yNDim - 1]; - const newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } - else if (yNDim > 1) { - const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1)); - y = tfc.transpose(y, dims); - } - } - return y; - } - } - else { - return this.mergeFunction(inputs); - } - }); - } - computeOutputShape(inputShape) { - inputShape = inputShape; - let outputShape; - if (inputShape[0] == null) { - outputShape = null; - } - else { - outputShape = inputShape[0].slice(1); - } - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = generic_utils.unique(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } - else { - outputShape = [null].concat(outputShape); - } - return outputShape; - } - computeMask(inputs, mask) { - return tfc.tidy(() => { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`The Array 'inputs' and 'mask' are expected to have the same ` + - `length, but have different lengths ` + - `(${inputs.length} vs ${mask.length})`); - } - if (mask.every(m => m == null)) { - return null; - } - mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0)); - let output = mask[0]; - for (let i = 1; i < mask.length - 1; ++i) { - output = tfc.logicalAnd(output, mask[i]); - } - return output; - }); - } -} -export class Add extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Add.className = 'Add'; -serialization.registerClass(Add); -/** - * Calculate the element-wise sum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Add` layer, by using no input argument - * or a single configuration argument. The resultant `Add` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const addLayer = tf.layers.add(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = addLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.add([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.add([input1, input2]).print(); - * // Gives [[11, 22], [33, 44]]. - * - */ -export function add(config) { - if (Array.isArray(config)) { - const layer = new Add({}); - return layer.apply(config); - } - else { - return new Add(config); - } -} -export class Multiply extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.mul(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Multiply.className = 'Multiply'; -serialization.registerClass(Multiply); -/** - * Calculate the element-wise product of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Multiply` layer, by using no input argument - * or a single configuration argument. The resultant `Multiply` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const multiplyLayer = tf.layers.multiply(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = multiplyLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.multiply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.multiply([input1, input2]).print(); - * // Gives [[10, 40], [90, 160]]. - * - */ -export function multiply(config) { - if (Array.isArray(config)) { - const layer = new Multiply({}); - return layer.apply(config); - } - else { - return new Multiply(config); - } -} -export class Average extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return tfc.mul(1 / inputs.length, output); - }); - } -} -/** @nocollapse */ -Average.className = 'Average'; -serialization.registerClass(Average); -/** - * Calculate the element-wise arithmetic mean of inputs, which all have the same - * shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Average` layer, by using no input argument - * or a single configuration argument. The resultant `Average` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const averageLayer = tf.layers.average(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = averageLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.average([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.average([input1, input2]).print(); - * // Gives [[5.5, 11], [16.5, 22]]. - * - */ -export function average(config) { - if (Array.isArray(config)) { - const layer = new Average({}); - return layer.apply(config); - } - else { - return new Average(config); - } -} -export class Maximum extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.maximum(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Maximum.className = 'Maximum'; -serialization.registerClass(Maximum); -/** - * Calculate the element-wise maximum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Maximum` layer, by using no input argument - * or a single configuration argument. The resultant `Maximum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const maximumLayer = tf.layers.maximum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = maximumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.maximum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.maximum([input1, input2]).print(); - * // Gives [[10, 20], [30, 40]]. - * - */ -export function maximum(config) { - if (Array.isArray(config)) { - const layer = new Maximum({}); - return layer.apply(config); - } - else { - return new Maximum(config); - } -} -export class Minimum extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.minimum(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Minimum.className = 'Minimum'; -serialization.registerClass(Minimum); -/** - * Calculate the element-wise minimum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Minimum` layer, by using no input argument - * or a single configuration argument. The resultant `Minimum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const minimumLayer = tf.layers.minimum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = minimumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.minimum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.minimum([input1, input2]).print(); - * // Gives [[1, 2], [3, 4]]. - * - */ -export function minimum(config) { - if (Array.isArray(config)) { - const layer = new Minimum({}); - return layer.apply(config); - } - else { - return new Minimum(config); - } -} -export class Concatenate extends Merge { - constructor(args) { - super(args); - this.DEFAULT_AXIS = -1; - if (args == null) { - args = {}; - } - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape; - let allNoneShape = true; - for (const shape of inputShape) { - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - const shapeSet = []; - for (let i = 0; i < inputShape.length; ++i) { - const shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - let exists = false; - for (const shape of shapeSet) { - if (util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - } - mergeFunction(inputs) { - return tidy(() => { - return K.concatenate(inputs, this.axis); - }); - } - computeOutputShape(inputShape) { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); - } - const inputShapes = inputShape; - const outputShape = inputShapes[0].slice(); - const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (const shape of inputShapes.slice(1)) { - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - } - computeMask(inputs, mask) { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`Mismatch in the length of mask (${mask.length}) ` + - `and the legnth of inputs (${inputs.length})`); - } - return tfc.tidy(() => { - let allNullMasks = true; - mask.forEach(m => { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - const outputMasks = []; - for (let i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(tfc.onesLike(inputs[i]).asType('bool')); - } - else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(tfc.expandDims(mask[i], -1)); - } - else { - outputMasks.push(mask[i]); - } - } - const concatenatedMasks = tfc.concat(outputMasks, this.axis); - return tfc.all(concatenatedMasks, -1, false); - }); - } - getConfig() { - const config = { - 'axis': this.axis, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Concatenate.className = 'Concatenate'; -serialization.registerClass(Concatenate); -/** - * Concatenate an `Array` of inputs. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Concatenate` layer, by using no input argument - * or a single configuration argument. The resultant `Concatenate` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const concatLayer = tf.layers.concatenate(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = concatLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 7], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = tf.layers.concatenate([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); - * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]); - * tf.layers.concatenate([input1, input2]).print(); - * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]]. - * - */ -export function concatenate(config) { - if (Array.isArray(config)) { - const layer = new Concatenate({}); - return layer.apply(config); - } - else { - return new Concatenate(config); - } -} -/** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ -function interpretAxis(axis, dim) { - while (axis < 0) { - axis += dim; - } - return axis; -} -function batchDot(x, y, axes) { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError('batchDot is not implemented for tensors of 4D or higher rank yet'); - } - tfc.util.assert(x.shape.length >= 2, () => `batchDot requires the rank of x to be >= 2, ` + - `but got ${x.shape.length}`); - tfc.util.assert(x.shape.length >= 2, () => `batchDot requires the rank of y to be >= 2, ` + - `but got ${y.shape.length}`); - if (typeof axes === 'number') { - axes = [axes, axes]; - } - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError('batchDot is not implemented for complex64-type Tensors yet.'); - } - const xNDim = x.shape.length; - const yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - const axesArray = axes; - return tfc.tidy(() => { - let diff; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } - else if (yNDim > xNDim) { - diff = yNDim - xNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } - else { - diff = 0; - } - let out; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } - else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } - else { - const adjX = axesArray[0] !== x.shape.length - 1; - const adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - if (diff > 0) { - let idx; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } - else { - idx = xNDim - 1; - } - const squeezeAxes = []; - for (let i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); -} -export class Dot extends Merge { - constructor(args) { - super(args); - this.axes = args.axes; - this.normalize = args.normalize == null ? false : args.normalize; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0]; - const shape2 = inputShape[1]; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError(`Dimension incompatibility: ` + - `${shape1[axes[0]]} !== ${shape2[axes[1]]}`); - } - } - mergeFunction(inputs) { - if (inputs.length !== 2) { - throw new ValueError('A `Dot` layer must be called on exactly 2 inputs, ' + - `but received ${inputs.length} input(s).`); - } - let x1 = inputs[0]; - let x2 = inputs[1]; - let axes; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } - else { - axes = this.axes.map((axis, i) => interpretAxis(axis, inputs[i].shape.length)); - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - } - interpretAxes(shape1, shape2) { - let axes; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } - else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - } - computeOutputShape(inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0].slice(); - const shape2 = inputShape[1].slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - const outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - } - computeMask(inputs, mask) { - return null; - } - getConfig() { - const config = { - 'axes': this.axes, - 'normalize': this.normalize - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Dot.className = 'Dot'; -serialization.registerClass(Dot); -// TODO(cais): Add functional interfaces for the merge layers. -//# sourceMappingURL=merge.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-layers/dist/layers/merge.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map deleted file mode 100644 index 94ffb0b7a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/layers/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAU,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,KAAK,EAA4B,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,C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,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACrB;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,WAAW,CAAC,MAAuB,EAAE,IAAsB;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAA6B;YACvC,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,WAAW,EAAE,IAAI,CAAC,SAAS;SAC5B,CAAC;QACF,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;;AA/GD,kBAAkB;AACX,aAAS,GAAG,KAAK,CAAC;AAgH3B,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAEjC,8DAA8D","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map deleted file mode 100644 index 95ebcdb06..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"merge_test.js","sourceRoot":"","sources":["../../src/layers/merge_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,IAAI,EAAyB,QAAQ,EAAY,QAAQ,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAG1G,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,OAA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C,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,wDAAwD;QACxD,MAAM,GAAG,GACL,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAW,CAAC;QAC/C,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for core.ts.\n */\n\nimport {ones, serialization, Tensor, tensor1d, Tensor2D, tensor2d, tensor3d} from '@tensorflow/tfjs-core';\n\nimport {SymbolicTensor} from '../engine/topology';\nimport * as tfl from '../index';\nimport {Shape} from '../keras_format/common';\nimport {deserialize} from '../layers/serialization';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {Add, Average, Concatenate, Maximum, Minimum, Multiply} from './merge';\n\ndescribeMathCPU('Merge Layers Except Concatenate: Symbolic', () => {\n const layers = [Add, Average, Multiply, Maximum, Minimum];\n const symbolicInputShapes: Shape[] = [\n [10, 3],\n [10, 2, 2],\n ];\n const numInputsArray: number[] = [2, 4];\n\n for (const layer of layers) {\n for (const inputShape of symbolicInputShapes) {\n for (const numInputs of numInputsArray) {\n const testTitle =\n `layer=${layer.name}; inputShape=${JSON.stringify(inputShape)}; ` +\n `numInputs=${numInputs}`;\n it(testTitle, () => {\n const addLayer = new layer({name: layer.name});\n const symbolicInputs: tfl.SymbolicTensor[] = [];\n for (let i = 0; i < numInputs; ++i) {\n symbolicInputs.push(\n new tfl.SymbolicTensor('float32', inputShape, null, [], null));\n }\n const output = addLayer.apply(symbolicInputs) as tfl.SymbolicTensor;\n expect(output.dtype).toEqual(symbolicInputs[0].dtype);\n expect(output.shape).toEqual(inputShape);\n });\n }\n }\n }\n\n it('Single input leads to exception', () => {\n const x = new tfl.SymbolicTensor('float32', [2, 2], null, [], null);\n const addLayer = tfl.layers.add({name: 'Add'});\n expect(() => {\n addLayer.apply([x]);\n }).toThrowError(/.*at least 2 inputs\\. Got 1 input.*/);\n });\n\n it('Non-unique batch sizes to exception', () => {\n const x1 = new tfl.SymbolicTensor('float32', [1, 2], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [2, 2], null, [], null);\n const addLayer = tfl.layers.add({name: 'Add'});\n expect(() => {\n addLayer.apply([x1, x2]);\n }).toThrowError(/Can not merge tensors with different batch sizes/);\n });\n});\n\ndescribeMathCPUAndGPU('Add-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect((tfl.layers.add()).getClassName()).toEqual('Add');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect((tfl.layers.add({name: 'addLayer'})).name.indexOf('addLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 2]});\n const input2 = tfl.layers.input({shape: [2, 2]});\n const output =\n tfl.layers.add().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 2]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([1, 2, 3, 4], [2, 2]);\n const input2 = tensor2d([10, 20, 30, 40], [2, 2]);\n const output = tfl.layers.add().apply([input1, input2]) as Tensor;\n expectTensorsClose(output, tensor2d([11, 22, 33, 44], [2, 2]));\n });\n\n it('predict() with functional model with Add layer works', () => {\n const input = tfl.layers.input({shape: [24, 24, 3]});\n const conv1 =\n tfl.layers.conv2d({filters: 4, kernelSize: [3, 3]}).apply(input) as\n tfl.SymbolicTensor;\n const conv2 =\n tfl.layers.conv2d({filters: 4, kernelSize: [3, 3]}).apply(input) as\n tfl.SymbolicTensor;\n const sum = tfl.layers.add().apply([conv1, conv2]) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input], outputs: sum});\n const x = ones([1, 24, 24, 3]);\n const y = model.predict(x) as Tensor;\n expect(y.shape).toEqual([1, 22, 22, 4]);\n });\n});\n\ndescribeMathCPUAndGPU('Multiply-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect(tfl.layers.multiply().getClassName()).toEqual('Multiply');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect(tfl.layers.multiply({name: 'multiplyLayer'})\n .name.indexOf('multiplyLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 2]});\n const input2 = tfl.layers.input({shape: [2, 2]});\n const output =\n tfl.layers.multiply().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 2]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([1, 2, 3, 4], [2, 2]);\n const input2 = tensor2d([10, 20, 30, 40], [2, 2]);\n const output = tfl.layers.multiply().apply([input1, input2]) as Tensor;\n expectTensorsClose(output, tensor2d([10, 40, 90, 160], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Average-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect(tfl.layers.average().getClassName()).toEqual('Average');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect(\n tfl.layers.average({name: 'averageLayer'}).name.indexOf('averageLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 2]});\n const input2 = tfl.layers.input({shape: [2, 2]});\n const output =\n tfl.layers.average().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 2]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([1, 2, 3, 4], [2, 2]);\n const input2 = tensor2d([10, 20, 30, 40], [2, 2]);\n const output = tfl.layers.average().apply([input1, input2]) as Tensor;\n expectTensorsClose(output, tensor2d([5.5, 11, 16.5, 22], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Maximum-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect(tfl.layers.maximum().getClassName()).toEqual('Maximum');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect(\n tfl.layers.maximum({name: 'maximumLayer'}).name.indexOf('maximumLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 2]});\n const input2 = tfl.layers.input({shape: [2, 2]});\n const output =\n tfl.layers.maximum().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 2]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([1, 20, 3, 40], [2, 2]);\n const input2 = tensor2d([10, 2, 30, 4], [2, 2]);\n const output = tfl.layers.maximum().apply([input1, input2]) as Tensor;\n expectTensorsClose(output, tensor2d([10, 20, 30, 40], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Minimum-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect(tfl.layers.minimum().getClassName()).toEqual('Minimum');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect(\n tfl.layers.minimum({name: 'minimumLayer'}).name.indexOf('minimumLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 2]});\n const input2 = tfl.layers.input({shape: [2, 2]});\n const output =\n tfl.layers.minimum().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 2]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([1, 20, 3, 40], [2, 2]);\n const input2 = tensor2d([10, 2, 30, 4], [2, 2]);\n const output = tfl.layers.minimum().apply([input1, input2]) as Tensor;\n expectTensorsClose(output, tensor2d([1, 2, 3, 4], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Concatenate-Functional', () => {\n it('Calling without arg returns Layer', () => {\n expect(tfl.layers.concatenate().getClassName()).toEqual('Concatenate');\n });\n\n it('Calling with config arg returns Layer', () => {\n expect(tfl.layers.concatenate({name: 'concatenateLayer'})\n .name.indexOf('concatenateLayer'))\n .toEqual(0);\n });\n\n it('Calling with symbolic tensors returns symbolic tensor', () => {\n const input1 = tfl.layers.input({shape: [2, 3]});\n const input2 = tfl.layers.input({shape: [2, 4]});\n const output =\n tfl.layers.concatenate().apply([input1, input2]) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([null, 2, 7]);\n });\n\n it('Calling with tensors returns tensor', () => {\n const input1 = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const input2 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const output = tfl.layers.concatenate().apply([input1, input2]) as Tensor;\n expectTensorsClose(\n output, tensor2d([[1, 2, 10, 20], [3, 4, 30, 40]], [2, 4]));\n });\n});\n\ndescribeMathCPU('Concatenate Layer: Symbolic', () => {\n it('All known shapes', () => {\n const x1 = new tfl.SymbolicTensor('float32', [2, 3, 4], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [2, 3, 4], null, [], null);\n const layer0 = tfl.layers.concatenate({});\n expect((layer0.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n 2, 3, 8\n ]);\n const layer1 = tfl.layers.concatenate({axis: -1});\n expect((layer1.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n 2, 3, 8\n ]);\n const layer2 = tfl.layers.concatenate({axis: 0});\n expect((layer2.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n 4, 3, 4\n ]);\n const layer3 = tfl.layers.concatenate({axis: 1});\n expect((layer3.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n 2, 6, 4\n ]);\n });\n it('Concat axis has unknown shape', () => {\n const x1 = new tfl.SymbolicTensor('float32', [2, null, 4], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [2, null, 4], null, [], null);\n const layer = tfl.layers.concatenate({axis: 1});\n expect((layer.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n 2, null, 4\n ]);\n });\n it('Non-concat axis has unknown shape', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 3, 4], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 5, 4], null, [], null);\n const layer = tfl.layers.concatenate({axis: 1});\n expect((layer.apply([x1, x2]) as tfl.SymbolicTensor).shape).toEqual([\n null, 8, 4\n ]);\n });\n it('Incompatible shape leads to error', () => {\n const x1 = new tfl.SymbolicTensor('float32', [2, 3, 5], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [2, 4, 5], null, [], null);\n const layer = tfl.layers.concatenate({});\n expect(() => layer.apply([\n x1, x2\n ])).toThrowError(/requires inputs with matching shapes except/);\n });\n it('Single shape leads to error', () => {\n const x1 = new tfl.SymbolicTensor('float32', [2, 3, 5], null, [], null);\n const layer = tfl.layers.concatenate({});\n expect(() => layer.apply([x1]))\n .toThrowError(/should be called on a list of at least 2 inputs/);\n });\n it('Serialization round trip', () => {\n const layer = tfl.layers.concatenate({axis: 2});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.concatenate(tsConfig);\n expect(layerPrime.getConfig().axis).toEqual(2);\n });\n});\n\ndescribeMathCPUAndGPU('Add Layer: Tensor', () => {\n it('2D plus 2D', () => {\n const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const x2 = tensor2d([[-1, -2], [-3, -4]], [2, 2]);\n const addLayer = tfl.layers.add({});\n const y = addLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[9, 18], [27, 36]], [2, 2]));\n });\n it('2D plus 2D, with broadcast', () => {\n const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const x2 = tensor2d([[-2], [-4]], [2, 1]);\n const addLayer = tfl.layers.add({});\n const y = addLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[8, 18], [26, 36]], [2, 2]));\n });\n it('2D plus 2D, with dimension expansion', () => {\n const x1 =\n tensor3d([[[10, 20], [30, 40]], [[50, 60], [70, 80]]], [2, 2, 2]);\n const x2 = tensor2d([[-2], [-4]], [2, 1]);\n const addLayer = tfl.layers.add({});\n const y = addLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(\n y, tensor3d([[[8, 18], [28, 38]], [[46, 56], [66, 76]]], [2, 2, 2]));\n });\n it('computeMask', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-2, -1], [-4, -3]]);\n const addLayer = tfl.layers.add({});\n const m1 = tensor1d([true, false], 'bool');\n const m2 = tensor1d([true, true], 'bool');\n const mask = addLayer.computeMask([x1, x2], [m1, m2]);\n expectTensorsClose(mask, tensor2d([[true, false]], [1, 2], 'bool'));\n });\n it('computeMask error condition: non-array input', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-2, -1], [-4, -3]]);\n const addLayer = tfl.layers.add({});\n const m1 = tensor1d([true, false], 'bool');\n const m2 = tensor1d([true, true], 'bool');\n expect(() => addLayer.computeMask(x1, [\n m1, m2\n ])).toThrowError(/inputs.*should be an Array/);\n expect(() => addLayer.computeMask([x1, x2], m1))\n .toThrowError(/mask.*should be an Array/);\n });\n it('computeMask error condition: incorrect number of masks', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-2, -1], [-4, -3]]);\n const addLayer = tfl.layers.add({});\n const m1 = tensor1d([true, false], 'bool');\n expect(() => addLayer.computeMask([x1, x2], [m1]))\n .toThrowError(/ are expected to have the same/);\n });\n});\n\ndescribeMathCPUAndGPU('Multiply Layer: Tensor', () => {\n it('2D times 2D', () => {\n const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const x2 = tensor2d([[-1, -2], [-3, -4]], [2, 2]);\n const multipyLayer = tfl.layers.multiply({});\n const y = multipyLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-10, -40], [-90, -160]], [2, 2]));\n });\n // TODO(cais): Reinstate when this issue is fixed:\n // https://github.com/PAIR-code/deeplearnjs/issues/457\n // it('2D times 2D, with broadcast', () => {\n // const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n // const x2 = tensor2d([[-2], [-4]], [2, 1]);\n // const multiplyLayer = new Multiply({});\n // const y = multiplyLayer.apply([x1, x2]) as Tensor;\n // expectTensorsClose(y, tensor2d([[-20, -40], [-120, -160]], [2, 2]));\n // });\n});\n\ndescribeMathCPUAndGPU('Average Layer: Tensor', () => {\n it('2D and 2D', () => {\n const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const x2 = tensor2d([[-2, -4], [-6, -8]], [2, 2]);\n const averageLayer = tfl.layers.average({});\n const y = averageLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[4, 8], [12, 16]], [2, 2]));\n });\n it('2D and 2D, with broadcast', () => {\n const x1 = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const x2 = tensor2d([[-2], [-4]], [2, 1]);\n const averageLayer = tfl.layers.average({});\n const y = averageLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[4, 9], [13, 18]], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Maximum Layer: Tensor', () => {\n it('2D and 2D', () => {\n const x1 = tensor2d([[10, 20], [-6, -8]], [2, 2]);\n const x2 = tensor2d([[-2, -4], [30, 40]], [2, 2]);\n const averageLayer = tfl.layers.maximum({});\n const y = averageLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[10, 20], [30, 40]], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Minimum Layer: Tensor', () => {\n it('2D and 2D', () => {\n const x1 = tensor2d([[10, 20], [-6, -8]], [2, 2]);\n const x2 = tensor2d([[-2, -4], [30, 40]], [2, 2]);\n const averageLayer = tfl.layers.minimum({});\n const y = averageLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-2, -4], [-6, -8]], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('Concatenate Layer: Tensor', () => {\n let x1: Tensor2D;\n let x2: Tensor2D;\n\n function createData() {\n x1 = tensor2d([1, 2, 3, 4], [2, 2]);\n x2 = tensor2d([-1, -2, -3, -4], [2, 2]);\n }\n\n const axisValues: number[] = [null, undefined, 0, 1, -1];\n for (const axis of axisValues) {\n it(`axis=${axis}`, () => {\n createData();\n const layer = tfl.layers.concatenate({axis});\n const expected = axis === 0 ?\n tensor2d([1, 2, 3, 4, -1, -2, -3, -4], [4, 2]) :\n tensor2d([1, 2, -1, -2, 3, 4, -3, -4], [2, 4]);\n expectTensorsClose(layer.apply([x1, x2]) as Tensor, expected);\n });\n }\n\n it('computeMask', () => {\n const layer = tfl.layers.concatenate();\n const x1 = tensor2d([[1], [0], [1]]);\n const x2 = tensor2d([[1], [0], [0]]);\n const mask =\n layer.computeMask([x1, x2], [x1.asType('bool'), x2.asType('bool')]);\n expectTensorsClose(mask, tensor1d([true, false, false], 'bool'));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // input1 = keras.Input(shape=[4])\n // input2 = keras.Input(shape=[4])\n // y1 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input1)\n // y1 = keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y1)\n // y2 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input2)\n // y2 = keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y2)\n //\n // y = keras.layers.Concatenate()([y1, y2])\n // y = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y)\n //\n // model = keras.Model(inputs=[input1, input2], outputs=y)\n // model.summary()\n //\n // xs1 = np.array([[0, 0, 0, 0],\n // [1, 0, 0, 0],\n // [1, 2, 0, 0],\n // [1, 2, 3, 0]])\n // xs2 = np.array([[0, 0, 0, 0],\n // [0, 0, 0, 0],\n // [1, 0, 0, 0],\n // [1, 2, 0, 0]])\n //\n // ys = model.predict([xs1, xs2])\n // print(ys)\n // ```\n it('With masking', () => {\n const input1 = tfl.input({shape: [4]});\n const input2 = tfl.input({shape: [4]});\n let y1 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input1) as SymbolicTensor;\n y1 = tfl.layers\n .lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y1) as SymbolicTensor;\n let y2 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input2) as SymbolicTensor;\n y2 = tfl.layers\n .lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y2) as SymbolicTensor;\n let y = tfl.layers.concatenate().apply([y1, y2]) as SymbolicTensor;\n y = tfl.layers\n .dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'})\n .apply(y) as SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n\n const xs1 =\n tensor2d([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]]);\n // Notice the mask of xs2 is different from that of xs1.\n const xs2 =\n tensor2d([[0, 0, 0, 0], [0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0]]);\n const ys = model.predict([xs1, xs2]) as Tensor;\n expectTensorsClose(\n ys, tensor2d([[0], [2.2785282], [5.169547], [5.8760333]]));\n });\n});\n\ndescribeMathCPU('Deserialize Merge Layers', () => {\n it('LayersModel with Add Layer', () => {\n // The following model config JSON can be obtained with Python code:\n // ```python\n // import keras\n //\n // input1 = keras.Input(shape=[4])\n // input2 = keras.Input(shape=[4])\n //\n // output = keras.layers.add([input1, input2])\n // model = keras.Model([input1, input2], output)\n //\n // model_json = model.to_json()\n // print(model_json)\n\n const modelWithMergeJSON: {} = {\n 'class_name': 'Model',\n 'keras_version': '2.1.5',\n 'config': {\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, 4],\n 'name': 'input_1',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_1'\n },\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, 4],\n 'name': 'input_2',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_2'\n },\n {\n 'class_name': 'Add',\n 'config': {'trainable': true, 'name': 'add_1'},\n 'inbound_nodes': [[['input_1', 0, 0, {}], ['input_2', 0, 0, {}]]],\n 'name': 'add_1'\n }\n ],\n 'input_layers': [['input_1', 0, 0], ['input_2', 0, 0]],\n 'output_layers': [['add_1', 0, 0]],\n 'name': 'model_1'\n },\n 'backend': 'tensorflow'\n };\n\n const tsConfig =\n convertPythonicToTs(modelWithMergeJSON) as serialization.ConfigDict;\n const model = deserialize(tsConfig) as tfl.LayersModel;\n expect(model.inputs.length).toEqual(2);\n expect(model.inputs[0].shape).toEqual([null, 4]);\n expect(model.inputs[1].shape).toEqual([null, 4]);\n expect(model.layers.length).toEqual(3);\n expect(model.layers[2] instanceof Add);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 4]);\n });\n\n it('LayersModel with Concatenate Layer', () => {\n // The following model config JSON can be obtained with Python code:\n // ```python\n // import keras\n //\n // input1 = keras.Input(shape=[4])\n // input2 = keras.Input(shape=[4])\n //\n // output = keras.layers.concatenate([input1, input2])\n // model = keras.Model([input1, input2], output)\n //\n // model_json = model.to_json()\n // print(model_json)\n\n const modelWithMergeJSON: {} = {\n 'class_name': 'Model',\n 'keras_version': '2.1.5',\n 'config': {\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, 4],\n 'name': 'input_1',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_1'\n },\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, 4],\n 'name': 'input_2',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_2'\n },\n {\n 'class_name': 'Concatenate',\n 'config': {'trainable': true, 'name': 'concatenate_1', 'axis': -1},\n 'inbound_nodes': [[['input_1', 0, 0, {}], ['input_2', 0, 0, {}]]],\n 'name': 'concatenate_1'\n }\n ],\n 'input_layers': [['input_1', 0, 0], ['input_2', 0, 0]],\n 'output_layers': [['concatenate_1', 0, 0]],\n 'name': 'model_1'\n },\n 'backend': 'tensorflow'\n };\n\n const tsConfig =\n convertPythonicToTs(modelWithMergeJSON) as serialization.ConfigDict;\n const model = deserialize(tsConfig) as tfl.LayersModel;\n expect(model.inputs.length).toEqual(2);\n expect(model.inputs[0].shape).toEqual([null, 4]);\n expect(model.inputs[1].shape).toEqual([null, 4]);\n expect(model.layers.length).toEqual(3);\n expect(model.layers[2] instanceof Concatenate);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 8]);\n });\n});\n\ndescribeMathCPU('Dot-Layer: Symbolic', () => {\n // Example refernce Python Keras code:\n //\n // ```py\n // import keras\n //\n // x1 = keras.Input(shape=[3, 4])\n // x2 = keras.Input(shape=[3])\n // dot_layer = keras.layers.Dot(1)\n // y = dot_layer([x1, x2])\n //\n // print(x1.shape)\n // print(x2.shape)\n // print(y.shape)\n // ```\n\n it('2D x 2D', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 8], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 8], null, [], null);\n const y1 = tfl.layers.dot({axes: -1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y1.shape).toEqual([null, 1]);\n const y2 = tfl.layers.dot({axes: 1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 1]);\n });\n\n it('3D x 3D, axes = -1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const y = tfl.layers.dot({axes: -1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y.shape).toEqual([null, 2, 2]);\n });\n\n it('3D x 3D, axes = 1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const y2 = tfl.layers.dot({axes: 1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 3, 3]);\n });\n\n it('3D x 3D, axes = 2', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const y2 = tfl.layers.dot({axes: 2}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 2, 2]);\n });\n\n it('2D x 3D, axes = -1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const y2 = tfl.layers.dot({axes: -1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 2]);\n });\n\n it('2D x 3D, axes = 1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 3, 4], null, [], null);\n const y2 = tfl.layers.dot({axes: 1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 4]);\n });\n\n it('3D x 2D, axes = -1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 3], null, [], null);\n const y2 = tfl.layers.dot({axes: -1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 2]);\n });\n\n it('3D x 2D, axes = -1', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 3, 4], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 3], null, [], null);\n const y2 = tfl.layers.dot({axes: 1}).apply([x1, x2]) as tfl.SymbolicTensor;\n expect(y2.shape).toEqual([null, 4]);\n });\n\n it('computeOutputShape() does not alter input shape', () => {\n const dotLayer = tfl.layers.dot({axes: 1});\n const inputShape1: Shape = [null, 3, 4];\n const inputShape2: Shape = [null, 3];\n const outputShape = dotLayer.computeOutputShape([inputShape1, inputShape2]);\n expect(outputShape).toEqual([null, 4]);\n expect(inputShape1).toEqual([null, 3, 4]);\n expect(inputShape2).toEqual([null, 3]);\n });\n\n // TODO(cais): Uncomment the follow test case when 4D and higher is supported\n // by the Dot layer.\n // it('4D x 4D, axes = -1', () => {\n // const x1 = new tfl.SymbolicTensor(\n // 'float32', [null, 2, 3, 4], null, [], null);\n // const x2 = new tfl.SymbolicTensor(\n // 'float32', [null, 2, 3, 4], null, [], null);\n // const y = tfl.layers.dot({axes: -1}).apply([x1, x2]) as\n // tfl.SymbolicTensor;\n // expect(y.shape).toEqual([null, 2, 3, 2, 3]);\n // });\n\n it('Dimension mismatch leads to error', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 4], null, [], null);\n expect(() => tfl.layers.dot({axes: -1}).apply([\n x1, x2\n ])).toThrowError('Dimension incompatibility: 3 !== 4');\n });\n\n it('Incorrect number of inputs leads to error', () => {\n const x1 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x2 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const x3 = new tfl.SymbolicTensor('float32', [null, 2, 3], null, [], null);\n expect(() => tfl.layers.dot({axes: -1}).apply([x1]))\n .toThrowError(/should be called on a list of exactly 2 inputs/);\n expect(() => tfl.layers.dot({axes: -1}).apply(x1))\n .toThrowError(/should be called on a list of exactly 2 inputs/);\n expect(() => tfl.layers.dot({axes: -1}).apply([\n x1, x2, x3\n ])).toThrowError(/should be called on a list of exactly 2 inputs/);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.dot({axes: -1, normalize: true});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.dot(tsConfig);\n expect(layerPrime.getConfig().axes).toEqual(-1);\n expect(layerPrime.getConfig().normalize).toEqual(true);\n });\n});\n\ndescribeMathCPUAndGPU('Dot-Layer: Tensor', () => {\n // Example reference Python Keras code:\n //\n // ```py\n // import keras\n // import numpy as np\n //\n // x1 = keras.Input(shape=[2])\n // x2 = keras.Input(shape=[2])\n // dot_layer = keras.layers.Dot(-11)\n // y = dot_layer([x1, x2])\n //\n // model = keras.Model([x1, x2], y)\n // model.summary()\n //\n // xs1 = np.array([[10, 20], [30, 40]], dtype=np.float32)\n // xs2 = np.array([[-1, -2], [-3, -4]], dtype=np.float32)\n // print(model.predict([xs1, xs2]))\n // ```\n\n it('2D x 2D, axis = -1', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-1, -2], [-3, -4]]);\n const dotLayer = tfl.layers.dot({axes: -1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-50], [-250]]));\n });\n\n it('2D x 2D, axis = -1, normalize = true', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-1, -2], [-4, -3]]);\n const dotLayer = tfl.layers.dot({axes: -1, normalize: true});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-1], [-0.96]]));\n });\n\n it('2D x 2D, axis = 1', () => {\n const x1 = tensor2d([[10, 20], [30, 40]]);\n const x2 = tensor2d([[-1, -2], [-3, -4]]);\n const dotLayer = tfl.layers.dot({axes: 1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-50], [-250]]));\n });\n\n it('3D x 2D, axis = -1', () => {\n const x1 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const x2 = tensor2d([[-1, -2], [-3, -4]]);\n const dotLayer = tfl.layers.dot({axes: -1});\n const y1 = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y1, tensor2d([[-50, -110], [-24, -10]]));\n const x3 = tensor2d([[1, 2], [3, 4]]);\n const y2 = dotLayer.apply([x1, x3]) as Tensor;\n expectTensorsClose(y2, tensor2d([[50, 110], [24, 10]]));\n });\n\n it('2D x 3D, axis = -1', () => {\n const x1 = tensor2d([[-1, -2], [-3, -4]]);\n const x2 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const dotLayer = tfl.layers.dot({axes: -1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-50, -110], [-24, -10]]));\n });\n\n it('2D x 3D, axis = 1', () => {\n const x1 = tensor2d([[-1, -2], [-3, -4]]);\n const x2 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const dotLayer = tfl.layers.dot({axes: 1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(y, tensor2d([[-70, -100], [-20, -13]]));\n });\n\n it('3D x 3D, axis = -1', () => {\n const x1 = tensor3d([[[-1, -2], [-3, -4]], [[5, 6], [7, 8]]]);\n const x2 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const dotLayer = tfl.layers.dot({axes: -1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(\n y, tensor3d([[[-50, -110], [-110, -250]], [[38, 16], [52, 22]]]));\n });\n\n it('3D x 3D, axis = 1', () => {\n const x1 = tensor3d([[[-1, -2], [-3, -4]], [[5, 6], [7, 8]]]);\n const x2 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const dotLayer = tfl.layers.dot({axes: 1});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(\n y, tensor3d([[[-100, -140], [-140, -200]], [[34, 22], [40, 26]]]));\n });\n\n it('3D x 3D, axis = [1, 2]', () => {\n const x1 = tensor3d([[[-1, -2], [-3, -4]], [[5, 6], [7, 8]]]);\n const x2 = tensor3d([[[10, 20], [30, 40]], [[4, 3], [2, 1]]]);\n const dotLayer = tfl.layers.dot({axes: [1, 2]});\n const y = dotLayer.apply([x1, x2]) as Tensor;\n expectTensorsClose(\n y, tensor3d([[[-70, -150], [-100, -220]], [[41, 17], [48, 20]]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // input1 = keras.Input(shape=[4])\n // input2 = keras.Input(shape=[4])\n // y1 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input1)\n // y1 = keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y1)\n // y2 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input2)\n // y2 = keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y2)\n //\n // y = keras.layers.Dot(axes=[-1, -1])([y1, y2])\n // y = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y)\n //\n // model = keras.Model(inputs=[input1, input2], outputs=y)\n //\n // xs1 = np.array([[0, 0, 0, 0],\n // [1, 0, 0, 0],\n // [1, 2, 0, 0],\n // [1, 2, 3, 0]])\n // xs2 = np.array([[0, 0, 0, 0],\n // [0, 0, 0, 0],\n // [1, 0, 0, 0],\n // [1, 2, 0, 0]])\n // ys = model.predict([xs1, xs2])\n // print(ys)\n // ```\n it('With masking', () => {\n const input1 = tfl.input({shape: [4]});\n const input2 = tfl.input({shape: [4]});\n let y1 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input1) as SymbolicTensor;\n y1 = tfl.layers\n .lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y1) as SymbolicTensor;\n let y2 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input2) as SymbolicTensor;\n y2 = tfl.layers\n .lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y2) as SymbolicTensor;\n let y = tfl.layers.dot({axes: [-1, -1]}).apply([y1, y2]) as SymbolicTensor;\n y = tfl.layers\n .dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'})\n .apply(y) as SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n\n const xs1 =\n tensor2d([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]]);\n // Notice the mask of xs2 is different from that of xs1.\n const xs2 =\n tensor2d([[0, 0, 0, 0], [0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0]]);\n const ys = model.predict([xs1, xs2]) as Tensor;\n expectTensorsClose(ys, tensor2d([[0], [0], [2.195756], [2.8765779]]));\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-layers/dist/layers/noise.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.d.ts deleted file mode 100644 index 1073b88fb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Noise Layers. - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { Layer, LayerArgs } from '../engine/topology'; -import { Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -export declare interface GaussianNoiseArgs extends LayerArgs { - /** Standard Deviation. */ - stddev: number; -} -export declare class GaussianNoise extends Layer { - /** @nocollapse */ - static className: string; - readonly stddev: number; - constructor(args: GaussianNoiseArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): { - stddev: number; - }; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare interface GaussianDropoutArgs extends LayerArgs { - /** drop probability. */ - rate: number; -} -export declare class GaussianDropout extends Layer { - /** @nocollapse */ - static className: string; - readonly rate: number; - constructor(args: GaussianDropoutArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): { - rate: number; - }; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare interface AlphaDropoutArgs extends LayerArgs { - /** drop probability. */ - rate: number; - /** - * A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - */ - noiseShape?: Shape; -} -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ -export declare class AlphaDropout extends Layer { - /** @nocollapse */ - static className: string; - readonly rate: number; - readonly noiseShape: Shape; - constructor(args: AlphaDropoutArgs); - _getNoiseShape(inputs: Tensor | Tensor[]): number[]; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - getConfig(): { - rate: number; - }; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js deleted file mode 100644 index af57725d0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Noise Layers. - */ -import { greaterEqual, randomUniform, serialization, tidy } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { Layer } from '../engine/topology'; -import { getExactlyOneTensor } from '../utils/types_utils'; -export class GaussianNoise extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.stddev = args.stddev; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { stddev: this.stddev }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const noised = () => K.randomNormal(input.shape, 0, this.stddev).add(input); - const output = K.inTrainPhase(noised, () => input, kwargs['training'] || false); - return output; - }); - } -} -/** @nocollapse */ -GaussianNoise.className = 'GaussianNoise'; -serialization.registerClass(GaussianNoise); -export class GaussianDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (this.rate > 0 && this.rate < 1) { - const noised = () => { - const stddev = Math.sqrt(this.rate / (1 - this.rate)); - return input.mul(K.randomNormal(input.shape, 1, stddev)); - }; - return K.inTrainPhase(noised, () => input, kwargs['training'] || false); - } - return input; - }); - } -} -/** @nocollapse */ -GaussianDropout.className = 'GaussianDropout'; -serialization.registerClass(GaussianDropout); -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ -export class AlphaDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - this.noiseShape = args.noiseShape; - } - _getNoiseShape(inputs) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - if (this.rate < 1 && this.rate > 0) { - const noiseShape = this._getNoiseShape(inputs); - const droppedInputs = () => { - const input = getExactlyOneTensor(inputs); - const alpha = 1.6732632423543772848170429916717; - const scale = 1.0507009873554804934193349852946; - const alphaP = -alpha * scale; - let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate); - keptIdx = K.cast(keptIdx, 'float32'); // get default dtype. - // Get affine transformation params. - const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; - const b = -a * alphaP * this.rate; - // Apply mask. - const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - return x.mul(a).add(b); - }; - return K.inTrainPhase(droppedInputs, () => getExactlyOneTensor(inputs), kwargs['training'] || false); - } - return inputs; - }); - } -} -/** @nocollapse */ -AlphaDropout.className = 'AlphaDropout'; -serialization.registerClass(AlphaDropout); -//# sourceMappingURL=noise.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-layers/dist/layers/noise.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js.map deleted file mode 100644 index 7a00dde13..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.js","sourceRoot":"","sources":["../../src/layers/noise.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE/F,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,KAAK,EAAY,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAOzD,MAAM,OAAO,aAAc,SAAQ,KAAK;IAKtC,YAAY,IAAuB;QACjC,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,UAAyB;QAC1C,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,SAAS;QACP,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC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oBAElC,cAAc;oBACd,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;oBAE9D,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACzB,CAAC,CAAC;gBACF,OAAO,CAAC,CAAC,YAAY,CACjB,aAAa,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAChD,MAAM,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC;aAClC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;;AA3DD,kBAAkB;AACX,sBAAS,GAAG,cAAc,CAAC;AA4DpC,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC","sourcesContent":["/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise_test.js.map deleted file mode 100644 index 04230983f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/noise_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise_test.js","sourceRoot":"","sources":["../../src/layers/noise_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,IAAI,EAAS,MAAM,uBAAuB,CA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QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAC,CAAW,CAAC;QACpE,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACvC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * Unit Tests for Noise Layers.\r\n */\r\n\r\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\r\nimport * as tfl from '../index';\r\nimport {ones, Tensor} from '@tensorflow/tfjs-core';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\ndescribeMathCPU('GaussianNoise: Symbolic', () => {\r\n const stddevs = [0, 1, 0.5];\r\n const symbolicInputs = [\r\n new tfl.SymbolicTensor('float32', [10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null),\r\n ];\r\n\r\n for (const stddev of stddevs) {\r\n for (const symbolicInput of symbolicInputs) {\r\n const testTitle = `std=${stddev}; ` +\r\n `input shape=${JSON.stringify(symbolicInput.shape)}`;\r\n it(testTitle, () => {\r\n const gaussianNoiseLayer = tfl.layers.gaussianNoise({stddev});\r\n const output =\r\n gaussianNoiseLayer.apply(symbolicInput) as tfl.SymbolicTensor;\r\n expect(output.dtype).toEqual(symbolicInput.dtype);\r\n expect(output.shape).toEqual(symbolicInput.shape);\r\n expect(output.sourceLayer).toEqual(gaussianNoiseLayer);\r\n expect(output.inputs).toEqual([symbolicInput]);\r\n });\r\n }\r\n }\r\n});\r\n\r\ndescribeMathCPUAndGPU('GaussianNoise: Tensor', () => {\r\n it('GaussianNoise: Predict', () => {\r\n const input = ones([2, 2]);\r\n const gaussianNoiseLayer = tfl.layers.gaussianNoise({stddev: 1});\r\n let output = gaussianNoiseLayer.apply(input, {training: false}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n expectTensorsClose(input, output);\r\n });\r\n\r\n it('GaussianNoise: Train', () => {\r\n const input = ones([2, 2]);\r\n const gaussianNoiseLayer = tfl.layers.gaussianNoise({stddev: 1});\r\n let output = gaussianNoiseLayer.apply(input, {training: true}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n const diff = output.sub(input).abs().max();\r\n expect(diff.dataSync()).toBeGreaterThan(0);\r\n expect(output.shape).toEqual(input.shape);\r\n expect(output.dtype).toEqual(input.dtype);\r\n });\r\n\r\n it('GaussianNoise: Successive Call', () => {\r\n const training = true;\r\n const inputA = ones([2, 2]);\r\n const gaussianNoiseLayer = tfl.layers.gaussianNoise({stddev: 1});\r\n let outputA = gaussianNoiseLayer.apply(inputA, {training}) as Tensor;\r\n outputA = getExactlyOneTensor(outputA);\r\n const inputB = ones([2, 2]);\r\n let outputB = gaussianNoiseLayer.apply(inputB, {training}) as Tensor;\r\n outputB = getExactlyOneTensor(outputA);\r\n expectTensorsClose(outputA, outputB);\r\n });\r\n});\r\n\r\ndescribeMathCPU('GaussianDropout: Symbolic', () => {\r\n const rates = [0, 1, 0.5];\r\n const symbolicInputs = [\r\n new tfl.SymbolicTensor('float32', [10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null),\r\n ];\r\n\r\n for (const rate of rates) {\r\n for (const symbolicInput of symbolicInputs) {\r\n const testTitle = `dropoutRate=${rate}; ` +\r\n `input shape=${JSON.stringify(symbolicInput.shape)}`;\r\n it(testTitle, () => {\r\n const gaussianDropout = tfl.layers.gaussianDropout({rate});\r\n const output =\r\n gaussianDropout.apply(symbolicInput) as tfl.SymbolicTensor;\r\n expect(output.dtype).toEqual(symbolicInput.dtype);\r\n expect(output.shape).toEqual(symbolicInput.shape);\r\n expect(output.sourceLayer).toEqual(gaussianDropout);\r\n expect(output.inputs).toEqual([symbolicInput]);\r\n });\r\n }\r\n }\r\n});\r\n\r\ndescribeMathCPUAndGPU('GaussianDropout: Tensor', () => {\r\n it('GaussianDropout: Predict', () => {\r\n const input = ones([1, 2]);\r\n const gaussianDropoutLayer = tfl.layers.gaussianDropout({rate: 0.5});\r\n let output = gaussianDropoutLayer.apply(input, {training: false}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n expectTensorsClose(input, output);\r\n });\r\n\r\n it('GaussianDropout: Train', () => {\r\n const input = ones([1, 2]);\r\n const gaussianDropoutLayer = tfl.layers.gaussianDropout({rate: 0.5});\r\n let output = gaussianDropoutLayer.apply(input, {training: true}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n const diff = output.sub(input).abs().max();\r\n expect(diff.dataSync()).toBeGreaterThan(0);\r\n expect(output.shape).toEqual(input.shape);\r\n expect(output.dtype).toEqual(input.dtype);\r\n });\r\n\r\n it('GaussianDropout: Successive Call', () => {\r\n const training = true;\r\n const inputA = ones([1, 2]);\r\n const gaussianDropoutLayer = tfl.layers.gaussianDropout({rate: 0.5});\r\n let outputA = gaussianDropoutLayer.apply(inputA, {training}) as Tensor;\r\n outputA = getExactlyOneTensor(outputA);\r\n const inputB = ones([1, 2]);\r\n let outputB = gaussianDropoutLayer.apply(inputB, {training}) as Tensor;\r\n outputB = getExactlyOneTensor(outputA);\r\n expectTensorsClose(outputA, outputB);\r\n });\r\n});\r\n\r\ndescribeMathCPU('AlphaDropout: Symbolic', () => {\r\n const rates = [0, 1, 0.5];\r\n const symbolicInputs = [\r\n new tfl.SymbolicTensor('float32', [10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [12, 10, 4], null, [], null),\r\n new tfl.SymbolicTensor('float32', [null, 4], null, [], null),\r\n ];\r\n\r\n for (const rate of rates) {\r\n for (const symbolicInput of symbolicInputs) {\r\n const testTitle = `dropoutRate=${rate}; ` +\r\n `input shape=${JSON.stringify(symbolicInput.shape)}`;\r\n it(testTitle, () => {\r\n const alphaDropout = tfl.layers.alphaDropout({rate});\r\n const output = alphaDropout.apply(symbolicInput) as tfl.SymbolicTensor;\r\n expect(output.dtype).toEqual(symbolicInput.dtype);\r\n expect(output.shape).toEqual(symbolicInput.shape);\r\n expect(output.sourceLayer).toEqual(alphaDropout);\r\n expect(output.inputs).toEqual([symbolicInput]);\r\n });\r\n }\r\n }\r\n});\r\n\r\ndescribeMathCPUAndGPU('AlphaDropout: Tensor', () => {\r\n it('AlphaDropout: Predict', () => {\r\n const input = ones([1, 2]);\r\n const alphaDropoutLayer = tfl.layers.alphaDropout({rate: 0.5});\r\n let output = alphaDropoutLayer.apply(input, {training: false}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n expectTensorsClose(input, output);\r\n });\r\n\r\n it('AlphaDropout: Train', () => {\r\n const input = ones([1, 2]);\r\n const alphaDropoutLayer = tfl.layers.alphaDropout({rate: 0.5});\r\n let output = alphaDropoutLayer.apply(input, {training: true}) as Tensor;\r\n output = getExactlyOneTensor(output);\r\n const diff = output.sub(input).abs().max();\r\n expect(diff.dataSync()).toBeGreaterThan(0);\r\n expect(output.shape).toEqual(input.shape);\r\n expect(output.dtype).toEqual(input.dtype);\r\n });\r\n\r\n it('AlphaDropout: Successive Call', () => {\r\n const training = true;\r\n const inputA = ones([1, 2]);\r\n const alphaDropoutLayer = tfl.layers.alphaDropout({rate: 0.5});\r\n let outputA = alphaDropoutLayer.apply(inputA, {training}) as Tensor;\r\n outputA = getExactlyOneTensor(outputA);\r\n const inputB = ones([1, 2]);\r\n let outputB = alphaDropoutLayer.apply(inputB, {training}) as Tensor;\r\n outputB = getExactlyOneTensor(outputA);\r\n expectTensorsClose(outputA, outputB);\r\n });\r\n});\r\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts deleted file mode 100644 index 7e2aee938..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { Shape } from '../keras_format/common'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs } from '../types'; -/** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ -export declare function batchNormalization(x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor, epsilon?: number): Tensor; -/** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -export declare function normalizeBatchInTraining(x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[], epsilon?: number): [Tensor, Tensor, Tensor]; -export declare interface BatchNormalizationLayerArgs extends LayerArgs { - /** - * The integer axis that should be normalized (typically the features axis). - * Defaults to -1. - * - * For instance, after a `Conv2D` layer with `data_format="channels_first"`, - * set `axis=1` in `batchNormalization`. - */ - axis?: number; - /** - * Momentum of the moving average. Defaults to 0.99. - */ - momentum?: number; - /** - * Small float added to the variance to avoid dividing by zero. Defaults to - * 1e-3. - */ - epsilon?: number; - /** - * If `true`, add offset of `beta` to normalized tensor. - * If `false`, `beta` is ignored. - * Defaults to `true`. - */ - center?: boolean; - /** - * If `true`, multiply by `gamma`. - * If `false`, `gamma` is not used. - * When the next layer is linear (also e.g. `nn.relu`), - * this can be disabled since the scaling will be done by the next layer. - * Defaults to `true`. - */ - scale?: boolean; - /** - * Initializer for the beta weight. - * Defaults to 'zeros'. - */ - betaInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the gamma weight. - * Defaults to `ones`. - */ - gammaInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the moving mean. - * Defaults to `zeros` - */ - movingMeanInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the moving variance. - * Defaults to 'Ones'. - */ - movingVarianceInitializer?: InitializerIdentifier | Initializer; - /** - * Constraint for the beta weight. - */ - betaConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint for gamma weight. - */ - gammaConstraint?: ConstraintIdentifier | Constraint; - /** - * Regularizer for the beta weight. - */ - betaRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer for the gamma weight. - */ - gammaRegularizer?: RegularizerIdentifier | Regularizer; -} -export declare class BatchNormalization extends Layer { - /** @nocollapse */ - static className: string; - private readonly axis; - private readonly momentum; - private readonly epsilon; - private readonly center; - private readonly scale; - private readonly betaInitializer; - private readonly gammaInitializer; - private readonly movingMeanInitializer; - private readonly movingVarianceInitializer; - private readonly betaConstraint; - private readonly gammaConstraint; - private readonly betaRegularizer; - private readonly gammaRegularizer; - private gamma; - private beta; - private movingMean; - private movingVariance; - constructor(args?: BatchNormalizationLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export interface LayerNormalizationLayerArgs extends LayerArgs { - /** - * The axis or axes that should be normalized (typically, the feature axis.) - * Defaults to -1 (the last axis.) - */ - axis?: number | number[]; - /** - * A small positive float added to variance to avoid divison by zero. - * Defaults to 1e-3. - */ - epsilon?: number; - /** - * If `true`, add offset of `beta` to normalized tensor. - * If `false`, `beta` is ignored. - * Default: `true`. - */ - center?: boolean; - /** - * If `true`, multiply output by `gamma`. - * If `false`, `gamma` is not used. - * When the next layer is linear, this can be disabled since scaling will - * be done by the next layer. - * Default: `true`. - */ - scale?: boolean; - /** - * Initializer for the beta weight. - * Default: `'zeros'`. - */ - betaInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the gamma weight. - * Default: `'ones'`. - */ - gammaInitializer?: InitializerIdentifier | Initializer; - /** Regularizer for the beta weight. */ - betaRegularizer?: RegularizerIdentifier | Regularizer; - /** Regularizer for the gamma weight. */ - gammaRegularizer?: RegularizerIdentifier | Regularizer; -} -export declare class LayerNormalization extends Layer { - /** @nocollapse */ - static className: string; - private axis; - readonly epsilon: number; - readonly center: boolean; - readonly scale: boolean; - readonly betaInitializer: Initializer; - readonly gammaInitializer: Initializer; - readonly betaRegularizer: Regularizer; - readonly gammaRegularizer: Regularizer; - private gamma; - private beta; - constructor(args?: LayerNormalizationLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js deleted file mode 100644 index 4a5c4c8cd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js +++ /dev/null @@ -1,396 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Normalization layers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { moments, serialization, tidy, util } from '@tensorflow/tfjs-core'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { InputSpec, Layer } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { getInitializer, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import * as generic_utils from '../utils/generic_utils'; -import * as math_utils from '../utils/math_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -/** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ -export function batchNormalization(x, mean, variance, beta, gamma, epsilon = 1e-3) { - let out; - if (x.rank === 2) { - out = tfc.batchNorm2d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = tfc.batchNorm3d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 4) { - out = tfc.batchNorm4d(x, mean, variance, beta, gamma, epsilon); - } - else { - throw new NotImplementedError(`batchNormalization is not implemented for array of rank ${x.rank} ` + - `yet`); - } - return out; -} -/** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const targetShape = []; - for (const axis of math_utils.range(0, x.rank)) { - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } - else { - targetShape.push(x.shape[axis]); - } - } - const broadcastMean = mean.reshape(targetShape); - const broadcastVariance = variance.reshape(targetShape); - const broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); - const broadcastBeta = beta == null ? null : beta.reshape(targetShape); - const normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -export function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - if (util.arraysEqual(reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } -} -export class BatchNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.supportsMasking = true; - this.axis = args.axis == null ? -1 : args.axis; - this.momentum = args.momentum == null ? 0.99 : args.momentum; - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - this.betaConstraint = getConstraint(args.betaConstraint); - this.gammaConstraint = getConstraint(args.gammaConstraint); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - const dim = inputShape[axis]; - if (dim == null) { - throw new ValueError(`Axis ${axis} of input tensor should have a defined dimension but ` + - `the layer received an input with shape ` + - `${JSON.stringify(inputShape)}.`); - } - this.inputSpec = - [new InputSpec({ ndim: inputShape.length, axes: { [axis]: dim } })]; - const shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); - } - this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const ndim = inputShape.length; - const reductionAxes = math_utils.range(0, ndim); - const axis = this.axis >= 0 ? this.axis : (this.axis + ndim); - reductionAxes.splice(axis, 1); - const broadcastShape = generic_utils.pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - const sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - const needsBroadcasting = !util.arraysEqual(sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1)); - const normalizeInference = () => { - if (needsBroadcasting) { - const broadcastMovingMean = this.movingMean.read().reshape(broadcastShape); - const broadcastMovingVariance = this.movingVariance.read().reshape(broadcastShape); - const broadcastBeta = this.center ? this.beta.read().reshape(broadcastShape) : null; - const broadcastGamma = this.scale ? this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); - } - else { - return batchNormalization(input, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); - } - }; - if (!training) { - return normalizeInference(); - } - const [normedTraining, mean, variance] = normalizeBatchInTraining(input, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); - const doMovingAverage = (variable, value, momentum) => { - tfc.tidy(() => { - const decay = 1 - momentum; - const origValue = variable.read(); - const updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - const updateMovingMeanAndVariance = () => { - doMovingAverage(this.movingMean, mean, this.momentum); - doMovingAverage(this.movingVariance, variance, this.momentum); - }; - updateMovingMeanAndVariance(); - return normedTraining; - }); - } - getConfig() { - const config = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -BatchNormalization.className = 'BatchNormalization'; -serialization.registerClass(BatchNormalization); -export class LayerNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.axis = args.axis == null ? -1 : args.axis; - if (typeof this.axis === 'number') { - if (!Number.isInteger(this.axis)) { - throw new Error(`Expected axis to be an integer, but received ${this.axis}`); - } - } - else if (Array.isArray(this.axis)) { - for (const axis of this.axis) { - if (!Number.isInteger(axis)) { - throw new Error(`Expected axis to be an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - } - } - else { - throw new Error(`Expected axis to be an integer or an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const nDims = inputShape.length; - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (let i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - // Further validate axes. - for (const axis of this.axis) { - if (axis < 0 || axis >= nDims) { - throw new Error(`Invalid axis: ${axis}`); - } - } - if (this.axis.length !== generic_utils.unique(this.axis).length) { - throw new Error(`Found duplicate axes in: ${this.axis}`); - } - const paramShape = this.axis.map(axis => inputShape[axis]); - const trainable = true; - if (this.scale) { - this.gamma = this.addWeight('gamma', paramShape, 'float32', this.gammaInitializer, this.gammaRegularizer, trainable); - } - else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight('beta', paramShape, 'float32', this.betaInitializer, this.betaRegularizer, trainable); - } - else { - this.beta = null; - } - this.built = true; - } - call(inputs, kwargs) { - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const nDims = inputShape.length; - return tidy(() => { - const keepDims = true; - let { mean, variance } = moments(input, this.axis, keepDims); - const broadcastShape = generic_utils.pyListRepeat(1, nDims); - for (const dim of this.axis) { - broadcastShape[dim] = inputShape[dim]; - } - const broadcast = (v) => { - if (v != null && v.shape.length !== nDims && - this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } - else { - return v; - } - }; - let scale = broadcast(this.gamma.read()); - let offset = broadcast(this.beta.read()); - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - const momentsTiling = []; - const scaleOffsetTiling = []; - for (let i = 0; i < nDims; ++i) { - if (this.axis.indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } - else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - return batchNormalization(input, mean, variance, offset, scale, this.epsilon); - }); - } - getConfig() { - const config = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -LayerNormalization.className = 'LayerNormalization'; -serialization.registerClass(LayerNormalization); -//# sourceMappingURL=normalization.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-layers/dist/layers/normalization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map deleted file mode 100644 index 58bb55c64..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"normalization.js","sourceRoot":"","sources":["../../src/layers/normalization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAE,aAAa,EAAkD,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAEzH,OAAO,EAAmC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAC,SAAS,EAAE,KAAK,EAAY,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAsC,oBAA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CAAC;YACtC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAExC,OAAO,kBAAkB,CACrB,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAA6B;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,eAAe,EAAE,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC;YAC3D,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAC7D,eAAe,EAAE,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC;YAC3D,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAAC,gBAAgB,CAAC;SAC9D,CAAC;QACF,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;;AAnKD,kBAAkB;AACX,4BAAS,GAAG,oBAAoB,CAAC;AAoK1C,aAAa,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization_test.js.map deleted file mode 100644 index 5f918f721..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"normalization_test.js","sourceRoot":"","sources":["../../src/layers/normalization_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAE5J,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,OAAO,EAAC,kBAAkB,EAAE,wBAAwB,EAAC,MAAM,iBAAiB,CAAC;AAE7E,qBAAqB,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACrD,4EAA4E;IAC5E,oBAAoB;IACpB,YAAY;IACZ,eAAe;IACf,qBAAqB;IACrB,0BAA0B;IAC1B,EAAE;IACF,6BAA6B;IAC7B,8BAA8B;IAC9B,0EAA0E;IAC1E,kEAAkE;IAClE,iEAAiE;IACjE,yBAAyB;IACzB,wEAAwE;IACxE,wCAAwC;IACxC,kBAAkB;IAClB,gBAAgB;IAChB,oBAAoB;IACpB,MAAM;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,CAAC;gBACtD,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC;aACvD;SACF,CAAC,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for normalization layers.\n */\n\nimport {dispose, memory, onesLike, scalar, Tensor, tensor1d, tensor2d, tensor3d, tensor4d, test_util, train, zeros, zerosLike} from '@tensorflow/tfjs-core';\n\nimport {SymbolicTensor} from '../engine/topology';\nimport * as tfl from '../index';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {batchNormalization, normalizeBatchInTraining} from './normalization';\n\ndescribeMathCPUAndGPU('normalizeBatchInTraining', () => {\n // The reference values for assertion below can be obtained with Python code\n // as the following:\n // ```python\n // import keras\n // import numpy as np\n // import tensorflow as tf\n //\n // with tf.Session() as sess:\n // x = tf.Variable(np.array(\n // [[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]], dtype=np.float32))\n // gamma = tf.Variable(np.array([1, 1, 1, 1], dtype=np.float32))\n // beta = tf.Variable(np.array([0, 0, 0, 0], dtype=np.float32))\n // reduction_axes = [0]\n // normed, mean, variance = keras.backend.normalize_batch_in_training(\n // x, gamma, beta, reduction_axes)\n // print(normed)\n // print(mean)\n // print(variance)\n // ```\n\n it('2D, no broadcasting', () => {\n const x = tensor2d([[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]], [3, 4]);\n const gamma = tensor1d([1, 1, 1, 1]);\n const beta = tensor1d([0, 0, 0, 0]);\n const reductionAxes = [0];\n const [normed, mean, variance] =\n normalizeBatchInTraining(x, gamma, beta, reductionAxes);\n expectTensorsClose(\n normed,\n tensor2d(\n [\n [-0.805371, -0.9502233, -1.1624058, -1.3885813],\n [-0.6040282, -0.4319197, -0.11624074, 0.46286058],\n [1.4093992, 1.3821429, 1.2786462, 0.92572117]\n ],\n [3, 4]));\n expectTensorsClose(mean, tensor1d([5.0, 5.6666665, 6.3333335, 7.0]));\n expectTensorsClose(\n variance, tensor1d([24.666666, 14.888889, 8.222222, 4.6666665]));\n });\n\n it('3D, no broadcasting', () => {\n const x = tensor3d(\n [[[1, 2], [3, 4]], [[2, 4], [6, 8]], [[12, 11], [10, 9]]], [3, 2, 2]);\n const gamma = tensor1d([1, 1]);\n const beta = tensor1d([0, 0]);\n const reductionAxes = [0, 1];\n const [normed, mean, variance] =\n normalizeBatchInTraining(x, gamma, beta, reductionAxes);\n expectTensorsClose(\n normed,\n tensor3d(\n [\n [[-1.1355163, -1.3552775], [-0.6488664, -0.7297648]],\n [[-0.8921913, -0.7297648], [0.08110833, 0.5212605]],\n [[1.5410578, 1.4595294], [1.0544081, 0.8340168]]\n ],\n [3, 2, 2]));\n expectTensorsClose(mean, tensor1d([5.6666665, 6.3333335]));\n expectTensorsClose(variance, tensor1d([16.88889, 10.222222]));\n });\n\n it('3D, broadcasting', () => {\n const x = tensor3d(\n [[[1, 2], [3, 4]], [[2, 4], [6, 8]], [[12, 11], [10, 9]]], [3, 2, 2]);\n const gamma = tensor2d([[1, 1], [1, 1]], [2, 2]);\n const beta = tensor2d([[0, 0], [0, 0]], [2, 2]);\n const reductionAxes = [0];\n const [normed, mean, variance] =\n normalizeBatchInTraining(x, gamma, beta, reductionAxes);\n expectTensorsClose(\n normed,\n tensor3d(\n [\n [[-0.805371, -0.9502233], [-1.1624058, -1.3885813]],\n [[-0.6040282, -0.4319197], [-0.11624074, 0.46286058]],\n [[1.4093992, 1.3821429], [1.2786462, 0.92572117]]\n ],\n [3, 2, 2]));\n expectTensorsClose(\n mean, tensor2d([[5, 5.6666665], [6.3333335, 7]], [2, 2]));\n expectTensorsClose(\n variance,\n tensor2d([[24.666666, 14.888889], [8.222222, 4.6666665]], [2, 2]));\n });\n\n it('4D, broadcasting', () => {\n const x = tensor4d(\n [[[[1, 2], [3, 4]], [[2, 4], [6, 8]], [[12, 11], [10, 9]]]],\n [1, 3, 2, 2]);\n const gamma = tensor2d([[1, 1], [1, 1]], [2, 2]);\n const beta = tensor2d([[0, 0], [0, 0]], [2, 2]);\n const reductionAxes = [0, 1];\n const [normed, mean, variance] =\n normalizeBatchInTraining(x, gamma, beta, reductionAxes);\n expectTensorsClose(\n normed,\n tensor4d(\n [[\n [[-0.805371, -0.9502233], [-1.1624058, -1.3885813]],\n [[-0.6040282, -0.4319197], [-0.11624074, 0.46286058]],\n [[1.4093992, 1.3821429], [1.2786462, 0.92572117]]\n ]],\n [1, 3, 2, 2]));\n expectTensorsClose(\n mean, tensor2d([[5, 5.6666665], [6.3333335, 7]], [2, 2]));\n expectTensorsClose(\n variance,\n tensor2d([[24.666666, 14.888889], [8.222222, 4.6666665]], [2, 2]));\n });\n});\n\ndescribeMathCPUAndGPU('batchNormalization', () => {\n it('2D, no broadcast, no gamma, no beta', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const mean = tensor2d([[5, 5], [5, 5]], [2, 2]);\n const variance = tensor2d([[4, 16], [4, 16]], [2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, null, null, 0),\n tensor2d([[2.5, 3.75], [12.5, 8.75]], [2, 2]));\n });\n it('2D, no broadcast, no gamma, no beta, custom epsilon', () => {\n const x = tensor2d([[30, 30], [60, 60]], [2, 2]);\n const mean = tensor2d([[0, 0], [0, 0]], [2, 2]);\n const variance = tensor2d([[7, 7], [7, 7]], [2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, null, null, 2),\n tensor2d([[10, 10], [20, 20]], [2, 2]));\n });\n it('2D, no broadcast, gamma, no beta', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const mean = tensor2d([[5, 5], [5, 5]], [2, 2]);\n const variance = tensor2d([[4, 16], [4, 16]], [2, 2]);\n const gamma = tensor2d([[1, 2], [3, 4]], [2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, null, gamma, 0),\n tensor2d([[2.5, 7.5], [37.5, 35]], [2, 2]));\n });\n it('2D, no broadcast, gamma, beta', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const mean = tensor2d([[5, 5], [5, 5]], [2, 2]);\n const variance = tensor2d([[4, 16], [4, 16]], [2, 2]);\n const gamma = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const beta = tensor2d([[-1, -1], [-2, -2]], [2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor2d([[1.5, 6.5], [35.5, 33]], [2, 2]));\n });\n it('2D, broadcast, gamma, beta', () => {\n const x = tensor2d([[10, 20], [30, 40]], [2, 2]);\n const mean = tensor1d([2, 5]);\n const variance = tensor1d([1, 4]);\n const gamma = tensor1d([3, 4]);\n const beta = tensor1d([-1, -2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor2d([[23, 28], [83, 68]], [2, 2]));\n });\n it('3D, no broadcast, no gamma, no beta', () => {\n const x = tensor3d([[[10, 20], [30, 40]], [[10, 20], [30, 40]]], [2, 2, 2]);\n const mean = tensor3d([[[5, 5], [5, 5]], [[5, 5], [5, 5]]], [2, 2, 2]);\n const variance =\n tensor3d([[[4, 16], [4, 16]], [[16, 25], [16, 25]]], [2, 2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, null, null, 0),\n tensor3d(\n [[[2.5, 3.75], [12.5, 8.75]], [[1.25, 3], [6.25, 7]]], [2, 2, 2]));\n });\n it('3D, no broadcast, gamma, beta', () => {\n const x = tensor3d([[[10, 20], [30, 40]], [[10, 20], [30, 40]]], [2, 2, 2]);\n const mean = tensor3d([[[5, 5], [5, 5]], [[5, 5], [5, 5]]], [2, 2, 2]);\n const variance =\n tensor3d([[[4, 16], [4, 16]], [[16, 25], [16, 25]]], [2, 2, 2]);\n const gamma = tensor3d([[[2, 2], [2, 2]], [[4, 4], [4, 4]]], [2, 2, 2]);\n const beta =\n tensor3d([[[-1, -1], [-2, -2]], [[-1, -1], [-2, -2]]], [2, 2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor3d([[[4, 6.5], [23, 15.5]], [[4, 11], [23, 26]]], [2, 2, 2]));\n });\n it('3D, broadcast, gamma, beta', () => {\n const x = tensor3d([[[10, 20], [30, 40]], [[10, 20], [30, 40]]], [2, 2, 2]);\n const mean = tensor1d([5, 5]);\n const variance = tensor1d([4, 16]);\n const gamma = tensor1d([2, 4]);\n const beta = tensor1d([-1, -2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor3d([[[4, 13], [24, 33]], [[4, 13], [24, 33]]], [2, 2, 2]));\n });\n it('4D, no broadcast, no gamma, no beta', () => {\n const x = tensor4d(\n [\n [[[10, 20], [30, 40]], [[10, 20], [30, 40]]],\n [[[-10, -20], [-30, -40]], [[-10, -20], [-30, -40]]]\n ],\n [2, 2, 2, 2]);\n const mean = tensor4d(\n [\n [[[5, 5], [5, 5]], [[5, 5], [5, 5]]],\n [[[-5, -5], [-5, -5]], [[-5, -5], [-5, -5]]]\n ],\n [2, 2, 2, 2]);\n const variance = tensor4d(\n [\n [[[4, 16], [4, 16]], [[16, 25], [16, 25]]],\n [[[4, 16], [4, 16]], [[16, 25], [16, 25]]]\n ],\n [2, 2, 2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, null, null, 0),\n tensor4d(\n [\n [[[2.5, 3.75], [12.5, 8.75]], [[1.25, 3], [6.25, 7]]],\n [[[-2.5, -3.75], [-12.5, -8.75]], [[-1.25, -3], [-6.25, -7]]]\n ],\n [2, 2, 2, 2]));\n });\n it('4D, no broadcast, gamma, beta', () => {\n const x = tensor4d(\n [\n [[[10, 20], [30, 40]], [[10, 20], [30, 40]]],\n [[[-10, -20], [-30, -40]], [[-10, -20], [-30, -40]]]\n ],\n [2, 2, 2, 2]);\n const mean = tensor4d(\n [\n [[[5, 5], [5, 5]], [[5, 5], [5, 5]]],\n [[[-5, -5], [-5, -5]], [[-5, -5], [-5, -5]]]\n ],\n [2, 2, 2, 2]);\n const variance = tensor4d(\n [\n [[[4, 16], [4, 16]], [[16, 25], [16, 25]]],\n [[[4, 16], [4, 16]], [[16, 25], [16, 25]]]\n ],\n [2, 2, 2, 2]);\n const gamma = tensor4d(\n [\n [[[2, 2], [2, 2]], [[4, 4], [4, 4]]],\n [[[2, 2], [2, 2]], [[4, 4], [4, 4]]]\n ],\n [2, 2, 2, 2]);\n const beta = tensor4d(\n [\n [[[-1, -1], [-2, -2]], [[-1, -1], [-2, -2]]],\n [[[1, 1], [2, 2]], [[1, 1], [2, 2]]]\n ],\n [2, 2, 2, 2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor4d(\n [\n [[[4, 6.5], [23, 15.5]], [[4, 11], [23, 26]]],\n [[[-4, -6.5], [-23, -15.5]], [[-4, -11], [-23, -26]]]\n ],\n [2, 2, 2, 2]));\n });\n it('4D, broadcast, gamma, beta', () => {\n const x = tensor4d(\n [[[[10, 20], [30, 40]]], [[[10, 20], [30, 40]]]], [2, 1, 2, 2]);\n const mean = tensor1d([5, 5]);\n const variance = tensor1d([4, 16]);\n const gamma = tensor1d([2, 4]);\n const beta = tensor1d([-1, -2]);\n expectTensorsClose(\n batchNormalization(x, mean, variance, beta, gamma, 0),\n tensor4d([[[[4, 13], [24, 33]]], [[[4, 13], [24, 33]]]], [2, 1, 2, 2]));\n });\n});\n\ndescribeMathCPU('BatchNormalization Layers: Symbolic', () => {\n const validInputShapes = [[4, 6], [2, 3, 4], [2, 3, 4, 5]];\n for (const inputShape of validInputShapes) {\n const testTitle = `shape=${JSON.stringify(inputShape)}`;\n it(testTitle, () => {\n const x = new SymbolicTensor('float32', inputShape, null, [], null);\n const layer = tfl.layers.batchNormalization({});\n const y = layer.apply(x) as SymbolicTensor;\n expect(y.dtype).toEqual(x.dtype);\n expect(y.shape).toEqual(x.shape);\n });\n }\n\n it('Undetermined dim axis leads to ValueError', () => {\n const x = new SymbolicTensor('float32', [null, 2, 3], null, [], null);\n const layer = tfl.layers.batchNormalization({axis: 0});\n expect(() => layer.apply(x))\n .toThrowError(\n /Axis 0 of input tensor should have a defined dimension.*/);\n });\n\n it('batchNormalization constructor works without arg', () => {\n const layer = tfl.layers.batchNormalization();\n expect(layer.getConfig().axis).toEqual(-1);\n });\n});\n\ndescribeMathCPUAndGPU('BatchNormalization Layers: Tensor', () => {\n const dimensions = [2, 3, 4];\n const axisValues = [0, -1];\n\n for (const dim of dimensions) {\n for (const axis of axisValues) {\n const testTitle = `Inference, ${dim}D, axis=${axis}`;\n it(testTitle, () => {\n const layer = tfl.layers.batchNormalization({axis});\n let x: Tensor;\n if (dim === 2) {\n x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n } else if (dim === 3) {\n x = tensor3d([[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]], [2, 2, 2]);\n } else if (dim === 4) {\n x = tensor4d(\n [\n [[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]],\n [[[-1, -2], [-3, -4]], [[1, 2], [3, 4]]]\n ],\n [2, 2, 2, 2]);\n }\n const y = layer.apply(x, {training: false}) as Tensor;\n expectTensorsClose(y, x, 0.01);\n });\n }\n }\n\n it('no center', () => {\n const layer = tfl.layers.batchNormalization({center: false, axis: 0});\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n expectTensorsClose(layer.apply(x) as Tensor, x, 0.01);\n expect(layer.getWeights().length).toEqual(3);\n // Firt weight is gamma.\n expectTensorsClose(layer.getWeights()[0], onesLike(layer.getWeights()[0]));\n // Second weight is moving mean.\n expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1]));\n // Third weight is moving variance.\n expectTensorsClose(layer.getWeights()[2], onesLike(layer.getWeights()[2]));\n });\n\n it('no scale', () => {\n const layer = tfl.layers.batchNormalization({scale: false, axis: 0});\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n expectTensorsClose(layer.apply(x) as Tensor, x, 0.01);\n expect(layer.getWeights().length).toEqual(3);\n // Firt weight is beta.\n expectTensorsClose(layer.getWeights()[0], zerosLike(layer.getWeights()[0]));\n // Second weight is moving mean.\n expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1]));\n // Third weight is moving variance.\n expectTensorsClose(layer.getWeights()[2], onesLike(layer.getWeights()[2]));\n });\n\n it('no center, no scale', () => {\n const layer = tfl.layers.batchNormalization({scale: false, center: false});\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n expectTensorsClose(layer.apply(x) as Tensor, x, 0.01);\n expect(layer.getWeights().length).toEqual(2);\n // First weight is moving mean.\n expectTensorsClose(layer.getWeights()[0], zerosLike(layer.getWeights()[0]));\n // Second weight is moving variance.\n expectTensorsClose(layer.getWeights()[1], onesLike(layer.getWeights()[1]));\n });\n\n // Use the following Python code to get the reference values for assertion:\n // ```python\n // from tensorflow import keras\n // import numpy as np\n //\n // layer1 = keras.layers.BatchNormalization(input_shape=(4,))\n // model = keras.Sequential([layer1])\n //\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs = np.array(\n // [[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]], dtype=np.float32)\n // ys = np.zeros([3, 4])\n // print(layer1.get_weights())\n // history = model.fit(xs, ys, epochs=2, batch_size=3)\n // print(history.history)\n // print(layer1.get_weights())\n // ```\n it('Fit: 2D, BatchNorm Layer Only', async () => {\n const layer1 = tfl.layers.batchNormalization({inputShape: [4]});\n const model = tfl.sequential({layers: [layer1]});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs1 = tensor2d([[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]], [3, 4]);\n const ys = zeros([3, 4]);\n const history = await model.fit(xs1, ys, {epochs: 2, batchSize: 3});\n expect(history.history['loss'][0]).toBeCloseTo(0.9998891353607178);\n expect(history.history['loss'][1]).toBeCloseTo(0.9899163246154785);\n const gammaValue = layer1.getWeights()[0];\n expectTensorsClose(\n gammaValue, [0.9900254, 0.9900257, 0.9900262, 0.9900271]);\n const betaValue = layer1.getWeights()[1];\n expectTensorsClose(\n betaValue,\n [2.9802322e-10, 1.4901161e-10, 9.1269614e-10, -7.4505802e-10]);\n const movingMeanValue = layer1.getWeights()[2];\n expectTensorsClose(\n movingMeanValue, [0.09949999, 0.11276666, 0.12603334, 0.13929999]);\n const movingVarianceValue = layer1.getWeights()[3];\n expectTensorsClose(\n movingVarianceValue, [1.4709667, 1.2763889, 1.1437222, 1.0729666]);\n });\n\n // Use the following Python code to get the reference values for\n // assertion:\n // ```python\n // from tensorflow import keras\n // import numpy as np\n //\n // layer1 = keras.layers.Dense(\n // 4, kernel_initializer='ones', use_bias=False, input_shape=(4,))\n // layer2 = keras.layers.BatchNormalization()\n // layer3 = keras.layers.Dense(1, kernel_initializer='ones',\n // use_bias=False)\n // model = keras.Sequential([layer1, layer2, layer3])\n //\n // optimizer = keras.optimizers.sgd(lr=0.1)\n // model.compile(loss='mean_squared_error', optimizer=optimizer)\n //\n // xs = np.array([[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]],\n // dtype=np.float32)\n // ys = np.zeros([3, 1])\n // history = model.fit(xs, ys, epochs=3, batch_size=3)\n //\n // print(history.history)\n // print(layer1.get_weights())\n // print(layer2.get_weights())\n // print(layer3.get_weights())\n // ```\n it('Fit: 2D, BatchNorm Layer between two Dense Layers', async () => {\n const layer1 = tfl.layers.dense(\n {units: 4, kernelInitializer: 'ones', useBias: false, inputShape: [4]});\n const layer2 = tfl.layers.batchNormalization({inputShape: [4]});\n const layer3 =\n tfl.layers.dense({units: 1, kernelInitializer: 'ones', useBias: false});\n const model = tfl.sequential({layers: [layer1, layer2, layer3]});\n\n const optimizer = train.sgd(0.1);\n model.compile({loss: 'meanSquaredError', optimizer});\n\n const xs1 = tensor2d([[1, 2, 3, 4], [2, 4, 6, 8], [12, 11, 10, 9]], [3, 4]);\n const ys = zeros([3, 1]);\n const history = await model.fit(xs1, ys, {epochs: 3, batchSize: 3});\n expect(history.history['loss'][0]).toBeCloseTo(15.999907493591309);\n expect(history.history['loss'][1]).toBeCloseTo(0.025602197274565697);\n expect(history.history['loss'][2]).toBeCloseTo(0.022478966042399406);\n const dense1KernelValue = layer1.getWeights()[0];\n expectTensorsClose(\n dense1KernelValue,\n tensor2d(\n [\n [0.99999833, 0.99999833, 0.99999833, 0.99999833],\n [0.9999987, 0.9999987, 0.9999987, 0.9999987],\n [0.999999, 0.999999, 0.999999, 0.999999],\n [0.99999934, 0.99999934, 0.99999934, 0.99999934]\n ],\n [4, 4]));\n const gammaValue = layer2.getWeights()[0];\n expectTensorsClose(\n gammaValue, [0.18779878, 0.18779878, 0.18779878, 0.18779878]);\n const betaValue = layer2.getWeights()[1];\n expectTensorsClose(\n betaValue,\n [5.5367128e-08, 5.5367128e-08, 5.5367128e-08, 5.5367128e-08]);\n const movingMeanValue = layer2.getWeights()[2];\n // TODO(cais): Update this to tf.keras.\n expectTensorsClose(\n movingMeanValue, [0.7128234, 0.7128234, 0.7128234, 0.7128234]);\n const movingVarianceValue = layer2.getWeights()[3];\n expectTensorsClose(\n movingVarianceValue, [6.276868, 6.276868, 6.276868, 6.276868]);\n const dense2KernelValue = layer3.getWeights()[0];\n expectTensorsClose(\n dense2KernelValue,\n tensor2d(\n [[0.18779878], [0.18779878], [0.18779878], [0.18779878]], [4, 1]));\n });\n\n // Python reference code:\n // ```python\n // import numpy as np\n // from tensorflow import keras\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Conv2D(\n // 4,\n // 2,\n // kernel_initializer='ones',\n // bias_initializer='zeros',\n // input_shape=[5, 5, 1]))\n // model.add(keras.layers.BatchNormalization())\n // model.add(keras.layers.Flatten())\n // model.add(keras.layers.Dense(\n // 1,\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n //\n // model.compile(loss='mse', optimizer='sgd')\n //\n // xs = np.arange(2 * 5 * 5 * 1).reshape([2, 5, 5, 1])\n // ys = np.array([[0], [1]])\n // h = model.fit(xs, ys, epochs=3)\n // print(h.history)\n // ```\n it('Fit: Wtih conv2d layer', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.conv2d({\n filters: 4,\n kernelSize: 2,\n kernelInitializer: 'ones',\n biasInitializer: 'zeros',\n inputShape: [5, 5, 1]\n }));\n model.add(tfl.layers.batchNormalization());\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xsData = [];\n for (let i = 0; i < 2 * 5 * 5 * 1; ++i) {\n xsData.push(i);\n }\n const xs = tensor4d(xsData, [2, 5, 5, 1]);\n const ys = tensor2d([0, 1], [2, 1]);\n\n const h = await model.fit(xs, ys, {epochs: 2});\n expectTensorsClose(\n h.history.loss as number[], [3332.9971, 2122.5361], 0.01);\n });\n\n // Reference Python code:\n // ```python\n // import numpy as np\n // import tensorflow as tf\n // from tensorflow import keras\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Conv2DTranspose(\n // 4,\n // 2,\n // kernel_initializer='ones',\n // bias_initializer='zeros',\n // input_shape=[5, 5, 1]))\n // model.add(keras.layers.BatchNormalization())\n // model.add(keras.layers.Flatten())\n // model.add(keras.layers.Dense(\n // 1,\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n //\n // model.compile(loss='mse', optimizer='sgd')\n //\n // xs = np.arange(2 * 5 * 5 * 1).reshape([2, 5, 5, 1]).astype(np.float32)\n // xs = (xs - 25.0) / 100.0\n // ys = np.array([[0], [1]])\n //\n // print(model.layers[1].get_weights())\n // h = model.fit(xs, ys, epochs=2)\n // print(h.history)\n // print(model.layers[1].get_weights())\n // ```\n it('Fit: Wtih conv2dTranspose layer', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.conv2dTranspose({\n filters: 4,\n kernelSize: 2,\n kernelInitializer: 'ones',\n biasInitializer: 'zeros',\n inputShape: [5, 5, 1]\n }));\n model.add(tfl.layers.batchNormalization());\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xsData = [];\n for (let i = 0; i < 2 * 5 * 5 * 1; ++i) {\n xsData.push(i);\n }\n const xs =\n (tensor4d(xsData, [2, 5, 5, 1]).sub(scalar(25))).div(scalar(100));\n const ys = tensor2d([0, 1], [2, 1]);\n\n const h = await model.fit(xs, ys, {epochs: 2});\n expect(h.history.loss[0]).toBeCloseTo(13922.4492);\n expect(h.history.loss[1]).toBeCloseTo(106532048, -3);\n const weights = model.layers[1].getWeights();\n expect(weights.length).toEqual(4);\n expectTensorsClose(\n weights[0], tensor1d([7661.0874, 7661.0874, 7661.0874, 7661.0874]),\n 1e-2);\n expectTensorsClose(\n weights[1], tensor1d([-118.35103, -118.35103, -118.35103, -118.35103]),\n 1e-2);\n expectTensorsClose(\n weights[2],\n tensor1d([-0.00026271, -0.00026271, -0.00026271, -0.00026271]));\n expectTensorsClose(\n weights[3], tensor1d([0.98333836, 0.98333836, 0.98333836, 0.98333836]));\n });\n\n // Use the following Python code to get the reference values for assertion:\n // ```python\n // from tensorflow import keras\n // import numpy as np\n //\n // layer1 = keras.layers.BatchNormalization(input_shape=[2, 2])\n // model = keras.Sequential([layer1])\n //\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs = np.array(\n // [[[1, 2], [3, 4]], [[2, 4], [6, 8]], [[12, 11], [10, 9]]],\n // dtype=np.float32)\n // ys = np.zeros([3, 2, 2], dtype=np.float32)\n // print(layer1.get_weights())\n // history = model.fit(xs, ys, epochs=2, batch_size=3)\n // print(history.history)\n // print(layer1.get_weights())\n // ```\n it('Fit: 3D, BatchNorm Layer Only', async () => {\n const layer1 = tfl.layers.batchNormalization({inputShape: [2, 2]});\n const model = tfl.sequential({layers: [layer1]});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs1 = tensor3d(\n [[[1, 2], [3, 4]], [[2, 4], [6, 8]], [[12, 11], [10, 9]]], [3, 2, 2]);\n const ys = zeros([3, 2, 2]);\n const history = await model.fit(xs1, ys, {epochs: 2, batchSize: 3});\n expect(history.history['loss'][0]).toBeCloseTo(0.9999215006828308);\n expect(history.history['loss'][1]).toBeCloseTo(0.980024516582489);\n const gammaValue = layer1.getWeights()[0];\n expectTensorsClose(gammaValue, [0.98010117, 0.98010194]);\n const betaValue = layer1.getWeights()[1];\n expectTensorsClose(betaValue, [-1.1175870e-09, 8.1956386e-10]);\n const movingMeanValue = layer1.getWeights()[2];\n expectTensorsClose(movingMeanValue, [0.11276666, 0.12603334]);\n const movingVarianceValue = layer1.getWeights()[3];\n expectTensorsClose(movingVarianceValue, [1.3161889, 1.1835222], 1e-5);\n });\n});\n\ndescribeMathCPUAndGPU('LayerNormalization Layer: Symbolic', () => {\n it('Invalid axis value leads to constructor error', () => {\n expect(() => tfl.layers.layerNormalization({\n // tslint:disable-next-line:no-any\n axis: 'foo' as any\n })).toThrowError(/Expected axis to be an integer/);\n expect(() => tfl.layers.layerNormalization({\n axis: 1.2\n })).toThrowError(/Expected axis to be an integer/);\n expect(() => tfl.layers.layerNormalization({\n axis: [1, 1.5]\n })).toThrowError(/Expected axis to be an array of integers/);\n });\n\n it('Serialization round trip', async () => {\n const layer = tfl.layers.layerNormalization(\n {axis: [-2, -1], center: true, scale: false});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.layerNormalization(tsConfig);\n expect(layerPrime.getConfig()).toEqual(layer.getConfig());\n });\n\n it('Deserialize model with BatchNorm Layer', async () => {\n // tslint:disable:max-line-length\n const modelJSONString =\n `{\"class_name\": \"Sequential\", \"config\": {\"name\": \"sequential\", \"layers\": [{\"class_name\": \"Dense\", \"config\": {\"name\": \"dense\", \"trainable\": true, \"batch_input_shape\": [null, 5], \"dtype\": \"float32\", \"units\": 10, \"activation\": \"linear\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}}, {\"class_name\": \"BatchNormalization\", \"config\": {\"name\": \"batch_normalization\", \"trainable\": true, \"dtype\": \"float32\", \"axis\": [1], \"momentum\": 0.99, \"epsilon\": 0.001, \"center\": true, \"scale\": true, \"beta_initializer\": {\"class_name\": \"Zeros\", \"config\": {}}, \"gamma_initializer\": {\"class_name\": \"Ones\", \"config\": {}}, \"moving_mean_initializer\": {\"class_name\": \"Zeros\", \"config\": {}}, \"moving_variance_initializer\": {\"class_name\": \"Ones\", \"config\": {}}, \"beta_regularizer\": null, \"gamma_regularizer\": null, \"beta_constraint\": null, \"gamma_constraint\": null}}, {\"class_name\": \"Dense\", \"config\": {\"name\": \"dense_1\", \"trainable\": true, \"dtype\": \"float32\", \"units\": 1, \"activation\": \"sigmoid\", \"use_bias\": true, \"kernel_initializer\": {\"class_name\": \"GlorotUniform\", \"config\": {\"seed\": null}}, \"bias_initializer\": {\"class_name\": \"Zeros\", \"config\": {}}, \"kernel_regularizer\": null, \"bias_regularizer\": null, \"activity_regularizer\": null, \"kernel_constraint\": null, \"bias_constraint\": null}}]}, \"keras_version\": \"2.2.4-tf\", \"backend\": \"tensorflow\"}`;\n // tslint:enable:max-line-length\n const model = await tfl.models.modelFromJSON(JSON.parse(modelJSONString));\n const ys = model.predict(zeros([3, 5])) as Tensor;\n expect(ys.shape).toEqual([3, 1]);\n expect(model.layers[1].getWeights().length).toEqual(4);\n });\n});\n\ndescribeMathCPUAndGPU('LayerNormalization Layer: Tensor', () => {\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // layer = tf.keras.layers.LayerNormalization()\n // xs = np.array([[1, 2, 3], [3, 6, 24]], dtype=np.float32)\n // ys = layer(xs)\n // print(ys)\n // ```\n it('Forward, 2D input, default axis', () => {\n const layer = tfl.layers.layerNormalization();\n const xs = tensor2d([[1, 2, 3], [3, 6, 24]]);\n const ys = layer.apply(xs) as Tensor;\n expectTensorsClose(\n ys,\n tensor2d(\n [[-1.2238274, 0, 1.2238274], [-0.8626572, -0.5391607, 1.401818]]));\n });\n\n it('Forward: no memory leak', () => {\n const layer = tfl.layers.layerNormalization();\n const xs = tensor2d([[1, 2, 3], [3, 6, 24]]);\n dispose(layer.apply(xs) as Tensor); // Warm up.\n const numTensors0 = memory().numTensors;\n dispose(layer.apply(xs) as Tensor);\n expect(memory().numTensors).toEqual(numTensors0);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // layer = tf.keras.layers.LayerNormalization()\n // xs = np.array([1, 2, 3, 6, 5, 4, 3, 6, 24, -10, 0, 5],\n // dtype=np.float32).reshape((2, 2, 3))\n // ys = layer(xs)\n // print(ys)\n // ```\n it('Forward, 3D input, default axis', () => {\n const layer = tfl.layers.layerNormalization();\n const xs = tensor3d([1, 2, 3, 6, 5, 4, 3, 6, 24, -10, 0, 5], [2, 2, 3]);\n const ys = layer.apply(xs) as Tensor;\n expectTensorsClose(\n ys, tensor3d([\n [[-1.2238274, 0, 1.2238274], [1.2238274, 0, -1.2238274]],\n [\n [-0.8626572, -0.5391607, 1.401818],\n [-1.3362889, 0.26725778, 1.0690311]\n ]\n ]));\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // layer = tf.keras.layers.LayerNormalization(axis=[1, 2])\n // xs = np.array([1, 2, 3, 6, 5, 4, 3, 6, 24, -10, 0, 5],\n // dtype=np.float32).reshape((2, 2, 3))\n // ys = layer(xs)\n // print(ys)\n // ```\n const nonDefaultAxisValues: number[][] = [[1, 2], [-2, -1]];\n for (const nonDefaultAxis of nonDefaultAxisValues) {\n it(`Forward, 3D input, non-default axis: ${nonDefaultAxis}`, () => {\n const layer = tfl.layers.layerNormalization({axis: nonDefaultAxis});\n const xs = tensor3d([1, 2, 3, 6, 5, 4, 3, 6, 24, -10, 0, 5], [2, 2, 3]);\n const ys = layer.apply(xs) as Tensor;\n expectTensorsClose(ys, tensor3d([\n [\n [-1.4635992, -0.8781595, -0.29271984],\n [1.4635992, 0.8781595, 0.29271984]\n ],\n [\n [-0.1645762, 0.13166097, 1.909084],\n [-1.4482707, -0.46081337, 0.03291526]\n ]\n ]));\n });\n }\n\n it('Duplicate items in axis leads to constructor error', () => {\n const layers = tfl.layers.layerNormalization({axis: [-2, -1, -1]});\n const xs = tensor3d([1, 2, 3, 6, 5, 4, 3, 6, 24, -10, 0, 5], [2, 2, 3]);\n expect(() => layers.apply(xs)).toThrowError(/duplicate axes/);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.LayerNormalization(input_shape=(3,)))\n // model.add(tf.keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(loss='mse', optimizer='sgd')\n //\n // xs = np.array([[1, 2, 3], [3, 6, 24], [10, 5, 0]], dtype=np.float32)\n // ys = np.array([[0], [-1], [2]], dtype=np.float32)\n // history = model.fit(xs, ys, epochs=5, verbose=0)\n // print(history.history)\n // ```\n it('Training: 2D: default axis', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.layerNormalization({inputShape: [3]}));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor2d([[1, 2, 3], [3, 6, 24], [10, 5, 0]]);\n const ys = tensor2d([[0], [-1], [2]]);\n const history = await model.fit(xs, ys, {epochs: 5});\n test_util.expectArraysClose(history.history.loss as number[], [\n 1.6666666269302368, 1.4296358823776245, 1.2372404336929321,\n 1.0793765783309937, 0.9486551880836487\n ]);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Dense(10, kernel_initializer='ones',\n // input_shape=(3,))) model.add(tf.keras.layers.LayerNormalization())\n // model.add(tf.keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(loss=\"mse\", optimizer=\"sgd\")\n //\n // xs = np.array([[1, 2, 3], [3, 6, 24], [10, 5, 0], [2, 7, 8]],\n // dtype=np.float32) ys = np.array([[0], [-1], [2], [3]], dtype=np.float32)\n // history = model.fit(xs, ys, epochs=5, verbose=0)\n // print(history.history)\n // ```\n it('Training: 2D: as intermediate layer: default axis', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 10, kernelInitializer: 'ones', inputShape: [3]}));\n model.add(tfl.layers.layerNormalization());\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor2d([[1, 2, 3], [3, 6, 24], [10, 5, 0], [2, 7, 8]]);\n const ys = tensor2d([[0], [-1], [2], [3]]);\n const history = await model.fit(xs, ys, {epochs: 5});\n test_util.expectArraysClose(history.history.loss as number[], [\n 3.5, 3.1083502769470215, 2.8706729412078857, 2.7243311405181885,\n 2.6366190910339355\n ]);\n });\n\n it('Training: no memory leak', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.layerNormalization({inputShape: [3]}));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor2d([[1, 2, 3], [3, 6, 24], [10, 5, 0], [2, 7, 8]]);\n const ys = tensor2d([[0], [-1], [2], [3]]);\n await model.fit(xs, ys, {epochs: 1}); // Warm up.\n\n const numTensors0 = memory().numTensors;\n await model.fit(xs, ys, {epochs: 1});\n expect(memory().numTensors).toEqual(numTensors0);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.LayerNormalization(input_shape=(2, 3)))\n // model.add(tf.keras.layers.Flatten())\n // model.add(tf.keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(loss='mse', optimizer='sgd')\n //\n // xs = np.array([[[1, 2, 3], [3, 6, 24]], [[10, 5, 0], [2, 7, 8]]],\n // dtype=np.float32) ys = np.array([[0], [-1]], dtype=np.float32) history =\n // model.fit(xs, ys, epochs=5, verbose=0) print(history.history)\n // ```\n it('Training: 3D: default axis', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.layerNormalization({inputShape: [2, 3]}));\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor3d([[[1, 2, 3], [3, 6, 24]], [[10, 5, 0], [2, 7, 8]]]);\n const ys = tensor2d([[0], [-1]]);\n const history = await model.fit(xs, ys, {epochs: 5});\n test_util.expectArraysClose(history.history.loss as number[], [\n 0.5, 0.33119967579841614, 0.23371894657611847, 0.171361044049263,\n 0.12831644713878632\n ]);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.LayerNormalization(input_shape=(2, 3), axis=[-2,\n // -1])) model.add(tf.keras.layers.Flatten())\n // model.add(tf.keras.layers.Dense(1, kernel_initializer='ones'))\n // model.compile(loss='mse', optimizer='sgd')\n //\n // xs = np.array([[[1, 2, 3], [3, 6, 24]], [[10, 5, 0], [2, 7, 8]]],\n // dtype=np.float32) ys = np.array([[0], [-1]], dtype=np.float32) history =\n // model.fit(xs, ys, epochs=5, verbose=0) print(history.history)\n // ```\n it('Training: 3D: non-default axis', async () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.layerNormalization({inputShape: [2, 3], axis: [-2, -1]}));\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor3d([[[1, 2, 3], [3, 6, 24]], [[10, 5, 0], [2, 7, 8]]]);\n const ys = tensor2d([[0], [-1]]);\n const history = await model.fit(xs, ys, {epochs: 5});\n test_util.expectArraysClose(history.history.loss as number[], [\n 0.5, 0.3337608873844147, 0.23789873719215393, 0.17923809587955475,\n 0.1408553570508957\n ]);\n });\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // model = tf.keras.Sequential()\n // embedding_layer = tf.keras.layers.Embedding(\n // input_dim=4, output_dim=3, input_length=4, mask_zero=True,\n // embeddings_initializer='ones')\n // model.add(embedding_layer)\n // model.add(tf.keras.layers.LayerNormalization())\n //\n // xs = np.array([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]],\n // dtype=np.float32)\n // model.predict(xs)\n //\n // embedding_layer.set_weights([\n // np.array([[1, 2, 3], [3, 2, 1], [2, 3, 1], [3, 1, 2]],\n // dtype=np.float32)])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('Forward, with masking', () => {\n const model = tfl.sequential();\n const embeddingLayer = tfl.layers.embedding({\n inputDim: 4,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n });\n model.add(embeddingLayer);\n // model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.add(tfl.layers.layerNormalization());\n\n const xs =\n tensor2d([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]]);\n model.predict(xs); // Make sure the embedding layer is built first.\n\n embeddingLayer.setWeights(\n [tensor2d([[1, 2, 3], [3, 2, 1], [2, 3, 1], [3, 1, 2]])]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(\n ys, tensor3d([\n [\n [-1.2238274, 0, 1.2238274], [-1.2238274, 0, 1.2238274],\n [-1.2238274, 0, 1.2238274], [-1.2238274, 0, 1.2238274]\n ],\n [\n [1.2238274, 0, -1.2238274], [-1.2238274, 0, 1.2238274],\n [-1.2238274, 0, 1.2238274], [-1.2238274, 0, 1.2238274]\n ],\n [\n [1.2238274, 0, -1.2238274], [0, 1.2238274, -1.2238274],\n [-1.2238274, 0, 1.2238274], [-1.2238274, 0, 1.2238274]\n ],\n [\n [1.2238274, 0, -1.2238274], [0, 1.2238274, -1.2238274],\n [1.2238274, -1.2238274, 0], [-1.2238274, 0, 1.2238274]\n ]\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-layers/dist/layers/padding.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts deleted file mode 100644 index 25ccf9ced..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Layer, LayerArgs } from '../engine/topology'; -import { DataFormat, Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -/** - * Pads the middle dimension of a 3D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of 2 integers, how many zeros to add at the start and - * end of the middle dimension (i.e., dimension 1). - * @return A padded 3D `tf.Tensor`. - */ -export declare function temporalPadding(x: Tensor, padding?: [number, number]): Tensor; -/** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ -export declare function spatial2dPadding(x: Tensor, padding?: [[number, number], [number, number]], dataFormat?: DataFormat): Tensor; -export declare interface ZeroPadding2DLayerArgs extends LayerArgs { - /** - * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of - * which is an `Array` of 2 integers. - * - If integer, the same symmetric padding is applied to width and height. - * - If Array` of 2 integers, interpreted as two different symmetric values - * for height and width: - * `[symmetricHeightPad, symmetricWidthPad]`. - * - If `Array` of 2 `Array`s, interpreted as: - * `[[topPad, bottomPad], [leftPad, rightPad]]`. - */ - padding?: number | [number, number] | [[number, number], [number, number]]; - /** - * One of `'channelsLast'` (default) and `'channelsFirst'`. - * - * The ordering of the dimensions in the inputs. - * `channelsLast` corresponds to inputs with shape - * `[batch, height, width, channels]` while `channelsFirst` - * corresponds to inputs with shape - * `[batch, channels, height, width]`. - */ - dataFormat?: DataFormat; -} -export declare class ZeroPadding2D extends Layer { - /** @nocollapse */ - static className: string; - readonly dataFormat: DataFormat; - readonly padding: [[number, number], [number, number]]; - constructor(args?: ZeroPadding2DLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js deleted file mode 100644 index caca1fbd6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Padding Layers. - */ -// Porting Note: In Python Keras, the padding layers are in convolutional.py, -// but we decided to put them in a separate file (padding.ts) for clarity. -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import { imageDataFormat } from '../backend/common'; -import { InputSpec, Layer } from '../engine/topology'; -import { ValueError } from '../errors'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -/** - * Pads the middle dimension of a 3D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of 2 integers, how many zeros to add at the start and - * end of the middle dimension (i.e., dimension 1). - * @return A padded 3D `tf.Tensor`. - */ -export function temporalPadding(x, padding) { - return tidy(() => { - if (x.rank !== 3) { - throw new ValueError(`temporalPadding expects input tensor to be 3-D, but received a ` + - `${x.rank}-D tensor.`); - } - if (padding == null) { - padding = [1, 1]; - } - if (padding.length !== 2) { - throw new ValueError(`temporalPadding expects input padding pattern to be a length-2 ` + - `array, but received a length-${padding.length} array.`); - } - const pattern = [[0, 0], padding, [0, 0]]; - return tfc.pad(x, pattern); - }); -} -/** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ -export function spatial2dPadding(x, padding, dataFormat) { - return tidy(() => { - if (x.rank !== 4) { - throw new ValueError(`temporalPadding expects input tensor to be 4-D, but received a ` + - `${x.rank}-D tensor.`); - } - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError(`Unknown data format: ${dataFormat}. ` + - `Supported data formats are 'channelsLast' and 'channelsFirst.`); - } - let pattern; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } - else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - return tfc.pad(x, pattern); - }); -} -export class ZeroPadding2D extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - this.padding = [[1, 1], [1, 1]]; - } - else if (typeof args.padding === 'number') { - this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } - else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError(`ZeroPadding2D expects padding to be a length-2 array, but ` + - `received a length-${args.padding.length} array.`); - } - let heightPadding; - let widthPadding; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1], args.padding[1]]; - } - else { - args.padding = args.padding; - if (args.padding[0].length !== 2) { - throw new ValueError(`ZeroPadding2D expects height padding to be a length-2 array, ` + - `but received a length-${args.padding[0].length} array.`); - } - heightPadding = args.padding[0]; - if (args.padding[1].length !== 2) { - throw new ValueError(`ZeroPadding2D expects width padding to be a length-2 array, ` + - `but received a length-${args.padding[1].length} array.`); - } - widthPadding = args.padding[1]; - } - this.padding = [heightPadding, widthPadding]; - } - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows; - let cols; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tidy(() => spatial2dPadding(getExactlyOneTensor(inputs), this.padding, this.dataFormat)); - } - getConfig() { - const config = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ZeroPadding2D.className = 'ZeroPadding2D'; -serialization.registerClass(ZeroPadding2D); -//# sourceMappingURL=padding.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-layers/dist/layers/padding.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map deleted file mode 100644 index 68895b3be..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding.js","sourceRoot":"","sources":["../../src/layers/padding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,6EAA6E;AAC7E,4EAA4E;AAE5E,OAAO,KAAK,GAAG,MAAM,uBAAuB,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AED,IAAI,CAAC,MAAuB,EAAE,MAAc;QAC1C,OAAO,IAAI,CACP,GAAG,EAAE,CAAC,gBAAgB,CAClB,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAA6B;YACvC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QACF,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;;AArGD,kBAAkB;AACX,uBAAS,GAAG,eAAe,CAAC;AAsGrC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map deleted file mode 100644 index 688bbdfb0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding_test.js","sourceRoot":"","sources":["../../src/layers/padding_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAS,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE/F,OAAO,EAAC,gBAAgB,EAAE,eAAe,EAAyB,MAAM,WAAW,CAAC;AAEpF,qBAAqB,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC7B,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAC7B,kBAAkB,CACd,CAAC,EAAE,QAAQ,CAAC;YACV,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,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,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,kBAAkB,CACd,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,kBAAkB,CACd,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit Tests for Padding Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tensor3d} from '@tensorflow/tfjs-core';\n\nimport {SymbolicTensor} from '../engine/topology';\nimport * as tfl from '../index';\nimport {DataFormat} from '../keras_format/common';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {spatial2dPadding, temporalPadding, ZeroPadding2DLayerArgs} from './padding';\n\ndescribeMathCPUAndGPU('temporalPadding', () => {\n it('default padding 1-1', () => {\n const x = tensor3d([[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]);\n const y = temporalPadding(x);\n expectTensorsClose(\n y, tensor3d([\n [[0, 0], [1, 2], [3, 4], [0, 0]], [[0, 0], [-1, -2], [-3, -4], [0, 0]]\n ]));\n });\n it('custom padding 2-2', () => {\n const x = tensor3d([[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]);\n const y = temporalPadding(x, [2, 2]);\n expectTensorsClose(y, tensor3d([\n [[0, 0], [0, 0], [1, 2], [3, 4], [0, 0], [0, 0]],\n [[0, 0], [0, 0], [-1, -2], [-3, -4], [0, 0], [0, 0]]\n ]));\n });\n});\n\ndescribeMathCPUAndGPU('spatial2dPadding', () => {\n it('default padding 1-1-1-1', () => {\n const x = tfc.ones([2, 3, 4, 3]);\n const y = spatial2dPadding(x);\n\n expect(y.shape).toEqual([2, 5, 6, 3]);\n expectTensorsClose(tfc.slice(y, [0, 1, 1, 0], [2, 3, 4, 3]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 1, 6, 3]), tfc.zeros([2, 1, 6, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 4, 0, 0], [2, 1, 6, 3]), tfc.zeros([2, 1, 6, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 5, 1, 3]), tfc.zeros([2, 5, 1, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 5, 0], [2, 5, 1, 3]), tfc.zeros([2, 5, 1, 3]));\n });\n\n it('custom padding 2-2-3-0', () => {\n const x = tfc.ones([2, 3, 4, 3]);\n const y = spatial2dPadding(x, [[2, 2], [3, 0]]);\n expect(y.shape).toEqual([2, 7, 7, 3]);\n\n expectTensorsClose(tfc.slice(y, [0, 2, 3, 0], [2, 3, 4, 3]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 2, 7, 3]), tfc.zeros([2, 2, 7, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 5, 0, 0], [2, 2, 7, 3]), tfc.zeros([2, 2, 7, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 7, 3, 3]), tfc.zeros([2, 7, 3, 3]));\n });\n});\n\ndescribeMathCPU('ZeroPadding2D: Symbolic', () => {\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n\n for (const dataFormat of dataFormats) {\n it('Default padding 1-1-1-1, dataFormat=' + dataFormat, () => {\n const x = new SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n const layer = tfl.layers.zeroPadding2d({dataFormat});\n const y = layer.apply(x) as SymbolicTensor;\n expect(y.dtype).toEqual('float32');\n if (dataFormat === 'channelsFirst') {\n expect(y.shape).toEqual([1, 2, 5, 6]);\n } else {\n expect(y.shape).toEqual([1, 4, 5, 4]);\n }\n });\n\n it('All symmetric padding 2, dataFormat=' + dataFormat, () => {\n const x = new SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n const layer = tfl.layers.zeroPadding2d({dataFormat, padding: 2});\n const y = layer.apply(x) as SymbolicTensor;\n expect(y.dtype).toEqual('float32');\n if (dataFormat === 'channelsFirst') {\n expect(y.shape).toEqual([1, 2, 7, 8]);\n } else {\n expect(y.shape).toEqual([1, 6, 7, 4]);\n }\n });\n\n it('Symmetric padding 2-3, dataFormat=' + dataFormat, () => {\n const x = new SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n const layer = tfl.layers.zeroPadding2d({dataFormat, padding: [2, 3]});\n const y = layer.apply(x) as SymbolicTensor;\n expect(y.dtype).toEqual('float32');\n if (dataFormat === 'channelsFirst') {\n expect(y.shape).toEqual([1, 2, 7, 10]);\n } else {\n expect(y.shape).toEqual([1, 6, 9, 4]);\n }\n });\n\n it('Asymmetric padding 2-3-4-5, dataFormat=' + dataFormat, () => {\n const x = new SymbolicTensor('float32', [1, 2, 3, 4], null, [], null);\n const layer =\n tfl.layers.zeroPadding2d({dataFormat, padding: [[2, 3], [4, 5]]});\n const y = layer.apply(x) as SymbolicTensor;\n expect(y.dtype).toEqual('float32');\n if (dataFormat === 'channelsFirst') {\n expect(y.shape).toEqual([1, 2, 8, 13]);\n } else {\n expect(y.shape).toEqual([1, 7, 12, 4]);\n }\n });\n }\n\n it('Incorrect array length leads to error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.zeroPadding2d({padding: [2, 3, 4]} as any))\n .toThrowError(/length-2 array/);\n });\n\n it('Incorrect height array length leads to error', () => {\n // tslint:disable:no-any\n expect(\n () => tfl.layers.zeroPadding2d({padding: [[2, 3, 4], [5, 6]]} as any))\n .toThrowError(/height.*length-2 array/);\n // tslint:enable:no-any\n });\n\n it('Incorrect height array length leads to error', () => {\n // tslint:disable:no-any\n expect(\n () => tfl.layers.zeroPadding2d({padding: [[1, 1], [2, 3, 4]]} as any))\n .toThrowError(/width.*length-2 array/);\n // tslint:enable:no-any\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.zeroPadding2d({padding: [2, 4]});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n const tsConfig = convertPythonicToTs(pythonicConfig);\n const layerPrime = tfl.layers.zeroPadding2d(\n tsConfig as ZeroPadding2DLayerArgs);\n expect(layerPrime.padding).toEqual(layer.padding);\n expect(layerPrime.dataFormat).toEqual(layer.dataFormat);\n });\n});\n\ndescribeMathCPUAndGPU('ZeroPadding2D: Tensor', () => {\n it('Default padding 1-1-1-1, channelsLast', () => {\n const x = tfc.ones([2, 2, 2, 3]);\n const layer = tfl.layers.zeroPadding2d();\n const y = layer.apply(x) as Tensor;\n expect(y.shape).toEqual([2, 4, 4, 3]);\n\n expectTensorsClose(tfc.slice(y, [0, 1, 1, 0], [2, 2, 2, 3]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 1, 4, 3]), tfc.zeros([2, 1, 4, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 3, 0, 0], [2, 1, 4, 3]), tfc.zeros([2, 1, 4, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 4, 1, 3]), tfc.zeros([2, 4, 1, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 3, 0], [2, 4, 1, 3]), tfc.zeros([2, 4, 1, 3]));\n });\n\n it('Default padding 1-1-1-1, channelFirst', () => {\n const x = tfc.ones([2, 3, 2, 2]);\n const layer = tfl.layers.zeroPadding2d({dataFormat: 'channelsFirst'});\n const y = layer.apply(x) as Tensor;\n expect(y.shape).toEqual([2, 3, 4, 4]);\n\n expectTensorsClose(tfc.slice(y, [0, 0, 1, 1], [2, 3, 2, 2]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 3, 1, 4]), tfc.zeros([2, 3, 1, 4]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 3, 0], [2, 3, 1, 4]), tfc.zeros([2, 3, 1, 4]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 3, 4, 1]), tfc.zeros([2, 3, 4, 1]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 3], [2, 3, 4, 1]), tfc.zeros([2, 3, 4, 1]));\n });\n\n it('Symmetric padding 2-2, channelsLast', () => {\n const x = tfc.ones([2, 2, 2, 3]);\n const layer = tfl.layers.zeroPadding2d({padding: [2, 2]});\n const y = layer.apply(x) as Tensor;\n expect(y.shape).toEqual([2, 6, 6, 3]);\n\n expectTensorsClose(tfc.slice(y, [0, 2, 2, 0], [2, 2, 2, 3]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 2, 6, 3]), tfc.zeros([2, 2, 6, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 4, 0, 0], [2, 2, 6, 3]), tfc.zeros([2, 2, 6, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 6, 2, 3]), tfc.zeros([2, 6, 2, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 4, 0], [2, 6, 2, 3]), tfc.zeros([2, 6, 2, 3]));\n });\n\n it('Asymmetric padding 2-1-2-1, channelsLast', () => {\n const x = tfc.ones([2, 2, 2, 3]);\n const layer = tfl.layers.zeroPadding2d({padding: [[2, 1], [2, 1]]});\n const y = layer.apply(x) as Tensor;\n expect(y.shape).toEqual([2, 5, 5, 3]);\n\n expectTensorsClose(tfc.slice(y, [0, 2, 2, 0], [2, 2, 2, 3]), x);\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 2, 5, 3]), tfc.zeros([2, 2, 5, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 4, 0, 0], [2, 1, 5, 3]), tfc.zeros([2, 1, 5, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 0, 0], [2, 5, 2, 3]), tfc.zeros([2, 5, 2, 3]));\n expectTensorsClose(\n tfc.slice(y, [0, 0, 4, 0], [2, 5, 1, 3]), tfc.zeros([2, 5, 1, 3]));\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-layers/dist/layers/pooling.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts deleted file mode 100644 index 9084d79dd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor, Tensor5D } from '@tensorflow/tfjs-core'; -import { Layer, LayerArgs } from '../engine/topology'; -import { DataFormat, PaddingMode, PoolMode, Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -/** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ -export declare function pool2d(x: Tensor, poolSize: [number, number], strides?: [number, number], padding?: PaddingMode, dataFormat?: DataFormat, poolMode?: PoolMode): Tensor; -/** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ -export declare function pool3d(x: Tensor5D, poolSize: [number, number, number], strides?: [number, number, number], padding?: PaddingMode, dataFormat?: DataFormat, poolMode?: PoolMode): Tensor; -export declare interface Pooling1DLayerArgs extends LayerArgs { - /** - * Size of the window to pool over, should be an integer. - */ - poolSize?: number | [number]; - /** - * Period at which to sample the pooled values. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number | [number]; - /** How to fill in data that's not an integer multiple of poolSize. */ - padding?: PaddingMode; -} -/** - * Abstract class for different pooling 1D layers. - */ -export declare abstract class Pooling1D extends Layer { - protected readonly poolSize: [number]; - protected readonly strides: [number]; - protected readonly padding: PaddingMode; - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - constructor(args: Pooling1DLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - protected abstract poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class MaxPooling1D extends Pooling1D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling1DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -export declare class AveragePooling1D extends Pooling1D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling1DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -export declare interface Pooling2DLayerArgs extends LayerArgs { - /** - * Factors by which to downscale in each dimension [vertical, horizontal]. - * Expects an integer or an array of 2 integers. - * - * For example, `[2, 2]` will halve the input in both spatial dimension. - * If only one integer is specified, the same window length - * will be used for both dimensions. - */ - poolSize?: number | [number, number]; - /** - * The size of the stride in each dimension of the pooling window. Expects - * an integer or an array of 2 integers. Integer, tuple of 2 integers, or - * None. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number | [number, number]; - /** The padding type to use for the pooling layer. */ - padding?: PaddingMode; - /** The data format to use for the pooling layer. */ - dataFormat?: DataFormat; -} -/** - * Abstract class for different pooling 2D layers. - */ -export declare abstract class Pooling2D extends Layer { - protected readonly poolSize: [number, number]; - protected readonly strides: [number, number]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - constructor(args: Pooling2DLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - protected abstract poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class MaxPooling2D extends Pooling2D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling2DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -export declare class AveragePooling2D extends Pooling2D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling2DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -export declare interface Pooling3DLayerArgs extends LayerArgs { - /** - * Factors by which to downscale in each dimension [depth, height, width]. - * Expects an integer or an array of 3 integers. - * - * For example, `[2, 2, 2]` will halve the input in three dimensions. - * If only one integer is specified, the same window length - * will be used for all dimensions. - */ - poolSize?: number | [number, number, number]; - /** - * The size of the stride in each dimension of the pooling window. Expects - * an integer or an array of 3 integers. Integer, tuple of 3 integers, or - * None. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number | [number, number, number]; - /** The padding type to use for the pooling layer. */ - padding?: PaddingMode; - /** The data format to use for the pooling layer. */ - dataFormat?: DataFormat; -} -/** - * Abstract class for different pooling 3D layers. - */ -export declare abstract class Pooling3D extends Layer { - protected readonly poolSize: [number, number, number]; - protected readonly strides: [number, number, number]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - constructor(args: Pooling3DLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - protected abstract poolingFunction(inputs: Tensor, poolSize: [number, number, number], strides: [number, number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class MaxPooling3D extends Pooling3D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling3DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number, number], strides: [number, number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -export declare class AveragePooling3D extends Pooling3D { - /** @nocollapse */ - static className: string; - constructor(args: Pooling3DLayerArgs); - protected poolingFunction(inputs: Tensor, poolSize: [number, number, number], strides: [number, number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; -} -/** - * Abstract class for different global pooling 1D layers. - */ -export declare abstract class GlobalPooling1D extends Layer { - constructor(args: LayerArgs); - computeOutputShape(inputShape: Shape): Shape; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare class GlobalAveragePooling1D extends GlobalPooling1D { - /** @nocollapse */ - static className: string; - constructor(args?: LayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare class GlobalMaxPooling1D extends GlobalPooling1D { - /** @nocollapse */ - static className: string; - constructor(args: LayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare interface GlobalPooling2DLayerArgs extends LayerArgs { - /** - * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`. - * - * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds - * to inputs with shape `[batch, height, width, channels[` while - * `CHANNEL_FIRST` corresponds to inputs with shape - * `[batch, channels, height, width]`. - */ - dataFormat?: DataFormat; -} -/** - * Abstract class for different global pooling 2D layers. - */ -export declare abstract class GlobalPooling2D extends Layer { - protected dataFormat: DataFormat; - constructor(args: GlobalPooling2DLayerArgs); - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare class GlobalAveragePooling2D extends GlobalPooling2D { - /** @nocollapse */ - static className: string; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare class GlobalMaxPooling2D extends GlobalPooling2D { - /** @nocollapse */ - static className: string; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js deleted file mode 100644 index cf8455568..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js +++ /dev/null @@ -1,518 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Pooling Layers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import { imageDataFormat } from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import { checkDataFormat, checkPaddingMode, checkPoolMode } from '../common'; -import { InputSpec } from '../engine/topology'; -import { Layer } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { convOutputLength } from '../utils/conv_utils'; -import { assertPositiveInteger } from '../utils/generic_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -import { preprocessConv2DInput, preprocessConv3DInput } from './convolutional'; -/** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ -export function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = tfc.maxPool(x, poolSize, strides, paddingString); - } - else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = tfc.avgPool( - // TODO(cais): Rank check? - x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); -} -/** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ -export function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x, dataFormat); - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = tfc.maxPool3d(x, poolSize, strides, paddingString); - } - else { // 'avg' - y = tfc.avgPool3d(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); -} -/** - * Abstract class for different pooling 1D layers. - */ -export class Pooling1D extends Layer { - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - constructor(args) { - if (args.poolSize == null) { - args.poolSize = 2; - } - super(args); - if (typeof args.poolSize === 'number') { - this.poolSize = [args.poolSize]; - } - else if (Array.isArray(args.poolSize) && - args.poolSize.length === 1 && - typeof args.poolSize[0] === 'number') { - this.poolSize = args.poolSize; - } - else { - throw new ValueError(`poolSize for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.poolSize)}`); - } - assertPositiveInteger(this.poolSize, 'poolSize'); - if (args.strides == null) { - this.strides = this.poolSize; - } - else { - if (typeof args.strides === 'number') { - this.strides = [args.strides]; - } - else if (Array.isArray(args.strides) && - args.strides.length === 1 && - typeof args.strides[0] === 'number') { - this.strides = args.strides; - } - else { - throw new ValueError(`strides for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.strides)}`); - } - } - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = K.expandDims(getExactlyOneTensor(inputs), 2); - const output = this.poolingFunction(getExactlyOneTensor(inputs), [this.poolSize[0], 1], [this.strides[0], 1], this.padding, 'channelsLast'); - // Remove dummy last dimension. - return tfc.squeeze(output, [2]); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -export class MaxPooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling1D.className = 'MaxPooling1D'; -serialization.registerClass(MaxPooling1D); -export class AveragePooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling1D.className = 'AveragePooling1D'; -serialization.registerClass(AveragePooling1D); -/** - * Abstract class for different pooling 2D layers. - */ -export class Pooling2D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError(`If the strides property of a 2D pooling layer is an Array, ` + - `it is expected to have a length of 2, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -export class MaxPooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling2D.className = 'MaxPooling2D'; -serialization.registerClass(MaxPooling2D); -export class AveragePooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling2D.className = 'AveragePooling2D'; -serialization.registerClass(AveragePooling2D); -/** - * Abstract class for different pooling 3D layers. - */ -export class Pooling3D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError(`If the strides property of a 3D pooling layer is an Array, ` + - `it is expected to have a length of 3, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let depths = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let rows = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength(depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } - else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -export class MaxPooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling3D.className = 'MaxPooling3D'; -serialization.registerClass(MaxPooling3D); -export class AveragePooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling3D.className = 'AveragePooling3D'; -serialization.registerClass(AveragePooling3D); -/** - * Abstract class for different global pooling 1D layers. - */ -export class GlobalPooling1D extends Layer { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - return [inputShape[0], inputShape[2]]; - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } -} -export class GlobalAveragePooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.mean(input, 1); - }); - } -} -/** @nocollapse */ -GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; -serialization.registerClass(GlobalAveragePooling1D); -export class GlobalMaxPooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.max(input, 1); - }); - } -} -/** @nocollapse */ -GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; -serialization.registerClass(GlobalMaxPooling1D); -/** - * Abstract class for different global pooling 2D layers. - */ -export class GlobalPooling2D extends Layer { - constructor(args) { - super(args); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = inputShape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } - else { - return [inputShape[0], inputShape[1]]; - } - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } - getConfig() { - const config = { dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -export class GlobalAveragePooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.mean(input, [1, 2]); - } - else { - return tfc.mean(input, [2, 3]); - } - }); - } -} -/** @nocollapse */ -GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; -serialization.registerClass(GlobalAveragePooling2D); -export class GlobalMaxPooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.max(input, [1, 2]); - } - else { - return tfc.max(input, [2, 3]); - } - }); - } -} -/** @nocollapse */ -GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; -serialization.registerClass(GlobalMaxPooling2D); -//# sourceMappingURL=pooling.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-layers/dist/layers/pooling.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map deleted file mode 100644 index f81d4b9db..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poo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,CAAC;AAa1C,aAAa,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map deleted file mode 100644 index 74b872d1f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map +++ /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AC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;qBACzD;iBACF;gBACD,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;gBAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;gBACjC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;SACJ;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for pooling.ts.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tensor2d, Tensor2D, tensor3d, tensor4d, tensor5d, Tensor4D, Tensor5D, util} from '@tensorflow/tfjs-core';\n\nimport {SymbolicTensor} from '../engine/topology';\nimport * as tfl from '../index';\nimport {DataFormat, PaddingMode, PoolMode} from '../keras_format/common';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {pool2d, pool3d} from './pooling';\n\ndescribeMathCPUAndGPU('pool2d', () => {\n const x4by4Data = [[[\n [10, 30, 50, 70], [20, 40, 60, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]];\n const x5by5Data = [[[\n [0, 1, 3, 5, 7], [0, 2, 4, 6, 8], [0, 0, 0, 0, 0], [0, -1, -3, -5, -7],\n [0, -2, -4, -6, -8]\n ]]];\n\n const poolModes: PoolMode[] = [undefined, 'max', 'avg'];\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const stridesArray = [1, 2];\n for (const poolMode of poolModes) {\n for (const dataFormat of dataFormats) {\n for (const stride of stridesArray) {\n const testTitle = `4x4, ${stride}, same, ${dataFormat}, ` +\n `${poolMode}`;\n it(testTitle, () => {\n let x: Tensor = tensor4d(x4by4Data, [1, 1, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n let yExpected: Tensor;\n if (poolMode === 'avg') {\n if (stride === 1) {\n yExpected = tensor4d(\n [[[\n [25, 45, 65, 75], [5, 5, 5, 5], [-25, -45, -65, -75],\n [-30, -50, -70, -80]\n ]]],\n [1, 1, 4, 4]);\n } else {\n yExpected = tensor4d([[[[25, 65], [-25, -65]]]], [1, 1, 2, 2]);\n }\n } else {\n if (stride === 1) {\n yExpected = tensor4d(\n [[[\n [40, 60, 80, 80], [40, 60, 80, 80], [-10, -30, -50, -70],\n [-20, -40, -60, -80]\n ]]],\n [1, 1, 4, 4]);\n } else if (stride === 2) {\n yExpected = tensor4d([[[[40, 80], [-10, -50]]]], [1, 1, 2, 2]);\n }\n }\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 1]);\n }\n const y =\n pool2d(x, [2, 2], [stride, stride], 'same', dataFormat, poolMode);\n expectTensorsClose(y, yExpected);\n });\n }\n }\n }\n\n for (const poolMode of poolModes) {\n it(`5x5, 2, same, CHANNEL_FIRST, ${poolMode}`, () => {\n const x5by5 = tensor4d(x5by5Data, [1, 1, 5, 5]);\n let yExpected = tensor4d(x4by4Data, [1, 1, 4, 4]);\n if (poolMode === 'avg') {\n yExpected = tensor4d(\n [[[[0.75, 4.5, 7.5], [-0.25, -2, -3.5], [-1, -5, -8]]]],\n [1, 1, 3, 3]);\n } else {\n yExpected =\n tensor4d([[[[2, 6, 8], [0, 0, 0], [0, -4, -8]]]], [1, 1, 3, 3]);\n }\n const y =\n pool2d(x5by5, [2, 2], [2, 2], 'same', 'channelsFirst', poolMode);\n expectTensorsClose(y, yExpected);\n });\n }\n\n for (const poolMode of poolModes) {\n it(`5x5, 2, valid, CHANNEL_LAST, ${poolMode}`, () => {\n const x5by5 =\n tfc.transpose(tensor4d(x5by5Data, [1, 1, 5, 5]), [0, 2, 3, 1]);\n let yExpected: Tensor4D;\n if (poolMode === 'avg') {\n yExpected = tensor4d([[[[0.75, 4.5], [-0.25, -2]]]], [1, 1, 2, 2]);\n } else {\n yExpected = tensor4d([[[[2, 6], [0, 0]]]], [1, 1, 2, 2]);\n }\n const y =\n pool2d(x5by5, [2, 2], [2, 2], 'valid', 'channelsLast', poolMode);\n expectTensorsClose(y, tfc.transpose(yExpected, [0, 2, 3, 1]));\n });\n }\n});\n\ndescribeMathCPUAndGPU('pool3d', () => {\n const x4by4by4Data = [[[\n [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]],\n [[17, 18, 19, 20], [21, 22, 23, 24], [25, 26, 27, 28], [19, 30, 31, 32]],\n [[33 ,34, 35 ,36], [37, 38, 39, 40], [41, 42, 43, 44], [45, 46, 47, 48]],\n [[49, 50, 51, 52], [53, 54, 55, 56], [57, 58, 59, 60], [61, 62, 63 ,64]]\n ]]];\n const x5by5by5Data = [[[\n [\n [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15],\n [16, 17, 18, 19, 20], [21, 22, 23, 24, 25]\n ], [\n [26, 27, 28, 29, 30], [31, 32, 33, 34, 35], [36, 37, 38, 39, 40],\n [41, 42, 43, 44, 45], [46, 47, 48, 49, 50]\n ], [\n [51, 52, 53, 54, 55], [56, 57, 58, 59, 60], [61, 62, 63, 64, 65],\n [66, 67, 68, 69, 70], [71, 72, 73, 74, 75]\n ], [\n [76, 77, 78, 79, 80], [81, 82, 83, 84, 85], [86, 87, 88, 89, 90],\n [91, 92, 93, 94, 95], [96, 97, 98, 99, 100]\n ], [\n [101, 102, 103, 104, 105], [106, 107, 108, 109, 110],\n [111, 112, 113, 114, 115], [116, 117, 118, 119, 120],\n [121, 122, 123, 124, 125]\n ]\n ]]];\n\n const poolModes: PoolMode[] = [undefined, 'max', 'avg'];\n const dataFormats: DataFormat[] =\n [undefined, 'channelsFirst', 'channelsLast'];\n const stridesArray = [1, 2];\n for (const poolMode of poolModes) {\n for (const dataFormat of dataFormats) {\n for (const stride of stridesArray) {\n const testTitle = `4x4x4, ${stride}, same, ${dataFormat}, ` +\n `${poolMode}`;\n it(testTitle, () => {\n let x: Tensor5D = tensor5d(x4by4by4Data, [1, 1, 4, 4, 4]);\n if (dataFormat !== 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 3, 4, 1]); // NDHWC -> NCDHW.\n }\n let yExpected: Tensor5D;\n if (poolMode === 'avg') {\n if (stride === 1) {\n yExpected = tensor5d(\n [[[\n [\n [11.5, 12.5, 13.5, 14], [15.5, 16.5, 17.5, 18],\n [18.25, 20.5, 21.5, 22], [19, 22.5, 23.5, 24]\n ], [\n [27.5, 28.5, 29.5, 30], [31.5, 32.5, 33.5, 34],\n [34.25, 36.5, 37.5, 38], [35, 38.5, 39.5, 40]\n ], [\n [43.5, 44.5, 45.5, 46], [47.5, 48.5, 49.5, 50],\n [51.5, 52.5, 53.5, 54], [53.5, 54.5, 55.5, 56]\n ], [\n [51.5, 52.5, 53.5, 54], [55.5, 56.5, 57.5, 58],\n [59.5, 60.5, 61.5, 62], [61.5, 62.5, 63.5, 64]]\n ]]],\n [1, 1, 4, 4, 4]);\n } else {\n yExpected = tensor5d([[[[[11.5, 13.5], [18.25, 21.5]],\n [[43.5, 45.5], [51.5, 53.5]]]]], [1, 1, 2, 2, 2]);\n }\n } else {\n if (stride === 1) {\n yExpected = tensor5d(\n [[[\n [\n [22, 23, 24, 24], [26, 27, 28, 28],\n [30, 31, 32, 32], [30, 31, 32, 32]\n ], [\n [38, 39, 40, 40], [42, 43, 44, 44],\n [46, 47, 48, 48], [46, 47, 48, 48]\n ], [\n [54, 55, 56, 56], [58, 59, 60, 60],\n [62, 63, 64, 64], [62, 63, 64, 64]\n ], [\n [54, 55, 56, 56], [58, 59, 60, 60],\n [62, 63, 64, 64], [62, 63, 64, 64]]\n ]]], [1, 1, 4, 4, 4]);\n } else if (stride === 2) {\n yExpected =\n tensor5d([[[[[22, 24], [30, 32]], [[54, 56], [62, 64]]]]],\n [1, 1, 2, 2, 2]);\n }\n }\n if (dataFormat !== 'channelsFirst') {\n yExpected = tfc.transpose(yExpected, [0, 2, 3, 4, 1]);\n }\n const y = pool3d(x, [2, 2, 2], [stride, stride, stride], 'same',\n dataFormat, poolMode);\n expectTensorsClose(y, yExpected as Tensor);\n });\n }\n }\n }\n\n for (const poolMode of poolModes) {\n it(`5x5x5, 2, same, CHANNEL_FIRST, ${poolMode}`, () => {\n const x5by5by5 = tensor5d(x5by5by5Data, [1, 1, 5, 5, 5]);\n let yExpected: Tensor5D;\n if (poolMode === 'avg') {\n yExpected = tensor5d([[[\n [[16.5, 18.5, 20], [26.5, 28.5, 30], [34, 36, 37.5]],\n [[66.5, 68.5, 70], [76.5, 78.5, 80], [84, 86, 87.5]],\n [[104, 106, 107.5], [114, 116, 117.5], [121.5, 123.5, 125]]\n ]]], [1, 1, 3, 3, 3]);\n } else {\n yExpected = tensor5d([[[\n [[32, 34, 35], [42, 44, 45], [47, 49, 50]],\n [[82, 84, 85], [92, 94, 95], [97, 99, 100]],\n [[107, 109, 110], [117, 119, 120], [122, 124, 125]]\n ]]], [1, 1, 3, 3, 3]);\n }\n const y = pool3d(x5by5by5, [2, 2, 2], [2, 2, 2], 'same', 'channelsFirst',\n poolMode);\n expectTensorsClose(y, yExpected as Tensor);\n });\n }\n\n for (const poolMode of poolModes) {\n it(`5x5x5, 2, valid, CHANNEL_LAST, ${poolMode}`, () => {\n const x5by5by5 = tfc.transpose(\n tensor5d(x5by5by5Data, [1, 1, 5, 5, 5]), [0, 2, 3, 4, 1]);\n let yExpected: Tensor5D;\n if (poolMode === 'avg') {\n yExpected = tensor5d(\n [[[[[16.5, 18.5], [26.5, 28.5]], [[66.5, 68.5], [76.5, 78.5]]]]],\n [1, 1, 2, 2, 2]);\n } else {\n yExpected = tensor5d(\n [[[[[32, 34], [42, 44]], [[82, 84], [92, 94]]]]],\n [1, 1, 2, 2, 2]);\n }\n const y = pool3d(x5by5by5, [2, 2, 2], [2, 2, 2], 'valid', 'channelsLast',\n poolMode);\n expectTensorsClose(y, tfc.transpose(yExpected, [0, 2, 3, 4, 1]));\n });\n }\n});\n\ndescribe('Pooling Layers 1D: Symbolic', () => {\n const poolSizes = [2, 3];\n const stridesList = [null, 1, 2];\n const poolModes: PoolMode[] = ['avg', 'max'];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n\n for (const poolMode of poolModes) {\n for (const paddingMode of paddingModes) {\n for (const poolSize of poolSizes) {\n for (const strides of stridesList) {\n const testTitle = `poolSize=${poolSize}, ` +\n `${paddingMode}, ${poolMode}`;\n it(testTitle, () => {\n const inputLength = 16;\n const inputNumChannels = 11;\n const inputBatchSize = 2;\n const inputShape = [inputBatchSize, inputLength, inputNumChannels];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling1d :\n tfl.layers.maxPooling1d;\n const poolingLayer = poolConstructor({\n poolSize,\n strides,\n padding: paddingMode,\n });\n const output = poolingLayer.apply(symbolicInput) as SymbolicTensor;\n const expectedOutputLength = convOutputLength(\n inputLength, poolSize, paddingMode,\n strides ? strides : poolSize);\n const expectedShape =\n [inputBatchSize, expectedOutputLength, inputNumChannels];\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n});\n\ndescribeMathCPUAndGPU('Pooling Layers 1D: Tensor', () => {\n const poolModes = ['avg', 'max'];\n const strides = [2, 4];\n const poolSizes = [2, 4];\n const batchSize = 2;\n for (const poolMode of poolModes) {\n for (const stride of strides) {\n for (const poolSize of poolSizes) {\n const testTitle = `stride=${stride}, ${poolMode}, ` +\n `poolSize=${poolSize}`;\n it(testTitle, () => {\n const x2by8 = tensor2d([\n [10, 30, 50, 70, 20, 40, 60, 80],\n [-10, -30, -50, -70, -20, -40, -60, -80]\n ]);\n const x2by8by1 = tfc.expandDims(x2by8, 2);\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling1d :\n tfl.layers.maxPooling1d;\n const poolingLayer = poolConstructor({\n poolSize,\n strides: stride,\n padding: 'valid',\n });\n const output = poolingLayer.apply(x2by8by1) as Tensor;\n let outputLength: number;\n let expectedOutputVals: number[][][];\n if (poolSize === 2) {\n if (stride === 2) {\n outputLength = 4;\n if (poolMode === 'avg') {\n expectedOutputVals =\n [[[20], [60], [30], [70]], [[-20], [-60], [-30], [-70]]];\n } else {\n expectedOutputVals =\n [[[30], [70], [40], [80]], [[-10], [-50], [-20], [-60]]];\n }\n } else if (stride === 4) {\n outputLength = 2;\n if (poolMode === 'avg') {\n expectedOutputVals = [[[20], [30]], [[-20], [-30]]];\n } else {\n expectedOutputVals = [[[30], [40]], [[-10], [-20]]];\n }\n }\n } else if (poolSize === 4) {\n if (stride === 2) {\n outputLength = 3;\n if (poolMode === 'avg') {\n expectedOutputVals =\n [[[40], [45], [50]], [[-40], [-45], [-50]]];\n } else {\n expectedOutputVals =\n [[[70], [70], [80]], [[-10], [-20], [-20]]];\n }\n } else if (stride === 4) {\n outputLength = 2;\n if (poolMode === 'avg') {\n expectedOutputVals = [[[40], [50]], [[-40], [-50]]];\n } else {\n expectedOutputVals = [[[70], [80]], [[-10], [-20]]];\n }\n }\n }\n const expectedShape: [number, number, number] =\n [batchSize, outputLength, 1];\n expectTensorsClose(\n output, tensor3d(expectedOutputVals, expectedShape));\n });\n }\n }\n }\n\n it('Handles poolSize and strides passed as number arrays', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.maxPool1d(\n {poolSize: [2], strides: [2], inputShape: [4, 3]}));\n const xs = tfc.ones([1, 4, 3]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, [1, 1, 1, 1, 1, 1]);\n expect(ys.shape).toEqual([1, 2, 3]);\n\n const config = model.layers[0].getConfig();\n expect(config['poolSize']).toEqual([2]);\n expect(config['strides']).toEqual([2]);\n });\n});\n\ndescribe('Pooling Layers 2D: Symbolic', () => {\n const poolSizes = [2, 3];\n const poolModes = ['avg', 'max'];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const poolSizeIsNumberValues = [false, true];\n\n for (const poolMode of poolModes) {\n for (const paddingMode of paddingModes) {\n for (const dataFormat of dataFormats) {\n for (const poolSize of poolSizes) {\n for (const poolSizeIsNumber of poolSizeIsNumberValues) {\n const testTitle = `poolSize=${poolSize}, ` +\n `${dataFormat}, ${paddingMode}, ` +\n `${poolMode}, ` +\n `poollSizeIsNumber=${poolSizeIsNumber}`;\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, 11, 9] :\n [2, 11, 9, 16];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling2d :\n tfl.layers.maxPooling2d;\n const poolingLayer = poolConstructor({\n poolSize: poolSizeIsNumber ? poolSize : [poolSize, poolSize],\n padding: paddingMode,\n dataFormat,\n });\n\n const output =\n poolingLayer.apply(symbolicInput) as SymbolicTensor;\n\n let outputRows = poolSize === 2 ? 5 : 3;\n if (paddingMode === 'same') {\n outputRows++;\n }\n let outputCols = poolSize === 2 ? 4 : 3;\n if (paddingMode === 'same' && poolSize === 2) {\n outputCols++;\n }\n\n let expectedShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape = [2, 16, outputRows, outputCols];\n } else {\n expectedShape = [2, outputRows, outputCols, 16];\n }\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n }\n\n const stridesValues: Array = [1, [1, 1], [2, 1]];\n for (const strides of stridesValues) {\n it(`custom strides: ${strides}`, () => {\n const inputShape = [2, 16, 11, 3];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n const poolingLayer = tfl.layers.maxPooling2d({poolSize: [2, 2], strides});\n const output = poolingLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n if (Array.isArray(strides) && util.arraysEqual(strides, [1, 1])) {\n expect(output.shape).toEqual([2, 15, 10, 3]);\n } else if (Array.isArray(strides) && util.arraysEqual(strides, [2, 1])) {\n expect(output.shape).toEqual([2, 8, 10, 3]);\n } else {\n // strides = 1\n expect(output.shape).toEqual([2, 15, 10, 3]);\n }\n });\n }\n\n it('Incorrect strides array length leads to error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.maxPooling2d({poolSize: 2, strides: [2]} as any))\n .toThrowError(/expected to have a length of 2/);\n expect(\n // tslint:disable-next-line:no-any\n () => tfl.layers.maxPooling2d({poolSize: 2, strides: [2, 3, 3]} as any))\n .toThrowError(/expected to have a length of 2/);\n });\n\n it('Invalid poolSize', () => {\n expect(() => tfl.layers.maxPooling2d({poolSize: 2.5, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.maxPooling2d({poolSize: 0, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*0\\.$/);\n expect(() => tfl.layers.maxPooling2d({poolSize: -2, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*-2\\.$/);\n });\n\n it('Invalid strides leads to Error', () => {\n expect(() => tfl.layers.maxPooling2d({poolSize: 3, strides: 2.5}))\n .toThrowError(/strides.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.maxPooling2d({poolSize: 3, strides: 0}))\n .toThrowError(/strides.*positive integer.*0\\.$/);\n expect(() => tfl.layers.maxPooling2d({poolSize: 3, strides: -2}))\n .toThrowError(/strides.*positive integer.*-2\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('Pooling Layers 2D: Tensor', () => {\n const x4by4Data =\n [10, 30, 50, 70, 20, 40, 60, 80, -10, -30, -50, -70, -20, -40, -60, -80];\n\n const poolModes: PoolMode[] = ['avg', 'max'];\n const strides = [1, 2];\n const batchSizes = [2, 4];\n const channelsArray = [1, 3];\n for (const poolMode of poolModes) {\n for (const stride of strides) {\n for (const batchSize of batchSizes) {\n for (const channels of channelsArray) {\n const testTitle = `stride=${stride}, ${poolMode}, ` +\n `batchSize=${batchSize}, channels=${channels}`;\n it(testTitle, () => {\n let xArrayData: number[] = [];\n for (let b = 0; b < batchSize; ++b) {\n for (let c = 0; c < channels; ++c) {\n xArrayData = xArrayData.concat(x4by4Data);\n }\n }\n const x4by4 = tensor4d(xArrayData, [batchSize, channels, 4, 4]);\n\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling2d :\n tfl.layers.maxPooling2d;\n const poolingLayer = poolConstructor({\n poolSize: [2, 2],\n strides: [stride, stride],\n padding: 'valid',\n dataFormat: 'channelsFirst',\n });\n\n const output = poolingLayer.apply(x4by4) as Tensor;\n\n let expectedShape: [number, number, number, number];\n let expectedOutputSlice: number[];\n if (poolMode === 'avg') {\n if (stride === 1) {\n expectedShape = [batchSize, channels, 3, 3];\n expectedOutputSlice = [25, 45, 65, 5, 5, 5, -25, -45, -65];\n } else if (stride === 2) {\n expectedShape = [batchSize, channels, 2, 2];\n expectedOutputSlice = [25, 65, -25, -65];\n }\n } else {\n if (stride === 1) {\n expectedShape = [batchSize, channels, 3, 3];\n expectedOutputSlice = [40, 60, 80, 40, 60, 80, -10, -30, -50];\n } else if (stride === 2) {\n expectedShape = [batchSize, channels, 2, 2];\n expectedOutputSlice = [40, 80, -10, -50];\n }\n }\n let expectedOutputArray: number[] = [];\n for (let b = 0; b < batchSize; ++b) {\n for (let c = 0; c < channels; ++c) {\n expectedOutputArray =\n expectedOutputArray.concat(expectedOutputSlice);\n }\n }\n expectTensorsClose(\n output, tensor4d(expectedOutputArray, expectedShape));\n });\n }\n }\n }\n }\n\n it('Handles strides passed as number arrays', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.maxPooling2d(\n {poolSize: 2, strides: [2, 2], inputShape: [4, 4, 3]}));\n const xs = tfc.ones([1, 4, 4, 3]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, tfc.ones([1, 2, 2, 3]));\n expect(ys.shape).toEqual([1, 2, 2, 3]);\n const config = model.layers[0].getConfig();\n expect(config['poolSize']).toEqual([2, 2]);\n expect(config['strides']).toEqual([2, 2]);\n });\n});\n\ndescribe('Pooling Layers 3D: Symbolic', () => {\n const poolSizes = [2, 3];\n const poolModes = ['avg', 'max'];\n const paddingModes: PaddingMode[] = [undefined, 'valid', 'same'];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const poolSizeIsNumberValues = [false, true];\n\n for (const poolMode of poolModes) {\n for (const paddingMode of paddingModes) {\n for (const dataFormat of dataFormats) {\n for (const poolSize of poolSizes) {\n for (const poolSizeIsNumber of poolSizeIsNumberValues) {\n const testTitle = `poolSize=${poolSize}, ` +\n `${dataFormat}, ${paddingMode}, ` +\n `${poolMode}, ` +\n `poollSizeIsNumber=${poolSizeIsNumber}`;\n it(testTitle, () => {\n const inputShape = dataFormat === 'channelsFirst' ?\n [2, 16, 11, 9, 7] :\n [2, 11, 9, 7, 16];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling3d :\n tfl.layers.maxPooling3d;\n const poolingLayer = poolConstructor({\n poolSize: poolSizeIsNumber ? poolSize :\n [poolSize, poolSize, poolSize],\n padding: paddingMode,\n dataFormat,\n });\n\n const output =\n poolingLayer.apply(symbolicInput) as SymbolicTensor;\n\n let outputDepths = poolSize === 2 ? 5: 3;\n if (paddingMode === 'same') {\n outputDepths++;\n }\n\n let outputRows = poolSize === 2 ? 4 : 3;\n if (paddingMode === 'same' && poolSize === 2) {\n outputRows++;\n }\n let outputCols = poolSize === 2 ? 3 : 2;\n if (paddingMode === 'same') {\n outputCols++;\n }\n\n let expectedShape: [number, number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n expectedShape = [2, 16, outputDepths, outputRows, outputCols];\n } else {\n expectedShape = [2, outputDepths, outputRows, outputCols, 16];\n }\n\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n }\n }\n }\n\n const stridesValues: Array =\n [1, [1, 1, 1], [2, 1, 2]];\n for (const strides of stridesValues) {\n it(`custom strides: ${strides}`, () => {\n const inputShape = [2, 16, 11, 15, 3];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n const poolingLayer =\n tfl.layers.maxPooling3d({poolSize: [2, 2, 2], strides});\n const output = poolingLayer.apply(symbolicInput) as tfl.SymbolicTensor;\n if (Array.isArray(strides) && util.arraysEqual(strides, [1, 1, 1])) {\n expect(output.shape).toEqual([2, 15, 10, 14, 3]);\n } else if (Array.isArray(strides) &&\n util.arraysEqual(strides, [2, 1, 2])) {\n expect(output.shape).toEqual([2, 8, 10, 7, 3]);\n } else {\n // strides = 1\n expect(output.shape).toEqual([2, 15, 10, 14, 3]);\n }\n });\n }\n\n it('Incorrect strides array length leads to error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.layers.maxPooling3d({poolSize: 2, strides: [2]} as any))\n .toThrowError(/expected to have a length of 3/);\n expect(\n // tslint:disable-next-line:no-any\n () => tfl.layers.maxPooling3d({poolSize: 2, strides: [2, 3]} as any))\n .toThrowError(/expected to have a length of 3/);\n expect(() => tfl.layers.averagePooling3d(\n // tslint:disable-next-line:no-any\n {poolSize: 2, strides: [2]} as any))\n .toThrowError(/expected to have a length of 3/);\n expect(() => tfl.layers.averagePooling3d(\n // tslint:disable-next-line:no-any\n {poolSize: 2, strides: [2, 3]} as any))\n .toThrowError(/expected to have a length of 3/);\n });\n\n it('Invalid poolSize', () => {\n expect(() => tfl.layers.maxPooling3d({poolSize: 2.5, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.maxPooling3d({poolSize: 0, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*0\\.$/);\n expect(() => tfl.layers.maxPooling3d({poolSize: -2, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*-2\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: 2.5, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: 0, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*0\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: -2, strides: 2}))\n .toThrowError(/poolSize.*positive integer.*-2\\.$/);\n });\n\n it('Invalid strides leads to Error', () => {\n expect(() => tfl.layers.maxPooling3d({poolSize: 3, strides: 2.5}))\n .toThrowError(/strides.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.maxPooling3d({poolSize: 3, strides: 0}))\n .toThrowError(/strides.*positive integer.*0\\.$/);\n expect(() => tfl.layers.maxPooling3d({poolSize: 3, strides: -2}))\n .toThrowError(/strides.*positive integer.*-2\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: 3, strides: 2.5}))\n .toThrowError(/strides.*positive integer.*2\\.5\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: 3, strides: 0}))\n .toThrowError(/strides.*positive integer.*0\\.$/);\n expect(() => tfl.layers.averagePooling3d({poolSize: 3, strides: -2}))\n .toThrowError(/strides.*positive integer.*-2\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('Pooling Layers 3D: Tensor', () => {\n const x4by4by4Data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,\n 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];\n\n const poolModes: PoolMode[] = ['avg', 'max'];\n const strides = [1, 2];\n const batchSizes = [2, 4];\n const channelsArray = [1, 3];\n for (const poolMode of poolModes) {\n for (const stride of strides) {\n for (const batchSize of batchSizes) {\n for (const channels of channelsArray) {\n const testTitle = `stride=${stride}, ${poolMode}, ` +\n `batchSize=${batchSize}, channels=${channels}`;\n it(testTitle, () => {\n let xArrayData: number[] = [];\n for (let b = 0; b < batchSize; ++b) {\n for (let c = 0; c < channels; ++c) {\n xArrayData = xArrayData.concat(x4by4by4Data);\n }\n }\n const x4by4by4 =\n tensor5d(xArrayData, [batchSize, channels, 4, 4, 4]);\n\n const poolConstructor = poolMode === 'avg' ?\n tfl.layers.averagePooling3d :\n tfl.layers.maxPooling3d;\n const poolingLayer = poolConstructor({\n poolSize: [2, 2, 2],\n strides: [stride, stride, stride],\n padding: 'valid',\n dataFormat: 'channelsFirst',\n });\n\n const output = poolingLayer.apply(x4by4by4 as Tensor) as Tensor;\n\n let expectedShape: [number, number, number, number, number];\n let expectedOutputSlice: number[];\n if (poolMode === 'avg') {\n if (stride === 1) {\n expectedShape = [batchSize, channels, 3, 3, 3];\n expectedOutputSlice = [11.5, 12.5, 13.5, 15.5, 16.5, 17.5,\n 19.5, 20.5, 21.5, 27.5, 28.5, 29.5, 31.5, 32.5, 33.5, 35.5,\n 36.5, 37.5, 43.5, 44.5, 45.5, 47.5, 48.5, 49.5, 51.5, 52.5,\n 53.5];\n } else if (stride === 2) {\n expectedShape = [batchSize, channels, 2, 2, 2];\n expectedOutputSlice =\n [11.5, 13.5, 19.5, 21.5, 43.5, 45.5, 51.5, 53.5];\n }\n } else {\n if (stride === 1) {\n expectedShape = [batchSize, channels, 3, 3, 3];\n expectedOutputSlice = [22, 23, 24, 26, 27, 28, 30, 31, 32, 38,\n 39, 40, 42, 43, 44, 46, 47, 48, 54, 55, 56, 58, 59, 60, 62,\n 63, 64];\n } else if (stride === 2) {\n expectedShape = [batchSize, channels, 2, 2, 2];\n expectedOutputSlice = [22, 24, 30, 32, 54, 56, 62, 64];\n }\n }\n let expectedOutputArray: number[] = [];\n for (let b = 0; b < batchSize; ++b) {\n for (let c = 0; c < channels; ++c) {\n expectedOutputArray =\n expectedOutputArray.concat(expectedOutputSlice);\n }\n }\n expectTensorsClose(output,\n tensor5d(expectedOutputArray, expectedShape) as Tensor);\n });\n }\n }\n }\n }\n});\n\ndescribe('1D Global pooling Layers: Symbolic', () => {\n const globalPoolingLayers =\n [tfl.layers.globalAveragePooling1d, tfl.layers.globalMaxPooling1d];\n\n for (const globalPoolingLayer of globalPoolingLayers) {\n for (const hasArgs of [true, false]) {\n const testTitle = `layer=${globalPoolingLayer.name}; hasArgs=${hasArgs}`;\n it(testTitle, () => {\n const inputShape = [2, 11, 9];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n\n const layer = globalPoolingLayer(hasArgs ? {} : undefined);\n const output = layer.apply(symbolicInput) as SymbolicTensor;\n\n const expectedShape = [2, 9];\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n\n it('Invalid poolSize', () => {\n expect(() => tfl.layers.avgPooling1d({\n poolSize: 2.5\n })).toThrowError(/poolSize.*positive integer.*2\\.5/);\n expect(() => tfl.layers.avgPooling1d({\n poolSize: 0\n })).toThrowError(/poolSize.*positive integer.*0\\.$/);\n expect(() => tfl.layers.avgPooling1d({\n poolSize: -3\n })).toThrowError(/poolSize.*positive integer.*-3\\.$/);\n });\n\n it('Invalid strides leads to Error', () => {\n expect(() => tfl.layers.avgPooling1d({poolSize: 3, strides: 4.5}))\n .toThrowError(/strides.*positive integer.*4\\.5\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('1D Global Pooling Layers: Tensor', () => {\n const x3DimData = [\n [[4, -1], [0, -2], [40, -10], [0, -20]],\n [[-4, 1], [0, 2], [-40, 10], [0, 20]]\n ];\n const globalPoolingLayers =\n [tfl.layers.globalAveragePooling1d, tfl.layers.globalMaxPooling1d];\n for (const globalPoolingLayer of globalPoolingLayers) {\n const testTitle = `globalPoolingLayer=${globalPoolingLayer.name}`;\n it(testTitle, () => {\n const x = tensor3d(x3DimData, [2, 4, 2]);\n const layer = globalPoolingLayer({});\n const output = layer.apply(x) as Tensor;\n\n let expectedOutput: Tensor2D;\n if (globalPoolingLayer === tfl.layers.globalAveragePooling1d) {\n expectedOutput = tensor2d([[11, -8.25], [-11, 8.25]], [2, 2]);\n } else {\n expectedOutput = tensor2d([[40, -1], [0, 20]], [2, 2]);\n }\n expectTensorsClose(output, expectedOutput);\n });\n }\n});\n\ndescribe('2D Global pooling Layers: Symbolic', () => {\n const globalPoolingLayers =\n [tfl.layers.globalAveragePooling2d, tfl.layers.globalMaxPooling2d];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n\n for (const globalPoolingLayer of globalPoolingLayers) {\n for (const dataFormat of dataFormats) {\n const testTitle = `layer=${globalPoolingLayer.name}, ${dataFormat}`;\n it(testTitle, () => {\n const inputShape = [2, 16, 11, 9];\n const symbolicInput =\n new SymbolicTensor('float32', inputShape, null, [], null);\n\n const layer = globalPoolingLayer({dataFormat});\n const output = layer.apply(symbolicInput) as SymbolicTensor;\n\n const expectedShape = dataFormat === 'channelsLast' ? [2, 9] : [2, 16];\n expect(output.shape).toEqual(expectedShape);\n expect(output.dtype).toEqual(symbolicInput.dtype);\n });\n }\n }\n});\n\ndescribeMathCPUAndGPU('2D Global Pooling Layers: Tensor', () => {\n const x4DimData = [\n [[[4, -1], [0, -2]], [[40, -10], [0, -20]]],\n [[[4, -1], [0, -2]], [[40, -10], [0, -20]]]\n ];\n const dataFormats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n\n const globalPoolingLayers =\n [tfl.layers.globalAveragePooling2d, tfl.layers.globalMaxPooling2d];\n for (const globalPoolingLayer of globalPoolingLayers) {\n for (const dataFormat of dataFormats) {\n const testTitle =\n `globalPoolingLayer=${globalPoolingLayer.name}, ${dataFormat}`;\n it(testTitle, () => {\n const x = tensor4d(x4DimData, [2, 2, 2, 2]);\n const layer = globalPoolingLayer({dataFormat});\n const output = layer.apply(x) as Tensor;\n\n let expectedOutput: Tensor2D;\n if (globalPoolingLayer === tfl.layers.globalAveragePooling2d) {\n if (dataFormat === 'channelsFirst') {\n expectedOutput = tensor2d([[0.25, 2.5], [0.25, 2.5]], [2, 2]);\n } else {\n expectedOutput = tensor2d([[11, -8.25], [11, -8.25]], [2, 2]);\n }\n } else {\n if (dataFormat === 'channelsFirst') {\n expectedOutput = tensor2d([[4, 40], [4, 40]], [2, 2]);\n } else {\n expectedOutput = tensor2d([[40, -1], [40, -1]], [2, 2]);\n }\n }\n expectTensorsClose(output, expectedOutput);\n const config = layer.getConfig();\n expect(config.dataFormat).toEqual(dataFormat);\n });\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-layers/dist/layers/recurrent.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts deleted file mode 100644 index 066fb329c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts +++ /dev/null @@ -1,666 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Recurrent Neural Network Layers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Activation } from '../activations'; -import { Constraint, ConstraintIdentifier } from '../constraints'; -import { InputSpec, SymbolicTensor } from '../engine/topology'; -import { Layer, LayerArgs } from '../engine/topology'; -import { Initializer, InitializerIdentifier } from '../initializers'; -import { ActivationIdentifier } from '../keras_format/activation_config'; -import { Shape } from '../keras_format/common'; -import { Regularizer, RegularizerIdentifier } from '../regularizers'; -import { Kwargs, RnnStepFunction } from '../types'; -import { LayerVariable } from '../variables'; -/** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ -export declare function standardizeArgs(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], initialState: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], constants: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], numConstants?: number): { - inputs: Tensor | SymbolicTensor; - initialState: Tensor[] | SymbolicTensor[]; - constants: Tensor[] | SymbolicTensor[]; -}; -/** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ -export declare function rnn(stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[], goBackwards?: boolean, mask?: Tensor, constants?: Tensor[], unroll?: boolean, needPerStepOutputs?: boolean): [Tensor, Tensor, Tensor[]]; -export declare interface BaseRNNLayerArgs extends LayerArgs { - /** - * A RNN cell instance. A RNN cell is a class that has: - * - a `call()` method, which takes `[Tensor, Tensor]` as the - * first input argument. The first item is the input at time t, and - * second item is the cell state at time t. - * The `call()` method returns `[outputAtT, statesAtTPlus1]`. - * The `call()` method of the cell can also take the argument `constants`, - * see section "Note on passing external constants" below. - * Porting Node: PyKeras overrides the `call()` signature of RNN cells, - * which are Layer subtypes, to accept two arguments. tfjs-layers does - * not do such overriding. Instead we preseve the `call()` signature, - * which due to its `Tensor|Tensor[]` argument and return value, is - * flexible enough to handle the inputs and states. - * - a `stateSize` attribute. This can be a single integer (single state) - * in which case it is the size of the recurrent state (which should be - * the same as the size of the cell output). This can also be an Array of - * integers (one size per state). In this case, the first entry - * (`stateSize[0]`) should be the same as the size of the cell output. - * It is also possible for `cell` to be a list of RNN cell instances, in which - * case the cells get stacked on after the other in the RNN, implementing an - * efficient stacked RNN. - */ - cell?: RNNCell | RNNCell[]; - /** - * Whether to return the last output in the output sequence, or the full - * sequence. - */ - returnSequences?: boolean; - /** - * Whether to return the last state in addition to the output. - */ - returnState?: boolean; - /** - * If `true`, process the input sequence backwards and return the reversed - * sequence (default: `false`). - */ - goBackwards?: boolean; - /** - * If `true`, the last state for each sample at index i in a batch will be - * used as initial state of the sample of index i in the following batch - * (default: `false`). - * - * You can set RNN layers to be "stateful", which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable "statefulness": - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * - if sequential model: - * `batchInputShape: [...]` to the first layer in your model. - * - else for functional model with 1 or more Input layers: - * `batchShape: [...]` to all the first layers in your model. - * This is the expected shape of your inputs - * *including the batch size*. - * It should be a tuple of integers, e.g., `[32, 10, 100]`. - * - specify `shuffle: false` when calling `LayersModel.fit()`. - * - * To reset the state of your model, call `resetStates()` on either the - * specific layer or on the entire model. - */ - stateful?: boolean; - /** - * If `true`, the network will be unrolled, else a symbolic loop will be - * used. Unrolling can speed-up a RNN, although it tends to be more memory- - * intensive. Unrolling is only suitable for short sequences (default: - * `false`). - * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with - * normal TypeScript control flow. Hence this property is inapplicable and - * ignored in tfjs-layers. - */ - unroll?: boolean; - /** - * Dimensionality of the input (integer). - * This option (or alternatively, the option `inputShape`) is required when - * this layer is used as the first layer in a model. - */ - inputDim?: number; - /** - * Length of the input sequences, to be specified when it is constant. - * This argument is required if you are going to connect `Flatten` then - * `Dense` layers upstream (without it, the shape of the dense outputs cannot - * be computed). Note that if the recurrent layer is not the first layer in - * your model, you would need to specify the input length at the level of the - * first layer (e.g., via the `inputShape` option). - */ - inputLength?: number; -} -export declare class RNN extends Layer { - /** @nocollapse */ - static className: string; - readonly cell: RNNCell; - readonly returnSequences: boolean; - readonly returnState: boolean; - readonly goBackwards: boolean; - readonly unroll: boolean; - stateSpec: InputSpec[]; - protected states_: Tensor[]; - protected keptStates: Tensor[][]; - private numConstants; - constructor(args: RNNLayerArgs); - getStates(): Tensor[]; - setStates(states: Tensor[]): void; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - states: Tensor[]; - build(inputShape: Shape | Shape[]): void; - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - resetStates(states?: Tensor | Tensor[], training?: boolean): void; - apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getInitialState(inputs: Tensor): Tensor[]; - readonly trainableWeights: LayerVariable[]; - readonly nonTrainableWeights: LayerVariable[]; - setFastWeightInitDuringBuild(value: boolean): void; - getConfig(): serialization.ConfigDict; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): T; -} -/** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ -export declare abstract class RNNCell extends Layer { - /** - * Size(s) of the states. - * For RNN cells with only a single state, this is a single integer. - */ - abstract stateSize: number | number[]; - dropoutMask: Tensor | Tensor[]; - recurrentDropoutMask: Tensor | Tensor[]; -} -export declare interface SimpleRNNCellLayerArgs extends LayerArgs { - /** - * units: Positive integer, dimensionality of the output space. - */ - units: number; - /** - * Activation function to use. - * Default: hyperbolic tangent ('tanh'). - * If you pass `null`, 'linear' activation will be applied. - */ - activation?: ActivationIdentifier; - /** - * Whether the layer uses a bias vector. - */ - useBias?: boolean; - /** - * Initializer for the `kernel` weights matrix, used for the linear - * transformation of the inputs. - */ - kernelInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the `recurrentKernel` weights matrix, used for - * linear transformation of the recurrent state. - */ - recurrentInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier | Initializer; - /** - * Regularizer function applied to the `kernel` weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the `recurrent_kernel` weights matrix. - */ - recurrentRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Constraint function applied to the `kernel` weights matrix. - */ - kernelConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint function applied to the `recurrentKernel` weights matrix. - */ - recurrentConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraintfunction applied to the bias vector. - */ - biasConstraint?: ConstraintIdentifier | Constraint; - /** - * Float number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the inputs. - */ - dropout?: number; - /** - * Float number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the recurrent state. - */ - recurrentDropout?: number; -} -export declare class SimpleRNNCell extends RNNCell { - /** @nocollapse */ - static className: string; - readonly units: number; - readonly activation: Activation; - readonly useBias: boolean; - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - readonly dropout: number; - readonly recurrentDropout: number; - readonly stateSize: number; - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - readonly DEFAULT_ACTIVATION = "tanh"; - readonly DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; - readonly DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; - constructor(args: SimpleRNNCellLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs { - /** - * Positive integer, dimensionality of the output space. - */ - units: number; - /** - * Activation function to use. - * - * Defaults to hyperbolic tangent (`tanh`) - * - * If you pass `null`, no activation will be applied. - */ - activation?: ActivationIdentifier; - /** - * Whether the layer uses a bias vector. - */ - useBias?: boolean; - /** - * Initializer for the `kernel` weights matrix, used for the linear - * transformation of the inputs. - */ - kernelInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the `recurrentKernel` weights matrix, used for - * linear transformation of the recurrent state. - */ - recurrentInitializer?: InitializerIdentifier | Initializer; - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier | Initializer; - /** - * Regularizer function applied to the kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the recurrentKernel weights matrix. - */ - recurrentRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier | Regularizer; - /** - * Constraint function applied to the kernel weights matrix. - */ - kernelConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint function applied to the recurrentKernel weights matrix. - */ - recurrentConstraint?: ConstraintIdentifier | Constraint; - /** - * Constraint function applied to the bias vector. - */ - biasConstraint?: ConstraintIdentifier | Constraint; - /** - * Number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the inputs. - */ - dropout?: number; - /** - * Number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the recurrent state. - */ - recurrentDropout?: number; -} -/** - * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the - * `cell` property required. This interface is to be used with constructors - * of concrete RNN layer subtypes. - */ -export declare interface RNNLayerArgs extends BaseRNNLayerArgs { - cell: RNNCell | RNNCell[]; -} -export declare class SimpleRNN extends RNN { - /** @nocollapse */ - static className: string; - constructor(args: SimpleRNNLayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; -} -export declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; - /** - * GRU convention (whether to apply reset gate after or before matrix - * multiplication). false = "before", true = "after" (only false is - * supported). - */ - resetAfter?: boolean; -} -export declare class GRUCell extends RNNCell { - /** @nocollapse */ - static className: string; - readonly units: number; - readonly activation: Activation; - readonly recurrentActivation: Activation; - readonly useBias: boolean; - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - readonly dropout: number; - readonly recurrentDropout: number; - readonly stateSize: number; - readonly implementation: number; - readonly DEFAULT_ACTIVATION = "tanh"; - readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier; - readonly DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; - readonly DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - constructor(args: GRUCellLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface GRULayerArgs extends SimpleRNNLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; -} -export declare class GRU extends RNN { - /** @nocollapse */ - static className: string; - constructor(args: GRULayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; -} -export declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - /** - * If `true`, add 1 to the bias of the forget gate at initialization. - * Setting it to `true` will also force `biasInitializer = 'zeros'`. - * This is recommended in - * [Jozefowicz et - * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf). - */ - unitForgetBias?: boolean; - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; -} -export declare class LSTMCell extends RNNCell { - /** @nocollapse */ - static className: string; - readonly units: number; - readonly activation: Activation; - readonly recurrentActivation: Activation; - readonly useBias: boolean; - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - readonly unitForgetBias: boolean; - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - readonly dropout: number; - readonly recurrentDropout: number; - readonly stateSize: number[]; - readonly implementation: number; - readonly DEFAULT_ACTIVATION = "tanh"; - readonly DEFAULT_RECURRENT_ACTIVATION = "hardSigmoid"; - readonly DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; - readonly DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; - readonly DEFAULT_BIAS_INITIALIZER = "zeros"; - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - constructor(args: LSTMCellLayerArgs); - build(inputShape: Shape | Shape[]): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - getConfig(): serialization.ConfigDict; -} -export declare interface LSTMLayerArgs extends SimpleRNNLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - /** - * If `true`, add 1 to the bias of the forget gate at initialization. - * Setting it to `true` will also force `biasInitializer = 'zeros'`. - * This is recommended in - * [Jozefowicz et - * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf). - */ - unitForgetBias?: boolean; - /** - * Implementation mode, either 1 or 2. - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions, whereas mode 2 will - * batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this config field. - */ - implementation?: number; -} -export declare class LSTM extends RNN { - /** @nocollapse */ - static className: string; - constructor(args: LSTMLayerArgs); - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; -} -export declare interface StackedRNNCellsArgs extends LayerArgs { - /** - * A `Array` of `RNNCell` instances. - */ - cells: RNNCell[]; -} -export declare class StackedRNNCells extends RNNCell { - /** @nocollapse */ - static className: string; - protected cells: RNNCell[]; - constructor(args: StackedRNNCellsArgs); - readonly stateSize: number[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - build(inputShape: Shape | Shape[]): void; - getConfig(): serialization.ConfigDict; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): T; - readonly trainableWeights: LayerVariable[]; - readonly nonTrainableWeights: LayerVariable[]; - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - getWeights(): Tensor[]; - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - setWeights(weights: Tensor[]): void; -} -export declare function generateDropoutMask(args: { - ones: () => tfc.Tensor; - rate: number; - training?: boolean; - count?: number; -}): tfc.Tensor | tfc.Tensor[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js deleted file mode 100644 index 56ec2b63d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js +++ /dev/null @@ -1,1337 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * TensorFlow.js Layers: Recurrent Neural Network Layers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy, util } from '@tensorflow/tfjs-core'; -import { getActivation, serializeActivation } from '../activations'; -import * as K from '../backend/tfjs_backend'; -import { nameScope } from '../common'; -import { getConstraint, serializeConstraint } from '../constraints'; -import { InputSpec, SymbolicTensor } from '../engine/topology'; -import { Layer } from '../engine/topology'; -import { AttributeError, NotImplementedError, ValueError } from '../errors'; -import { getInitializer, Initializer, Ones, serializeInitializer } from '../initializers'; -import { getRegularizer, serializeRegularizer } from '../regularizers'; -import { assertPositiveInteger } from '../utils/generic_utils'; -import * as math_utils from '../utils/math_utils'; -import { getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes } from '../utils/types_utils'; -import { batchGetValue, batchSetValue } from '../variables'; -import { deserialize } from './serialization'; -/** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ -export function standardizeArgs(inputs, initialState, constants, numConstants) { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError('When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - function toListOrNull(x) { - if (x == null || Array.isArray(x)) { - return x; - } - else { - return [x]; - } - } - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - return { inputs, initialState, constants }; -} -/** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ -export function rnn(stepFunction, inputs, initialStates, goBackwards = false, mask, constants, unroll = false, needPerStepOutputs = false) { - return tfc.tidy(() => { - const ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`); - } - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - const axes = [1, 0].concat(math_utils.range(2, ndim)); - inputs = tfc.transpose(inputs, axes); - if (constants != null) { - throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = tfc.expandDims(mask, -1); - } - mask = tfc.transpose(mask, axes); - } - if (goBackwards) { - inputs = tfc.reverse(inputs, 0); - if (mask != null) { - mask = tfc.reverse(mask, 0); - } - } - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - const perStepOutputs = []; - let lastOutput; - let states = initialStates; - const timeSteps = inputs.shape[0]; - const perStepInputs = tfc.unstack(inputs); - let perStepMasks; - if (mask != null) { - perStepMasks = tfc.unstack(mask); - } - for (let t = 0; t < timeSteps; ++t) { - const currentInput = perStepInputs[t]; - const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states)); - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } - else { - const maskedOutputs = tfc.tidy(() => { - const stepMask = perStepMasks[t]; - const negStepMask = tfc.onesLike(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - const output = stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - const newStates = states.map((state, i) => { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return { output, newStates }; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - } - let outputs; - if (needPerStepOutputs) { - const axis = 1; - outputs = tfc.stack(perStepOutputs, axis); - } - return [lastOutput, outputs, states]; - }); -} -export class RNN extends Layer { - constructor(args) { - super(args); - let cell; - if (args.cell == null) { - throw new ValueError('cell property is missing for the constructor of RNN.'); - } - else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({ cells: args.cell }); - } - else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - this.cell = cell; - this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - this.returnState = args.returnState == null ? false : args.returnState; - this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - this._stateful = args.stateful == null ? false : args.stateful; - this.unroll = args.unroll == null ? false : args.unroll; - this.supportsMasking = true; - this.inputSpec = [new InputSpec({ ndim: 3 })]; - this.stateSpec = null; - this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - this.keptStates = []; - } - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - getStates() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return math_utils.range(0, numStates).map(x => null); - } - else { - return this.states_; - } - } - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - setStates(states) { - this.states_ = states; - } - computeOutputShape(inputShape) { - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - // TODO(cais): Remove the casting once stacked RNN cells become supported. - let stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - const outputDim = stateSize[0]; - let outputShape; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } - else { - outputShape = [inputShape[0], outputDim]; - } - if (this.returnState) { - const stateShape = []; - for (const dim of stateSize) { - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } - else { - return outputShape; - } - } - computeMask(inputs, mask) { - return tfc.tidy(() => { - if (Array.isArray(mask)) { - mask = mask[0]; - } - const outputMask = this.returnSequences ? mask : null; - if (this.returnState) { - const stateMask = this.states.map(s => null); - return [outputMask].concat(stateMask); - } - else { - return outputMask; - } - }); - } - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get states() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - const output = []; - for (let i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } - else { - return this.states_; - } - } - set states(s) { - this.states_ = s; - } - build(inputShape) { - // Note inputShape will be an Array of Shapes of initial states and - // constants if these are passed in apply(). - const constantShape = null; - if (this.numConstants != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - const batchSize = this.stateful ? inputShape[0] : null; - const inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({ shape: [batchSize, null, ...inputDim] }); - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - const stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (constantShape != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - else { - this.cell.build(stepInputShape); - } - // Set or validate stateSpec. - let stateSize; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } - else { - stateSize = [this.cell.stateSize]; - } - if (this.stateSpec != null) { - if (!util.arraysEqual(this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]), stateSize)) { - throw new ValueError(`An initialState was passed that is not compatible with ` + - `cell.stateSize. Received stateSpec=${this.stateSpec}; ` + - `However cell.stateSize is ${this.cell.stateSize}`); - } - } - else { - this.stateSpec = - stateSize.map(dim => new InputSpec({ shape: [null, dim] })); - } - if (this.stateful) { - this.resetStates(); - } - } - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - resetStates(states, training = false) { - tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const batchSize = this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.states_ == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } - else { - this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } - else { - this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - tfc.dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const dim = Array.isArray(this.cell.stateSize) ? - this.cell.stateSize[index] : - this.cell.stateSize; - const expectedShape = [batchSize, dim]; - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - apply(inputs, kwargs) { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - let additionalInputs = []; - let additionalSpecs = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (const state of initialState) { - this.stateSpec.push(new InputSpec({ shape: state.shape })); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - const isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - // tslint:disable-next-line:no-any - call(inputs, kwargs) { - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tidy(() => { - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - let initialState = kwargs == null ? null : kwargs['initialState']; - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (this.stateful) { - initialState = this.states_; - } - else { - initialState = this.getInitialState(inputs); - } - } - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError(`RNN Layer has ${numStates} state(s) but was passed ` + - `${initialState.length} initial state(s).`); - } - if (this.unroll) { - console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - const cellCallKwargs = { training }; - // TODO(cais): Add support for constants. - const step = (inputs, states) => { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - const outputs = this.cell.call([inputs].concat(states), cellCallKwargs); - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)]; - }; - // TODO(cais): Add support for constants. - const rnnOutputs = rnn(step, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); - const lastOutput = rnnOutputs[0]; - const outputs = rnnOutputs[1]; - const states = rnnOutputs[2]; - if (this.stateful) { - this.resetStates(states, training); - } - const output = this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. - if (this.returnState) { - return [output].concat(states); - } - else { - return output; - } - }); - } - getInitialState(inputs) { - return tidy(() => { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - let initialState = tfc.zeros(inputs.shape); - // [Samples]. - initialState = tfc.sum(initialState, [1, 2]); - initialState = K.expandDims(initialState); // [Samples, 1]. - if (Array.isArray(this.cell.stateSize)) { - return this.cell.stateSize.map(dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState); - } - else { - return this.cell.stateSize > 1 ? - [K.tile(initialState, [1, this.cell.stateSize])] : - [initialState]; - } - }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - } - get nonTrainableWeights() { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - const cellConfig = this.cell.getConfig(); - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - }; - } - // this order is necessary, to prevent cell name from replacing layer name - return Object.assign({}, cellConfig, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cellConfig = config['cell']; - const cell = deserialize(cellConfig, customObjects); - return new cls(Object.assign(config, { cell })); - } -} -/** @nocollapse */ -RNN.className = 'RNN'; -serialization.registerClass(RNN); -// Porting Note: This is a common parent class for RNN cells. There is no -// equivalent of this in PyKeras. Having a common parent class forgoes the -// need for `has_attr(cell, ...)` checks or its TypeScript equivalent. -/** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ -export class RNNCell extends Layer { -} -export class SimpleRNNCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, `units`); - this.activation = getActivation(args.activation == null ? this.DEFAULT_ACTIVATION : args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = math_utils.min([1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`); - } - let prevOutput = inputs[1]; - inputs = inputs[0]; - const training = kwargs['training'] == null ? false : kwargs['training']; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(prevOutput), - rate: this.recurrentDropout, - training - }); - } - let h; - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - if (dpMask != null) { - h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read()); - } - else { - h = K.dot(inputs, this.kernel.read()); - } - if (this.bias != null) { - h = K.biasAdd(h, this.bias.read()); - } - if (recDpMask != null) { - prevOutput = tfc.mul(prevOutput, recDpMask); - } - let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read())); - if (this.activation != null) { - output = this.activation.apply(output); - } - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -SimpleRNNCell.className = 'SimpleRNNCell'; -serialization.registerClass(SimpleRNNCell); -export class SimpleRNN extends RNN { - constructor(args) { - args.cell = new SimpleRNNCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } -} -/** @nocollapse */ -SimpleRNN.className = 'SimpleRNN'; -serialization.registerClass(SimpleRNN); -export class GRUCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.resetAfter) { - throw new ValueError(`GRUCell does not support reset_after parameter set to true.`); - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = math_utils.min([1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`GRUCell expects 2 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] == null ? false : kwargs['training']; - let hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training, - count: 3 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 3 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - let z; - let r; - let hh; - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let matrixX = K.dot(inputs, this.kernel.read()); - if (this.useBias) { - matrixX = K.biasAdd(matrixX, this.bias.read()); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - const recurrentKernelValue = this.recurrentKernel.read(); - const [rk1, rk2] = tfc.split(recurrentKernelValue, [2 * this.units, this.units], recurrentKernelValue.rank - 1); - const matrixInner = K.dot(hTMinus1, rk1); - const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1); - const [recurrentZ, recurrentR] = tfc.split(matrixInner, 2, matrixInner.rank - 1); - z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); - r = this.recurrentActivation.apply(tfc.add(xR, recurrentR)); - const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2); - hh = this.activation.apply(tfc.add(xH, recurrentH)); - const h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -GRUCell.className = 'GRUCell'; -serialization.registerClass(GRUCell); -export class GRU extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -/** @nocollapse */ -GRU.className = 'GRU'; -serialization.registerClass(GRU); -export class LSTMCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.unitForgetBias = args.unitForgetBias; - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = math_utils.min([1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = [this.units, this.units]; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - let biasInitializer; - if (this.useBias) { - if (this.unitForgetBias) { - const capturedBiasInit = this.biasInitializer; - const capturedUnits = this.units; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - // TODO(cais): More informative variable names? - const bI = capturedBiasInit.apply([capturedUnits]); - const bF = (new Ones()).apply([capturedUnits]); - const bCAndH = capturedBiasInit.apply([capturedUnits * 2]); - return K.concatAlongFirstAxis(K.concatAlongFirstAxis(bI, bF), bCAndH); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs; - if (inputs.length !== 3) { - throw new ValueError(`LSTMCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - let hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training, - count: 4 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 4 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - let i; - let f; - let c; - let o; - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let z = K.dot(inputs, this.kernel.read()); - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read())); - if (this.useBias) { - z = K.biasAdd(z, this.bias.read()); - } - const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1); - i = this.recurrentActivation.apply(z0); - f = this.recurrentActivation.apply(z1); - c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2))); - o = this.recurrentActivation.apply(z3); - const h = tfc.mul(o, this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -LSTMCell.className = 'LSTMCell'; -serialization.registerClass(LSTMCell); -export class LSTM extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -/** @nocollapse */ -LSTM.className = 'LSTM'; -serialization.registerClass(LSTM); -export class StackedRNNCells extends RNNCell { - constructor(args) { - super(args); - this.cells = args.cells; - } - get stateSize() { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - const stateSize = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - stateSize.push(...cell.stateSize); - } - else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - let states = inputs.slice(1); - // Recover per-cell states. - const nestedStates = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } - else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - // Call the cells in order and store the returned states. - const newNestedStates = []; - let callInputs; - for (let i = 0; i < this.cells.length; ++i) { - const cell = this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } - else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs); - newNestedStates.push(callInputs.slice(1)); - } - // Format the new states as a flat list in reverse cell order. - states = []; - for (const cellStates of newNestedStates.slice().reverse()) { - states.push(...cellStates); - } - return [callInputs[0]].concat(states); - }); - } - build(inputShape) { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = inputShape[0]; - } - inputShape = inputShape; - let outputDim; - this.cells.forEach((cell, i) => { - nameScope(`RNNCell_${i}`, () => { - // TODO(cais): Take care of input constants. - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } - else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim]; - }); - }); - this.built = true; - } - getConfig() { - const baseConfig = super.getConfig(); - const getCellConfig = (cell) => { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - const cellConfigs = this.cells.map(getCellConfig); - const config = { 'cells': cellConfigs }; - return Object.assign({}, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cells = []; - for (const cellConfig of config['cells']) { - cells.push(deserialize(cellConfig, customObjects)); - } - return new cls({ cells }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const cell of this.cells) { - trainableWeights.push(...cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - getWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.weights); - } - return batchGetValue(weights); - } - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - setWeights(weights) { - const tuples = []; - for (const cell of this.cells) { - const numParams = cell.weights.length; - const inputWeights = weights.splice(numParams); - for (let i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - } -} -/** @nocollapse */ -StackedRNNCells.className = 'StackedRNNCells'; -serialization.registerClass(StackedRNNCells); -export function generateDropoutMask(args) { - const { ones, rate, training = false, count = 1 } = args; - const droppedInputs = () => K.dropout(ones(), rate); - const createMask = () => K.inTrainPhase(droppedInputs, ones, training); - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return tfc.keep(createMask().clone()); - } - const masks = Array(count).fill(undefined).map(createMask); - return masks.map(m => tfc.keep(m.clone())); -} -//# sourceMappingURL=recurrent.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-layers/dist/layers/recurrent.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map deleted file mode 100644 index 39ca96805..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recurrent.js","sourceRoot":"","sources":["../../src/layers/recurrent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAW,aAAa,EAAU,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAElF,OAAO,EAAa,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,CAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,EAAmC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAC,KAAK,EAAY,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAE,WAAW,EAAyB,IAAI,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAG/G,OAAO,EAAC,cAAc,EAAsC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAAC,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAC,aAAa,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AACzE,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC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AAC;AAiLvC,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;AAE7C,MAAM,UAAU,mBAAmB,CAAC,IAKnC;IACC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,KAAK,GAAG,CAAC,EAAC,GAAG,IAAI,CAAC;IAEvD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvE,wDAAwD;IACxD,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,EAAE;QACxB,OAAO,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;KACvC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAE3D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\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-layers/dist/layers/recurrent_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map deleted file mode 100644 index 6120a6275..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"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C,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for recurrent.ts.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, randomNormal, scalar, Tensor, tensor1d, tensor2d, tensor3d, tensor4d} from '@tensorflow/tfjs-core';\n\nimport {serializeActivation, Tanh} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {NonNeg, serializeConstraint, UnitNorm} from '../constraints';\nimport * as tfl from '../index';\nimport {GlorotUniform, HeUniform, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {ModelAndWeightsConfig, modelFromJSON} from '../models';\nimport {L1L2, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convertPythonicToTs, convertTsToPythonic} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, describeMathGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {GRUCellLayerArgs, GRULayerArgs, LSTMCellLayerArgs, LSTMLayerArgs, rnn, RNN, RNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs} from './recurrent';\n\n/**\n * A simplistic RNN step function for testing.\n * This step function simply\n * - calculates a reduced mean over all input elements, for each sample.\n * - adds that mean to the state tensor(s),\n * - take the negative of the 1st current state tensor and use it as the\n * output.\n * @param inputs\n * @param states\n */\nfunction rnnStepForTest(inputs: Tensor, states: Tensor[]): [Tensor, Tensor[]] {\n const mean = tfc.mean(inputs);\n const newStates = states.map(state => tfc.add(mean, state));\n const output = tfc.neg(newStates[0]);\n return [output, newStates];\n}\n\ndescribeMathCPUAndGPU('rnn', () => {\n it('Simple step function: 3D inputs, 1 state', () => {\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const initialStates = [tfc.zeros([2, 4])];\n const rnnOutputs =\n rnn(rnnStepForTest, inputs, initialStates, false /* goBackwards */,\n null /* mask */, null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const newStates = rnnOutputs[2];\n expectTensorsClose(\n lastOutput,\n tensor2d(\n [\n [-57.75, -57.75, -57.75, -57.75], [-57.75, -57.75, -57.75, -57.75]\n ],\n [2, 4]));\n expectTensorsClose(\n outputs,\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ]\n ],\n [2, 3, 4]));\n expect(newStates.length).toEqual(1);\n expectTensorsClose(\n newStates[0],\n tensor2d(\n [[57.75, 57.75, 57.75, 57.75], [57.75, 57.75, 57.75, 57.75]],\n [2, 4]));\n });\n\n it('Simple step function: 3D inputs, 2 states', () => {\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n // The two state tensors have different shapes.\n const initialStates = [tfc.zeros([2, 4]), tfc.ones([2, 3])];\n const rnnOutputs =\n rnn(rnnStepForTest, inputs, initialStates, false /* goBackwards */,\n null /* mask */, null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const newStates = rnnOutputs[2];\n expectTensorsClose(\n lastOutput,\n tensor2d(\n [\n [-57.75, -57.75, -57.75, -57.75], [-57.75, -57.75, -57.75, -57.75]\n ],\n [2, 4]));\n expectTensorsClose(\n outputs,\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ]\n ],\n [2, 3, 4]));\n expect(newStates.length).toEqual(2);\n expectTensorsClose(\n newStates[0],\n tensor2d(\n [[57.75, 57.75, 57.75, 57.75], [57.75, 57.75, 57.75, 57.75]],\n [2, 4]));\n expectTensorsClose(\n newStates[1],\n tensor2d([[58.75, 58.75, 58.75], [58.75, 58.75, 58.75]], [2, 3]));\n });\n\n it('Simple step function: 4D inputs, 2 states', () => {\n const inputs = tensor4d(\n [\n [[[1], [2]], [[3], [4]], [[5], [6]]],\n [[[10], [20]], [[30], [40]], [[50], [60]]]\n ],\n [2, 3, 2, 1]);\n // The two state tensors have different shapes.\n const initialStates = [tfc.zeros([2, 4]), tfc.ones([2, 3])];\n const rnnOutputs =\n rnn(rnnStepForTest, inputs, initialStates, false /* goBackwards */,\n null /* mask */, null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const newStates = rnnOutputs[2];\n expectTensorsClose(\n lastOutput,\n tensor2d(\n [\n [-57.75, -57.75, -57.75, -57.75], [-57.75, -57.75, -57.75, -57.75]\n ],\n [2, 4]));\n expectTensorsClose(\n outputs,\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25, -8.25], [-27.5, -27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75, -57.75]\n ]\n ],\n [2, 3, 4]));\n expect(newStates.length).toEqual(2);\n expectTensorsClose(\n newStates[0],\n tensor2d(\n [[57.75, 57.75, 57.75, 57.75], [57.75, 57.75, 57.75, 57.75]],\n [2, 4]));\n expectTensorsClose(\n newStates[1],\n tensor2d([[58.75, 58.75, 58.75], [58.75, 58.75, 58.75]], [2, 3]));\n });\n\n it('Using inputs <3D leads to ValueError', () => {\n const inputs = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const initialStates = [tfc.zeros([4]), tfc.ones([3])];\n expect(() => rnn(rnnStepForTest, inputs, initialStates)).toThrowError();\n });\n});\n\n/**\n * A simplistic RNNCell for testing.\n *\n * This RNNCell performs the following with the inputs and states.\n * - calculates a reduced mean over all input elements,\n * - adds that mean to the state tensor(s),\n * - take the negative of the 1st current state tensor and use it as the\n * output.\n */\nclass RNNCellForTest extends RNNCell {\n /** @nocollapse */\n static className = 'RNNCellForTest';\n stateSize: number|number[];\n constructor(stateSizes: number|number[]) {\n super({});\n this.stateSize = stateSizes;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = inputs as Tensor[];\n const dataInputs = inputs[0];\n const states = inputs.slice(1);\n const mean = tfc.mean(dataInputs);\n const newStates = states.map(state => tfc.add(mean, state));\n const output = tfc.neg(newStates[0]);\n return [output].concat(newStates);\n }\n}\n\ndescribeMathCPU('RNN-Layer', () => {\n // TODO(cais): Add tests for stacked RNN cell (i.e., multiple cells) once it\n // implemented.\n // TODO(cais): Add tests for masks once implemented.\n // TODO(cais): Add tests for constants once implemented.\n\n it('constructor: only cell', () => {\n const cell = new RNNCellForTest(5);\n const rnn = tfl.layers.rnn({cell});\n expect(rnn.returnSequences).toEqual(false);\n expect(rnn.returnState).toEqual(false);\n expect(rnn.goBackwards).toEqual(false);\n });\n\n it('constructor: cell and custom options', () => {\n const cell = new RNNCellForTest(5);\n const rnn = tfl.layers.rnn({\n cell,\n returnSequences: true,\n returnState: true,\n goBackwards: true\n });\n expect(rnn.returnSequences).toEqual(true);\n expect(rnn.returnState).toEqual(true);\n expect(rnn.goBackwards).toEqual(true);\n });\n\n it('computeOutputShape: 1 state, returnSequences=false, returnState=false',\n () => {\n const cell = new RNNCellForTest(5);\n const rnn = tfl.layers.rnn({cell});\n const inputShape = [4, 3, 2];\n expect(rnn.computeOutputShape(inputShape)).toEqual([4, 5]);\n });\n\n it('computeOutputShape: 1 state, returnSequences=true, returnState=false',\n () => {\n const cell = new RNNCellForTest([5, 6]);\n const rnn = tfl.layers.rnn({cell, returnSequences: true});\n const inputShape = [4, 3, 2];\n expect(rnn.computeOutputShape(inputShape)).toEqual([4, 3, 5]);\n });\n\n it('computeOutputShape: 1 state, returnSequences=true, returnState=true',\n () => {\n const cell = new RNNCellForTest(6);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const inputShape = [4, 3, 2];\n expect(rnn.computeOutputShape(inputShape)).toEqual([[4, 3, 6], [4, 6]]);\n });\n\n it('computeOutputShape: 2 states, returnSequences=true, returnState=true',\n () => {\n const cell = new RNNCellForTest([5, 6]);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const inputShape = [4, 3, 2];\n expect(rnn.computeOutputShape(inputShape)).toEqual([\n [4, 3, 5], [4, 5], [4, 6]\n ]);\n });\n\n it('apply: Symbolic: 1 state, returnSequences=false, returnState=false',\n () => {\n const cell = new RNNCellForTest(6);\n const rnn = tfl.layers.rnn({cell});\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 8], null, [], null);\n const output = rnn.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([16, 6]);\n });\n\n it('apply: Symbolic: 1 state, returnSequences=true, returnState=false',\n () => {\n const cell = new RNNCellForTest(6);\n const rnn = tfl.layers.rnn({cell, returnSequences: true});\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 8], null, [], null);\n const output = rnn.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([16, 10, 6]);\n });\n\n it('apply: Symbolic: 1 state, returnSequences=true, returnState=true', () => {\n const cell = new RNNCellForTest(6);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 8], null, [], null);\n const output = rnn.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([16, 10, 6]);\n expect(output[1].shape).toEqual([16, 6]);\n });\n\n it('apply: Symbolic: 1 state, returnSequences=false, returnState=true',\n () => {\n const cell = new RNNCellForTest(6);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: false, returnState: true});\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 8], null, [], null);\n const output = rnn.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([16, 6]);\n expect(output[1].shape).toEqual([16, 6]);\n });\n\n it('apply: Symbolic: 2 states, returnSequences=true, returnState=true',\n () => {\n const cell = new RNNCellForTest([5, 6]);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 8], null, [], null);\n const output = rnn.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(3);\n expect(output[0].shape).toEqual([16, 10, 5]);\n expect(output[1].shape).toEqual([16, 5]);\n expect(output[2].shape).toEqual([16, 6]);\n });\n});\n\ndescribeMathCPUAndGPU('RNN-Layer-Math', () => {\n it('getInitialState: 1 state', () => {\n const cell = new RNNCellForTest(5);\n const inputs = tfc.zeros([4, 3, 2]);\n const rnn = tfl.layers.rnn({cell});\n const initialStates = rnn.getInitialState(inputs);\n expect(initialStates.length).toEqual(1);\n expectTensorsClose(initialStates[0], tfc.zeros([4, 5]));\n });\n\n it('getInitialState: 2 states', () => {\n const cell = new RNNCellForTest([5, 6]);\n const inputs = tfc.zeros([4, 3, 2]);\n const rnn = tfl.layers.rnn({cell});\n const initialStates = rnn.getInitialState(inputs);\n expect(initialStates.length).toEqual(2);\n expectTensorsClose(initialStates[0], tfc.zeros([4, 5]));\n expectTensorsClose(initialStates[1], tfc.zeros([4, 6]));\n });\n\n it('call: 1 state: returnSequences=false, returnState=false', () => {\n const cell = new RNNCellForTest(4);\n const rnn = tfl.layers.rnn({cell});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs = rnn.apply(inputs) as Tensor;\n expectTensorsClose(outputs, tfc.mul(scalar(-57.75), tfc.ones([2, 4])));\n });\n\n it('apply: 1 state: returnSequences=true, returnState=false', () => {\n const cell = new RNNCellForTest(3);\n const rnn = tfl.layers.rnn({cell, returnSequences: true});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs = rnn.apply(inputs) as Tensor;\n expectTensorsClose(\n outputs,\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n ],\n [2, 3, 3]));\n });\n\n it('apply: 1 state: returnSequences=true, returnState=true', () => {\n const cell = new RNNCellForTest(3);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs = rnn.apply(inputs) as Tensor[];\n expect(outputs.length).toEqual(2);\n expectTensorsClose(\n outputs[0],\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n ],\n [2, 3, 3]));\n expectTensorsClose(\n outputs[1],\n tensor2d([[57.75, 57.75, 57.75], [57.75, 57.75, 57.75]], [2, 3]));\n });\n\n it('apply: 2 states: returnSequences=true, returnState=true', () => {\n const cell = new RNNCellForTest([3, 4]);\n const rnn =\n tfl.layers.rnn({cell, returnSequences: true, returnState: true});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs = rnn.apply(inputs) as Tensor[];\n expect(outputs.length).toEqual(3);\n expectTensorsClose(\n outputs[0],\n tensor3d(\n [\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n [\n [-8.25, -8.25, -8.25], [-27.5, -27.5, -27.5],\n [-57.75, -57.75, -57.75]\n ],\n ],\n [2, 3, 3]));\n expectTensorsClose(\n outputs[1],\n tensor2d([[57.75, 57.75, 57.75], [57.75, 57.75, 57.75]], [2, 3]));\n expectTensorsClose(\n outputs[2],\n tensor2d(\n [[57.75, 57.75, 57.75, 57.75], [57.75, 57.75, 57.75, 57.75]],\n [2, 4]));\n });\n\n it('call: with 1 initialState', () => {\n const cell = new RNNCellForTest(4);\n const rnn = tfl.layers.rnn({cell});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs =\n rnn.apply(inputs, {'initialState': [tfc.ones([2, 4])]}) as Tensor;\n expectTensorsClose(outputs, tfc.mul(scalar(-58.75), tfc.ones([2, 4])));\n });\n\n it('call: with 2 initialStates', () => {\n const cell = new RNNCellForTest([4, 5]);\n const rnn = tfl.layers.rnn({cell, returnState: true});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n const outputs = rnn.apply(inputs, {\n 'initialState': [tfc.ones([2, 4]), tfc.mul(scalar(2), tfc.ones([2, 5]))]\n }) as Tensor[];\n expect(outputs.length).toEqual(3);\n expectTensorsClose(outputs[0], tfc.mul(scalar(-58.75), tfc.ones([2, 4])));\n expectTensorsClose(outputs[1], tfc.mul(scalar(58.75), tfc.ones([2, 4])));\n expectTensorsClose(outputs[2], tfc.mul(scalar(59.75), tfc.ones([2, 5])));\n });\n\n it('call with incorrect number of initialStates leads to ValueError', () => {\n const cell = new RNNCellForTest([4, 5]);\n const rnn = tfl.layers.rnn({cell, returnState: true});\n const inputs = tensor3d(\n [[[1, 2], [3, 4], [5, 6]], [[10, 20], [30, 40], [50, 60]]], [2, 3, 2]);\n expect(() => rnn.apply(inputs, {\n 'initialState': [tfc.ones([2, 4])]\n })).toThrowError(/An initialState was passed that is not compatible with/);\n });\n});\n\ndescribeMathCPU('SimpleRNN Symbolic', () => {\n it('returnSequences=false, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const simpleRNN = tfl.layers.simpleRNN({units: 5});\n const output = simpleRNN.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 5]);\n });\n\n it('returnSequences=false, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const simpleRNN = tfl.layers.simpleRNN({units: 5, returnState: true});\n const output = simpleRNN.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([9, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n });\n\n it('returnSequences=true, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const simpleRNN = tfl.layers.simpleRNN({units: 5, returnSequences: true});\n const output = simpleRNN.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 10, 5]);\n });\n\n it('returnSequences=true, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const simpleRNN = tfl.layers.simpleRNN({\n units: 5,\n returnSequences: true,\n returnState: true,\n });\n const output = simpleRNN.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([9, 10, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n });\n\n it('Serialization round trip', () => {\n const layer = tfl.layers.simpleRNN({units: 4});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.simpleRNN(tsConfig);\n expect(layerPrime.getConfig().units).toEqual(4);\n });\n\n it('Invalid units leads to Error', () => {\n expect(() => tfl.layers.simpleRNN({\n units: 12.5\n })).toThrowError(/units.*positive integer.*12\\.5\\.$/);\n expect(() => tfl.layers.simpleRNN({\n units: 0\n })).toThrowError(/units.*positive integer.*0\\.$/);\n expect(() => tfl.layers.simpleRNN({\n units: -25\n })).toThrowError(/units.*positive integer.*-25\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('SimpleRNN Tensor', () => {\n const units = 5;\n const batchSize = 4;\n const inputSize = 2;\n\n // TODO(cais): Add test for the default recurrent initializer ('Orthogonal')\n // when it becomes available.\n\n const dropouts = [0.0, 0.1];\n const trainings = [true, false];\n for (const training of trainings) {\n for (const dropout of dropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, dropout=${dropout}`;\n it(testTitle, () => {\n const timeSteps = 3;\n const simpleRNN = tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n dropout,\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(simpleRNN.apply(input, kwargs) as Tensor);\n if (dropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(1 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const recurrentDropouts = [0.0, 0.1];\n for (const training of trainings) {\n for (const recurrentDropout of recurrentDropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, recurrentDropout=${recurrentDropout}`;\n it(testTitle, () => {\n const timeSteps = 3;\n const simpleRNN = tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n recurrentDropout,\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(simpleRNN.apply(input, kwargs) as Tensor);\n if (recurrentDropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(1 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const activations: ActivationIdentifier[] = ['linear', 'tanh'];\n for (const activation of activations) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true, ${activation}`;\n it(testTitle, () => {\n const timeSteps = 1;\n const simpleRNN = tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n activation\n });\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n const output = simpleRNN.apply(input) as Tensor;\n let expectedElementValue = inputSize + 1;\n if (activation === 'tanh') {\n expectedElementValue = Math.tanh(expectedElementValue);\n }\n expectTensorsClose(\n output,\n tfc.mul(scalar(expectedElementValue), tfc.ones([batchSize, units])));\n });\n }\n\n const returnStateValues = [false, true];\n for (const returnState of returnStateValues) {\n const testTitle = `returnSequences=true, ` +\n `returnState=${returnState}, useBias=true, linear`;\n it(testTitle, () => {\n const timeSteps = 2;\n const simpleRNN = tfl.layers.simpleRNN({\n units,\n returnSequences: true,\n returnState,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n activation: 'linear'\n });\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n let output = simpleRNN.apply(input);\n let finalState: Tensor;\n if (returnState) {\n output = output as Tensor[];\n expect(output.length).toEqual(2);\n finalState = output[1];\n output = output[0];\n } else {\n output = output as Tensor;\n }\n\n expect(output.shape).toEqual([batchSize, timeSteps, units]);\n const timeMajorOutput = tfc.transpose(output, [1, 0, 2]);\n const outputT0 = K.sliceAlongFirstAxis(timeMajorOutput, 0, 1);\n const outputT1 = K.sliceAlongFirstAxis(timeMajorOutput, 1, 1);\n expectTensorsClose(\n outputT0,\n tfc.mul(scalar(inputSize + 1), tfc.ones([1, batchSize, units])));\n expectTensorsClose(\n outputT1,\n tfc.mul(\n scalar((inputSize + 1) * (units + 1)),\n tfc.ones([1, batchSize, units])));\n if (returnState) {\n expectTensorsClose(finalState, outputT1.reshape([batchSize, units]));\n }\n });\n\n it('stateful missing batchInputShape leads to error', () => {\n const sequenceLength = 3;\n const simpleRNN = tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'zeros',\n activation: 'linear',\n stateful: true,\n inputShape: [sequenceLength, inputSize]\n }) as RNN;\n const model = tfl.sequential();\n expect(() => model.add(simpleRNN))\n .toThrowError(/needs to know its batch size/);\n });\n\n // The reference values below can be obtained with PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // units = 5\n // batch_size = 4\n // input_size = 2\n // sequence_length = 3\n //\n // rnn = keras.layers.SimpleRNN(units,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='zeros',\n // activation='linear',\n // stateful=True,\n // batch_input_shape=[batch_size,\n // sequence_length,\n // input_size])\n //\n // x = np.ones([batch_size, sequence_length, input_size])\n //\n // model = keras.Sequential()\n // model.add(rnn)\n // print(model.predict(x))\n // print(model.predict(x))\n // model.reset_states()\n // print(model.predict(x))\n // print(model.predict(x))\n // ```\n it('stateful forward: only RNN layer', async () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'zeros',\n activation: 'linear',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const model = tfl.sequential();\n model.add(rnn);\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const scalar1 = tfc.scalar(62);\n const scalar2 = tfc.scalar(7812);\n\n let y1 = model.predict(x) as Tensor;\n expect(y1.kept).toBe(false);\n let y1Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(scalar1));\n expectTensorsClose(y1, y1Expected);\n\n let y2 = model.predict(x) as Tensor;\n expect(y2.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y1.isDisposed).toBe(false);\n let y2Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(scalar2));\n expectTensorsClose(y2, y2Expected);\n tfc.dispose([y1, y2, y1Expected, y2Expected]);\n\n model.resetStates();\n const numTensors0 = tfc.memory().numTensors;\n\n y1 = model.predict(x) as Tensor;\n expect(y1.kept).toBe(false);\n y1Expected = tfc.tidy(() => tfc.ones([batchSize, units]).mul(scalar1));\n expectTensorsClose(y1, y1Expected);\n\n y2 = model.predict(x) as Tensor;\n expect(y2.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y1.isDisposed).toBe(false);\n y2Expected = tfc.tidy(() => tfc.ones([batchSize, units]).mul(scalar2));\n expectTensorsClose(y2, y2Expected);\n tfc.dispose([y1, y2, y1Expected, y2Expected]);\n\n // Assert no memory leak, even without resetStates() being called.\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n });\n }\n\n // Reference Python code:\n // ```py\n // import numpy as np\n // from tensorflow import keras\n //\n // model = keras.Sequential()\n // model.add(keras.layers.SimpleRNN(\n // units=5,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='zeros',\n // activation='linear',\n // stateful=True,\n // batch_input_shape=[4, 3, 2]))\n // model.add(keras.layers.Dense(units=1, kernel_initializer='ones'))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n // model.summary()\n //\n // xs = np.ones([4, 3, 2])\n // y1 = model.predict(xs)\n // print(y1)\n // y2 = model.predict(xs)\n // print(y2)\n //\n // history = model.fit(xs, ys, batch_size=4, epochs=3)\n // print(history.history)\n // ```\n it('stateful forward: RNN and dense layers', async () => {\n const sequenceLength = 3;\n const model = tfl.sequential();\n model.add(tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'zeros',\n activation: 'linear',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense({units: 1, kernelInitializer: 'ones'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tfc.ones([batchSize, sequenceLength, inputSize]);\n const ys = tfc.ones([batchSize, 1]);\n let y1: Tensor;\n let y2: Tensor;\n tfc.tidy(() => {\n y1 = model.predict(xs) as Tensor;\n expectTensorsClose(y1, tfc.tensor2d([310, 310, 310, 310], [4, 1]));\n y2 = model.predict(xs) as Tensor;\n expectTensorsClose(\n y2, tfc.tensor2d([39060, 39060, 39060, 39060], [4, 1]));\n });\n model.resetStates();\n const numTensors0 = tfc.memory().numTensors;\n\n tfc.tidy(() => {\n y1 = model.predict(xs) as Tensor;\n expect(y1.shape).toEqual([batchSize, 1]);\n expectTensorsClose(y1, tfc.tensor2d([310, 310, 310, 310], [4, 1]));\n y2 = model.predict(xs) as Tensor;\n expectTensorsClose(\n y2, tfc.tensor2d([39060, 39060, 39060, 39060], [4, 1]));\n });\n // Assert no memory leak, even without resetStates() being called.\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n\n const history = await model.fit(xs, ys, {epochs: 1, batchSize: 4});\n expect(history.history.loss[0]).toBeCloseTo(23841822736384);\n });\n\n it('computeMask: returnSequence = false, returnState = false', () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.simpleRNN({\n units,\n returnSequences: false,\n returnState: false,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const m = tfc.ones([sequenceLength, 1]);\n const mask = rnn.computeMask(x, m);\n expect(mask).toBeNull();\n });\n\n it('computeMask: returnSequence = true, returnState = false', () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.simpleRNN({\n units,\n returnSequences: true,\n returnState: false,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const m = tfc.ones([sequenceLength, 1]);\n const mask = rnn.computeMask(x, m) as Tensor;\n expectTensorsClose(mask, m);\n });\n\n it('computeMask: returnSequence = true, returnState = true', () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.simpleRNN({\n units,\n returnSequences: true,\n returnState: true,\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n rnn.apply(x);\n rnn.resetStates(); // Let the RNN layer object construct its state first.\n const m = tfc.ones([sequenceLength, 1]);\n const masks = rnn.computeMask(x, m) as Tensor[];\n expect(masks.length).toEqual(2);\n expectTensorsClose(masks[0], m);\n expect(masks[1]).toBeNull();\n });\n\n // The reference values can be obtained with the following PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // batch_size = 4\n // sequence_length = 3\n // input_size = 2\n //\n // model = keras.Sequential()\n // model.add(keras.layers.SimpleRNN(\n // units=5,\n // batch_input_shape=[batch_size, sequence_length, input_size],\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='zeros',\n // stateful=True))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='zeros',\n // use_bias=False))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs_1 = np.ones([batch_size, sequence_length, input_size])\n // xs_2 = np.zeros([batch_size, sequence_length, input_size])\n // xs = np.concatenate([xs_1, xs_2], 0)\n // ys = np.array([[-1], [-2], [0], [1], [1], [2], [0], [-1]])\n //\n // history = model.fit(xs, ys, batch_size=batch_size, shuffle=False)\n // print(history.history)\n // ```\n it('stateful BPTT', async () => {\n const sequenceLength = 3;\n const model = tfl.sequential();\n model.add(tfl.layers.simpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'zeros',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs1 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs2 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs = tfc.concat([xs1, xs2], 0);\n const ys = tfc.tensor2d([[-1], [-2], [0], [1], [1], [2], [0], [-1]]);\n\n const history = await model.fit(xs, ys, {batchSize, shuffle: false});\n // See code snippet above for the code used to obtain this loss value.\n expect(history.history.loss[0]).toBeCloseTo(1.5262475);\n });\n\n it('BPTT', async () => {\n // The following golden values for assertion can be obtained with the\n // following Python Keras code.\n // ```python\n // import keras\n // import numpy as np\n //\n // sequence_length = 3\n // input_size = 4\n // batch_size = 5\n //\n // t_input = keras.Input([sequence_length, input_size])\n // simple_rnn = keras.layers.SimpleRNN(1,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // use_bias=False)\n // dense = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False)\n // output = dense(simple_rnn(t_input))\n // model = keras.Model(t_input, output)\n // optimizer = keras.optimizers.SGD(5)\n // model.compile(optimizer=optimizer, loss='mean_squared_error')\n //\n // x = np.ones([batch_size, sequence_length, input_size])\n // y = np.zeros([batch_size, 1])\n // model.fit(x, y, batch_size=batch_size, epochs=2)\n // print(simple_rnn.get_weights()[0])\n // print(simple_rnn.get_weights()[1])\n // print(dense.get_weights()[0])\n // ```\n const sequenceLength = 3;\n const inputSize = 4;\n const batchSize = 5;\n const model = tfl.sequential();\n model.add(tfl.layers.simpleRNN({\n units: 1,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n useBias: false,\n inputShape: [sequenceLength, inputSize],\n }));\n model.add(tfl.layers.dense({\n units: 1,\n kernelInitializer: 'ones',\n useBias: false,\n }));\n\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const y = tfc.zeros([batchSize, 1]);\n const sgd = tfc.train.sgd(5);\n model.compile({loss: 'meanSquaredError', optimizer: sgd});\n await model.fit(x, y, {epochs: 2});\n\n expectTensorsClose(\n model.layers[0].getWeights()[0],\n tfc.mul(scalar(0.8484658), tfc.ones([4, 1])));\n expectTensorsClose(\n model.layers[0].getWeights()[1],\n tfc.mul(scalar(0.8484799), tfc.ones([1, 1])));\n expectTensorsClose(\n model.layers[1].getWeights()[0],\n tfc.mul(scalar(80.967026), tfc.ones([1, 1])));\n });\n});\n\ndescribeMathCPU('SimpleRNN Serialization', () => {\n const cellConfig: SimpleRNNCellLayerArgs = {\n units: 8,\n activation: 'tanh',\n useBias: true,\n kernelInitializer: 'glorotUniform',\n recurrentInitializer: 'heUniform',\n biasInitializer: 'ones',\n kernelRegularizer: 'l1l2',\n recurrentRegularizer: 'l1l2',\n biasRegularizer: 'l1l2',\n kernelConstraint: 'unitNorm',\n recurrentConstraint: 'unitNorm',\n biasConstraint: 'nonNeg',\n dropout: 0.1,\n recurrentDropout: 0.2,\n name: 'cell_1',\n batchSize: 12,\n batchInputShape: [12, 8, 8],\n inputShape: [8, 8],\n dtype: 'int32',\n inputDType: 'int32',\n trainable: true,\n };\n\n const expectedCellConfigPrime = {\n name: 'cell_1',\n trainable: true,\n batchInputShape: [12, 8, 8],\n dtype: 'int32',\n units: 8,\n activation: serializeActivation(new Tanh()),\n useBias: true,\n kernelInitializer: serializeInitializer(new GlorotUniform()),\n recurrentInitializer: serializeInitializer(new HeUniform()),\n biasInitializer: serializeInitializer(new Ones()),\n kernelRegularizer: serializeRegularizer(new L1L2()),\n recurrentRegularizer: serializeRegularizer(new L1L2()),\n biasRegularizer: serializeRegularizer(new L1L2()),\n activityRegularizer: serializeRegularizer(null),\n kernelConstraint: serializeConstraint(new UnitNorm({})),\n recurrentConstraint: serializeConstraint(new UnitNorm({})),\n biasConstraint: serializeConstraint(new NonNeg()),\n };\n\n describe('SimpleRNNCell.getConfig', () => {\n it('should return the expected values', () => {\n const cell = tfl.layers.simpleRNNCell(cellConfig);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual(expectedCellConfigPrime);\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n\n describe('SimpleRNN.getConfig', () => {\n it('should return the expected values', () => {\n const config: SimpleRNNLayerArgs = {\n ...cellConfig,\n name: 'layer_1',\n ...{\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n inputDim: 8,\n inputLength: 8,\n } as Omit\n };\n\n const cell = tfl.layers.simpleRNN(config);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual({\n ...expectedCellConfigPrime,\n name: 'layer_1',\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n });\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n});\n\ndescribeMathCPU('GRU Symbolic', () => {\n it('returnSequences=false, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const gru = tfl.layers.gru({units: 5});\n const output = gru.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 5]);\n });\n\n it('returnSequences=false, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const gru = tfl.layers.gru({units: 5, returnState: true});\n const output = gru.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([9, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n });\n\n it('returnSequences=true, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const gru = tfl.layers.gru({units: 5, returnSequences: true});\n const output = gru.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 10, 5]);\n });\n\n it('returnSequences=true, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const gru = tfl.layers.gru({\n units: 5,\n returnSequences: true,\n returnState: true,\n });\n const output = gru.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(2);\n expect(output[0].shape).toEqual([9, 10, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n });\n\n it('trainableWeights, nonTrainableWeights and weights give correct outputs',\n () => {\n const input =\n new tfl.SymbolicTensor('float32', [2, 3, 4], null, [], null);\n const gru = tfl.layers.gru({units: 5, returnState: true});\n gru.apply(input);\n expect(gru.trainable).toEqual(true);\n // Trainable weights: kernel, recurrent kernel and bias.\n expect(gru.trainableWeights.length).toEqual(3);\n expect(gru.nonTrainableWeights.length).toEqual(0);\n expect(gru.weights.length).toEqual(3);\n });\n\n for (const implementation of [1, 2]) {\n it('Serialization round trip', () => {\n const layer = tfl.layers.gru({units: 4, implementation});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.gru(tsConfig);\n expect(layerPrime.getConfig().units).toEqual(4);\n expect(layerPrime.getConfig().implementation).toEqual(implementation);\n });\n }\n\n it('Invalid units leads to Error', () => {\n expect(() => tfl.layers.gru({\n units: 12.5\n })).toThrowError(/units.*positive integer.*12\\.5\\.$/);\n expect(() => tfl.layers.gru({\n units: 0\n })).toThrowError(/units.*positive integer.*0\\.$/);\n expect(() => tfl.layers.gru({\n units: -25\n })).toThrowError(/units.*positive integer.*-25\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('GRU Tensor', () => {\n // Note:\n // The golden expected values used for assertions in these unit tests can be\n // obtained through running the Python code similar to the following example.\n // TensorFlow 1.5 was used to obtain the values.\n //\n // ```python\n // import numpy as np\n // import tensorflow as tf\n //\n // units = 5\n // batch_size = 4\n // input_size = 2\n // time_steps = 3\n //\n // with tf.Session() as sess:\n // lstm = tf.keras.layers.GRU(units,\n // kernel_initializer=\"ones\",\n // recurrent_initializer=\"ones\",\n // bias_initializer=\"ones\",\n // return_sequences=True,\n // return_state=True)\n // inputs = tf.placeholder(tf.float32, shape=[None, None, input_size])\n // outputs = lstm(inputs)\n //\n // sess.run(tf.global_variables_initializer())\n // feed_inputs = np.ones([batch_size, time_steps, input_size])\n // print(sess.run(outputs, feed_dict={inputs: feed_inputs}))\n // ```\n\n const units = 5;\n const batchSize = 4;\n const inputSize = 2;\n const timeSteps = 3;\n const goldenOutputElementValues = [0.22847827, 0.2813754, 0.29444352];\n\n // TODO(cais): Add test for the default recurrent initializer ('Orthogonal')\n // when it becomes available.\n\n const dropouts = [0.0, 0.1];\n const trainings = [true, false];\n for (const training of trainings) {\n for (const dropout of dropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, dropout=${dropout}`;\n it(testTitle, () => {\n const gru = tfl.layers.gru({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n dropout,\n implementation: 1\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(gru.apply(input, kwargs) as Tensor);\n if (dropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(3 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const recurrentDropouts = [0.0, 0.1];\n for (const training of trainings) {\n for (const recurrentDropout of recurrentDropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, recurrentDropout=${recurrentDropout}`;\n it(testTitle, () => {\n const gru = tfl.layers.gru({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n recurrentDropout,\n implementation: 1\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(gru.apply(input, kwargs) as Tensor);\n if (recurrentDropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(3 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const implementations = [1, 2];\n const returnStateValues = [false, true];\n const returnSequencesValues = [false, true];\n for (const implementation of implementations) {\n for (const returnState of returnStateValues) {\n for (const returnSequences of returnSequencesValues) {\n const testTitle = `implementation=${implementation}, ` +\n `returnSequences=${returnSequences}, ` +\n `returnState=${returnState}`;\n it(testTitle, () => {\n const gru = tfl.layers.gru({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n returnState,\n returnSequences,\n implementation\n });\n const input = tfc.zeros([batchSize, timeSteps, inputSize]);\n let output = gru.apply(input);\n\n const goldenOutputElementValueFinal =\n goldenOutputElementValues[goldenOutputElementValues.length - 1];\n\n let expectedOutput: Tensor;\n if (returnSequences) {\n const outputs = goldenOutputElementValues.map(\n value =>\n tfc.mul(scalar(value), tfc.ones([1, batchSize, units])));\n expectedOutput = tfc.transpose(\n K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(outputs[0], outputs[1]), outputs[2]),\n [1, 0, 2]);\n } else {\n expectedOutput = tfc.mul(\n scalar(goldenOutputElementValueFinal),\n tfc.ones([batchSize, units]));\n }\n if (returnState) {\n output = output as Tensor[];\n expect(output.length).toEqual(2);\n expectTensorsClose(output[0], expectedOutput);\n expectTensorsClose(\n output[1],\n tfc.mul(\n scalar(goldenOutputElementValueFinal),\n tfc.ones([batchSize, units])));\n } else {\n output = output as Tensor;\n expectTensorsClose(output, expectedOutput);\n }\n });\n }\n }\n }\n\n // The reference values below can be obtained with PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // units = 5\n // batch_size = 4\n // input_size = 2\n // sequence_length = 3\n //\n // rnn = keras.layers.GRU(units,\n // kernel_initializer='ones',\n // recurrent_initializer='zeros',\n // bias_initializer='zeros',\n // activation='linear',\n // stateful=True,\n // batch_input_shape=[batch_size,\n // sequence_length,\n // input_size])\n //\n // x = np.ones([batch_size, sequence_length, input_size])\n //\n // model = keras.Sequential()\n // model.add(rnn)\n // print(model.predict(x))\n // print(model.predict(x))\n // model.reset_states()\n // print(model.predict(x))\n // print(model.predict(x))\n // ```\n it('stateful forward', async () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.gru({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'zeros',\n biasInitializer: 'zeros',\n activation: 'linear',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const model = tfl.sequential();\n model.add(rnn);\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const y1 = model.predict(x) as Tensor;\n expect(y1.kept).toBe(false);\n const y1Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.542)));\n expectTensorsClose(y1, y1Expected);\n const y2 = model.predict(x) as Tensor;\n expect(y2.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y1.isDisposed).toBe(false);\n const y2Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.9371182)));\n expectTensorsClose(y2, y2Expected);\n\n tfc.dispose([y1, y2, y1Expected, y2Expected]);\n model.resetStates();\n const numTensors0 = tfc.memory().numTensors;\n\n const y3 = model.predict(x) as Tensor;\n expect(y3.kept).toBe(false);\n const y3Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.542)));\n expectTensorsClose(y3, y3Expected);\n const y4 = model.predict(x) as Tensor;\n expect(y4.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y3.isDisposed).toBe(false);\n const y4Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.9371182)));\n expectTensorsClose(y4, y4Expected);\n tfc.dispose([y3, y3Expected, y4, y4Expected]);\n // Assert no memory leak, even without resetStates() being called.\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n });\n\n // The reference values can be obtained with the following PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // batch_size = 4\n // sequence_length = 3\n // input_size = 2\n //\n // model = keras.Sequential()\n // model.add(keras.layers.GRU(\n // units=5,\n // batch_input_shape=[batch_size, sequence_length, input_size],\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='zeros',\n // stateful=True))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='zeros',\n // use_bias=False))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs_1 = np.ones([batch_size, sequence_length, input_size])\n // xs_2 = np.zeros([batch_size, sequence_length, input_size])\n // xs = np.concatenate([xs_1, xs_2], 0)\n // ys = np.array([[-1], [-2], [0], [1], [1], [2], [0], [-1]])\n //\n // history = model.fit(xs, ys, batch_size=batch_size, shuffle=False)\n // print(history.history)\n // ```\n it('stateful BPTT', async () => {\n const sequenceLength = 3;\n const model = tfl.sequential();\n model.add(tfl.layers.gru({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'zeros',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'zeros', useBias: false}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs1 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs2 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs = tfc.concat([xs1, xs2], 0);\n const ys = tfc.tensor2d([[-1], [-2], [0], [1], [1], [2], [0], [-1]]);\n\n const history = await model.fit(xs, ys, {batchSize, shuffle: false});\n // See code snippet above for the code used to obtain this loss value.\n expect(history.history.loss[0]).toBeCloseTo(1.501);\n });\n\n it('BPTT', async () => {\n // The following golden values for assertion can be obtained with the\n // following Python Keras code.\n // ```python\n // import keras\n // import numpy as np\n\n // sequence_length = 3\n // input_size = 4\n // batch_size = 5\n\n // t_input = keras.Input([sequence_length, input_size])\n // gru = keras.layers.GRU(1,\n // kernel_initializer='zeros',\n // recurrent_initializer='zeros',\n // use_bias=False)\n // dense = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False)\n // output = dense(gru(t_input))\n // model = keras.Model(t_input, output)\n // optimizer = keras.optimizers.SGD(1)\n // model.compile(optimizer=optimizer, loss='mean_squared_error')\n\n // x = np.ones([batch_size, sequence_length, input_size])\n // y = np.ones([batch_size, 1])\n // model.fit(x, y, batch_size=batch_size, epochs=2)\n // print(gru.get_weights()[0])\n // print(gru.get_weights()[1])\n // print(dense.get_weights()[0])\n // ```\n const sequenceLength = 3;\n const inputSize = 4;\n const batchSize = 5;\n const model = tfl.sequential();\n model.add(tfl.layers.gru({\n units: 1,\n kernelInitializer: 'zeros',\n recurrentInitializer: 'zeros',\n useBias: false,\n inputShape: [sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', useBias: false}));\n\n const sgd = tfc.train.sgd(1);\n model.compile({loss: 'meanSquaredError', optimizer: sgd});\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const y = tfc.ones([batchSize, 1]);\n await model.fit(x, y, {epochs: 2});\n expectTensorsClose(\n model.layers[0].getWeights()[0],\n K.tile(tensor2d([[-0.03750037, 0, 1.7500007]], [1, 3]), [4, 1]));\n expectTensorsClose(\n model.layers[0].getWeights()[1],\n tensor2d([[-1.562513e-02, 0, 2.086183e-07]], [1, 3]));\n expectTensorsClose(\n model.layers[1].getWeights()[0], tensor2d([[1.2187521]], [1, 1]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // in1 = keras.Input(shape=[5])\n // out1 = keras.layers.Dense(2,\n // kernel_initializer='ones',\n // bias_initializer='zeros')(in1)\n // in2 = keras.Input(shape=[3, 4])\n // out2 = keras.layers.GRU(2,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(in2, initial_state=out1)\n // model = keras.Model(inputs=[in1, in2], outputs=[out1, out2])\n //\n // xs1 = np.array([[0.1, 0.2, 0.3, 0.4, 0.5]])\n // xs2 = np.array([[[0.1, 0.2, 0.3, 0.4], [-0.1, -0.2, -0.3, -0.4],\n // [0.3, 0.4, 0.5, 0.6]]])\n // print(model.predict([xs1, xs2]))\n // ```\n it('SymbolicTensor as initialState thru kwargs; Save & Load', async () => {\n const in1 = tfl.input({shape: [5]});\n const out1 =\n tfl.layers\n .dense(\n {units: 2, kernelInitializer: 'ones', biasInitializer: 'zeros'})\n .apply(in1) as tfl.SymbolicTensor;\n const in2 = tfl.input({shape: [3, 4]});\n const out2 = tfl.layers\n .gru({\n units: 2,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(in2, {initialState: out1}) as tfl.SymbolicTensor;\n\n const model = tfl.model({inputs: [in1, in2], outputs: [out1, out2]});\n\n const xs1 = tensor2d([[0.1, 0.2, 0.3, 0.4, 0.5]]);\n const xs2 = tensor3d([\n [[0.1, 0.2, 0.3, 0.4], [-0.1, -0.2, -0.3, -0.4], [0.3, 0.4, 0.5, 0.6]]\n ]);\n const ys = model.predict([xs1, xs2]) as Tensor[];\n expect(ys.length).toEqual(2);\n expectTensorsClose(ys[0], tensor2d([[1.5, 1.5]]));\n expectTensorsClose(ys[1], tensor2d([[1.4435408, 1.4435408]]));\n\n // NOTE: Here on down, i.e., the part that tests serialization and\n // deserialization of the model, has no counterpart in the Python\n // code snippet above.\n const modelJSON = model.toJSON(null, false);\n const modelPrime =\n await tfl.models.modelFromJSON({modelTopology: modelJSON});\n const ysPrime = modelPrime.predict([xs1, xs2]) as Tensor[];\n expect(ysPrime.length).toEqual(2);\n expectTensorsClose(ysPrime[0], ys[0]);\n expectTensorsClose(ysPrime[1], ys[1]);\n });\n});\n\ndescribeMathCPU('GRU-deserialization', () => {\n it('Default recurrentActivation round trip', () => {\n const x = randomNormal([1, 2, 3]);\n const layer = tfl.layers.gru({units: 4});\n const y = layer.apply(x) as Tensor;\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.gru(tsConfig);\n const yPrime = layer.apply(x) as Tensor;\n expectTensorsClose(yPrime, y);\n expect(layerPrime.getConfig()['recurrentActivation'])\n .toEqual(layer.getConfig()['recurrentActivation']);\n });\n\n it('Non-default recurrentActivation round trip', () => {\n const x = randomNormal([1, 2, 3]);\n const layer =\n tfl.layers.gru({units: 4, recurrentActivation: 'tanh'});\n const y = layer.apply(x) as Tensor;\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.gru(tsConfig);\n const yPrime = layer.apply(x) as Tensor;\n expectTensorsClose(yPrime, y);\n expect(layerPrime.getConfig()['recurrentActivation'])\n .toEqual(layer.getConfig()['recurrentActivation']);\n });\n});\n\ndescribeMathCPU('GRU Serialization', () => {\n const cellConfig: GRUCellLayerArgs = {\n units: 8,\n activation: 'tanh',\n recurrentActivation: 'tanh',\n useBias: true,\n kernelInitializer: 'glorotUniform',\n recurrentInitializer: 'heUniform',\n biasInitializer: 'ones',\n kernelRegularizer: 'l1l2',\n recurrentRegularizer: 'l1l2',\n biasRegularizer: 'l1l2',\n kernelConstraint: 'unitNorm',\n recurrentConstraint: 'unitNorm',\n biasConstraint: 'nonNeg',\n dropout: 0.1,\n recurrentDropout: 0.2,\n name: 'cell_1',\n batchSize: 12,\n batchInputShape: [12, 8, 8],\n inputShape: [8, 8],\n dtype: 'int32',\n inputDType: 'int32',\n trainable: true,\n implementation: 1,\n };\n\n const expectedCellConfigPrime = {\n name: 'cell_1',\n trainable: true,\n batchInputShape: [12, 8, 8],\n dtype: 'int32',\n units: 8,\n activation: serializeActivation(new Tanh()),\n recurrentActivation: serializeActivation(new Tanh()),\n useBias: true,\n kernelInitializer: serializeInitializer(new GlorotUniform()),\n recurrentInitializer: serializeInitializer(new HeUniform()),\n biasInitializer: serializeInitializer(new Ones()),\n kernelRegularizer: serializeRegularizer(new L1L2()),\n recurrentRegularizer: serializeRegularizer(new L1L2()),\n biasRegularizer: serializeRegularizer(new L1L2()),\n activityRegularizer: serializeRegularizer(null),\n kernelConstraint: serializeConstraint(new UnitNorm({})),\n recurrentConstraint: serializeConstraint(new UnitNorm({})),\n biasConstraint: serializeConstraint(new NonNeg()),\n implementation: 1,\n resetAfter: false,\n };\n\n describe('GRUCell.getConfig', () => {\n it('should return the expected values', () => {\n const cell = tfl.layers.gruCell(cellConfig);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual(expectedCellConfigPrime);\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n\n describe('GRU.getConfig', () => {\n it('should return the expected values', () => {\n const config: GRULayerArgs = {\n ...cellConfig,\n name: 'layer_1',\n ...{\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n inputDim: 8,\n inputLength: 8,\n } as Omit\n };\n\n const cell = tfl.layers.gru(config);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual({\n ...expectedCellConfigPrime,\n name: 'layer_1',\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n });\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n});\n\ndescribeMathCPU('LSTM Symbolic', () => {\n it('returnSequences=false, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const lstm = tfl.layers.lstm({units: 5});\n const output = lstm.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 5]);\n });\n\n it('returnSequences=false, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const lstm = tfl.layers.lstm({units: 5, returnState: true});\n const output = lstm.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(3);\n expect(output[0].shape).toEqual([9, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n expect(output[2].shape).toEqual([9, 5]);\n });\n\n it('returnSequences=true, returnState=false', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const lstm = tfl.layers.lstm({units: 5, returnSequences: true});\n const output = lstm.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([9, 10, 5]);\n });\n\n it('returnSequences=true, returnState=true', () => {\n const input = new tfl.SymbolicTensor('float32', [9, 10, 8], null, [], null);\n const lstm = tfl.layers.lstm({\n units: 5,\n returnSequences: true,\n returnState: true,\n });\n const output = lstm.apply(input) as tfl.SymbolicTensor[];\n expect(output.length).toEqual(3);\n expect(output[0].shape).toEqual([9, 10, 5]);\n expect(output[1].shape).toEqual([9, 5]);\n expect(output[2].shape).toEqual([9, 5]);\n });\n\n it('trainableWeights, nonTrainableWeights and weights give correct outputs',\n () => {\n const input =\n new tfl.SymbolicTensor('float32', [2, 3, 4], null, [], null);\n const lstm = tfl.layers.lstm({units: 5, returnState: true});\n lstm.apply(input);\n expect(lstm.trainable).toEqual(true);\n // Trainable weights: kernel, recurrent kernel and bias.\n expect(lstm.trainableWeights.length).toEqual(3);\n expect(lstm.nonTrainableWeights.length).toEqual(0);\n expect(lstm.weights.length).toEqual(3);\n });\n\n for (const implementation of [1, 2]) {\n it('Serialization round trip', () => {\n const layer = tfl.layers.lstm({units: 4, implementation});\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.lstm(tsConfig);\n expect(layerPrime.getConfig().units).toEqual(4);\n expect(layerPrime.getConfig().implementation).toEqual(implementation);\n });\n }\n\n it('LSTM Cells save and load', async () => {\n const inputShape = [2, 3];\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 1, inputShape}));\n const cells = [\n tfl.layers.lstmCell({units: 3}),\n tfl.layers.lstmCell({units: 4}),\n ];\n const rnn = tfl.layers.rnn({cell: cells, returnSequences: true});\n model.add(rnn);\n\n const numExamples = 5;\n const xs = randomNormal([numExamples].concat(inputShape));\n const ys = model.predict(xs) as Tensor;\n\n let savedArtifacts: io.ModelArtifacts;\n await model.save(tfc.io.withSaveHandler(async (artifacts) => {\n savedArtifacts = artifacts;\n return null;\n }));\n\n const loadedModel =\n await tfl.loadLayersModel(tfc.io.fromMemory(savedArtifacts));\n\n expect(model.inputs[0].shape).toEqual(loadedModel.inputs[0].shape);\n expect(model.outputs[0].shape).toEqual(loadedModel.outputs[0].shape);\n expectTensorsClose(loadedModel.predict(xs) as Tensor, ys);\n });\n\n it('Invalid units leads to Error', () => {\n expect(() => tfl.layers.lstm({\n units: 12.5\n })).toThrowError(/units.*positive integer.*12\\.5\\.$/);\n expect(() => tfl.layers.lstm({\n units: 0\n })).toThrowError(/units.*positive integer.*0\\.$/);\n expect(() => tfl.layers.lstm({\n units: -25\n })).toThrowError(/units.*positive integer.*-25\\.$/);\n });\n});\n\ndescribeMathCPUAndGPU('LSTM Tensor', () => {\n // Note:\n // The golden expected values used for assertions in these unit tests can be\n // obtained through running the Python code similar to the following\n // example. TensorFlow 1.5 was used to obtain the values.\n //\n // ```python\n // import numpy as np\n // import tensorflow as tf\n //\n // units = 5\n // batch_size = 4\n // input_size = 2\n // time_steps = 2\n //\n // with tf.Session() as sess:\n // lstm = tf.keras.layers.LSTM(units,\n // kernel_initializer=\"ones\",\n // recurrent_initializer=\"ones\",\n // bias_initializer=\"ones\",\n // return_sequences=True,\n // return_state=True,\n // unit_forget_bias=True)\n // inputs = tf.placeholder(tf.float32, shape=[None, None, input_size])\n // outputs = lstm(inputs)\n //\n // sess.run(tf.global_variables_initializer())\n // feed_inputs = np.ones([batch_size, time_steps, input_size])\n // print(sess.run(outputs, feed_dict={inputs: feed_inputs}))\n // ```\n\n const units = 5;\n const batchSize = 4;\n const inputSize = 2;\n const timeSteps = 2;\n\n // TODO(cais): Add test for the default recurrent initializer ('Orthogonal')\n // when it becomes available.\n\n const dropouts = [0.0, 0.1];\n const trainings = [true, false];\n for (const training of trainings) {\n for (const dropout of dropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, dropout=${dropout}`;\n it(testTitle, () => {\n const lstm = tfl.layers.lstm({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n dropout,\n implementation: 1\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(lstm.apply(input, kwargs) as Tensor);\n if (dropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(4 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const recurrentDropouts = [0.0, 0.1];\n for (const training of trainings) {\n for (const recurrentDropout of recurrentDropouts) {\n const testTitle =\n `returnSequences=false, returnState=false, useBias=true,` +\n ` ${training}, recurrentDropout=${recurrentDropout}`;\n it(testTitle, () => {\n const lstm = tfl.layers.lstm({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n recurrentDropout,\n implementation: 1\n });\n const kwargs: Kwargs = {};\n if (training) {\n kwargs['training'] = true;\n }\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n spyOn(tfc, 'dropout').and.callThrough();\n let numTensors = 0;\n for (let i = 0; i < 2; i++) {\n tfc.dispose(lstm.apply(input, kwargs) as Tensor);\n if (recurrentDropout !== 0.0 && training) {\n expect(tfc.dropout).toHaveBeenCalledTimes(4 * (i + 1));\n } else {\n expect(tfc.dropout).toHaveBeenCalledTimes(0);\n }\n if (i === 0) {\n numTensors = tfc.memory().numTensors;\n } else {\n expect(tfc.memory().numTensors).toEqual(numTensors);\n }\n }\n });\n }\n }\n\n const implementations: Array<(1 | 2)> = [1, 2];\n const returnStateValues = [false, true];\n const returnSequencesValues = [false, true];\n for (const implementation of implementations) {\n for (const returnState of returnStateValues) {\n for (const returnSequences of returnSequencesValues) {\n const testTitle = `implementation=${implementation}, ` +\n `returnSequences=${returnSequences}, ` +\n `returnState=${returnState}`;\n it(testTitle, () => {\n const lstm = tfl.layers.lstm({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n returnState,\n returnSequences,\n implementation\n });\n const input = tfc.ones([batchSize, timeSteps, inputSize]);\n let output = lstm.apply(input);\n\n // See comments at the beginning of this describe() block on how\n // these golden expected values can be obtained.\n const goldenOutputElementValueAtT0 = 0.7595095;\n const goldenOutputElementValueAtT1 = 0.96367633;\n const goldenHStateElementValue = goldenOutputElementValueAtT1;\n const goldenCStateElementValue = 1.99505234;\n\n let expectedOutput: Tensor;\n if (returnSequences) {\n const outputAtT0 = tfc.mul(\n scalar(goldenOutputElementValueAtT0),\n tfc.ones([1, batchSize, units]));\n const outputAtT1 = tfc.mul(\n scalar(goldenOutputElementValueAtT1),\n tfc.ones([1, batchSize, units]));\n expectedOutput = tfc.transpose(\n K.concatAlongFirstAxis(outputAtT0, outputAtT1), [1, 0, 2]);\n } else {\n expectedOutput = tfc.mul(\n scalar(goldenOutputElementValueAtT1),\n tfc.ones([batchSize, units]));\n }\n if (returnState) {\n output = output as Tensor[];\n expect(output.length).toEqual(3);\n expectTensorsClose(output[0], expectedOutput);\n expectTensorsClose(\n output[1],\n tfc.mul(\n scalar(goldenHStateElementValue),\n tfc.ones([batchSize, units])));\n expectTensorsClose(\n output[2],\n tfc.mul(\n scalar(goldenCStateElementValue),\n tfc.ones([batchSize, units])));\n } else {\n output = output as Tensor;\n expectTensorsClose(output, expectedOutput);\n }\n });\n }\n }\n\n // The reference values below can be obtained with PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // units = 5\n // batch_size = 4\n // input_size = 2\n // sequence_length = 3\n //\n // rnn = keras.layers.LSTM(units,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='ones',\n // stateful=True,\n // batch_input_shape=[batch_size,\n // sequence_length,\n // input_size])\n //\n // x = np.ones([batch_size, sequence_length, input_size])\n //\n // model = keras.Sequential()\n // model.add(rnn)\n // print(model.predict(x))\n // print(model.predict(x))\n // model.reset_states()\n // print(model.predict(x))\n // print(model.predict(x))\n // ```\n it('stateful forward', async () => {\n const sequenceLength = 3;\n const rnn = tfl.layers.lstm({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n });\n const model = tfl.sequential();\n model.add(rnn);\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n\n let y1 = model.predict(x) as Tensor;\n expect(y1.kept).toBe(false);\n let y1Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.995)));\n expectTensorsClose(y1, y1Expected);\n let y2 = model.predict(x) as Tensor;\n expect(y2.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y1.isDisposed).toBe(false);\n let y2Expected = tfc.tidy(\n () => tfc.ones([batchSize, units]).mul(tfc.scalar(0.99998766)));\n expectTensorsClose(y2, y2Expected);\n\n tfc.dispose([y1, y2, y1Expected, y2Expected]);\n model.resetStates();\n const numTensors0 = tfc.memory().numTensors;\n\n y1 = model.predict(x) as Tensor;\n expect(y1.kept).toBe(false);\n y1Expected =\n tfc.tidy(() => tfc.ones([batchSize, units]).mul(tfc.scalar(0.995)));\n expectTensorsClose(y1, y1Expected);\n y2 = model.predict(x) as Tensor;\n expect(y2.kept).toBe(false);\n // Future predicts should not dispose previous outputs.\n expect(y1.isDisposed).toBe(false);\n y2Expected = tfc.tidy(\n () => tfc.ones([batchSize, units]).mul(tfc.scalar(0.99998766)));\n expectTensorsClose(y2, y2Expected);\n tfc.dispose([y1, y2, y1Expected, y2Expected]);\n // Assert no memory leak, even without resetStates() being called.\n expect(tfc.memory().numTensors).toEqual(numTensors0);\n });\n\n // The reference values can be obtained with the following PyKeras code:\n // ```python\n // import keras\n // import numpy as np\n //\n // batch_size = 4\n // sequence_length = 3\n // input_size = 2\n //\n // model = keras.Sequential()\n // model.add(keras.layers.LSTM(\n // 5,\n // batch_input_shape=[batch_size, sequence_length, input_size],\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='ones',\n // stateful=True))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs_1 = np.ones([batch_size, sequence_length, input_size])\n // xs_2 = np.ones([batch_size, sequence_length, input_size])\n // xs = np.concatenate([xs_1, xs_2], 0)\n // ys = np.array([[1], [2], [3], [4], [5], [6], [7], [8]])\n //\n // history = model.fit(xs, ys, batch_size=batch_size, shuffle=False)\n // print(history.history)\n // ```\n it('stateful BPTT', async () => {\n const sequenceLength = 3;\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n stateful: true,\n batchInputShape: [batchSize, sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', useBias: false}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs1 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs2 = tfc.ones([batchSize, sequenceLength, inputSize]);\n const xs = tfc.concat([xs1, xs2], 0);\n const ys = tfc.tensor2d([[1], [2], [3], [4], [5], [6], [7], [8]]);\n\n const history = await model.fit(xs, ys, {batchSize, shuffle: false});\n // See code snippet above for the code used to obtain this loss value.\n expect(history.history.loss[0]).toBeCloseTo(5.8377);\n });\n\n it('BPTT', async () => {\n // The following golden values for assertion can be obtained with the\n // following Python Keras code.\n // ```python\n // import keras\n // import numpy as np\n //\n // sequence_length = 3\n // input_size = 4\n // batch_size = 5\n //\n // t_input = keras.Input([sequence_length, input_size])\n // lstm = keras.layers.LSTM(1,\n // kernel_initializer='zeros',\n // recurrent_initializer='zeros',\n // use_bias=False)\n // dense = keras.layers.Dense(1,\n // kernel_initializer='ones',\n // use_bias=False)\n // output = dense(lstm(t_input))\n // model = keras.Model(t_input, output)\n // optimizer = keras.optimizers.SGD(1)\n // model.compile(optimizer=optimizer, loss='mean_squared_error')\n //\n // x = np.ones([batch_size, sequence_length, input_size])\n // y = np.ones([batch_size, 1])\n // model.fit(x, y, batch_size=batch_size, epochs=2)\n // print(lstm.get_weights()[0])\n // print(lstm.get_weights()[1])\n // print(dense.get_weights()[0])\n // ```\n const sequenceLength = 3;\n const inputSize = 4;\n const batchSize = 5;\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units: 1,\n kernelInitializer: 'zeros',\n recurrentInitializer: 'zeros',\n useBias: false,\n inputShape: [sequenceLength, inputSize]\n }));\n model.add(tfl.layers.dense({\n units: 1,\n kernelInitializer: 'ones',\n useBias: false,\n }));\n\n const sgd = tfc.train.sgd(1);\n model.compile({loss: 'meanSquaredError', optimizer: sgd});\n\n const x = tfc.ones([batchSize, sequenceLength, inputSize]);\n const y = tfc.ones([batchSize, 1]);\n await model.fit(x, y, {epochs: 2});\n\n expectTensorsClose(\n model.layers[0].getWeights()[0],\n K.tile(\n tensor2d(\n [[0.11455188, 0.06545822, 0.8760446, 0.18237013]], [1, 4]),\n [4, 1]));\n expectTensorsClose(\n model.layers[0].getWeights()[1],\n tensor2d([[0.02831176, 0.01934617, 0.00025817, 0.05784169]], [1, 4]));\n expectTensorsClose(\n model.layers[1].getWeights()[0], tensor2d([[1.4559253]], [1, 1]));\n });\n }\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Embedding(10,\n // 4,\n // input_length=6,\n // mask_zero=True,\n // embeddings_initializer='ones'))\n // model.add(keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zero'))\n //\n // xs = np.array([[0, 0, 0, 0, 0, 0],\n // [1, 0, 0, 0, 0, 0],\n // [1, 2, 0, 0, 0, 0],\n // [1, 2, 3, 0, 0, 0]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('With mask', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 6,\n maskZero: true,\n embeddingsInitializer: 'ones'\n }));\n model.add(tfl.layers.lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n\n const xs = tensor2d([\n [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0],\n [1, 2, 3, 0, 0, 0]\n ]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(\n ys, tensor2d([[0], [2.283937], [2.891939], [2.9851441]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n //\n // model = keras.Sequential()\n // embedding_layer = keras.layers.Embedding(4,\n // 2,\n // input_length=3,\n // mask_zero=True)\n // model.add(embedding_layer)\n // lstm_layer = keras.layers.LSTM(2, go_backwards=True)\n // model.add(lstm_layer)\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zero'))\n //\n // embedding_layer.set_weights([\n // np.array([[0.1, 0.2], [0.3, 0.4], [-0.1, -0.2], [-0.3, -0.4]])])\n // print(lstm_layer.get_weights())\n // lstm_layer.set_weights([\n // np.array([[1, 2, 3, 4, 5, 6, 7, 8],\n // [-1, -2, -3, -4, -5, -6, -7, -8]]),\n // np.array([[1, 2, 3, 4, 5, 6, 7, 8],\n // [-1, -2, -3, -4, -5, -6, -7, -8]]),\n // np.array([1, 2, 3, 4, 5, 6, 7, 8])])\n //\n // xs = np.array([[0, 0, 0],\n // [1, 0, 0],\n // [1, 2, 0],\n // [1, 2, 3]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('With mask, goBackwards = true', () => {\n const model = tfl.sequential();\n const embeddingLayer = tfl.layers.embedding(\n {inputDim: 4, outputDim: 2, inputLength: 3, maskZero: true});\n model.add(embeddingLayer);\n const lstmLayer = tfl.layers.lstm({units: 2, goBackwards: true});\n model.add(lstmLayer);\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n\n // Setting weights to asymmetric, so that the effect of goBackwards=true\n // can show.\n embeddingLayer.setWeights(\n [tensor2d([[0.1, 0.2], [0.3, 0.4], [-0.1, -0.2], [-0.3, -0.4]])]);\n lstmLayer.setWeights([\n tensor2d([[1, 2, 3, 4, 5, 6, 7, 8], [-1, -2, -3, -4, -5, -6, -7, -8]]),\n tensor2d([[1, 2, 3, 4, 5, 6, 7, 8], [-1, -2, -3, -4, -5, -6, -7, -8]]),\n tensor1d([1, 2, 3, 4, 5, 6, 7, 8])\n ]);\n\n const xs = tensor2d([[0, 0, 0], [1, 0, 0], [1, 2, 0], [1, 2, 3]]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(\n ys, tensor2d([[0], [1.2876499], [1.8165315], [1.9599037]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Reshape(target_shape=[6], input_shape=[6]))\n // nested_model = keras.Sequential()\n // nested_model.add(keras.layers.Embedding(10,\n // 4,\n // input_length=6,\n // mask_zero=True,\n // embeddings_initializer='ones'))\n // nested_model.add(keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n // model.add(nested_model)\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zero'))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs = np.array([[0, 0, 0, 0, 0, 0],\n // [1, 0, 0, 0, 0, 0],\n // [1, 2, 0, 0, 0, 0],\n // [1, 2, 3, 0, 0, 0]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('With mask and a nested model', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.reshape(\n {targetShape: [6], inputShape: [6]})); // A dummy input layer.\n const nestedModel = tfl.sequential();\n nestedModel.add(tfl.layers.embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 6,\n maskZero: true,\n embeddingsInitializer: 'ones'\n }));\n nestedModel.add(tfl.layers.lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n model.add(nestedModel);\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n\n const xs = tensor2d([\n [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0],\n [1, 2, 3, 0, 0, 0]\n ]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(\n ys, tensor2d([[0], [2.283937], [2.891939], [2.9851441]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Embedding(10,\n // 4,\n // input_length=6,\n // mask_zero=True,\n // embeddings_initializer='ones'))\n // model.add(keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zero'))\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // xs = np.array([[0, 0, 0, 0, 0, 0],\n // [1, 0, 0, 0, 0, 0],\n // [1, 2, 0, 0, 0, 0],\n // [1, 2, 3, 0, 0, 0]])\n // ys = np.array([[1], [2], [3], [4]])\n //\n // model.fit(xs, ys, epochs=2, batch_size=4)\n // history = model.fit(xs, ys, epochs=2, batch_size=4)\n // print(history.history)\n // ```\n it('BPTT with mask: correctness and no leak', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 6,\n maskZero: true,\n embeddingsInitializer: 'ones'\n }));\n model.add(tfl.layers.lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const xs = tensor2d([\n [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0],\n [1, 2, 3, 0, 0, 0]\n ]);\n const ys = tensor2d([[1], [2], [3], [4]]);\n\n // Serves as burn-in call for subsequent tracking of memory leak.\n await model.fit(xs, ys, {epochs: 2, batchSize: 4});\n\n const numTensors0 = tfc.memory().numTensors;\n const history = await model.fit(xs, ys, {epochs: 2, batchSize: 4});\n const numTensors1 = tfc.memory().numTensors;\n // Assert no memory leak.\n expect(numTensors1).toEqual(numTensors0);\n expect(history.history.loss.length).toEqual(2);\n expect(history.history.loss[0]).toBeCloseTo(0.503677);\n expect(history.history.loss[1]).toBeCloseTo(0.492173);\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // inp = keras.Input(shape=[6])\n // y = keras.layers.Embedding(10,\n // 4,\n // input_length=6,\n // mask_zero=True,\n // embeddings_initializer='ones')(inp)\n // y = keras.layers.LSTM(3,\n // return_state=True,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y)\n //\n // model = keras.Model(inputs=inp, outputs=y)\n //\n // xs = np.array([[0, 0, 0, 0, 0, 0],\n // [1, 0, 0, 0, 0, 0],\n // [1, 2, 0, 0, 0, 0],\n // [1, 2, 3, 0, 0, 0]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('With mask, returnStates = true', () => {\n const inp = tfl.input({shape: [6]});\n let y: tfl.SymbolicTensor|tfl.SymbolicTensor[] =\n tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 6,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(inp) as tfl.SymbolicTensor;\n y = tfl.layers\n .lstm({\n units: 3,\n returnState: true,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y) as tfl.SymbolicTensor[];\n const model = tfl.model({inputs: inp, outputs: y});\n const xs = tensor2d([\n [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0],\n [1, 2, 3, 0, 0, 0]\n ]);\n const ys = model.predict(xs) as Tensor[];\n expect(ys.length).toEqual(3);\n expectTensorsClose(ys[0], tensor2d([\n [0, 0, 0], [0.76131237, 0.76131237, 0.76131237],\n [0.9639796, 0.9639796, 0.9639796],\n [0.99504817, 0.99504817, 0.99504817]\n ]));\n expectTensorsClose(ys[1], tensor2d([\n [0, 0, 0], [0.76131237, 0.76131237, 0.76131237],\n [0.9639796, 0.9639796, 0.9639796],\n [0.99504817, 0.99504817, 0.99504817]\n ]));\n expectTensorsClose(\n ys[2], tensor2d([\n [0, 0, 0], [0.9993292, 0.9993292, 0.9993292],\n [1.9993222, 1.9993222, 1.9993222], [2.9993203, 2.9993203, 2.9993203]\n ]));\n });\n\n // Referernce Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Embedding(10,\n // 4,\n // input_length=3,\n // mask_zero=True,\n // embeddings_initializer='ones'))\n // model.add(keras.layers.LSTM(3,\n // return_sequences=True,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n // model.add(keras.layers.Dense(1,\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n //\n // xs = np.array([[0, 0, 0],\n // [1, 0, 0],\n // [1, 2, 0],\n // [1, 2, 3]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('With mask, returnSequences = true', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 3,\n maskZero: true,\n embeddingsInitializer: 'ones'\n }));\n model.add(tfl.layers.lstm({\n units: 3,\n returnSequences: true,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n model.add(tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'zeros'}));\n\n const xs = tensor2d([[0, 0, 0], [1, 0, 0], [1, 2, 0], [1, 2, 3]]);\n const ys = model.predict(xs) as Tensor;\n expectTensorsClose(ys, tensor3d([\n [[0], [0], [0]], [[2.283937], [2.283937], [2.283937]],\n [[2.283937], [2.8919387], [2.8919387]],\n [[2.283937], [2.8919387], [2.9851446]]\n ]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model = keras.Sequential()\n // model.add(keras.layers.Embedding(10,\n // 4,\n // input_length=3,\n // mask_zero=True,\n // embeddings_initializer='ones'))\n // model.add(keras.layers.SimpleRNN(3,\n // return_sequences=True,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n // model.add(keras.layers.LSTM(3,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros'))\n //\n // xs = np.array([[0, 0, 0],\n // [1, 0, 0],\n // [1, 2, 0],\n // [1, 2, 3]])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('Stacked RNNs with masking: correctness and no leak', () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputDim: 10,\n outputDim: 4,\n inputLength: 3,\n maskZero: true,\n embeddingsInitializer: 'ones'\n }));\n model.add(tfl.layers.simpleRNN({\n units: 3,\n returnSequences: true,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n model.add(tfl.layers.lstm({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n }));\n\n const xs = tensor2d([[0, 0, 0], [1, 0, 0], [1, 2, 0], [1, 2, 3]]);\n\n // Burn-in call for subsequent memory leak check.\n model.predict(xs);\n\n const numTensors0 = tfc.memory().numTensors;\n const ys = model.predict(xs) as Tensor;\n const numTensors1 = tfc.memory().numTensors;\n expectTensorsClose(ys, tensor2d([\n [0, 0, 0], [0.75950104, 0.75950104, 0.75950104],\n [0.96367145, 0.96367145, 0.96367145],\n [0.9950049, 0.9950049, 0.9950049]\n ]));\n ys.dispose();\n // Assert no memory leak.\n expect(numTensors1).toEqual(numTensors0 + 1);\n });\n});\n\ndescribeMathCPU('LSTM-deserialization', () => {\n it('modelFromConfig', async () => {\n const model = await modelFromJSON(fakeLSTMModel);\n const encoderInputs = tfc.zeros([1, 3, 71], 'float32');\n const decoderInputs = tfc.zeros([1, 3, 94], 'float32');\n const outputs = model.predict([encoderInputs, decoderInputs]) as Tensor;\n expect(outputs.shape).toEqual([1, 3, 94]);\n });\n\n it('Default recurrentActivation round trip', () => {\n const x = randomNormal([1, 2, 3]);\n const layer = tfl.layers.lstm({units: 4});\n const y = layer.apply(x) as Tensor;\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.lstm(tsConfig);\n const yPrime = layer.apply(x) as Tensor;\n expectTensorsClose(yPrime, y);\n expect(layerPrime.getConfig()['recurrentActivation'])\n .toEqual(layer.getConfig()['recurrentActivation']);\n });\n\n it('Non-default recurrentActivation round trip', () => {\n const x = randomNormal([1, 2, 3]);\n const layer =\n tfl.layers.lstm({units: 4, recurrentActivation: 'tanh'});\n const y = layer.apply(x) as Tensor;\n const pythonicConfig = convertTsToPythonic(layer.getConfig());\n // tslint:disable-next-line:no-any\n const tsConfig = convertPythonicToTs(pythonicConfig) as any;\n const layerPrime = tfl.layers.lstm(tsConfig);\n const yPrime = layer.apply(x) as Tensor;\n expectTensorsClose(yPrime, y);\n expect(layerPrime.getConfig()['recurrentActivation'])\n .toEqual(layer.getConfig()['recurrentActivation']);\n });\n});\n\nconst fakeLSTMModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'class_name': 'Model',\n 'keras_version': '2.1.2',\n 'config': {\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, null, 71],\n 'name': 'input_1',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_1'\n },\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, null, 94],\n 'name': 'input_2',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_2'\n },\n {\n 'class_name': 'LSTM',\n 'config': {\n 'recurrent_activation': 'hard_sigmoid',\n 'trainable': true,\n 'recurrent_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'use_bias': true,\n 'bias_regularizer': null,\n 'return_state': true,\n 'unroll': false,\n 'activation': 'tanh',\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 256,\n 'unit_forget_bias': true,\n 'activity_regularizer': null,\n 'recurrent_dropout': 0.0,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'kernel_constraint': null,\n 'dropout': 0.0,\n 'stateful': false,\n 'recurrent_regularizer': null,\n 'name': 'lstm_1',\n 'bias_constraint': null,\n 'go_backwards': false,\n 'implementation': 1,\n 'kernel_regularizer': null,\n 'return_sequences': false,\n 'recurrent_constraint': null\n },\n 'inbound_nodes': [[['input_1', 0, 0, {}]]],\n 'name': 'lstm_1'\n },\n {\n 'class_name': 'LSTM',\n 'config': {\n 'recurrent_activation': 'hard_sigmoid',\n 'trainable': true,\n 'recurrent_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'use_bias': true,\n 'bias_regularizer': null,\n 'return_state': true,\n 'unroll': false,\n 'activation': 'tanh',\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 256,\n 'unit_forget_bias': true,\n 'activity_regularizer': null,\n 'recurrent_dropout': 0.0,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'kernel_constraint': null,\n 'dropout': 0.0,\n 'stateful': false,\n 'recurrent_regularizer': null,\n 'name': 'lstm_2',\n 'bias_constraint': null,\n 'go_backwards': false,\n 'implementation': 1,\n 'kernel_regularizer': null,\n 'return_sequences': true,\n 'recurrent_constraint': null\n },\n 'inbound_nodes': [\n [['input_2', 0, 0, {}], ['lstm_1', 0, 1, {}], ['lstm_1', 0, 2, {}]]\n ],\n 'name': 'lstm_2'\n },\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'activation': 'softmax',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 94,\n 'use_bias': true,\n 'activity_regularizer': null\n },\n 'inbound_nodes': [[['lstm_2', 0, 0, {}]]],\n 'name': 'dense_1'\n }\n ],\n 'input_layers': [['input_1', 0, 0], ['input_2', 0, 0]],\n 'output_layers': [['dense_1', 0, 0]],\n 'name': 'model_1'\n },\n 'backend': 'tensorflow'\n }\n};\n\ndescribeMathCPU('LSTM Serialization', () => {\n const cellConfig: LSTMCellLayerArgs = {\n units: 8,\n activation: 'tanh',\n recurrentActivation: 'tanh',\n useBias: true,\n kernelInitializer: 'glorotUniform',\n recurrentInitializer: 'heUniform',\n biasInitializer: 'ones',\n kernelRegularizer: 'l1l2',\n recurrentRegularizer: 'l1l2',\n biasRegularizer: 'l1l2',\n kernelConstraint: 'unitNorm',\n recurrentConstraint: 'unitNorm',\n biasConstraint: 'nonNeg',\n dropout: 0.1,\n recurrentDropout: 0.2,\n name: 'cell_1',\n batchSize: 12,\n batchInputShape: [12, 8, 8],\n inputShape: [8, 8],\n dtype: 'int32',\n inputDType: 'int32',\n trainable: true,\n implementation: 1,\n unitForgetBias: true,\n };\n\n const expectedCellConfigPrime = {\n name: 'cell_1',\n trainable: true,\n batchInputShape: [12, 8, 8],\n dtype: 'int32',\n units: 8,\n activation: serializeActivation(new Tanh()),\n recurrentActivation: serializeActivation(new Tanh()),\n useBias: true,\n kernelInitializer: serializeInitializer(new GlorotUniform()),\n recurrentInitializer: serializeInitializer(new HeUniform()),\n biasInitializer: serializeInitializer(new Ones()),\n kernelRegularizer: serializeRegularizer(new L1L2()),\n recurrentRegularizer: serializeRegularizer(new L1L2()),\n biasRegularizer: serializeRegularizer(new L1L2()),\n activityRegularizer: serializeRegularizer(null),\n kernelConstraint: serializeConstraint(new UnitNorm({})),\n recurrentConstraint: serializeConstraint(new UnitNorm({})),\n biasConstraint: serializeConstraint(new NonNeg()),\n implementation: 1,\n unitForgetBias: true,\n };\n\n describe('LSTMCell.getConfig', () => {\n it('should return the expected values', () => {\n const cell = tfl.layers.lstmCell(cellConfig);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual(expectedCellConfigPrime);\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n\n describe('LSTM.getConfig', () => {\n it('should return the expected values', () => {\n const config: LSTMLayerArgs = {\n ...cellConfig,\n name: 'layer_1',\n ...{\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n inputDim: 8,\n inputLength: 8,\n } as Omit\n };\n\n const cell = tfl.layers.lstm(config);\n\n const {dropout, recurrentDropout, ...configPrime} = cell.getConfig();\n\n expect(configPrime).toEqual({\n ...expectedCellConfigPrime,\n name: 'layer_1',\n returnSequences: true,\n returnState: true,\n stateful: true,\n unroll: true,\n goBackwards: true,\n });\n expect(dropout).toBeCloseTo(0.1);\n expect(recurrentDropout).toBeCloseTo(0.2);\n });\n });\n});\n\ndescribeMathCPU('StackedRNNCells Symbolic', () => {\n it('With SimpleRNNCell', () => {\n const stackedRNN = tfl.layers.rnn({\n cell: tfl.layers.stackedRNNCells({\n cells: [\n tfl.layers.simpleRNNCell(\n {units: 3, recurrentInitializer: 'glorotNormal'}),\n tfl.layers.simpleRNNCell(\n {units: 2, recurrentInitializer: 'glorotNormal'})\n ],\n })\n });\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 7], null, [], null);\n const output = stackedRNN.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([16, 2]);\n\n // 3 trainable weights from each cell.\n expect(stackedRNN.trainableWeights.length).toEqual(6);\n expect(stackedRNN.nonTrainableWeights.length).toEqual(0);\n // Kernel, recurrent kernel and bias of 1st cell.\n expect(stackedRNN.getWeights()[0].shape).toEqual([7, 3]);\n expect(stackedRNN.getWeights()[1].shape).toEqual([3, 3]);\n expect(stackedRNN.getWeights()[2].shape).toEqual([3]);\n // Kernel, recurrent kernel and bias of 2nd cell.\n expect(stackedRNN.getWeights()[3].shape).toEqual([3, 2]);\n expect(stackedRNN.getWeights()[4].shape).toEqual([2, 2]);\n expect(stackedRNN.getWeights()[5].shape).toEqual([2]);\n });\n\n it('With LSTMCell', () => {\n const stackedRNN = tfl.layers.rnn({\n cell: tfl.layers.stackedRNNCells({\n cells: [\n tfl.layers.lstmCell({units: 3, recurrentInitializer: 'glorotNormal'}),\n tfl.layers.lstmCell({units: 2, recurrentInitializer: 'glorotNormal'})\n ],\n })\n });\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 7], null, [], null);\n const output = stackedRNN.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([16, 2]);\n\n // 3 trainable weights from each cell.\n expect(stackedRNN.trainableWeights.length).toEqual(6);\n expect(stackedRNN.nonTrainableWeights.length).toEqual(0);\n // Kernel, recurrent kernel and bias of 1st cell.\n expect(stackedRNN.getWeights()[0].shape).toEqual([7, 12]);\n expect(stackedRNN.getWeights()[1].shape).toEqual([3, 12]);\n expect(stackedRNN.getWeights()[2].shape).toEqual([12]);\n // expect(stackedRNN.getWeights()[2].shape).toEqual([3]);\n // Kernel, recurrent kernel and bias of 2nd cell.\n expect(stackedRNN.getWeights()[3].shape).toEqual([3, 8]);\n expect(stackedRNN.getWeights()[4].shape).toEqual([2, 8]);\n expect(stackedRNN.getWeights()[5].shape).toEqual([8]);\n });\n\n it('RNN with cell array creates StackedRNNCell', () => {\n const stackedRNN = tfl.layers.rnn({\n cell: [\n tfl.layers.gruCell({units: 3, recurrentInitializer: 'glorotNormal'}),\n tfl.layers.gruCell({units: 2, recurrentInitializer: 'glorotNormal'}),\n ],\n });\n const input =\n new tfl.SymbolicTensor('float32', [16, 10, 7], null, [], null);\n const output = stackedRNN.apply(input) as tfl.SymbolicTensor;\n expect(output.shape).toEqual([16, 2]);\n\n // 3 trainable weights from each cell.\n expect(stackedRNN.trainableWeights.length).toEqual(6);\n expect(stackedRNN.nonTrainableWeights.length).toEqual(0);\n // Kernel, recurrent kernel and bias of 1st cell.\n expect(stackedRNN.getWeights()[0].shape).toEqual([7, 9]);\n expect(stackedRNN.getWeights()[1].shape).toEqual([3, 9]);\n expect(stackedRNN.getWeights()[2].shape).toEqual([9]);\n // expect(stackedRNN.getWeights()[2].shape).toEqual([3]);\n // Kernel, recurrent kernel and bias of 2nd cell.\n expect(stackedRNN.getWeights()[3].shape).toEqual([3, 6]);\n expect(stackedRNN.getWeights()[4].shape).toEqual([2, 6]);\n expect(stackedRNN.getWeights()[5].shape).toEqual([6]);\n });\n});\n\ndescribeMathCPU('Stacked RNN serialization', () => {\n it('StackedRNNCells', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense(\n {units: 1, inputShape: [3, 4], kernelInitializer: 'ones'}));\n const cells = [\n tfl.layers.lstmCell(\n {units: 5, kernelInitializer: 'ones', recurrentInitializer: 'ones'}),\n tfl.layers.lstmCell(\n {units: 6, kernelInitializer: 'ones', recurrentInitializer: 'ones'})\n ];\n const rnn = tfl.layers.rnn({cell: cells, returnSequences: true});\n model.add(rnn);\n const xs = tfc.ones([1, 3, 4]).mul(0.1);\n const ys = model.predict(xs) as Tensor;\n\n const modelJSON = model.toJSON(null, false);\n const modelPrime =\n await tfl.models.modelFromJSON({modelTopology: modelJSON});\n const ysPrime = modelPrime.predict(xs) as Tensor;\n expectTensorsClose(ysPrime, ys);\n });\n});\n\ndescribeMathGPU('StackedRNNCells Tensor', () => {\n // The golden values for assertion below can be obtained with the following\n // Python Keras code:\n //\n // ```python\n // import keras\n // import numpy as np\n //\n // stacked_rnn = keras.layers.RNN(\n // [\n // keras.layers.SimpleRNNCell(\n // 3,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // use_bias=False),\n // keras.layers.GRUCell(\n // 2,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // use_bias=False),\n // keras.layers.LSTMCell(\n // 1,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // use_bias=False),\n // ])\n //\n // t_input = keras.layers.Input(batch_shape=(2, 3, 4))\n // t_output = stacked_rnn(t_input)\n // print(t_input.shape)\n // print(t_output.shape)\n //\n // model = keras.Model(t_input, t_output)\n //\n // input_val = np.array([\n // [\n // [0.1, -0.1, 0.2, -0.2], [-0.1, 0.1, -0.2, 0.2],\n // [0.1, 0.1, -0.2, -0.2]\n // ],\n // [\n // [0.05, -0.05, 0.1, -0.1], [-0.05, 0.05, -0.1, 0.1],\n // [0.05, 0.05, -0.1, -0.1]\n // ]\n // ])\n // print(model.predict(input_val))\n // ```\n it('Forward pass', () => {\n const stackedRNN = tfl.layers.rnn({\n cell: tfl.layers.stackedRNNCells({\n cells: [\n tfl.layers.simpleRNNCell({\n units: 3,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n useBias: false\n }),\n tfl.layers.gruCell({\n units: 2,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n useBias: false\n }),\n tfl.layers.lstmCell({\n units: 1,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n useBias: false\n }),\n ],\n })\n });\n const input = tensor3d(\n [\n [\n [0.1, -0.1, 0.2, -0.2], [-0.1, 0.1, -0.2, 0.2],\n [0.1, 0.1, -0.2, -0.2]\n ],\n [\n [0.05, -0.05, 0.1, -0.1], [-0.05, 0.05, -0.1, 0.1],\n [0.05, 0.05, -0.1, -0.1]\n ]\n ],\n [2, 3, 4]);\n const output = stackedRNN.apply(input) as Tensor;\n expectTensorsClose(\n output, tensor2d([[-0.07715216], [-0.05906887]], [2, 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-layers/dist/layers/serialization.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts deleted file mode 100644 index b968a5f60..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization } from '@tensorflow/tfjs-core'; -/** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ -export declare function deserialize(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict, fastWeightInit?: boolean): serialization.Serializable; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js deleted file mode 100644 index d9112fbff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original Source layers/__init__.py */ -import { serialization } from '@tensorflow/tfjs-core'; -import { deserializeKerasObject } from '../utils/generic_utils'; -/** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ -export function deserialize(config, customObjects = {}, fastWeightInit = false) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer', fastWeightInit); -} -//# sourceMappingURL=serialization.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-layers/dist/layers/serialization.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map deleted file mode 100644 index 5245f7ef5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../src/layers/serialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wCAAwC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACvB,MAAgC,EAChC,gBAAgB,EAA8B,EAC9C,cAAc,GAAG,KAAK;IACxB,OAAO,sBAAsB,CACzB,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\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-layers/dist/layers/serialization_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map deleted file mode 100644 index 92d0322c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialization_test.js","sourceRoot":"","sources":["../../src/layers/serialization_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAc,IAAI,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;QAC9B,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;QACnB,MAAM,WAAW,GAAU,WAAW,CAAC,MAAM,CAAgB,CAAC;QAC9D,MAAM,CAAC,WAAW,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;QAC7B,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;QACnB,MAAM,WAAW,GAAS,WAAW,CAAC,MAAM,CAAgB,CAAC;QAC7D,MAAM,CAAC,WAAW,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {Initializer, Ones, Zeros} from '../initializers';\nimport {deserialize} from './serialization';\n\ndescribe('Deserialization', () => {\n it('Zeros Initialzer', () => {\n const config: serialization.ConfigDict = {};\n config['className'] = 'Zeros';\n config.config = {};\n const initializer: Zeros = deserialize(config) as Initializer;\n expect(initializer instanceof (Zeros)).toEqual(true);\n });\n it('Ones Initialzer', () => {\n const config: serialization.ConfigDict = {};\n config['className'] = 'Ones';\n config.config = {};\n const initializer: Ones = deserialize(config) as Initializer;\n expect(initializer instanceof (Ones)).toEqual(true);\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-layers/dist/layers/wrappers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts deleted file mode 100644 index 2a451243d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization, Tensor } from '@tensorflow/tfjs-core'; -import { Layer, LayerArgs, SymbolicTensor } from '../engine/topology'; -import { BidirectionalMergeMode, Shape } from '../keras_format/common'; -import { Kwargs } from '../types'; -import { RegularizerFn } from '../types'; -import { LayerVariable } from '../variables'; -import { RNN } from './recurrent'; -export declare interface WrapperLayerArgs extends LayerArgs { - /** - * The layer to be wrapped. - */ - layer: Layer; -} -/** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ -export declare abstract class Wrapper extends Layer { - readonly layer: Layer; - constructor(args: WrapperLayerArgs); - build(inputShape: Shape | Shape[]): void; - trainable: boolean; - readonly trainableWeights: LayerVariable[]; - readonly nonTrainableWeights: LayerVariable[]; - readonly updates: Tensor[]; - readonly losses: RegularizerFn[]; - getWeights(): Tensor[]; - setWeights(weights: Tensor[]): void; - getConfig(): serialization.ConfigDict; - setFastWeightInitDuringBuild(value: boolean): void; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): T; -} -export declare class TimeDistributed extends Wrapper { - /** @nocollapse */ - static className: string; - constructor(args: WrapperLayerArgs); - build(inputShape: Shape | Shape[]): void; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; -} -export declare function checkBidirectionalMergeMode(value?: string): void; -export declare interface BidirectionalLayerArgs extends WrapperLayerArgs { - /** - * The instance of an `RNN` layer to be wrapped. - */ - layer: RNN; - /** - * Mode by which outputs of the forward and backward RNNs are - * combined. If `null` or `undefined`, the output will not be - * combined, they will be returned as an `Array`. - * - * If `undefined` (i.e., not provided), defaults to `'concat'`. - */ - mergeMode?: BidirectionalMergeMode; -} -export declare class Bidirectional extends Wrapper { - /** @nocollapse */ - static className: string; - mergeMode: BidirectionalMergeMode; - private forwardLayer; - private backwardLayer; - private returnSequences; - private returnState; - private numConstants?; - private _trainable; - constructor(args: BidirectionalLayerArgs); - trainable: boolean; - getWeights(): Tensor[]; - setWeights(weights: Tensor[]): void; - computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; - apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - resetStates(states?: Tensor | Tensor[]): void; - build(inputShape: Shape | Shape[]): void; - computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; - readonly trainableWeights: LayerVariable[]; - readonly nonTrainableWeights: LayerVariable[]; - setFastWeightInitDuringBuild(value: boolean): void; - getConfig(): serialization.ConfigDict; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js deleted file mode 100644 index 33662a13c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js +++ /dev/null @@ -1,484 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Layers that augment the functionality of a base layer. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { serialization, tidy } from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import { nameScope } from '../common'; -import { InputSpec, Layer, SymbolicTensor } from '../engine/topology'; -import { NotImplementedError, ValueError } from '../errors'; -import { VALID_BIDIRECTIONAL_MERGE_MODES } from '../keras_format/common'; -import * as generic_utils from '../utils/generic_utils'; -import { getExactlyOneShape, getExactlyOneTensor } from '../utils/types_utils'; -import { rnn, standardizeArgs } from './recurrent'; -import { deserialize } from './serialization'; -/** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ -export class Wrapper extends Layer { - constructor(args) { - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - super(args); - this.layer = args.layer; - } - build(inputShape) { - this.built = true; - } - // TODO(cais): Implement activityRegularizer getter. - get trainable() { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } - else { - return false; - } - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - } - get trainableWeights() { - return this.layer.trainableWeights; - } - // TODO(cais): Implement setter for trainableWeights. - get nonTrainableWeights() { - return this.layer.nonTrainableWeights; - } - // TODO(cais): Implement setter for nonTrainableWeights. - get updates() { - // tslint:disable-next-line:no-any - return this.layer._updates; - } - // TODO(cais): Implement getUpdatesFor(). - get losses() { - return this.layer.losses; - } - // TODO(cais): Implement getLossesFor(). - getWeights() { - return this.layer.getWeights(); - } - setWeights(weights) { - this.layer.setWeights(weights); - } - getConfig() { - const config = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const layerConfig = config['layer']; - const layer = deserialize(layerConfig, customObjects); - delete config['layer']; - const newConfig = { layer }; - Object.assign(newConfig, config); - return new cls(newConfig); - } -} -export class TimeDistributed extends Wrapper { - constructor(args) { - super(args); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError(`TimeDistributed layer expects an input shape >= 3D, but received ` + - `input shape ${JSON.stringify(inputShape)}`); - } - this.inputSpec = [{ shape: inputShape }]; - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - super.build(inputShape); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - const childOutputShape = this.layer.computeOutputShape(childInputShape); - const timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - } - call(inputs, kwargs) { - return tidy(() => { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - const step = (inputs, states) => { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - const output = getExactlyOneTensor(this.layer.call(inputs, kwargs)); - return [output, []]; - }; - const rnnOutputs = rnn(step, inputs, [], false /* goBackwards */, null /* mask */, null /* constants */, false /* unroll */, true /* needPerStepOutputs */); - const y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - } -} -/** @nocollapse */ -TimeDistributed.className = 'TimeDistributed'; -serialization.registerClass(TimeDistributed); -export function checkBidirectionalMergeMode(value) { - generic_utils.checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); -} -const DEFAULT_BIDIRECTIONAL_MERGE_MODE = 'concat'; -export class Bidirectional extends Wrapper { - constructor(args) { - super(args); - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - const layerConfig = args.layer.getConfig(); - const forwDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - this.forwardLayer = deserialize(forwDict); - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - const backDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - this.backwardLayer = deserialize(backDict); - this.forwardLayer.name = 'forward_' + this.forwardLayer.name; - this.backwardLayer.name = 'backward_' + this.backwardLayer.name; - this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(this.mergeMode); - if (args.weights) { - throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); - } - this._stateful = args.layer.stateful; - this.returnSequences = args.layer.returnSequences; - this.returnState = args.layer.returnState; - this.supportsMasking = true; - this._trainable = true; - this.inputSpec = args.layer.inputSpec; - this.numConstants = null; - } - get trainable() { - return this._trainable; - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - } - getWeights() { - return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); - } - setWeights(weights) { - const numWeights = weights.length; - const numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - } - computeOutputShape(inputShape) { - let layerShapes = this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes]; - } - layerShapes = layerShapes; - let outputShape; - let outputShapes; - let stateShape; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } - else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } - else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } - else { - outputShapes = [outputShape]; - } - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return generic_utils.singletonOrArray(outputShapes); - } - apply(inputs, kwargs) { - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - if (Array.isArray(inputs)) { - initialState = inputs.slice(1); - inputs = inputs[0]; - } - if ((initialState == null || initialState.length === 0) && - constants == null) { - return super.apply(inputs, kwargs); - } - const additionalInputs = []; - const additionalSpecs = []; - if (initialState != null) { - const numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push(...initialState); - const stateSpecs = initialState - .map(state => new InputSpec({ shape: state.shape })); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push(...stateSpecs); - } - if (constants != null) { - throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (const tensor of additionalInputs) { - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError('The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - call(inputs, kwargs) { - return tidy(() => { - const initialState = kwargs['initialState']; - let y; - let yRev; - if (initialState == null) { - y = this.forwardLayer.call(inputs, kwargs); - yRev = this.backwardLayer.call(inputs, kwargs); - } - else { - const forwardState = initialState.slice(0, initialState.length / 2); - const backwardState = initialState.slice(initialState.length / 2); - y = this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); - yRev = this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); - } - let states; - if (this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat(yRev.slice(1)); - } - else { - } - y = y[0]; - yRev = yRev[0]; - } - if (this.returnSequences) { - yRev = tfc.reverse(yRev, 1); - } - let output; - if (this.mergeMode === 'concat') { - output = K.concatenate([y, yRev]); - } - else if (this.mergeMode === 'sum') { - output = tfc.add(y, yRev); - } - else if (this.mergeMode === 'ave') { - output = tfc.mul(.5, tfc.add(y, yRev)); - } - else if (this.mergeMode === 'mul') { - output = tfc.mul(y, yRev); - } - else if (this.mergeMode == null) { - output = [y, yRev]; - } - // TODO(cais): Properly set learning phase. - if (this.returnState) { - if (this.mergeMode == null) { - return output.concat(states); - } - return [output].concat(states); - } - return output; - }); - } - resetStates(states) { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - } - build(inputShape) { - nameScope(this.forwardLayer.name, () => { - this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, () => { - this.backwardLayer.build(inputShape); - }); - this.built = true; - } - computeMask(inputs, mask) { - if (Array.isArray(mask)) { - mask = mask[0]; - } - let outputMask; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } - else { - outputMask = mask; - } - } - else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } - else { - outputMask = null; - } - } - if (this.returnState) { - const states = this.forwardLayer.states; - const stateMask = states.map(state => null); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } - else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } - else { - return outputMask; - } - } - get trainableWeights() { - return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); - } - get nonTrainableWeights() { - return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); - } - // TODO(cais): Implement constraints(). - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const config = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - /** @nocollapse */ - static fromConfig(cls, config) { - const rnnLayer = deserialize(config['layer']); - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError(`Deserialization of a Bidirectional layer with numConstants ` + - `present is not supported yet.`); - } - // tslint:disable-next-line:no-any - const newConfig = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - } -} -/** @nocollapse */ -Bidirectional.className = 'Bidirectional'; -serialization.registerClass(Bidirectional); -//# sourceMappingURL=wrappers.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-layers/dist/layers/wrappers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map deleted file mode 100644 index cad78d542..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src/layers/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,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IAC5B,CAAC;;AA/VD,kBAAkB;AACX,uBAAS,GAAG,eAAe,CAAC;AAgWrC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map deleted file mode 100644 index e44fc74c7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers_test.js","sourceRoot":"","sources":["../../src/layers/wrappers_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,IAAI,EAAE,MAAM,EAAyB,QAAQ,EAAY,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAIxG,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAyB,+BAA+B,EAAC,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAC,mBAAmB,EAAC,MA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AI,YAAY,CAAC,IAAI,KAAK,WAAW,EAAE;gBAC5C,kBAAkB,CACd,OAAO,CAAC,OAAO,CAAC,MAAM,CAAa,EACnC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;aAC/C;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC;YACZ,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for wrapper layers.\n */\n\nimport {ones, scalar, serialization, Tensor, tensor2d, Tensor3D, tensor3d} from '@tensorflow/tfjs-core';\n\nimport {Layer, SymbolicTensor} from '../engine/topology';\nimport {LayersModel} from '../engine/training';\nimport * as tfl from '../index';\nimport {BidirectionalMergeMode, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from '../utils/test_utils';\n\nimport {Dense, Reshape} from './core';\nimport {RNN, SimpleRNN} from './recurrent';\nimport {deserialize} from './serialization';\nimport {Bidirectional, checkBidirectionalMergeMode, TimeDistributed} from './wrappers';\n\ndescribeMathCPU('TimeDistributed Layer: Symbolic', () => {\n it('3D input: Dense', () => {\n const input = new tfl.SymbolicTensor('float32', [10, 8, 2], null, [], null);\n const wrapper = tfl.layers.timeDistributed({layer: new Dense({units: 3})});\n const output = wrapper.apply(input) as tfl.SymbolicTensor;\n expect(wrapper.trainable).toEqual(true);\n expect(wrapper.getWeights().length).toEqual(2); // kernel and bias.\n expect(output.dtype).toEqual(input.dtype);\n expect(output.shape).toEqual([10, 8, 3]);\n });\n it('4D input: Reshape', () => {\n const input =\n new tfl.SymbolicTensor('float32', [10, 8, 2, 3], null, [], null);\n const wrapper =\n tfl.layers.timeDistributed({layer: new Reshape({targetShape: [6]})});\n const output = wrapper.apply(input) as tfl.SymbolicTensor;\n expect(output.dtype).toEqual(input.dtype);\n expect(output.shape).toEqual([10, 8, 6]);\n });\n it('2D input leads to exception', () => {\n const input = new tfl.SymbolicTensor('float32', [10, 2], null, [], null);\n const wrapper = tfl.layers.timeDistributed({layer: new Dense({units: 3})});\n expect(() => wrapper.apply(input))\n .toThrowError(\n /TimeDistributed .*expects an input shape >= 3D, .* \\[10,.*2\\]/);\n });\n it('getConfig and fromConfig: round trip', () => {\n const wrapper = tfl.layers.timeDistributed({layer: new Dense({units: 3})});\n const config = wrapper.getConfig();\n const wrapperPrime = TimeDistributed.fromConfig(TimeDistributed, config);\n expect(wrapperPrime.getConfig()).toEqual(wrapper.getConfig());\n });\n});\n\ndescribeMathCPUAndGPU('TimeDistributed Layer: Tensor', () => {\n it('3D input: Dense', () => {\n const input = tensor3d(\n [\n [[1, 2], [3, 4], [5, 6], [7, 8]],\n [[-1, -2], [-3, -4], [-5, -6], [-7, -8]]\n ],\n [2, 4, 2]);\n // Given an all-ones Dense kernel and no bias, the output at each timestep\n // is expected to be [3, 7, 11, 15], give or take a minus sign.\n const wrapper = tfl.layers.timeDistributed({\n layer: new Dense({units: 1, kernelInitializer: 'ones', useBias: false})\n });\n const output = wrapper.apply(input) as Tensor;\n expectTensorsClose(\n output,\n tensor3d(\n [[[3], [7], [11], [15]], [[-3], [-7], [-11], [-15]]], [2, 4, 1]));\n });\n\n // Reference Python Keras code:\n // ```py\n // import keras\n // import numpy as np\n //\n // model_as_layer = keras.Sequential(\n // layers=[keras.layers.Dense(\n // units=3,\n // input_shape=[2, 5],\n // kernel_initializer='ones',\n // activation='softmax')])\n //\n // td = keras.layers.TimeDistributed(\n // layer=model_as_layer, input_shape=[2, 5])\n // model = keras.Sequential(layers=[td])\n // model.summary()\n //\n // xs = np.ones([1, 2, 5])\n // ys = model.predict(xs)\n // print(ys)\n // ```\n it('LayersModel as constituent layer', () => {\n const modelAsLayer = tfl.sequential({\n layers: [tfl.layers.dense({\n activation: 'softmax',\n units: 3,\n inputShape: [2, 5],\n kernelInitializer: 'ones'\n })],\n });\n const td =\n tfl.layers.timeDistributed({layer: modelAsLayer, inputShape: [2, 5]});\n const model = tfl.sequential({layers: [td]});\n const ys = model.predict(ones([1, 2, 5])) as Tensor;\n expect(ys.shape).toEqual([1, 2, 3]);\n expectTensorsClose(ys, tensor3d([[\n [0.33333334, 0.33333334, 0.33333334],\n [0.33333334, 0.33333334, 0.33333334]\n ]]));\n });\n\n // Reference Python code:\n // ```py\n // import keras\n // import numpy as np\n //\n // input1 = keras.Input(shape=[4])\n // input2 = keras.Input(shape=[4])\n // y1 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input1)\n // y1 = keras.layers.LSTM(3,\n // return_sequences=True,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(y1)\n // z1 = keras.layers.Embedding(10,\n // 3,\n // input_length=4,\n // mask_zero=True,\n // embeddings_initializer='ones')(input2)\n // z1 = keras.layers.LSTM(3,\n // return_sequences=True,\n // recurrent_initializer='ones',\n // kernel_initializer='ones',\n // bias_initializer='zeros')(z1)\n // y2 = keras.layers.Dot(axes=[2, 2])([y1, z1])\n // y3 = keras.layers.Concatenate()([y1, y2])\n // y3 = keras.layers.TimeDistributed(keras.layers.Dense(\n // 1,\n // kernel_initializer='ones',\n // bias_initializer='zeros'))(y3)\n // model = keras.Model(inputs=[input1, input2], outputs=y3)\n // model.summary()\n //\n // xs1 = np.array([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]])\n // xs2 = np.ones([4, 4])\n // ys = model.predict([xs1, xs2])\n // print(ys)\n // ```\n it('With masking', () => {\n const input1 = tfl.input({shape: [4]});\n const input2 = tfl.input({shape: [4]});\n let y1 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input1) as SymbolicTensor;\n y1 = tfl.layers\n .lstm({\n units: 3,\n returnSequences: true,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(y1) as SymbolicTensor;\n let z1 = tfl.layers\n .embedding({\n inputDim: 10,\n outputDim: 3,\n inputLength: 4,\n maskZero: true,\n embeddingsInitializer: 'ones'\n })\n .apply(input2) as SymbolicTensor;\n z1 = tfl.layers\n .lstm({\n units: 3,\n returnSequences: true,\n recurrentInitializer: 'ones',\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n .apply(z1) as SymbolicTensor;\n const y2 = tfl.layers.dot({axes: [2, 2]}).apply([y1, z1]) as SymbolicTensor;\n let y3 = tfl.layers.concatenate().apply([y1, y2]) as SymbolicTensor;\n y3 = tfl.layers\n .timeDistributed({\n layer: tfl.layers.dense({\n units: 1,\n kernelInitializer: 'ones',\n biasInitializer: 'zeros'\n })\n })\n .apply(y3) as SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y3});\n\n const xs1 =\n tensor2d([[0, 0, 0, 0], [1, 0, 0, 0], [1, 2, 0, 0], [1, 2, 3, 0]]);\n const xs2 = ones([4, 4]);\n const ys = model.predict([xs1, xs2]) as Tensor;\n expectTensorsClose(\n ys, tensor3d([\n [[0], [0], [0], [0]],\n [[10.7489796], [10.7489796], [10.7489796], [10.7489796]],\n [[10.7489796], [13.6384077], [13.6384077], [13.6384077]],\n [[10.7489796], [13.6384077], [14.0818386], [14.0818386]]\n ]));\n });\n});\n\ndescribeMathCPU('Bidirectional Layer: Symbolic', () => {\n const mergeModes: BidirectionalMergeMode[] = [\n null,\n 'concat',\n 'ave',\n 'mul',\n 'sum',\n ];\n const returnStateValues: boolean[] = [false, true];\n\n for (const mergeMode of mergeModes) {\n for (const returnState of returnStateValues) {\n const testTitle = `3D input: returnSequence=false, ` +\n `mergeMode=${mergeMode}; returnState=${returnState}`;\n it(testTitle, () => {\n const input =\n new tfl.SymbolicTensor('float32', [10, 8, 2], null, [], null);\n const bidi = tfl.layers.bidirectional({\n layer: new SimpleRNN(\n {units: 3, recurrentInitializer: 'glorotNormal', returnState}),\n mergeMode,\n });\n // TODO(cais): Remove recurrentInitializer once Orthogonal initializer\n // is available.\n let outputs = bidi.apply(input);\n expect(bidi.trainable).toEqual(true);\n // {kernel, recurrentKernel, bias} * {forward, backward}.\n expect(bidi.getWeights().length).toEqual(6);\n if (!returnState) {\n if (mergeMode === null) {\n outputs = outputs as tfl.SymbolicTensor[];\n expect(outputs.length).toEqual(2);\n expect(outputs[0].shape).toEqual([10, 3]);\n expect(outputs[1].shape).toEqual([10, 3]);\n } else if (mergeMode === 'concat') {\n outputs = outputs as tfl.SymbolicTensor;\n expect(outputs.shape).toEqual([10, 6]);\n } else {\n outputs = outputs as tfl.SymbolicTensor;\n expect(outputs.shape).toEqual([10, 3]);\n }\n } else {\n if (mergeMode === null) {\n outputs = outputs as tfl.SymbolicTensor[];\n expect(outputs.length).toEqual(4);\n expect(outputs[0].shape).toEqual([10, 3]);\n expect(outputs[1].shape).toEqual([10, 3]);\n expect(outputs[2].shape).toEqual([10, 3]);\n expect(outputs[3].shape).toEqual([10, 3]);\n } else if (mergeMode === 'concat') {\n outputs = outputs as tfl.SymbolicTensor[];\n expect(outputs.length).toEqual(3);\n expect(outputs[0].shape).toEqual([10, 6]);\n expect(outputs[1].shape).toEqual([10, 3]);\n expect(outputs[2].shape).toEqual([10, 3]);\n } else {\n outputs = outputs as tfl.SymbolicTensor[];\n expect(outputs.length).toEqual(3);\n expect(outputs[0].shape).toEqual([10, 3]);\n expect(outputs[1].shape).toEqual([10, 3]);\n expect(outputs[2].shape).toEqual([10, 3]);\n }\n }\n });\n }\n }\n it('returnSequence=true', () => {\n const input = new tfl.SymbolicTensor('float32', [10, 8, 2], null, [], null);\n const bidi = tfl.layers.bidirectional({\n layer: new SimpleRNN({\n units: 3,\n recurrentInitializer: 'glorotNormal',\n returnSequences: true,\n returnState: true\n }),\n mergeMode: 'ave'\n });\n const outputs = bidi.apply(input) as tfl.SymbolicTensor[];\n expect(outputs.length).toEqual(3);\n expect(outputs[0].shape).toEqual([10, 8, 3]);\n expect(outputs[1].shape).toEqual([10, 3]);\n expect(outputs[2].shape).toEqual([10, 3]);\n });\n it('Serialization round trip', () => {\n const layer = tfl.layers.bidirectional({\n layer: new SimpleRNN({units: 3}),\n mergeMode: 'concat',\n inputShape: [4, 4],\n });\n const model = tfl.sequential({layers: [layer]});\n const unused: {} = null;\n const modelJSON = model.toJSON(unused, false);\n const modelPrime = deserialize(\n convertPythonicToTs(modelJSON) as\n serialization.ConfigDict) as tfl.Sequential;\n expect((modelPrime.layers[0] as Bidirectional).getConfig().mergeMode)\n .toEqual('concat');\n });\n it('mergeMode defaults to concat', () => {\n const bidi = tfl.layers.bidirectional({layer: new SimpleRNN({units: 3})});\n expect(bidi.mergeMode).toEqual('concat');\n expect(bidi.getConfig().mergeMode).toEqual('concat');\n });\n});\n\ndescribe('checkBidirectionalMergeMode', () => {\n it('Valid values', () => {\n const extendedValues =\n VALID_BIDIRECTIONAL_MERGE_MODES.concat([undefined, null]);\n for (const validValue of extendedValues) {\n // Using implicit \"expect().toNotThrow()\" for valid values\n checkBidirectionalMergeMode(validValue);\n }\n });\n it('Invalid values', () => {\n // Test invalid values are rejected, and reported in the error.\n expect(() => checkBidirectionalMergeMode('foo')).toThrowError(/foo/);\n try {\n checkBidirectionalMergeMode('bad');\n } catch (e) {\n expect(e).toMatch('BidirectionalMergeMode');\n // Test that the error message contains the list of valid values.\n for (const validValue of VALID_BIDIRECTIONAL_MERGE_MODES) {\n expect(e).toMatch(validValue);\n }\n }\n });\n});\n\ndescribeMathCPUAndGPU('Bidirectional Layer: Tensor', () => {\n // The golden tensor values used in the tests below can be obtained with\n // PyKeras code such as the following:\n // ```python\n // import keras\n // import numpy as np\n //\n // bidi = keras.layers.Bidirectional(\n // keras.layers.SimpleRNN(\n // 3,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // return_state=True),\n // merge_mode='ave')\n //\n // time_steps = 4\n // input_size = 2\n // inputs = keras.Input([time_steps, input_size])\n // outputs = bidi(inputs)\n // model = keras.Model(inputs, outputs)\n //\n // x = np.array(\n // [[[0.05, 0.05],\n // [-0.05, -0.05],\n // [0.1, 0.1],\n // [-0.1, -0.1]]])\n // print(model.predict(x))\n // ```\n\n // TODO(bileschi): This should be tfl.layers.Layer.\n let bidi: Layer;\n let x: Tensor3D;\n function createLayerAndData(\n mergeMode: BidirectionalMergeMode, returnState: boolean) {\n const units = 3;\n bidi = tfl.layers.bidirectional({\n layer: new SimpleRNN({\n units,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n useBias: false,\n returnState\n }),\n mergeMode,\n });\n const timeSteps = 4;\n const inputSize = 2;\n x = tensor3d(\n [[[0.05, 0.05], [-0.05, -0.05], [0.1, 0.1], [-0.1, -0.1]]],\n [1, timeSteps, inputSize]);\n }\n\n const mergeModes: BidirectionalMergeMode[] =\n [null, undefined, 'concat', 'mul'];\n for (const mergeMode of mergeModes) {\n it(`No returnState, mergeMode=${mergeMode}`, () => {\n createLayerAndData(mergeMode, false);\n let y = bidi.apply(x);\n if (mergeMode === null) {\n y = y as Tensor[];\n expect(y.length).toEqual(2);\n expectTensorsClose(\n y[0], tensor2d([[0.9440416, 0.9440416, 0.9440416]], [1, 3]));\n expectTensorsClose(\n y[1], tensor2d([[-0.9842659, -0.9842659, -0.9842659]], [1, 3]));\n } else if (mergeMode === undefined || mergeMode === 'concat') {\n y = y as Tensor;\n expectTensorsClose(\n y,\n tensor2d(\n [[\n 0.9440416, 0.9440416, 0.9440416, -0.9842659, -0.9842659,\n -0.9842659\n ]],\n [1, 6]));\n } else if (mergeMode === 'mul') {\n y = y as Tensor;\n expectTensorsClose(\n y, tensor2d([[-0.929188, -0.929188, -0.929188]], [1, 3]));\n }\n });\n }\n it('returnState', () => {\n createLayerAndData('ave', true);\n const y = bidi.apply(x) as Tensor[];\n expect(y.length).toEqual(3);\n expectTensorsClose(\n y[0], tensor2d([[-0.02011216, -0.02011216, -0.02011216]], [1, 3]));\n expectTensorsClose(\n y[1], tensor2d([[0.9440416, 0.9440416, 0.9440416]], [1, 3]));\n expectTensorsClose(\n y[2], tensor2d([[-0.9842659, -0.9842659, -0.9842659]], [1, 3]));\n });\n\n // The golden values in the test below can be obtained with the following\n // Python Keras code.\n //\n // ```python\n // import keras\n // import numpy\n //\n // rnn = keras.layers.LSTM(\n // 1,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='ones',\n // go_backwards=True)\n // bidi = keras.layers.Bidirectional(\n // rnn, merge_mode='concat', input_shape=[2, 2])\n // model = keras.Sequential([bidi])\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // x = np.array([[[0.1, 0.2],\n // [-0.1, 0.1]]])\n // y = np.array([[0.3, 0.5]])\n // print(model.predict(x))\n //\n // history = model.fit(x, y)\n // print(history.history)\n // ```\n it('Backwards LSTM: predict and fit: concat', async () => {\n const lstm = tfl.layers.lstm({\n units: 1,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n goBackwards: true\n }) as RNN;\n const bidi = tfl.layers.bidirectional(\n {layer: lstm, inputShape: [2, 2], mergeMode: 'concat'});\n const model = tfl.sequential({layers: [bidi]});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const x = tensor3d([[[0.1, 0.2], [-0.1, 0.1]]]);\n const y = tensor2d([[0.3, 0.5]]);\n expectTensorsClose(\n model.predict(x) as Tensor, tensor2d([[0.69299805, 0.66088]]));\n const history = await model.fit(x, y);\n expect(history.history.loss[0]).toBeCloseTo(0.0901649);\n expectTensorsClose(\n model.predict(x) as Tensor, tensor2d([[0.6927189, 0.66077083]]));\n });\n\n // The golden values in the test below can be obtained with the following\n // Python Keras code.\n //\n // ```python\n // import keras\n // import numpy\n //\n // rnn = keras.layers.LSTM(\n // 1,\n // kernel_initializer='ones',\n // recurrent_initializer='ones',\n // bias_initializer='ones',\n // go_backwards=True)\n // bidi = keras.layers.Bidirectional(\n // rnn, merge_mode='ave', input_shape=[2, 2])\n // model = keras.Sequential([bidi])\n // model.compile(loss='mean_squared_error', optimizer='sgd')\n //\n // x = np.array([[[0.1, 0.2],\n // [-0.1, 0.1]]])\n // y = np.array([[0.4]])\n // print(model.predict(x))\n //\n // history = model.fit(x, y)\n // print(history.history)\n // ```\n it('Backwards LSTM: predict and fit: ave', done => {\n const lstm = tfl.layers.lstm({\n units: 1,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones',\n biasInitializer: 'ones',\n goBackwards: true\n }) as RNN;\n const bidi = tfl.layers.bidirectional(\n {layer: lstm, inputShape: [2, 2], mergeMode: 'ave'});\n const model = tfl.sequential({layers: [bidi]});\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\n const x = tensor3d([[[0.1, 0.2], [-0.1, 0.1]]]);\n const y = tensor2d([[0.4]]);\n expectTensorsClose(model.predict(x) as Tensor, tensor2d([[0.676939]]));\n model.fit(x, y)\n .then(history => {\n expect(history.history.loss[0]).toBeCloseTo(0.0766952);\n expectTensorsClose(\n model.predict(x) as Tensor, tensor2d([[0.6767467]]));\n done();\n })\n .catch(err => {\n done.fail(err.stack);\n });\n });\n});\n\ndescribeMathCPUAndGPU('Bidirectional with initial state', () => {\n const sequenceLength = 4;\n const recurrentUnits = 3;\n const inputDim = 2;\n\n function createLayerAndTensors(): {\n bidiLayer: Bidirectional,\n initState1: SymbolicTensor,\n initState2: SymbolicTensor,\n inputTensor: SymbolicTensor,\n outputTensors: SymbolicTensor[],\n } {\n const initState1 = tfl.input({shape: [recurrentUnits]});\n const initState2 = tfl.input({shape: [recurrentUnits]});\n const inputTensor = tfl.input({shape: [sequenceLength, inputDim]});\n const bidiLayer = tfl.layers.bidirectional({\n layer: tfl.layers.gru({\n units: recurrentUnits,\n kernelInitializer: 'zeros',\n recurrentInitializer: 'zeros',\n biasInitializer: 'ones'\n }) as RNN,\n mergeMode: null,\n });\n const outputTensors =\n bidiLayer.apply(\n inputTensor, {initialState: [initState1, initState2]}) as\n SymbolicTensor[];\n return {bidiLayer, initState1, initState2, inputTensor, outputTensors};\n }\n\n it('Correct shapes', () => {\n const layerAndTensors = createLayerAndTensors();\n expect(layerAndTensors.outputTensors.length).toEqual(2);\n expect(layerAndTensors.outputTensors[0].shape).toEqual([\n null, recurrentUnits\n ]);\n expect(layerAndTensors.outputTensors[1].shape).toEqual([\n null, recurrentUnits\n ]);\n });\n\n it('apply() with concrete tensors', () => {\n const layerAndTensors = createLayerAndTensors();\n const xVal = ones([1, sequenceLength, inputDim]);\n const initState1Val = ones([1, recurrentUnits]).mul(scalar(-1));\n const initState2Val = ones([1, recurrentUnits]);\n const yVals =\n layerAndTensors.bidiLayer.apply(\n xVal, {initialState: [initState1Val, initState2Val]}) as Tensor[];\n expect(yVals.length).toEqual(2);\n expectTensorsClose(\n yVals[0], tensor2d([[0.33863544, 0.33863544, 0.33863544]]));\n expectTensorsClose(yVals[1], tensor2d([[0.8188354, 0.8188354, 0.8188354]]));\n });\n\n it('LayersModel predict', () => {\n const layerAndTensors = createLayerAndTensors();\n const model = tfl.model({\n inputs: [\n layerAndTensors.inputTensor, layerAndTensors.initState1,\n layerAndTensors.initState2\n ],\n outputs: layerAndTensors.outputTensors\n });\n const xVal = ones([1, sequenceLength, inputDim]);\n const initState1Val = ones([1, recurrentUnits]).mul(scalar(-1));\n const initState2Val = ones([1, recurrentUnits]);\n const yVals =\n model.predict([xVal, initState1Val, initState2Val]) as Tensor[];\n expect(yVals.length).toEqual(2);\n expectTensorsClose(\n yVals[0], tensor2d([[0.33863544, 0.33863544, 0.33863544]]));\n expectTensorsClose(yVals[1], tensor2d([[0.8188354, 0.8188354, 0.8188354]]));\n });\n\n it('LayersModel serialization round trip', () => {\n // Disable the console warning about the unserialization SymbolicTensor in\n // the CallArgs.\n spyOn(console, 'warn');\n const layerAndTensors = createLayerAndTensors();\n const model = tfl.model({\n inputs: [\n layerAndTensors.inputTensor, layerAndTensors.initState1,\n layerAndTensors.initState2\n ],\n outputs: layerAndTensors.outputTensors\n });\n const json1 = model.toJSON(null, false);\n const model2 =\n deserialize(convertPythonicToTs(json1) as serialization.ConfigDict) as\n LayersModel;\n const json2 = model2.toJSON(null, false);\n expect(json2).toEqual(json1);\n });\n\n it('Incorrect number of initial-state tensors leads to error', () => {\n const initState1 = tfl.input({shape: [recurrentUnits]});\n const x = tfl.input({shape: [sequenceLength, inputDim]});\n const bidi = tfl.layers.bidirectional({\n layer: tfl.layers.gru({\n units: recurrentUnits,\n }) as RNN,\n mergeMode: null,\n });\n expect(() => bidi.apply(x, {\n initialState: [initState1]\n })).toThrowError(/the state should be .*RNNs/);\n });\n});\n\ndescribeMathCPUAndGPU('Bidirectional with masking', () => {\n for (const rnnLayerType of [tfl.layers.simpleRNN, tfl.layers.lstm]) {\n // Reference Python TensorFlow code (v1.15.0):\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_v2_behavior()\n // tf.enable_eager_execution()\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Embedding(\n // 3, 3, input_length=2, embeddings_initializer=\"ones\", mask_zero=True))\n // model.add(tf.keras.layers.Bidirectional(tf.keras.layers.SimpleRNN(\n // 4,\n // kernel_initializer=\"ones\",\n // recurrent_initializer=\"ones\")))\n // model.add(tf.keras.layers.Dense(1, kernel_initializer=\"ones\"))\n //\n // xs = np.array([[0, 1], [0, 2], [0, 0], [1, 2]], dtype=np.int32)\n // print(model.predict(xs))\n // ```\n it(`Inference ${rnnLayerType.name}`, () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputLength: 2,\n inputDim: 3,\n outputDim: 3,\n embeddingsInitializer: 'ones',\n maskZero: true\n }));\n model.add(tfl.layers.bidirectional({\n layer: rnnLayerType({\n units: 4,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones'\n }) as RNN\n }));\n model.add(tfl.layers.dense({\n units: 1,\n kernelInitializer: 'ones',\n }));\n const xs = tensor2d([[0, 1], [0, 2], [0, 0], [1, 2]]);\n const ys = model.predict(xs) as Tensor;\n if (rnnLayerType.name === 'lstm') {\n expectTensorsClose(\n ys, tensor2d([[6.076076], [6.076076], [0], [7.709405]]));\n } else if (rnnLayerType.name === 'simpleRNN') {\n expectTensorsClose(\n ys, tensor2d([[7.960438], [7.960438], [0], [7.9999857]]));\n } else {\n throw new Error(`Unexpected rnnLayerType name: ${rnnLayerType.name}`);\n }\n });\n\n // Reference Python TensorFlow code (v1.15.0):\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_v2_behavior()\n // tf.enable_eager_execution()\n //\n // model = tf.keras.Sequential()\n // model.add(tf.keras.layers.Embedding(\n // 3, 3, input_length=2, embeddings_initializer=\"ones\", mask_zero=True))\n // model.add(tf.keras.layers.Bidirectional(tf.keras.layers.SimpleRNN(\n // 4,\n // kernel_initializer=\"ones\",\n // recurrent_initializer=\"ones\")))\n // model.add(tf.keras.layers.Dense(1, kernel_initializer=\"ones\"))\n // model.compile(optimizer=\"sgd\", loss=\"mse\")\n //\n // xs = np.array([[0, 1], [0, 2], [0, 0], [1, 2]], dtype=np.int32)\n // ys = np.array([[0], [0], [0], [0]], dtype=np.float32)\n // history = model.fit(xs, ys, epochs=5)\n // print(history.history)\n // ```\n it(`Training ${rnnLayerType.name}`, async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.embedding({\n inputLength: 2,\n inputDim: 3,\n outputDim: 3,\n embeddingsInitializer: 'ones',\n maskZero: true\n }));\n model.add(tfl.layers.bidirectional({\n layer: rnnLayerType({\n units: 4,\n kernelInitializer: 'ones',\n recurrentInitializer: 'ones'\n }) as RNN\n }));\n model.add(tfl.layers.dense({\n units: 1,\n kernelInitializer: 'ones',\n }));\n model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n const xs = tensor2d([[0, 1], [0, 2], [0, 0], [1, 2]]);\n const ys = tensor2d([[0], [0], [0], [0]]);\n const history = await model.fit(xs, ys, {epochs: 5});\n if (rnnLayerType.name === 'lstm') {\n expectTensorsClose(\n history.history['loss'] as number[],\n [33.318, 27.104, 22.058, 17.961, 14.634]);\n } else if (rnnLayerType.name === 'simpleRNN') {\n expectTensorsClose(\n history.history['loss'] as number[],\n [47.684, 35.741, 26.804, 20.115, 15.108]);\n } else {\n throw new Error(`Unexpected rnnLayerType name:\n ${rnnLayerType.name}`);\n }\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-layers/dist/logs.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts deleted file mode 100644 index f1eabe608..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Scalar } from '@tensorflow/tfjs-core'; -/** - * Logs in which values can be either numbers or Tensors (Scalars). - * - * Used internally. - */ -export declare type UnresolvedLogs = { - [key: string]: number | Scalar; -}; -/** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ -export declare function resolveScalarsInLogs(logs: UnresolvedLogs): Promise; -/** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ -export declare function disposeTensorsInLogs(logs: UnresolvedLogs): void; -/** - * Logs in which values can only be numbers. - * - * Used when calling client-provided custom callbacks. - */ -export declare type Logs = { - [key: string]: number; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js deleted file mode 100644 index 3a3d6cfe0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { dispose } from '@tensorflow/tfjs-core'; -/** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ -export async function resolveScalarsInLogs(logs) { - if (logs == null) { - return; - } - const promises = []; - const keys = []; - const scalarsToDispose = []; - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - const valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (promises.length > 0) { - const values = await Promise.all(promises); - for (let i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - dispose(scalarsToDispose); - } -} -/** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ -export function disposeTensorsInLogs(logs) { - if (logs == null) { - return; - } - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } -} -//# sourceMappingURL=logs.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-layers/dist/logs.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map deleted file mode 100644 index 0ef7eecb6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,OAAO,EAAS,MAAM,uBAAuB,CAAC;AAWtD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAoB;IAC7D,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO;KACR;IACD,MAAM,QAAQ,GAAuD,EAAE,CAAC;IACxE,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,WAAW,GAAG,KAAK,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACf,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACpC;KACF;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9B;QACD,uCAAuC;QACvC,OAAO,CAAC,gBAAgB,CAAC,CAAC;KAC3B;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAoB;IACvD,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO;KACR;IACD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;SACjB;KACF;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\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-layers/dist/losses.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts deleted file mode 100644 index d1fe19bc9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { LossOrMetricFn } from './types'; -/** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ -export declare function l2Normalize(x: Tensor, axis?: number): Tensor; -export declare function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function meanAbsolutePercentageError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function meanSquaredLogarithmicError(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function hinge(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor; -/** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ -export declare function logcosh(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function categoricalCrossentropy(target: Tensor, output: Tensor, fromLogits?: boolean): Tensor; -/** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ -export declare function sparseCategoricalCrossentropy(target: Tensor, output: Tensor, fromLogits?: boolean): Tensor; -/** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ -export declare function sigmoidCrossEntropyWithLogits(labels: Tensor, logits: Tensor): Tensor; -export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function kullbackLeiblerDivergence(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function poisson(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor; -export declare const mse: typeof meanSquaredError; -export declare const MSE: typeof meanSquaredError; -export declare const mae: typeof meanAbsoluteError; -export declare const MAE: typeof meanAbsoluteError; -export declare const mape: typeof meanAbsolutePercentageError; -export declare const MAPE: typeof meanAbsolutePercentageError; -export declare const msle: typeof meanSquaredLogarithmicError; -export declare const MSLE: typeof meanSquaredLogarithmicError; -export declare const kld: typeof kullbackLeiblerDivergence; -export declare const KLD: typeof kullbackLeiblerDivergence; -export declare const cosine: typeof cosineProximity; -export declare const lossesMap: { - [functionName: string]: LossOrMetricFn; -}; -export declare function get(identifierOrFn: string | LossOrMetricFn): LossOrMetricFn; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js deleted file mode 100644 index e2b691dc9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original Source: losses.py */ -import * as tfc from '@tensorflow/tfjs-core'; -import { tidy, util } from '@tensorflow/tfjs-core'; -import { epsilon } from './backend/common'; -import * as K from './backend/tfjs_backend'; -import { ValueError } from './errors'; -/** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ -export function l2Normalize(x, axis) { - return tidy(() => { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - const squareSum = tfc.sum(K.square(x), axis, true); - const epsilonTensor = tfc.fill(squareSum.shape, epsilon()); - const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); - return tfc.div(x, norm); - }); -} -export function meanSquaredError(yTrue, yPred) { - return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1)); -} -export function meanAbsoluteError(yTrue, yPred) { - return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1)); -} -export function meanAbsolutePercentageError(yTrue, yPred) { - return tidy(() => { - const diff = tfc.sub(yTrue, yPred); - const clippedTrue = tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); - const absResult = tfc.abs(tfc.div(diff, clippedTrue)); - return tfc.mul(100, tfc.mean(absResult, -1)); - }); -} -export function meanSquaredLogarithmicError(yTrue, yPred) { - return tidy(() => { - const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); - const firstLog = tfc.log(tfc.add(1, clippedPred)); - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); - const secondLog = tfc.log(tfc.add(1, clippedTrue)); - return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1); - }); -} -export function squaredHinge(yTrue, yPred) { - return tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(K.square(maxResult), -1); - }); -} -export function hinge(yTrue, yPred) { - return tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(maxResult, -1); - }); -} -export function categoricalHinge(yTrue, yPred) { - return tidy(() => { - const pos = tfc.sum(tfc.mul(yTrue, yPred), -1); - const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1); - return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos))); - }); -} -/** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ -export function logcosh(yTrue, yPred) { - return tidy(() => { - const log2 = Math.log(2); - const predictionDiff = tfc.sub(yPred, yTrue); - const logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))), log2); - return tfc.mean(logcoshResult, -1); - }); -} -export function categoricalCrossentropy(target, output, fromLogits = false) { - return tidy(() => { - if (fromLogits) { - output = tfc.softmax(output); - } - else { - // scale preds so that the class probabilities of each sample sum to 1. - const outputSum = tfc.sum(output, output.shape.length - 1, true); - output = tfc.div(output, outputSum); - } - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); - }); -} -/** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ -export function sparseCategoricalCrossentropy(target, output, fromLogits = false) { - return tidy(() => { - const flatTarget = tfc.floor(K.flatten(target)).toInt(); - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - const outputShape = output.shape; - const oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); -} -/** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ -export function sigmoidCrossEntropyWithLogits(labels, logits) { - if (!util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError(`logits and labels must have the same shape, but got shapes ` + - `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`); - } - return tidy(() => { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - const reluLogits = logits.relu(); - const negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); -} -export function binaryCrossentropy(yTrue, yPred) { - return tidy(() => { - let y; - y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); - y = tfc.log(tfc.div(y, tfc.sub(1, y))); - return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); -} -export function kullbackLeiblerDivergence(yTrue, yPred) { - return tidy(() => { - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); - const clippedPred = tfc.clipByValue(yPred, epsilon(), 1); - return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); - }); -} -export function poisson(yTrue, yPred) { - return tidy(() => { - const logPred = tfc.log(tfc.add(epsilon(), yPred)); - return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); - }); -} -export function cosineProximity(yTrue, yPred) { - return tidy(() => { - const trueNormalized = l2Normalize(yTrue, -1); - const predNormalized = l2Normalize(yPred, -1); - const trueXPred = tfc.mul(trueNormalized, predNormalized); - return tfc.neg(tfc.sum(trueXPred, -1)); - }); -} -export const mse = meanSquaredError; -export const MSE = meanSquaredError; -export const mae = meanAbsoluteError; -export const MAE = meanAbsoluteError; -export const mape = meanAbsolutePercentageError; -export const MAPE = meanAbsolutePercentageError; -export const msle = meanSquaredLogarithmicError; -export const MSLE = meanSquaredLogarithmicError; -export const kld = kullbackLeiblerDivergence; -export const KLD = kullbackLeiblerDivergence; -export const cosine = cosineProximity; -// TODO(michaelterry): Add deserialize() function. -export const lossesMap = { - meanSquaredError, - meanAbsoluteError, - meanAbsolutePercentageError, - meanSquaredLogarithmicError, - squaredHinge, - hinge, - categoricalHinge, - logcosh, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - binaryCrossentropy, - kullbackLeiblerDivergence, - poisson, - cosineProximity -}; -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -export function get(identifierOrFn) { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - let errMsg = `Unknown loss ${identifierOrFn}`; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = `Unknown loss ${identifierOrFn}. ` + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } - else { - return identifierOrFn; - } -} -//# sourceMappingURL=losses.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-layers/dist/losses.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map deleted file mode 100644 index 126032e39..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"losses.js","sourceRoot":"","sources":["../src/losses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAmB,IAAI,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,wBAAwB,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AAChD,MAAM,CAAC,MAAM,IAAI,GAAG,2BAA2B,CAAC;AAChD,MAAM,CAAC,MAAM,IAAI,GAAG,2BAA2B,CAAC;AAChD,MAAM,CAAC,MAAM,IAAI,GAAG,2BAA2B,CAAC;AAChD,MAAM,CAAC,MAAM,GAAG,GAAG,yBAAyB,CAAC;AAC7C,MAAM,CAAC,MAAM,GAAG,GAAG,yBAAyB,CAAC;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;AAEtC,kDAAkD;AAElD,MAAM,CAAC,MAAM,SAAS,GAA6C;IACjE,gBAAgB;IAChB,iBAAiB;IACjB,2BAA2B;IAC3B,2BAA2B;IAC3B,YAAY;IACZ,KAAK;IACL,gBAAgB;IAChB,OAAO;IACP,uBAAuB;IACvB,6BAA6B;IAC7B,kBAAkB;IAClB,yBAAyB;IACzB,OAAO;IACP,eAAe;CAChB,CAAC;AAEF,8EAA8E;AAC9E,kDAAkD;AAClD,MAAM,UAAU,GAAG,CAAC,cAAqC;IACvD,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QACtC,IAAI,cAAc,IAAI,SAAS,EAAE;YAC/B,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC;SAClC;QACD,IAAI,MAAM,GAAG,gBAAgB,cAAc,EAAE,CAAC;QAC9C,IAAI,cAAc,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;YAChE,MAAM,GAAG,gBAAgB,cAAc,IAAI;gBACvC,uDAAuD;gBACvD,+BAA+B,CAAC;SACrC;QACD,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;KAC9B;SAAM;QACL,OAAO,cAAc,CAAC;KACvB;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\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-layers/dist/losses_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map deleted file mode 100644 index 09ddcd6bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"losses_test.js","sourceRoot":"","sources":["../src/losses_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,qBAAqB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AAC,CAAC;QACrC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for activations.ts.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor, tensor1d, tensor2d, tensor3d} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as losses from './losses';\nimport {describeMathCPUAndGPU, expectTensorsClose} from './utils/test_utils';\n\ndescribeMathCPUAndGPU('meanSquaredError', () => {\n it('1D', () => {\n const yTrue = tfc.zeros([3]);\n const yPred = tensor1d([1, 2, 3]);\n const expectedVal = scalar((1 * 1 + 2 * 2 + 3 * 3) / 3);\n const result = losses.meanSquaredError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n\n it('2D', () => {\n const yTrue = tfc.zeros([2, 2]);\n const yPred = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const expectedVal = tensor1d([(1 * 1 + 2 * 2) / 2, (3 * 3 + 4 * 4) / 2]);\n const result = losses.meanSquaredError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('meanAbsoluteError', () => {\n it('1D', () => {\n const yTrue = tfc.zeros([3]);\n const yPred = tensor1d([-1, -2, -3]);\n const expectedVal = scalar((1 + 2 + 3) / 3);\n const result = losses.meanAbsoluteError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n\n it('2D', () => {\n const yTrue = tfc.zeros([2, 2]);\n const yPred = tensor2d([[-1, -2], [-3, -4]], [2, 2]);\n const expectedVal = tensor1d([(1 + 2) / 2, (3 + 4) / 2]);\n const result = losses.meanAbsoluteError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('meanAbsolutePercentageError', () => {\n it('1D', () => {\n const yTrue = tensor1d([-1, -2, -3]);\n const yPred = tfc.zeros([3]);\n const expectedVal = scalar((1 + 2 + 3) / (1 + 2 + 3) * 100);\n const result = losses.meanAbsolutePercentageError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n\n it('2D', () => {\n const yTrue = tensor2d([[-1, -2], [-3, -4]], [2, 2]);\n const yPred = tfc.zeros([2, 2]);\n const expectedVal =\n tensor1d([(1 + 2) / (1 + 2) * 100, (3 + 4) / (3 + 4) * 100]);\n const result = losses.meanAbsolutePercentageError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('meanSquaredLogarithmicError', () => {\n function meanSquaredLogErrorFor1DArray(x: number[], y: number[]): number {\n const calcLog = (val: number) => Math.log(Math.max(val, epsilon()) + 1);\n const logX = x.map(calcLog);\n const logY = y.map(calcLog);\n let acc = 0.0;\n for (let i = 0; i < x.length; i++) {\n const diff = logX[i] - logY[i];\n acc += diff * diff;\n }\n return acc / x.length;\n }\n\n it('2D', () => {\n const yTrue = tfc.zeros([2, 2]);\n const yPred = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const expectedVal = tensor1d([\n meanSquaredLogErrorFor1DArray([1, 2], [0, 0]),\n meanSquaredLogErrorFor1DArray([3, 4], [0, 0])\n ]);\n const result = losses.meanSquaredLogarithmicError(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('squaredHinge', () => {\n it('2D', () => {\n const yTrue = tensor2d([[-1, 2], [-3, 2]], [2, 2]);\n const yPred = tensor2d([[-3, 5], [3, -2]], [2, 2]);\n // First row has correct predictions, so loss is 0.\n const secondRow = [1 - (-3 * 3), 1 - (2 * -2)].map(x => x * x);\n const expectedVal = tensor1d([0, (secondRow[0] + secondRow[1]) / 2]);\n const result = losses.squaredHinge(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('hinge', () => {\n it('2D', () => {\n const yTrue = tensor2d([[-1, 2], [-3, 2]], [2, 2]);\n const yPred = tensor2d([[-3, 5], [3, -2]], [2, 2]);\n // First row has correct predictions, so loss is 0.\n const secondRow = [1 - (-3 * 3), 1 - (2 * -2)];\n const expectedVal = tensor1d([0, (secondRow[0] + secondRow[1]) / 2]);\n const result = losses.hinge(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('categoricalHinge', () => {\n it('2D', () => {\n const yTrue = tensor2d([[0, 1, 0], [1, 0, 0]], [2, 3]);\n const yPred = tensor2d([[0, 2, 0], [1, 3, 2]], [2, 3]);\n // First row has correct predictions, so loss is 0.\n const secondRowPos = 1 * 1;\n const secondRowNeg = Math.max(1 * 3, 1 * 2);\n const secondRowVal = secondRowNeg - secondRowPos + 1;\n const expectedVal = tensor1d([0, secondRowVal]);\n const result = losses.categoricalHinge(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('logcosh', () => {\n function _logcosh(x: number): number {\n return x + Math.log(Math.exp(-2 * x) + 1) - Math.log(2);\n }\n it('2D', () => {\n const yTrue = tfc.zeros([2, 2]);\n const yPred = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const firstRow = [1, 2].map(_logcosh);\n const secondRow = [3, 4].map(_logcosh);\n const firstVal = (firstRow[0] + firstRow[1]) / 2;\n const secondVal = (secondRow[0] + secondRow[1]) / 2;\n const expectedVal = tensor1d([firstVal, secondVal]);\n const result = losses.logcosh(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('categoricalCrossentropy ', () => {\n it('from logits', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const target = tensor2d([[0.25, 0.75], [0.1, 0.9]], [2, 2]);\n const expected = tensor1d([\n -1 *\n (Math.log(Math.exp(1) / (Math.exp(1) + Math.exp(2))) * 0.25 +\n Math.log(Math.exp(2) / (Math.exp(1) + Math.exp(2))) * 0.75),\n -1 *\n (Math.log(Math.exp(3) / (Math.exp(3) + Math.exp(4))) * 0.1 +\n Math.log(Math.exp(4) / (Math.exp(3) + Math.exp(4))) * 0.9)\n ]);\n const result = losses.categoricalCrossentropy(target, x, true);\n expectTensorsClose(result, expected);\n });\n\n it('from softmax', () => {\n const x = tensor2d([[0.3, 0.7], [0.4, 0.6]], [2, 2]);\n const target = tensor2d([[0.25, 0.75], [0.1, 0.9]], [2, 2]);\n const expected = tensor1d([\n -1 * (Math.log(0.3) * 0.25 + Math.log(0.7) * 0.75),\n -1 * (Math.log(0.4) * 0.1 + Math.log(0.6) * 0.9)\n ]);\n const result = losses.categoricalCrossentropy(target, x, false);\n expectTensorsClose(result, expected);\n });\n\n // Reference Python code\n // ```python\n // import numpy as np\n // import tensorflow as tf\n // from tensorflow import keras\n //\n // x_value = np.array([[[0.3, 0.7], [0.4, 0.6]], [[0.2, 0.8], [0.55, 0.45]]])\n // target_value = np.array([[[0, 1], [1, 0]], [[0, 1], [1, 0]]])\n //\n // with tf.Session() as sess:\n // x = tf.placeholder(tf.float32, [2, 2, 2])\n // target = tf.placeholder(tf.float32, [2, 2, 2])\n // y = keras.backend.categorical_crossentropy(target, x)\n // print(sess.run(y, feed_dict={\n // x: x_value,\n // target: target_value\n // }))\n // ```\n it('from softmax, sequence output', () => {\n const x = tensor3d([[[0.3, 0.7], [0.4, 0.6]], [[0.2, 0.8], [0.55, 0.45]]], [\n 2,\n 2,\n 2,\n ]);\n const target = tensor3d([[[0, 1], [1, 0]], [[0, 1], [1, 0]]], [2, 2, 2]);\n const result = losses.categoricalCrossentropy(target, x, false);\n expectTensorsClose(\n result, tensor2d([[0.35667497, 0.9162907], [0.22314353, 0.597837]]));\n });\n});\n\ndescribeMathCPUAndGPU('sparseCategoricalCrossentropy ', () => {\n // Reference Python TensorFlow code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // with tf.Session() as sess:\n // x = tf.placeholder(tf.float32, [None, 3])\n // target = tf.placeholder(tf.float32, [None])\n // crossentropy = tf.keras.backend.sparse_categorical_crossentropy(\n // target, x)\n // out = sess.run(\n // crossentropy,\n // feed_dict={\n // x: np.array([[0.1, 0.2, 0.7], [0.2, 0.3, 0.5]],\n // dtype=np.float32),\n // target: np.array([0, 2], dtype=np.float32)\n // })\n // print(out)\n // ```\n it('sparseCategoricalCrossentropy', () => {\n const x = tensor2d([[0.1, 0.2, 0.7], [0.2, 0.3, 0.5]], [2, 3]);\n const target = tensor1d([0, 2]);\n const result = losses.sparseCategoricalCrossentropy(target, x);\n expectTensorsClose(result, tensor1d([2.3025851, 0.6931472]));\n });\n});\n\ndescribeMathCPUAndGPU('sigmoidCrossEntropyWithLogits', () => {\n it('outputs sigmoid cross-entropy', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const target = tensor2d([[0.25, 0.75], [0.1, 0.9]], [2, 2]);\n const targetComplement = tfc.add(scalar(1), tfc.neg(target));\n const sigmoidX = tfc.sigmoid(x);\n const sigmoidXComplement = tfc.add(scalar(1), tfc.neg(sigmoidX));\n const expected = tfc.add(\n tfc.mul(target, tfc.neg(tfc.log(sigmoidX))),\n tfc.mul(targetComplement, tfc.neg(tfc.log(sigmoidXComplement))));\n const result = losses.sigmoidCrossEntropyWithLogits(target, x);\n expectTensorsClose(result, expected);\n });\n\n // Python TensorFlow reference code:\n // ```py\n // import numpy as np\n // import tensorflow as tf\n //\n // tf.enable_eager_execution()\n //\n // logits = np.array([[-10, -10, -10],\n // [-5, -5, -5],\n // [0, 0, 0],\n // [0.5, 0.5, 0.5],\n // [2, 2, 2]], dtype=np.float32)\n // labels = np.array([[0, 0.5, 1],\n // [0, 0.5, 1],\n // [0, 0.5, 1],\n // [0, 0.5, 1],\n // [0, 0.5, 1]], dtype=np.float32)\n //\n // print(tf.nn.sigmoid_cross_entropy_with_logits(\n // logits=logits, labels=labels))\n // ```\n it('Comparison with TensorFlow references values', () => {\n const logits = tensor2d(\n [[-10, -10, -10], [-5, -5, -5], [0, 0, 0], [0.5, 0.5, 0.5], [2, 2, 2]]);\n const labels = tensor2d(\n [[0, 0.5, 1], [0, 0.5, 1], [0, 0.5, 1], [0, 0.5, 1], [0, 0.5, 1]]);\n const outputs = losses.sigmoidCrossEntropyWithLogits(labels, logits);\n expectTensorsClose(outputs, tensor2d([\n [4.5398901e-05, 5.0000453e+00, 1.0000046e+01],\n [6.7153485e-03, 2.5067153e+00, 5.0067153e+00],\n [6.9314718e-01, 6.9314718e-01, 6.9314718e-01],\n [9.7407699e-01, 7.2407699e-01, 4.7407699e-01],\n [2.1269281e+00, 1.1269280e+00, 1.2692800e-01]\n ]));\n });\n});\n\ndescribeMathCPUAndGPU('categoricalCrossentropy', () => {\n it('2D', () => {\n const yTrue = tensor2d([[1, 0], [0, 1]], [2, 2]);\n const yPred = yTrue;\n const expectedVal = tfc.zeros([2]);\n const result = losses.categoricalCrossentropy(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('sparseCategoricalCrossentropy', () => {\n it('2D', () => {\n const yTrue = tensor1d([0, 1]);\n const yPred = tensor2d([[1, 0], [0, 1]], [2, 2]);\n const expectedVal = tfc.zeros([2]);\n const result = losses.sparseCategoricalCrossentropy(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('binaryCrossentropy', () => {\n function _binaryCrossentropy(target: Tensor, output: Tensor): Tensor {\n const targetComplement = tfc.add(scalar(1), tfc.neg(target));\n const outputComplement = tfc.add(scalar(1), tfc.neg(output));\n return tfc.mean(\n tfc.neg(tfc.add(\n tfc.mul(target, tfc.log(output)),\n tfc.mul(targetComplement, tfc.log(outputComplement)))),\n -1);\n }\n\n it('from sigmoid', () => {\n const x = tensor2d([[0.3, 0.7], [0.4, 0.6]], [2, 2]);\n const target = tensor2d([[0.25, 0.75], [0.1, 0.9]], [2, 2]);\n const expected = _binaryCrossentropy(target, x);\n const result = losses.binaryCrossentropy(target, x);\n expectTensorsClose(result, expected);\n });\n});\n\ndescribeMathCPUAndGPU('kullbackLeiblerDivergence', () => {\n function klElement(actual: number, predicted: number): number {\n actual = Math.max(actual, epsilon());\n predicted = Math.max(predicted, epsilon());\n return actual * Math.log(actual / predicted);\n }\n\n it('2D', () => {\n const yTrue = tensor2d([[1, 0], [1, 0]], [2, 2]);\n const yPred = tensor2d([[0.25, 0.75], [0.9, 0.1]], [2, 2]);\n const expectedVal = tensor1d([\n klElement(1, 0.25) + klElement(0, 0.75),\n klElement(1, 0.9) + klElement(0, 0.1),\n ]);\n const result = losses.kullbackLeiblerDivergence(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('poisson', () => {\n function poissonElement(actual: number, predicted: number): number {\n return predicted - actual * Math.log(predicted + epsilon());\n }\n\n it('2D', () => {\n const yTrue = tensor2d([[1, 0], [1, 0]], [2, 2]);\n const yPred = tensor2d([[0.25, 0.75], [0.9, 0.1]], [2, 2]);\n const expectedVal = tensor1d([\n (poissonElement(1, 0.25) + poissonElement(0, 0.75)) / 2,\n (poissonElement(1, 0.9) + poissonElement(0, 0.1)) / 2,\n ]);\n const result = losses.poisson(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribeMathCPUAndGPU('cosineProximity', () => {\n it('2D', () => {\n const z = Math.sqrt(2) / 2;\n const yTrue = tensor2d([[1, 0], [1, 0]], [2, 2]);\n const yPred = tensor2d([[z, z], [0, 1]], [2, 2]);\n const expectedVal = tensor1d([-1 * z, 0]);\n const result = losses.cosineProximity(yTrue, yPred);\n expectTensorsClose(result, expectedVal);\n });\n});\n\ndescribe('losses get', () => {\n for (const lossName\n of ['meanSquaredError', 'meanAbsoluteError',\n 'meanAbsolutePercentageError', 'meanSquaredLogarithmicError',\n 'squaredHinge', 'hinge', 'categoricalHinge', 'logcosh',\n 'categoricalCrossentropy', 'sparseCategoricalCrossentropy',\n 'binaryCrossentropy', 'kullbackLeiblerDivergence', 'poisson',\n 'cosineProximity']) {\n it(`can get ${lossName}`, () => {\n losses.get(lossName);\n });\n }\n\n it(`get custom loss works`, () => {\n const customLoss = (x: Tensor, y: Tensor) => scalar(42.0);\n expect(losses.get(customLoss)).toEqual(customLoss);\n });\n});\n\ndescribeMathCPUAndGPU('l2Normalize', () => {\n it('normalizes with no axis defined.', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const norm = Math.sqrt(1 * 1 + 2 * 2 + 3 * 3 + 4 * 4);\n const expected =\n tensor2d([[1 / norm, 2 / norm], [3 / norm, 4 / norm]], [2, 2]);\n const result = losses.l2Normalize(x);\n expectTensorsClose(result, expected);\n });\n\n it('normalizes along axis = -1.', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2]);\n const firstNorm = Math.sqrt(1 * 1 + 2 * 2);\n const secondNorm = Math.sqrt(3 * 3 + 4 * 4);\n const expected = tensor2d(\n [[1 / firstNorm, 2 / firstNorm], [3 / secondNorm, 4 / secondNorm]],\n [2, 2]);\n const result = losses.l2Normalize(x, -1);\n expectTensorsClose(result, expected);\n });\n\n it('normalizes with zeros.', () => {\n const x = tfc.zeros([2, 2]);\n const result = losses.l2Normalize(x);\n expectTensorsClose(result, x);\n });\n\n it('normalizes casts int32 as float32.', () => {\n const x = tensor2d([[1, 2], [3, 4]], [2, 2], 'int32');\n const norm = Math.sqrt(1 * 1 + 2 * 2 + 3 * 3 + 4 * 4);\n const expected =\n tensor2d([[1 / norm, 2 / norm], [3 / norm, 4 / norm]], [2, 2]);\n const result = losses.l2Normalize(x);\n expectTensorsClose(result, expected);\n });\n\n it('normalizes casts bool as float32.', () => {\n const x = tensor2d([[1, 1]], [1, 2], 'bool');\n const norm = Math.sqrt(1 * 1 + 1 * 1);\n const expected = tensor2d([[1 / norm, 1 / norm]], [1, 2]);\n const result = losses.l2Normalize(x);\n expectTensorsClose(result, expected);\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-layers/dist/metrics.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts deleted file mode 100644 index 16159293c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss } from './losses'; -import { LossOrMetricFn } from './types'; -export declare function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function precision(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function recall(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function sparseCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare function sparseTopKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; -export declare const mse: typeof meanSquaredError; -export declare const MSE: typeof meanSquaredError; -export declare const mae: typeof meanAbsoluteError; -export declare const MAE: typeof meanAbsoluteError; -export declare const mape: typeof meanAbsolutePercentageError; -export declare const MAPE: typeof meanAbsolutePercentageError; -export declare const categoricalCrossentropy: typeof categoricalCrossentropyLoss; -export declare const cosine: typeof cosineProximity; -export declare const sparseCategoricalCrossentropy: typeof sparseCategoricalCrossentropyLoss; -export declare const metricsMap: { - [functionName: string]: LossOrMetricFn; -}; -export declare function get(identifier: string | LossOrMetricFn): LossOrMetricFn; -/** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ -export declare function getLossOrMetricName(fn: string | LossOrMetricFn): string; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js deleted file mode 100644 index f3e793377..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Built-in metrics. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { tidy } from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import { NotImplementedError, ValueError } from './errors'; -import { categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss } from './losses'; -import { binaryCrossentropy as lossBinaryCrossentropy } from './losses'; -import { lossesMap } from './losses'; -import * as util from './utils/generic_utils'; -export function binaryAccuracy(yTrue, yPred) { - return tidy(() => { - const threshold = tfc.mul(.5, tfc.onesLike(yPred)); - const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype); - return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); - }); -} -export function categoricalAccuracy(yTrue, yPred) { - return tidy(() => K.cast(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32')); -} -function truePositives(yTrue, yPred) { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); -} -function falseNegatives(yTrue, yPred) { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); -} -function falsePositives(yTrue, yPred) { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); -} -export function precision(yTrue, yPred) { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fp = falsePositives(yTrue, yPred); - const denominator = tp.add(fp); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -export function recall(yTrue, yPred) { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fn = falseNegatives(yTrue, yPred); - const denominator = tp.add(fn); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -export function binaryCrossentropy(yTrue, yPred) { - return lossBinaryCrossentropy(yTrue, yPred); -} -export function sparseCategoricalAccuracy(yTrue, yPred) { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return tfc.equal(yTrue, yPred).asType('float32'); -} -export function topKCategoricalAccuracy(yTrue, yPred) { - throw new NotImplementedError(); -} -export function sparseTopKCategoricalAccuracy(yTrue, yPred) { - throw new NotImplementedError(); -} -// Aliases. -export const mse = meanSquaredError; -export const MSE = meanSquaredError; -export const mae = meanAbsoluteError; -export const MAE = meanAbsoluteError; -export const mape = meanAbsolutePercentageError; -export const MAPE = meanAbsolutePercentageError; -export const categoricalCrossentropy = categoricalCrossentropyLoss; -export const cosine = cosineProximity; -export const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss; -// TODO(cais, nielsene): Add serialize(). -export const metricsMap = { - binaryAccuracy, - categoricalAccuracy, - precision, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - mse, - MSE, - mae, - MAE, - mape, - MAPE, - cosine -}; -export function get(identifier) { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } - else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } - else { - throw new ValueError(`Unknown metric ${identifier}`); - } -} -/** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ -export function getLossOrMetricName(fn) { - util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`); - if (typeof fn === 'string') { - return fn; - } - else { - let fnName; - for (const key of Object.keys(lossesMap)) { - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (const key of Object.keys(metricsMap)) { - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return fn.name; - } -} -//# sourceMappingURL=metrics.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-layers/dist/metrics.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map deleted file mode 100644 index 552cfcebe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAS,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,EAAC,uBAAuB,IAAI,2BAA2B,EAAE,eAAe,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,6BAA6B,IAAI,iCAAiC,EAAC,MAAM,UAAU,CAAC;AACvO,OAAO,EAAC,kBAAkB,IAAI,sBAAsB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,MAAM,UAAU,cA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AM,KAAK,SAAS,EAAE;YACxB,OAAO,MAAM,CAAC;SACf;QACD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACzC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;gBAC1B,MAAM,GAAG,GAAG,CAAC;gBACb,MAAM;aACP;SACF;QACD,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,OAAO,MAAM,CAAC;SACf;QACD,OAAQ,EAAe,CAAC,IAAI,CAAC;KAC9B;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\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-layers/dist/metrics_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map deleted file mode 100644 index b39000655..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics_test.js","sourceRoot":"","sources":["../src/metrics_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,MAAM,EAAU,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,GAAG,EAAE,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAExF,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAE7E,qBAAqB,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;QAClB,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAA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AC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACpE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,UAAU,GAAmB,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAChE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for metrics.ts.\n */\n\nimport {scalar, Tensor, tensor, tensor1d, tensor2d} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport {binaryAccuracy, categoricalAccuracy, get, getLossOrMetricName} from './metrics';\nimport {LossOrMetricFn} from './types';\nimport {describeMathCPUAndGPU, expectTensorsClose} from './utils/test_utils';\n\ndescribeMathCPUAndGPU('binaryAccuracy', () => {\n it('1D exact', () => {\n const x = tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n const y = tensor1d([1, 0, 1, 0, 0, 1, 0, 1]);\n const accuracy = tfl.metrics.binaryAccuracy(x, y);\n expectTensorsClose(accuracy, scalar(0.5));\n });\n it('2D thresholded', () => {\n const x = tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n const y = tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n const accuracy = tfl.metrics.binaryAccuracy(x, y);\n expectTensorsClose(accuracy, scalar(5 / 8));\n });\n it('2D exact', () => {\n const x = tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n const y = tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n const accuracy = tfl.metrics.binaryAccuracy(x, y);\n expectTensorsClose(accuracy, tensor1d([0.5, 0.75]));\n });\n it('2D thresholded', () => {\n const x = tensor2d([[1, 1], [1, 1], [0, 0], [0, 0]], [4, 2]);\n const y =\n tensor2d([[0.2, 0.4], [0.6, 0.8], [0.2, 0.3], [0.4, 0.7]], [4, 2]);\n const accuracy = tfl.metrics.binaryAccuracy(x, y);\n expectTensorsClose(accuracy, tensor1d([0, 1, 1, 0.5]));\n });\n});\n\ndescribeMathCPUAndGPU('sparseCategoricalAccuracy', () => {\n it('1D float32 yTrue, 2D yPred', () => {\n const yTrue = tensor1d([1, 1, 2, 2, 0]);\n const yPred = tensor2d(\n [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n const accuracy = tfl.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n expectTensorsClose(accuracy.toBool(), tensor1d([1, 0, 1, 0, 1], 'bool'));\n });\n it('1D int32 yTrue, 2D yPred', () => {\n const yTrue = tensor1d([1, 1, 2, 2, 0], 'int32');\n const yPred = tensor2d(\n [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n const accuracy = tfl.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n expectTensorsClose(accuracy.toBool(), tensor1d([1, 0, 1, 0, 1], 'bool'));\n });\n it('2D int32 yTrue, 2D yPred', () => {\n const yTrue = tensor2d([1, 1, 2, 2, 0], [5, 1], 'int32');\n const yPred = tensor2d(\n [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n const accuracy = tfl.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n expectTensorsClose(accuracy.toBool(), tensor1d([1, 0, 1, 0, 1], 'bool'));\n });\n});\n\ndescribeMathCPUAndGPU('binaryCrossentropy', () => {\n it('2D single-value yTrue', () => {\n // Use the following Python code to generate the reference values:\n // ```python\n // import keras\n // import numpy as np\n // import tensorflow as tf\n //\n // with tf.Session() as sess:\n // x = tf.Variable(np.array(\n // [[0], [0], [0], [1], [1], [1]],\n // dtype=np.float32))\n // y = tf.Variable(np.array(\n // [[0], [0.5], [1], [0], [0.5], [1]],\n // dtype=np.float32))\n // z = keras.metrics.binary_crossentropy(x, y)\n //\n // sess.run(tf.global_variables_initializer())\n // print(sess.run(z))\n // ```\n const x = tensor2d([[0], [0], [0], [1], [1], [1]]);\n const y = tensor2d([[0], [0.5], [1], [0], [0.5], [1]]);\n const accuracy = tfl.metrics.binaryCrossentropy(x, y);\n expectTensorsClose(accuracy, tensor1d([\n 1.00000015e-07, 6.93147182e-01, 1.59423847e+01,\n 1.61180954e+01, 6.93147182e-01, 1.19209332e-07\n ]));\n });\n it('2D one-hot binary yTrue', () => {\n // Use the following Python code to generate the reference values:\n // ```python\n // import keras\n // import numpy as np\n // import tensorflow as tf\n //\n // with tf.Session() as sess:\n // x = tf.Variable(np.array(\n // [[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]],\n // dtype=np.float32))\n // y = tf.Variable(np.array(\n // [[1, 0], [0.5, 0.5], [0, 1], [1, 0], [0.5, 0.5], [0, 1]],\n // dtype=np.float32))\n // z = keras.metrics.binary_crossentropy(x, y)\n //\n // sess.run(tf.global_variables_initializer())\n // print(sess.run(z))\n // ```\n const x = tensor2d([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]);\n const y =\n tensor2d([[1, 0], [0.5, 0.5], [0, 1], [1, 0], [0.5, 0.5], [0, 1]]);\n const accuracy = tfl.metrics.binaryCrossentropy(x, y);\n expectTensorsClose(accuracy, tensor1d([\n 1.0960467e-07, 6.9314718e-01, 1.6030239e+01,\n 1.6030239e+01, 6.9314718e-01, 1.0960467e-07\n ]));\n });\n});\n\ndescribeMathCPUAndGPU('categoricalAccuracy', () => {\n it('1D', () => {\n const x = tensor1d([0, 0, 0, 1]);\n const y = tensor1d([0.1, 0.8, 0.05, 0.05]);\n const accuracy = tfl.metrics.categoricalAccuracy(x, y);\n expect(accuracy.dtype).toEqual('float32');\n expect(accuracy.shape).toEqual([]);\n expect(Array.from(accuracy.dataSync())).toEqual([0]);\n });\n it('2D', () => {\n const x = tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]], [2, 4]);\n const y =\n tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]], [2, 4]);\n const accuracy = tfl.metrics.categoricalAccuracy(x, y);\n expect(accuracy.dtype).toEqual('float32');\n expect(accuracy.shape).toEqual([2]);\n expect(Array.from(accuracy.dataSync())).toEqual([0, 1]);\n });\n});\n\ndescribeMathCPUAndGPU('categoricalCrossentropy metric', () => {\n it('1D', () => {\n const x = tensor1d([0, 0, 0, 1]);\n const y = tensor1d([0.1, 0.8, 0.05, 0.05]);\n const accuracy = tfl.metrics.categoricalCrossentropy(x, y);\n expect(accuracy.dtype).toEqual('float32');\n expectTensorsClose(accuracy, scalar(2.995732));\n });\n it('2D', () => {\n const x = tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n const y = tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n const accuracy = tfl.metrics.categoricalCrossentropy(x, y);\n expect(accuracy.dtype).toEqual('float32');\n expectTensorsClose(accuracy, tensor1d([2.995732, 0.22314353]));\n });\n});\n\ndescribeMathCPUAndGPU('precision metric', () => {\n it('1D', () => {\n const x = tensor1d([0, 0, 0, 1]);\n const y = tensor1d([0, 0, 0, 1]);\n const precision = tfl.metrics.precision(x, y);\n expect(precision.dtype).toEqual('float32');\n expectTensorsClose(precision, scalar(1));\n });\n it('2D', () => {\n // Use the following Python code to generate the reference values:\n // ```python\n //\n // import tensorflow as tf\n // import numpy as np\n //\n // with tf.Session() as session:\n // labels = tf.constant([\n // [0, 0, 1],\n // [0, 0, 1],\n // [1, 0, 0],\n // [0, 1, 0]\n // ])\n // prediction = tf.constant([\n // [0, 0, 1],\n // [1, 0, 0],\n // [1, 0, 0],\n // [0, 1, 0]\n // ])\n //\n // output = tf.metrics.precision(\n // labels,\n // prediction\n // )\n //\n // init = tf.local_variables_initializer()\n // session.run(init)\n //\n // result = session.run(output)\n // print(result[0])\n // ```\n const x = tensor2d([[0, 0, 1], [0, 0, 1], [1, 0, 0], [0, 1, 0]]);\n const y = tensor2d([[0, 0, 1], [1, 0, 0], [1, 0, 0], [0, 1, 0]]);\n const precision = tfl.metrics.precision(x, y);\n expect(precision.dtype).toEqual('float32');\n expectTensorsClose(precision, scalar(0.75));\n });\n\n it('2D edge case', () => {\n const x = tensor2d([[0, 0, 1], [0, 0, 1], [1, 0, 0], [0, 1, 0]]);\n const y = tensor2d([[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]);\n const precision = tfl.metrics.precision(x, y);\n expect(precision.dtype).toEqual('float32');\n expectTensorsClose(precision, scalar(0));\n });\n});\n\ndescribeMathCPUAndGPU('recall metric', () => {\n it('1D', () => {\n const x = tensor1d([1, 0, 1, 0, 0, 0, 1]);\n const y = tensor1d([0, 0, 1, 1, 1, 1, 0]);\n const recall = tfl.metrics.recall(x, y);\n expect(recall.dtype).toEqual('float32');\n expectTensorsClose(recall, scalar(0.33333334));\n });\n it('2D', () => {\n // Use the following Python code to generate the reference values:\n // ```python\n //\n // import tensorflow as tf\n // import numpy as np\n //\n // with tf.Session() as session:\n // labels = tf.constant([\n // [0, 0, 1],\n // [0, 0, 1],\n // [1, 0, 0],\n // [0, 1, 0]\n // ])\n // prediction = tf.constant([\n // [0, 0, 1],\n // [1, 0, 0],\n // [1, 0, 0],\n // [0, 1, 0]\n // ])\n //\n // output = tf.metrics.recall(\n // labels,\n // prediction\n // )\n //\n // init = tf.local_variables_initializer()\n // session.run(init)\n //\n // result = session.run(output)\n // print(result[0])\n // ```\n const x = tensor2d([[0, 0, 1], [0, 0, 1], [1, 0, 0], [0, 1, 0]]);\n const y = tensor2d([[0, 0, 1], [1, 0, 0], [1, 0, 0], [0, 1, 0]]);\n const recall = tfl.metrics.recall(x, y);\n expect(recall.dtype).toEqual('float32');\n expectTensorsClose(recall, scalar(0.75));\n });\n\n it('2D edge case', () => {\n const x = tensor2d([[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]);\n const y = tensor2d([[0, 0, 1], [1, 0, 0], [1, 0, 0], [0, 1, 0]]);\n const recall = tfl.metrics.recall(x, y);\n expect(recall.dtype).toEqual('float32');\n expectTensorsClose(recall, scalar(0));\n });\n});\n\ndescribe('metrics.get', () => {\n it('valid name, not alias', () => {\n expect(get('binaryAccuracy') === get('categoricalAccuracy')).toEqual(false);\n });\n it('valid name, alias', () => {\n expect(get('mse') === get('MSE')).toEqual(true);\n });\n it('invalid name', () => {\n expect(() => get('InvalidMetricName')).toThrowError(/Unknown metric/);\n });\n it('LossOrMetricFn input', () => {\n expect(get(binaryAccuracy)).toEqual(binaryAccuracy);\n expect(get(categoricalAccuracy)).toEqual(categoricalAccuracy);\n });\n});\n\ndescribe('getLossOrMetricName', () => {\n it('string short cut name', async () => {\n const fnName = getLossOrMetricName('meanSquaredError');\n expect(fnName).toEqual('meanSquaredError');\n });\n\n it('function included in losses map', async () => {\n const fnName = getLossOrMetricName(tfl.metrics.meanSquaredError);\n expect(fnName).toEqual('meanSquaredError');\n });\n\n it('function included in metrics map', async () => {\n const fnName = getLossOrMetricName(tfl.metrics.categoricalAccuracy);\n expect(fnName).toEqual('categoricalAccuracy');\n });\n\n it('function not included in losses map or metrics map', async () => {\n const fakeMetric: LossOrMetricFn = (yTrue: Tensor, yPred: Tensor) =>\n tensor([1]);\n const fnName = getLossOrMetricName(fakeMetric);\n expect(fnName).toEqual('fakeMetric');\n });\n\n it('throws null', async () => {\n expect(() => getLossOrMetricName(null)).toThrowError();\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-layers/dist/miniprogram/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js deleted file mode 100644 index 0d664f5ca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.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)}(this,(function(t,e){"use strict";function n(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function r(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function i(t,e=[],n=!1){if(null==e&&(e=[]),Array.isArray(t)||h(t)&&!n)for(let r=0;re)):[].concat(t)).every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),r(t.every((t=>o(t))),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function h(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function c(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error(`Unknown dtype ${t}`)}function p(t){return"string"==typeof t||t instanceof String}function d(t){return Array.isArray(t)?d(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":"number"==typeof t?"float32":p(t)?"string":function(t){return"boolean"==typeof t}(t)?"bool":"float32"}function f(t){return!!(t&&t.constructor&&t.call&&t.apply)}function g(t){const e=t.length;if(e<2)return[];const n=new Array(e-1);n[e-2]=t[e-1];for(let r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n}function m(t,e,n,r=!1){const i=new Array;if(1===e.length){const a=e[0]*(r?2:1);for(let e=0;et*e))*(r?2:1);for(let e=0;et*e))*(n?2:1);if(0===r)return[];if(r!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return m(0,t,e,n)}function v(t,e){const n=b(t,e);for(let t=0;t{const[e,n]=t.split(":");this.urlFlags[e]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}(e,n)}))}}}function x(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((t,...n)=>(function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(e,n[0],n[1]),n.join("=")))),e}function I(){return z}let N,z=null;function A(){if(null==N){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof global)t=global;else if("undefined"!=typeof process)t=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}N=t}return N}function C(t,e){const n=function(){const t=A();return null==t._tfGlobals&&(t._tfGlobals=new Map),t._tfGlobals}();if(n.has(t))return n.get(t);{const r=e();return n.set(t,r),n.get(t)}}const D="Acos",T="Acosh",E="Add",F="ArgMax",L="ArgMin",_="Asin",R="Asinh",M="Atan",O="Atanh",B="Atan2",$="AvgPool",P="BatchMatMul",W="BatchToSpaceND",U="Cast",K="Ceil",j="ClipByValue",V="ComplexAbs",q="Concat",G="Conv2D",H="Conv2DBackpropInput",J="Cosh",Z="Cumsum",X="DepthwiseConv2dNative",Y="Dilation2D",Q="RealDiv",tt="ExpandDims",et="Expm1",nt="Floor",rt="FloorDiv",it="FusedBatchNorm",at="GatherV2",st="GreaterEqual",ot="Identity",ut="IsFinite",lt="IsInf",ht="IsNan",ct="LeakyRelu",pt="Log1p",dt="Maximum",ft="MaxPool",gt="Mean",mt="Minimum",yt="MirrorPad",vt="Multiply",bt="OnesLike",wt="OneHot",kt="Pack",St="PadV2",xt="Prelu",It="Reciprocal",Nt="Relu",zt="Reshape",At="ResizeNearestNeighbor",Ct="ResizeBilinear",Dt="Relu6",Tt="Reverse",Et="Round",Ft="Rsqrt",Lt="Select",_t="Selu",Rt="Slice",Mt="Sinh",Ot="Sign",Bt="Sigmoid",$t="Softplus",Pt="Sqrt",Wt="SpaceToBatchND",Ut="SplitV",Kt="Softmax",jt="SquaredDifference",Vt="Tanh",qt="Tile",Gt="Transpose",Ht="Unpack",Jt="UnsortedSegmentSum",Zt="ZerosLike",Xt="Step",Yt=C("kernelRegistry",(()=>new Map)),Qt=C("gradRegistry",(()=>new Map));function te(t,e){const n=function(t,e){return`${e}_${t}`}(t,e);return Yt.get(n)}function ee(t){return Qt.get(t)}function ne(t){const e=Yt.entries(),n=[];for(;;){const{done:r,value:i}=e.next();if(r)break;const[a,s]=i,[o]=a.split("_");o===t&&n.push(s)}return n}function re(t){const{kernelName:e}=t;Qt.has(e)&&I().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${e}'`),Qt.set(e,t)}function ie(t,e){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=i(t)),I().getBool("DEBUG")&&function(t,e){for(let n=0;n{r=n()};let a;const s=ae();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(i);else{i();for(const t of r)t.dataSync();a=Promise.resolve({kernelMs:ae()-s})}if(I().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let e=0;e{ue(e,n.dtype,t)}))}return{kernelName:t,outputs:r,inputs:e,timeMs:a.then((t=>t.kernelMs)),extraInfo:a.then((t=>null!=t.getExtraProfileInfo?t.getExtraProfileInfo():""))}}logKernelProfile(t){const{kernelName:e,outputs:n,timeMs:r,inputs:i,extraInfo:a}=t;n.forEach((t=>{Promise.all([t.data(),r,a]).then((n=>{this.logger.logKernelProfile(e,t,n[0],n[1],i,n[2])}))}))}}function ue(t,e,n){if("float32"!==e)return!1;for(let e=0;e0?r:""} `}}console.log(`%c${o}\t%c${s}\t%c${l}D ${c}\t%c${h}\t%c${p}\t%c${a}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function he(t,e,n,r){const i=g(e),s=function(t,e,n,r){const i=a(e),s=r[r.length-1],o=new Array(s).fill(0),u=e.length,l="complex64"===n?fe(t):t;if(u>1)for(let t=0;t" "+t)).join("\n")),l.join("\n")}function ce(t,e,n){let r;return r=Array.isArray(t)?`${parseFloat(t[0].toFixed(7))} + ${parseFloat(t[1].toFixed(7))}j`:p(t)?`'${t}'`:"bool"===n?pe(t):parseFloat(t.toFixed(7)).toString(),u(r,e)}function pe(t){return 0===t?"false":"true"}function de(t,e,n,r,i,a=!0){const s="complex64"===n?2:1,o=e[0],u=e.length;if(0===u){if("complex64"===n){return[ce(fe(t)[0],0,n)]}return"bool"===n?[pe(t[0])]:[t[0].toString()]}if(1===u){if(o>20){const e=3*s;let r=Array.from(t.slice(0,e)),a=Array.from(t.slice((o-3)*s,o*s));return"complex64"===n&&(r=fe(r),a=fe(a)),["["+r.map(((t,e)=>ce(t,i[e],n))).join(", ")+", ..., "+a.map(((t,e)=>ce(t,i[o-3+e],n))).join(", ")+"]"]}return["["+("complex64"===n?fe(t):Array.from(t)).map(((t,e)=>ce(t,i[e],n))).join(", ")+"]"]}const l=e.slice(1),h=r.slice(1),c=r[0]*s,p=[];if(o>20){for(let e=0;e<3;e++){const r=e*c,a=r+c;p.push(...de(t.slice(r,a),l,n,h,i,!1))}p.push("...");for(let e=o-3;ese(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataSync(){this.throwIfDisposed();const t=ge().readSync(this.dataId);if("string"===this.dtype)try{return t.map((t=>se(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();const t=await ge().read(this.dataId);return"string"===this.dtype?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(ge().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return me.print(this,t)}clone(){return this.throwIfDisposed(),me.clone(this)}toString(t=!1){return he(this.dataSync(),this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),me.cast(this,t)}variable(t=!0,e,n){return this.throwIfDisposed(),ge().makeVariable(this,t,e,n)}}function ve(){return C("Tensor",(()=>ye))}Object.defineProperty(ye,Symbol.hasInstance,{value:t=>!!t&&null!=t.data&&null!=t.dataSync&&null!=t.throwIfDisposed}),ve();class be extends ye{constructor(t,e,n,r){super(t.shape,t.dtype,t.dataId,r),this.trainable=e,this.name=n}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!s(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);ge().disposeTensor(this),this.dataId=t.dataId,ge().incRef(this,null)}dispose(){ge().disposeVariable(this),this.isDisposedInternal=!0}}var we,ke,Se,xe,Ie;Object.defineProperty(be,Symbol.hasInstance,{value:t=>t instanceof ye&&null!=t.assign&&t.assign instanceof Function}),function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(we||(we={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(ke||(ke={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(Se||(Se={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(xe||(xe={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(Ie||(Ie={}));const Ne={float32:xe,int32:ke,bool:Se,complex64:Ie};function ze(t,e){if(t.dtype===e.dtype)return[t,e];const n=function(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return Ne[t][e]}(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function Ae(t){const e=[];return Ce(t,e,new Set),e}function Ce(t,e,n){if(null==t)return;if(t instanceof ye)return void e.push(t);if(r=t,!Array.isArray(r)&&"object"!=typeof r)return;var r;const i=t;for(const t in i){const r=i[t];n.has(r)||(n.add(r),Ce(r,e,n))}}function De(t){return null!=t.kernelName}class Te{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((t=>t.name))))}}}dispose(){for(const t in this.registeredVariables)this.registeredVariables[t].dispose()}}class Ee{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Te}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const t=this.getSortedBackends();for(let e=0;e{null!=t.setupFunc&&t.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(t){ne(t).forEach((e=>{null!=e.disposeFunc&&e.disposeFunc(this.registry[t])}))}initializeBackend(t){const e=this.registryFactory[t];if(null==e)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{const r=e.factory();if(!r||r instanceof class{refCount(t){return n("refCount")}incRef(t){return n("incRef")}timerAvailable(){return!0}time(t){return n("time")}read(t){return n("read")}readSync(t){return n("readSync")}numDataIds(){return n("numDataIds")}disposeData(t,e){return n("disposeData")}write(t,e,r){return n("write")}move(t,e,r,i,a){return n("move")}memory(){return n("memory")}floatPrecision(){return n("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return n("dispose")}}||"function"!=typeof r.then)return this.registry[t]=r,{success:!0,asyncInit:!1};{const e=++this.pendingBackendInitId,n=r.then((n=>!(e(ethis.registryFactory[e].priority-this.registryFactory[t].priority))}initializeBackendsAndReturnBest(){const t=this.getSortedBackends();for(let e=0;ethis.startScope(r)),(()=>this.endScope(n)),(()=>(n=e(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(t,e,n){t();try{const t=n();return e(),t}catch(t){throw e(),t}}nextTensorId(){return Ee.nextTensorId++}nextVariableId(){return Ee.nextVariableId++}clone(t){const e=Fe.runKernel(ot,{x:t}),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],(t=>({x:()=>{const e={x:t},n={dtype:"float32"};return Fe.runKernel(U,e,n)}})),[],{}),e}runKernel(t,e,n){if(!(null!=te(t,this.backendName)))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,n){const r=this.backend.numDataIds();let i=0;n.forEach((t=>{i+="complex64"===t.dtype?3:1}));const a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=r-e-i-a;if(s>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${s} data ids) after running '${t}'`)}runKernelFunc(t){let e,n=[];const i=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;let o,u;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=De(t)?t.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(De(t)){const{kernelName:e,inputs:a,attrs:s}=t;null==this.backendName&&this.backend;const l=te(e,this.backendName);r(null!=l,(()=>`Cannot find registered kernel '${e}' for backend '${this.backendName}'`)),o=()=>{const t=this.backend.numDataIds();u=l.kernelFunc({inputs:a,attrs:s,backend:this.backend});const r=Array.isArray(u)?u:[u];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(e,t,r);const o=r.map((t=>{if(null!=t.rank)return t;const{dataId:e,shape:n,dtype:r}=t;return this.makeTensorFromDataId(e,n,r)}));if(i){const t=this.getTensorsForGradient(e,a,o);n=this.saveTensorsForBackwardMode(t)}return o}}else{const{forwardFunc:e}=t,r=t=>{i&&(n=t.map((t=>this.keep(this.clone(t)))))};o=()=>{const t=this.backend.numDataIds();u=this.tidy((()=>e(this.backend,r)));const n=Array.isArray(u)?u:[u];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,t,n),n}}const{inputs:h,attrs:c}=t,p=De(t)?null:t.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,h,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),e=d.outputs):e=o()})),i&&this.addTapeNode(l,h,e,p,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(h).map((t=>null!=h[t]?h[t].shape:null)),outputShapes:e.map((t=>t.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(u)?e:e[0]}saveTensorsForBackwardMode(t){return t.map((t=>this.keep(this.clone(t))))}getTensorsForGradient(t,e,n){const i=ee(t);if(null!=i){const t=i.inputsToSave||[],a=i.outputsToSave||[];let s;i.saveAllInputs?(r(Array.isArray(e),(()=>"saveAllInputs is true, expected inputs to be an array.")),s=Object.keys(e).map((t=>e[t]))):s=t.map((t=>e[t]));const o=n.filter(((t,e)=>a[e]));return s.concat(o)}return[]}makeTensor(t,e,n,r){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let i=t;"string"===n&&p(t[0])&&(i=t.map((t=>function(t,e="utf-8"){return e=e||"utf-8",I().platform.encode(t,e)}(t))));const a=r.write(i,e,n),s=new ye(e,n,a,this.nextTensorId());if(this.trackTensor(s,r),"string"===n){const t=this.state.tensorInfo.get(a),e=function(t){if(null==t)return 0;let e=0;return t.forEach((t=>e+=t.length)),e}(i);this.state.numBytes+=e-t.bytes,t.bytes=e}return s}makeTensorFromDataId(t,e,n,r){const i=new ye(e,n=n||"float32",t,this.nextTensorId());return this.trackTensor(i,r),i}makeVariable(t,e=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==t.dtype&&(t=t.cast(r));const i=new be(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(t,e){this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(n=t.size*c(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof be||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;const e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,"string"===t.dtype&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),"complex64"!==t.dtype&&"string"!==t.dtype){const e=t.size*c(t.dtype);this.state.numBytes-=e}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(const t in this.state.registeredVariables){const e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]}memory(){const t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;const e=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((t=>t.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const t of this.state.activeProfile.kernels)t.kernelTimeMs=await t.kernelTimeMs,t.extraInfo=await t.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(t,e,n,r,i,a){const s={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},o=ee(t);null!=o&&(r=o.gradFunc),null!=r&&(s.gradient=t=>(t=t.map(((t,e)=>{if(null==t){const t=n[e],r=b(t.size,t.dtype);return this.makeTensor(r,t.shape,t.dtype)}return t})),r(t.length>1?t:t[0],i,a))),this.state.activeTape.push(s)}keep(t){return t.kept=!0,t}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){const e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){const e=Ae(t),n=new Set(e.map((t=>t.id)));for(let t=0;t{t.kept||t.scopeId!==r.id||this.track(t)}))}gradients(t,e,n,i=!1){if(r(e.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const o=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",t)));r(o instanceof ye,(()=>"The result y returned by f() must be a tensor."));const u=function(t,e,n){const r={},i={};for(let t=0;tr[t.id]=!0)),o=!0,i[a.id]=!0;break}if(o)break}}const a={};a[n.id]=!0;const s={};for(let e=t.length-1;e>=0;e--){const n=t[e],r=n.inputs;for(let t=0;t0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const t={};t[o.id]=null==n?function(t){const e=v(a(t),"float32");return Fe.makeTensor(e,t,"float32")}(o.shape):n,function(t,e,n,r){for(let i=e.length-1;i>=0;i--){const a=e[i],o=[];if(a.outputs.forEach((e=>{const n=t[e.id];null!=n?o.push(n):o.push(null)})),null==a.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${a.kernelName}.`);const u=a.gradient(o);for(const e in a.inputs){if(!(e in u))throw new Error(`Cannot backprop through input ${e}. Available gradients found: ${Object.keys(u)}.`);const i=n((()=>u[e]()));if("float32"!==i.dtype)throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input ${e} must have 'float32' dtype, but has '${i.dtype}'`);const o=a.inputs[e];if(!s(i.shape,o.shape))throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input '${e}' has shape '${i.shape}', which does not match the shape of the input '${o.shape}'`);if(null==t[o.id])t[o.id]=i;else{const e=t[o.id];t[o.id]=r(e,i),e.dispose()}}}}(t,u,(t=>this.tidy(t)),Le);const r=e.map((e=>t[e.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((t=>{for(const e of t.saved)e.dispose()})),this.state.activeTape=null),{value:o,grads:r}}))}customGrad(t){return r(f(t),(()=>"The f passed in customGrad(f) must be a function.")),(...e)=>{let n;r(e.every((t=>t instanceof ye)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const i={};e.forEach(((t,e)=>{i[e]=t}));return this.runKernelFunc({forwardFunc:(i,a)=>(n=t(...e,a),r(n.value instanceof ye,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),r(f(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(t,i)=>{const a=n.gradFunc(t,i),s=Array.isArray(a)?a:[a];r(s.length===e.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),r(s.every((t=>t instanceof ye)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return s.forEach(((t,e)=>{o[e]=()=>t})),o},inputs:i})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}async time(t){const e=ae(),n=await this.backend.time(t);return n.wallMs=ae()-e,n}track(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Te;for(const t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Ee.nextTensorId=0,Ee.nextVariableId=0;const Fe=function(){const t=A();if(null==t._tfengine){const e=new S(t);t._tfengine=new Ee(e)}var e;return e=t._tfengine.ENV,z=e,ge=()=>t._tfengine,t._tfengine}();function Le(t,e){const n={a:t,b:e};return Fe.runKernel(E,n)}function _e(t,e){let n=t;if(h(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];const r=[];for(;Array.isArray(n)||h(n)&&"string"!==e;)r.push(n.length),n=n[0];return Array.isArray(t)&&I().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Re(t,r,[]),r}function Re(t,e,n){if(n=n||[],!Array.isArray(t)&&!h(t))return void r(0===e.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`));r(e.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`)),r(t.length===e[0],(()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`));const i=e.slice(1);for(let e=0;e=0&&(a=r),Me(r,a,e,n),null==t||!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){const r=null==t?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const s=_e(t,a);h(t)||Array.isArray(t)||(t=[t]);const o="string"!==a?ie(t,a):i(t,[],!0);return Fe.makeTensor(o,s,a)}function Be(t,e,n,r="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map(((t,i)=>Oe(t,`${e}[${i}]`,n,r)))}function $e(t){const e=Object.keys(t);if(1!==e.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const i=(...t)=>{Fe.startScope(n);try{const e=r(...t);return w(e)&&console.error("Cannot return a Promise inside of tidy."),Fe.endScope(e),e}catch(t){throw Fe.endScope(null),t}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}const Pe=$e({abs_:function(t){const e=Oe(t,"x","abs");if("complex64"===e.dtype){const t={x:e};return Fe.runKernel(V,t)}{const t={x:e};return Fe.runKernel("Abs",t)}}});const We=$e({acos_:function(t){const e={x:Oe(t,"x","acos")};return Fe.runKernel(D,e)}});const Ue=$e({acosh_:function(t){const e={x:Oe(t,"x","acosh")};return Fe.runKernel(T,e)}});const Ke=$e({add_:function(t,e){let n=Oe(t,"a","add"),r=Oe(e,"b","add");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(E,i)}});const je=$e({all_:function(t,e=null,n=!1){const r={x:Oe(t,"x","all","bool")},i={axis:e,keepDims:n};return Fe.runKernel("All",r,i)}});const Ve=$e({any_:function(t,e=null,n=!1){const r={x:Oe(t,"x","any","bool")},i={axis:e,keepDims:n};return Fe.runKernel("Any",r,i)}});const qe=$e({argMax_:function(t,e=0){const n={x:Oe(t,"x","argMax")},r={axis:e};return Fe.runKernel(F,n,r)}});const Ge=$e({argMin_:function(t,e=0){const n={x:Oe(t,"x","argMin")},r={axis:e};return Fe.runKernel(L,n,r)}});const He=$e({asin_:function(t){const e={x:Oe(t,"x","asin")};return Fe.runKernel(_,e)}});const Je=$e({asinh_:function(t){const e={x:Oe(t,"x","asinh")};return Fe.runKernel(R,e)}});const Ze=$e({atan_:function(t){const e={x:Oe(t,"x","atan")};return Fe.runKernel(M,e)}});const Xe=$e({atan2_:function(t,e){let n=Oe(t,"a","atan2"),r=Oe(e,"b","atan2");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(B,i)}});const Ye=$e({atanh_:function(t){const e={x:Oe(t,"x","atanh")};return Fe.runKernel(O,e)}});const Qe=$e({cast_:function(t,e){const n=Oe(t,"x","cast");if(!function(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const r={x:n},i={dtype:e};return Fe.runKernel(U,r,i)}});function tn(t,e,n,r,i,a,s="channelsLast"){const[o,u]=en(e);let l;if("channelsLast"===s)l=[o,u,t[3],t[3]];else{if("channelsFirst"!==s)throw new Error(`Unknown dataFormat ${s}`);l=[o,u,t[1],t[1]]}return function(t,e,n,r,i,a,s=!1,o="channelsLast"){let[u,l,h,c]=[-1,-1,-1,-1];if("channelsLast"===o)[u,l,h,c]=t;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[u,c,l,h]=t}const[p,d,,f]=e,[g,m]=en(n),[y,v]=en(r),b=nn(p,y),w=nn(d,v),{padInfo:k,outHeight:S,outWidth:x}=function(t,e,n,r,i,a,s,o,u){let l,h,c;if("number"==typeof t){l={top:t,bottom:t,left:t,right:t,type:0===t?"VALID":"NUMBER"};const i=function(t,e,n,r,i){null==r&&(r=function(t,e,n,r=1){const i=nn(e,r);return Math.floor((t[0]*(n-1)-n+i)/2)}(t,e,n));const a=t[0],s=t[1],o=rn((a-e+2*r)/n+1,i),u=rn((s-e+2*r)/n+1,i);return[o,u]}([e,n],a,r,t,o);h=i[0],c=i[1]}else if("same"===t){h=Math.ceil(e/r),c=Math.ceil(n/i);const t=Math.max(0,(h-1)*r+a-e),o=Math.max(0,(c-1)*i+s-n),u=Math.floor(t/2),p=t-u,d=Math.floor(o/2);l={top:u,bottom:p,left:d,right:o-d,type:"SAME"}}else if("valid"===t)l={top:0,bottom:0,left:0,right:0,type:"VALID"},h=Math.ceil((e-a+1)/r),c=Math.ceil((n-s+1)/i);else{if("object"!=typeof t)throw Error(`Unknown padding parameter: ${t}`);{const p="channelsLast"===u?t[1][0]:t[2][0],d="channelsLast"===u?t[1][1]:t[2][1],f="channelsLast"===u?t[2][0]:t[3][0],g="channelsLast"===u?t[2][1]:t[3][1];l={top:p,bottom:d,left:f,right:g,type:0===p&&0===d&&0===f&&0===g?"VALID":"EXPLICIT"},h=rn((e-a+p+d)/r+1,o),c=rn((n-s+f+g)/i+1,o)}}return{padInfo:l,outHeight:h,outWidth:c}}(i,l,h,g,m,b,w,a,o),I=s?f*c:f;let N;"channelsFirst"===o?N=[u,I,S,x]:"channelsLast"===o&&(N=[u,S,x,I]);return{batchSize:u,dataFormat:o,inHeight:l,inWidth:h,inChannels:c,outHeight:S,outWidth:x,outChannels:I,padInfo:k,strideHeight:g,strideWidth:m,filterHeight:p,filterWidth:d,effectiveFilterHeight:b,effectiveFilterWidth:w,dilationHeight:y,dilationWidth:v,inShape:t,outShape:N,filterShape:e}}(t,l,n,r,i,a,!1,s)}function en(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function nn(t,e){return e<=1?t:t+(t-1)*(e-1)}function rn(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function an(t){const[e,n,r]=en(t);return 1===e&&1===n&&1===r}function sn(t,e){return an(t)||an(e)}const on=$e({reshape_:function(t,e){const n={x:Oe(t,"x","reshape","string_or_numeric")},r={shape:e};return Fe.runKernel(zt,n,r)}});const un=$e({avgPool_:function(t,e,n,i,a){const s=Oe(t,"x","avgPool","float32");r(sn(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===u.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${u.rank}.`)),null!=a&&r(o(i),(()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const h={x:u},c={filterSize:e,strides:n,pad:i,dimRoundingMode:a};let p=Fe.runKernel($,h,c);return p=Qe(p,s.dtype),l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const ln=$e({clone_:function(t){const e={x:Oe(t,"x","clone","string_or_numeric")};return Fe.runKernel(ot,e)}});const hn=$e({concat_:function(t,e=0){r(t.length>=1,(()=>"Pass at least one tensor to concat"));const n=Be(t,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((t=>{if("complex64"!==t.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${t.dtype}. `)})),1===n.length)return ln(n[0]);const i=n,a={axis:e};return Fe.runKernel(q,i,a)}});const cn=$e({matMul_:function(t,e,n=!1,r=!1){let i=Oe(t,"a","matMul"),a=Oe(e,"b","matMul");[i,a]=ze(i,a);const s={a:i,b:a},o={transposeA:n,transposeB:r};return Fe.runKernel(P,s,o)}});const pn=$e({mul_:function(t,e){let n=Oe(t,"a","mul"),r=Oe(e,"b","mul");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(vt,i)}});const dn=$e({sigmoid_:function(t){const e={x:Oe(t,"x","sigmoid")};return Fe.runKernel(Bt,e)}});const fn=$e({slice_:function(t,e,n){const r=Oe(t,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const i={x:r},a={begin:e,size:n};return Fe.runKernel(Rt,i,a)}});const gn=$e({tanh_:function(t){const e={x:Oe(t,"x","tanh")};return Fe.runKernel(Vt,e)}});const mn=$e({batchToSpaceND_:function(t,e,n){const i=Oe(t,"x","batchToSpaceND"),a=e.reduce(((t,e)=>t*e));r(i.rank>=1+e.length,(()=>`input rank is ${i.rank} but should be > than blockShape.length ${e.length}`)),r(n.length===e.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`)),r(i.shape[0]%a==0,(()=>`input tensor batch is ${i.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${a}`));const s={x:i},o={blockShape:e,crops:n};return Fe.runKernel(W,s,o)}});const yn=$e({batchNorm_:function(t,e,n,i,a,s){null==s&&(s=.001);const o=Oe(t,"x","batchNorm"),u=Oe(e,"mean","batchNorm"),l=Oe(n,"variance","batchNorm");let h,c;null!=a&&(h=Oe(a,"scale","batchNorm")),null!=i&&(c=Oe(i,"offset","batchNorm")),r(u.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),r(null==c||u.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),r(null==h||u.rank===h.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const p={x:function(t){let e;return e=0===t.rank||1===t.rank?on(t,[1,1,1,t.size]):2===t.rank?on(t,[1,1,t.shape[0],t.shape[1]]):3===t.rank?on(t,[1,t.shape[0],t.shape[1],t.shape[2]]):t,e}(o),scale:h,offset:c,mean:u,variance:l},d={varianceEpsilon:s},f=Fe.runKernel(it,p,d);return on(f,o.shape)}});const vn=$e({broadcastTo_:function(t,e){let n=Oe(t,"broadcastTo","x");const r=n.shape;if(e.some((t=>!(t>0)||t%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const t=n.shape.slice();for(;t.length=0;t--)if(i[t]===e[t])a[t]=1;else if(1!==n.shape[t])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(0===a.map(((t,e)=>t>1?e:-1)).filter((t=>t>=0)).length)return ln(n);const s={x:n},o={reps:a};return Fe.runKernel(qt,s,o)}});const bn=$e({ceil_:function(t){const e={x:Oe(t,"x","ceil")};return Fe.runKernel(K,e)}});const wn=$e({clipByValue_:function(t,e,n){const i=Oe(t,"x","clipByValue");r(e<=n,(()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`));const a={x:i},s={clipValueMin:e,clipValueMax:n};return Fe.runKernel(j,a,s)}});const kn=$e({complex_:function(t,e){const n=Oe(t,"real","complex"),i=Oe(e,"imag","complex");!function(t,e,n=""){r(s(t,e),(()=>n+` Shapes ${t} and ${e} must match`))}(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const a={real:n,imag:i};return Fe.runKernel("Complex",a)}});const Sn=$e({conv2d_:function(t,e,n,i,a="NHWC",s=[1,1],u){const l=Oe(t,"x","conv2d"),h=Oe(e,"filter","conv2d");let c=l,p=!1;3===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1],l.shape[2]])),r(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===h.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`)),null!=u&&r(o(i),(()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`));const d="NHWC"===a?c.shape[3]:c.shape[1];r(d===h.shape[2],(()=>`Error in conv2d: depth of input (${d}) must match input depth for filter ${h.shape[2]}.`)),r(sn(n,s),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`));const f={x:c,filter:h},g={strides:n,pad:i,dataFormat:a,dilations:s,dimRoundingMode:u},m=Fe.runKernel(G,f,g);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const xn=$e({conv1d_:function(t,e,n,i,a="NWC",s=1,u){const l=Oe(t,"x","conv1d"),h=Oe(e,"filter","conv1d");let c=l,p=!1;2===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1]])),r(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),r(3===h.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${h.rank}.`)),null!=u&&r(o(i),(()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`)),r(c.shape[2]===h.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${h.shape[1]}.`)),r(sn(n,s),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`)),r("NWC"===a,(()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`));const d=on(h,[1,h.shape[0],h.shape[1],h.shape[2]]),f=on(c,[c.shape[0],1,c.shape[1],c.shape[2]]),g=Sn(f,d,[1,n],i,"NHWC",[1,s],u);return on(g,p?[g.shape[2],g.shape[3]]:[g.shape[0],g.shape[2],g.shape[3]])}});const In=$e({conv2DBackpropInput_:function(t,e,n,i,a,s="NHWC",u){r(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let l=t,h=e,c=!1;3===e.rank&&(c=!0,h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]),l=[1,t[0],t[1],t[2]]),r(4===l.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${l.length}.`)),r(4===h.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${h.rank}`)),r(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const p="NHWC"===s?l[3]:l[1],d="NHWC"===s?h.shape[3]:h.shape[1];r(p===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${n.shape[2]}.`)),r(d===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[3]}.`)),null!=u&&r(o(a),(()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${u} but got pad ${a}.`));const f={dy:h,filter:n},g={strides:i,pad:a,dataFormat:s,dimRoundingMode:u,inputShape:l},m=Fe.runKernel(H,f,g);return c?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Nn=$e({conv2dTranspose_:function(t,e,n,r,i,a){const s=Oe(t,"x","conv2dTranspose"),o=Oe(e,"filter","conv2dTranspose");return In(n,s,o,r,i,"NHWC",a)}});const zn=$e({conv3DBackpropInput_:function(t,e,n,i,a){r(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let s=t,o=e,u=!1;4===e.rank&&(u=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),s=[1,t[0],t[1],t[2],t[3]]);const l=s[4],h=o.shape[4];r(5===s.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`)),r(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),r(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),r(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),r(h===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[4]}.`));const c={dy:o,filter:n},p={pad:a,strides:i,inputShape:s},d=Fe.runKernel("Conv3DBackpropInputV2",c,p);return u?on(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const An=$e({cos_:function(t){const e={x:Oe(t,"x","cos")};return Fe.runKernel("Cos",e)}});const Cn=$e({cosh_:function(t){const e={x:Oe(t,"x","cosh")};return Fe.runKernel(J,e)}});const Dn=$e({cumsum_:function(t,e=0,n=!1,r=!1){const i={x:Oe(t,"x","cumsum")},a={axis:e,exclusive:n,reverse:r};return Fe.runKernel(Z,i,a)}});const Tn=$e({depthToSpace_:function(t,e,n="NHWC"){const i=Oe(t,"x","depthToSpace"),a="NHWC"===n?i.shape[1]:i.shape[2],s="NHWC"===n?i.shape[2]:i.shape[3],o="NHWC"===n?i.shape[3]:i.shape[1];r(a*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${e} for depthToSpace with input shape\n ${i.shape}`)),r(s*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${e} for depthToSpace with input shape\n ${i.shape}`)),r(o%(e*e)==0,(()=>`Dimension size must be evenly divisible by ${e*e} but is ${o} for depthToSpace with input shape ${i.shape}`));const u={x:i},l={blockSize:e,dataFormat:n};return Fe.runKernel("DepthToSpace",u,l)}});const En=$e({depthwiseConv2d_:function(t,e,n,i,a="NHWC",s=[1,1],u){const l=Oe(t,"x","depthwiseConv2d"),h=Oe(e,"filter","depthwiseConv2d");let c=l,p=!1;3===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1],l.shape[2]])),r(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`)),r(c.shape[3]===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${h.shape[2]}.`)),null!=u&&r(o(i),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`));const d={x:c,filter:h},f={strides:n,pad:i,dataFormat:a,dilations:s,dimRoundingMode:u},g=Fe.runKernel(X,d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3]]):g}});const Fn=$e({dilation2d_:function(t,e,n,i,a=[1,1],s="NHWC"){const o=Oe(t,"x","dilation2d"),u=Oe(e,"filter","dilation2d");r(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),r(3===u.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${u.rank}.`)),r("NHWC"===s,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`));let l=o,h=!1;3===o.rank&&(l=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),h=!0);const c={x:l,filter:u},p={strides:n,pad:i,dilations:a},d=Fe.runKernel(Y,c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Ln=$e({floorDiv_:function(t,e){let n=Oe(t,"a","floorDiv"),r=Oe(e,"b","floorDiv");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(rt,i)}});const _n=$e({div_:function(t,e){let n=Oe(t,"a","div"),r=Oe(e,"b","div");if([n,r]=ze(n,r),"int32"===n.dtype&&"int32"===r.dtype)return Ln(n,r);const i={a:n,b:r};return Fe.runKernel(Q,i,{})}});function Rn(t,e){const n=[];for(let r=0;r1)&&n.unshift(a)}return n}function Mn(t,e){const n=[],r=Math.max(t.length,e.length);for(let i=0;i`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${i.rank}.`));const a=1===n.rank?n.size:n.shape[1],s=1===i.rank?i.size:i.shape[0];if(r(a===s,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`)),1===n.rank&&1===i.rank){const t=on(n,[1,-1]),e=on(i,[-1,1]),r=cn(t,e);return on(r,[])}if(1===n.rank&&2===i.rank){const t=on(n,[1,-1]),e=on(i,[i.shape[0],i.shape[1]]),r=cn(t,e);return on(r,[r.size])}if(2===n.rank&&1===i.rank){const t=on(i,[-1,1]),e=cn(n,t);return on(e,[e.size])}{const t=on(i,[i.shape[0],i.shape[1]]);return cn(n,t)}}});const Un=$e({elu_:function(t){const e={x:Oe(t,"x","elu")};return Fe.runKernel("Elu",e)}});const Kn=$e({erf_:function(t){let e=Oe(t,"x","erf");r("int32"===e.dtype||"float32"===e.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===e.dtype&&(e=Qe(e,"float32"));const n={x:e};return Fe.runKernel("Erf",n)}});const jn=$e({exp_:function(t){const e={x:Oe(t,"x","exp")};return Fe.runKernel("Exp",e)}});const Vn=$e({expandDims_:function(t,e=0){const n=Oe(t,"x","expandDims","string_or_numeric");r(e<=n.rank,(()=>"Axis must be <= rank of the tensor"));const i={input:n},a={dim:e};return Fe.runKernel(tt,i,a)}});const qn=$e({expm1_:function(t){const e={x:Oe(t,"x","expm1")};return Fe.runKernel(et,e)}});const Gn=$e({tile_:function(t,e){const n=Oe(t,"x","tile","string_or_numeric");r(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`));const i={x:n},a={reps:e};return Fe.runKernel(qt,i,a)}});const Hn=$e({floor_:function(t){const e={x:Oe(t,"x","floor")};return Fe.runKernel(nt,e)}});const Jn=$e({gather_:function(t,e,n=0,r=0){const i={x:Oe(t,"x","gather"),indices:Oe(e,"indices","gather","int32")},a={axis:n,batchDims:r};return Fe.runKernel(at,i,a)}});const Zn=$e({greater_:function(t,e){let n=Oe(t,"a","greater"),r=Oe(e,"b","greater");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("Greater",i)}});const Xn=$e({greaterEqual_:function(t,e){let n=Oe(t,"a","greaterEqual"),r=Oe(e,"b","greaterEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(st,i)}});const Yn=$e({imag_:function(t){const e={input:Oe(t,"input","imag")};return Fe.runKernel("Imag",e)}});const Qn=$e({isFinite_:function(t){const e={x:Oe(t,"x","isFinite")};return Fe.runKernel(ut,e)}});const tr=$e({isInf_:function(t){const e={x:Oe(t,"x","isInf")};return Fe.runKernel(lt,e)}});const er=$e({isNaN_:function(t){const e={x:Oe(t,"x","isNaN")};return Fe.runKernel(ht,e)}});const nr=$e({leakyRelu_:function(t,e=.2){const n={x:Oe(t,"x","leakyRelu")},r={alpha:e};return Fe.runKernel(ct,n,r)}});const rr=$e({less_:function(t,e){let n=Oe(t,"a","less"),r=Oe(e,"b","less");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("Less",i)}});const ir=$e({lessEqual_:function(t,e){let n=Oe(t,"a","lessEqual"),r=Oe(e,"b","lessEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LessEqual",i)}});const ar=$e({localResponseNormalization_:function(t,e=5,n=1,i=1,a=.5){const s=Oe(t,"x","localResponseNormalization");r(4===s.rank||3===s.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`)),r(o(e),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`));let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]]));const h={x:u},c={depthRadius:e,bias:n,alpha:i,beta:a},p=Fe.runKernel("LRN",h,c);return l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const sr=$e({log_:function(t){const e={x:Oe(t,"x","log")};return Fe.runKernel("Log",e)}});const or=$e({log1p_:function(t){const e={x:Oe(t,"x","log1p")};return Fe.runKernel(pt,e)}});function ur(t){return Fe.customGrad(t)}const lr=$e({neg_:function(t){const e={x:Oe(t,"x","neg")};return Fe.runKernel("Neg",e)}});const hr=$e({softplus_:function(t){const e={x:Oe(t,"x","softplus")};return Fe.runKernel($t,e)}});const cr=$e({logSigmoid_:function(t){const e=Oe(t,"x","logSigmoid");return ur((t=>({value:lr(hr(lr(t))),gradFunc:e=>pn(e,dn(lr(t)))})))(e)}});const pr=$e({max_:function(t,e=null,n=!1){const r={x:Oe(t,"x","max")},i={reductionIndices:e,keepDims:n};return Fe.runKernel("Max",r,i)}});const dr=$e({sub_:function(t,e){let n=Oe(t,"a","sub"),r=Oe(e,"b","sub");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Sub",i)}});const fr=$e({sum_:function(t,e=null,n=!1){let r=Oe(t,"x","sum");"bool"===r.dtype&&(r=Qe(r,"int32"));const i={x:r},a={axis:e,keepDims:n};return Fe.runKernel("Sum",i,a)}});const gr=$e({logSoftmax_:function(t,e=-1){const n=Oe(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return ur(((t,n)=>{const r=pr(t,e,!0),i=dr(t,r),a=dr(Qe(i,"float32"),sr(fr(jn(i),e,!0)));n([a]);return{value:a,gradFunc:(t,n)=>{const[r]=n,i=jn(r);return dr(t,pn(fr(t,e,!0),i))}}}))(n)}});function mr(t,e){return function(t,e,n){const r=t.length+e.length,i=[];let a=0,s=0;for(let o=0;o1)),e)}function yr(t){return t.map(((t,e)=>[e,t])).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}const vr=$e({logSumExp_:function(t,e=null,n=!1){const r=Oe(t,"x","logSumExp"),i=l(e,r.shape),a=pr(r,i,!0),s=dr(r,a),o=jn(s),u=fr(o,i),h=sr(u),c=Ke(on(a,h.shape),h);if(n){const t=mr(c.shape,i);return on(c,t)}return c}});const br=$e({logicalAnd_:function(t,e){const n=Oe(t,"a","logicalAnd","bool"),r=Oe(e,"b","logicalAnd","bool");Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LogicalAnd",i)}});const wr=$e({logicalNot_:function(t){const e={x:Oe(t,"x","logicalNot","bool")};return Fe.runKernel("LogicalNot",e)}});const kr=$e({logicalOr_:function(t,e){const n=Oe(t,"a","logicalOr","bool"),r=Oe(e,"b","logicalOr","bool");Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LogicalOr",i)}});const Sr=$e({logicalXor_:function(t,e){const n=Oe(t,"a","logicalXor","bool"),r=Oe(e,"b","logicalXor","bool");return Mn(n.shape,r.shape),br(kr(t,e),wr(br(t,e)))}});const xr=$e({maxPool_:function(t,e,n,i,a){const s=Oe(t,"x","maxPool");let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===u.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${u.rank}.`)),r(sn(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=a&&r(o(i),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const h={x:u},c={filterSize:e,strides:n,pad:i,dimRoundingMode:a},p=Fe.runKernel(ft,h,c);return l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const Ir=$e({maximum_:function(t,e){let n=Oe(t,"a","maximum"),r=Oe(e,"b","maximum");[n,r]=ze(n,r),"bool"===n.dtype&&(n=Qe(n,"int32"),r=Qe(r,"int32")),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(dt,i)}});const Nr=$e({mean_:function(t,e=null,n=!1){const r={x:Oe(t,"x","mean")},i={axis:e,keepDims:n};return Fe.runKernel(gt,r,i)}});function zr(t,e="float32"){if("complex64"===e){const e=zr(t,"float32"),n=zr(t,"float32");return kn(e,n)}const n=b(a(t),e);return Fe.makeTensor(n,t,e)}function Ar(t,e="float32"){if("complex64"===e){const e=Ar(t,"float32"),n=zr(t,"float32");return kn(e,n)}const n=v(a(t),e);return Fe.makeTensor(n,t,e)}const Cr=$e({min_:function(t,e=null,n=!1){const r={x:Oe(t,"x","min")},i={axis:e,keepDims:n};return Fe.runKernel("Min",r,i)}});const Dr=$e({minimum_:function(t,e){let n=Oe(t,"a","minimum"),r=Oe(e,"b","minimum");[n,r]=ze(n,r),"bool"===n.dtype&&(n=Qe(n,"int32"),r=Qe(r,"int32")),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(mt,i)}});const Tr=$e({mirrorPad_:function(t,e,n){r("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const i=Oe(t,"x","mirrorPad");if(0===i.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");r(e.length===i.rank,(()=>`Padding doesn't match input. Must be ${i.rank}. Got ${e.length}.`));const a="reflect"===n?1:0;for(let t=0;t"Invalid number of paddings. Must be length of 2 each.")),r(e[t][0]>=0&&e[t][0]<=i.shape[t]-a&&e[t][1]>=0&&e[t][1]<=i.shape[t]-a,(()=>`Padding in dimension ${t} cannot be greater than or equal to ${i.shape[t]-a} or less than 0 for input of shape ${i.shape}`));const s={paddings:e,mode:n},o={x:i};return Fe.runKernel(yt,o,s)}});const Er=$e({mod_:function(t,e){let n=Oe(t,"a","mod"),r=Oe(e,"b","mod");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Mod",i)}});const Fr=$e({square_:function(t){const e=Oe(t,"x","square");return Fe.runKernel("Square",{x:e},{})}});const Lr=$e({notEqual_:function(t,e){let n=Oe(t,"a","notEqual"),r=Oe(e,"b","notEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("NotEqual",i)}});const _r=$e({oneHot_:function(t,e,n=1,r=0){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:Oe(t,"indices","oneHot","int32")},a={depth:e,onValue:n,offValue:r};return Fe.runKernel(wt,i,a)}});const Rr=$e({onesLike_:function(t){const e={x:Oe(t,"x","onesLike")};return Fe.runKernel(bt,e)}});const Mr=$e({pad_:function(t,e,n=0){const r=Oe(t,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:n},a={x:r};return Fe.runKernel(St,a,i)}});const Or=$e({spaceToBatchND_:function(t,e,n){const i=Oe(t,"x","spaceToBatchND");r(i.rank>=1+e.length,(()=>`input rank ${i.rank} should be > than [blockShape] ${e.length}`)),r(n.length===e.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`)),r(i.shape.reduce(((t,r,i)=>i>0&&i<=e.length?t&&(r+n[i-1][0]+n[i-1][1])%e[i-1]==0:t),!0),(()=>`input spatial dimensions ${i.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`));const a={x:i},s={blockShape:e,paddings:n};return Fe.runKernel(Wt,a,s)}});const Br=$e({pool_:function(t,e,n,i,a,s){null==a&&(a=[1,1]),null==s&&(s=1),0===i&&(i="valid");const o=Oe(t,"x","maxPool");let u=o,l=!1;3===o.rank&&(l=!0,u=on(o,[1,o.shape[0],o.shape[1],o.shape[2]])),r(sn(s,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`));const h=tn(u.shape,e,s,a,i),c=[h.dilationHeight,h.dilationWidth];let p;p="same"===i?function(t,e){const n=t.map(((t,n)=>t+(t-1)*(e[n]-1))).map((t=>t-1)),r=n.map((t=>Math.floor(t/2))),i=n.map(((t,e)=>t-r[e]));return n.map(((t,e)=>[r[e],i[e]]))}([h.filterHeight,h.filterWidth],c):[[0,0],[0,0]];const d=1===c[0]&&1===c[1],[f,g]=function(t,e,n){const r=n.map((t=>t[0])),i=n.map((t=>t[1])),a=t.concat(r,i),s=e.map(((t,e)=>(t-a[e]%t)%t)),o=i.map(((t,e)=>t+s[e])),u=e.map(((t,e)=>[r[e],o[e]])),l=e.map(((t,e)=>[0,s[e]]));return[u,l]}([h.inHeight,h.inWidth],c,p),m=d?i:"valid",y=d?u:Or(u,c,f),v=("avg"===n?()=>un(y,e,s,m):()=>xr(y,e,s,m))(),b=d?v:mn(v,c,g);return l?on(b,[b.shape[1],b.shape[2],b.shape[3]]):b}});const $r=$e({pow_:function(t,e){let n=Oe(t,"base","pow"),r=Oe(e,"exp","pow");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Pow",i)}});const Pr=$e({prelu_:function(t,e){const n={x:Oe(t,"x","prelu"),alpha:Oe(e,"alpha","prelu")};return Fe.runKernel(xt,n)}});const Wr=$e({prod_:function(t,e=null,n=!1){let r=Oe(t,"x","prod");"bool"===r.dtype&&(r=Qe(r,"int32"));const i={x:r},a={axis:e,keepDims:n};return Fe.runKernel("Prod",i,a)}});const Ur=$e({real_:function(t){const e={input:Oe(t,"input","real")};return Fe.runKernel("Real",e)}});const Kr=$e({reciprocal_:function(t){const e={x:Oe(t,"x","reciprocal")};return Fe.runKernel(It,e)}});const jr=$e({relu_:function(t){const e={x:Oe(t,"x","relu")};return Fe.runKernel(Nt,e)}});const Vr=$e({relu6_:function(t){const e={x:Oe(t,"x","relu6")};return Fe.runKernel(Dt,e)}});const qr=$e({reverse_:function(t,e){const n={x:Oe(t,"x","reverse")},r={dims:e};return Fe.runKernel(Tt,n,r)}});const Gr=$e({round_:function(t){const e={x:Oe(t,"x","round")};return Fe.runKernel(Et,e)}});const Hr=$e({rsqrt_:function(t){const e={x:Oe(t,"x","rsqrt")};return Fe.runKernel(Ft,e)}});function Jr(t,e,n,s){if(null==s&&(s=d(t)),"complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){!function(t){t.forEach((e=>{r(Number.isInteger(e)&&e>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`))}))}(e);const t=a(e),i=a(n);r(t===i,(()=>`Based on the provided shape, [${e}], the tensor should have ${t} values but has ${i}`));for(let t=0;t`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `))}}return h(t)||Array.isArray(t)||(t=[t]),e=e||n,t="string"!==s?ie(t,s):i(t,[],!0),Fe.makeTensor(t,e,s)}function Zr(t,e){if((h(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&h(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Jr(t,[],[],e)}const Xr=$e({selu_:function(t){const e={x:Oe(t,"x","selu")};return Fe.runKernel(_t,e)}});const Yr=$e({separableConv2d_:function(t,e,n,i,a,s=[1,1],o="NHWC"){const u=Oe(t,"x","separableConv2d"),l=Oe(e,"depthwiseFilter","separableConv2d"),h=Oe(n,"pointwiseFilter","separableConv2d");let c=u,p=!1;if(3===u.rank&&(p=!0,c=on(u,[1,u.shape[0],u.shape[1],u.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");r(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),r(4===h.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),r(1===h.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${h.shape[0]}.`)),r(1===h.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${h.shape[1]}.`));const d=l.shape[2],f=l.shape[3];r(h.shape[2]===d*f,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*f}, but got ${h.shape[2]}.`));const g=En(c,l,i,a,o,s),m=Sn(g,h,1,"valid",o);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Qr=$e({sign_:function(t){const e={x:Oe(t,"x","sign")};return Fe.runKernel(Ot,e)}});const ti=$e({sin_:function(t){const e={x:Oe(t,"x","sin")};return Fe.runKernel("Sin",e)}});const ei=$e({sinh_:function(t){const e={x:Oe(t,"x","sinh")};return Fe.runKernel(Mt,e)}});const ni=$e({softmax_:function(t,e=-1){const n=Oe(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const r={logits:n},i={dim:e};return Fe.runKernel(Kt,r,i)}});const ri=$e({fft_:function(t){r("complex64"===t.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Fe.runKernel("FFT",e)}});const ii=$e({ifft_:function(t){r("complex64"===t.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Fe.runKernel("IFFT",e)}});const ai=$e({irfft_:function(t){const e=t.shape[t.shape.length-1],n=t.size/e;let r;if(e<=2){const i=on(t,[n,e]);r=ii(i)}else{const i=[n,2*(e-1)],a=on(Ur(t),[n,e]),s=on(Yn(t),[n,e]),o=qr(fn(a,[0,1],[n,e-2]),1),u=pn(qr(fn(s,[0,1],[n,e-2]),1),Zr(-1)),l=hn([a,o],1),h=hn([s,u],1),c=on(kn(l,h),[i[0],i[1]]);r=ii(c)}if(r=Ur(r),3===t.rank&&0!==t.shape[0]){const e=r,n=t.shape[0];r=on(r,[n,r.shape[0]/n,r.shape[1]]),e.dispose()}return r}});const si=$e({split_:function(t,e,n=0){const r={x:Oe(t,"x","split")},i={numOrSizeSplits:e,axis:n};return Fe.runKernel(Ut,r,i)}});const oi=$e({rfft_:function(t,e){r("float32"===t.dtype,(()=>`The dtype for rfft() must be real value but got ${t.dtype}`));let n=t.shape[t.shape.length-1];const i=t.size/n;let a;if(null!=e&&e0)),i=t.shape.map((t=>t));i[t.shape.length-1]=e,a=fn(t,r,i),n=e}else if(null!=e&&e>n){const r=t.shape.map((t=>t));r[t.shape.length-1]=e-n,a=hn([t,zr(r)],t.shape.length-1),n=e}else a=t;const s=$n(a),o=on(kn(a,s),[i,n]),u=ri(o),l=Math.floor(n/2)+1,h=Ur(u),c=Yn(u),p=si(h,[l,n-l],h.shape.length-1),d=si(c,[l,n-l],c.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=l,on(kn(p[0],d[0]),f)}});const ui=$e({sqrt_:function(t){const e={x:Oe(t,"x","sqrt")};return Fe.runKernel(Pt,e)}});const li=$e({squaredDifference_:function(t,e){let n=Oe(t,"a","squaredDifference"),r=Oe(e,"b","squaredDifference");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(jt,i,{})}});const hi=$e({squeeze_:function(t,e){const n=Oe(t,"x","squeeze");return on(n,function(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,a=null==e||i?null:l(e,t).sort();let s=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),a[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}(n.shape,e).newShape)}});const ci=$e({stack_:function(t,e=0){const n=Be(t,"tensors","stack","string_or_numeric");r(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&r(e<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,a={axis:e};return Fe.runKernel(kt,i,a)}});const pi=$e({step_:function(t,e=0){const n={x:Oe(t,"x","step")},r={alpha:e};return Fe.runKernel(Xt,n,r)}});const di=$e({stridedSlice_:function(t,e,n,r,i=0,a=0,s=0,o=0,u=0){const l={x:Oe(t,"x","stridedSlice")},h={begin:e,end:n,strides:r,beginMask:i,endMask:a,ellipsisMask:s,newAxisMask:o,shrinkAxisMask:u};return Fe.runKernel("StridedSlice",l,h)}});const fi=$e({tan_:function(t){const e={x:Oe(t,"x","tan")};return Fe.runKernel("Tan",e)}});const gi=$e({topk_:function(t,e=1,n=!0){const r=Oe(t,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=r.shape[r.shape.length-1];if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${e}`);const a={x:r},s={k:e,sorted:n},[o,u]=Fe.runKernel("TopK",a,s);return{values:o,indices:u}}});const mi=$e({unique_:function(t,e=0){const n=Oe(t,"x","unique","string_or_numeric");r(n.rank>0,(()=>"The input tensor must be at least 1D"));const i={x:n},a={axis:e},[s,o]=Fe.runKernel("Unique",i,a);return{values:s,indices:o}}});const yi=$e({unsortedSegmentSum_:function(t,e,n){const i=Oe(t,"x","unsortedSegmentSum"),a=Oe(e,"segmentIds","unsortedSegmentSum","int32");r(o(n),(()=>"numSegments must be of dtype int"));const s={x:i,segmentIds:a},u={numSegments:n};return Fe.runKernel(Jt,s,u)}});const vi=$e({unstack_:function(t,e=0){const n=Oe(t,"x","unstack","string_or_numeric");r(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`));const i={value:n},a={axis:e};return Fe.runKernel(Ht,i,a)}});const bi=$e({transpose_:function(t,e){const n=Oe(t,"x","transpose");if(null==e&&(e=n.shape.map(((t,e)=>e)).reverse()),r(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${e}.`)),e.forEach((t=>{r(t>=0&&t"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${e}`))})),n.rank<=1)return n.clone();const i={x:n},a={perm:e};return Fe.runKernel(Gt,i,a)}});function wi(t,e,n=null){if(0===t.rank)return Pe(t);if(1!==t.rank&&null===n)return wi(on(t,[-1]),e,n);if(1===t.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===e)return fr(Pe(t),n);if(e===1/0)return pr(Pe(t),n);if(e===-1/0)return Cr(Pe(t),n);if("euclidean"===e||2===e)return ui(fr($r(Pe(t),Zr(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}if(Array.isArray(n)&&2===n.length){if(1===e)return pr(fr(Pe(t),n[0]),n[1]-1);if(e===1/0)return pr(fr(Pe(t),n[1]),n[0]);if(e===-1/0)return Cr(fr(Pe(t),n[1]),n[0]);if("fro"===e||"euclidean"===e)return ui(fr(Fr(t),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const ki=$e({norm_:function(t,e="euclidean",n=null,r=!1){const i=wi(t=Oe(t,"x","norm"),e,n);let a=i.shape;if(r){const e=l(n,t.shape);a=mr(i.shape,e)}return on(i,a)}});const Si=$e({conv2DBackpropFilter_:function(t,e,n,i,a,s="NHWC",u){let l=t;3===t.rank&&(l=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let h=e;3===h.rank&&(h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]])),r(4===l.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${l.shape}.`)),r(4===h.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${h.shape}.`)),r(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const c="NHWC"===s?l.shape[3]:l.shape[1],p="NHWC"===s?h.shape[3]:h.shape[1];r(c===n[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`)),r(p===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${n[3]}).`)),null!=u&&r(o(a),(()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${u} but got pad ${a}.`));const d={x:l,dy:h},f={strides:i,pad:a,dataFormat:s,dimRoundingMode:u,filterShape:n};return Fe.runKernel("Conv2DBackpropFilter",d,f)}});const xi=$e({depthwiseConv2dNativeBackpropFilter_:function(t,e,n,r,i,a=[1,1],s){let o=t;3===t.rank&&(o=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u=e;3===u.rank&&(u=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={x:o,dy:u},h={strides:r,pad:i,dimRoundingMode:s,dilations:a,filterShape:n};return Fe.runKernel("DepthwiseConv2dNativeBackpropFilter",l,h)}});const Ii=$e({depthwiseConv2dNativeBackpropInput_:function(t,e,n,r,i,a=[1,1],s){let o=e,u=!1;3===e.rank&&(u=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={dy:o,filter:n},h={strides:r,pad:i,dimRoundingMode:s,dilations:a,inputShape:t},c=Fe.runKernel("DepthwiseConv2dNativeBackpropInput",l,h);return u?on(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Ni=$e({resizeBilinear_:function(t,e,n=!1,i=!1){const a=Oe(t,"images","resizeBilinear");r(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),r(2===e.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`)),r(!1===i||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=on(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const u={images:s},l={alignCorners:n,halfPixelCenters:i,size:e},h=Fe.runKernel(Ct,u,l);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const zi=$e({resizeNearestNeighbor_:function(t,e,n=!1,i=!1){const a=Oe(t,"images","resizeNearestNeighbor");r(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),r(2===e.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`)),r("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),r(!1===i||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=on(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const u={images:s},l={alignCorners:n,halfPixelCenters:i,size:e},h=Fe.runKernel(At,u,l);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});ve().prototype.abs=function(){return this.throwIfDisposed(),Pe(this)},ve().prototype.acos=function(){return this.throwIfDisposed(),We(this)},ve().prototype.acosh=function(){return this.throwIfDisposed(),Ue(this)},ve().prototype.add=function(t){return this.throwIfDisposed(),Ke(this,t)},ve().prototype.all=function(t,e){return this.throwIfDisposed(),je(this,t,e)},ve().prototype.any=function(t,e){return this.throwIfDisposed(),Ve(this,t,e)},ve().prototype.argMax=function(t){return this.throwIfDisposed(),qe(this,t)},ve().prototype.argMin=function(t){return this.throwIfDisposed(),Ge(this,t)},ve().prototype.asScalar=function(){return this.throwIfDisposed(),r(1===this.size,(()=>"The array must have only 1 element.")),on(this,[])},ve().prototype.asType=function(t){return this.throwIfDisposed(),Qe(this,t)},ve().prototype.as1D=function(){return this.throwIfDisposed(),on(this,[this.size])},ve().prototype.as2D=function(t,e){return this.throwIfDisposed(),on(this,[t,e])},ve().prototype.as3D=function(t,e,n){return this.throwIfDisposed(),on(this,[t,e,n])},ve().prototype.as4D=function(t,e,n,r){return this.throwIfDisposed(),on(this,[t,e,n,r])},ve().prototype.as5D=function(t,e,n,r,i){return this.throwIfDisposed(),on(this,[t,e,n,r,i])},ve().prototype.asin=function(){return this.throwIfDisposed(),He(this)},ve().prototype.asinh=function(){return this.throwIfDisposed(),Je(this)},ve().prototype.atan=function(){return this.throwIfDisposed(),Ze(this)},ve().prototype.atan2=function(t){return this.throwIfDisposed(),Xe(this,t)},ve().prototype.atanh=function(){return this.throwIfDisposed(),Ye(this)},ve().prototype.avgPool=function(t,e,n,r){return this.throwIfDisposed(),un(this,t,e,n,r)},ve().prototype.batchToSpaceND=function(t,e){return this.throwIfDisposed(),mn(this,t,e)},ve().prototype.batchNorm=function(t,e,n,r,i){return this.throwIfDisposed(),yn(this,t,e,n,r,i)},ve().prototype.broadcastTo=function(t){return this.throwIfDisposed(),vn(this,t)},ve().prototype.cast=function(t){return this.throwIfDisposed(),Qe(this,t)},ve().prototype.ceil=function(){return this.throwIfDisposed(),bn(this)},ve().prototype.clipByValue=function(t,e){return this.throwIfDisposed(),wn(this,t,e)},ve().prototype.concat=function(t,e){return this.throwIfDisposed(),t instanceof ye&&(t=[t]),hn([this,...t],e)},ve().prototype.conv1d=function(t,e,n,r,i,a){return this.throwIfDisposed(),xn(this,t,e,n,r,i,a)},ve().prototype.conv2dTranspose=function(t,e,n,r,i){return this.throwIfDisposed(),Nn(this,t,e,n,r,i)},ve().prototype.conv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),Sn(this,t,e,n,r,i,a)},ve().prototype.cos=function(){return this.throwIfDisposed(),An(this)},ve().prototype.cosh=function(){return this.throwIfDisposed(),Cn(this)},ve().prototype.cumsum=function(t,e,n){return this.throwIfDisposed(),Dn(this,t,e,n)},ve().prototype.depthToSpace=function(t,e){return this.throwIfDisposed(),Tn(this,t,e)},ve().prototype.depthwiseConv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),En(this,t,e,n,r,i,a)},ve().prototype.dilation2d=function(t,e,n,r,i){return this.throwIfDisposed(),Fn(this,t,e,n,r,i)},ve().prototype.divNoNan=function(t){return this.throwIfDisposed(),Pn(this,t)},ve().prototype.div=function(t){return this.throwIfDisposed(),_n(this,t)},ve().prototype.dot=function(t){return this.throwIfDisposed(),Wn(this,t)},ve().prototype.elu=function(){return this.throwIfDisposed(),Un(this)},ve().prototype.equal=function(t){return this.throwIfDisposed(),On(this,t)},ve().prototype.erf=function(){return this.throwIfDisposed(),Kn(this)},ve().prototype.exp=function(){return this.throwIfDisposed(),jn(this)},ve().prototype.expandDims=function(t){return this.throwIfDisposed(),Vn(this,t)},ve().prototype.expm1=function(){return this.throwIfDisposed(),qn(this)},ve().prototype.fft=function(){return this.throwIfDisposed(),ri(this)},ve().prototype.flatten=function(){return this.throwIfDisposed(),on(this,[this.size])},ve().prototype.floor=function(){return this.throwIfDisposed(),Hn(this)},ve().prototype.floorDiv=function(t){return this.throwIfDisposed(),Ln(this,t)},ve().prototype.gather=function(t,e){return this.throwIfDisposed(),Jn(this,t,e)},ve().prototype.greaterEqual=function(t){return this.throwIfDisposed(),Xn(this,t)},ve().prototype.greater=function(t){return this.throwIfDisposed(),Zn(this,t)},ve().prototype.ifft=function(){return this.throwIfDisposed(),ii(this)},ve().prototype.irfft=function(){return this.throwIfDisposed(),ai(this)},ve().prototype.isFinite=function(){return this.throwIfDisposed(),Qn(this)},ve().prototype.isInf=function(){return this.throwIfDisposed(),tr(this)},ve().prototype.isNaN=function(){return this.throwIfDisposed(),er(this)},ve().prototype.leakyRelu=function(t){return this.throwIfDisposed(),nr(this,t)},ve().prototype.lessEqual=function(t){return this.throwIfDisposed(),ir(this,t)},ve().prototype.less=function(t){return this.throwIfDisposed(),rr(this,t)},ve().prototype.localResponseNormalization=function(t,e,n,r){return this.throwIfDisposed(),ar(this,t,e,n,r)},ve().prototype.logSigmoid=function(){return this.throwIfDisposed(),cr(this)},ve().prototype.logSoftmax=function(t){return this.throwIfDisposed(),gr(this,t)},ve().prototype.logSumExp=function(t,e){return this.throwIfDisposed(),vr(this,t,e)},ve().prototype.log=function(){return this.throwIfDisposed(),sr(this)},ve().prototype.log1p=function(){return this.throwIfDisposed(),or(this)},ve().prototype.logicalAnd=function(t){return this.throwIfDisposed(),br(this,t)},ve().prototype.logicalNot=function(){return this.throwIfDisposed(),wr(this)},ve().prototype.logicalOr=function(t){return this.throwIfDisposed(),kr(this,t)},ve().prototype.logicalXor=function(t){return this.throwIfDisposed(),Sr(this,t)},ve().prototype.matMul=function(t,e,n){return this.throwIfDisposed(),cn(this,t,e,n)},ve().prototype.maxPool=function(t,e,n,r){return this.throwIfDisposed(),xr(this,t,e,n,r)},ve().prototype.max=function(t,e){return this.throwIfDisposed(),pr(this,t,e)},ve().prototype.maximum=function(t){return this.throwIfDisposed(),Ir(this,t)},ve().prototype.mean=function(t,e){return this.throwIfDisposed(),Nr(this,t,e)},ve().prototype.min=function(t,e){return this.throwIfDisposed(),Cr(this,t,e)},ve().prototype.minimum=function(t){return this.throwIfDisposed(),Dr(this,t)},ve().prototype.mirrorPad=function(t,e){return this.throwIfDisposed(),Tr(this,t,e)},ve().prototype.mod=function(t){return this.throwIfDisposed(),Er(this,t)},ve().prototype.mul=function(t){return this.throwIfDisposed(),pn(this,t)},ve().prototype.neg=function(){return this.throwIfDisposed(),lr(this)},ve().prototype.norm=function(t,e,n){return this.throwIfDisposed(),ki(this,t,e,n)},ve().prototype.notEqual=function(t){return this.throwIfDisposed(),Lr(this,t)},ve().prototype.oneHot=function(t,e=1,n=0){return this.throwIfDisposed(),_r(this,t,e,n)},ve().prototype.onesLike=function(){return this.throwIfDisposed(),Rr(this)},ve().prototype.pad=function(t,e){return this.throwIfDisposed(),Mr(this,t,e)},ve().prototype.pool=function(t,e,n,r,i){return this.throwIfDisposed(),Br(this,t,e,n,r,i)},ve().prototype.pow=function(t){return this.throwIfDisposed(),$r(this,t)},ve().prototype.prelu=function(t){return this.throwIfDisposed(),Pr(this,t)},ve().prototype.prod=function(t,e){return this.throwIfDisposed(),Wr(this,t,e)},ve().prototype.reciprocal=function(){return this.throwIfDisposed(),Kr(this)},ve().prototype.relu=function(){return this.throwIfDisposed(),jr(this)},ve().prototype.relu6=function(){return this.throwIfDisposed(),Vr(this)},ve().prototype.reshapeAs=function(t){return this.throwIfDisposed(),on(this,t.shape)},ve().prototype.reshape=function(t){return this.throwIfDisposed(),on(this,t)},ve().prototype.resizeBilinear=function(t,e,n){return this.throwIfDisposed(),Ni(this,t,e,n)},ve().prototype.resizeNearestNeighbor=function(t,e,n){return this.throwIfDisposed(),zi(this,t,e,n)},ve().prototype.reverse=function(t){return this.throwIfDisposed(),qr(this,t)},ve().prototype.rfft=function(){return this.throwIfDisposed(),oi(this)},ve().prototype.round=function(){return this.throwIfDisposed(),Gr(this)},ve().prototype.rsqrt=function(){return this.throwIfDisposed(),Hr(this)},ve().prototype.selu=function(){return this.throwIfDisposed(),Xr(this)},ve().prototype.separableConv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),Yr(this,t,e,n,r,i,a)},ve().prototype.sigmoid=function(){return this.throwIfDisposed(),dn(this)},ve().prototype.sign=function(){return this.throwIfDisposed(),Qr(this)},ve().prototype.sin=function(){return this.throwIfDisposed(),ti(this)},ve().prototype.sinh=function(){return this.throwIfDisposed(),ei(this)},ve().prototype.slice=function(t,e){return this.throwIfDisposed(),fn(this,t,e)},ve().prototype.softmax=function(t){return this.throwIfDisposed(),ni(this,t)},ve().prototype.softplus=function(){return this.throwIfDisposed(),hr(this)},ve().prototype.spaceToBatchND=function(t,e){return this.throwIfDisposed(),Or(this,t,e)},ve().prototype.split=function(t,e){return this.throwIfDisposed(),si(this,t,e)},ve().prototype.sqrt=function(){return this.throwIfDisposed(),ui(this)},ve().prototype.square=function(){return this.throwIfDisposed(),Fr(this)},ve().prototype.squaredDifference=function(t){return this.throwIfDisposed(),li(this,t)},ve().prototype.squeeze=function(t){return this.throwIfDisposed(),hi(this,t)},ve().prototype.stack=function(t,e){this.throwIfDisposed();const n=t instanceof ye?[this,t]:[this,...t];return ci(n,e)},ve().prototype.step=function(t){return this.throwIfDisposed(),pi(this,t)},ve().prototype.stridedSlice=function(t,e,n,r,i,a,s,o){return this.throwIfDisposed(),di(this,t,e,n,r,i,a,s,o)},ve().prototype.sub=function(t){return this.throwIfDisposed(),dr(this,t)},ve().prototype.sum=function(t,e){return this.throwIfDisposed(),fr(this,t,e)},ve().prototype.tan=function(){return this.throwIfDisposed(),fi(this)},ve().prototype.tanh=function(){return this.throwIfDisposed(),gn(this)},ve().prototype.tile=function(t){return this.throwIfDisposed(),Gn(this,t)},ve().prototype.toBool=function(){return this.throwIfDisposed(),Qe(this,"bool")},ve().prototype.toFloat=function(){return this.throwIfDisposed(),Qe(this,"float32")},ve().prototype.toInt=function(){return this.throwIfDisposed(),Qe(this,"int32")},ve().prototype.topk=function(t,e){return this.throwIfDisposed(),gi(this,t,e)},ve().prototype.transpose=function(t){return this.throwIfDisposed(),bi(this,t)},ve().prototype.unique=function(t){return this.throwIfDisposed(),mi(this,t)},ve().prototype.unsortedSegmentSum=function(t,e){return this.throwIfDisposed(),yi(this,t,e)},ve().prototype.unstack=function(t){return this.throwIfDisposed(),vi(this,t)},ve().prototype.where=function(t,e){return this.throwIfDisposed(),Bn(t,this,e)},ve().prototype.zerosLike=function(){return this.throwIfDisposed(),$n(this)};const Ai={kernelName:"Abs",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pi(Qe(n,"float32"),-1))}}},Ci={kernelName:D,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Fr(Qe(n,"float32")),r=ui(dr(Zr(1),e));return lr(_n(t,r))}}}},Di={kernelName:T,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=ui(dr(Fr(Qe(n,"float32")),1));return _n(t,e)}}}},Ti={kernelName:E,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{let e=t;const r=Rn(n.shape,i);return r.length>0&&(e=fr(e,r)),on(e,n.shape)},b:()=>{let e=t;const n=Rn(r.shape,i);return n.length>0&&(e=fr(e,n)),on(e,r.shape)}}}},Ei={kernelName:"AddN",saveAllInputs:!0,gradFunc:(t,e)=>{const n={};return e.forEach(((e,r)=>{n[r]=()=>t.clone()})),n}},Fi={kernelName:F,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(n)}}},Li={kernelName:L,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(n)}}},_i={kernelName:_,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,ui(dr(Zr(1),Fr(Qe(n,"float32")))))}}},Ri={kernelName:R,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=ui(Ke(Zr(1),Fr(Qe(n,"float32"))));return _n(t,e)}}}},Mi={kernelName:B,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=Ke(Fr(n),Fr(r));let a=pn(t,_n(r,e));const s=Rn(n.shape,i);return s.length>0&&(a=fr(a,s)),on(a,n.shape)},b:()=>{const e=Ke(Fr(n),Fr(r));let a=lr(pn(t,_n(n,e)));const s=Rn(r.shape,i);return s.length>0&&(a=fr(a,s)),on(a,r.shape)}}}},Oi={kernelName:M,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Ke(Fr(Qe(n,"float32")),1))}}},Bi={kernelName:O,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,dr(Zr(1),Fr(Qe(n,"float32"))))}}};const $i=$e({avgPool3dGrad_:function(t,e,n,i,a,s){const u=Oe(t,"dy","avgPool3dGrad"),l=Oe(e,"input","avgPool3dGrad");let h=u,c=l,p=!1;4===l.rank&&(p=!0,h=on(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),c=on(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]])),r(5===h.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${h.rank}.`)),r(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),null!=s&&r(o(a),(()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${a}.`));const d={dy:h,input:c},f={filterSize:n,strides:i,pad:a,dimRoundingMode:s},g=Fe.runKernel("AvgPool3DGrad",d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),Pi={kernelName:"AvgPool3D",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{filterSize:i,strides:a,pad:s,dimRoundingMode:o}=n;return{x:()=>$i(t,r,i,a,s,o)}}};const Wi=$e({avgPoolGrad_:function(t,e,n,i,a){const s=Oe(t,"dy","avgPoolGrad"),o=Oe(e,"input","avgPoolGrad");r(o.rank===s.rank,(()=>`Rank of input (${o.rank}) does not match rank of dy (${s.rank})`));let u=o,l=s,h=!1;3===o.rank&&(h=!0,u=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),r(4===u.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${u.rank}.`));const c={dy:l,input:u},p={filterSize:n,strides:i,pad:a},d=Fe.runKernel("AvgPoolGrad",c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Ui={kernelName:$,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{filterSize:i,strides:a,pad:s}=n;return{x:()=>Wi(t,r,i,a,s)}}},Ki={kernelName:P,inputsToSave:["a","b"],gradFunc:(t,e,n)=>{const[r,i]=e,{transposeA:a,transposeB:s}=n;return a||s?!a&&s?{a:()=>cn(t,i,!1,!1),b:()=>cn(t,r,!0,!1)}:a&&!s?{a:()=>cn(i,t,!1,!0),b:()=>cn(r,t,!1,!1)}:{a:()=>cn(i,t,!0,!0),b:()=>cn(t,r,!0,!0)}:{a:()=>cn(t,i,!1,!0),b:()=>cn(r,t,!0,!1)}}},ji={kernelName:W,gradFunc:(t,e,n)=>{const{blockShape:r,crops:i}=n;return{x:()=>Or(t,r,i)}}},Vi={kernelName:"BroadcastTo",gradFunc:(t,e,n)=>{const r=n,i=r.inputShape,a=r.shape,s=Array.from(a);for(let t=i.length-1;t>=0;t--)if(i[t]===a[t])s[t]=1;else if(1!==i[t])throw new Error(`broadcastTo(): [${i}] cannot be broadcast to [${a}].`);const o=[];for(let t=0;t1&&o.push(t);return{x:()=>fr(t,o,!0)}}},qi={kernelName:U,gradFunc:t=>({x:()=>t.clone()})},Gi={kernelName:K,gradFunc:t=>({x:()=>$n(t)})},Hi={kernelName:j,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{clipValueMin:i,clipValueMax:a}=n;return{x:()=>Bn(br(Xn(r,i),ir(r,a)),t,$n(t))}}},Ji={kernelName:V,inputsToSave:["x"],gradFunc:Ai.gradFunc},Zi={kernelName:q,saveAllInputs:!0,gradFunc:(t,e,n)=>{const r=e.map((t=>t.shape)),{axis:i}=n,a=l(i,e[0].shape)[0],s=r.map((t=>t[a]));return si(t,s,a).map((t=>()=>t))}},Xi={kernelName:G,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[i,a]=e,{dilations:s,strides:o,pad:u,dataFormat:l}=n;return r(an(s),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`)),{x:()=>In(i.shape,t,a,o,u,l),filter:()=>Si(i,t,a.shape,o,u,l)}}},Yi={kernelName:H,inputsToSave:["dy","filter"],gradFunc:(t,e,n)=>{const[r,i]=e,{strides:a,pad:s,dataFormat:o,dimRoundingMode:u}=n;return{dy:()=>Sn(t,i,a,s,o,1,u),filter:()=>Si(t,r,i.shape,a,s,o,u)}}};const Qi=$e({conv3DBackpropFilter_:function(t,e,n,i,a){let s=t;4===t.rank&&(s=on(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]));let o=e;4===o.rank&&(o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]])),r(5===s.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`)),r(5===o.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`)),r(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),r(s.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`)),r(o.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`));const u={x:s,dy:o},l={strides:i,pad:a,filterShape:n};return Fe.runKernel("Conv3DBackpropFilterV2",u,l)}}),ta={kernelName:"Conv3D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:a,pad:s}=n;r(an(i),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const[o,u]=e;return{x:()=>zn(o.shape,t,u,a,s),filter:()=>Qi(o,t,u.shape,a,s)}}},ea={kernelName:"Cos",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(lr(ti(Qe(n,"float32"))),t)}}},na={kernelName:J,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(ei(Qe(n,"float32")),t)}}},ra={kernelName:Z,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{axis:i,exclusive:a,reverse:s}=n;return{x:()=>{const e=function(t,e){if(function(t,e){for(let n=0;nn.push(t))),n}([i],r.rank);let n=Dn(t,i,a,!s);return null!=e&&(n=bi(n,e)),n}}}},ia={kernelName:X,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:a,pad:s,dimRoundingMode:u}=n,l=null==i?[1,1]:i;r(an(l),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${l}'`));const[h,c]=e;return r(4===h.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${h.rank}.`)),r(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),r(h.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),r(sn(a,l),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'.`)),null!=u&&r(o(s),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`)),{x:()=>Ii(h.shape,t,c,a,s,i,u),filter:()=>xi(h,t,c.shape,a,s,i,u)}}},aa={kernelName:Y,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[r,i]=e,a={x:r,filter:i,dy:t},s={x:r,filter:i,dy:t};return{x:()=>Fe.runKernel("Dilation2DBackpropInput",a,n),filter:()=>Fe.runKernel("Dilation2DBackpropFilter",s,n)}}},sa={kernelName:"Elu",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e,r={dy:t,y:n};return{x:()=>Fe.runKernel("EluGrad",r)}}},oa={kernelName:"Erf",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,r=pn(jn(lr(Fr(n))),2/Math.sqrt(Math.PI));return{x:()=>pn(t,r)}}},ua={kernelName:"Exp",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,n)}}},la={kernelName:tt,inputsToSave:["input"],gradFunc:(t,e)=>{const[n]=e;return{input:()=>on(t,n.shape)}}},ha={kernelName:et,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,jn(n))}}},ca={kernelName:nt,gradFunc:t=>({x:()=>$n(t)})},pa={kernelName:rt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=_n(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const a=Rn(r.shape,i);a.length>0&&(e=on(fr(e,a),r.shape));const s=Fr(r);return lr(_n(e,Qe(s,"float32")))}}}},da={kernelName:it,inputsToSave:["x","mean","variance","scale"],gradFunc:(t,e,n)=>{const{varianceEpsilon:r}=n,[i,a,s,o]=e,u=null==o?Zr(1):o,l=Rn(a.shape,i.shape),h=[];if(1===a.rank){for(let t=0;t1===a.rank?on(pn(pn(t,Gn(on(d,[1,1,1,a.shape[0]]),h)),u),i.shape):on(pn(pn(t,d),u),i.shape),mean:()=>{let t=pn(pn(d,Zr(-1)),p);return 1===a.rank&&(t=fr(t,l)),on(t,a.shape)},variance:()=>{let t=pn(pn(f,c),p);return 1===a.rank&&(t=fr(t,l)),on(t,a.shape)},scale:()=>{const e=pn(c,d);let n=pn(t,e);return 1===a.rank&&(n=fr(n,l)),on(n,a.shape)},offset:()=>{let e=t;return 1===a.rank&&(e=fr(e,l)),on(e,a.shape)}}}},fa={kernelName:at,inputsToSave:["x","indices"],gradFunc:(t,e,n)=>{const[r,i]=e,{axis:a}=n,s=l(a,r.shape)[0];return{x:()=>{const e=r.shape,n=i.size,o=e.slice(0,s),u=o.length,l=e.slice(a,e.length).slice(1),h=l.length,c=ga(0,u),p=ga(u+1,u+1+h),d=ma([o,[n],l]),f=on(t,d),g=on(i,[n]),m=ma([[u],c,p]),y=bi(f,m);let v=yi(y,g,r.shape[s]);const b=yr(m);return v=bi(v,b),v},indices:()=>i}}};function ga(t,e){const n=[];for(let r=t;r{const[n,r]=e;return{a:()=>$n(n),b:()=>$n(r)}}},va={kernelName:ot,gradFunc:t=>({x:()=>Qe(t,"float32")})},ba={kernelName:ut,gradFunc:t=>({x:()=>$n(t)})},wa={kernelName:lt,gradFunc:t=>({x:()=>$n(t)})},ka={kernelName:ht,gradFunc:t=>({x:()=>$n(t)})},Sa={kernelName:ct,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{alpha:i}=n,a=Zn(r,0);return{x:()=>Bn(a,t,pn(t,i))}}},xa={kernelName:pt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Ke(n,1))}}},Ia={kernelName:"Log",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Qe(n,"float32"))}}},Na={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r]=e,{axis:i}=n;return{logits:()=>{const e=jn(r);return dr(t,pn(fr(t,i,!0),e))}}}};const za=$e({localResponseNormalizationBackprop_:function(t,e,n,r=5,i=1,a=1,s=.5){const o={x:t,y:e,dy:n},u={depthRadius:r,bias:i,alpha:a,beta:s};return Fe.runKernel("LRNGrad",o,u)}}),Aa={kernelName:"LRN",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{depthRadius:a,bias:s,alpha:o,beta:u}=n;return{x:()=>za(r,i,t,a,s,o,u)}}};function Ca(t,e,n,r){return e.rankpn(t,Qe(On(n,e),t.dtype))}}const Da={kernelName:"Max",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const r=n,{reductionIndices:i}=r,a=e[0],s=Ca(t,e[1],a,l(i,a.shape));return{x:()=>s.x()}}},Ta={kernelName:dt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e;return{a:()=>pn(t,Qe(Xn(n,r),"float32")),b:()=>pn(t,Qe(rr(n,r),"float32"))}}};const Ea=$e({maxPool3dGrad_:function(t,e,n,i,a,s,u){const l=Oe(t,"dy","maxPool3dGrad"),h=Oe(e,"input","maxPool3dGrad"),c=Oe(n,"output","maxPool3dGrad");let p=l,d=h,f=c,g=!1;4===h.rank&&(g=!0,p=on(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=on(h,[1,h.shape[0],h.shape[1],h.shape[2],h.shape[3]]),f=on(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),r(5===p.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${p.rank}.`)),r(5===d.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`)),r(5===f.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${f.rank}.`)),null!=u&&r(o(s),(()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`));const m={dy:p,input:d,output:f},y={filterSize:i,strides:a,pad:s,dimRoundingMode:u},v=Fe.runKernel("MaxPool3DGrad",m,y);return g?on(v,[v.shape[1],v.shape[2],v.shape[3],v.shape[4]]):v}}),Fa={kernelName:"MaxPool3D",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{filterSize:a,strides:s,pad:o,dimRoundingMode:u}=n;return{x:()=>Ea(t,r,i,a,s,o,u)}}};const La=$e({maxPoolGrad_:function(t,e,n,i,a,s,u){const l=Oe(t,"dy","maxPoolGrad"),h=Oe(e,"input","maxPoolGrad"),c=Oe(n,"output","maxPoolGrad");r(h.rank===l.rank,(()=>`Rank of input (${h.rank}) does not match rank of dy (${l.rank})`)),r(4===l.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),r(4===h.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${h.rank}.`)),null!=u&&r(o(s),(()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`));const p={dy:l,input:h,output:c},d={filterSize:i,strides:a,pad:s,dimRoundingMode:u};return Fe.runKernel("MaxPoolGrad",p,d)}}),_a={kernelName:St,inputsToSave:["x"],gradFunc:(t,e,n)=>{const r=e[0],{paddings:i}=n,a=i.map((t=>t[0]));return{x:()=>fn(t,a,r.shape)}}};const Ra={kernelName:Wt,gradFunc:(t,e,n)=>{const{blockShape:r,paddings:i}=n;return{x:()=>mn(t,r,i)}}},Ma={kernelName:Ut,gradFunc:(t,e,n)=>{const{axis:r}=n;return{x:()=>hn(t,r)}}};const Oa=[Ai,Ci,Di,Ti,Ei,Fi,Li,_i,Ri,Mi,Oi,Bi,Pi,Ui,Ki,ji,Vi,qi,Gi,Hi,Ji,Zi,Yi,Xi,ta,ea,na,ra,ia,aa,{kernelName:Q,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=_n(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const a=Rn(r.shape,i);a.length>0&&(e=on(fr(e,a),r.shape));const s=Fr(r);return lr(_n(e,Qe(s,"float32")))}}}},sa,oa,ua,la,ha,pa,ca,da,fa,ya,va,ba,wa,ka,Sa,xa,Ia,Na,Aa,Da,Da,Ta,Fa,{kernelName:ft,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{filterSize:a,strides:s,pad:o}=n;return{x:()=>La(t,r,i,a,s,o)}}},{kernelName:gt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{axis:i}=n,s=l(i,r.shape),o=a(function(t,e){const n=[],r=t.length;for(let i=0;it[e]))]}(r.shape,s)[1]);return{x:()=>{const e=r.shape.slice();s.forEach((t=>{e[t]=1}));const n=on(t,e);return _n(pn(n,Ar(r.shape,"float32")),o)}}}},{kernelName:"Min",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const r=n,{axis:i}=r,[a,s]=e,o=Ca(t,s,a,l(i,a.shape));return{x:()=>o.x()}}},{kernelName:mt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e;return{a:()=>pn(t,Qe(ir(n,r),"float32")),b:()=>pn(t,Qe(Zn(n,r),"float32"))}}},{kernelName:yt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const r=e[0],{paddings:i}=n,a=i.map((t=>t[0]));return{x:()=>fn(t,a,r.shape)}}},{kernelName:"Mod",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=Rn(n.shape,i);return e.length>0?on(fr(t,e),n.shape):t},b:()=>{const e=pn(t,lr(Hn(_n(n,r)))),a=Rn(r.shape,i);return a.length>0?on(fr(e,a),r.shape):e}}}},{kernelName:vt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=pn(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{const e=pn(t,Qe(n,"float32")),a=Rn(r.shape,i);return a.length>0?on(fr(e,a),r.shape):e}}}},{kernelName:"Neg",gradFunc:t=>({x:()=>lr(t)})},{kernelName:wt,inputsToSave:["indices"],gradFunc:(t,e)=>{const n=e[0];return{indices:()=>zr(n.shape,"float32")}}},{kernelName:bt,gradFunc:t=>({x:()=>$n(t)})},{kernelName:kt,saveAllInputs:!0,gradFunc:(t,e,n)=>{const{axis:r}=n;return vi(t,r).map((t=>()=>t))}},_a,_a,{kernelName:"Pow",inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(t,e)=>{const[n,r,i]=e,a=n,s=r,o=Mn(a.shape,s.shape);return{a:()=>{const e=Qe(s,"float32");let n=pn(t,pn(e,$r(a,dr(e,Zr(1)))));const r=Rn(a.shape,o);return r.length>0&&(n=fr(n,r)),on(n,a.shape)},b:()=>{const e=Zn(a,0),n=Bn(e,sr(a),$n(a));let r=pn(t,pn(i,n));const u=Rn(s.shape,o);return u.length>0&&(r=fr(r,u)),on(r,s.shape)}}}},{kernelName:xt,inputsToSave:["x","alpha"],gradFunc:(t,e)=>{const[n,r]=e,i=Zn(n,0);return{x:()=>Bn(i,t,pn(t,r)),alpha:()=>{let e=Bn(i,$n(t),pn(t,n));const a=Rn(r.shape,t.shape);return a.length>0&&(e=fr(e,a)),on(e,r.shape)}}}},{kernelName:It,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,lr(Fr(n)))}}},{kernelName:Dt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,r=pn(ir(n,6),pi(n));return{x:()=>pn(t,Qe(r,"float32"))}}},{kernelName:Nt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,Qe(pi(n),"float32"))}}},{kernelName:zt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>on(t,n.shape)}}},{kernelName:Ct,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[r]=e,i={dy:t,images:r};return{images:()=>Fe.runKernel("ResizeBilinearGrad",i,n)}}},{kernelName:At,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[r]=e,i={dy:t,images:r};return{images:()=>Fe.runKernel("ResizeNearestNeighborGrad",i,n)}}},{kernelName:Tt,gradFunc:(t,e,n)=>{const{dims:r}=n,i=l(r,t.shape);return{x:()=>qr(t,i)}}},{kernelName:Et,gradFunc:t=>({x:()=>$n(t)})},{kernelName:Ft,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>lr(_n(t,pn($r(n,1.5),2)))}}},{kernelName:Lt,inputsToSave:["condition"],gradFunc:(t,e)=>{const[n]=e;return{condition:()=>Qe($n(n),"float32"),t:()=>pn(t,Qe(n,t.dtype)),e:()=>pn(t,Qe(wr(n),t.dtype))}}},{kernelName:_t,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Zn(n,Zr(0)),r=Zr(1.7580993408473768),i=Zr(1.0507009873554805),a=pn(t,i),s=pn(pn(t,r),jn(Qe(n,"float32")));return Bn(e,a,s)}}}},{kernelName:Bt,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(n,dr(Zr(1),n)))}}},{kernelName:Ot,gradFunc:t=>({x:()=>$n(t)})},{kernelName:"Sin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(An(Qe(n,"float32")),t)}}},{kernelName:Mt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(Cn(Qe(n,"float32")),t)}}},{kernelName:Rt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[i]=e,{begin:a,size:s}=n,o=i.shape,[u,l]=function(t,e,n){let i;const a=t.shape.length;let s;return i="number"==typeof e?[e,...new Array(a-1).fill(0)]:e.length{r(-1!==t,(()=>"slice() does not support negative begin indexing."))})),s=null==n?new Array(a).fill(-1):"number"==typeof n?[n,...new Array(a-1).fill(-1)]:n.lengthe>=0?e:(r(-1===e,(()=>`Negative size values should be exactly -1 but got ${e} for the slice() size at index ${n}.`)),t.shape[n]-i[n]))),[i,s]}(i,a,s),h=[];for(let e=0;eMr(t,h)}}},{kernelName:Kt,outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r]=e,{dim:i}=n,a=pn(t,r);return{logits:()=>dr(a,pn(fr(a,[i],true),r))}}},{kernelName:$t,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,dn(n))}}},Ra,Ra,Ma,Ma,{kernelName:Pt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,pn(ui(Qe(n,"float32")),2))}}},{kernelName:jt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Zr(2);return{a:()=>pn(t,pn(i,dr(n,r))),b:()=>pn(t,pn(i,dr(r,n)))}}},{kernelName:"Square",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(Qe(n,"float32"),2))}}},{kernelName:Xt,gradFunc:t=>({x:()=>$n(t)})},{kernelName:"Sub",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{let e=t;const r=Rn(n.shape,i);return r.length>0&&(e=fr(e,r)),on(e,n.shape)},b:()=>{let e=t;const n=Rn(r.shape,i);return n.length>0&&(e=fr(e,n)),on(lr(e),r.shape)}}}},{kernelName:"Sum",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,i=r.shape.slice(),{axis:a}=n;l(a,r.shape).forEach((t=>{i[t]=1}));const s=on(t,i),o=pn(s,Ar(r.shape,"float32"));return{x:()=>o}}},{kernelName:"Tan",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Fr(An(n)))}}},{kernelName:Vt,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(dr(Zr(1),Fr(n)),t)}}},{kernelName:qt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{reps:i}=n;return{x:()=>{let e=$n(r);if(1===r.rank)for(let n=0;n{const r=n,{perm:i}=r,a=yr(i);return{x:()=>bi(t,a)}}},{kernelName:Ht,gradFunc:(t,e,n)=>{const r=n,{axis:i}=r;return{value:()=>ci(t,i)}}},{kernelName:Jt,inputsToSave:["segmentIds"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>function(t,e){const n=Ir(e,$n(e)),r=Jn(t,n);let i=Xn(e,Zr(0,"int32"));const a=r.rank-i.rank;for(let t=0;t({x:()=>$n(t)})}];for(const t of Oa)re(t);var Ba=function(t,e){return(Ba=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 $a(t,e){function n(){this.constructor=t}Ba(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Pa,Wa=function(){return(Wa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e?1:0}(t,e)}function us(t){if(null==t)return t;for(var e=[],n=0,r=t;n=0),Xa(r>=n),Array.isArray(t)&&t.length>=n&&t.length<=r&&t.every((function(t){return typeof t===e}))}function ps(t,n){Array.isArray(t)?(e.util.assert(t.length>0,(function(){return n+" is unexpectedly an empty array."})),t.forEach((function(t,e){return ps(t,"element "+(e+1)+" of "+n)}))):e.util.assert(Number.isInteger(t)&&t>0,(function(){return"Expected "+n+" to be a positive integer, but got "+ds(t)+"."}))}function ds(t){return null===t?"null":Array.isArray(t)?"["+t.map((function(t){return ds(t)})).join(",")+"]":"string"==typeof t?'"'+t+'"':""+t}function fs(t){return"relu"===t?"relu":"linear"===t?"linear":"elu"===t?"elu":null}function gs(t,n){return e.tidy((function(){return e.sqrt(e.sum(e.mul(t,t),n,!0))}))}var ms=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.prototype.getConfig=function(){return{}},e}(e.serialization.Serializable),ys=function(t){function n(e){var n=t.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){var r=gs(t,n.axis),i=e.clipByValue(r,0,n.maxValue);return e.mul(t,e.div(i,e.add(ja(),r)))}))},n.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},n.className="MaxNorm",n}(ms);e.serialization.registerClass(ys);var vs=function(t){function n(e){var n=t.call(this)||this;return n.defaultAxis=0,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){return e.div(t,e.add(ja(),gs(t,n.axis)))}))},n.prototype.getConfig=function(){return{axis:this.axis}},n.className="UnitNorm",n}(ms);e.serialization.registerClass(vs);var bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t){return e.relu(t)},n.className="NonNeg",n}(ms);e.serialization.registerClass(bs);var ws=function(t){function n(e){var n=t.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=e.minValue?e.minValue:n.defaultMinValue,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.rate=null!=e.rate?e.rate:n.defaultRate,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){var r=gs(t,n.axis),i=e.add(e.mul(n.rate,e.clipByValue(r,n.minValue,n.maxValue)),e.mul(1-n.rate,r));return e.mul(t,e.div(i,e.add(ja(),r)))}))},n.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},n.className="MinMaxNorm",n}(ms);e.serialization.registerClass(ws);var ks={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Ss(t){return is(t)}function xs(t,n){return void 0===n&&(n={}),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"constraint")}function Is(t){return null==t?null:"string"==typeof t?xs({className:t in ks?ks[t]:t,config:{}}):t instanceof ms?t:xs(t)}var Ns={__proto__:null,maxNorm:function(t){return new ys(t)},unitNorm:function(t){return new vs(t)},nonNeg:function(){return new bs},minMaxNorm:function(t){return new ws(t)}},zs=["channelsFirst","channelsLast"],As=["nearest","bilinear"],Cs=["valid","same","causal"],Ds=["max","avg"],Ts=["sum","mul","concat","ave"],Es=new Map;function Fs(t){hs(zs,"DataFormat",t)}function Ls(t){hs(Cs,"PaddingMode",t)}function _s(t){hs(Ds,"PoolMode",t)}var Rs=[];function Ms(t,e){Rs.push(t);try{var n=e();return Rs.pop(),n}catch(t){throw Rs.pop(),t}}function Os(t){if(!Ps(t))throw new Error("Not a valid tensor name: '"+t+"'");return(0===Rs.length?"":Rs.join("/")+"/")+t}function Bs(t){if(!Ps(t))throw new Error("Not a valid tensor name: '"+t+"'");Es.has(t)||Es.set(t,0);var e=Es.get(t);if(Es.set(t,Es.get(t)+1),e>0){var n=t+"_"+e;return Es.set(n,1),n}return t}var $s=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Ps(t){return!!t.match($s)}function Ws(t,e,n){null==e&&(e=0),null==n&&(n=t.length);for(var r=1,i=e;i= 2 but got x shape = "+t.shape+" and y shape = "+n.shape);if(n.rank>=3&&t.shape.slice(-1)[0]!==(c=n.shape.slice(-2)[0]))throw new Ha("If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = "+t.shape+" and y shape = "+n.shape);if(2===t.rank&&2===n.rank){var a=!1,s=!1;return e.fused.matMul({a:t,b:n,transposeA:a,transposeB:s,bias:i?io(t.rank,i,"channelsLast"):null,activation:r})}var o=t.shape.slice(),u=o.pop();t=t.reshape([-1,u]);var l=n.shape.slice(),h=l.pop(),c=l.pop(),p=l.concat([h]),d=Array.from({length:n.rank},(function(t,e){return 0===e?n.rank-2:e<=n.rank-2?e-1:e}));n=n.transpose(d).reshape([c,-1]);var f=o.concat(p);a=!1,s=!1;return e.fused.matMul({a:t,b:n,transposeA:a,transposeB:s,bias:i?io(t.rank,i,"channelsLast"):null,activation:r}).reshape(f)}function no(t,n,r){return e.tidy((function(){return n=Array.isArray(n)?e.tensor1d(n,"int32"):n.toInt(),e.gather(t,n,r)}))}function ro(t){return e.mul(t,t)}function io(t,e,n){var r=e.shape;if(1!==e.rank&&e.rank!==t)throw new Ga("Unexpected bias dimensions: "+e.rank+"; expected it to be 1 or "+t);if(5===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1,1,1]):e.reshape([1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,1,1,r[0]]):e.reshape([1].concat(r))}else if(4===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1,1]):e.reshape([1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,1,r[0]]):e.reshape([1].concat(r))}else if(3===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1]):e.reshape([1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,r[0]]):e.reshape([1].concat(r))}else if(t<3)return e;throw new Ga("Unsupported input rank by biasAdd: "+e.rank)}function ao(t,n,r){return e.tidy((function(){return null==r&&(r="channelsLast"),Fs(r),t.add(io(t.rank,n,r))}))}function so(t,n,r,i){return e.tidy((function(){return e.dropout(t,n,r,i)}))}function oo(t,e,n){return void 0===n&&(n=!1),n?t():e()}var uo=["fanIn","fanOut","fanAvg"],lo=["normal","uniform","truncatedNormal"];var ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.prototype.fromConfigUsesCustomObjects=function(){return!1},e.prototype.getConfig=function(){return{}},e}(e.serialization.Serializable),co=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t,n){return e.zeros(t,n)},n.className="Zeros",n}(ho);e.serialization.registerClass(co);var po=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t,n){return e.ones(t,n)},n.className="Ones",n}(ho);e.serialization.registerClass(po);var fo=function(t){function n(e){var n=t.call(this)||this;if("object"!=typeof e)throw new Ga("Expected argument of type ConstantConfig but got "+e);if(void 0===e.value)throw new Ga("config must have value set but got "+e);return n.value=e.value,n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){return e.mul(e.scalar(r.value),e.ones(t,n))}))},n.prototype.getConfig=function(){return{value:this.value}},n.className="Constant",n}(ho);e.serialization.registerClass(fo);var go=function(t){function n(e){var n=t.call(this)||this;return n.DEFAULT_MINVAL=-.05,n.DEFAULT_MAXVAL=.05,n.minval=e.minval||n.DEFAULT_MINVAL,n.maxval=e.maxval||n.DEFAULT_MAXVAL,n.seed=e.seed,n}return $a(n,t),n.prototype.apply=function(t,n){return e.randomUniform(t,this.minval,this.maxval,n)},n.prototype.getConfig=function(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}},n.className="RandomUniform",n}(ho);e.serialization.registerClass(go);var mo=function(t){function e(e){var n=t.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=e.mean||n.DEFAULT_MEAN,n.stddev=e.stddev||n.DEFAULT_STDDEV,n.seed=e.seed,n}return $a(e,t),e.prototype.apply=function(t,e){if("float32"!==(e=e||"float32")&&"int32"!==e)throw new Ha("randomNormal does not support dType "+e+".");return to(t,this.mean,this.stddev,e,this.seed)},e.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},e.className="RandomNormal",e}(ho);e.serialization.registerClass(mo);var yo=function(t){function n(e){var n=t.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=e.mean||n.DEFAULT_MEAN,n.stddev=e.stddev||n.DEFAULT_STDDEV,n.seed=e.seed,n}return $a(n,t),n.prototype.apply=function(t,n){if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Ha("truncatedNormal does not support dType "+n+".");return e.truncatedNormal(t,this.mean,this.stddev,n,this.seed)},n.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},n.className="TruncatedNormal",n}(ho);e.serialization.registerClass(yo);var vo=function(t){function n(e){var n=t.call(this)||this;return n.gain=null!=e.gain?e.gain:1,n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){if(2!==t.length||t[0]!==t[1])throw new Ga("Identity matrix initializer can only be used for 2D square matrices.");return e.mul(r.gain,e.eye(t[0]))}))},n.prototype.getConfig=function(){return{gain:this.gain}},n.className="Identity",n}(ho);e.serialization.registerClass(vo);var bo=function(t){function n(e){var n,r=t.call(this)||this;if(e.scale<0)throw new Ga("scale must be a positive float. Got: "+e.scale);return r.scale=null==e.scale?1:e.scale,r.mode=null==e.mode?"fanIn":e.mode,n=r.mode,hs(uo,"FanMode",n),r.distribution=null==e.distribution?"normal":e.distribution,function(t){hs(lo,"Distribution",t)}(r.distribution),r.seed=e.seed,r}return $a(n,t),n.prototype.apply=function(t,n){var r=function(t,e){var n,r;if(void 0===e&&(e="channelsLast"),Fs(e),2===t.length)n=t[0],r=t[1];else if(-1!==[3,4,5].indexOf(t.length))if("channelsFirst"===e){var i=Ws(t,2);n=t[1]*i,r=t[0]*i}else"channelsLast"===e&&(i=Ws(t,0,t.length-2),n=t[t.length-2]*i,r=t[t.length-1]*i);else{var a=Ws(t);n=Math.sqrt(a),r=Math.sqrt(a)}return[n,r]}(t),i=r[0],a=r[1],s=this.scale;if("fanIn"===this.mode?s/=Math.max(1,i):"fanOut"===this.mode?s/=Math.max(1,a):s/=Math.max(1,(i+a)/2),"normal"===this.distribution){var o=Math.sqrt(s);if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Ha(this.getClassName()+" does not support dType "+n+".");return e.truncatedNormal(t,0,o,n,this.seed)}var u=Math.sqrt(3*s);return e.randomUniform(t,-u,u,n)},n.prototype.getConfig=function(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}},n.className="VarianceScaling",n}(ho);e.serialization.registerClass(bo);var wo=function(t){function e(e){return t.call(this,{scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="GlorotUniform",e}(bo);e.serialization.registerClass(wo);var ko=function(t){function e(e){return t.call(this,{scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="GlorotNormal",e}(bo);e.serialization.registerClass(ko);var So=function(t){function e(e){return t.call(this,{scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="HeNormal",e}(bo);e.serialization.registerClass(So);var xo=function(t){function e(e){return t.call(this,{scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="HeUniform",e}(bo);e.serialization.registerClass(xo);var Io=function(t){function e(e){return t.call(this,{scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="LeCunNormal",e}(bo);e.serialization.registerClass(Io);var No=function(t){function e(e){return t.call(this,{scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="LeCunNormal",e}(bo);e.serialization.registerClass(No);var zo=function(t){function n(e){var n=t.call(this)||this;if(n.DEFAULT_GAIN=1,n.gain=null==e.gain?n.DEFAULT_GAIN:e.gain,n.seed=e.seed,null!=n.seed)throw new Ha("Random seed is not implemented for Orthogonal Initializer yet.");return n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){if(t.length<2)throw new Ha("Shape must be at least 2D.");t[0]*t[1]>2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+t[0]*t[1]+") elements: Slowness may result.");var n=to(t[0]>t[1]?[t[1],t[0]]:t,0,1,"float32"),i=e.linalg.gramSchmidt(n);return t[0]>t[1]&&(i=i.transpose()),e.mul(r.gain,i)}))},n.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},n.className="Orthogonal",n}(ho);e.serialization.registerClass(zo);var Ao={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Co(t,n){return void 0===n&&(n={}),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"initializer")}function Do(t){return is(t)}function To(t){if("string"==typeof t){var e=t in Ao?Ao[t]:t;if("GlorotNormal"===e)return new ko;if("GlorotUniform"===e)return new wo;if("HeNormal"===e)return new So;if("HeUniform"===e)return new xo;if("LeCunNormal"===e)return new Io;if("LeCunUniform"===e)return new No;var n={};return n.className=e,n.config={},Co(n)}return t instanceof ho?t:Co(t)}var Eo={__proto__:null,zeros:function(){return new co},ones:function(){return new po},constant:function(t){return new fo(t)},randomUniform:function(t){return new go(t)},randomNormal:function(t){return new mo(t)},truncatedNormal:function(t){return new yo(t)},identity:function(t){return new vo(t)},varianceScaling:function(t){return new bo(t)},glorotUniform:function(t){return new wo(t)},glorotNormal:function(t){return new ko(t)},heNormal:function(t){return new So(t)},heUniform:function(t){return new xo(t)},leCunNormal:function(t){return new Io(t)},leCunUniform:function(t){return new No(t)},orthogonal:function(t){return new zo(t)}},Fo=0;function Lo(){return Fo++}var _o={};function Ro(t){return void 0===t&&(t=""),t in _o||(_o[t]=0),_o[t]+=1,t+_o[t].toString()}function Mo(t){return Array.isArray(t)&&Array.isArray(t[0])}function Oo(t){return 0===t.length?[]:Array.isArray(t[0])?t:[t]}function Bo(t){var e;if(Array.isArray(t)){if(1!==t.length)throw new Ga("Expected Tensor length to be 1; got "+t.length);e=t[0]}else e=t;return e}function $o(t){if(Array.isArray(t)&&Array.isArray(t[0])){if(1===t.length)return(t=t)[0];throw new Ga("Expected exactly 1 Shape; got "+t.length)}return t}function Po(t){for(var e=0,n=0,r=t;n1)throw new Va("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new Va("Layer "+this.name+" is not connected, no input to return.");return Qa(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new Va("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new Va("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return Qa(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),n.prototype.calculateLosses=function(){return this.losses.map((function(t){return t()}))},Object.defineProperty(n.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"built",{get:function(){return this._built},set:function(t){this._built=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trainable",{get:function(){return this.trainable_},set:function(t){this._trainableWeights.forEach((function(e){return e.trainable=t})),this.trainable_=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable_?this._trainableWeights.filter((function(t){return t.trainable})):[]},set:function(t){this._trainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._trainableWeights.filter((function(t){return!t.trainable})).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)},set:function(t){this._nonTrainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),n.prototype.resetStates=function(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")},n.prototype.assertInputCompatibility=function(t){if(t=ts(t),null!=this.inputSpec&&0!==this.inputSpec.length){var e=ts(this.inputSpec);if(t.length!==e.length)throw new Ga("Layer "+this.name+" expects "+e.length+" inputs, but it received "+t.length+" input tensors. Input received: "+t);for(var n=0;n=0?s[u]:s[s.length+u];if(null!=l&&-1===[l,null].indexOf(h))throw new Ga("Input "+n+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+l+" but got shape "+s+".")}}if(null!=i.shape)for(var c=0;c0&&Array.isArray(f[0])?f.map((function(r,i){return new qo(m,r,n,ts(t),e,n.name,i)})):new qo(m,f,n,ts(t),e,n.name),n.addInboundNode(t,g,null,null,d,f,e),n._refCount++,null!=n.activityRegularizer)throw new Ha("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return g}))},n.prototype.warnOnIncompatibleInputShape=function(t){if(null!=this.batchInputShape)if(t.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(t)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var e=!1;this.batchInputShape.forEach((function(n,r){null!=n&&null!=t[r]&&t[r]!==n&&(e=!0)})),e&&console.warn("The shape of the input tensor ("+JSON.stringify(t)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(n.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Va("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var t=[],e=0,n=this.inboundNodes;e0)&&(e=t.sourceLayer,n=t.nodeIndex),0===e.inboundNodes.length)return[t];var r=e.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var i=[],a=0;a0?[4,Promise.all(n)]:[3,2];case 1:for(u=h.sent(),l=0;l=0&&Number.isInteger(n),(function(){return"Verbosity level is expected to be an integer >= 0, but got "+n})),t.checkForDuplicate(r),null==t.constructors[n]&&(t.constructors[n]=[]),t.constructors[n].push(r)},t.checkForDuplicate=function(e){for(var n in t.constructors){t.constructors[+n].forEach((function(t){if(t===e)throw new Ga("Duplicate callback constructor.")}))}},t.clear=function(){t.constructors={}},t.createCallbacks=function(e){var n=[];for(var r in t.constructors){var i=+r;e>=i&&n.push.apply(n,t.constructors[i])}return n.map((function(t){return new t}))},t.constructors={},t}();function hu(t,e,n,r,i,a,s,o,u){var l=new su,h=[new au].concat(lu.createCallbacks(e));null!=t&&h.push.apply(h,t),h.push(l);var c=new iu(h);return c.setParams({epochs:n,initialEpoch:r,samples:i,steps:a,batchSize:s,verbose:e,doValidation:o,metrics:u}),{callbackList:c,history:l}}function cu(t,n,r){return void 0===n&&(n={}),void 0===r&&(r=!1),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"layer",r)}function pu(t,n){return e.tidy((function(){"float32"!==t.dtype&&(t=t.asType("float32"));var r=e.sum(ro(t),n,!0),i=e.fill(r.shape,ja()),a=e.sqrt(e.maximum(r,i));return e.div(t,a)}))}function du(t,n){return e.tidy((function(){return e.mean(ro(e.sub(n,t)),-1)}))}function fu(t,n){return e.tidy((function(){return e.mean(e.abs(e.sub(n,t)),-1)}))}function gu(t,n){return e.tidy((function(){var r=e.sub(t,n),i=e.clipByValue(e.abs(t),ja(),Number.MAX_VALUE),a=e.abs(e.div(r,i));return e.mul(100,e.mean(a,-1))}))}function mu(t,n,r){return void 0===r&&(r=!1),e.tidy((function(){if(r)n=e.softmax(n);else{var i=e.sum(n,n.shape.length-1,!0);n=e.div(n,i)}return n=e.clipByValue(n,ja(),1-ja()),e.neg(e.sum(e.mul(t.toFloat(),e.log(n)),n.shape.length-1))}))}function yu(t,n,r){return void 0===r&&(r=!1),e.tidy((function(){var i,a,s=e.floor((i=t,a=[Ws(i.shape)],i.reshape(a))).toInt(),o=(n=e.clipByValue(n,ja(),1-ja())).shape;return mu(e.oneHot(s,o[o.length-1]).reshape(o),n,r)}))}function vu(t,n){return e.tidy((function(){var r;return r=e.clipByValue(n,ja(),1-ja()),r=e.log(e.div(r,e.sub(1,r))),e.mean(function(t,n){if(!e.util.arraysEqual(t.shape,n.shape))throw new Ga("logits and labels must have the same shape, but got shapes "+JSON.stringify(t.shape)+" and "+JSON.stringify(n.shape));return e.tidy((function(){var e=n.relu(),r=n.abs().neg();return e.sub(n.mul(t)).add(r.exp().log1p())}))}(t,r),-1)}))}function bu(t,n){return e.tidy((function(){var r=pu(t,-1),i=pu(n,-1),a=e.mul(r,i);return e.neg(e.sum(a,-1))}))}var wu={meanSquaredError:du,meanAbsoluteError:fu,meanAbsolutePercentageError:gu,meanSquaredLogarithmicError:function(t,n){return e.tidy((function(){var r=e.clipByValue(n,ja(),Number.MAX_VALUE),i=e.log(e.add(1,r)),a=e.clipByValue(t,ja(),Number.MAX_VALUE),s=e.log(e.add(1,a));return e.mean(ro(e.sub(i,s)),-1)}))},squaredHinge:function(t,n){return e.tidy((function(){var r=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(ro(r),-1)}))},hinge:function(t,n){return e.tidy((function(){var r=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(r,-1)}))},categoricalHinge:function(t,n){return e.tidy((function(){var r=e.sum(e.mul(t,n),-1),i=e.max(e.mul(e.sub(1,t),n),-1);return e.maximum(0,e.add(1,e.sub(i,r)))}))},logcosh:function(t,n){return e.tidy((function(){var r=Math.log(2),i=e.sub(n,t),a=e.sub(e.add(i,e.softplus(e.mul(-2,i))),r);return e.mean(a,-1)}))},categoricalCrossentropy:mu,sparseCategoricalCrossentropy:yu,binaryCrossentropy:vu,kullbackLeiblerDivergence:function(t,n){return e.tidy((function(){var r=e.clipByValue(t,ja(),1),i=e.clipByValue(n,ja(),1);return e.sum(e.mul(t,e.log(e.div(r,i))),-1)}))},poisson:function(t,n){return e.tidy((function(){var r=e.log(e.add(ja(),n));return e.mean(e.sub(n,e.mul(t,r)),-1)}))},cosineProximity:bu};function ku(t){if("string"==typeof t){if(t in wu)return wu[t];var e="Unknown loss "+t;throw t.toLowerCase().includes("softmaxcrossentropy")&&(e="Unknown loss "+t+'. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy'),new Ga(e)}return t}function Su(t,n){return e.tidy((function(){var r=e.mul(.5,e.onesLike(n)),i=qs(e.greater(n,r),t.dtype);return e.mean(e.equal(t,i),-1)}))}function xu(t,n){return e.tidy((function(){return qs(e.equal(e.argMax(t,-1),e.argMax(n,-1)),"float32")}))}function Iu(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(1),n.equal(1)).sum().cast("float32")}))}function Nu(t,n){return e.tidy((function(){var r=Iu(t,n),i=function(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(0),n.equal(1)).sum().cast("float32")}))}(t,n),a=r.add(i);return e.where(e.greater(a,0),r.div(a),0).cast("float32")}))}function zu(t,n){return e.tidy((function(){var r=Iu(t,n),i=function(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(1),n.equal(0)).sum().cast("float32")}))}(t,n),a=r.add(i);return e.where(e.greater(a,0),r.div(a),0).cast("float32")}))}function Au(t,e){return vu(t,e)}function Cu(t,n){return t.rank===n.rank&&(t=t.squeeze([t.rank-1])),(n=n.argMax(-1)).dtype!==t.dtype&&(n=n.asType(t.dtype)),e.equal(t,n).asType("float32")}var Du=mu,Tu=yu,Eu={binaryAccuracy:Su,categoricalAccuracy:xu,precision:Nu,categoricalCrossentropy:Du,sparseCategoricalCrossentropy:Tu,mse:du,MSE:du,mae:fu,MAE:fu,mape:gu,MAPE:gu,cosine:bu};function Fu(t){if(Xa(null!==t,"Unknown LossOrMetricFn "+t),"string"==typeof t)return t;for(var e=void 0,n=0,r=Object.keys(wu);nLu&&console.warn('User-defined metadata of model "'+e+'" is too large in size (length='+r.length+" when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.")}}function Ru(t){if(null===t)return!0;if("object"==typeof t){if(Object.getPrototypeOf(t)===Object.prototype){for(var e=0,n=Object.keys(t);e1||1===o.length&&o[0].inboundLayers.length>1){e=!1;break}r.push.apply(r,o)}if(e)for(var u=0,l=t.layers;u0&&(r=r.slice(0,r.length-1)+" "),r=(r+=t[i]).slice(0,e[i]),r+=" ".repeat(e[i]-r.length);n(r)}function Bu(t,e,n){var r;try{r=JSON.stringify(t.outputShape)}catch(t){r="multiple"}Ou([t.name+" ("+t.getClassName()+")",r,t.countParams().toString()],e,n)}function $u(t,e,n,r){var i;try{i=JSON.stringify(t.outputShape)}catch(t){i="multiple"}for(var a=[],s=0,o=t.inboundNodes;s0&&-1===n.indexOf(u)))for(var l=0;l0,(function(){return"Expected at least one fetch, got none"}));var r=[],i={};if(1===t.length){var a=Ju(t[0],n);r=a.sorted,i=a.recipientMap}else for(var s=new Set,o=0,u=t;oi.maxNumTensors&&(i.maxNumTensors=w),w0;){var h=u[u.length-1];if(n.has(h.name))u.pop();else{var c=l[l.length-1]===u.length-1;if(0===h.inputs.length||c)u.pop(),r.push(h),n.add(h.name),c&&l.pop();else{l.push(u.length-1);for(var p=0,d=h.inputs;p1 nodes"),Xa(0===l,"input layer has >1 tensors"),r.inputLayers.push(o),r.inputLayersNodeIndices.push(u),r.inputLayersTensorIndices.push(l)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var p=0;p=0;)i.splice(i.indexOf(u),1);w.push(u)}},S=[],x=[],I=0,N=r.outputs;Ir?1:0}));for(var U=0,K=W;U0)throw new Ga("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var t=[],e=0,n=this.layers;e0)throw new Ga(d.length+" of "+r+" weights are not set: "+d)}jo(l)},n.prototype.updatedConfig=function(){var t=this.getConfig(),e={};return e.className=this.getClassName(),e.config=t,e.kerasVersion="tfjs-layers 3.6.0",e.backend="TensorFlow.js",e},n.prototype.toJSON=function(t,e){void 0===e&&(e=!0);var n=Uu(this.updatedConfig());return e?JSON.stringify(n):n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){t=ts(t);for(var e=new ju,i=0;i1)for(var o=0,u=s;o0){for(var d=[],f=0;f0&&t.apply(Qa(r),n)}function u(t){var n=t.name,a=cu(t,null!=e.customObjects?e.customObjects:{});a.setFastWeightInitDuringBuild(r),i[n]=a,t.inboundNodes.forEach((function(t){if(!(t instanceof Array))throw new Ga("Corrupted configuration, expected array for nodeData: "+t);s(a,t)}))}for(var l=e.name,h=e.layers,c=0,p=h;c0&&"object"==typeof t[Object.keys(t)[0]]){var i=[];return e.forEach((function(e){e in t?i.push(t[e]):i.push(null)})),i}throw new Error("The model has multiple ("+r+") outputs, so "+n+" must be either an array with "+r+" elements or an object with "+e+" keys. Provided "+n+" not understood: "+JSON.stringify(t))}(t,e,"classWeight")}function Qu(t,n,r,i){return Ua(this,void 0,void 0,(function(){var a,s,o,u,l;return Ka(this,(function(h){switch(h.label){case 0:if(null!=n||null!=i)throw new Error("Support sampleWeight is not implemented yet");return null==r?[3,2]:(a=e.tidy((function(){if(1===t.shape.length)return t.clone();if(2===t.shape.length){if(t.shape[1]>1){return t.argMax(1)}if(1===t.shape[1])return t.reshape([t.shape[0]]);throw new Error("Encountered unexpected last-dimension size ("+t.shape[1]+") during handling of class weights. The size is expected to be >= 1.")}throw new Error("Unexpected rank of target (y) tensor ("+t.rank+") during handling of class weights. The rank is expected to be 1 or 2.")})),u=(o=Array).from,[4,a.data()]);case 1:return s=u.apply(o,[h.sent()]),e.dispose(a),l=[],s.forEach((function(t){if(null==r[t])throw new Error("classWeight must contain all classes in the training data. The class "+t+" exists in the data but not in classWeight");l.push(r[t])})),[2,e.tensor1d(l,"float32")];case 2:return[2,null]}}))}))}function tl(t,n){return e.mul(t,n)}function el(t,n){var r,i,a=n;r=a.xs,i=a.ys,e.util.assert(null!=r&&null!=i,(function(){return"A Dataset iterator for fitDataset() is expected to generate objects of the form `{xs: xVal, ys: yVal}`, where the two values may be `tf.Tensor`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates "+n}));var s=nl("input",t.inputNames,r),o=nl("output",t.outputNames,i),u=s[0].shape[0];e.util.assert(s.length===t.inputs.length,(function(){return"LayersModel has "+t.inputs.length+" inputs, but the dataset provides "+s.length+" inputs. (Expected input keys: "+JSON.stringify(t.inputNames)+")"})),e.util.assert(o.length===t.outputs.length,(function(){return"LayersModel has "+t.outputs.length+" outputs, but the dataset provides "+o.length+" outputs. (Expected output keys: "+JSON.stringify(t.outputNames)+")"}));for(var l=function(n){e.util.assert(s[n].shape[0]===u,(function(){return"Batch size mismatch: input "+t.inputNames[n]+" has "+s[n].shape[0]+"; expected "+u+" based on input "+t.inputNames[0]+"."}))},h=0;h0&&Number.isInteger(r.epochs),(function(){return"For fitDataset(), config.epochs is expected to be a positive integer, but got "+r.epochs})),e.util.assert(!i||r.batchesPerEpoch>0&&Number.isInteger(r.batchesPerEpoch),(function(){return"For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got "+r.batchesPerEpoch})),e.util.assert(null==r.validationSplit,(function(){return"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."})),t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");t.isTraining=!0,B.label=1;case 1:return B.trys.push([1,,26,27]),a=null!=r.validationData,s=void 0,o=void 0,a&&(il(r.validationData)?e.util.assert(null==r.validationBatches||r.validationBatches>0&&Number.isInteger(r.validationBatches),(function(){return"For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got "+r.validationBatches})):(u=function(t){if(3===t.length)throw new Ha("Validation with sample weights is not implemented yet.");return{xs:t[0],ys:t[1]}}(r.validationData),s=u.xs,o=u.ys)),l=t.makeTrainFunction(),h=t.getDedupedMetricsNames(),c=void 0,c=a?h.slice().concat(h.map((function(t){return"val_"+t}))):h.slice(),p=uu(r.callbacks,r.yieldEvery),d=null==r.verbose?1:r.verbose,f=hu(p,d,r.epochs,null,null,function(t,e){var n=null;null!=e.batchesPerEpoch?n=e.batchesPerEpoch:Number.isFinite(t.size)&&(n=t.size);return n}(n,r),null,a,c),g=f.callbackList,m=f.history,g.setModel(t),t.history=m,[4,g.onTrainBegin()];case 2:return B.sent(),t.stopTraining_=!1,y=null==r.initialEpoch?0:r.initialEpoch,[4,n.iterator()];case 3:v=B.sent(),B.label=4;case 4:return y=r.batchesPerEpoch:S.done)?a?(R=void 0,il(r.validationData)?(M=ts,[4,t.evaluateDataset(r.validationData,{batches:r.validationBatches})]):[3,17]):[3,19]:[3,20];case 16:return R=M.apply(void 0,[B.sent()]),[3,18];case 17:R=ts(t.evaluate(s,o,{batchSize:null==r.validationBatchSize?32:r.validationBatchSize,verbose:0})),B.label=18;case 18:for(O=0;O0)throw new Ha("Verbose mode is not implemented yet.");return e.util.assert(!i||r.batches>0&&Number.isInteger(r.batches),(function(){return"Test loop expects `batches` to be a positive integer, but received "+JSON.stringify(r.batches)})),"function"!=typeof n.next?[3,1]:(u=n,[3,3]);case 1:return[4,n.iterator()];case 2:u=f.sent(),f.label=3;case 3:o=u,l=0,h=0,c=function(){var n;return Ka(this,(function(u){switch(u.label){case 0:return[4,o.next()];case 1:return n=u.sent(),s=e.tidy((function(){if(n.value){var r=el(t,n.value),i=r.xs,o=r.ys,u=i.concat(o),c=e.tidy((function(){return a(u)}));if(e.dispose(u),0===h)for(var p=0;p0&&e.dispose(r)};for(p=0;p0&&Number.isInteger(t),(function(){return"batchSize is required to be a positive integer, but got "+t}))}function ol(t,e,n){return null==t?[null]:Array.isArray(t)?t.map((function(t){return Hs(t,e,n-e)})):Hs(t,e,n-e)}function ul(t,n){return e.tidy((function(){return null==t?null:Array.isArray(t)?t.map((function(t){return ul(t,n)})):no(t,"int32"===n.dtype?n:n.toInt())}))}function ll(t,e){for(var n=[],r=0,i=null;r=t&&(i=t),n.push([r,i]),r=i;return n}function hl(t,n,r,i,a,s,o,u,l,h,c,p,d,f,g){return Ua(this,void 0,void 0,(function(){var m,y,v,b,w,k,S,x;return Ka(this,(function(I){switch(I.label){case 0:if(null==a&&(a=32),null==s&&(s=1),null==c&&(c=!0),null==d&&(d=0),m=!1,null!=l&&null!=h&&(m=!0),null!=g&&(m=!0,null==f))throw new Ga("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");return null!=(y=t.checkNumSamples(r,a,f,"steps_per_epoch"))&&(v=Vs(0,y)),null==o&&(o=1),b=hu(u,o,s,d,y,f,a,m,p),w=b.callbackList,k=b.history,w.setModel(t),t.history=k,[4,w.onTrainBegin()];case 1:I.sent(),t.stopTraining_=!1,S=function(s){var o,u,p,d,g;return Ka(this,(function(b){switch(b.label){case 0:return[4,w.onEpochBegin(s)];case 1:if(b.sent(),o={},null==f)return[3,2];throw new Ha("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===c)throw new Ha("batch shuffling is not implemneted yet");c&&e.util.shuffle(v),u=e.tensor1d(v),p=ll(y,a),d=function(s){var c;return Ka(this,(function(d){switch(d.label){case 0:return c={},[4,w.onBatchBegin(s,c)];case 1:return d.sent(),e.tidy((function(){var d=p[s][0],f=p[s][1],g=Hs(u,d,f-d);c.batch=s,c.size=f-d;for(var y=ul(r,g),v=n(y),b=0;b0))return[3,4];if(f=!0,2!==i.validationData.length)throw 3===i.validationData.length?new Ha("validationData including sample weights is not supported yet."):new Ga("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+i.validationData+" is invalid.");return o=i.validationData[0],u=i.validationData[1],!0,[4,t.standardizeUserData(o,u,null,null,true,p)];case 3:return m=N.sent(),l=m[0],h=m[1],g=l.concat(h),[3,5];case 4:null!=i.validationSplit&&i.validationSplit>0&&i.validationSplit<1?(f=!0,y=Math.floor(a[0].shape[0]*(1-i.validationSplit)),v=a[0].shape[0],l=ol(a,y,v),a=ol(a,0,y),h=ol(s,y,v),s=ol(s,0,y),g=l.concat(h)):null!=i.validationSteps&&(f=!0),N.label=5;case 5:return b=a.concat(s).concat(c),t.checkTrainableWeightsConsistency(),w=t.makeTrainFunction(),k=t.getDedupedMetricsNames(),S=void 0,x=void 0,f?(t.makeTestFunction(),S=t.testFunction,x=k.slice().concat(k.map((function(t){return"val_"+t})))):(S=null,g=[],x=k.slice()),I=uu(i.callbacks,i.yieldEvery),[4,hl(t,w,b,k,p,i.epochs,i.verbose,I,S,g,i.shuffle,x,i.initialEpoch,null,null)];case 6:return[2,N.sent()];case 7:return t.isTraining=!1,dl(a,n),dl(s,r),dl(l,o),dl(h,u),null!=c&&e.dispose(c),[7];case 8:return[2]}}))}))}function pl(t){var n=[];t instanceof e.Tensor&&(t=[t]);for(var r=0;r0)a=!0;else if(gl(t)){for(var s in t)if(t.hasOwnProperty(s)){a=!0;break}}else a=!0;if(a)throw new Ga("Error when checking model "+i+" expected no data, but got "+t)}return[]}if(null==t)return e.map((function(t){return null}));var o;if(gl(t)){t=t,o=[];for(var u=0,l=e;u1)throw new Ga("The model "+i+" expects "+e.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+t.shape);o=[t]}if(o=pl(o),null!=n)for(var c=0;c=0&&f!==g)throw new Ga("Error when checking "+i+": expected "+e[c]+" to have shape ["+n[c]+"], but got array with shape ["+p.shape+"].")}}return o}function yl(t,e,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(t)){if(t.length!==e.length)throw new Ga("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+e.length+" Tensor(s), but instead got "+t.length+" Tensors(s).");a=t}else{if(e.length>1)throw new Ga("The model expects "+e.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(t.shape)+".");a=[t]}if(null!=n)for(var s=0;s1&&(n.metricsTensors.push([e,t]),n.metricsNames.push(n.outputNames[t]+"_loss"))}}));var f=function(t,e){if(null==t||Array.isArray(t)&&0===t.length)return e.map((function(t){return[]}));var n;if("string"==typeof t||"function"==typeof t)n=[t];else{if(!Array.isArray(t)&&"object"!=typeof t)throw new TypeError("Type of metrics argument not understood. Expected an string,function, Array, or Object, found: "+t);n=t}if(Array.isArray(n))return e.map((function(t){return n}));for(var r=[],i=0,a=e;i1&&(e=n.outputNames[t]+"_"+e),n.metricsNames.push(e),n.metricsTensors.push([r,t])}(t,r,l)},o=0,u=e;o0){var h=[];throw e.forEach((function(e,n){null==e&&h.push(t[n])})),new Ga("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(h))}return e},n.prototype.predictLoop=function(t,n,r){var i=this;return void 0===n&&(n=32),void 0===r&&(r=!1),e.tidy((function(){var a=i.checkNumSamples(t);if(r)throw new Ha("Verbose predictLoop() is not implemented yet.");for(var s=ll(a,n),o=i.outputs.map((function(t){return[]})),u=function(n){e.tidy((function(){var e=s[n][0],r=s[n][1],a=ol(t,e,r),o=[];if(Array.isArray(a))for(var u=0;u1)throw new Ga("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map((function(t){return t.shape}))));if(a.length>1)throw new Ga("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(n.map((function(t){return t.shape}))));if(i.length>0&&a.length>0&&!e.util.arraysEqual(i,a))throw new Ga("Input Tensors should have the same number of samples as target Tensors. Found "+i[0]+" input sample(s) and "+a[0]+" target sample(s).")}(t=ml(t,this.feedInputNames,this.feedInputShapes,!1,"input"),n=ml(n,this.feedOutputNames,a,!1,"target")),function(t,e,n){for(var r=[du,vu,mu],i=0;i0&&t[0].shape[0]%i!=0)throw new Ga("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+i+". Found: "+t[0].shape[0]+" sample(s).");return[t,n]},n.prototype.standardizeUserData=function(t,e,n,r,i,a){return void 0===i&&(i=!0),Ua(this,void 0,void 0,(function(){var s,o,u,l,h,c,p,d;return Ka(this,(function(f){switch(f.label){case 0:if(s=this.standardizeUserDataXY(t,e,i,a),o=s[0],u=s[1],null!=n)throw new Error("sample weight is not supported yet.");if(l=null,null==r)return[3,4];h=Yu(r,this.outputNames),l=[],c=0,f.label=1;case 1:return c0)throw new Ha("Verbose mode is not implemented yet.");if(null!=a)throw new Ha("steps mode in testLoop() is not implemented yet");for(var l=ll(o,r),h=e.tensor1d(Vs(0,o)),c=0;c1)i+="_"+Ya(t.slice(0,n),r);e.push(i)}return e},n.prototype.makeTrainFunction=function(){var t=this;return function(n){var r=[],i=n.slice(0,t.inputs.length),a=n.slice(t.inputs.length,t.inputs.length+t.outputs.length),s=n.slice(t.inputs.length+t.outputs.length,t.inputs.length+2*t.outputs.length),o=[],u=t.collectedTrainableWeights.map((function(t){return t.read()}));return[t.optimizer_.minimize((function(){for(var n=[],u=0;u1&&u1)throw new Ga("Found more than one ("+r.length+") save handlers for URL '"+t+"'");t=r[0]}if(null==t.save)throw new Ga("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,e.io.encodeWeights(this.getNamedWeights(n))];case 1:return i=f.sent(),!1,null,a=this.toJSON(null,false),s={modelTopology:a,format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v3.6.0",convertedBy:null},null!=n&&n.includeOptimizer&&null!=this.optimizer?(s.trainingConfig=this.getTrainingConfig(),o="optimizer",p=(c=e.io).encodeWeights,[4,this.optimizer.getWeights()]):[3,4];case 2:return[4,p.apply(c,[f.sent(),o])];case 3:u=f.sent(),l=u.data,h=u.specs,(d=i.specs).push.apply(d,h),i.data=e.io.concatenateArrayBuffers([i.data,l]),f.label=4;case 4:return null!=this.userDefinedMetadata&&(!0,_u(this.userDefinedMetadata,this.name,true),s.userDefinedMetadata=this.userDefinedMetadata),s.weightData=i.data,s.weightSpecs=i.specs,[2,t.save(s)]}}))}))},n.prototype.setUserDefinedMetadata=function(t){_u(t,this.name),this.userDefinedMetadata=t},n.prototype.getUserDefinedMetadata=function(){return this.userDefinedMetadata},n.className="Model",n}(Xu);e.serialization.registerClass(vl);var bl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.className="Functional",e}(vl);function wl(t,n,r){return Ua(this,void 0,void 0,(function(){var i,a,s,o,u,l,h,c,p;return Ka(this,(function(d){switch(d.label){case 0:if(null==r&&(r={}),null==t.load)throw new Ga("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,t.load()];case 1:if(i=d.sent(),null!=(a=i.modelTopology).model_config&&(a=a.model_config),s=null==r.strict||r.strict,o=null!=i.weightData&&null!=i.weightSpecs&&s,u=cu(Wu(a),n,o),null!=(l=i.trainingConfig)&&u.loadTrainingConfig(l),null!=i.userDefinedMetadata&&u.setUserDefinedMetadata(i.userDefinedMetadata),null==i.weightData)return[3,4];if(null==i.weightSpecs)throw new Ga("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");return h=function(t,n){var r=e.io.decodeWeights(t,n),i={},a=[];return n.forEach((function(t){"optimizer"===t.group?a.push({name:t.name,tensor:r[t.name]}):i[t.name]=r[t.name]})),{modelWeights:i,optimizerWeights:a}}(i.weightData,i.weightSpecs),c=h.modelWeights,p=h.optimizerWeights,u.loadWeights(c,s),null!=u.optimizer&&p.length>0?[4,u.optimizer.setWeights(p)]:[3,3];case 2:d.sent(),d.label=3;case 3:e.dispose(c),e.dispose(p.map((function(t){return t.tensor}))),d.label=4;case 4:return[2,u]}}))}))}e.serialization.registerClass(bl);var kl=function(t){function n(e){var n=t.call(this,{inputs:[],outputs:[]})||this;if(e=e||{},n.trainable=!0,n.built=!1,n.name=null!=e.name?e.name:Ro("sequential_"),null!=e.layers)for(var r=0,i=e.layers;r 0 but got "+JSON.stringify(t.filters))},n}(sh),uh=function(t){function e(n){var r=t.call(this,2,n)||this;return e.verifyArgs(n),r}return $a(e,t),e.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.rank,e},e.verifyArgs=function(t){if("number"!=typeof t.kernelSize&&!cs(t.kernelSize,"number",1,2))throw new Ga("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(t.kernelSize)+".")},e.className="Conv2D",e}(oh);e.serialization.registerClass(uh);var lh=function(t){function e(n){var r=t.call(this,3,n)||this;return e.verifyArgs(n),r}return $a(e,t),e.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.rank,e},e.verifyArgs=function(t){if("number"!=typeof t.kernelSize&&(!Array.isArray(t.kernelSize)||1!==t.kernelSize.length&&3!==t.kernelSize.length))throw new Ga("Conv3D expects config.kernelSize to be number or [number, number, number], but received "+JSON.stringify(t.kernelSize)+".")},e.className="Conv3D",e}(oh);e.serialization.registerClass(lh);var hh=function(t){function n(e){var n=t.call(this,e)||this;if(n.inputSpec=[new Vo({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new Ga("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return $a(n,t),n.prototype.build=function(t){var e;if(4!==(t=$o(t)).length)throw new Ga("Input should have rank 4; Received input shape: "+JSON.stringify(t));var n="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[n])throw new Ga("The channel dimension of the inputs should be defined. Found `None`.");var r=t[n],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vo({ndim:4,axes:(e={},e[n]=r,e)})],this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);if(4!==n.shape.length)throw new Ga("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+n.shape.length);var i,a,s=n.shape,o=s[0];"channelsFirst"===r.dataFormat?(i=2,a=3):(i=1,a=2);var u=s[i],l=s[a],h=r.kernelSize[0],c=r.kernelSize[1],p=r.strides[0],d=r.strides[1],f=[o,nh(u,p,h,r.padding),nh(l,d,c,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(n=e.transpose(n,[0,2,3,1]));var g=e.conv2dTranspose(n,r.kernel.read(),f,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(g=e.transpose(g,[0,3,1,2])),null!=r.bias&&(g=ao(g,r.bias.read(),r.dataFormat)),null!=r.activation&&(g=r.activation.apply(g)),g}))},n.prototype.computeOutputShape=function(t){var e,n,r,i=(t=$o(t)).slice();"channelsFirst"===this.dataFormat?(e=1,n=2,r=3):(e=3,n=1,r=2);var a=this.kernelSize[0],s=this.kernelSize[1],o=this.strides[0],u=this.strides[1];return i[e]=this.filters,i[n]=nh(i[n],o,a,this.padding),i[r]=nh(i[r],u,s,this.padding),i},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.dilationRate,e},n.className="Conv2DTranspose",n}(uh);e.serialization.registerClass(hh);var ch=function(t){function n(e){var n=t.call(this,e)||this;if(n.inputSpec=[new Vo({ndim:5})],"same"!==n.padding&&"valid"!==n.padding)throw new Ga("Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return $a(n,t),n.prototype.build=function(t){var e;if(5!==(t=$o(t)).length)throw new Ga("Input should have rank 5; Received input shape: "+JSON.stringify(t));var n="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[n])throw new Ga("The channel dimension of the inputs should be defined. Found `None`.");var r=t[n],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vo({ndim:5,axes:(e={},e[n]=r,e)})],this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);if(5!==n.shape.length)throw new Ga("Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+n.shape.length);var i,a,s,o=n.shape,u=o[0];"channelsFirst"===r.dataFormat?(s=2,i=3,a=4):(s=1,i=2,a=3);var l=o[s],h=o[i],c=o[a],p=r.kernelSize[0],d=r.kernelSize[1],f=r.kernelSize[2],g=r.strides[0],m=r.strides[1],y=r.strides[2],v=[u,nh(l,g,p,r.padding),nh(h,m,d,r.padding),nh(c,y,f,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(n=e.transpose(n,[0,2,3,4,1]));var b=e.conv3dTranspose(n,r.kernel.read(),v,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(b=e.transpose(b,[0,4,1,2,3])),null!==r.bias&&(b=ao(b,r.bias.read(),r.dataFormat)),null!==r.activation&&(b=r.activation.apply(b)),b}))},n.prototype.computeOutputShape=function(t){var e,n,r,i,a=(t=$o(t)).slice();"channelsFirst"===this.dataFormat?(e=1,n=2,r=3,i=4):(e=4,n=1,r=2,i=3);var s=this.kernelSize[0],o=this.kernelSize[1],u=this.kernelSize[2],l=this.strides[0],h=this.strides[1],c=this.strides[2];return a[e]=this.filters,a[n]=nh(a[n],l,s,this.padding),a[r]=nh(a[r],h,o,this.padding),a[i]=nh(a[i],c,u,this.padding),a},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.dilationRate,e},n.className="Conv3DTranspose",n}(lh);e.serialization.registerClass(ch);var ph=function(t){function e(e){return t.call(this,2,e)||this}return $a(e,t),e.className="SeparableConv2D",e}(function(t){function n(e,n){var r=t.call(this,e,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new Ga("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new Ga("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new Ga("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=To(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=Gl(n.depthwiseRegularizer),r.depthwiseConstraint=Is(n.depthwiseConstraint),r.pointwiseInitializer=To(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=Gl(n.pointwiseRegularizer),r.pointwiseConstraint=Is(n.pointwiseConstraint),r}return $a(n,t),n.prototype.build=function(t){var e;if((t=$o(t)).length1&&(e=t.slice(1,t.length)),t=t[0]}function i(t){return null==t||Array.isArray(t)?t:[t]}return{inputs:t,initialState:e=i(e),constants:n=i(n)}}function vh(t,n,r,i,a,s,o,u){return void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===u&&(u=!1),e.tidy((function(){var l=n.shape.length;if(l<3)throw new Ga("Input should be at least 3D, but is "+l+"D.");var h=[1,0].concat(Vs(2,l));if(n=e.transpose(n,h),null!=s)throw new Ha("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=a&&((a=a.asType("bool").asType("float32")).rank===l-1&&(a=e.expandDims(a,-1)),a=e.transpose(a,h)),i&&(n=e.reverse(n,0),null!=a&&(a=e.reverse(a,0)));var c,p,d=[],f=r,g=n.shape[0],m=e.unstack(n);null!=a&&(p=e.unstack(a));for(var y,v=function(n){var r=m[n],i=e.tidy((function(){return t(r,f)}));if(null==a)c=i[0],f=i[1];else{var s=e.tidy((function(){var t=p[n],r=e.onesLike(t).sub(t);return{output:i[0].mul(t).add(f[0].mul(r)),newStates:f.map((function(e,n){return i[1][n].mul(t).add(e.mul(r))}))}}));c=s.output,f=s.newStates}u&&d.push(c)},b=0;b1?Qs(r,[1,t]):r})):n.cell.stateSize>1?[Qs(r,[1,n.cell.stateSize])]:[r]}))},Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),n.prototype.setFastWeightInitDuringBuild=function(e){t.prototype.setFastWeightInitDuringBuild.call(this,e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),r={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(r.numConstants=this.numConstants);var i=this.cell.getConfig();return this.getClassName()===n.className&&(r.cell={className:this.cell.getClassName(),config:i}),Wa({},i,e,r)},n.fromConfig=function(t,e,n){void 0===n&&(n={});var r=cu(e.cell,n);return new t(Object.assign(e,{cell:r}))},n.className="RNN",n}(Zo);e.serialization.registerClass(bh);var wh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e}(Zo),kh=function(t){function n(e){var n=t.call(this,e)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=e.units,ps(n.units,"units"),n.activation=Pl(null==e.activation?n.DEFAULT_ACTIVATION:e.activation),n.useBias=null==e.useBias||e.useBias,n.kernelInitializer=To(e.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=To(e.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=To(e.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=Gl(e.kernelRegularizer),n.recurrentRegularizer=Gl(e.recurrentRegularizer),n.biasRegularizer=Gl(e.biasRegularizer),n.kernelConstraint=Is(e.kernelConstraint),n.recurrentConstraint=Is(e.recurrentConstraint),n.biasConstraint=Is(e.biasConstraint),n.dropout=Ks([1,js([0,null==e.dropout?0:e.dropout])]),n.recurrentDropout=Ks([1,js([0,null==e.recurrentDropout?0:e.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return $a(n,t),n.prototype.build=function(t){t=$o(t),this.kernel=this.addWeight("kernel",[t[t.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){if(2!==(t=t).length)throw new Ga("SimpleRNNCell expects 2 input Tensors, got "+t.length+".");var i=t[1];t=t[0];var a,s=null!=n.training&&n.training;01){for(var i=[0],a=2;a1)throw new Ga("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(t)+".");for(var i=null==t[0]?null:t[0].slice(1),a=1;a1){var v=Vs(1,u).concat([0]);n.push(e.transpose(d,v)),h=!0}else n.push(d)}var b=r.mergeFunction(n),w=b.rank;if(h)if(null==w){var k=b.shape;m=[g=k[k.length-1]].concat(k.slice(0,k.length-1));b=e.transpose(b.reshape([-1,g]),[1,0]).reshape(m)}else if(w>1){v=[w-1].concat(Vs(0,w-1));b=e.transpose(b,v)}return b}return r.mergeFunction(t)}))},n.prototype.computeOutputShape=function(t){var e;e=null==(t=t)[0]?null:t[0].slice(1);for(var n=1;n1)throw new Ga("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(t))}},n.prototype.mergeFunction=function(t){var n=this;return e.tidy((function(){return Xs(t,n.axis)}))},n.prototype.computeOutputShape=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Ga("A `Concatenate` layer should be called on a list of inputs.");for(var e=t,n=e[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=e.slice(1);i3||r.length>3)throw new Ha("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(n,r);if(n[i[0]]!==r[i[1]])throw new Ga("Dimension incompatibility: "+n[i[0]]+" !== "+r[i[1]])},n.prototype.mergeFunction=function(t){if(2!==t.length)throw new Ga("A `Dot` layer must be called on exactly 2 inputs, but received "+t.length+" input(s).");var n,r=t[0],i=t[1];return n=Array.isArray(this.axes)?this.axes.map((function(e,n){return Jh(e,t[n].shape.length)})):[Jh(this.axes,r.shape.length),Jh(this.axes,i.shape.length)],this.normalize&&(r=pu(r,n[0]),i=pu(i,n[1])),function(t,n,r){if(t.shape.length>3||n.shape.length>3)throw new Ha("batchDot is not implemented for tensors of 4D or higher rank yet");if(e.util.assert(t.shape.length>=2,(function(){return"batchDot requires the rank of x to be >= 2, but got "+t.shape.length})),e.util.assert(t.shape.length>=2,(function(){return"batchDot requires the rank of y to be >= 2, but got "+n.shape.length})),"number"==typeof r&&(r=[r,r]),"complex64"===t.dtype||"complex64"===n.dtype)throw new Ha("batchDot is not implemented for complex64-type Tensors yet.");var i=t.shape.length,a=n.shape.length;null==r&&(r=[i-1,a-2]);var s=r;return e.tidy((function(){var e,r;if(i>a){e=i-a;for(var o=[],u=0;ui){for(e=a-i,o=[],u=0;u0){var c=void 0,p=[];for(u=c=i>a?i+a-3:i-1;u3||r.length>3)throw new Ha("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(n,r);n.splice(i[0],1),r.splice(i[1],1),r.splice(0,1);var a=n.concat(r);return 1===a.length&&a.push(1),a},n.prototype.computeMask=function(t,e){return null},n.prototype.getConfig=function(){var e={axes:this.axes,normalize:this.normalize},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="Dot",n}(Uh);e.serialization.registerClass(Zh);var Xh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.stddev=e.stddev,n}return $a(n,t),n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={stddev:this.stddev};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n);var e=Bo(t);return oo((function(){return to(e.shape,0,r.stddev).add(e)}),(function(){return e}),n.training||!1)}))},n.className="GaussianNoise",n}(Zo);e.serialization.registerClass(Xh);var Yh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.rate=e.rate,n}return $a(n,t),n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n);var e=Bo(t);if(r.rate>0&&r.rate<1){return oo((function(){var t=Math.sqrt(r.rate/(1-r.rate));return e.mul(to(e.shape,1,t))}),(function(){return e}),n.training||!1)}return e}))},n.className="GaussianDropout",n}(Zo);e.serialization.registerClass(Yh);var Qh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.rate=e.rate,n.noiseShape=e.noiseShape,n}return $a(n,t),n.prototype._getNoiseShape=function(t){return this.noiseShape||Bo(t).shape},n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){if(r.rate<1&&r.rate>0){var i=r._getNoiseShape(t);return oo((function(){var n=Bo(t),a=-1.7580993408473766,s=e.greaterEqual(e.randomUniform(i),r.rate);s=qs(s,"float32");var o=Math.pow((1-r.rate)*(1+r.rate*Math.pow(a,2)),-.5),u=-o*a*r.rate;return n.mul(s).add(s.add(-1).mul(a)).mul(o).add(u)}),(function(){return Bo(t)}),n.training||!1)}return t}))},n.className="AlphaDropout",n}(Zo);function tc(t,n,r,i,a,s){var o;if(void 0===s&&(s=.001),2===t.rank)o=e.batchNorm2d(t,n,r,i,a,s);else if(3===t.rank)o=e.batchNorm3d(t,n,r,i,a,s);else{if(4!==t.rank)throw new Ha("batchNormalization is not implemented for array of rank "+t.rank+" yet");o=e.batchNorm4d(t,n,r,i,a,s)}return o}function ec(t,n,r,i,a){return void 0===a&&(a=.001),e.util.arraysEqual(i.slice().sort(),Vs(0,t.rank-1))?function(t,n,r,i,a){return void 0===a&&(a=.001),e.tidy((function(){var s=e.moments(t,i),o=s.mean,u=s.variance;return[tc(t,o,u,r,n,a),o,u]}))}(t,n,r,i,a):function(t,n,r,i,a){return void 0===a&&(a=.001),e.tidy((function(){for(var s=e.moments(t,i),o=s.mean,u=s.variance,l=[],h=0,c=Vs(0,t.rank);h=0?this.axis:this.axis+t.length,r=t[n];if(null==r)throw new Ga("Axis "+n+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(t)+".");this.inputSpec=[new Vo({ndim:t.length,axes:(e={},e[n]=r,e)})];var i=[r];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var i=null!=n.training&&n.training,a=Bo(t),s=a.shape,o=s.length,u=Vs(0,o),l=r.axis>=0?r.axis:r.axis+o;u.splice(l,1);var h=Za(1,o);h[l]=s[l];var c=u.slice();c.sort();var p=!e.util.arraysEqual(c,Vs(0,o).slice(0,o-1));if(!i)return function(){if(p){var t=r.movingMean.read().reshape(h),e=r.movingVariance.read().reshape(h),n=r.center?r.beta.read().reshape(h):null,i=r.scale?r.gamma.read().reshape(h):null;return tc(a,t,e,n,i,r.epsilon)}return tc(a,r.movingMean.read(),r.movingVariance.read(),null==r.beta?null:r.beta.read(),null==r.gamma?null:r.gamma.read(),r.epsilon)}();var d=ec(a,r.gamma.read(),r.beta.read(),u,r.epsilon),f=d[0],g=d[1],m=d[2],y=function(t,n,r){e.tidy((function(){var e=1-r,i=t.read(),a=i.sub(n).mul(e);t.write(i.sub(a))}))};return y(r.movingMean,g,r.momentum),y(r.movingVariance,m,r.momentum),f}))},n.prototype.getConfig=function(){var e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Do(this.betaInitializer),gammaInitializer:Do(this.gammaInitializer),movingMeanInitializer:Do(this.movingMeanInitializer),movingVarianceInitializer:Do(this.movingVarianceInitializer),betaRegularizer:Vl(this.betaRegularizer),gammaRegularizer:Vl(this.gammaRegularizer),betaConstraint:Ss(this.betaConstraint),gammaConstraint:Ss(this.gammaConstraint)},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="BatchNormalization",n}(Zo);e.serialization.registerClass(nc);var rc=function(t){function n(e){var n=this;if(null==e&&(e={}),(n=t.call(this,e)||this).axis=null==e.axis?-1:e.axis,"number"==typeof n.axis){if(!Number.isInteger(n.axis))throw new Error("Expected axis to be an integer, but received "+n.axis)}else{if(!Array.isArray(n.axis))throw new Error("Expected axis to be an integer or an array of integers, but received "+JSON.stringify(n.axis));for(var r=0,i=n.axis;r=e)throw new Error("Invalid axis: "+a)}if(this.axis.length!==us(this.axis).length)throw new Error("Found duplicate axes in: "+this.axis);var s=this.axis.map((function(e){return t[e]}));this.scale?this.gamma=this.addWeight("gamma",s,"float32",this.gammaInitializer,this.gammaRegularizer,true):this.gamma=null,this.center?this.beta=this.addWeight("beta",s,"float32",this.betaInitializer,this.betaRegularizer,true):this.beta=null,this.built=!0},n.prototype.call=function(t,n){var r=this,i=Bo(t),a=i.shape,s=a.length;return e.tidy((function(){for(var t=e.moments(i,r.axis,!0),n=t.mean,o=t.variance,u=Za(1,s),l=0,h=r.axis;l=0?t[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[3]&&t[3]>=0?t[3]+this.padding[1][0]+this.padding[1][1]:null,[t[0],t[1],e,n]):(e=null!=t[1]&&t[1]>=0?t[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[2]&&t[2]>=0?t[2]+this.padding[1][0]+this.padding[1][1]:null,[t[0],e,n,t[3]])},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return n=Bo(t),i=r.padding,a=r.dataFormat,e.tidy((function(){if(4!==n.rank)throw new Ga("temporalPadding expects input tensor to be 4-D, but received a "+n.rank+"-D tensor.");if(null==i&&(i=[[1,1],[1,1]]),2!==i.length||2!==i[0].length||2!==i[1].length)throw new Ga("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==a&&(a="channelsLast"),"channelsLast"!==a&&"channelsFirst"!==a)throw new Ga("Unknown data format: "+a+". Supported data formats are 'channelsLast' and 'channelsFirst.");var t;return t="channelsFirst"===a?[[0,0],[0,0],i[0],i[1]]:[[0,0],i[0],i[1],[0,0]],e.pad(n,t)}));var n,i,a}))},n.prototype.getConfig=function(){var e={padding:this.padding,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="ZeroPadding2D",n}(Zo);function ac(t,n,r,i,a,s){return e.tidy((function(){var o;Fs(a),_s(s),Ls(i),null==r&&(r=[1,1]),null==i&&(i="valid"),null==a&&(a="channelsLast"),null==s&&(s="max"),t=rh(t,a);var u="same"===i?"same":"valid";return o="max"===s?e.maxPool(t,n,r,u):e.avgPool(t,n,r,u),"channelsFirst"===a&&(o=e.transpose(o,[0,3,1,2])),o}))}function sc(t,n,r,i,a,s){return e.tidy((function(){var o;Fs(a),_s(s),Ls(i),null==r&&(r=[1,1,1]),null==i&&(i="valid"),null==a&&(a="channelsLast"),null==s&&(s="max"),t=ih(t,a);var u="same"===i?"same":"valid";return o="max"===s?e.maxPool3d(t,n,r,u):e.avgPool3d(t,n,r,u),"channelsFirst"===a&&(o=e.transpose(o,[0,4,1,2,3])),o}))}e.serialization.registerClass(ic);var oc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=2),n=t.call(this,e)||this,"number"==typeof e.poolSize)n.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new Ga("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.poolSize));n.poolSize=e.poolSize}if(ps(n.poolSize,"poolSize"),null==e.strides)n.strides=n.poolSize;else if("number"==typeof e.strides)n.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new Ga("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.strides));n.strides=e.strides}return ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,Ls(n.padding),n.inputSpec=[new Vo({ndim:3})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){var e=eh((t=$o(t))[1],this.poolSize[0],this.padding,this.strides[0]);return[t[0],e,t[2]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n),t=Gs(Bo(t),2);var i=r.poolingFunction(Bo(t),[r.poolSize[0],1],[r.strides[0],1],r.padding,"channelsLast");return e.squeeze(i,[2])}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),uc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"max")},e.className="MaxPooling1D",e}(oc);e.serialization.registerClass(uc);var lc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"avg")},e.className="AveragePooling1D",e}(oc);e.serialization.registerClass(lc);var hc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=[2,2]),(n=t.call(this,e)||this).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)n.strides=n.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new Ga("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+e.strides.length+".");n.strides=e.strides}else n.strides=[e.strides,e.strides];return ps(n.poolSize,"poolSize"),ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),Ls(n.padding),n.inputSpec=[new Vo({ndim:4})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){t=$o(t);var e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2];return e=eh(e,this.poolSize[0],this.padding,this.strides[0]),n=eh(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n]:[t[0],e,n,t[3]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return r.invokeCallHook(t,n),r.poolingFunction(Bo(t),r.poolSize,r.strides,r.padding,r.dataFormat)}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),cc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"max")},e.className="MaxPooling2D",e}(hc);e.serialization.registerClass(cc);var pc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"avg")},e.className="AveragePooling2D",e}(hc);e.serialization.registerClass(pc);var dc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=[2,2,2]),(n=t.call(this,e)||this).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)n.strides=n.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new Ga("If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length "+e.strides.length+".");n.strides=e.strides}else n.strides=[e.strides,e.strides,e.strides];return ps(n.poolSize,"poolSize"),ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),Ls(n.padding),n.inputSpec=[new Vo({ndim:5})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){t=$o(t);var e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],r="channelsFirst"===this.dataFormat?t[4]:t[3];return e=eh(e,this.poolSize[0],this.padding,this.strides[0]),n=eh(n,this.poolSize[1],this.padding,this.strides[1]),r=eh(r,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n,r]:[t[0],e,n,r,t[4]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return r.invokeCallHook(t,n),r.poolingFunction(Bo(t),r.poolSize,r.strides,r.padding,r.dataFormat)}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),fc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),sc(t,e,n,r,i,"max")},e.className="MaxPooling3D",e}(dc);e.serialization.registerClass(fc);var gc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),sc(t,e,n,r,i,"avg")},e.className="AveragePooling3D",e}(dc);e.serialization.registerClass(gc);var mc=function(t){function e(e){var n=t.call(this,e)||this;return n.inputSpec=[new Vo({ndim:3})],n}return $a(e,t),e.prototype.computeOutputShape=function(t){return[t[0],t[2]]},e.prototype.call=function(t,e){throw new Ha},e}(Zo),yc=function(t){function n(e){return t.call(this,e||{})||this}return $a(n,t),n.prototype.call=function(t,n){return e.tidy((function(){var n=Bo(t);return e.mean(n,1)}))},n.className="GlobalAveragePooling1D",n}(mc);e.serialization.registerClass(yc);var vc=function(t){function n(e){return t.call(this,e||{})||this}return $a(n,t),n.prototype.call=function(t,n){return e.tidy((function(){var n=Bo(t);return e.max(n,1)}))},n.className="GlobalMaxPooling1D",n}(mc);e.serialization.registerClass(vc);var bc=function(t){function e(e){var n=t.call(this,e)||this;return n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),n.inputSpec=[new Vo({ndim:4})],n}return $a(e,t),e.prototype.computeOutputShape=function(t){return t=t,"channelsLast"===this.dataFormat?[t[0],t[3]]:[t[0],t[1]]},e.prototype.call=function(t,e){throw new Ha},e.prototype.getConfig=function(){var e={dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},e}(Zo),wc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);return"channelsLast"===r.dataFormat?e.mean(n,[1,2]):e.mean(n,[2,3])}))},n.className="GlobalAveragePooling2D",n}(bc);e.serialization.registerClass(wc);var kc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);return"channelsLast"===r.dataFormat?e.max(n,[1,2]):e.max(n,[2,3])}))},n.className="GlobalMaxPooling2D",n}(bc);e.serialization.registerClass(kc);var Sc=function(t){function e(e){var n=t.call(this,e)||this;return n.layer=e.layer,n}return $a(e,t),e.prototype.build=function(t){this.built=!0},Object.defineProperty(e.prototype,"trainable",{get:function(){return null!=this.layer&&this.layer.trainable},set:function(t){null!=this.layer&&(this.layer.trainable=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trainableWeights",{get:function(){return this.layer.trainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nonTrainableWeights",{get:function(){return this.layer.nonTrainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updates",{get:function(){return this.layer._updates},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"losses",{get:function(){return this.layer.losses},enumerable:!0,configurable:!0}),e.prototype.getWeights=function(){return this.layer.getWeights()},e.prototype.setWeights=function(t){this.layer.setWeights(t)},e.prototype.getConfig=function(){var e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},e.prototype.setFastWeightInitDuringBuild=function(e){t.prototype.setFastWeightInitDuringBuild.call(this,e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)},e.fromConfig=function(t,e,n){void 0===n&&(n={});var r=cu(e.layer,n);delete e.layer;var i={layer:r};return Object.assign(i,e),new t(i)},e}(Zo),xc=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n}return $a(n,t),n.prototype.build=function(e){if((e=$o(e)).length<3)throw new Ga("TimeDistributed layer expects an input shape >= 3D, but received input shape "+JSON.stringify(e));this.inputSpec=[{shape:e}];var n=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),t.prototype.build.call(this,e)},n.prototype.computeOutputShape=function(t){var e=[(t=$o(t))[0]].concat(t.slice(2)),n=this.layer.computeOutputShape(e),r=t[1];return[n[0],r].concat(n.slice(1))},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return vh((function(t,e){return[Bo(r.layer.call(t,n)),[]]}),t=Bo(t),[],!1,null,null,!1,!0)[1]}))},n.className="TimeDistributed",n}(Sc);e.serialization.registerClass(xc);var Ic=function(t){function n(e){var n=t.call(this,e)||this,r=e.layer.getConfig(),i={};i.className=e.layer.getClassName(),i.config=r,n.forwardLayer=cu(i),r.goBackwards=!0!==r.goBackwards;var a,s={};if(s.className=e.layer.getClassName(),s.config=r,n.backwardLayer=cu(s),n.forwardLayer.name="forward_"+n.forwardLayer.name,n.backwardLayer.name="backward_"+n.backwardLayer.name,n.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,a=n.mergeMode,hs(Ts,"BidirectionalMergeMode",a),e.weights)throw new Ha("weights support is not implemented for Bidirectional layer yet.");return n._stateful=e.layer.stateful,n.returnSequences=e.layer.returnSequences,n.returnState=e.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=e.layer.inputSpec,n.numConstants=null,n}return $a(n,t),Object.defineProperty(n.prototype,"trainable",{get:function(){return this._trainable},set:function(t){this._trainable=t,null!=this.forwardLayer&&(this.forwardLayer.trainable=t),null!=this.backwardLayer&&(this.backwardLayer.trainable=t)},enumerable:!0,configurable:!0}),n.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},n.prototype.setWeights=function(t){var e=t.length,n=Math.floor(e/2);this.forwardLayer.setWeights(t.slice(0,n)),this.backwardLayer.setWeights(t.slice(n))},n.prototype.computeOutputShape=function(t){var e,n,r,i=this.forwardLayer.computeOutputShape(t);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),e=i[0]):e=i[0],e=e,"concat"===this.mergeMode?(e[e.length-1]*=2,n=[e]):n=null==this.mergeMode?[e,e.slice()]:[e],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[e].concat(r).concat(r.slice()):Qa(n)},n.prototype.apply=function(e,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=yh(e,r,i,this.numConstants);if(e=a.inputs,r=a.initialState,i=a.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==i)return t.prototype.apply.call(this,e,n);var s=[],o=[];if(null!=r){var u=r.length;if(u%2>0)throw new Ga("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,s.push.apply(s,r);var l=r.map((function(t){return new Vo({shape:t.shape})}));this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),o.push.apply(o,l)}if(null!=i)throw new Ha("Support for constants in Bidirectional layers is not implemented yet.");for(var h=s[0]instanceof qo,c=0,p=s;ce}var $c=function(t){function e(e){var n=t.call(this)||this;if(null==e&&(e={}),e.restoreBestWeights)throw new Ha("restoreBestWeights = True is not implemented in EarlyStopping yet.");return n.monitor=e.monitor||"val_loss",n.minDelta=Math.abs(e.minDelta||0),n.patience=e.patience||0,n.verbose=e.verbose||0,n.mode=e.mode||"auto",n.baseline=e.baseline,-1===["auto","min","max"].indexOf(n.mode)&&(console.warn("EarlyStopping mode '"+n.mode+"' is invalid. Falling back to mode 'auto'."),n.mode="auto"),"min"===n.mode?n.monitorFunc=Oc:"max"===n.mode||-1!==n.monitor.indexOf("acc")?n.monitorFunc=Bc:n.monitorFunc=Oc,n.monitorFunc===Oc&&(n.minDelta*=-1),n}return $a(e,t),e.prototype.onTrainBegin=function(t){return Ua(this,void 0,void 0,(function(){return Ka(this,(function(t){return this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Oc?1/0:-1/0,[2]}))}))},e.prototype.onEpochEnd=function(t,e){return Ua(this,void 0,void 0,(function(){var n;return Ka(this,(function(r){switch(r.label){case 0:return[4,eu(e)];case 1:return r.sent(),null==(n=this.getMonitorValue(e))?[2]:(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=t,this.model.stopTraining=!0)),[2])}}))}))},e.prototype.onTrainEnd=function(t){return Ua(this,void 0,void 0,(function(){return Ka(this,(function(t){return this.stoppedEpoch>0&&this.verbose&&console.log("Epoch "+this.stoppedEpoch+": early stopping."),[2]}))}))},e.prototype.getMonitorValue=function(t){null==t&&(t={});var e=t[this.monitor];return null==e&&console.warn("Metric for EarlyStopping "+this.monitor+" is not available. Available metrics are: "+Object.keys(t)),e},e}(Mc);var Pc={earlyStopping:function(t){return new $c(t)}};t.Callback=Mc,t.CallbackList=iu,t.CustomCallback=ou,t.EarlyStopping=$c,t.History=su,t.InputSpec=Vo,t.LayerVariable=Uo,t.LayersModel=vl,t.RNN=bh,t.Sequential=kl,t.SymbolicTensor=qo,t.callbacks=Pc,t.constraints=Ns,t.initializers=Eo,t.input=Sl,t.layers=Fc,t.loadLayersModel=function(t,n){return null==n&&(n={}),function(t,n){return Ua(this,void 0,void 0,(function(){var r;return Ka(this,(function(i){if(null==n&&(n={}),"string"==typeof t){if(0===(r=e.io.getLoadHandlers(t,n)).length)r.push(e.io.browserHTTPRequest(t,n));else if(r.length>1)throw new Ga("Found more than one ("+r.length+") load handlers for URL '"+t+"'");t=r[0]}return[2,wl(t,void 0,n)]}))}))}(t,n)},t.metrics=Lc,t.model=function(t){return new vl(t)},t.models=_c,t.registerCallbackConstructor=function(t,e){lu.registerCallbackConstructor(t,e)},t.regularizers=Rc,t.sequential=function(t){return new kl(t)},t.version_layers=Ku,Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=tf-layers.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js.map deleted file mode 100644 index aeed14506..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/miniprogram/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.min.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/base_callbacks.ts","../src/logs.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/optimizers.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["notYetImplemented","kernelName","Error","assert","expr","msg","flatten","arr","result","skipTypedArray","Array","isArray","isTypedArray","i","length","push","sizeFromShape","shape","size","arraysEqual","n1","n2","isInt","a","rightPad","repeat","parseAxisParam","axis","rank","map","s","concat","every","ax","Float32Array","Int32Array","Uint8Array","bytesPerElement","dtype","isString","value","String","inferDtype","values","isBoolean","isFunction","f","constructor","call","apply","computeStrides","strides","createNestedArray","offset","isComplex","ret","d","rest","slice","len","reduce","acc","c","toNestedArray","makeOnesTypedArray","array","makeZerosTypedArray","isPromise","object","then","TENSORFLOWJS_FLAGS_PREFIX","Environment","[object Object]","global","this","flags","flagRegistry","urlFlags","getQueryParams","populateURLFlags","platformName","platform","console","warn","flagName","evaluationFn","setHook","flagValue","set","evaluateFlag","get","features","Object","assign","location","search","urlParams","split","forEach","keyValue","key","toLowerCase","parseValue","queryString","params","replace","t","name","decodeURIComponent","decodeParam","join","env","ENV","globalNameSpace","getGlobalNamespace","ns","window","process","self","getGlobal","init","globalMap","_tfGlobals","Map","getGlobalMap","has","singleton","Acos","Acosh","Add","ArgMax","ArgMin","Asin","Asinh","Atan","Atanh","Atan2","AvgPool","BatchMatMul","BatchToSpaceND","Cast","Ceil","ClipByValue","ComplexAbs","Concat","Conv2D","Conv2DBackpropInput","Cosh","Cumsum","DepthwiseConv2dNative","Dilation2D","RealDiv","ExpandDims","Expm1","Floor","FloorDiv","FusedBatchNorm","GatherV2","GreaterEqual","Identity","IsFinite","IsInf","IsNan","LeakyRelu","Log1p","Maximum","MaxPool","Mean","Minimum","MirrorPad","Multiply","OnesLike","OneHot","Pack","PadV2","Prelu","Reciprocal","Relu","Reshape","ResizeNearestNeighbor","ResizeBilinear","Relu6","Reverse","Round","Rsqrt","Select","Selu","Slice","Sinh","Sign","Sigmoid","Softplus","Sqrt","SpaceToBatchND","SplitV","Softmax","SquaredDifference","Tanh","Tile","Transpose","Unpack","UnsortedSegmentSum","ZerosLike","Step","kernelRegistry","gradRegistry","getKernel","backendName","makeKey","getGradient","getKernelsForBackend","it","entries","done","next","config","backend","registerGradient","getBool","toTypedArray","base.flatten","vals","num","isNaN","isFinite","base.checkConversionForErrors","noConversionNeeded","bool","Math","round","now","decodeString","bytes","encoding","decode","Profiler","backendTimer","logger","Logger","inputs","outputs","holdResultWrapperFn","timer","start","util.now","timerAvailable","time","output","dataSync","Promise","resolve","kernelMs","data","tensorVals","checkComputationForErrors","timeMs","timing","extraInfo","getExtraProfileInfo","kernelProfile","all","valueContainer","logKernelProfile","util.rightPad","paddedName","toString","inputShapesDescription","input","inputShape","inputRank","log","tensorToString","verbose","padPerCol","n","numCols","fill","valuesOrTuples","createComplexTuples","row","j","max","valToString","computeMaxSizePerColumn","valsLines","subTensorToString","lines","l","val","pad","valStr","parseFloat","toFixed","boolNumToString","v","isLast","storagePerElement","firstValsSize","firstVals","from","lastVals","x","subshape","substrides","stride","end","sep","newLineSep","complexTuples","trackerFn","opHandler","Tensor","dataId","id","kept","isDisposedInternal","util.sizeFromShape","rankType","buffer","throwIfDisposed","read","b","util.decodeString","_a","readSync","isDisposed","disposeTensor","print","clone","cast","trainable","makeVariable","getGlobalTensorClass","defineProperty","Symbol","hasInstance","instance","Variable","initialValue","tensorId","super","newValue","util.arraysEqual","incRef","disposeVariable","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","UpcastComplex64AndMap","Function","upcastTypeMap","float32","int32","complex64","makeTypesMatch","typeA","typeB","upcastType","getTensorsInContainer","list","walkTensorContainer","Set","container","seen","obj","iterable","k","add","isRegisteredKernelInvocation","kernelInvocation","EngineState","registeredVariables","nextTapeNodeId","numBytes","numTensors","numStringTensors","numDataBuffers","gradientDepth","kernelDepth","scopeStack","numDataMovesStack","nextScopeId","tensorInfo","WeakMap","profiling","activeProfile","newBytes","newTensors","peakBytes","kernels","kernelNames","variableName","dispose","Engine","registry","registryFactory","pendingBackendInitId","state","pendingBackendInit","backendInstance","sortedBackends","getSortedBackends","initializeBackend","success","setBackend","asyncInit","initializeBackendsAndReturnBest","keys","factory","priority","setupRegisteredKernels","profiler","kernel","setupFunc","disposeFunc","registryFactoryEntry","force","refCount","floatPrecision","promiseId","catch","err","stack","message","disposeRegisteredKernels","sort","info","srcBackend","disposeData","move","shouldCheckForMemLeaks","nameOrFn","fn","scopedRun","startScope","endScope","error","res","ex","nextTensorId","nextVariableId","y","ENGINE","runKernel","addTapeNode","activeScope","dy","gradInputs","attrs","runKernelFunc","numDataIdsBefore","outInfos","numDataIdsAfter","numDataIds","numOutputDataIds","numMoves","dataIdsLeaked","kernelParams","saved","isTapeOn","startingBytecount","startingNumTensors","kernelFunc","out","kernelOrScopeName","util.assert","checkKernelForMemLeak","outTensors","outInfo","makeTensorFromDataId","tensorsToSave","getTensorsForGradient","saveTensorsForBackwardMode","forwardFunc","saveFunc","tensors","tensor","keep","tidy","outs","backwardsFunc","profileKernel","bytesAdded","totalBytesSnapshot","tensorsAdded","totalTensorsSnapshot","inputShapes","outputShapes","item","kernelTimeMs","gradConfig","inputsToSave","outputsToSave","inputTensorsToSave","saveAllInputs","inputName","outputTensorsToSave","filter","_","backendVals","util.isString","encode","util.encodeString","write","trackTensor","bytesFromStringArray","util.bytesPerElement","track","delete","removeDataId","varName","memory","unreliable","reasons","query","startBytes","startNumTensors","gradientsFunc","tapeNode","gradFunc","gradient","dys","util.makeZerosTypedArray","makeTensor","activeTape","scopeInfo","tensorsToTrackInParent","tensorsToTrackInParentSet","oldScope","pop","scopeId","xs","allowNoGradients","startTape","endTape","filteredTape","tape","tensorsFromX","nodesFromX","node","nodeInputs","anyInputFromX","tensorsLeadToY","nodesToY","prunedInputs","nodeInput","prunedNode","getFilteredNodesXToY","accumulatedGradientMap","ones","tensorAccumulatedGradientMap","o","gradTensor","inputGradients","dx","curGradient","backpropagateGradients","grads","util.isFunction","inputMap","save","gradRes","gradMap","grad","timingInfo","wallMs","reset","_tfengine","environment","getOrMakeEngine","inferShape","firstElem","deepAssertShapeConsistency","indices","subShape","assertDtype","expectedDtype","actualDType","argName","functionName","convertToTensor","parseAsDtype","inferredDtype","indexOf","type","inferredShape","convertToTensorArray","arg","op","opName","endsWith","substring","f2","args","configurable","abs","abs_","$x","acos","acos_","acosh","acosh_","add_","$a","$b","all_","keepDims","any","any_","argMax","argMax_","argMin","argMin_","asin","asin_","asinh","asinh_","atan","atan_","atan2","atan2_","atanh","atanh_","cast_","util.isValidDtype","computePool2DInfo","inShape","filterSize","dilations","roundingMode","dataFormat","filterHeight","filterWidth","parseTupleParam","filterShape","depthwise","batchSize","inHeight","inWidth","inChannels","filterChannels","strideHeight","strideWidth","dilationHeight","dilationWidth","effectiveFilterHeight","getEffectiveFilterSize","effectiveFilterWidth","padInfo","outHeight","outWidth","top","bottom","left","right","outShape","fieldSize","zeroPad","dilation","effectiveFieldSize","floor","computeDefaultPad","inputRows","inputCols","outputRows","outputCols","computeOutputShape2D","ceil","padAlongHeight","padAlongWidth","getPadAndOutInfo","outChannels","computeConv2DInfo","param","trunc","tupleValuesAreOne","dimA","dimB","dimC","eitherStridesOrDilationsAreOne","reshape","reshape_","avgPool","avgPool_","dimRoundingMode","conv_util.eitherStridesOrDilationsAreOne","x4D","reshapedTo4D","util.isInt","clone_","concat_","$tensors","attr","matMul","matMul_","transposeA","transposeB","mul","mul_","sigmoid","sigmoid_","slice_","begin","tanh","tanh_","batchToSpaceND","batchToSpaceND_","blockShape","crops","prod","batchNorm","batchNorm_","mean","variance","scale","varianceEpsilon","$mean","$variance","$scale","$offset","xAs4D","broadcastTo","broadcastTo_","xShape","some","newShape","unshift","reps","ceil_","clipByValue","clipByValue_","clipValueMin","clipValueMax","complex","complex_","real","imag","$real","$imag","shapeA","shapeB","errorMessagePrefix","util.assertShapesMatch","conv2d","conv2d_","$filter","inDepth","conv1d","conv1d_","x3D","reshapedTo3D","filter4D","input4D","conv2DBackpropInput","conv2DBackpropInput_","xShape4D","dy4D","outDepth","conv2dTranspose","conv2dTranspose_","outputShape","conv3DBackpropInput","conv3DBackpropInput_","xShape5D","dy5D","reshapedTo5D","cos","cos_","cosh","cosh_","cumsum","cumsum_","exclusive","reverse","depthToSpace","depthToSpace_","blockSize","inputHeight","inputWidth","inputDepth","depthwiseConv2d","depthwiseConv2d_","dilation2d","dilation2d_","floorDiv","floorDiv_","div","div_","getReductionAxes","inDim","outAxis","outDim","assertAndGetBroadcastShape","equal","equal_","where","where_","condition","$condition","broadcastShape","e","zerosLike","zerosLike_","divNoNan","divNoNan_","divResult","zeros","bEqualsZero","dot","dot_","t1","t2","$t1","$t2","t1Inner","t2Inner","t12D","t22D","t1t2","elu","elu_","erf","erf_","exp","exp_","expandDims","expandDims_","dim","expm1","expm1_","tile","tile_","floor_","gather","gather_","batchDims","greater","greater_","greaterEqual","greaterEqual_","imag_","isFinite_","isInf","isInf_","isNaN_","leakyRelu","leakyRelu_","alpha","less","less_","lessEqual","lessEqual_","localResponseNormalization","localResponseNormalization_","depthRadius","bias","beta","log_","log1p","log1p_","customGrad","neg","neg_","softplus","softplus_","logSigmoid","logSigmoid_","customOp","max_","reductionIndices","sub","sub_","sum","sum_","logSoftmax","logSoftmax_","logits","$logits","xMax","shifted","softmax","expandShapeToKeepDim","axes","outputLoc","reduceLoc","loc","outIdx","reduceIdx","combineLocations","getUndoAxesPermutation","logSumExp","logSumExp_","logicalAnd","logicalAnd_","logicalNot","logicalNot_","logicalOr","logicalOr_","logicalXor","logicalXor_","maxPool","maxPool_","maximum","maximum_","mean_","min","min_","minimum","minimum_","mirrorPad","mirrorPad_","paddings","mode","shapeOffset","mod","mod_","square","square_","notEqual","notEqual_","oneHot","oneHot_","depth","onValue","offValue","onesLike","onesLike_","pad_","constantValue","spaceToBatchND","spaceToBatchND_","pool","pool_","windowShape","poolingType","convInfo","conv_util.computePool2DInfo","basePadding","padExtraShape","padExtraStart","padExtraEnd","withSpaceToBatchBasePaddings","isDilationOne","adjustedPadding","adjustedCrops","padStart","origPadEnd","fullInputShape","padEndExtra","padEnd","requiredSpaceToBatchPaddings","convertedPad","convertedX","pow","pow_","base","$base","$exp","prelu","prelu_","prod_","real_","reciprocal","reciprocal_","relu","relu_","relu6","relu6_","reverse_","dims","round_","rsqrt","rsqrt_","dimSize","Number","isInteger","assertNonNegativeIntegerDimensions","providedSize","inferredSize","inferred","flatDimsDontMatch","scalar","selu","selu_","separableConv2d","separableConv2d_","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","sign","sign_","sin","sin_","sinh","sinh_","softmax_","fft","fft_","ifft","ifft_","irfft","irfft_","innerDimensionSize","batch","complexInput","realInput","imagInput","realConjugate","imagConjugate","r","temp","split_","numOrSizeSplits","rfft","rfft_","fftLength","adjustedInput","zerosShape","zerosInput","half","realValues","imagValues","realComplexConjugate","imagComplexConjugate","sqrt","sqrt_","squaredDifference","squaredDifference_","squeeze","squeeze_","keptDims","isEmptyArray","squeezeShape","stack_","step","step_","stridedSlice","stridedSlice_","beginMask","endMask","ellipsisMask","newAxisMask","shrinkAxisMask","tan","tan_","topk","topk_","sorted","lastDim","unique","unique_","unsortedSegmentSum","unsortedSegmentSum_","segmentIds","numSegments","$segmentIds","unstack","unstack_","transpose","transpose_","perm","normImpl","p","Infinity","norm","norm_","ord","keepDimsShape","axis_util.expandShapeToKeepDim","conv2DBackpropFilter","conv2DBackpropFilter_","depthwiseConv2dNativeBackpropFilter","depthwiseConv2dNativeBackpropFilter_","depthwiseConv2dNativeBackpropInput","depthwiseConv2dNativeBackpropInput_","resizeBilinear","resizeBilinear_","images","alignCorners","halfPixelCenters","$images","batchImages","resizeNearestNeighbor","resizeNearestNeighbor_","prototype","asScalar","asType","as1D","as2D","rows","columns","as3D","as4D","depth2","as5D","depth3","padding","dilationRate","reshapeAs","newShape2D","halfFloatCenters","tensorsToBeStacked","toBool","toFloat","toInt","absGradConfig","acosGradConfig","acoshGradConfig","addGradConfig","broadcast_util.assertAndGetBroadcastShape","reduceAxes","broadcast_util.getReductionAxes","addNGradConfig","ders","argMaxGradConfig","argMinGradConfig","asinGradConfig","asinhGradConfig","atan2GradConfig","atanGradConfig","atanhGradConfig","avgPool3dGrad","avgPool3dGrad_","$dy","$input","input5D","avgPool3DGradConfig","avgPoolGrad","avgPoolGrad_","avgPoolGradConfig","batchMatMulGradConfig","batchToSpaceNDGradConfig","broadcastToGradConfig","broadCastToAttrs","castGradConfig","ceilGradConfig","clipByValueGradConfig","complexAbsGradConfig","concatGradConfig","shapes","$axis","sizeSplits","conv2DGradConfig","conv_util.tupleValuesAreOne","conv2DBackpropInputGradConfig","ddx","conv3DBackpropFilter","conv3DBackpropFilter_","x5D","conv3DGradConfig","cosGradConfig","coshGradConfig","cumsumGradConfig","permutation","axesAreInnerMostDims","getAxesPermutation","depthwiseConv2dNativeGradConfig","$dilations","dilation2dGradConfig","inputInputs","filterInputs","eluGradConfig","erfGradConfig","PI","expGradConfig","expandDimsGradConfig","expm1GradConfig","floorGradConfig","floorDivGradConfig","tmp","fusedBatchNormGradConfig","scaleValue","reductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","gatherGradConfig","parsedAxis","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","stop","arrays","greaterEqualGradConfig","identityGradConfig","isFiniteGradConfig","isInfGradConfig","isNanGradConfig","leakyReluGradConfig","mask","log1pGradConfig","logGradConfig","logSoftmaxGradConfig","localResponseNormalizationBackprop","localResponseNormalizationBackprop_","lrnGradConfig","gradForMinAndMax","xOrig","origAxes","maxGradConfig","maxAttrs","maxGrad","util.parseAxisParam","maximumGradConfig","maxPool3dGrad","maxPool3dGrad_","$output","output5D","maxPool3DGradConfig","maxPoolGrad","maxPoolGrad_","padV2GradConfig","spaceToBatchNDGradConfig","splitVGradConfig","gradConfigs","reduceSize","aShape","computeOutAndReduceShapes","expandedDyShape","expandedDy","minAttrs","minGrad","expFloat","logBase","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","begin_","size_","xRank","parseSliceParams","dyTimesY","two","derX","xGrad","transposeAttrs","undoPerm","axis_util.getUndoAxesPermutation","unpackAttrs","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gatherDropNegatives","gradientConfig","_epsilon","epsilon","_super","setPrototypeOf","_this","AttributeError","tslib_1.__extends","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","pyListRepeat","numValues","newArray","count","refernce","counter","array_1","_i","singletonOrArray","toList","toSnakeCase","insecure","toCamelCase","identifier","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","dict","getClassName","getConfig","convertNDArrayScalarsInConfig","configItem","fields_1","field","deserializeKerasObject","moduleObjects","customObjects","printableModuleName","fastWeightInit","JSON","stringify","className","cls","fromConfig","_b","_c","customObjectsCombined","_d","_f","_e","backupCustomObjects","_h","_g","returnObj","_k","_j","reverseNumberCompare","numberCompare","xs_1","isObjectEmpty","hasOwnProperty","checkStringTypeUnionValue","label","checkArrayTypeAndLength","expectedType","minLength","maxLength","assertPositiveInteger","util","formatAsFriendlyString","mapActivationToFusedKernel","activationName","calcL2Norms","w","tfc.sqrt","tfc.sum","tfc.mul","Constraint","serialization","Serializable","maxValue","defaultMaxValue","defaultAxis","MaxNorm","norms","desired","tfc.clipByValue","tfc.div","tfc.add","registerClass","UnitNorm","NonNeg","tfc.relu","minValue","defaultMinValue","rate","defaultRate","MinMaxNorm","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","constraint","deserializeConstraint","SerializationMap","getMap","classNameMap","getConstraint","VALID_DATA_FORMAT_VALUES","VALID_INTERPOLATION_FORMAT_VALUES","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","VALID_BIDIRECTIONAL_MERGE_MODES","nameMap","checkDataFormat","checkPaddingMode","checkPoolMode","_nameScopeStack","nameScope","getScopedTensorName","tensorName","isValidTensorName","getUniqueTensorName","scopedName","index","tensorNameRegex","RegExp","match","arrayProd","toArray1D","tensor1d","tfc.min","tfc.max","range","splice","sliceAlongFirstAxis","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","sliceAlongLastAxis","sliceAlongAxis","concatenate","tfc.concat","concatAlongFirstAxis","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","randomNormal","stddev","seed","tfc.randomNormal","activation","ySecondLastDim","tfc.fused","reshapeBias","aFirstDims","aLastDim","bShape","bLastDim","yOtherDims","reference","tfc.gather","biasShape","biasAdd","dropout","level","noiseShape","tfc.dropout","inTrainPhase","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","Ones","undefined","Constant","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","RandomUniform","randomUniform","DEFAULT_MEAN","DEFAULT_STDDEV","RandomNormal","K.randomNormal","TruncatedNormal","truncatedNormal","gain","eye","distribution","checkDistribution","VarianceScaling","fans","fanIn","fanOut","receptiveFieldSize","shapeProd","computeFans","limit","GlorotUniform","GlorotNormal","HeNormal","HeUniform","LeCunNormal","LeCunUniform","DEFAULT_GAIN","Orthogonal","q","linalg","gramSchmidt","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","heUniform","identity","leCunNormal","leCunUniform","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","initializer","getInitializer","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","prefix","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","weights","weights_1","weight","DEFAULT_VARIABLE_NAME_PREFIX","originalName","trainable_","tfc.variable","LayerVariable","assertNotDisposed","newVal","checkShapesMatch","batchGetValue","batchSetValue","variablesAndValues","variableAndValue","ndim","maxNDim","minNDim","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","layer","outboundNodes","inboundNodes","Node","inboundNames","_nextLayerID","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","batchInputShape","inputDType","initialWeights","_refCount","fastWeightInitDuringBuild","Layer","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","built","trainableWeights","nonTrainableWeights","_stateful","stateful","generic_utils.toList","inputIndex","spec","xShapeAtAxis","specDim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","inputsList_1","SymbolicTensor","noneAreSymbolic","inputsList_2","assertInputCompatibility","xElem","build","setWeights","outputListCopy","outputList_1","inputTensors_1","collectInputShape","computeOutputShape","outputDType_1","warnOnIncompatibleInputShape","addInboundNode","dimMismatch_1","dimension","allOutputShapes","shapeString","variable_utils.countParamsInWeights","trainableOnly","weightValueTuples","paramValues","pv","regularizer","_addedWeightNames","initValue","addLoss","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","inputTensorList_1","tensorIndex","numDisposedVariables","disposeWeights","refCountAfterDispose","getSourceInputs","sourceTensors","previousSources_1","x_1","ModelLoggingVerbosity","sparse","inputTensor","InputLayer","Input","batchShape","resolveScalarsInLogs","logs","promises","scalarsToDispose","valueScalar","disposeTensorsInLogs","BaseCallback","epoch","model","callbacks","queueLength","CallbackList","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","totals","this_1","oldTotalsToDispose","total","this_2","History","history","valueArray","yieldEvery","waitMs","lastResult","lastTime","onYield","isNumber","maybeWait","bind","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","yield","CustomCallback","ps","nextFrame","currentEpoch","standardizeCallbacks","callbackConfig","CallbackConstructorRegistry","verbosityLevel","callbackConstructor","checkForDuplicate","constructors","levelName","ctor","configureCallbacks","epochs","initialEpoch","numTrainSamples","stepsPerEpoch","doValidation","callbackMetrics","actualCallbacks","createCallbacks","callbackList","samples","steps","metrics","deserialize","l2Normalize","squareSum","K.square","epsilonTensor","tfc.fill","tfc.maximum","meanSquaredError","yTrue","yPred","tfc.mean","tfc.sub","meanAbsoluteError","tfc.abs","meanAbsolutePercentageError","diff","clippedTrue","MAX_VALUE","absResult","categoricalCrossentropy","target","fromLogits","tfc.softmax","outputSum","tfc.neg","tfc.log","sparseCategoricalCrossentropy","flatTarget","tfc.floor","math_utils.arrayProd","tfc.oneHot","binaryCrossentropy","labels","reluLogits","negAbsLogits","sigmoidCrossEntropyWithLogits","cosineProximity","trueNormalized","predNormalized","trueXPred","lossesMap","meanSquaredLogarithmicError","clippedPred","firstLog","secondLog","squaredHinge","maxResult","hinge","categoricalHinge","pos","logcosh","log2","predictionDiff","logcoshResult","tfc.softplus","kullbackLeiblerDivergence","poisson","logPred","identifierOrFn","errMsg","includes","binaryAccuracy","threshold","tfc.onesLike","yPredThresholded","K.cast","tfc.greater","tfc.equal","categoricalAccuracy","tfc.argMax","truePositives","tfc.logicalAnd","precision","tp","fp","falsePositives","denominator","tfc.where","recall","falseNegatives","lossBinaryCrossentropy","sparseCategoricalAccuracy","categoricalCrossentropyLoss","sparseCategoricalCrossentropyLoss","metricsMap","mse","MSE","mae","MAE","mape","MAPE","cosine","getLossOrMetricName","fnName","MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH","checkUserDefinedMetadata","userDefinedMetadata","modelName","checkSize","getPrototypeOf","plainObjectCheck","keys_1","xType","printSummary","lineLength","positions","printFn","relevantNodes","sequentialLike","nodesByDepth","nodes","nodesByDepth_1","depthNodes","layers","flag","isModelSequentialLike","toDisplay","printRow","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","trainableCount","collectedTrainableWeights","countTrainableParams","nonTrainableCount","fields","line","countParams","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","isArrayItemInputOrOutputName","convertPythonicToTs","pythonicConfig","generic_utils.toCamelCase","tsArray","arrayLength","tsDict","pythonicKey","pythonicValue","tsKey","convertTsToPythonic","tsConfig","pyArray","pyDict","tsValue","pyKey","version","feeds","FeedDict","id2Value","id2Mask","feeds_1","feed","assertFeedCompatibility","name2Id","cachedSorted","cachedRecipientCounts","execute","fetches","feedDict","probe","arrayFetches","fetchArray","outputNames","finalOutputs","feedNames","names","outputNames_1","outputName","getValue","maxNumTensors","minNumTensors","recipientCounts","fetchAndFeedKey","finalSorted","finalRecipientMap","getTopologicalSortAndRecipientCountsForOneFetch","recipientMap","visited","fetches_1","sorted_1","symbolicTensor","name_1","recipient","recipientMap2Counts","getTopologicalSortAndRecipientCounts","internalFeedDict","symbolic","srcLayer","inputValues","tensorsToDispose","maskExists","getMask","hasKey","outputMask","computeMask","layerOutputs","getNodeOutputs","outputSymbolicTensors","i_1","disposeMasks","name_2","fetch","marks","top_1","topIsMarked","getOutputAt","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","internalContainerRefs","generic_utils.assert","inputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","finishedNodes","nodesInProgress","containerNodes","Container","nodeKey","numInboundLayers","layer_1","nodeIndex_1","tensorIndex_1","reversedNodesInDecreasingDepth_1","previousDepth","inboundNode","previousDepth_1","nodeID","layersByDepth","layerID","depthKeys","parseInt","generic_utils.reverseNumberCompare","depthKeys_1","layersForDepth","aIndex","bIndex","layersForDepth_1","computableTensors","layersWithCompleteInput","depthKeys_2","_l","_o","_m","_q","_p","_s","_r","allNames","numOccurrences","allNames_1","_t","strict","nameToWeight","totalWeightsCount","validatedName","tokens","unsetNames","name_3","theConfig","modelConfig","unused","returnString","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","inputShape_1","shapeKey","depthKeys_3","nodes_1","inputShapes_1","nodeIndex_2","inputShape_2","outputShapes_1","outputShapeKeys","tensorMap","depthKeys_4","nodes_2","referenceInputTensors","referenceOutputTensors","computedData","referenceInputTensors_1","computedTensors","computedMasks","outputTensors_1","outputMasks_1","computedTensor","computedMask","keptNodes","nodeConversionMap","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","addUnprocessedNode","processNode","nodeData_1","inputData","inboundLayerName","inboundNodeIndex","processLayer","layerData","layerName","deserializeLayer","setFastWeightInitDuringBuild","layersFromConfig","layersFromConfig_1","generic_utils.isObjectEmpty","layersFromConfig_2","currentUnprocessedNodesForLayer","currentUnprocessedNodesForLayer_1","inputLayersFromConfig_1","layerOutputTensors","outputLayersFromConfig_1","resetStates","standardizeClassWeights","classWeight","xWeight","weightType","numOutputs","output_1","standardizeSampleOrClassWeights","standardizeWeights","sampleWeight","sampleWeightMode","yClasses","yClassIndices","classSampleWeight_1","classIndex","computeWeightedLoss","sampleWeights","standardizeDataIteratorOutput","iteratorOut","ys","iteratorOutObj","tfc.util","flattenedXs","flattenTensorOrArrayOrMap","flattenedYs","xIndex","yIndex","inputOrOutput","tfc.Tensor","names_1","fitDataset","dataset","hasBatchesPerEpoch","batchesPerEpoch","optimizer","isTraining","validationData","valXs","valYs","isDatasetObject","validationBatches","standardizeTensorValidationData","trainFunction","makeTrainFunction","outLabels","getDedupedMetricsNames","getStepsPerEpoch","history_1","stopTraining_","iterator","dataIterator","epochLogs","stepsDone","batchIndex","batchLogs","standardClassWeights","ins","tfc.dispose","tfc.keep","valOuts","evaluateDataset","batches","evaluate","validationBatchSize","metricsNames","syncData","hasBatches","testFunction","numExamples","tfc.tidy","xsAndYs_1","batchOuts","batchSize_1","batchOut","oldScalar","checkBatchSize","sliceArrays","sliceArraysByIndices","makeBatches","batchStart","fitLoop","valF","valIns","shuffle","validationSteps","checkNumSamples","indexArray","epochIndexArray1D_1","batches_1","batchIds","insBatch","testLoop","fitTensors","standardizeUserData","standardizedOuts","targets","inputValX","inputValY","valStandardized","valX","valY","validationSplit","splitAt","originalBatchSize","valFunction","makeTestFunction","disposeNewTensors","ensureTensorsRank2OrHigher","refTensors","oldTensorIds","oldTensor","isDataArray","isDataDict","isDataTensor","standardizeInputData","checkBatchAxis","exceptionPrefix","gotUnexpectedData","refDim","checkInputData","LayersModel","loss","optimizer_","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","optimizers.getOptimizer","isOptimizerOwned","Optimizer","lossFunctions","theLosses","losses.get","lossFunction_1","name_4","feedOutputShapes","feedLossFns","name_5","skipTargetIndices","metricsTensors","weightedLoss","nestedMetrics","wrappedMetrics","outputMetrics","collectMetrics","metricName","accFn","weightedMetricFn","metric","losses.binaryCrossentropy","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","suffix","metricFn","Metrics.get","Metrics.getLossOrMetricName","metricResult","outputIndex","metricTensor","appendMetric","metrics_1","handleMetrics","standardizeUserDataXY","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","tensorValue","executeOutputs","symbolicTensorNames","outputsRemaining","layerOutputNames","remainingNames_1","outsBatches","xsRank2OrHigher","predictLoop","setX","setY","checkArrayLengths","lossFns","keyLosses","losses.meanSquaredError","losses.categoricalCrossentropy","slicedYShape","slicedShape","targetDim","checkLossAndTargetCompatibility","standardXs","standardYs","standardSampleWeights","classWeights","K.sliceAlongFirstAxis","dedupedOutLabels","newLabel","lossValues","metricsValues","variables","minimize","totalLoss","lossFunction","meanLoss","weightedMetric","regularizerLoss","valOutputs","meanMetric","standardizeOut","losses_1","namedWeights","weightValues","getWeights","numTensorsBeforeOptmizerDisposal","tfc.memory","lossNames","losses_2","outputNames_2","metricsIdentifiers","getLossIdentifiers","getMetricIdentifiers","optimizer_config","class_name","trainingConfig","weighted_metrics","loss_weights","sample_weight_mode","lossEntry","compile","handlerOrURL","handlers","io","getSaveHandlers","encodeWeights","getNamedWeights","weightDataAndSpecs","toJSON","modelArtifacts","modelTopology","format","generatedBy","convertedBy","includeOptimizer","getTrainingConfig","optimizerWeightData","optimizerWeightSpecs","specs","concatenateArrayBuffers","weightData","weightSpecs","Functional","loadLayersModelFromIOHandler","handler","options","load","artifacts","loadTrainingConfig","setUserDefinedMetadata","name2Tensor","decodeWeights","modelWeights","optimizerWeights","group","decodeModelAndOptimizerWeights","loadWeights","Sequential","modelLayer","isLayerModelInstance","checkShape","outputTensor","lastLayerIndex","summary","predict","predictOnBatch","fit","trainOnBatch","configArray","extraModelConfig","configArray_1","stopTraining","Activation","Elu","tfc.elu","K.elu","tfc.selu","tfc.minimum","Linear","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softsign","K.softsign","tfc.tanh","LogSoftmax","tfc.logSoftmax","Swish","Mish","serializeActivation","deserializeActivation","getActivation","assertObjectArgs","l1","l2","hasL1","hasL2","L1L2","regularization","Regularizer","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","ReLU","baseConfig","DEFAULT_ALPHA","LeakyReLU","alphaInitializer","DEFAULT_ALPHA_INITIALIZER","alphaRegularizer","alphaConstraint","sharedAxes","PReLU","paramShape","addWeight","InputSpec","ELU","theta","DEFAULT_THETA","ThresholdedReLU","softmaxActivation","DEFAULT_AXIS","normalizeArray","singleValue","convOutputLength","inputLength","outputLength","deconvLength","strideSize","kernelSize","preprocessConv2DInput","tfc.transpose","preprocessConv3DInput","conv2dWithBiasActivation","BaseConv","verifyArgs","generic_utils.assertPositiveInteger","useBias","biasInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","biasRegularizer","generic_utils.checkArrayTypeAndLength","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","biasValue","fusedActivationName","generic_utils.mapActivationToFusedKernel","tfc.conv1d","K.biasAdd","tfc.conv3d","conv3dWithBias","newSpace","space","newDim","Conv3D","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","tfc.conv2dTranspose","heightAxis","widthAxis","Conv3DTranspose","dAxis","kernelD","strideD","tfc.conv3dTranspose","depthAxis","SeparableConv2D","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","SeparableConv","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","Conv1D","cropping","Cropping2D","hSliced","K.sliceAlongAxis","DEFAULT_SIZE","interpolation","UpSampling2D","resized","DepthwiseConv2D","tfc.depthwiseConv2d","cols","outFilters","outRows","outCols","standardizeArgs","initialState","constants","numConstants","toListOrNull","rnn","stepFunction","initialStates","goBackwards","unroll","needPerStepOutputs","math_utils.range","tfc.expandDims","tfc.reverse","lastOutput","perStepMasks","perStepOutputs","states","timeSteps","perStepInputs","tfc.unstack","currentInput","stepOutputs","maskedOutputs","stepMask","negStepMask","newStates","tfc.stack","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","states_","keptStates","RNN","outputDim","stateShape","stateSize_1","stateMask","numStates","stepInputShape","tfc.zeros","expectedShape","standardized","additionalInputs","additionalSpecs","initialState_1","fullInput","fullInputSpec","originalInputSpec","getInitialState","cellCallKwargs","rnnOutputs","K.expandDims","K.tile","cellConfig","units","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","SimpleRNNCell","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","K.dot","RNNCell","SimpleRNN","resetAfter","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","GRUCell","hTMinus1","z","hh","matrixX","recurrentKernelValue","rk1","rk2","matrixInner","xZ","xR","xH","recurrentZ","recurrentR","recurrentH","GRU","unitForgetBias","LSTMCell","capturedBiasInit_1","capturedUnits_1","CustomInit","bI","bF","bCAndH","K.concatAlongFirstAxis","cTMinus1","z0","z1","z2","z3","LSTM","nestedStates","callInputs","newNestedStates","cellStates","cellConfigs","tuples","numParams","inputWeights","droppedInputs","K.dropout","createMask","K.inTrainPhase","ConvRNN2D","computeSingleOutputShape","getStates","isChannelsFirst","hOut","wOut","ConvLSTM2DCell","recurrentKernelShape","init_1","filters_1","K.concatenate","tfc.ones","applyDropout","xI","xF","xC","xO","recDropoutMask","hI","hF","hC","hO","kernelI","kernelF","kernelC","kernelO","biasI","biasF","biasC","biasO","inputConv","recKernelI","recKernelF","recKernelC","recKernelO","recurrentConv","tfc.conv2d","tslib_1.__assign","ConvLSTM2D","Dropout","invokeCallHook","noiseShape_1","getNoiseShape","SpatialDropout1D","Dense","inputLastDim","Flatten","K.batchFlatten","RepeatVector","targetShape","isUnknown","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","expectedSortedIndices","dimsIncludingBatch","Permute","maskValue","Masking","booleanMask","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","Embedding","embeddings","inLens","s1","s2","K.gather","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","inputs_1","xNDim","mergeFunction","transposed","inputs_2","xTransposed","mathUtils.arrayProd","mathUtils.range","yNDim","yShape","Average","Concatenate","allNoneShape","inputShape_3","shapeSet","shapeWithoutConcatAxis","exists","shapeSet_1","allNullMasks","concatenatedMasks","tfc.all","interpretAxis","normalize","Dot","interpretAxes","x1","x2","axesArray","diffShape","adjX","adjY","idx","squeezeAxes","batchDot","GaussianNoise","GaussianDropout","AlphaDropout","_getNoiseShape","alphaP","keptIdx","batchNormalization","gamma","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","normalizeBatchInTraining","meanAndVariance","tfc.moments","regularNormalizeBatchInTraining","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","broadcastNormalizeBatchInTraining","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","BatchNormalization","movingMean","movingVariance","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","doMovingAverage","variable","decay","origValue","updateDelta","LayerNormalization","nDims","broadcast","momentsTiling","scaleOffsetTiling","heightPadding","widthPadding","ZeroPadding2D","pattern","tfc.pad","pool2d","poolSize","poolMode","paddingString","tfc.maxPool","tfc.avgPool","pool3d","tfc.maxPool3d","tfc.avgPool3d","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","Pooling3D","depths","MaxPooling3D","AveragePooling3D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","timesteps","forwDict","forwardLayer","backDict","backwardLayer","mergeMode","generic_utils.checkStringTypeUnionValue","_trainable","Bidirectional","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","additionalInputs_1","yRev","forwardState","backwardState","rnnLayer","averagePooling1d","averagePooling2d","averagePooling3d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.sparseCategoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","metrics.precision","metrics.recall","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","modelAndWeightsConfig","weightsManifest","pathPrefix","uniqueWeightValues","Callback","currVal","prevVal","restoreBestWeights","monitor","minDelta","patience","baseline","monitorFunc","EarlyStopping","wait","stoppedEpoch","best","current","getMonitorValue","monitorValue","earlyStopping","pathOrIOHandler","getLoadHandlers","browserHTTPRequest","loadLayersModelInternal","registerCallbackConstructor"],"mappings":";;;;;;;;;;;;;;;;sQAmGA,SAASA,EAAkBC,GACvB,MAAM,IAAIC,MAAM,IAAID,6HCuCjB,SAASE,EAAOC,EAAMC,GACzB,IAAKD,EACD,MAAM,IAAIF,MAAqB,iBAARG,EAAmBA,EAAMA,KA4BjD,SAASC,EAAQC,EAAKC,EAAS,GAAIC,GAAiB,GAIvD,GAHc,MAAVD,IACAA,EAAS,IAETE,MAAMC,QAAQJ,IAAQK,EAAaL,KAASE,EAC5C,IAAK,IAA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AA8B,CAEvC,GAAwB,KADlBrkB,EAAWC,KAAGqkB,gBAAgBD,EAAiB9iB,IACxC9vE,OAKXuuE,EAAStuE,KAAKuuE,KAAGskB,mBAAmBF,EAAiB9iB,SAChD,GAAIvB,EAASvuE,OAAS,EAC3B,MAAM,IAAI+uC,GACN,wBAAwBw/B,EAASvuE,OAAjC,4BACQ4yF,OAEdA,EAAkBrkB,EAAS,GAE7B,SAAOqB,GAA6BgjB,OAAiB34C,EAAW61B,UCrBzDijB,CAAwBH,EAAiB9iB,kCArK5B1rD,GACpB,OAAO,IAAIyiD,GAAYziD,uDAmMrBukC,EACAC,GACFF,GAA4BsqC,4BACxBrqC,EAAgBC,4CAvIKn8C,GACzB,OAAO,IAAIikE,GAAWjkE"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map deleted file mode 100644 index 5ddca1e44..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"model_save_test.js","sourceRoot":"","sources":["../src/model_save_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAU,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,2CAA2C;AAC3C,OAAO,EAAC,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,qB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B,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;4BACzD,OAAO,EAAE,CAAC;4BACV,UAAU,EAAE,IAAI;4BAChB,sBAAsB,EAAE,IAAI;yBAC7B;qBACF;iBACF;gBACD,MAAM,EAAE,cAAc;aACvB;YACD,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC;QACH,MAAM,KAAK,GACP,MAAM,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAExD,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAW,CAAC;QACvC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,+DAA+D;IAC/D,uBAAuB;AACzB,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {io, linalg, randomNormal, Tensor, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport * as initializers from './initializers';\n// tslint:disable-next-line:max-line-length\nimport {describeMathCPUAndGPU, describeMathGPU, expectTensorsClose} from './utils/test_utils';\nimport {version} from './version';\n\ndescribeMathCPUAndGPU('LayersModel.save', () => {\n class IOHandlerForTest implements io.IOHandler {\n savedArtifacts: io.ModelArtifacts;\n\n async save(modelArtifacts: io.ModelArtifacts): Promise {\n this.savedArtifacts = modelArtifacts;\n return {modelArtifactsInfo: null};\n }\n }\n\n class EmptyIOHandler implements io.IOHandler {}\n\n it('Model artifacts contains meta-information: Sequential', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 3, inputShape: [5]}));\n const handler = new IOHandlerForTest();\n\n await model.save(handler);\n expect(handler.savedArtifacts.format).toEqual('layers-model');\n expect(handler.savedArtifacts.generatedBy)\n .toEqual(`TensorFlow.js tfjs-layers v${version}`);\n expect(handler.savedArtifacts.convertedBy).toEqual(null);\n });\n\n it('Model artifacts contains meta-information: Functional', async () => {\n const input = tfl.input({shape: [5]});\n const output =\n tfl.layers.dense({units: 3}).apply(input) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: input, outputs: output});\n const handler = new IOHandlerForTest();\n\n await model.save(handler);\n expect(handler.savedArtifacts.format).toEqual('layers-model');\n expect(handler.savedArtifacts.generatedBy)\n .toEqual(`TensorFlow.js tfjs-layers v${version}`);\n expect(handler.savedArtifacts.convertedBy).toEqual(null);\n });\n\n it('Saving all weights succeeds', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 3, inputShape: [5]}));\n const handler = new IOHandlerForTest();\n\n await model.save(handler);\n expect(handler.savedArtifacts.modelTopology)\n .toEqual(model.toJSON(null, false));\n expect(handler.savedArtifacts.weightSpecs.length).toEqual(2);\n expect(handler.savedArtifacts.weightSpecs[0].name.indexOf('/kernel'))\n .toBeGreaterThan(0);\n expect(handler.savedArtifacts.weightSpecs[0].shape).toEqual([5, 3]);\n expect(handler.savedArtifacts.weightSpecs[0].dtype).toEqual('float32');\n expect(handler.savedArtifacts.weightSpecs[1].name.indexOf('/bias'))\n .toBeGreaterThan(0);\n expect(handler.savedArtifacts.weightSpecs[1].shape).toEqual([3]);\n expect(handler.savedArtifacts.weightSpecs[1].dtype).toEqual('float32');\n });\n\n it('Saving only trainable weights succeeds', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 3, inputShape: [5], trainable: false}));\n model.add(tfl.layers.dense({units: 2}));\n const handler = new IOHandlerForTest();\n\n await model.save(handler, {trainableOnly: true});\n expect(handler.savedArtifacts.modelTopology)\n .toEqual(model.toJSON(null, false));\n // Verify that only the trainable weights (i.e., weights from the\n // 2nd, trainable Dense layer) are saved.\n expect(handler.savedArtifacts.weightSpecs.length).toEqual(2);\n expect(handler.savedArtifacts.weightSpecs[0].name.indexOf('/kernel'))\n .toBeGreaterThan(0);\n expect(handler.savedArtifacts.weightSpecs[0].shape).toEqual([3, 2]);\n expect(handler.savedArtifacts.weightSpecs[0].dtype).toEqual('float32');\n expect(handler.savedArtifacts.weightSpecs[1].name.indexOf('/bias'))\n .toBeGreaterThan(0);\n expect(handler.savedArtifacts.weightSpecs[1].shape).toEqual([2]);\n expect(handler.savedArtifacts.weightSpecs[1].dtype).toEqual('float32');\n });\n\n it('Saving to a handler without save method fails', async done => {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({units: 3, inputShape: [5]}));\n const handler = new EmptyIOHandler();\n model.save(handler)\n .then(saveResult => {\n fail(\n 'Saving with an IOHandler without `save` succeeded ' +\n 'unexpectedly.');\n })\n .catch(err => {\n expect(err.message)\n .toEqual(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n done();\n });\n });\n});\n\ndescribeMathGPU('Save-load round trips', () => {\n it('Sequential model, Local storage', async () => {\n const model1 = tfl.sequential();\n model1.add(\n tfl.layers.dense({units: 2, inputShape: [2], activation: 'relu'}));\n model1.add(tfl.layers.dense({units: 1, useBias: false}));\n\n // Use a randomly generated model path to prevent collision.\n const path = `testModel${new Date().getTime()}_${Math.random()}`;\n\n // First save the model to local storage.\n const modelURL = `localstorage://${path}`;\n await model1.save(modelURL);\n // Once the saving succeeds, load the model back.\n const model2 = await tfl.loadLayersModel(modelURL);\n // Verify that the topology of the model is correct.\n expect(model2.toJSON(null, false)).toEqual(model1.toJSON(null, false));\n\n // Check the equality of the two models' weights.\n const weights1 = model1.getWeights();\n const weights2 = model2.getWeights();\n expect(weights2.length).toEqual(weights1.length);\n for (let i = 0; i < weights1.length; ++i) {\n expectTensorsClose(weights1[i], weights2[i]);\n }\n });\n\n it('Functional model, IndexedDB', async () => {\n const input = tfl.input({shape: [2, 2]});\n const layer1 = tfl.layers.flatten().apply(input);\n const layer2 =\n tfl.layers.dense({units: 2}).apply(layer1) as tfl.SymbolicTensor;\n const model1 = tfl.model({inputs: input, outputs: layer2});\n // Use a randomly generated model path to prevent collision.\n const path = `testModel${new Date().getTime()}_${Math.random()}`;\n\n // First save the model to local storage.\n const modelURL = `indexeddb://${path}`;\n await model1.save(modelURL);\n // Once the saving succeeds, load the model back.\n const model2 = await tfl.loadLayersModel(modelURL);\n // Verify that the topology of the model is correct.\n expect(model2.toJSON(null, false)).toEqual(model1.toJSON(null, false));\n\n // Check the equality of the two models' weights.\n const weights1 = model1.getWeights();\n const weights2 = model2.getWeights();\n expect(weights2.length).toEqual(weights1.length);\n for (let i = 0; i < weights1.length; ++i) {\n expectTensorsClose(weights1[i], weights2[i]);\n }\n });\n\n it('Call predict() and fit() after load: conv2d model', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.conv2d({\n filters: 8,\n kernelSize: 4,\n inputShape: [28, 28, 1],\n padding: 'same',\n activation: 'relu'\n }));\n model.add(tfl.layers.maxPooling2d({\n poolSize: 2,\n padding: 'same',\n }));\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense({units: 1}));\n\n const x = randomNormal([1, 28, 28, 1]);\n const y = model.predict(x) as Tensor;\n\n const path = `testModel${new Date().getTime()}_${Math.random()}`;\n const url = `indexeddb://${path}`;\n await model.save(url);\n // Load the model back.\n const modelPrime = await tfl.loadLayersModel(url);\n // Call predict() on the loaded model and assert the result\n // equals the original predict() result.\n const yPrime = modelPrime.predict(x) as Tensor;\n expectTensorsClose(y, yPrime);\n\n // Call compile and fit() on the loaded model.\n modelPrime.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const trainExamples = 10;\n await modelPrime.fit(\n randomNormal([trainExamples, 28, 28, 1]),\n randomNormal([trainExamples, 1]), {epochs: 4});\n });\n\n it('Call predict() and fit() after load: conv1d model', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.conv1d({\n filters: 8,\n kernelSize: 4,\n inputShape: [100, 1],\n padding: 'same',\n activation: 'relu'\n }));\n model.add(tfl.layers.maxPooling1d({\n poolSize: 2,\n padding: 'same',\n }));\n model.add(tfl.layers.flatten());\n model.add(tfl.layers.dense({units: 1}));\n\n const x = randomNormal([1, 100, 1]);\n const y = model.predict(x) as Tensor;\n\n const path = `testModel${new Date().getTime()}_${Math.random()}`;\n const url = `indexeddb://${path}`;\n await model.save(url);\n // Load the model back.\n const modelPrime = await tfl.loadLayersModel(url);\n // Call predict() on the loaded model and assert the\n // result equals the original predict() result.\n const yPrime = modelPrime.predict(x) as Tensor;\n expectTensorsClose(y, yPrime);\n\n // Call compile and fit() on the loaded model.\n modelPrime.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const trainExamples = 10;\n await modelPrime.fit(\n randomNormal([trainExamples, 100, 1]), randomNormal([trainExamples, 1]),\n {epochs: 4});\n });\n\n it('Call predict() and fit() after load: Bidirectional LSTM', async () => {\n const model = tfl.sequential();\n const lstmUnits = 3;\n const sequenceLength = 4;\n const inputDims = 5;\n model.add(tfl.layers.bidirectional({\n layer: tfl.layers.lstm({units: lstmUnits}) as tfl.RNN,\n mergeMode: 'concat',\n inputShape: [sequenceLength, inputDims]\n }));\n\n const x = randomNormal([2, 4, 5]);\n const y = model.predict(x) as Tensor;\n\n const path = `testModel${new Date().getTime()}_${Math.random()}`;\n const url = `indexeddb://${path}`;\n await model.save(url);\n const modelPrime = await tfl.loadLayersModel(url);\n const yPrime = modelPrime.predict(x) as Tensor;\n expectTensorsClose(y, yPrime);\n\n // Call compile and fit() on the loaded model.\n modelPrime.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const trainExamples = 2;\n await modelPrime.fit(\n randomNormal([trainExamples, sequenceLength, inputDims]),\n randomNormal([trainExamples, lstmUnits * 2]), {epochs: 2});\n });\n\n it('Load model: Fast init w/ weights: Sequential & LSTM', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units: 2,\n inputShape: [3, 4],\n recurrentInitializer: 'orthogonal',\n kernelInitializer: 'orthogonal',\n biasInitializer: 'randomNormal',\n }));\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n const getInitSpy = spyOn(initializers, 'getInitializer').and.callThrough();\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const modelPrime = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n for (let i = 0; i < weights.length; ++i) {\n expectTensorsClose(weightsPrime[i], weights[i]);\n }\n // Assert that orthogonal initializer hasn't been obtained during\n // the model loading.\n expect(getInitSpy).toHaveBeenCalledWith('zeros');\n expect(gramSchmidtSpy).not.toHaveBeenCalled();\n });\n\n it('Loading model: Fast init w/ weights: timeDistributed', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.timeDistributed({\n inputShape: [3, 4],\n layer: tfl.layers.dense(\n {units: 4, kernelInitializer: 'orthogonal', useBias: false})\n }));\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n const getInitSpy = spyOn(initializers, 'getInitializer').and.callThrough();\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const modelPrime = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n for (let i = 0; i < weights.length; ++i) {\n expectTensorsClose(weightsPrime[i], weights[i]);\n }\n // Assert that orthogonal initializer hasn't been obtained during\n // the model loading.\n expect(getInitSpy).toHaveBeenCalledWith('zeros');\n expect(gramSchmidtSpy).not.toHaveBeenCalled();\n });\n\n it('Loading model: Fast init w/ weights: bidirectional', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.bidirectional({\n inputShape: [3, 4],\n mergeMode: 'concat',\n layer: tfl.layers.lstm({\n units: 4,\n kernelInitializer: 'orthogonal',\n recurrentInitializer: 'orthogonal',\n biasInitializer: 'glorotNormal'\n }) as tfl.RNN\n }));\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n const getInitSpy = spyOn(initializers, 'getInitializer').and.callThrough();\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const modelPrime = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n for (let i = 0; i < weights.length; ++i) {\n expectTensorsClose(weightsPrime[i], weights[i]);\n }\n // Assert that orthogonal initializer hasn't been obtained during\n // the model loading.\n expect(getInitSpy).toHaveBeenCalledWith('zeros');\n expect(gramSchmidtSpy).not.toHaveBeenCalled();\n });\n\n it('Loading model: Fast init w/ weights: functional model', async () => {\n const input1 = tfl.input({shape: [3, 2]});\n const input2 = tfl.input({shape: [3, 2]});\n let y =\n tfl.layers.concatenate().apply([input1, input2]) as tfl.SymbolicTensor;\n y = tfl.layers\n .lstm({\n units: 4,\n kernelInitializer: 'orthogonal',\n recurrentInitializer: 'orthogonal',\n biasInitializer: 'glorotNormal'\n })\n .apply(y) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n const getInitSpy = spyOn(initializers, 'getInitializer').and.callThrough();\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const modelPrime = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n for (let i = 0; i < weights.length; ++i) {\n expectTensorsClose(weightsPrime[i], weights[i]);\n }\n // Assert that orthogonal initializer hasn't been obtained during\n // the model loading.\n expect(getInitSpy).toHaveBeenCalledWith('zeros');\n expect(gramSchmidtSpy).not.toHaveBeenCalled();\n });\n\n it('modelFromJSON calls correct weight initializers', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units: 2,\n inputShape: [3, 4],\n recurrentInitializer: 'orthogonal',\n kernelInitializer: 'orthogonal',\n biasInitializer: 'randomNormal',\n }));\n const modelJSON = model.toJSON(null, false);\n\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const modelPrime =\n await tfl.models.modelFromJSON({modelTopology: modelJSON});\n // Make sure modelPrime builds.\n modelPrime.predict(zeros([2, 3, 4]));\n // Assert the orthogonal initializer has been called.\n expect(gramSchmidtSpy).toHaveBeenCalled();\n });\n\n it('Partial non-strict load calls weight initializers', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units: 2,\n inputShape: [3, 4],\n recurrentInitializer: 'orthogonal',\n kernelInitializer: 'orthogonal',\n biasInitializer: 'randomNormal',\n }));\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n expect(savedArtifacts.weightSpecs.length).toEqual(3);\n savedArtifacts.weightSpecs = savedArtifacts.weightSpecs.slice(0, 1);\n\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const strict = false;\n const modelPrime =\n await tfl.loadLayersModel(io.fromMemory(savedArtifacts), {strict});\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n expectTensorsClose(weightsPrime[0], weights[0]);\n // Assert the orthogonal initializer has been called.\n expect(gramSchmidtSpy).toHaveBeenCalled();\n });\n\n it('loadLayersModel: non-strict load calls weight initializers', async () => {\n const model = tfl.sequential();\n model.add(tfl.layers.lstm({\n units: 2,\n inputShape: [3, 4],\n recurrentInitializer: 'orthogonal',\n kernelInitializer: 'orthogonal',\n biasInitializer: 'randomNormal',\n }));\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const weights = model.getWeights();\n\n expect(savedArtifacts.weightSpecs.length).toEqual(3);\n savedArtifacts.weightSpecs = savedArtifacts.weightSpecs.slice(0, 1);\n\n const gramSchmidtSpy = spyOn(linalg, 'gramSchmidt').and.callThrough();\n const strict = false;\n const modelPrime =\n await tfl.loadLayersModel(io.fromMemory(savedArtifacts), {strict});\n const weightsPrime = modelPrime.getWeights();\n expect(weightsPrime.length).toEqual(weights.length);\n expectTensorsClose(weightsPrime[0], weights[0]);\n // Assert the orthogonal initializer has been called.\n expect(gramSchmidtSpy).toHaveBeenCalled();\n });\n\n it('Load model artifact with ndarray-format scalar objects', async () => {\n // The following model config contains a scalar parameter serialized in the\n // ndarray-style format: `{\"type\": \"ndarray\", \"value\": 6}`.\n const modelJSON = JSON.stringify({\n 'class_name': 'Sequential',\n 'keras_version': '2.2.4',\n 'config': {\n 'layers': [\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'dtype': 'float32',\n 'activation': 'linear',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 2,\n 'batch_input_shape': [null, 3],\n 'use_bias': true,\n 'activity_regularizer': null\n }\n },\n {\n 'class_name': 'ReLU',\n 'config': {\n 'threshold': 0.0,\n 'max_value': {'type': 'ndarray', 'value': 6},\n 'trainable': true,\n 'name': 're_lu_1',\n 'negative_slope': 0.0\n }\n },\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_2',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'activation': 'linear',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 1,\n 'use_bias': true,\n 'activity_regularizer': null\n }\n }\n ],\n 'name': 'sequential_1'\n },\n 'backend': 'tensorflow'\n });\n const model =\n await tfl.models.modelFromJSON({modelTopology: JSON.parse(modelJSON)});\n expect(model.layers.length).toEqual(3);\n expect(model.layers[1].getConfig().maxValue).toEqual(6);\n\n const xs = randomNormal([5].concat(model.inputs[0].shape.slice(1)));\n const ys = model.predict(xs) as Tensor;\n expect(ys.shape).toEqual([5, 1]);\n });\n\n // TODO(cais): Test fast initialization of models consisting of\n // StackedRNN layers.\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-layers/dist/model_summary_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map deleted file mode 100644 index 8ea04ac41..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"model_summary_test.js","sourceRoot":"","sources":["../src/model_summary_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uEAAuE;AAEvE,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAEnD,SAAS,yBAAyB,CAAC,MAAM,GAAG,EAAE;IAC5C,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,eAAe,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAC1C,IAAI,iBAA2B,CAAC;IAEhC,UAAU,CAAC,GAAG,EAAE;QACd,iBAAiB,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAgB,EAAE,EAAE;YACtD,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,GAAG,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,SAAS,GAAG,yBAAyB,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC;YAC3B,M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,wEAAwE;YACxE,kBAAkB,EAAE,sBAAsB,EAAE,yBAAyB;YACrE,wEAAwE;SACzE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Unit tests for tf.LayersModel.summary() and tf.Sequential.summary().\n\nimport * as tfl from './index';\nimport {describeMathCPU} from './utils/test_utils';\n\nfunction getRandomLayerOrModelName(length = 12) {\n return 'L' + Math.random().toFixed(length - 1).slice(2);\n}\n\ndescribeMathCPU('LayersModel.summary', () => {\n let consoleLogHistory: string[];\n\n beforeEach(() => {\n consoleLogHistory = [];\n spyOn(console, 'log').and.callFake((message?: string) => {\n consoleLogHistory.push(message);\n });\n });\n\n afterEach(() => {\n consoleLogHistory = [];\n });\n\n it('Sequential model: one layer', () => {\n const layerName = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [tfl.layers.dense({units: 3, inputShape: [10], name: layerName})]\n });\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${layerName} (Dense) [null,3] 33 `,\n '=================================================================',\n 'Total params: 33', 'Trainable params: 33', 'Non-trainable params: 0',\n '_________________________________________________________________'\n ]);\n });\n\n it('Sequential model: one layer: custom lineLength', () => {\n const layerName = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [tfl.layers.dense({units: 3, inputShape: [10], name: layerName})]\n });\n const lineLength = 70;\n model.summary(lineLength);\n expect(consoleLogHistory).toEqual([\n '______________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '======================================================================',\n `${layerName} (Dense) [null,3] 33 `,\n '======================================================================',\n 'Total params: 33', 'Trainable params: 33', 'Non-trainable params: 0',\n '______________________________________________________________________'\n ]);\n });\n\n it('Sequential model: one layer: custom positions', () => {\n const layerName = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [tfl.layers.dense({units: 3, inputShape: [10], name: layerName})]\n });\n const lineLength = 70;\n const positions: number[] = [0.5, 0.8, 1.0];\n model.summary(lineLength, positions);\n expect(consoleLogHistory).toEqual([\n '______________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '======================================================================',\n `${layerName} (Dense) [null,3] 33 `,\n '======================================================================',\n 'Total params: 33', 'Trainable params: 33', 'Non-trainable params: 0',\n '______________________________________________________________________'\n ]);\n });\n\n it('Sequential model: one layer: custom printFn', () => {\n const layerName = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [tfl.layers.dense({units: 3, inputShape: [10], name: layerName})]\n });\n\n const messages: string[] = [];\n // tslint:disable-next-line:no-any\n function rerouteLog(message?: any, ...optionalParams: any[]) {\n messages.push(message);\n }\n\n model.summary(null, null, rerouteLog);\n expect(messages).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${layerName} (Dense) [null,3] 33 `,\n '=================================================================',\n 'Total params: 33', 'Trainable params: 33', 'Non-trainable params: 0',\n '_________________________________________________________________'\n ]);\n\n // console.log should have received no calls.\n expect(consoleLogHistory).toEqual([]);\n });\n\n it('Sequential model: three layers', () => {\n const lyrName01 = getRandomLayerOrModelName();\n const lyrName02 = getRandomLayerOrModelName();\n const lyrName03 = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [\n tfl.layers.flatten({inputShape: [2, 5], name: lyrName01}),\n tfl.layers.dense({units: 3, name: lyrName02}),\n tfl.layers.dense({units: 1, name: lyrName03}),\n ]\n });\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${lyrName01} (Flatten) [null,10] 0 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,3] 33 `,\n '_________________________________________________________________',\n `${lyrName03} (Dense) [null,1] 4 `,\n '=================================================================',\n 'Total params: 37',\n 'Trainable params: 37',\n 'Non-trainable params: 0',\n '_________________________________________________________________',\n ]);\n });\n\n it('Sequential model: with non-trainable layers', () => {\n const lyrName01 = getRandomLayerOrModelName();\n const lyrName02 = getRandomLayerOrModelName();\n const lyrName03 = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [\n tfl.layers.flatten({inputShape: [2, 5], name: lyrName01}),\n tfl.layers.dense({units: 3, name: lyrName02, trainable: false}),\n tfl.layers.dense({units: 1, name: lyrName03}),\n ]\n });\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${lyrName01} (Flatten) [null,10] 0 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,3] 33 `,\n '_________________________________________________________________',\n `${lyrName03} (Dense) [null,1] 4 `,\n '=================================================================',\n 'Total params: 37',\n 'Trainable params: 4',\n 'Non-trainable params: 33',\n '_________________________________________________________________',\n ]);\n consoleLogHistory = [];\n\n // Setting the entire model to non-trainable should be reflected\n // in the summary.\n model.trainable = false;\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${lyrName01} (Flatten) [null,10] 0 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,3] 33 `,\n '_________________________________________________________________',\n `${lyrName03} (Dense) [null,1] 4 `,\n '=================================================================',\n 'Total params: 37',\n 'Trainable params: 0',\n 'Non-trainable params: 37',\n '_________________________________________________________________',\n ]);\n consoleLogHistory = [];\n\n // Setting the model's trainable property should be reflected in the\n // new summary. But the initially untrainable layer should still stay\n // untrainable.\n model.trainable = true;\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${lyrName01} (Flatten) [null,10] 0 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,3] 33 `,\n '_________________________________________________________________',\n `${lyrName03} (Dense) [null,1] 4 `,\n '=================================================================',\n 'Total params: 37',\n 'Trainable params: 4',\n 'Non-trainable params: 33',\n '_________________________________________________________________',\n ]);\n consoleLogHistory = [];\n });\n\n it('Sequential model with Embedding layer', () => {\n const lyrName01 = getRandomLayerOrModelName();\n const lyrName02 = getRandomLayerOrModelName();\n const model = tfl.sequential({\n layers: [\n tfl.layers.embedding({\n inputDim: 10,\n outputDim: 8,\n inputShape: [null, 5],\n name: lyrName01\n }),\n tfl.layers.dense({units: 3, name: lyrName02}),\n ]\n });\n model.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${lyrName01} (Embedding) [null,null,5,8] 80 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,null,5,3] 27 `,\n '=================================================================',\n 'Total params: 107', 'Trainable params: 107', 'Non-trainable params: 0',\n '_________________________________________________________________'\n ]);\n });\n\n it('Sequential model: nested', () => {\n const mdlName01 = getRandomLayerOrModelName();\n const innerModel = tfl.sequential({\n layers: [tfl.layers.dense({units: 3, inputShape: [10]})],\n name: mdlName01\n });\n const outerModel = tfl.sequential();\n outerModel.add(innerModel);\n\n const lyrName02 = getRandomLayerOrModelName();\n outerModel.add(tfl.layers.dense({units: 1, name: lyrName02}));\n\n outerModel.summary();\n expect(consoleLogHistory).toEqual([\n '_________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '=================================================================',\n `${mdlName01} (Sequential) [null,3] 33 `,\n '_________________________________________________________________',\n `${lyrName02} (Dense) [null,1] 4 `,\n '=================================================================',\n 'Total params: 37',\n 'Trainable params: 37',\n 'Non-trainable params: 0',\n '_________________________________________________________________',\n ]);\n });\n\n it('Functional model', () => {\n const lyrName01 = getRandomLayerOrModelName();\n const input1 = tfl.input({shape: [3], name: lyrName01});\n const lyrName02 = getRandomLayerOrModelName();\n const input2 = tfl.input({shape: [4], name: lyrName02});\n const lyrName03 = getRandomLayerOrModelName();\n const input3 = tfl.input({shape: [5], name: lyrName03});\n const lyrName04 = getRandomLayerOrModelName();\n const concat1 =\n tfl.layers.concatenate({name: lyrName04}).apply([input1, input2]) as\n tfl.SymbolicTensor;\n const lyrName05 = getRandomLayerOrModelName();\n const output =\n tfl.layers.concatenate({name: lyrName05}).apply([concat1, input3]) as\n tfl.SymbolicTensor;\n const model =\n tfl.model({inputs: [input1, input2, input3], outputs: output});\n\n const lineLength = 70;\n const positions: number[] = [0.42, 0.64, 0.75, 1];\n model.summary(lineLength, positions);\n expect(consoleLogHistory).toEqual([\n '______________________________________________________________________',\n 'Layer (type) Output shape Param # Receives inputs ',\n '======================================================================',\n `${lyrName01} (InputLayer) [null,3] 0 `,\n '______________________________________________________________________',\n `${lyrName02} (InputLayer) [null,4] 0 `,\n '______________________________________________________________________',\n `${lyrName04} (Concatenate) [null,7] 0 ${lyrName01}[0][0]`,\n ` ${lyrName02}[0][0]`,\n '______________________________________________________________________',\n `${lyrName03} (InputLayer) [null,5] 0 `,\n '______________________________________________________________________',\n `${lyrName05} (Concatenate) [null,12] 0 ${lyrName04}[0][0]`,\n ` ${lyrName03}[0][0]`,\n '======================================================================',\n 'Total params: 0', 'Trainable params: 0', 'Non-trainable params: 0',\n '______________________________________________________________________'\n ]);\n });\n\n it('LayersModel with multiple outputs', () => {\n const lyrName01 = getRandomLayerOrModelName();\n const input1 = tfl.input({shape: [3, 4], name: lyrName01});\n const lyrName02 = getRandomLayerOrModelName();\n const outputs =\n tfl.layers.simpleRNN({units: 2, returnState: true, name: lyrName02})\n .apply(input1) as tfl.SymbolicTensor[];\n const model = tfl.model({inputs: input1, outputs});\n const lineLength = 70;\n model.summary(lineLength);\n expect(consoleLogHistory).toEqual([\n '______________________________________________________________________',\n 'Layer (type) Output shape Param # ',\n '======================================================================',\n `${lyrName01} (InputLayer) [null,3,4] 0 `,\n '______________________________________________________________________',\n `${lyrName02} (SimpleRNN) [[null,2],[null,2]] 14 `,\n '======================================================================',\n 'Total params: 14', 'Trainable params: 14', 'Non-trainable params: 0',\n '______________________________________________________________________'\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-layers/dist/models.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts deleted file mode 100644 index 6a32907b5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts +++ /dev/null @@ -1,575 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { io, Optimizer, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; -import { History } from './base_callbacks'; -import { Dataset } from './engine/dataset_stub'; -import { Layer } from './engine/topology'; -import { LayersModel, ModelCompileArgs, ModelEvaluateArgs } from './engine/training'; -import { ModelEvaluateDatasetArgs, ModelFitDatasetArgs } from './engine/training_dataset'; -import { ModelFitArgs } from './engine/training_tensors'; -import { Shape } from './keras_format/common'; -import { PyJsonDict } from './keras_format/types'; -import { Kwargs } from './types'; -/** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ -export declare function modelFromJSON(modelAndWeightsConfig: ModelAndWeightsConfig | PyJsonDict, customObjects?: serialization.ConfigDict): Promise; -/** - * Options for loading a saved mode in TensorFlow.js format. - */ -export interface ModelAndWeightsConfig { - /** - * A JSON object or JSON string containing the model config. - * - * This can be either of the following two formats: - * - A model archiecture-only config, i.e., a format consistent with the - * return value of`keras.Model.to_json()`. - * - A full model config, containing not only model architecture, but also - * training options and state, i.e., a format consistent with the return - * value of `keras.models.save_model()`. - */ - modelTopology: PyJsonDict; - /** - * A weights manifest in TensorFlow.js format. - */ - weightsManifest?: io.WeightsManifestConfig; - /** - * Path to prepend to the paths in `weightManifest` before fetching. - * - * The path may optionally end in a slash ('/'). - */ - pathPrefix?: string; -} -export interface ModelPredictArgs { - /** - * Optional. Batch size (Integer). If unspecified, it will default to 32. - */ - batchSize?: number; - /** - * Optional. Verbosity mode. Defaults to false. - */ - verbose?: boolean; -} -/** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ -export declare function loadLayersModelInternal(pathOrIOHandler: string | io.IOHandler, options?: io.LoadOptions): Promise; -/** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ -export declare function loadLayersModelFromIOHandler(handler: io.IOHandler, customObjects?: serialization.ConfigDict, options?: io.LoadOptions): Promise; -/** - * Configuration for a Sequential model. - */ -export interface SequentialArgs { - /** Stack of layers for the model. */ - layers?: Layer[]; - /** The name of this model. */ - name?: string; -} -/** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export declare class Sequential extends LayersModel { - /** @nocollapse */ - static className: string; - private model; - constructor(args?: SequentialArgs); - private checkShape; - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - add(layer: Layer): void; - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - pop(): void; - call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; - build(inputShape?: Shape | Shape[]): void; - countParams(): number; - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - setWeights(weights: Tensor[]): void; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x: Tensor | Tensor[], y: Tensor | Tensor[], args?: ModelEvaluateArgs): Scalar | Scalar[]; - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs): Promise; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x: Tensor | Tensor[], args?: ModelPredictArgs): Tensor | Tensor[]; - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - predictOnBatch(x: Tensor): Tensor | Tensor[]; - /** - * See `LayersModel.compile`. - * - * @param args - */ - compile(args: ModelCompileArgs): void; - optimizer: Optimizer; - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - fit(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, args?: ModelFitArgs): Promise; - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - fitDataset(dataset: Dataset, args: ModelFitDatasetArgs): Promise; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - trainOnBatch(x: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }, y: Tensor | Tensor[] | { - [inputName: string]: Tensor; - }): Promise; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: serialization.ConfigDict, fastWeightInit?: boolean): T; - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - stopTraining: boolean; - getConfig(): any; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js deleted file mode 100644 index 065a4a70c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js +++ /dev/null @@ -1,933 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source keras/models.py */ -import { dispose, io, serialization, util } from '@tensorflow/tfjs-core'; -import { getUid } from './backend/state'; -import { Input } from './engine/input_layer'; -import { getSourceInputs, Node } from './engine/topology'; -import { LayersModel } from './engine/training'; -import { NotImplementedError, RuntimeError, ValueError } from './errors'; -import { deserialize } from './layers/serialization'; -import * as generic_utils from './utils/generic_utils'; -import { convertPythonicToTs } from './utils/serialization_utils'; -import { getExactlyOneShape } from './utils/types_utils'; -/** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ -export async function modelFromJSON(modelAndWeightsConfig, customObjects) { - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = { modelTopology: modelAndWeightsConfig }; - } - modelAndWeightsConfig = modelAndWeightsConfig; - let modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config']; - } - const tsConfig = convertPythonicToTs(modelTopology); - const model = deserialize(tsConfig, customObjects); - if (modelAndWeightsConfig.weightsManifest != null) { - // Load the weight values keyed by the original tensor names in the model - // file that was loaded. These should match the keys of the weight - // manifest. - const weightValues = await io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(weight => weight.originalName)); - // Map the weights to the unique tensor names generated during model loading - const uniqueWeightValues = {}; - for (const weight of model.weights) { - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - dispose(weightValues); - } - return model; -} -/** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ -export async function loadLayersModelInternal(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - const handlers = io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(io.browserHTTPRequest(pathOrIOHandler, options)); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) load handlers for ` + - `URL '${pathOrIOHandler}'`); - } - pathOrIOHandler = handlers[0]; - } - return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options); -} -/** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ -export async function loadLayersModelFromIOHandler(handler, customObjects, options) { - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - const artifacts = await handler.load(); - let modelTopology = artifacts.modelTopology; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config']; - } - const strict = options.strict == null ? true : options.strict; - // If weights are provided and the weight-loading mode is strict, use - // fast weight initialization. This skips costly initializers such as - // 'orthogonal' and saves unnecessary computation in cases where - // the initialized weight values will immediately be overwritten by - // loaded weight values. - const fastWeightInit = artifacts.weightData != null && artifacts.weightSpecs != null && strict; - const model = deserialize(convertPythonicToTs(modelTopology), customObjects, fastWeightInit); - const trainingConfig = artifacts.trainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - // If weightData is present, load the weights into the model. - if (artifacts.weightData != null) { - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError('LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - const { modelWeights, optimizerWeights } = decodeModelAndOptimizerWeights(artifacts.weightData, artifacts.weightSpecs); - model.loadWeights(modelWeights, strict); - if (model.optimizer != null && optimizerWeights.length > 0) { - await model.optimizer.setWeights(optimizerWeights); - } - // Dispose temporary weight values. - dispose(modelWeights); - dispose(optimizerWeights.map(w => w.tensor)); - } - return model; -} -function decodeModelAndOptimizerWeights(buffer, specs) { - const name2Tensor = io.decodeWeights(buffer, specs); - const modelWeights = {}; - const optimizerWeights = []; - specs.forEach(spec => { - if (spec.group === 'optimizer') { - optimizerWeights.push({ name: spec.name, tensor: name2Tensor[spec.name] }); - } - else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return { modelWeights, optimizerWeights }; -} -/** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export class Sequential extends LayersModel { - constructor(args) { - super({ inputs: [], outputs: [] }); - args = args || {}; - this.trainable = true; - this.built = false; - // Set model name. - this.name = (args.name != null) ? args.name : getUid('sequential_'); - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (const layer of args.layers) { - this.add(layer); - } - } - } - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - checkShape(layer) { - const shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(x => x < 0)) { - throw new ValueError('Negative dimension size caused by adding layer ' + - `${layer.name} with input shape [` + - `${layer.inboundNodes[0].inputTensors[0].shape}]`); - } - } - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - add(layer) { - const isLayerModelInstance = layer instanceof Sequential || layer instanceof LayersModel; - let modelLayer; - if (isLayerModelInstance) { - modelLayer = layer; - if (modelLayer.outputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError('The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - const x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } - else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError('A layer added to a Sequential model must not already be ' + - `connected somewhere else. LayersModel received layer ${layer.name} ` + - `which has ${layer.inboundNodes.length} pre-existing inbound ` + - 'connections.'); - } - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: generic_utils.pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs[0].shape - }); - } - else { - const outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - this.layers.push(layer); - this.built = false; - } - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - pop() { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } - else { - const lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - } - call(inputs, kwargs) { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - } - build(inputShape) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError('Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - } - countParams() { - if (!this.built) { - this.build(); - } - return super.countParams(); - } - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - this.build(); - } - super.summary(lineLength, positions, printFn); - } - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - setWeights(weights) { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluateDataset(dataset, args); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - } - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - predictOnBatch(x) { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - } - /** - * See `LayersModel.compile`. - * - * @param args - */ - compile(args) { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = this.model.isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - } - get optimizer() { - return this.model == null ? undefined : this.model.optimizer; - } - set optimizer(optimizer) { - this.model.optimizer = optimizer; - } - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fit(x, y, args); - } - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async fitDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fitDataset(dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - return this.model.trainOnBatch(x, y); - } - /* See parent class for JsDoc */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - let configArray; - let extraModelConfig = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } - else { - util.assert(config['layers'] != null, () => `When the config data for a Sequential model is not an Array, ` + - `it must be an Object that contains the 'layers' field.`); - configArray = config['layers']; - delete config['layers']; - extraModelConfig = config; - } - const model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError(`Sequential.fromConfig called on non-Sequential input: ${model}`); - } - for (const conf of configArray) { - const customObjects = undefined; - const layer = deserialize(conf, customObjects, fastWeightInit); - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError('Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - } - get stopTraining() { - if (this.model == null) { - throw new ValueError('Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - } - // TODO(cais): Override get trainableWeights() here - // tslint:disable-next-line:no-any - getConfig() { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - const layers = []; - for (const layer of this.layers) { - const dict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return { name: this.name, layers }; - } -} -/** @nocollapse */ -Sequential.className = 'Sequential'; -serialization.registerClass(Sequential); -//# sourceMappingURL=models.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-layers/dist/models.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js.map deleted file mode 100644 index 24c8e2ce5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qCAAqC;AAErC,OAAO,EAAC,OAAO,EAAE,EAAE,EAAqC,aAAa,EAAU,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAElH,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAS,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAsC,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAIvE,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,aAAa,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,qBAAuD,EACvD,aAAwC;IAC1C,IAAI,CAAC,CAAC,eAAe,IAAI,qBAAqB,CAAC,EAAE;QAC/C,qBAAqB,GAAG,EAAC,aAAa,EAAE,qBAAqB,EAAC,CAAC;KAChE;IACD,qBAAqB,GAAG,qBAA8C,CAAC;IAEvE,IAAI,aAAa,GAAG,qBAAqB,CA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;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,IAAI,YAAY,CAAC,IAAa;QAC5B,0EAA0E;QAC1E,iCAAiC;QACjC,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;YACtB,MAAM,IAAI,UAAU,CAChB,oEAAoE;gBACpE,iBAAiB,CAAC,CAAC;SACxB;QACD,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,IAAI,YAAY;QACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;YACtB,MAAM,IAAI,UAAU,CAChB,oEAAoE;gBACpE,iBAAiB,CAAC,CAAC;SACxB;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;IACjC,CAAC;IAED,mDAAmD;IAEnD,kCAAkC;IAClC,SAAS;QACP,wEAAwE;QACxE,uEAAuE;QACvE,oEAAoE;QACpE,WAAW;QACX,MAAM,MAAM,GAA+B,EAAE,CAAC;QAC9C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,GAA6B,EAAE,CAAC;YAC1C,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACnB;QACD,OAAO,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IACnC,CAAC;;AAzsBD,kBAAkB;AACX,oBAAS,GAAG,YAAY,CAAC;AA0sBlC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map deleted file mode 100644 index a1d3a2f85..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"models_test.js","sourceRoot":"","sources":["../src/models_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAW,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAU,MAAM,EAAiB,GAAG,EAAU,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAG5K,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAE/B,O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AAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAa,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, env, io, memory, ones, randomNormal, Scalar, scalar, serialization, sum, Tensor, tensor1d, tensor2d, tensor3d, train, zeros} from '@tensorflow/tfjs-core';\n\nimport {LayersModel} from './engine/training';\nimport * as tfl from './index';\nimport {PyJsonDict} from './keras_format/types';\nimport {Reshape} from './layers/core';\nimport {deserialize} from './layers/serialization';\nimport {loadLayersModelInternal, ModelAndWeightsConfig, modelFromJSON} from './models';\nimport {convertPythonicToTs, convertTsToPythonic} from './utils/serialization_utils';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from './utils/test_utils';\nimport {version as layersVersion} from './version';\n\nconst OCTET_STREAM_TYPE = 'application/octet-stream';\nconst JSON_TYPE = 'application/json';\n\ndescribeMathCPU('Nested model topology', () => {\n it('Nested Sequential model: Sequential as first layer', done => {\n const modelLevel1 = tfl.sequential(\n {layers: [tfl.layers.dense({units: 2, inputShape: [3]})]});\n const x = ones([1, 3]);\n const y = modelLevel1.predict(x) as Tensor;\n\n const modelLevel2 = tfl.sequential();\n modelLevel2.add(modelLevel1);\n expectTensorsClose(modelLevel2.predict(x) as Tensor, y);\n\n const modelLevel3 = tfl.sequential();\n modelLevel3.add(modelLevel2);\n expectTensorsClose(modelLevel3.predict(x) as Tensor, y);\n\n const xs = ones([8, 3]);\n const ys = zeros([8, 2]);\n modelLevel3.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n modelLevel3.fit(xs, ys)\n .then(history => {\n const newY = modelLevel1.predict(x) as Tensor;\n expectTensorsClose(modelLevel2.predict(x) as Tensor, newY);\n expectTensorsClose(modelLevel3.predict(x) as Tensor, newY);\n done();\n })\n .catch(err => done.fail(err.stack));\n });\n\n it('Nested Sequential model: Functional model as first layer', done => {\n const input = tfl.input({shape: [3]});\n const output =\n tfl.layers.dense({units: 2}).apply(input) as tfl.SymbolicTensor;\n const modelLevel1 = tfl.model({inputs: input, outputs: output});\n const x = ones([1, 3]);\n const y = modelLevel1.predict(x) as Tensor;\n\n const modelLevel2 = tfl.sequential();\n modelLevel2.add(modelLevel1);\n expectTensorsClose(modelLevel2.predict(x) as Tensor, y);\n\n const modelLevel3 = tfl.sequential();\n modelLevel3.add(modelLevel2);\n expectTensorsClose(modelLevel3.predict(x) as Tensor, y);\n\n const xs = ones([8, 3]);\n const ys = zeros([8, 2]);\n modelLevel3.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n modelLevel3.fit(xs, ys)\n .then(history => {\n const newY = modelLevel1.predict(x) as Tensor;\n expectTensorsClose(modelLevel2.predict(x) as Tensor, newY);\n expectTensorsClose(modelLevel3.predict(x) as Tensor, newY);\n done();\n })\n .catch(err => done.fail(err.stack));\n });\n\n it('Nested Sequential model: Sequential as second layer', done => {\n const innerModel = tfl.sequential(\n {layers: [tfl.layers.dense({units: 2, inputShape: [4]})]});\n const x = ones([1, 4]);\n const y = innerModel.predict(x) as Tensor;\n\n const x2By2 = ones([1, 2, 2]);\n\n const outerModel = tfl.sequential(\n {layers: [tfl.layers.reshape({targetShape: [4], inputShape: [2, 2]})]});\n outerModel.add(innerModel);\n expectTensorsClose(outerModel.predict(x2By2) as Tensor, y);\n\n const xs = ones([8, 2, 2]);\n const ys = zeros([8, 2]);\n outerModel.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n outerModel.fit(xs, ys)\n .then(history => {\n const newY = innerModel.predict(x) as Tensor;\n expectTensorsClose(outerModel.predict(x2By2) as Tensor, newY);\n done();\n })\n .catch(err => done.fail(err.stack));\n });\n\n it('Nested Sequential model: Sequential as middle layer', done => {\n const innerModel = tfl.sequential(\n {layers: [tfl.layers.dense({units: 4, inputShape: [4]})]});\n const x = ones([1, 4]);\n const y = innerModel.predict(x) as Tensor;\n\n const x2By2 = ones([1, 2, 2]);\n\n const outerModel = tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [4], inputShape: [2, 2]}), innerModel,\n tfl.layers.reshape({targetShape: [2, 2]})\n ]\n });\n expectTensorsClose(\n outerModel.predict(x2By2) as Tensor, y.reshape([1, 2, 2]));\n\n const xs = ones([8, 2, 2]);\n const ys = zeros([8, 2, 2]);\n outerModel.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n outerModel.fit(xs, ys)\n .then(history => {\n const newY = innerModel.predict(x) as Tensor;\n expectTensorsClose(\n outerModel.predict(x2By2) as Tensor, newY.reshape([1, 2, 2]));\n done();\n })\n .catch(err => done.fail(err.stack));\n });\n\n it('getLayer() works for nested sequential model', () => {\n const innerModel = tfl.sequential({\n layers: [\n tfl.layers.dense({\n units: 4,\n inputShape: [4],\n activation: 'relu',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n }),\n tfl.layers.dense({\n units: 2,\n activation: 'tanh',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n })\n ]\n });\n const outerModel = tfl.sequential({\n layers: [\n innerModel,\n tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'ones'})\n ]\n });\n expect(outerModel.getLayer(null, 0) instanceof tfl.Sequential)\n .toEqual(true);\n // Expect all-one values based on the kernel and bias initializers specified\n // above.\n expectTensorsClose(\n outerModel.getLayer(null, 1).getWeights()[0], ones([2, 1]));\n expectTensorsClose(outerModel.getLayer(null, 1).getWeights()[1], ones([1]));\n // Expect there to be only two layers.\n expect(() => outerModel.getLayer(null, 2)).toThrow();\n });\n\n it('getWeights() works for nested sequential model', () => {\n const innerModel = tfl.sequential({\n layers: [\n tfl.layers.dense({\n units: 4,\n inputShape: [4],\n activation: 'relu',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n }),\n tfl.layers.dense({\n units: 2,\n activation: 'tanh',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n })\n ]\n });\n const outerModel =\n tfl.sequential({layers: [innerModel, tfl.layers.dense({units: 1})]});\n const weights = outerModel.getWeights();\n expect(weights.length).toEqual(6);\n expect(weights[0].shape).toEqual([4, 4]);\n expect(weights[1].shape).toEqual([4]);\n expect(weights[2].shape).toEqual([4, 2]);\n expect(weights[3].shape).toEqual([2]);\n expect(weights[4].shape).toEqual([2, 1]);\n expect(weights[5].shape).toEqual([1]);\n });\n\n it('setWeights() works for nested sequential model', () => {\n const innerModel = tfl.sequential({\n layers: [\n tfl.layers.dense({\n units: 2,\n inputShape: [3],\n activation: 'relu',\n kernelInitializer: 'zeros',\n useBias: false\n }),\n ]\n });\n const outerModel = tfl.sequential({\n layers: [\n innerModel,\n tfl.layers.dense({units: 1, kernelInitializer: 'zeros', useBias: false})\n ]\n });\n\n // The kernel start off as zeros. Set them all to ones.\n outerModel.setWeights([ones([3, 2]), ones([2, 1])]);\n expectTensorsClose(outerModel.getWeights()[0], ones([3, 2]));\n expectTensorsClose(outerModel.getWeights()[1], ones([2, 1]));\n expectTensorsClose(\n outerModel.predict(ones([1, 3])) as Tensor, tensor2d([[6]]));\n });\n\n it('Sequential as layer: save-load round trip', () => {\n const innerModel = tfl.sequential({\n layers: [\n tfl.layers.dense({\n units: 4,\n inputShape: [4],\n activation: 'relu',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n }),\n tfl.layers.dense({\n units: 4,\n activation: 'tanh',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n })\n ]\n });\n const outerModel = tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [4], inputShape: [2, 2]}), innerModel,\n tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'ones'})\n ]\n });\n const x = randomNormal([1, 2, 2]);\n const y = outerModel.predict(x) as Tensor;\n\n const unusedArg: {} = null;\n const returnString = false;\n const outerModelJSON = outerModel.toJSON(unusedArg, returnString);\n const reconstructedModel =\n deserialize(convertPythonicToTs(outerModelJSON) as PyJsonDict) as\n tfl.Sequential;\n expect(reconstructedModel.toJSON(unusedArg, returnString))\n .toEqual(outerModelJSON);\n expectTensorsClose(reconstructedModel.predict(x) as Tensor, y);\n });\n\n it('Functional model as layer: save-load round trip', () => {\n const input = tfl.input({shape: [4]});\n const layer1 = tfl.layers.dense({\n units: 4,\n activation: 'relu',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n });\n const layer2 = tfl.layers.dense({\n units: 4,\n activation: 'tanh',\n kernelInitializer: 'ones',\n biasInitializer: 'ones'\n });\n const output = layer2.apply(layer1.apply(input)) as tfl.SymbolicTensor;\n const innerModel = tfl.model({inputs: input, outputs: output});\n const outerModel = tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [4], inputShape: [2, 2]}), innerModel,\n tfl.layers.reshape({targetShape: [2, 2]})\n ]\n });\n const x = randomNormal([1, 2, 2]);\n const y = outerModel.predict(x) as Tensor;\n\n const unusedArg: {} = null;\n const returnString = false;\n const outerModelJSON = outerModel.toJSON(unusedArg, returnString);\n const reconstructedModel =\n deserialize(convertPythonicToTs(outerModelJSON) as PyJsonDict) as\n tfl.Sequential;\n expect(reconstructedModel.toJSON(unusedArg, returnString))\n .toEqual(outerModelJSON);\n expectTensorsClose(reconstructedModel.predict(x) as Tensor, y);\n });\n\n it('Attempt to nest two-input functional model fails', () => {\n const input1 = tfl.input({shape: [4]});\n const input2 = tfl.input({shape: [5]});\n const output =\n tfl.layers.concatenate().apply([input1, input2]) as tfl.SymbolicTensor;\n const innerModel = tfl.model({inputs: [input1, input2], outputs: output});\n\n const outerModel = tfl.sequential();\n\n // Adding the two-input model as the first layer of the new model should\n // fail.\n expect(() => outerModel.add(innerModel))\n .toThrowError(/should have a single input tensor/);\n\n // Adding the two-input model as the second layer of the new model should\n // fail.\n const outerModel2 = tfl.sequential(\n {layers: [tfl.layers.dense({units: 4, inputShape: [8]})]});\n expect(() => outerModel2.add(innerModel))\n .toThrowError(/should have a single input tensor/);\n\n // Creating a sequential model consisting of only the two-input model as\n // a layer should fail.\n expect(() => tfl.sequential({\n layers: [innerModel]\n })).toThrowError(/should have a single input tensor/);\n });\n\n it('Attempt to nest two-output functional model fails', () => {\n const input = tfl.input({shape: [12]});\n const output1 = tfl.layers.reshape({targetShape: [2, 6]}).apply(input) as\n tfl.SymbolicTensor;\n const output2 = tfl.layers.reshape({targetShape: [3, 4]}).apply(input) as\n tfl.SymbolicTensor;\n const innerModel = tfl.model({inputs: input, outputs: [output1, output2]});\n\n // Adding the two-output model as the first layer of the new model should\n // fail.\n const outerModel = tfl.sequential();\n expect(() => outerModel.add(innerModel))\n .toThrowError(/should have a single output tensor/);\n\n // Adding the two-output model as the second layer of the new model should\n // fail.\n const outerModel2 = tfl.sequential(\n {layers: [tfl.layers.dense({units: 4, inputShape: [8]})]});\n expect(() => outerModel2.add(innerModel))\n .toThrowError(/should have a single output tensor/);\n\n // Creating a sequential model consisting of only the two-output model as\n // a layer should fail.\n expect(() => tfl.sequential({\n layers: [innerModel]\n })).toThrowError(/should have a single output tensor/);\n });\n});\n\ndescribeMathCPU('modelFromJSON', () => {\n it('reconstitutes pythonic json string', done => {\n /* python generating code\n a=Input(shape=(32,))\n b=Dense(32)(a)\n model = Model(inputs=a, outputs=b, name=\"test\")\n model.to_json())\n */\n modelFromJSON(fakeSequentialModel)\n .then(model => {\n expect(model.name).toEqual('test');\n const allZeros = zeros([1, 32]);\n expectTensorsClose(model.apply(allZeros) as Tensor, allZeros);\n done();\n })\n .catch(done.fail);\n });\n\n it('modelFromJSON with only model topology (no weights)', async () => {\n const model = await modelFromJSON(fakeSequentialModel.modelTopology);\n expect(model.name).toEqual('test');\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n });\n\n it('toJSON and modelFromJSON', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.repeatVector({inputShape: [2], n: 4}));\n const model1JSON = model1.toJSON(null, false) as PyJsonDict;\n const model2 = await tfl.models.modelFromJSON(model1JSON);\n expect(model2.toJSON(null, false)).toEqual(model1JSON);\n });\n\n // TODO(bileschi): Uncomment once we are able to load the full RNN model.\n /*\n it('reconstitutes rnn model', done => {\n modelFromJSON(fakeRNNModel)\n .then(model => {\n console.log(model);\n done();\n })\n .catch(done.fail);\n });*/\n\n it('reconstitutes mnist non-sequential mode.', async () => {\n /*\n input_shape = (28,28,1)\n num_classes=10\n\n input_layer= Input(shape=input_shape)\n layer1 = Conv2D(32, kernel_size=(3, 3),\n activation='relu',\n input_shape=input_shape)\n layer1_result = layer1(input_layer)\n layer2= Conv2D(64, (3,3), activation='relu')\n layer2_result = layer2(layer1_result)\n layer3 = MaxPooling2D(pool_size=(2, 2))\n layer3_result = layer3(layer2_result)\n layer4 = Dropout(0.25)\n layer4_result = layer4(layer3_result)\n layer5 = Flatten()\n layer5_result = layer5(layer4_result)\n layer6 = Dense(128, activation='relu')\n layer6_result = layer6(layer5_result)\n layer7=Dropout(0.5)\n layer7_result = layer7(layer6_result)\n layer8=Dense(num_classes, activation='softmax')\n layer8_result = layer8(layer7_result)\n model = Model(inputs=input_layer, outputs=layer8_result, name='mnist')\n model.to_json()\n */\n const model = await modelFromJSON(fakeNonSequentialModel);\n expect(model.name).toEqual('mnist');\n expect(model.layers.length).toEqual(9);\n const prediction = model.predict(zeros([1, 28, 28, 1])) as Tensor;\n expect(prediction.shape).toEqual([1, 10]);\n expect(sum(prediction).dataSync()).toBeCloseTo(1);\n });\n it('reconstitutes mnist sequential mode.', async () => {\n /*\n input_shape = (28,28,1)\n num_classes = 10\n\n model = Sequential()\n model.add(Conv2D(32, kernel_size=(3, 3),\n activation='relu',\n input_shape=input_shape))\n model.add(Conv2D(64, (3,3), activation='relu'))\n model.add(MaxPooling2D(pool_size=(2, 2)))\n model.add(Dropout(0.25))\n model.add(Flatten())\n model.add(Dense(128, activation='relu'))\n model.add(Dropout(0.5))\n model.add(Dense(num_classes, activation='softmax'))\n\n model.to_json())\n */\n const model = await modelFromJSON(fakeMnistModel);\n expect(model.layers.length).toEqual(8);\n const prediction = model.predict(zeros([1, 28, 28, 1])) as Tensor;\n expect(prediction.shape).toEqual([1, 10]);\n expect(sum(prediction).dataSync()).toBeCloseTo(1);\n });\n\n it('Serialization round-tripping', async () => {\n const model = await modelFromJSON(fakeRoundtripModel);\n const serializedModel = model.toJSON() as string;\n // toJSON() returns a string by default.\n expect(typeof serializedModel).toEqual('string');\n const reparsedJson = JSON.parse(serializedModel);\n expect(reparsedJson['class_name'])\n .toEqual(fakeRoundtripModel.modelTopology['class_name']);\n // Intentionally skipping backend and keras_version fields.\n expect(reparsedJson['config'])\n .toEqual(fakeRoundtripModel.modelTopology['config']);\n });\n\n it('toJSON with returnString = false', async () => {\n const model = await modelFromJSON(fakeRoundtripModel);\n const serializedModel = model.toJSON(null, false) as PyJsonDict;\n expect(serializedModel['class_name'])\n .toEqual(fakeRoundtripModel.modelTopology['class_name']);\n expect(serializedModel['config'])\n .toEqual(fakeRoundtripModel.modelTopology['config']);\n });\n\n it('toJSON return value includes correct versions', async () => {\n const model = await modelFromJSON(fakeRoundtripModel);\n const serializedModel = model.toJSON(null, false) as PyJsonDict;\n expect(serializedModel['keras_version'])\n .toEqual(`tfjs-layers ${layersVersion}`);\n });\n\n it('Load sequential model with non-array config', async () => {\n const modelTopology: {} = {\n 'class_name': 'Sequential',\n 'keras_version': '2.1.6-tf',\n 'config': {\n 'name': 'BarSequential123',\n 'layers': [{\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'dtype': 'float32',\n 'activation': 'sigmoid',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 1,\n 'batch_input_shape': [null, 4],\n 'use_bias': true,\n 'activity_regularizer': null\n }\n }]\n },\n 'backend': 'tensorflow'\n };\n const model = deserialize(\n convertPythonicToTs(modelTopology) as\n serialization.ConfigDict) as LayersModel;\n\n expect(model.name.indexOf('BarSequential123')).toEqual(0);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 4]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 1]);\n });\n});\n\ndescribeMathCPU('loadLayersModel from URL', () => {\n const setupFakeWeightFiles =\n (fileBufferMap:\n {[filename: string]: Float32Array|Int32Array|ArrayBuffer}) => {\n spyOn(env().platform, 'fetch')\n .and.callFake((path: string) => new Promise(resolve => {\n resolve(new Response(fileBufferMap[path], {\n 'headers': {'Content-Type': OCTET_STREAM_TYPE}\n }));\n }));\n };\n\n const isModelConfigNestedValues = [false, true];\n const pathPrefixes = ['.', './', './model-home', './model-home/'];\n for (const isModelConfigNested of isModelConfigNestedValues) {\n for (const pathPrefix of pathPrefixes) {\n it(`pathPrefix=${pathPrefix}`, done => {\n const path0 = pathPrefix.endsWith('/') ? `${pathPrefix}weight_0` :\n `${pathPrefix}/weight_0`;\n const path1 = pathPrefix.endsWith('/') ? `${pathPrefix}weight_1` :\n `${pathPrefix}/weight_1`;\n const fileBufferMap:\n {[filename: string]: Float32Array|Int32Array|ArrayBuffer} = {};\n fileBufferMap[path0] =\n ones([32, 32], 'float32').dataSync() as Float32Array;\n fileBufferMap[path1] = ones([32], 'float32').dataSync() as Float32Array;\n setupFakeWeightFiles(fileBufferMap);\n // Use a randomly generated layer name to prevent interaction with\n // other unit tests that load the same sample JSON.\n const denseLayerName = `dense_${Math.floor(Math.random() * 1e9)}`;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [{\n 'name': `${denseLayerName}/kernel`,\n 'dtype': 'float32',\n 'shape': [32, 32]\n }],\n },\n {\n 'paths': ['weight_1'],\n 'weights': [{\n 'name': `${denseLayerName}/bias`,\n 'dtype': 'float32',\n 'shape': [32]\n }],\n }\n ];\n // JSON.parse and stringify to deep copy fakeSequentialModel.\n let modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n modelTopology['config']['layers'][1]['config']['name'] = denseLayerName;\n if (isModelConfigNested) {\n // Simulate case in which `configJson` contains not only\n // `model_config`, but also other data, such as training.\n modelTopology = {'model_config': modelTopology};\n }\n modelFromJSON({modelTopology, weightsManifest, pathPrefix})\n .then(model => {\n expectTensorsClose(\n model.weights[0].read(), ones([32, 32], 'float32'));\n expectTensorsClose(\n model.weights[1].read(), ones([32], 'float32'));\n })\n .then(done)\n .catch(done.fail);\n });\n }\n }\n\n it('load topology and weights from implicit relative http path', async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights':\n [{'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n ones([32, 32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n zeros([32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const model = await loadLayersModelInternal('model/model.json');\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], ones([32, 32]));\n expectTensorsClose(weightValues[1], zeros([32]));\n });\n\n it('loadLayersModel: with onProgress callback from relative path',\n async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [\n {'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}\n ],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n ones([32, 32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n zeros([32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const progressFractions: number[] = [];\n const model = await tfl.loadLayersModel('model/model.json', {\n onProgress: (fraction: number) => {\n progressFractions.push(fraction);\n }\n });\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], ones([32, 32]));\n expectTensorsClose(weightValues[1], zeros([32]));\n // There are three files: a JSON file and two weight files. So the\n // progress callback should have been called four times (twice the weight\n // files' number).\n expect(progressFractions).toEqual([0.25, 0.5, 0.75, 1]);\n });\n\n it('loadLayersModel: with onProgress callback from URL', async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights':\n [{'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'https://url/to/model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'https://url/to/model/weight_0') {\n resolve(new Response(\n ones([32, 32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'https://url/to/model/weight_1') {\n resolve(new Response(\n zeros([32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const progressFractions: number[] = [];\n const model = await tfl.loadLayersModel('https://url/to/model/model.json', {\n onProgress: (fraction: number) => {\n progressFractions.push(fraction);\n }\n });\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], ones([32, 32]));\n expectTensorsClose(weightValues[1], zeros([32]));\n // There are three files: a JSON file and two weight files. So the progress\n // callback should have been called four times (twice the weight files'\n // number).\n expect(progressFractions).toEqual([0.25, 0.5, 0.75, 1]);\n });\n\n it('loadLayersModel: no memory leak during model loading', async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights':\n [{'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n\n const kernelData = ones([32, 32], 'float32').dataSync() as Float32Array;\n const biasData = zeros([32], 'float32').dataSync() as Float32Array;\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n kernelData, {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n biasData, {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const numTensors0 = memory().numTensors;\n const model1 = await tfl.loadLayersModel('model/model.json');\n const numTensors1 = memory().numTensors;\n // The increase in the number of tensors should be equal to the\n // number of weights possessed by the model. No extra tensors\n // should have been created.\n expect(numTensors1).toEqual(numTensors0 + 2);\n\n model1.dispose();\n const numTensors2 = memory().numTensors;\n // The dispose() call should have brought us to the initial number\n // of tensors (i.e., before the model was created).\n expect(numTensors2).toEqual(numTensors0);\n });\n\n it('loadLayersModel: no memory leak with nested LayersModel layer',\n async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModelWithNestedContainer))\n .modelTopology;\n\n const weightsManifest: io.WeightsManifestConfig = [{\n 'paths': ['weight_0'],\n 'weights': [\n {'name': `dense_1/kernel`, 'dtype': 'float32', 'shape': [4, 2]},\n {'name': `dense_1/bias`, 'dtype': 'float32', 'shape': [2]},\n {'name': `dense_2/kernel`, 'dtype': 'float32', 'shape': [2, 1]},\n {'name': `dense_2/bias`, 'dtype': 'float32', 'shape': [1]}\n ],\n }];\n\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]),\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const numTensors0 = memory().numTensors;\n const model = await tfl.loadLayersModel('model/model.json');\n const mem = await memory();\n const numTensors1 = mem.numTensors;\n expect(numTensors1).toEqual(numTensors0 + 4);\n\n const disposeResult = model.dispose();\n expect(disposeResult.numDisposedVariables).toEqual(4);\n const numTensors2 = memory().numTensors;\n expect(numTensors2).toEqual(numTensors0);\n });\n\n it('load topology and weights from implicit relative http path: HDF5 format',\n async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModelFromHDF5))\n .modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [\n {'name': `dense_1/kernel`, 'dtype': 'float32', 'shape': [10, 2]}\n ],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_1/bias`, 'dtype': 'float32', 'shape': [2]}],\n },\n {\n 'paths': ['weight_2'],\n 'weights': [\n {'name': `dense_2/kernel`, 'dtype': 'float32', 'shape': [2, 1]}\n ],\n },\n {\n 'paths': ['weight_3'],\n 'weights':\n [{'name': `dense_2/bias`, 'dtype': 'float32', 'shape': [1]}],\n }\n ];\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n ones([10, 2], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n zeros([2], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_2') {\n resolve(new Response(\n zeros([2, 1], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_3') {\n resolve(new Response(\n ones([1], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const model = await loadLayersModelInternal('model/model.json');\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 10]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 1]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(4);\n expectTensorsClose(weightValues[0], ones([10, 2]));\n expectTensorsClose(weightValues[1], zeros([2]));\n expectTensorsClose(weightValues[2], zeros([2, 1]));\n expectTensorsClose(weightValues[3], ones([1]));\n });\n\n it('load topology and weights: non-array Sequential config', async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeNonArrayConfigSequentialModelFromHDF5))\n .modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights':\n [{'name': `dense_1/kernel`, 'dtype': 'float32', 'shape': [10, 2]}],\n },\n {\n 'paths': ['weight_1'],\n 'weights': [{'name': `dense_1/bias`, 'dtype': 'float32', 'shape': [2]}],\n },\n {\n 'paths': ['weight_2'],\n 'weights':\n [{'name': `dense_2/kernel`, 'dtype': 'float32', 'shape': [2, 1]}],\n },\n {\n 'paths': ['weight_3'],\n 'weights': [{'name': `dense_2/bias`, 'dtype': 'float32', 'shape': [1]}],\n }\n ];\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n ones([10, 2], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n zeros([2], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_2') {\n resolve(new Response(\n zeros([2, 1], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_3') {\n resolve(new Response(\n ones([1], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const model = await loadLayersModelInternal('model/model.json');\n expect(model.name.indexOf('Foo123Sequential')).toEqual(0);\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 10]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 1]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(4);\n expectTensorsClose(weightValues[0], ones([10, 2]));\n expectTensorsClose(weightValues[1], zeros([2]));\n expectTensorsClose(weightValues[2], zeros([2, 1]));\n expectTensorsClose(weightValues[3], ones([1]));\n });\n\n it('load topology and weights with browserHTTPRequest with requestInit',\n async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [\n {'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}\n ],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n\n const requestHeaders: Array<{[key: string]: string | {}}> = [];\n const requestCredentials: string[] = [];\n spyOn(env().platform, 'fetch')\n .and.callFake((path: string, requestInit?: RequestInit) => {\n if (requestInit != null) {\n requestHeaders.push(requestInit.headers as {});\n requestCredentials.push(requestInit.credentials);\n }\n return new Promise((resolve, reject) => {\n if (path === 'model/model.json') {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === 'model/weight_0') {\n resolve(new Response(\n ones([32, 32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === 'model/weight_1') {\n resolve(new Response(\n zeros([32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const model = await loadLayersModelInternal(\n io.browserHTTPRequest('model/model.json', {\n requestInit: {\n headers: {'header_key_1': 'header_value_1'},\n credentials: 'include',\n }\n }));\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], ones([32, 32]));\n expectTensorsClose(weightValues[1], zeros([32]));\n\n // Verify that the headers and credentials are sent via\n // `fetch` properly.\n expect(requestHeaders[0]).toEqual(jasmine.objectContaining({\n 'header_key_1': 'header_value_1'\n }));\n expect(requestHeaders[1]).toEqual(jasmine.objectContaining({\n 'header_key_1': 'header_value_1'\n }));\n expect(requestHeaders[2]).toEqual(jasmine.objectContaining({\n 'header_key_1': 'header_value_1'\n }));\n expect(requestCredentials).toEqual(['include', 'include', 'include']);\n });\n\n const httpProtocols = ['http://', 'https://'];\n for (const protocol of httpProtocols) {\n it(`load topology and weights: explicit relative ${protocol} path`,\n async () => {\n const modelTopology =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [\n {'name': `dense_6/kernel`, 'dtype': 'float32', 'shape': [32, 32]}\n ],\n },\n {\n 'paths': ['weight_1'],\n 'weights':\n [{'name': `dense_6/bias`, 'dtype': 'float32', 'shape': [32]}],\n }\n ];\n spyOn(env().platform, 'fetch').and.callFake((path: string) => {\n return new Promise((resolve, reject) => {\n if (path === `${protocol}localhost:8888/models/model.json`) {\n resolve(new Response(\n JSON.stringify({\n modelTopology,\n weightsManifest,\n }),\n {'headers': {'Content-Type': JSON_TYPE}}));\n } else if (path === `${protocol}localhost:8888/models/weight_0`) {\n resolve(new Response(\n ones([32, 32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else if (path === `${protocol}localhost:8888/models/weight_1`) {\n resolve(new Response(\n zeros([32], 'float32').dataSync() as Float32Array,\n {'headers': {'Content-Type': OCTET_STREAM_TYPE}}));\n } else {\n reject(new Error(`Invalid path: ${path}`));\n }\n });\n });\n\n const model = await loadLayersModelInternal(\n `${protocol}localhost:8888/models/model.json`);\n expect(model.layers.length).toEqual(2);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 32]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 32]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], ones([32, 32]));\n expectTensorsClose(weightValues[1], zeros([32]));\n });\n }\n\n it('Missing weight in manifest leads to error', done => {\n setupFakeWeightFiles({\n './weight_0': ones([32, 32], 'float32').dataSync() as Float32Array,\n './weight_1': ones([32], 'float32').dataSync() as Float32Array,\n });\n // Use a randomly generated layer name to prevent interaction with other\n // unit tests that load the same sample JSON.\n const denseLayerName = `dense_${Math.floor(Math.random() * 1e9)}`;\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [{\n 'name': `${denseLayerName}/kernel`,\n 'dtype': 'float32',\n 'shape': [32, 32]\n }],\n },\n ]; // Missing bias.\n // JSON.parse and stringify to deep copy fakeSequentialModel.\n const configJson =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n configJson['config']['layers'][1]['config']['name'] = denseLayerName;\n modelFromJSON({modelTopology: configJson, weightsManifest, pathPrefix: '.'})\n .then(() => done.fail())\n .catch(() => done());\n });\n\n it('Loads weights despite uniqueified tensor names', async () => {\n setupFakeWeightFiles({\n './weight_0': ones([32, 32], 'float32').dataSync() as Float32Array,\n './weight_1': ones([32], 'float32').dataSync() as Float32Array,\n });\n const denseLayerName = 'dense_uniqueify';\n const weightsManifest: io.WeightsManifestConfig = [\n {\n 'paths': ['weight_0'],\n 'weights': [{\n 'name': `${denseLayerName}/kernel`,\n 'dtype': 'float32',\n 'shape': [32, 32]\n }],\n },\n {\n 'paths': ['weight_1'],\n 'weights': [\n {'name': `${denseLayerName}/bias`, 'dtype': 'float32', 'shape': [32]}\n ],\n }\n ];\n // JSON.parse and stringify to deep copy fakeSequentialModel.\n const configJson =\n JSON.parse(JSON.stringify(fakeSequentialModel)).modelTopology;\n configJson['config']['layers'][1]['config']['name'] = denseLayerName;\n const model1 = await modelFromJSON(\n {modelTopology: configJson, weightsManifest, pathPrefix: '.'});\n expect(model1.weights[0].name).toEqual('dense_uniqueify/kernel');\n expect(model1.weights[0].originalName).toEqual('dense_uniqueify/kernel');\n expect(model1.weights[1].name).toEqual('dense_uniqueify/bias');\n expect(model1.weights[1].originalName).toEqual('dense_uniqueify/bias');\n expectTensorsClose(model1.weights[0].read(), ones([32, 32], 'float32'));\n expectTensorsClose(model1.weights[1].read(), ones([32], 'float32'));\n\n // On the second load, the variable names will be uniqueified. This\n // test succeeds only because we maintain the name mapping, so we\n // can load weights--keyed by non-unique names in the weight\n // manifest--into variables with newly uniqueified names.\n const model2 = await modelFromJSON(\n {modelTopology: configJson, weightsManifest, pathPrefix: '.'});\n // note unique suffix\n expect(model2.weights[0].name).toEqual('dense_uniqueify/kernel_1');\n expect(model2.weights[0].originalName).toEqual('dense_uniqueify/kernel');\n // note unique suffix\n expect(model2.weights[1].name).toEqual('dense_uniqueify/bias_1');\n expect(model2.weights[1].originalName).toEqual('dense_uniqueify/bias');\n expectTensorsClose(model2.weights[0].read(), ones([32, 32], 'float32'));\n expectTensorsClose(model2.weights[1].read(), ones([32], 'float32'));\n });\n\n it('Repeated saving and loading of LayersModel works', () => {\n const model1 = tfl.sequential();\n model1.add(\n tfl.layers.dense({units: 3, inputShape: [4], activation: 'relu'}));\n model1.add(tfl.layers.dense({units: 1, activation: 'sigmoid'}));\n const json1 = model1.toJSON(null, false);\n const model2 =\n deserialize(convertPythonicToTs(json1) as serialization.ConfigDict) as\n LayersModel;\n const json2 = model2.toJSON(null, false);\n expect(json2).toEqual(json1);\n });\n});\n\ndescribeMathCPUAndGPU('Saving+loading model with optimizer', () => {\n it('SGD', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const optimizer = train.sgd(learningRate);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n expect(weightSpecs.length).toEqual(2 + 1);\n expect(weightSpecs[2].name).toEqual('iter');\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 * 8 + 4 * 1 + 4);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(26.2144);\n });\n\n it('RMSProp', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const decay = 0.95;\n const optimizer = train.rmsprop(learningRate, decay);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last four weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2 * 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/rms`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/rms`);\n expect(weightSpecs[5].name).toEqual(`${weightSpecs[0].name}/momentum`);\n expect(weightSpecs[6].name).toEqual(`${weightSpecs[1].name}/momentum`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 3 + 4 * 1 * 3);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n expect(model2.optimizer.getConfig()['decay']).toEqual(decay);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(51.768246);\n });\n\n it('Adadelta', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const optimizer = train.adadelta(learningRate);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last four weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2 * 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/accum_grad`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/accum_grad`);\n expect(weightSpecs[5].name).toEqual(`${weightSpecs[0].name}/accum_var`);\n expect(weightSpecs[6].name).toEqual(`${weightSpecs[1].name}/accum_var`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 3 + 4 * 1 * 3);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(26.2144);\n });\n\n it('Adagrad', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const initialAccumulatorValue = 0.15;\n const optimizer = train.adagrad(learningRate, initialAccumulatorValue);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last two weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/accumulator`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/accumulator`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 2 + 4 * 1 * 2);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n expect(model2.optimizer.getConfig()['initialAccumulatorValue'])\n .toEqual(initialAccumulatorValue);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(61.153225);\n });\n\n it('Adam as explicit object', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const beta1 = 0.95;\n const beta2 = 0.98;\n const optimizer = train.adam(learningRate, beta1, beta2);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last four weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2 * 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/m`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/m`);\n expect(weightSpecs[5].name).toEqual(`${weightSpecs[0].name}/v`);\n expect(weightSpecs[6].name).toEqual(`${weightSpecs[1].name}/v`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 3 + 4 * 1 * 3);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n expect(model2.optimizer.getConfig()['beta1']).toEqual(beta1);\n expect(model2.optimizer.getConfig()['beta2']).toEqual(beta2);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(61.1524);\n });\n\n it('Adam as string name', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n model1.compile({loss: 'meanSquaredError', optimizer: 'adam'});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last four weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2 * 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/m`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/m`);\n expect(weightSpecs[5].name).toEqual(`${weightSpecs[0].name}/v`);\n expect(weightSpecs[6].name).toEqual(`${weightSpecs[1].name}/v`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 3 + 4 * 1 * 3);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(1e-3);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(63.8561);\n });\n\n it('Momentum', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense(\n {units: 1, inputShape: [8], kernelInitializer: 'ones'}));\n const learningRate = 0.02;\n const momentum = 0.91;\n const optimizer = train.momentum(learningRate, momentum);\n model1.compile({loss: 'meanSquaredError', optimizer});\n\n const xs = ones([4, 8]);\n const ys = zeros([4, 1]);\n await model1.fit(xs, ys, {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('mean_squared_error');\n\n const weightSpecs = savedArtifacts.weightSpecs;\n // The first two weights belong to the model proper.\n // The next weight is the iterations counter.\n // The last four weights belong to the rmsprop optimizer.\n expect(weightSpecs.length).toEqual(2 + 1 + 2);\n expect(weightSpecs[2].name).toEqual('iter');\n expect(weightSpecs[3].name).toEqual(`${weightSpecs[0].name}/momentum`);\n expect(weightSpecs[4].name).toEqual(`${weightSpecs[1].name}/momentum`);\n // The first part comes from the kernel of the dense layer, which has a\n // 8 elements and each is 4 bytes.\n // The second part comes from the bias of the dense layer, which has 1\n // element and is also 4 bytes.\n const weightData = savedArtifacts.weightData;\n expect(weightData.byteLength).toEqual(4 + 4 * 8 * 2 + 4 * 1 * 2);\n\n // Load the model back, with the optimizer.\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n expect(model2.optimizer.getConfig()['learningRate']).toEqual(learningRate);\n\n const optimizer1Weights = await model1.optimizer.getWeights();\n const optimizer2Weights = await model2.optimizer.getWeights();\n expect(optimizer2Weights.length).toEqual(optimizer1Weights.length);\n for (let i = 0; i < optimizer1Weights.length; ++i) {\n expectTensorsClose(\n optimizer2Weights[i].tensor, optimizer1Weights[i].tensor);\n }\n\n // Call fit() on the loaded model and assert that the effect is the\n // same as calling fit() again on the original model.\n const history = await model2.fit(xs, ys, {epochs: 1});\n expect(history.history.loss[0]).toBeCloseTo(26.2144);\n });\n\n it('Saving model with metrics', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense({\n units: 3,\n inputShape: [8],\n kernelInitializer: 'ones',\n activation: 'softmax'\n }));\n model1.compile(\n {loss: 'categoricalCrossentropy', optimizer: 'adam', metrics: ['acc']});\n\n const xs = ones([4, 8]);\n const ys = tensor2d([[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]);\n let h = await model1.fit(xs, ys, {epochs: 1});\n expect(h.history.loss[0]).toBeCloseTo(1.0986123);\n expect(h.history.acc).toEqual([0]);\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('categorical_crossentropy');\n expect(trainingConfig['metrics']).toEqual(['acc']);\n\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n h = await model2.fit(xs, ys, {epochs: 1});\n expect(h.history.loss.length).toEqual(1);\n expect(h.history.loss[0]).toBeCloseTo(1.086648);\n expect(h.history.acc).toEqual([1]);\n });\n\n it('Saving model without calling fit first', async () => {\n const model1 = tfl.sequential();\n model1.add(tfl.layers.dense({\n units: 3,\n inputShape: [8],\n kernelInitializer: 'ones',\n activation: 'softmax'\n }));\n model1.compile(\n {loss: 'categoricalCrossentropy', optimizer: 'adam', metrics: ['acc']});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual('categorical_crossentropy');\n expect(trainingConfig['metrics']).toEqual(['acc']);\n\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n\n const xs = ones([4, 8]);\n const ys = tensor2d([[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]);\n const h = await model2.fit(xs, ys, {epochs: 1});\n expect(h.history.loss.length).toEqual(1);\n expect(h.history.loss[0]).toBeCloseTo(1.0986123);\n expect(h.history.acc).toEqual([0]);\n expect(model2.optimizer.iterations).toEqual(1);\n });\n\n it('Saving functional model with more than one output', async () => {\n const input = tfl.input({shape: [8]});\n const x =\n tfl.layers\n .dense({units: 5, kernelInitializer: 'ones', activation: 'relu'})\n .apply(input) as tfl.SymbolicTensor;\n const outLayer1 = tfl.layers.dense(\n {units: 3, kernelInitializer: 'ones', activation: 'softmax'});\n const y1 = outLayer1.apply(x) as tfl.SymbolicTensor;\n const outLayer2 = tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', activation: 'sigmoid'});\n const y2 = outLayer2.apply(x) as tfl.SymbolicTensor;\n const model1 = tfl.model({inputs: input, outputs: [y1, y2]});\n model1.compile({\n loss: ['categoricalCrossentropy', 'binaryCrossentropy'],\n optimizer: 'adam',\n metrics: ['acc']\n });\n\n const xs = ones([4, 8]);\n const ys1 = tensor2d([[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]);\n const ys2 = tensor2d([[1], [1], [1], [1]]);\n\n let h = await model1.fit(xs, [ys1, ys2], {epochs: 1});\n\n let savedArtifacts: io.ModelArtifacts;\n await model1.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return null;\n }),\n {includeOptimizer: true});\n\n const trainingConfig = savedArtifacts.trainingConfig;\n expect(trainingConfig['loss']).toEqual([\n 'categorical_crossentropy', 'binary_crossentropy'\n ]);\n expect(trainingConfig['metrics']).toEqual(['acc']);\n\n const model2 = await tfl.loadLayersModel(io.fromMemory(savedArtifacts));\n\n h = await model2.fit(xs, [ys1, ys2], {epochs: 1});\n expect(h.history.loss.length).toEqual(1);\n expect(h.history.loss[0]).toBeCloseTo(1.044699);\n\n const lossKey1 = `${outLayer1.name}_loss`;\n const outputLoss1 = h.history[lossKey1] as number[];\n expect(outputLoss1.length).toEqual(1);\n expect(outputLoss1[0]).toBeCloseTo(1.0446988);\n const lossKey2 = `${outLayer2.name}_loss`;\n const outputLoss2 = h.history[lossKey2] as number[];\n expect(outputLoss2.length).toEqual(1);\n expect(outputLoss2[0]).toBeCloseTo(1.936124e-7);\n\n const metricKey1 = `${outLayer1.name}_acc`;\n const metricValues1 = h.history[metricKey1] as number[];\n expect(metricValues1.length).toEqual(1);\n expect(metricValues1[0]).toEqual(1);\n const metricKey2 = `${outLayer2.name}_acc`;\n const metricValues2 = h.history[metricKey2] as number[];\n expect(metricValues2.length).toEqual(1);\n expect(metricValues2[0]).toBeCloseTo(1);\n });\n});\n\ndescribeMathCPU('loadLayersModel from IOHandler', () => {\n // The model topology JSON can be obtained with the following Python Keras\n // code:\n //\n // ```python\n // import keras\n // model = keras.Sequential([\n // keras.layers.Dense(1, input_shape=[4], activation='sigmoid')\n // ])\n // print(model.to_json())\n // ```\n const modelTopology: {} = {\n 'class_name': 'Sequential',\n 'keras_version': '2.1.4',\n 'config': [{\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'dtype': 'float32',\n 'activation': 'sigmoid',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 1,\n 'batch_input_shape': [null, 4],\n 'use_bias': true,\n 'activity_regularizer': null\n }\n }],\n 'backend': 'tensorflow'\n };\n const weightSpecs: io.WeightsManifestEntry[] = [\n {\n name: 'dense_1/kernel',\n shape: [4, 1],\n dtype: 'float32',\n },\n {\n name: 'dense_1/bias',\n shape: [1],\n dtype: 'float32',\n }\n ];\n const weightData = new Float32Array([1.1, 2.2, 3.3, 4.4, 5.5]).buffer;\n\n // A dummy IOHandler that returns hard-coded model artifacts when its\n // `load` method is called.\n class IOHandlerForTest implements io.IOHandler {\n private readonly includeWeights: boolean;\n\n constructor(includeWeights = true) {\n this.includeWeights = includeWeights;\n }\n\n async load(): Promise {\n return this.includeWeights ? {modelTopology, weightSpecs, weightData} :\n {modelTopology};\n }\n }\n\n // A dummy IOHandler that doesn't have the `load` method implemented and\n // is expected to cause `loadLayersModel` or `loadLayersModelInternal` to\n // fail.\n class IOHandlerWithoutLoad implements io.IOHandler {\n constructor() {}\n }\n\n it('load topology and weights', async () => {\n const model = await loadLayersModelInternal(new IOHandlerForTest(true));\n expect(model.layers.length).toEqual(1);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 4]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 1]);\n const weightValues = model.getWeights();\n expect(weightValues.length).toEqual(2);\n expectTensorsClose(weightValues[0], tensor2d([1.1, 2.2, 3.3, 4.4], [4, 1]));\n expectTensorsClose(weightValues[1], tensor1d([5.5]));\n });\n\n it('load topology only', async () => {\n const model = await loadLayersModelInternal(new IOHandlerForTest(false));\n expect(model.layers.length).toEqual(1);\n expect(model.inputs.length).toEqual(1);\n expect(model.inputs[0].shape).toEqual([null, 4]);\n expect(model.outputs.length).toEqual(1);\n expect(model.outputs[0].shape).toEqual([null, 1]);\n });\n\n it('IOHandler without load method causes error', async done => {\n loadLayersModelInternal(new IOHandlerWithoutLoad())\n .then(model => {\n done.fail(\n 'Loading with an IOHandler without load method succeeded ' +\n 'unexpectedly.');\n })\n .catch(err => {\n expect(err.message).toMatch(/does not have .*load.* method/);\n done();\n });\n });\n});\n\ndescribeMathCPUAndGPU('Sequential', () => {\n const inputShape = [1, 6];\n const batchInputShape = [1].concat(inputShape);\n const firstReshape = [2, 3];\n const secondReshape = [3, 2];\n const layers = [\n new Reshape({targetShape: firstReshape, batchInputShape, name: 'layer1'}),\n new Reshape({targetShape: secondReshape, name: 'layer2'})\n ];\n\n function getInputs(): Tensor {\n return ones(batchInputShape);\n }\n\n function getExpectedOutputs(): Tensor {\n return ones([1].concat(secondReshape));\n }\n\n it('throws an exception if the first layer is not an input layer', () => {\n const layer = new Reshape({targetShape: firstReshape});\n expect(() => tfl.sequential({layers: [layer]}))\n .toThrowError(\n /The first layer in a Sequential model must get an `inputShape`/);\n });\n\n it('can accept a list of layers in constructor', () => {\n const model = tfl.sequential({layers});\n expect(model.layers).toEqual(layers);\n });\n\n it('can add layers', () => {\n const model = tfl.sequential();\n for (const layer of layers) {\n model.add(layer);\n }\n expect(model.layers).toEqual(layers);\n });\n\n it('can pop layers', () => {\n const model = tfl.sequential({layers});\n model.pop();\n expect(model.layers).toEqual(layers.slice(0, 1));\n });\n\n it('Incompatible inputShape leads to warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [8], inputShape: [2, 4]}),\n tfl.layers.dense({units: 1, inputShape: [7]})\n ]\n });\n expect(recordedWarnMessage)\n .toMatch(/shape of the input tensor .*null,8.* not match .*null,7.*/);\n });\n\n it('Incompatible inputShape rank leads to warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [8], inputShape: [2, 4]}),\n tfl.layers.dense({units: 1, inputShape: [3, 7]})\n ]\n });\n expect(recordedWarnMessage)\n .toMatch(/rank .*null,8.* does not match .*null,3,7.* /);\n });\n\n it('Compatible inputShape leads to NO warning', () => {\n let recordedWarnMessage: string;\n spyOn(console, 'warn')\n .and.callFake((message: string) => recordedWarnMessage = message);\n tfl.sequential({\n layers: [\n tfl.layers.reshape({targetShape: [8], inputShape: [2, 4]}),\n tfl.layers.dense({units: 1, inputShape: [8]})\n ]\n });\n expect(recordedWarnMessage).toEqual(undefined);\n });\n\n it('throws error if try to pop too many layers', () => {\n const model = tfl.sequential();\n expect(() => model.pop()).toThrowError(/There are no layers in the model/);\n });\n\n it('throws error if first layer would result in negative shape', () => {\n const model = tfl.sequential();\n const layer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [10, 10],\n strides: 1,\n padding: 'valid',\n dataFormat: 'channelsLast',\n inputShape: [4, 4, 1]\n });\n // Adding the layer would result in a shpae of [null, -5, -5, 1]\n expect(() => model.add(layer)).toThrowError(/Negative dimension size/);\n });\n\n it('throws error if adding layer would result in negative shape', () => {\n const model = tfl.sequential();\n model.add(\n tfl.layers.activation({inputShape: [4, 4, 1], activation: 'relu'}));\n const layer = tfl.layers.conv2d({\n filters: 1,\n kernelSize: [10, 10],\n strides: 1,\n padding: 'valid',\n dataFormat: 'channelsLast',\n });\n // Adding the layer would result in a shpae of [null, -5, -5, 1]\n expect(() => model.add(layer)).toThrowError(/Negative dimension size/);\n });\n\n it('apply() threads data through the model.', () => {\n const model = tfl.sequential({layers});\n expectTensorsClose(\n model.apply(getInputs()) as Tensor, getExpectedOutputs());\n });\n\n it('predict() threads data through the model.', () => {\n const model = tfl.sequential({layers});\n expectTensorsClose(\n model.predict(getInputs()) as Tensor, getExpectedOutputs());\n });\n\n const dtypes: DataType[] = ['int32', 'float32'];\n // TODO(bileschi): Add test for casting incompatible types, once they exist.\n for (const dtype of dtypes) {\n it(`predict() works with input dtype ${dtype}.`, () => {\n const embModel = tfl.sequential();\n embModel.add(\n tfl.layers.embedding({inputShape: [1], inputDim: 10, outputDim: 2}));\n const x = tensor2d([[0], [0], [1]], [3, 1], dtype);\n const y = embModel.predict(x) as Tensor;\n expect(y.dtype).toBe('float32');\n });\n\n it(`fit() works with input dtype ${dtype}.`, async () => {\n const embModel = tfl.sequential();\n embModel.add(\n tfl.layers.embedding({inputShape: [1], inputDim: 10, outputDim: 2}));\n embModel.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const x = tensor2d([[0]], [1, 1], dtype);\n const y = tensor3d([[[0.5, 0.5]]], [1, 1, 2], 'float32');\n await embModel.fit(x, y);\n });\n }\n\n it('predictOnBatch() threads data through the model.', () => {\n const batchSize = 10;\n const inputShape = [1, 6];\n const batchInputShape = [batchSize].concat(inputShape);\n const firstReshape = [2, 3];\n const secondReshape = [3, 2];\n const layers = [\n new Reshape({targetShape: firstReshape, batchInputShape, name: 'layer1'}),\n new Reshape({targetShape: secondReshape, name: 'layer2'})\n ];\n const inputBatch = ones([batchSize].concat(inputShape));\n const expectedOutput = ones([batchSize].concat(secondReshape));\n const model = tfl.sequential({layers});\n expectTensorsClose(\n model.predictOnBatch(inputBatch) as Tensor, expectedOutput);\n });\n\n it('predictOnBatch() works with multi-input model.', () => {\n const input1 = tfl.input({shape: [3]});\n const input2 = tfl.input({shape: [4]});\n const dense1 = tfl.layers.dense({units: 1, activation: 'sigmoid'});\n const y1 = dense1.apply(input1) as tfl.SymbolicTensor;\n const dense2 = tfl.layers.dense({units: 1, activation: 'sigmoid'});\n const y2 = dense2.apply(input2) as tfl.SymbolicTensor;\n const y = tfl.layers.concatenate().apply([y1, y2]) as tfl.SymbolicTensor;\n const model = tfl.model({inputs: [input1, input2], outputs: y});\n\n const batchSize = 5;\n const x1 = zeros([batchSize, 3]);\n const x2 = ones([batchSize, 4]);\n const out = model.predictOnBatch([x1, x2]) as Tensor;\n expect(out.shape).toEqual([5, 2]);\n });\n\n it('compile() and fit()', async () => {\n const batchSize = 5;\n const inputSize = 4;\n const xs = ones([batchSize, inputSize]);\n const ys = ones([batchSize, 1]);\n const denseLayer1 = tfl.layers.dense({\n units: 3,\n useBias: false,\n kernelInitializer: 'ones',\n inputShape: [inputSize]\n });\n const denseLayer2 =\n tfl.layers.dense({units: 1, useBias: false, kernelInitializer: 'ones'});\n const model = tfl.sequential({layers: [denseLayer1, denseLayer2]});\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const history = await model.fit(xs, ys, {batchSize, epochs: 2});\n expect(history.history['loss'][0]).toBeCloseTo(121);\n expect(history.history['loss'][1]).toBeCloseTo(0.015178224071860313);\n });\n\n it('calling fit twice in a row leads to error', async () => {\n const batchSize = 5;\n const inputSize = 4;\n const xs = ones([batchSize, inputSize]);\n const ys = ones([batchSize, 1]);\n const denseLayer1 = tfl.layers.dense({units: 3, inputShape: [inputSize]});\n const denseLayer2 = tfl.layers.dense({units: 1});\n const model = tfl.sequential({layers: [denseLayer1, denseLayer2]});\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n // Do not call `await` below, so the two fit() calls may interleave.\n const firstFit = model.fit(xs, ys, {batchSize, epochs: 8});\n\n let errorCaught: Error;\n try {\n await model.fit(xs, ys);\n } catch (err) {\n errorCaught = err;\n }\n expect(errorCaught.message)\n .toEqual(\n 'Cannot start training because another fit() call is ongoing.');\n await firstFit;\n });\n\n it('Stop Sequential.fit() using non-class callback function', async () => {\n const batchSize = 5;\n const inputSize = 4;\n const xs = ones([batchSize, inputSize]);\n const ys = ones([batchSize, 1]);\n const denseLayer1 = tfl.layers.dense({units: 3, inputShape: [inputSize]});\n const denseLayer2 = tfl.layers.dense({units: 1});\n const model = tfl.sequential({layers: [denseLayer1, denseLayer2]});\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n\n let numEpochsDone = 0;\n const epochs = 8;\n const stopAfterEpoch = 3;\n let history = await model.fit(xs, ys, {\n epochs,\n callbacks: {\n onEpochEnd: async (epoch, logs) => {\n numEpochsDone++;\n if (epoch === stopAfterEpoch) {\n model.stopTraining = true;\n }\n }\n }\n });\n expect(numEpochsDone).toEqual(stopAfterEpoch + 1);\n expect(history.history.loss.length).toEqual(stopAfterEpoch + 1);\n\n // Check that model.fit can still be called after force stopping.\n history = await model.fit(xs, ys, {epochs: 2});\n expect(history.history.loss.length).toEqual(2);\n });\n\n it('Calling evaluate before compile leads to error', () => {\n const batchSize = 5;\n const inputSize = 4;\n const denseLayer1 = tfl.layers.dense({units: 3, inputShape: [inputSize]});\n const model = tfl.sequential({layers: [denseLayer1]});\n const xs = ones([batchSize, inputSize]);\n const ys = ones([batchSize, 1]);\n expect(() => model.evaluate(xs, ys))\n .toThrowError(/needs to be compiled before/);\n });\n\n it('compile() and evaluate()', () => {\n const batchSize = 5;\n const inputSize = 4;\n const xs = ones([batchSize, inputSize]);\n const ys = ones([batchSize, 1]);\n const denseLayer1 = tfl.layers.dense({\n units: 3,\n useBias: false,\n kernelInitializer: 'ones',\n inputShape: [inputSize]\n });\n const denseLayer2 =\n tfl.layers.dense({units: 1, useBias: false, kernelInitializer: 'ones'});\n const model = tfl.sequential({layers: [denseLayer1, denseLayer2]});\n model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n const losses = model.evaluate(xs, ys, {batchSize}) as Scalar;\n expectTensorsClose(losses, scalar(121));\n });\n\n it('getConfig returns an Array', () => {\n const model = tfl.sequential({layers});\n const config = model.getConfig();\n expect(Array.isArray(config.layers)).toEqual(true);\n expect(config.layers.length).toEqual(layers.length);\n });\n});\n\n// Fake models.\n\nconst fakeSequentialModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'class_name': 'Model',\n 'keras_version': '2.0.7',\n 'config': {\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'config': {\n 'dtype': 'float32',\n 'batch_input_shape': [null, 32],\n 'name': 'input_6',\n 'sparse': false\n },\n 'inbound_nodes': [],\n 'name': 'input_6'\n },\n {\n 'class_name': 'Dense',\n 'config': {\n 'units': 32,\n 'bias_constraint': null,\n 'use_bias': true,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'activation': 'linear',\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'trainable': true,\n 'kernel_constraint': null,\n 'kernel_regularizer': null,\n 'name': 'dense_6',\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}}\n },\n 'inbound_nodes': [[['input_6', 0, 0, {}]]],\n 'name': 'dense_6'\n }\n ],\n 'input_layers': [['input_6', 0, 0]],\n 'output_layers': [['dense_6', 0, 0]],\n 'name': 'test'\n },\n 'backend': 'tensorflow'\n }\n};\n\nconst fakeSequentialModelWithNestedContainer: ModelAndWeightsConfig = {\n modelTopology: {\n 'keras_version': '2.2.4',\n 'backend': 'tensorflow',\n 'model_config': {\n 'class_name': 'Model',\n 'config': {\n 'name': 'model_1',\n 'layers': [\n {\n 'name': 'dense_1_input',\n 'class_name': 'InputLayer',\n 'config': {\n 'batch_input_shape': [null, 4],\n 'dtype': 'float32',\n 'sparse': false,\n 'name': 'dense_1_input'\n },\n 'inbound_nodes': []\n },\n {\n 'name': 'dense_1',\n 'class_name': 'Dense',\n 'config': {\n 'name': 'dense_1',\n 'trainable': true,\n 'batch_input_shape': [null, 4],\n 'dtype': 'float32',\n 'units': 2,\n 'activation': 'relu',\n 'use_bias': true,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'distribution': 'uniform',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_regularizer': null,\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_constraint': null,\n 'bias_constraint': null\n },\n 'inbound_nodes': [[['dense_1_input', 0, 0, {}]]]\n },\n {\n 'name': 'sequential_2',\n 'class_name': 'Sequential',\n 'config': {\n 'name': 'sequential_2',\n 'layers': [{\n 'class_name': 'Dense',\n 'config': {\n 'name': 'dense_2',\n 'trainable': true,\n 'batch_input_shape': [null, 2],\n 'dtype': 'float32',\n 'units': 1,\n 'activation': 'softmax',\n 'use_bias': true,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'distribution': 'uniform',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_regularizer': null,\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_constraint': null,\n 'bias_constraint': null\n }\n }]\n },\n 'inbound_nodes': [[['dense_1', 0, 0, {}]]]\n }\n ],\n 'input_layers': [['dense_1_input', 0, 0]],\n 'output_layers': [['sequential_2', 1, 0]]\n }\n }\n }\n};\n\nconst fakeSequentialModelFromHDF5: ModelAndWeightsConfig = {\n modelTopology: {\n 'backend': 'tensorflow',\n 'keras_version': '2.1.4',\n 'model_config': {\n 'class_name': 'Sequential',\n 'config': [\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'dtype': 'float32',\n 'activation': 'relu',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 2,\n 'batch_input_shape': [null, 10],\n 'use_bias': true,\n 'activity_regularizer': null\n }\n },\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_2',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'activation': 'sigmoid',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 1,\n 'use_bias': true,\n 'activity_regularizer': null\n }\n }\n ]\n },\n }\n};\n\nconst fakeNonArrayConfigSequentialModelFromHDF5: ModelAndWeightsConfig = {\n modelTopology: {\n 'backend': 'tensorflow',\n 'keras_version': '2.1.6-tf',\n 'model_config': {\n 'class_name': 'Sequential',\n 'config': {\n 'name': 'Foo123Sequential',\n 'layers': [\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_1',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'dtype': 'float32',\n 'activation': 'relu',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 2,\n 'batch_input_shape': [null, 10],\n 'use_bias': true,\n 'activity_regularizer': null\n }\n },\n {\n 'class_name': 'Dense',\n 'config': {\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'seed': null,\n 'mode': 'fan_avg'\n }\n },\n 'name': 'dense_2',\n 'kernel_constraint': null,\n 'bias_regularizer': null,\n 'bias_constraint': null,\n 'activation': 'sigmoid',\n 'trainable': true,\n 'kernel_regularizer': null,\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'units': 1,\n 'use_bias': true,\n 'activity_regularizer': null\n }\n }\n ]\n },\n }\n }\n};\n\n// TODO(bileschi): Uncomment once we are able to load a model of this size.\n/*\nconst fakeRNNModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'keras_version': '2.1.5',\n 'training_config': {\n 'optimizer_config': {\n 'config': {\n 'rho': 0.8999999761581421,\n 'epsilon': 1e-07,\n 'lr': 0.009999999776482582,\n 'decay': 0.0\n },\n 'class_name': 'RMSprop'\n },\n 'loss': 'categorical_crossentropy',\n 'metrics': ['acc'],\n 'sample_weight_mode': null,\n 'loss_weights': null\n },\n 'backend': 'tensorflow',\n 'model_config': {\n 'config': [\n {\n 'config': {\n 'unroll': false,\n 'name': 'lstm_9',\n 'trainable': true,\n 'implementation': 1,\n 'recurrent_constraint': null,\n 'stateful': false,\n 'return_sequences': false,\n 'recurrent_initializer': {\n 'config': {'gain': 1.0, 'seed': null},\n 'class_name': 'Orthogonal'\n },\n 'bias_regularizer': null,\n 'kernel_constraint': null,\n 'dtype': 'float32',\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'kernel_regularizer': null,\n 'go_backwards': false,\n 'units': 256,\n 'recurrent_regularizer': null,\n 'kernel_initializer': {\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n },\n 'class_name': 'VarianceScaling'\n },\n 'use_bias': true,\n 'bias_constraint': null,\n 'activation': 'tanh',\n 'recurrent_activation': 'hard_sigmoid',\n 'recurrent_dropout': 0.0,\n 'return_state': false,\n 'dropout': 0.0,\n 'batch_input_shape': [null, 10, 393],\n 'activity_regularizer': null,\n 'unit_forget_bias': true\n },\n 'class_name': 'LSTM'\n },\n {\n 'config': {\n 'rate': 0.2,\n 'name': 'dropout_4',\n 'noise_shape': null,\n 'seed': null,\n 'trainable': true\n },\n 'class_name': 'Dropout'\n },\n {\n 'config': {\n 'name': 'dense_4',\n 'trainable': true,\n 'use_bias': true,\n 'bias_constraint': null,\n 'units': 393,\n 'kernel_initializer': {\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n },\n 'class_name': 'VarianceScaling'\n },\n 'activation': 'linear',\n 'bias_regularizer': null,\n 'kernel_constraint': null,\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'activity_regularizer': null,\n 'kernel_regularizer': null\n },\n 'class_name': 'Dense'\n },\n {\n 'config': {\n 'name': 'activation_4',\n 'trainable': true,\n 'activation': 'softmax'\n },\n 'class_name': 'Activation'\n }\n ],\n 'class_name': 'Sequential'\n }\n }\n} */\n\nconst fakeNonSequentialModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'backend': 'tensorflow',\n 'class_name': 'Model',\n 'keras_version': '2.1.1',\n 'config': {\n 'name': 'mnist',\n 'output_layers': [['dense_16', 0, 0]],\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'name': 'input_6',\n 'inbound_nodes': [],\n 'config': {\n 'batch_input_shape': [null, 28, 28, 1],\n 'sparse': false,\n 'name': 'input_6',\n 'dtype': 'float32'\n }\n },\n {\n 'class_name': 'Conv2D',\n 'name': 'conv2d_15',\n 'inbound_nodes': [[['input_6', 0, 0, {}]]],\n 'config': {\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'padding': 'valid',\n 'use_bias': true,\n 'strides': [1, 1],\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'data_format': 'channels_last',\n 'dilation_rate': [1, 1],\n 'kernel_constraint': null,\n 'kernel_regularizer': null,\n 'kernel_size': [3, 3],\n 'activation': 'relu',\n 'name': 'conv2d_15',\n 'filters': 32,\n 'trainable': true,\n 'bias_constraint': null\n }\n },\n {\n 'class_name': 'Conv2D',\n 'name': 'conv2d_16',\n 'inbound_nodes': [[['conv2d_15', 0, 0, {}]]],\n 'config': {\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'padding': 'valid',\n 'use_bias': true,\n 'strides': [1, 1],\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'data_format': 'channels_last',\n 'dilation_rate': [1, 1],\n 'kernel_constraint': null,\n 'kernel_regularizer': null,\n 'kernel_size': [3, 3],\n 'activation': 'relu',\n 'name': 'conv2d_16',\n 'filters': 64,\n 'trainable': true,\n 'bias_constraint': null\n }\n },\n {\n 'class_name': 'MaxPooling2D',\n 'name': 'max_pooling2d_8',\n 'inbound_nodes': [[['conv2d_16', 0, 0, {}]]],\n 'config': {\n 'padding': 'valid',\n 'strides': [2, 2],\n 'pool_size': [2, 2],\n 'data_format': 'channels_last',\n 'name': 'max_pooling2d_8',\n 'trainable': true\n }\n },\n {\n 'class_name': 'Dropout',\n 'name': 'dropout_15',\n 'inbound_nodes': [[['max_pooling2d_8', 0, 0, {}]]],\n 'config': {\n 'rate': 0.25,\n 'noise_shape': null,\n 'name': 'dropout_15',\n 'trainable': true,\n 'seed': null\n }\n },\n {\n 'class_name': 'Flatten',\n 'name': 'flatten_8',\n 'inbound_nodes': [[['dropout_15', 0, 0, {}]]],\n 'config': {'name': 'flatten_8', 'trainable': true}\n },\n {\n 'class_name': 'Dense',\n 'name': 'dense_15',\n 'inbound_nodes': [[['flatten_8', 0, 0, {}]]],\n 'config': {\n 'use_bias': true,\n 'bias_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_constraint': null,\n 'bias_constraint': null,\n 'kernel_regularizer': null,\n 'activation': 'relu',\n 'name': 'dense_15',\n 'activity_regularizer': null,\n 'trainable': true,\n 'units': 128\n }\n },\n {\n 'class_name': 'Dropout',\n 'name': 'dropout_16',\n 'inbound_nodes': [[['dense_15', 0, 0, {}]]],\n 'config': {\n 'rate': 0.5,\n 'noise_shape': null,\n 'name': 'dropout_16',\n 'trainable': true,\n 'seed': null\n }\n },\n {\n 'class_name': 'Dense',\n 'name': 'dense_16',\n 'inbound_nodes': [[['dropout_16', 0, 0, {}]]],\n 'config': {\n 'use_bias': true,\n 'bias_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_constraint': null,\n 'bias_constraint': null,\n 'kernel_regularizer': null,\n 'activation': 'softmax',\n 'name': 'dense_16',\n 'activity_regularizer': null,\n 'trainable': true,\n 'units': 10\n }\n }\n ],\n 'input_layers': [['input_6', 0, 0]]\n }\n }\n};\n\nconst fakeMnistModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'backend': 'tensorflow',\n 'config': [\n {\n 'config': {\n 'kernel_size': [3, 3],\n 'use_bias': true,\n 'batch_input_shape': [null, 28, 28, 1],\n 'filters': 32,\n 'kernel_regularizer': null,\n 'dilation_rate': [1, 1],\n 'strides': [1, 1],\n 'padding': 'valid',\n 'bias_constraint': null,\n 'kernel_constraint': null,\n 'data_format': 'channels_last',\n 'trainable': true,\n 'activation': 'relu',\n 'dtype': 'float32',\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'bias_regularizer': null,\n 'name': 'conv2d_1',\n 'kernel_initializer': {\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null,\n 'distribution': 'uniform'\n },\n 'class_name': 'VarianceScaling'\n },\n 'activity_regularizer': null\n },\n 'class_name': 'Conv2D'\n },\n {\n 'config': {\n 'kernel_size': [3, 3],\n 'use_bias': true,\n 'filters': 64,\n 'kernel_regularizer': null,\n 'dilation_rate': [1, 1],\n 'strides': [1, 1],\n 'padding': 'valid',\n 'bias_constraint': null,\n 'data_format': 'channels_last',\n 'trainable': true,\n 'activation': 'relu',\n 'kernel_constraint': null,\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'bias_regularizer': null,\n 'name': 'conv2d_2',\n 'kernel_initializer': {\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null,\n 'distribution': 'uniform'\n },\n 'class_name': 'VarianceScaling'\n },\n 'activity_regularizer': null\n },\n 'class_name': 'Conv2D'\n },\n {\n 'config': {\n 'strides': [2, 2],\n 'padding': 'valid',\n 'pool_size': [2, 2],\n 'data_format': 'channels_last',\n 'trainable': true,\n 'name': 'max_pooling2d_1'\n },\n 'class_name': 'MaxPooling2D'\n },\n {\n 'config': {\n 'seed': null,\n 'name': 'dropout_1',\n 'trainable': true,\n 'noise_shape': null,\n 'rate': 0.25\n },\n 'class_name': 'Dropout'\n },\n {\n 'config': {'name': 'flatten_1', 'trainable': true},\n 'class_name': 'Flatten'\n },\n {\n 'config': {\n 'use_bias': true,\n 'units': 128,\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'kernel_regularizer': null,\n 'bias_regularizer': null,\n 'trainable': true,\n 'activation': 'relu',\n 'bias_constraint': null,\n 'kernel_constraint': null,\n 'name': 'dense_1',\n 'kernel_initializer': {\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null,\n 'distribution': 'uniform'\n },\n 'class_name': 'VarianceScaling'\n },\n 'activity_regularizer': null\n },\n 'class_name': 'Dense'\n },\n {\n 'config': {\n 'seed': null,\n 'name': 'dropout_2',\n 'trainable': true,\n 'noise_shape': null,\n 'rate': 0.5\n },\n 'class_name': 'Dropout'\n },\n {\n 'config': {\n 'use_bias': true,\n 'units': 10,\n 'bias_initializer': {'config': {}, 'class_name': 'Zeros'},\n 'kernel_regularizer': null,\n 'bias_regularizer': null,\n 'trainable': true,\n 'activation': 'softmax',\n 'bias_constraint': null,\n 'kernel_constraint': null,\n 'name': 'dense_2',\n 'kernel_initializer': {\n 'config': {\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null,\n 'distribution': 'uniform'\n },\n 'class_name': 'VarianceScaling'\n },\n 'activity_regularizer': null\n },\n 'class_name': 'Dense'\n }\n ],\n 'keras_version': '2.1.1',\n 'class_name': 'Sequential'\n }\n};\n\nconst fakeRoundtripModel: ModelAndWeightsConfig = {\n modelTopology: {\n 'backend': 'tensorflow',\n 'class_name': 'Model',\n 'keras_version': '2.1.1',\n 'config': {\n 'name': 'mnist',\n 'output_layers': [['dense_16', 0, 0]],\n 'layers': [\n {\n 'class_name': 'InputLayer',\n 'name': 'input_6',\n 'inbound_nodes': [],\n 'config': {\n 'batch_input_shape': [null, 28, 28, 1],\n 'sparse': false,\n 'name': 'input_6',\n 'dtype': 'float32'\n }\n },\n {\n 'class_name': 'Conv2D',\n 'name': 'conv2d_15',\n 'inbound_nodes': [[['input_6', 0, 0, {}]]],\n 'config': {\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'padding': 'valid',\n 'use_bias': true,\n 'strides': [1, 1],\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'data_format': 'channels_last',\n 'dilation_rate': [1, 1],\n 'kernel_constraint': null,\n 'kernel_regularizer': null,\n 'kernel_size': [3, 3],\n 'activation': 'relu',\n 'name': 'conv2d_15',\n 'filters': 32,\n 'trainable': true,\n 'bias_constraint': null\n }\n },\n {\n 'class_name': 'Conv2D',\n 'name': 'conv2d_16',\n 'inbound_nodes': [[['conv2d_15', 0, 0, {}]]],\n 'config': {\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'padding': 'valid',\n 'use_bias': true,\n 'strides': [1, 1],\n 'bias_regularizer': null,\n 'activity_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'data_format': 'channels_last',\n 'dilation_rate': [1, 1],\n 'kernel_constraint': null,\n 'kernel_regularizer': null,\n 'kernel_size': [3, 3],\n 'activation': 'relu',\n 'name': 'conv2d_16',\n 'filters': 64,\n 'trainable': true,\n 'bias_constraint': null\n }\n },\n {\n 'class_name': 'MaxPooling2D',\n 'name': 'max_pooling2d_8',\n 'inbound_nodes': [[['conv2d_16', 0, 0, {}]]],\n 'config': {\n 'padding': 'valid',\n 'strides': [2, 2],\n 'pool_size': [2, 2],\n 'data_format': 'channels_last',\n 'name': 'max_pooling2d_8',\n 'trainable': true\n }\n },\n {\n 'class_name': 'Dropout',\n 'name': 'dropout_15',\n 'inbound_nodes': [[['max_pooling2d_8', 0, 0, {}]]],\n 'config': {\n 'rate': 0.25,\n 'noise_shape': null,\n 'name': 'dropout_15',\n 'trainable': true,\n 'seed': null\n }\n },\n {\n 'class_name': 'Flatten',\n 'name': 'flatten_8',\n 'inbound_nodes': [[['dropout_15', 0, 0, {}]]],\n 'config': {'name': 'flatten_8', 'trainable': true}\n },\n {\n 'class_name': 'Dense',\n 'name': 'dense_15',\n 'inbound_nodes': [[['flatten_8', 0, 0, {}]]],\n 'config': {\n 'use_bias': true,\n 'bias_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_constraint': null,\n 'bias_constraint': null,\n 'kernel_regularizer': null,\n 'activation': 'relu',\n 'name': 'dense_15',\n 'activity_regularizer': null,\n 'trainable': true,\n 'units': 128\n }\n },\n {\n 'class_name': 'Dropout',\n 'name': 'dropout_16',\n 'inbound_nodes': [[['dense_15', 0, 0, {}]]],\n 'config': {\n 'rate': 0.5,\n 'noise_shape': null,\n 'name': 'dropout_16',\n 'trainable': true,\n 'seed': null\n }\n },\n {\n 'class_name': 'Dense',\n 'name': 'dense_16',\n 'inbound_nodes': [[['dropout_16', 0, 0, {}]]],\n 'config': {\n 'use_bias': true,\n 'bias_regularizer': null,\n 'kernel_initializer': {\n 'class_name': 'VarianceScaling',\n 'config': {\n 'distribution': 'uniform',\n 'scale': 1.0,\n 'mode': 'fan_avg',\n 'seed': null\n }\n },\n 'bias_initializer': {'class_name': 'Zeros', 'config': {}},\n 'kernel_constraint': null,\n 'bias_constraint': null,\n 'kernel_regularizer': null,\n 'activation': 'softmax',\n 'name': 'dense_16',\n 'activity_regularizer': null,\n 'trainable': true,\n 'units': 10\n }\n }\n ],\n 'input_layers': [['input_6', 0, 0]]\n }\n }\n};\n\ndescribeMathCPU('Functional-model saving and loading', () => {\n it('Save-load round trip: multi-node layer', async () => {\n const input1 = tfl.input({shape: [2, 3]});\n const input2 = tfl.input({shape: [3, 2]});\n\n const reshape = tfl.layers.reshape({targetShape: [6]});\n const output1 = reshape.apply(input1) as tfl.SymbolicTensor;\n const output2 = reshape.apply(input2) as tfl.SymbolicTensor;\n\n const model1 =\n tfl.model({inputs: [input1, input2], outputs: [output1, output2]});\n\n const model1JSON = model1.toJSON(null, false) as PyJsonDict;\n const model2 = await modelFromJSON({modelTopology: model1JSON});\n\n expect(model2.inputs.length).toEqual(model1.inputs.length);\n expect(model2.inputs[0].shape).toEqual(model1.inputs[0].shape);\n expect(model2.inputs[1].shape).toEqual(model1.inputs[1].shape);\n expect(model2.outputs.length).toEqual(model1.outputs.length);\n expect(model2.outputs[0].shape).toEqual(model1.outputs[0].shape);\n expect(model2.outputs[1].shape).toEqual(model1.outputs[1].shape);\n expect(model2.toJSON(null, false)).toEqual(model1JSON);\n\n const x1 = randomNormal([1, 2, 3]);\n const x2 = randomNormal([1, 3, 2]);\n const ys1 = model1.apply([x1, x2]) as Tensor[];\n\n const ys2 = model2.apply([x1, x2]) as Tensor[];\n\n expectTensorsClose(ys1[0], ys2[0]);\n expectTensorsClose(ys1[1], ys2[1]);\n });\n\n it('Save-load round trip: layer with loopy invocation', async () => {\n const input = tfl.layers.input({shape: [1]});\n const dense = tfl.layers.dense(\n {units: 1, kernelInitializer: 'ones', biasInitializer: 'ones'});\n let output = dense.apply(input) as tfl.SymbolicTensor;\n for (let i = 0; i < 3; ++i) {\n output = dense.apply(output) as tfl.SymbolicTensor;\n }\n const model1 = tfl.model({inputs: input, outputs: output});\n\n const xs = ones([10, 1]);\n const ys1 = model1.predict(xs) as Tensor;\n\n const model1JSON = model1.toJSON(null, false) as PyJsonDict;\n const model2 = await modelFromJSON({modelTopology: model1JSON});\n expect(model2.toJSON(null, false)).toEqual(model1JSON);\n\n const ys2 = model2.predict(xs) as Tensor;\n expectTensorsClose(ys1, ys2);\n });\n\n it('Deserialization with truncated_normal', async () => {\n // From https://github.com/tensorflow/tfjs/issues/146\n const modelJSON = JSON.parse(\n // tslint:disable-next-line:max-line-length\n `{\"modelTopology\":{\"class_name\":\"Sequential\",\"config\":[{\"class_name\":\"Dense\",\"config\":{\"units\":1,\"activation\":\"linear\",\"use_bias\":true,\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"scale\":1,\"mode\":\"fan_avg\",\"distribution\":\"truncated_normal\",\"seed\":null}},\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}},\"kernel_regularizer\":null,\"bias_regularizer\":null,\"activity_regularizer\":null,\"kernel_constraint\":null,\"bias_constraint\":null,\"name\":\"dense_Dense1\",\"trainable\":true,\"batch_input_shape\":[null,1],\"dtype\":\"float32\"}}],\"keras_version\":\"tfjs-layers 1.0.2\",\"backend\":\"tensor_flow.js\"},\"weightsManifest\":[{\"paths\":[\"weights.bin\"],\"weights\":[{\"name\":\"dense_Dense1/kernel\",\"shape\":[1,1],\"dtype\":\"float32\"},{\"name\":\"dense_Dense1/bias\",\"shape\":[1],\"dtype\":\"float32\"}]}]}`);\n const modelTopology = modelJSON.modelTopology;\n expect(() => modelFromJSON({modelTopology})).not.toThrow();\n });\n\n it('Load attention model', async () => {\n // From https://github.com/tensorflow/tfjs/issues/794\n const modelJSON = JSON.parse(\n // tslint:disable-next-line:max-line-length\n `{\"modelTopology\":{\"keras_version\":\"2.1.6\",\"backend\":\"tensorflow\",\"model_config\":{\"class_name\":\"Model\",\"config\":{\"input_layers\":[[\"input_1\",0,0],[\"s0\",0,0],[\"c0\",0,0]],\"name\":\"model_1\",\"layers\":[{\"class_name\":\"InputLayer\",\"inbound_nodes\":[],\"name\":\"input_1\",\"config\":{\"dtype\":\"float32\",\"name\":\"input_1\",\"sparse\":false,\"batch_input_shape\":[null,30,38]}},{\"class_name\":\"InputLayer\",\"inbound_nodes\":[],\"name\":\"s0\",\"config\":{\"dtype\":\"float32\",\"name\":\"s0\",\"sparse\":false,\"batch_input_shape\":[null,64]}},{\"class_name\":\"Bidirectional\",\"inbound_nodes\":[[[\"input_1\",0,0,{}]]],\"name\":\"bidirectional_1\",\"config\":{\"trainable\":true,\"name\":\"bidirectional_1\",\"merge_mode\":\"concat\",\"layer\":{\"class_name\":\"LSTM\",\"config\":{\"stateful\":false,\"units\":32,\"activation\":\"tanh\",\"recurrent_activation\":\"hard_sigmoid\",\"dropout\":0,\"recurrent_dropout\":0,\"use_bias\":true,\"trainable\":true,\"recurrent_initializer\":{\"class_name\":\"Orthogonal\",\"config\":{\"seed\":null,\"gain\":1}},\"bias_constraint\":null,\"unroll\":false,\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"seed\":null,\"distribution\":\"uniform\",\"mode\":\"fan_avg\",\"scale\":1}},\"unit_forget_bias\":true,\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}},\"kernel_constraint\":null,\"activity_regularizer\":null,\"return_sequences\":true,\"recurrent_constraint\":null,\"recurrent_regularizer\":null,\"bias_regularizer\":null,\"go_backwards\":false,\"implementation\":1,\"name\":\"lstm_2\",\"kernel_regularizer\":null,\"return_state\":false}}}},{\"class_name\":\"RepeatVector\",\"inbound_nodes\":[[[\"s0\",0,0,{}]],[[\"lstm_1\",0,0,{}]],[[\"lstm_1\",1,0,{}]],[[\"lstm_1\",2,0,{}]],[[\"lstm_1\",3,0,{}]],[[\"lstm_1\",4,0,{}]],[[\"lstm_1\",5,0,{}]],[[\"lstm_1\",6,0,{}]],[[\"lstm_1\",7,0,{}]],[[\"lstm_1\",8,0,{}]]],\"name\":\"repeat_vector_1\",\"config\":{\"n\":30,\"trainable\":true,\"name\":\"repeat_vector_1\"}},{\"class_name\":\"Concatenate\",\"inbound_nodes\":[[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",0,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",1,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",2,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",3,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",4,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",5,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",6,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",7,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",8,0,{}]],[[\"bidirectional_1\",0,0,{}],[\"repeat_vector_1\",9,0,{}]]],\"name\":\"concatenate_1\",\"config\":{\"trainable\":true,\"name\":\"concatenate_1\",\"axis\":-1}},{\"class_name\":\"Dense\",\"inbound_nodes\":[[[\"concatenate_1\",0,0,{}]],[[\"concatenate_1\",1,0,{}]],[[\"concatenate_1\",2,0,{}]],[[\"concatenate_1\",3,0,{}]],[[\"concatenate_1\",4,0,{}]],[[\"concatenate_1\",5,0,{}]],[[\"concatenate_1\",6,0,{}]],[[\"concatenate_1\",7,0,{}]],[[\"concatenate_1\",8,0,{}]],[[\"concatenate_1\",9,0,{}]]],\"name\":\"dense_1\",\"config\":{\"bias_constraint\":null,\"kernel_constraint\":null,\"units\":10,\"activity_regularizer\":null,\"use_bias\":true,\"bias_regularizer\":null,\"trainable\":true,\"activation\":\"tanh\",\"name\":\"dense_1\",\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"seed\":null,\"distribution\":\"uniform\",\"mode\":\"fan_avg\",\"scale\":1}},\"kernel_regularizer\":null,\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}}}},{\"class_name\":\"Dense\",\"inbound_nodes\":[[[\"dense_1\",0,0,{}]],[[\"dense_1\",1,0,{}]],[[\"dense_1\",2,0,{}]],[[\"dense_1\",3,0,{}]],[[\"dense_1\",4,0,{}]],[[\"dense_1\",5,0,{}]],[[\"dense_1\",6,0,{}]],[[\"dense_1\",7,0,{}]],[[\"dense_1\",8,0,{}]],[[\"dense_1\",9,0,{}]]],\"name\":\"dense_2\",\"config\":{\"bias_constraint\":null,\"kernel_constraint\":null,\"units\":1,\"activity_regularizer\":null,\"use_bias\":true,\"bias_regularizer\":null,\"trainable\":true,\"activation\":\"relu\",\"name\":\"dense_2\",\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"seed\":null,\"distribution\":\"uniform\",\"mode\":\"fan_avg\",\"scale\":1}},\"kernel_regularizer\":null,\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}}}},{\"class_name\":\"Activation\",\"inbound_nodes\":[[[\"dense_2\",0,0,{}]],[[\"dense_2\",1,0,{}]],[[\"dense_2\",2,0,{}]],[[\"dense_2\",3,0,{}]],[[\"dense_2\",4,0,{}]],[[\"dense_2\",5,0,{}]],[[\"dense_2\",6,0,{}]],[[\"dense_2\",7,0,{}]],[[\"dense_2\",8,0,{}]],[[\"dense_2\",9,0,{}]]],\"name\":\"attention_weights\",\"config\":{\"trainable\":true,\"activation\":\"softmax\",\"name\":\"attention_weights\"}},{\"class_name\":\"Dot\",\"inbound_nodes\":[[[\"attention_weights\",0,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",1,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",2,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",3,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",4,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",5,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",6,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",7,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",8,0,{}],[\"bidirectional_1\",0,0,{}]],[[\"attention_weights\",9,0,{}],[\"bidirectional_1\",0,0,{}]]],\"name\":\"dot_1\",\"config\":{\"trainable\":true,\"name\":\"dot_1\",\"normalize\":false,\"axes\":1}},{\"class_name\":\"InputLayer\",\"inbound_nodes\":[],\"name\":\"c0\",\"config\":{\"dtype\":\"float32\",\"name\":\"c0\",\"sparse\":false,\"batch_input_shape\":[null,64]}},{\"class_name\":\"LSTM\",\"inbound_nodes\":[[[\"dot_1\",0,0,{}],[\"s0\",0,0,{}],[\"c0\",0,0,{}]],[[\"dot_1\",1,0,{}],[\"lstm_1\",0,0,{}],[\"lstm_1\",0,2,{}]],[[\"dot_1\",2,0,{}],[\"lstm_1\",1,0,{}],[\"lstm_1\",1,2,{}]],[[\"dot_1\",3,0,{}],[\"lstm_1\",2,0,{}],[\"lstm_1\",2,2,{}]],[[\"dot_1\",4,0,{}],[\"lstm_1\",3,0,{}],[\"lstm_1\",3,2,{}]],[[\"dot_1\",5,0,{}],[\"lstm_1\",4,0,{}],[\"lstm_1\",4,2,{}]],[[\"dot_1\",6,0,{}],[\"lstm_1\",5,0,{}],[\"lstm_1\",5,2,{}]],[[\"dot_1\",7,0,{}],[\"lstm_1\",6,0,{}],[\"lstm_1\",6,2,{}]],[[\"dot_1\",8,0,{}],[\"lstm_1\",7,0,{}],[\"lstm_1\",7,2,{}]],[[\"dot_1\",9,0,{}],[\"lstm_1\",8,0,{}],[\"lstm_1\",8,2,{}]]],\"name\":\"lstm_1\",\"config\":{\"stateful\":false,\"units\":64,\"activation\":\"tanh\",\"recurrent_activation\":\"hard_sigmoid\",\"dropout\":0,\"recurrent_dropout\":0,\"use_bias\":true,\"trainable\":true,\"recurrent_initializer\":{\"class_name\":\"Orthogonal\",\"config\":{\"seed\":null,\"gain\":1}},\"bias_constraint\":null,\"unroll\":false,\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"seed\":null,\"distribution\":\"uniform\",\"mode\":\"fan_avg\",\"scale\":1}},\"unit_forget_bias\":true,\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}},\"kernel_constraint\":null,\"activity_regularizer\":null,\"return_sequences\":false,\"recurrent_constraint\":null,\"recurrent_regularizer\":null,\"bias_regularizer\":null,\"go_backwards\":false,\"implementation\":1,\"name\":\"lstm_1\",\"kernel_regularizer\":null,\"return_state\":true}},{\"class_name\":\"Dense\",\"inbound_nodes\":[[[\"lstm_1\",0,0,{}]],[[\"lstm_1\",1,0,{}]],[[\"lstm_1\",2,0,{}]],[[\"lstm_1\",3,0,{}]],[[\"lstm_1\",4,0,{}]],[[\"lstm_1\",5,0,{}]],[[\"lstm_1\",6,0,{}]],[[\"lstm_1\",7,0,{}]],[[\"lstm_1\",8,0,{}]],[[\"lstm_1\",9,0,{}]]],\"name\":\"dense_3\",\"config\":{\"bias_constraint\":null,\"kernel_constraint\":null,\"units\":11,\"activity_regularizer\":null,\"use_bias\":true,\"bias_regularizer\":null,\"trainable\":true,\"activation\":\"softmax\",\"name\":\"dense_3\",\"kernel_initializer\":{\"class_name\":\"VarianceScaling\",\"config\":{\"seed\":null,\"distribution\":\"uniform\",\"mode\":\"fan_avg\",\"scale\":1}},\"kernel_regularizer\":null,\"bias_initializer\":{\"class_name\":\"Zeros\",\"config\":{}}}}],\"output_layers\":[[\"dense_3\",0,0],[\"dense_3\",1,0],[\"dense_3\",2,0],[\"dense_3\",3,0],[\"dense_3\",4,0],[\"dense_3\",5,0],[\"dense_3\",6,0],[\"dense_3\",7,0],[\"dense_3\",8,0],[\"dense_3\",9,0]]}},\"training_config\":{\"loss\":\"categorical_crossentropy\",\"sample_weight_mode\":null,\"metrics\":[\"accuracy\"],\"optimizer_config\":{\"class_name\":\"Adam\",\"config\":{\"beta_1\":0.8999999761581421,\"decay\":0.009999999776482582,\"beta_2\":0.9990000128746033,\"lr\":0.004999999888241291,\"amsgrad\":false,\"epsilon\":1e-7}},\"loss_weights\":null}},\"weightsManifest\":[{\"paths\":[\"group1-shard1of1\"],\"weights\":[{\"shape\":[38,128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/forward_lstm_2/kernel\"},{\"shape\":[32,128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/forward_lstm_2/recurrent_kernel\"},{\"shape\":[128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/forward_lstm_2/bias\"},{\"shape\":[38,128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/backward_lstm_2/kernel\"},{\"shape\":[32,128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/backward_lstm_2/recurrent_kernel\"},{\"shape\":[128],\"dtype\":\"float32\",\"name\":\"bidirectional_1/backward_lstm_2/bias\"},{\"shape\":[128,10],\"dtype\":\"float32\",\"name\":\"dense_1/kernel\"},{\"shape\":[10],\"dtype\":\"float32\",\"name\":\"dense_1/bias\"},{\"shape\":[10,1],\"dtype\":\"float32\",\"name\":\"dense_2/kernel\"},{\"shape\":[1],\"dtype\":\"float32\",\"name\":\"dense_2/bias\"},{\"shape\":[64,11],\"dtype\":\"float32\",\"name\":\"dense_3/kernel\"},{\"shape\":[11],\"dtype\":\"float32\",\"name\":\"dense_3/bias\"},{\"shape\":[64,256],\"dtype\":\"float32\",\"name\":\"lstm_1/kernel\"},{\"shape\":[64,256],\"dtype\":\"float32\",\"name\":\"lstm_1/recurrent_kernel\"},{\"shape\":[256],\"dtype\":\"float32\",\"name\":\"lstm_1/bias\"}]}]}`);\n const modelTopology = modelJSON.modelTopology;\n const model = await modelFromJSON({modelTopology});\n\n expect(model.inputs.length).toEqual(3);\n expect(model.inputs[0].shape).toEqual([null, 30, 38]);\n expect(model.inputs[1].shape).toEqual([null, 64]);\n expect(model.inputs[2].shape).toEqual([null, 64]);\n expect(model.outputs.length).toEqual(10);\n for (const output of model.outputs) {\n expect(output.shape).toEqual([null, 11]);\n }\n expect(convertTsToPythonic(model.getConfig()))\n .toEqual(modelTopology['model_config']['config']);\n\n const x = randomNormal([2, 30, 38]);\n const s = randomNormal([2, 64]);\n const c = randomNormal([2, 64]);\n const output = model.predict([x, s, c]) as Tensor[];\n expect(output.length).toEqual(10);\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-layers/dist/optimizers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts deleted file mode 100644 index 65e3d91d0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Optimizers. - */ -import { Optimizer } from '@tensorflow/tfjs-core'; -export declare function getOptimizer(identifier: string): Optimizer; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js deleted file mode 100644 index bae88f987..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Optimizers. - */ -import { train } from '@tensorflow/tfjs-core'; -import { epsilon } from './backend/common'; -import { ValueError } from './errors'; -// Add (de)serialize() -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -export function getOptimizer(identifier) { - const optimizerMap = { - 'Adagrad': () => train.adagrad(0.01), - 'Adadelta': () => train.adadelta(1, 0.95, epsilon()), - 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()), - 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0), - 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()), - 'SGD': () => train.sgd(0.01) - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError(`Unknown Optimizer ${identifier}`); -} -//# sourceMappingURL=optimizers.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-layers/dist/optimizers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map deleted file mode 100644 index d071849dd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optimizers.js","sourceRoot":"","sources":["../src/optimizers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAY,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,sBAAsB;AAEtB,8EAA8E;AAC9E,kDAAkD;AAClD,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,MAAM,YAAY,GAA+C;QAC/D,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACpD,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACtD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QAC7D,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;QACxD,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;KAC7B,CAAC;IACF,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACpD,YAAY,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChD,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,YAAY,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,UAAU,IAAI,YAAY,EAAE;QAC9B,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;KACnC;IACD,MAAM,IAAI,UAAU,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\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-layers/dist/optimizers_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map deleted file mode 100644 index 09702cb38..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optimizers_test.js","sourceRoot":"","sources":["../src/optimizers_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAE1I,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAEnD,eAAe,CAAC,cAAc,EAAE,GAAG,EAAE;IACnC,wEAAwE;IAExE,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC7B,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,CAAC,SAAS,YAAY,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qBAAqB,EAAE,GAAG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license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for optimizers.ts.\n */\n\nimport {AdadeltaOptimizer, AdagradOptimizer, AdamaxOptimizer, AdamOptimizer, RMSPropOptimizer, SGDOptimizer} from '@tensorflow/tfjs-core';\n\nimport {getOptimizer} from './optimizers';\nimport {describeMathCPU} from './utils/test_utils';\n\ndescribeMathCPU('getOptimizer', () => {\n // TODO(nsthorat): Assert defaults by getting config from the optimizer.\n\n it(`can instantiate SGD`, () => {\n const optimizer = getOptimizer('SGD');\n expect(optimizer instanceof SGDOptimizer).toBe(true);\n });\n it(`can instantiate sgd`, () => {\n const optimizer = getOptimizer('sgd');\n expect(optimizer instanceof SGDOptimizer).toBe(true);\n });\n it(`can instantiate Adam`, () => {\n const optimizer = getOptimizer('Adam');\n expect(optimizer instanceof AdamOptimizer).toBe(true);\n });\n it(`can instantiate adam`, () => {\n const optimizer = getOptimizer('adam');\n expect(optimizer instanceof AdamOptimizer).toBe(true);\n });\n it(`can instantiate RMSProp`, () => {\n const optimizer = getOptimizer('RMSProp');\n expect(optimizer instanceof RMSPropOptimizer).toBe(true);\n });\n it(`can instantiate rmsprop`, () => {\n const optimizer = getOptimizer('rmsprop');\n expect(optimizer instanceof RMSPropOptimizer).toBe(true);\n });\n it(`can instantiate Adagrad`, () => {\n const optimizer = getOptimizer('Adagrad');\n expect(optimizer instanceof AdagradOptimizer).toBe(true);\n });\n it(`can instantiate adagrad`, () => {\n const optimizer = getOptimizer('adagrad');\n expect(optimizer instanceof AdagradOptimizer).toBe(true);\n });\n it(`can instantiate Adadelta`, () => {\n const optimizer = getOptimizer('Adadelta');\n expect(optimizer instanceof AdadeltaOptimizer).toBe(true);\n });\n it(`can instantiate adadelta`, () => {\n const optimizer = getOptimizer('adadelta');\n expect(optimizer instanceof AdadeltaOptimizer).toBe(true);\n });\n it(`can instantiate Adamax`, () => {\n const optimizer = getOptimizer('Adamax');\n expect(optimizer instanceof AdamaxOptimizer).toBe(true);\n });\n it(`can instantiate adamax`, () => {\n const optimizer = getOptimizer('adamax');\n expect(optimizer instanceof AdamaxOptimizer).toBe(true);\n });\n it('throws for non-existent optimizer', () => {\n expect(() => getOptimizer('not an optimizer'))\n .toThrowError(/Unknown Optimizer/);\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-layers/dist/regularizers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts deleted file mode 100644 index f747568c5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; -/** - * Regularizer base class. - */ -export declare abstract class Regularizer extends serialization.Serializable { - abstract apply(x: Tensor): Scalar; -} -export interface L1L2Args { - /** L1 regularization rate. Defaults to 0.01. */ - l1?: number; - /** L2 regularization rate. Defaults to 0.01. */ - l2?: number; -} -export interface L1Args { - /** L1 regularization rate. Defaults to 0.01. */ - l1: number; -} -export interface L2Args { - /** L2 regularization rate. Defaults to 0.01. */ - l2: number; -} -export declare class L1L2 extends Regularizer { - /** @nocollapse */ - static className: string; - private readonly l1; - private readonly l2; - private readonly hasL1; - private readonly hasL2; - constructor(args?: L1L2Args); - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - apply(x: Tensor): Scalar; - getConfig(): serialization.ConfigDict; - /** @nocollapse */ - static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; -} -export declare function l1(args?: L1Args): L1L2; -export declare function l2(args: L2Args): L1L2; -/** @docinline */ -export declare type RegularizerIdentifier = 'l1l2' | string; -export declare const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: { - [identifier in RegularizerIdentifier]: string; -}; -export declare function serializeRegularizer(constraint: Regularizer): serialization.ConfigDictValue; -export declare function deserializeRegularizer(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Regularizer; -export declare function getRegularizer(identifier: RegularizerIdentifier | serialization.ConfigDict | Regularizer): Regularizer; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js deleted file mode 100644 index 208b01480..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* original source: keras/regularizers.py */ -import * as tfc from '@tensorflow/tfjs-core'; -import { abs, add, serialization, sum, tidy, zeros } from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import { deserializeKerasObject, serializeKerasObject } from './utils/generic_utils'; -function assertObjectArgs(args) { - if (args != null && typeof args !== 'object') { - throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an ` + - `object, but received: ${args}`); - } -} -/** - * Regularizer base class. - */ -export class Regularizer extends serialization.Serializable { -} -export class L1L2 extends Regularizer { - constructor(args) { - super(); - assertObjectArgs(args); - this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - this.hasL1 = this.l1 !== 0; - this.hasL2 = this.l2 !== 0; - } - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - apply(x) { - return tidy(() => { - let regularization = zeros([1]); - if (this.hasL1) { - regularization = add(regularization, sum(tfc.mul(this.l1, abs(x)))); - } - if (this.hasL2) { - regularization = - add(regularization, sum(tfc.mul(this.l2, K.square(x)))); - } - return regularization.asScalar(); - }); - } - getConfig() { - return { 'l1': this.l1, 'l2': this.l2 }; - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls({ l1: config['l1'], l2: config['l2'] }); - } -} -/** @nocollapse */ -L1L2.className = 'L1L2'; -serialization.registerClass(L1L2); -export function l1(args) { - assertObjectArgs(args); - return new L1L2({ l1: args != null ? args.l1 : null, l2: 0 }); -} -export function l2(args) { - assertObjectArgs(args); - return new L1L2({ l2: args != null ? args.l2 : null, l1: 0 }); -} -// Maps the JavaScript-like identifier keys to the corresponding keras symbols. -export const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'l1l2': 'L1L2' -}; -export function serializeRegularizer(constraint) { - return serializeKerasObject(constraint); -} -export function deserializeRegularizer(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); -} -export function getRegularizer(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeRegularizer(config); - } - else if (identifier instanceof Regularizer) { - return identifier; - } - else { - return deserializeRegularizer(identifier); - } -} -//# sourceMappingURL=regularizers.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-layers/dist/regularizers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map deleted file mode 100644 index 22c336ee7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regularizers.js","sourceRoot":"","sources":["../src/regularizers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4CAA4C;AAE5C,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,GAAG,EAAE,GAAG,EAAU,aAAa,EAAE,GAAG,EAAU,IAAI,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAEnF,SAAS,gBAAgB,CAAC,IAAgC;IACxD,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5C,MAAM,IAAI,KAAK,CACX,kEAAkE;YAClE,yBAAyB,IAAI,EAAE,CAAC,CAAC;KACtC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,OAAgB,WAAY,SAAQ,aAAa,CAAC,YAAY;CAEnE;AAmBD,MAAM,OAAO,IAAK,SAAQ,WAAW;IAQnC,YAAY,IAAe;QACzB,KAAK,EAAE,CAAC;QAER,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEvB,IAAI,CAAC,EAAE,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3D,IAAI,CAAC,EAAE,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,KA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U,CAAC;KACnB;SAAM;QACL,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;KAC3C;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\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-layers/dist/regularizers_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map deleted file mode 100644 index f00f9e89f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regularizers_test.js","sourceRoot":"","sources":["../src/regularizers_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gCAAgC;AAEhC,OAAO,EAAC,MAAM,EAAyB,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,sBAAsB,EAAE,cAAc,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAEvE,eAAe,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACf,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,kBAAkB,CACd,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAA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D,MAAM,MAAM,GACR,oBAAoB,CAAC,WAAW,CAA6B,CAAC;QAClE,MAAM,aAAa,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,eAAe,GACjB,oBAAoB,CAAC,aAAa,CAA6B,CAAC;QACpE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,YAAY,GAAG,eAAe,CAAC,MAAkC,CAAC;QACxE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Unit tests for constraints */\n\nimport {scalar, serialization, Tensor, tensor1d} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport {deserializeRegularizer, getRegularizer, serializeRegularizer} from './regularizers';\nimport {describeMathCPU, expectTensorsClose} from './utils/test_utils';\n\ndescribeMathCPU('Built-in Regularizers', () => {\n it('l1_l2', () => {\n const x = tensor1d([1, -2, 3, -4]);\n const regularizer = tfl.regularizers.l1l2();\n const score = regularizer.apply(x);\n expectTensorsClose(\n score, scalar(0.01 * (1 + 2 + 3 + 4) + 0.01 * (1 + 4 + 9 + 16)));\n });\n it('l1', () => {\n const x = tensor1d([1, -2, 3, -4]);\n const regularizer = tfl.regularizers.l1();\n const score = regularizer.apply(x);\n expectTensorsClose(score, scalar(0.01 * (1 + 2 + 3 + 4)));\n });\n it('l2', () => {\n const x = tensor1d([1, -2, 3, -4]);\n const regularizer = tfl.regularizers.l2();\n const score = regularizer.apply(x);\n expectTensorsClose(score, scalar(0.01 * (1 + 4 + 9 + 16)));\n });\n it('l1_l2 non default', () => {\n const x = tensor1d([1, -2, 3, -4]);\n const regularizer = tfl.regularizers.l1l2({l1: 1, l2: 2});\n const score = regularizer.apply(x);\n expectTensorsClose(\n score, scalar(1 * (1 + 2 + 3 + 4) + 2 * (1 + 4 + 9 + 16)));\n });\n it('Using number arg for constructor leads to error', () => {\n // tslint:disable-next-line:no-any\n expect(() => tfl.regularizers.l1(0.001 as any))\n .toThrowError(/expected.*object.*received.*0\\.001/);\n // tslint:disable-next-line:no-any\n expect(() => tfl.regularizers.l2(0.001 as any))\n .toThrowError(/expected.*object.*received.*0\\.001/);\n // tslint:disable-next-line:no-any\n expect(() => tfl.regularizers.l1l2(0.001 as any))\n .toThrowError(/expected.*object.*received.*0\\.001/);\n });\n});\n\ndescribeMathCPU('regularizers.get', () => {\n let x: Tensor;\n beforeEach(() => {\n x = tensor1d([1, -2, 3, -4]);\n });\n\n it('by string - lower camel', () => {\n const regularizer = getRegularizer('l1l2');\n expectTensorsClose(regularizer.apply(x), tfl.regularizers.l1l2().apply(x));\n });\n it('by string - upper camel', () => {\n const regularizer = getRegularizer('L1L2');\n expectTensorsClose(regularizer.apply(x), tfl.regularizers.l1l2().apply(x));\n });\n\n it('by existing object', () => {\n const origReg = tfl.regularizers.l1l2({l1: 1, l2: 2});\n const regularizer = getRegularizer(origReg);\n expect(regularizer).toEqual(origReg);\n });\n it('by config dict', () => {\n const origReg = tfl.regularizers.l1l2({l1: 1, l2: 2});\n const regularizer = getRegularizer(\n serializeRegularizer(origReg) as serialization.ConfigDict);\n expectTensorsClose(regularizer.apply(x), origReg.apply(x));\n });\n});\n\ndescribeMathCPU('Regularizer Serialization', () => {\n it('Built-ins', () => {\n const regularizer = tfl.regularizers.l1l2({l1: 1, l2: 2});\n const config =\n serializeRegularizer(regularizer) as serialization.ConfigDict;\n const reconstituted = deserializeRegularizer(config);\n const roundTripConfig =\n serializeRegularizer(reconstituted) as serialization.ConfigDict;\n expect(roundTripConfig.className).toEqual('L1L2');\n const nestedConfig = roundTripConfig.config as serialization.ConfigDict;\n expect(nestedConfig.l1).toEqual(1);\n expect(nestedConfig.l2).toEqual(2);\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-layers/dist/setup_tests.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.d.ts deleted file mode 100644 index 6bd8921a3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.d.ts +++ /dev/null @@ -1,21 +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 '@tensorflow/tfjs-core'; -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -import '@tensorflow/tfjs-backend-cpu'; -import '@tensorflow/tfjs-backend-webgl'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js deleted file mode 100644 index 1eee130e6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js +++ /dev/null @@ -1,24 +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 '@tensorflow/tfjs-core'; -// tslint:disable-next-line:no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -import '@tensorflow/tfjs-backend-cpu'; -import '@tensorflow/tfjs-backend-webgl'; -//# sourceMappingURL=setup_tests.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-layers/dist/setup_tests.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js.map deleted file mode 100644 index fd5664f7d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/setup_tests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setup_tests.js","sourceRoot":"","sources":["../src/setup_tests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,gDAAgD;AAChD,OAAO,wEAAwE,CAAC;AAChF,iDAAiD;AACjD,OAAO,mDAAmD,CAAC;AAE3D,OAAO,8BAA8B,CAAC;AACtC,OAAO,gCAAgC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2020 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-core';\n// tslint:disable-next-line:no-imports-from-dist\nimport '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops';\n// tslint:disable-next-line: no-imports-from-dist\nimport '@tensorflow/tfjs-core/dist/register_all_gradients';\n\nimport '@tensorflow/tfjs-backend-cpu';\nimport '@tensorflow/tfjs-backend-webgl';\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js deleted file mode 100644 index d07bf618a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js +++ /dev/null @@ -1,35464 +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)); -}(this, (function (exports, tfc) { 'use strict'; - - /** - * @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. - * ============================================================================= - */ - const EPSILON_FLOAT32 = 1e-7; - const EPSILON_FLOAT16 = 1e-4; - /** - * The interface that defines the kernels that should be implemented when - * adding a new backend. New backends don't need to implement every one of the - * methods, this can be done gradually (throw an error for unimplemented - * methods). - */ - class KernelBackend { - refCount(dataId) { - return notYetImplemented('refCount'); - } - incRef(dataId) { - return notYetImplemented('incRef'); - } - timerAvailable() { - return true; - } - time(f) { - return notYetImplemented('time'); - } - read(dataId) { - return notYetImplemented('read'); - } - readSync(dataId) { - return notYetImplemented('readSync'); - } - numDataIds() { - return notYetImplemented('numDataIds'); - } - disposeData(dataId, force) { - return notYetImplemented('disposeData'); - } - write(values, shape, dtype) { - return notYetImplemented('write'); - } - move(dataId, values, shape, dtype, refCount) { - return notYetImplemented('move'); - } - memory() { - return notYetImplemented('memory'); - } - /** Returns the highest precision for floats in bits (e.g. 16 or 32) */ - floatPrecision() { - return notYetImplemented('floatPrecision'); - } - /** Returns the smallest representable number. */ - epsilon() { - return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16; - } - dispose() { - return notYetImplemented('dispose'); - } - } - function notYetImplemented(kernelName) { - throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` + - `This kernel may not be supported by the tfjs backend you have chosen`); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Asserts that the expression is true. Otherwise throws an error with the - * provided message. - * - * ```js - * const x = 2; - * tf.util.assert(x === 2, 'x is not 2'); - * ``` - * - * @param expr The expression to assert (as a boolean). - * @param msg A function that returns the message to report when throwing an - * error. We use a function for performance reasons. - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function assert(expr, msg) { - if (!expr) { - throw new Error(typeof msg === 'string' ? msg : msg()); - } - } - function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') { - assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); - } - // NOTE: We explicitly type out what T extends instead of any so that - // util.flatten on a nested array of number doesn't try to infer T as a - // number[][], causing us to explicitly type util.flatten(). - /** - * Flattens an arbitrarily nested array. - * - * ```js - * const a = [[1, 2], [3, 4], [5, [6, [7]]]]; - * const flat = tf.util.flatten(a); - * console.log(flat); - * ``` - * - * @param arr The nested array to flatten. - * @param result The destination array which holds the elements. - * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults - * to false. - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function flatten(arr, result = [], skipTypedArray = false) { - if (result == null) { - result = []; - } - if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) { - for (let i = 0; i < arr.length; ++i) { - flatten(arr[i], result, skipTypedArray); - } - } - else { - result.push(arr); - } - return result; - } - /** - * Returns the size (number of elements) of the tensor given its shape. - * - * ```js - * const shape = [3, 4, 2]; - * const size = tf.util.sizeFromShape(shape); - * console.log(size); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function sizeFromShape(shape) { - if (shape.length === 0) { - // Scalar. - return 1; - } - let size = shape[0]; - for (let i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; - } - function arraysEqual(n1, n2) { - if (n1 === n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - if (n1.length !== n2.length) { - return false; - } - for (let i = 0; i < n1.length; i++) { - if (n1[i] !== n2[i]) { - return false; - } - } - return true; - } - function isInt(a) { - return a % 1 === 0; - } - function rightPad(a, size) { - if (size <= a.length) { - return a; - } - return a + ' '.repeat(size - a.length); - } - function parseAxisParam(axis, shape) { - const rank = shape.length; - // Normalize input - axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); - // Check for valid range - assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + - `got axis ${axis}`); - // Check for only integers - assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` + - `got axis ${axis}`); - // Handle negative axis. - return axis.map(a => a < 0 ? rank + a : a); - } - /** Reduces the shape by removing all dimensions of shape 1. */ - function squeezeShape(shape, axis) { - const newShape = []; - const keptDims = []; - const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; - const axes = (axis == null || isEmptyArray) ? - null : - parseAxisParam(axis, shape).sort(); - let j = 0; - for (let i = 0; i < shape.length; ++i) { - if (axes != null) { - if (axes[j] === i && shape[i] !== 1) { - throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); - } - if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - if (axes[j] <= i) { - j++; - } - } - if (shape[i] !== 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - } - return { newShape, keptDims }; - } - function checkConversionForErrors(vals, dtype) { - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); - } - } - } - /** Returns true if the dtype is valid. */ - function isValidDtype(dtype) { - return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' || - dtype === 'int32' || dtype === 'string'; - } - function isTypedArray(a) { - return a instanceof Float32Array || a instanceof Int32Array || - a instanceof Uint8Array; - } - function bytesPerElement(dtype) { - if (dtype === 'float32' || dtype === 'int32') { - return 4; - } - else if (dtype === 'complex64') { - return 8; - } - else if (dtype === 'bool') { - return 1; - } - else { - throw new Error(`Unknown dtype ${dtype}`); - } - } - /** - * Returns the approximate number of bytes allocated in the string array - 2 - * bytes per character. Computing the exact bytes for a native string in JS is - * not possible since it depends on the encoding of the html page that serves - * the website. - */ - function bytesFromStringArray(arr) { - if (arr == null) { - return 0; - } - let bytes = 0; - arr.forEach(x => bytes += x.length); - return bytes; - } - /** Returns true if the value is a string. */ - function isString(value) { - return typeof value === 'string' || value instanceof String; - } - function isBoolean(value) { - return typeof value === 'boolean'; - } - function isNumber(value) { - return typeof value === 'number'; - } - function inferDtype(values) { - if (Array.isArray(values)) { - return inferDtype(values[0]); - } - if (values instanceof Float32Array) { - return 'float32'; - } - else if (values instanceof Int32Array || values instanceof Uint8Array) { - return 'int32'; - } - else if (isNumber(values)) { - return 'float32'; - } - else if (isString(values)) { - return 'string'; - } - else if (isBoolean(values)) { - return 'bool'; - } - return 'float32'; - } - function isFunction(f) { - return !!(f && f.constructor && f.call && f.apply); - } - function computeStrides(shape) { - const rank = shape.length; - if (rank < 2) { - return []; - } - // Last dimension has implicit stride of 1, thus having D-1 (instead of D) - // strides. - const strides = new Array(rank - 1); - strides[rank - 2] = shape[rank - 1]; - for (let i = rank - 3; i >= 0; --i) { - strides[i] = strides[i + 1] * shape[i + 1]; - } - return strides; - } - function createNestedArray(offset, shape, a, isComplex = false) { - const ret = new Array(); - if (shape.length === 1) { - const d = shape[0] * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = a[offset + i]; - } - } - else { - const d = shape[0]; - const rest = shape.slice(1); - const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = createNestedArray(offset + i * len, rest, a, isComplex); - } - } - return ret; - } - // Provide a nested array of TypedArray in given shape. - function toNestedArray(shape, a, isComplex = false) { - if (shape.length === 0) { - // Scalar type should return a single number. - return a[0]; - } - const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - if (size === 0) { - // A tensor with shape zero should be turned into empty list. - return []; - } - if (size !== a.length) { - throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`); - } - return createNestedArray(0, shape, a, isComplex); - } - function makeOnesTypedArray(size, dtype) { - const array = makeZerosTypedArray(size, dtype); - for (let i = 0; i < array.length; i++) { - array[i] = 1; - } - return array; - } - function makeZerosTypedArray(size, dtype) { - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(size); - } - else if (dtype === 'int32') { - return new Int32Array(size); - } - else if (dtype === 'bool') { - return new Uint8Array(size); - } - else { - throw new Error(`Unknown data type ${dtype}`); - } - } - function assertNonNegativeIntegerDimensions(shape) { - shape.forEach(dimSize => { - assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` + - `shape [${shape}].`); - }); - } - /** - * This method asserts whether an object is a Promise instance. - * @param object - */ - // tslint:disable-next-line: no-any - function isPromise(object) { - // We chose to not use 'obj instanceOf Promise' for two reasons: - // 1. It only reliably works for es6 Promise, not other Promise - // implementations. - // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch - // the async calls, so it is possible the obj (patched) is comparing to a - // pre-patched Promise. - return object && object.then && typeof object.then === 'function'; - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - // Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true. - const TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; - /** - * The environment contains evaluated flags as well as the registered platform. - * This is always used as a global singleton and can be retrieved with - * `tf.env()`. - * - * @doc {heading: 'Environment'} - */ - class Environment { - // tslint:disable-next-line: no-any - constructor(global) { - this.global = global; - this.flags = {}; - this.flagRegistry = {}; - this.urlFlags = {}; - // Jasmine spies on this in 'environment_test.ts' - this.getQueryParams = getQueryParams; - this.populateURLFlags(); - } - setPlatform(platformName, platform) { - if (this.platform != null) { - console.warn(`Platform ${this.platformName} has already been set. ` + - `Overwriting the platform with ${platform}.`); - } - this.platformName = platformName; - this.platform = platform; - } - registerFlag(flagName, evaluationFn, setHook) { - this.flagRegistry[flagName] = { evaluationFn, setHook }; - // Override the flag value from the URL. This has to happen here because the - // environment is initialized before flags get registered. - if (this.urlFlags[flagName] != null) { - const flagValue = this.urlFlags[flagName]; - console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`); - this.set(flagName, flagValue); - } - } - async getAsync(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - this.flags[flagName] = await this.evaluateFlag(flagName); - return this.flags[flagName]; - } - get(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - const flagValue = this.evaluateFlag(flagName); - if (isPromise(flagValue)) { - throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` + - `Please use getAsync() instead.`); - } - this.flags[flagName] = flagValue; - return this.flags[flagName]; - } - getNumber(flagName) { - return this.get(flagName); - } - getBool(flagName) { - return this.get(flagName); - } - getFlags() { - return this.flags; - } - // For backwards compatibility. - get features() { - return this.flags; - } - set(flagName, value) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); - } - this.flags[flagName] = value; - if (this.flagRegistry[flagName].setHook != null) { - this.flagRegistry[flagName].setHook(value); - } - } - evaluateFlag(flagName) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); - } - return this.flagRegistry[flagName].evaluationFn(); - } - setFlags(flags) { - this.flags = Object.assign({}, flags); - } - reset() { - this.flags = {}; - this.urlFlags = {}; - this.populateURLFlags(); - } - populateURLFlags() { - if (typeof this.global === 'undefined' || - typeof this.global.location === 'undefined' || - typeof this.global.location.search === 'undefined') { - return; - } - const urlParams = this.getQueryParams(this.global.location.search); - if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { - const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); - keyValues.forEach(keyValue => { - const [key, value] = keyValue.split(':'); - this.urlFlags[key] = parseValue(key, value); - }); - } - } - } - function getQueryParams(queryString) { - const params = {}; - queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { - decodeParam(params, t[0], t[1]); - return t.join('='); - }); - return params; - } - function decodeParam(params, name, value) { - params[decodeURIComponent(name)] = decodeURIComponent(value || ''); - } - function parseValue(flagName, value) { - value = value.toLowerCase(); - if (value === 'true' || value === 'false') { - return value === 'true'; - } - else if (`${+value}` === value) { - return +value; - } - throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); - } - /** - * Returns the current environment (a global singleton). - * - * The environment object contains the evaluated feature values as well as the - * active platform. - * - * @doc {heading: 'Environment'} - */ - function env() { - return ENV; - } - let ENV = null; - function setEnvironmentGlobal(environment) { - ENV = environment; - } - - /** - * @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. - * ============================================================================= - */ - // Note that the identifier globalNameSpace is scoped to this module, but will - // always resolve to the same global object regardless of how the module is - // resolved. - // tslint:disable-next-line:no-any - let globalNameSpace; - // tslint:disable-next-line:no-any - function getGlobalNamespace() { - if (globalNameSpace == null) { - // tslint:disable-next-line:no-any - let ns; - if (typeof (window) !== 'undefined') { - ns = window; - } - else if (typeof (global) !== 'undefined') { - ns = global; - } - else if (typeof (process) !== 'undefined') { - ns = process; - } - else if (typeof (self) !== 'undefined') { - ns = self; - } - else { - throw new Error('Could not find a global object'); - } - globalNameSpace = ns; - } - return globalNameSpace; - } - // tslint:disable-next-line:no-any - function getGlobalMap() { - const ns = getGlobalNamespace(); - if (ns._tfGlobals == null) { - ns._tfGlobals = new Map(); - } - return ns._tfGlobals; - } - /** - * Returns a globally accessible 'singleton' object. - * - * @param key the name of the object - * @param init a function to initialize to initialize this object - * the first time it is fetched. - */ - function getGlobal(key, init) { - const globalMap = getGlobalMap(); - if (globalMap.has(key)) { - return globalMap.get(key); - } - else { - const singleton = init(); - globalMap.set(key, singleton); - return globalMap.get(key); - } - } - - const Abs = 'Abs'; - const Acos = 'Acos'; - const Acosh = 'Acosh'; - const Add = 'Add'; - const AddN = 'AddN'; - const All = 'All'; - const Any = 'Any'; - const ArgMax = 'ArgMax'; - const ArgMin = 'ArgMin'; - const Asin = 'Asin'; - const Asinh = 'Asinh'; - const Atan = 'Atan'; - const Atanh = 'Atanh'; - const Atan2 = 'Atan2'; - const AvgPool = 'AvgPool'; - const AvgPoolGrad = 'AvgPoolGrad'; - const AvgPool3D = 'AvgPool3D'; - const AvgPool3DGrad = 'AvgPool3DGrad'; - const BatchMatMul = 'BatchMatMul'; - const BatchToSpaceND = 'BatchToSpaceND'; - const BroadcastTo = 'BroadcastTo'; - const Cast = 'Cast'; - const Ceil = 'Ceil'; - const ClipByValue = 'ClipByValue'; - const Complex = 'Complex'; - const ComplexAbs = 'ComplexAbs'; - const Concat = 'Concat'; - const Conv2D = 'Conv2D'; - const Conv2DBackpropFilter = 'Conv2DBackpropFilter'; - const Conv2DBackpropInput = 'Conv2DBackpropInput'; - const Conv3D = 'Conv3D'; - const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2'; - const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2'; - const Cos = 'Cos'; - const Cosh = 'Cosh'; - const Cumsum = 'Cumsum'; - const DepthToSpace = 'DepthToSpace'; - const DepthwiseConv2dNative = 'DepthwiseConv2dNative'; - const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter'; - const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput'; - const Dilation2D = 'Dilation2D'; - const Dilation2DBackpropInput = 'Dilation2DBackpropInput'; - const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter'; - const RealDiv = 'RealDiv'; - const Elu = 'Elu'; - const EluGrad = 'EluGrad'; - const Erf = 'Erf'; - const Equal = 'Equal'; - const Exp = 'Exp'; - const ExpandDims = 'ExpandDims'; - const Expm1 = 'Expm1'; - const FFT = 'FFT'; - const Floor = 'Floor'; - const FloorDiv = 'FloorDiv'; - const FusedBatchNorm = 'FusedBatchNorm'; - const GatherV2 = 'GatherV2'; - const Greater = 'Greater'; - const GreaterEqual = 'GreaterEqual'; - const Identity = 'Identity'; - const IFFT = 'IFFT'; - const Imag = 'Imag'; - const IsFinite = 'IsFinite'; - const IsInf = 'IsInf'; - const IsNan = 'IsNan'; - const LeakyRelu = 'LeakyRelu'; - const Less = 'Less'; - const LessEqual = 'LessEqual'; - const Log = 'Log'; - const Log1p = 'Log1p'; - const LogicalAnd = 'LogicalAnd'; - const LogicalNot = 'LogicalNot'; - const LogicalOr = 'LogicalOr'; - const LogSoftmax = 'LogSoftmax'; - const LRN = 'LRN'; - const LRNGrad = 'LRNGrad'; - const Max = 'Max'; - const Maximum = 'Maximum'; - const MaxPool = 'MaxPool'; - const MaxPoolGrad = 'MaxPoolGrad'; - const MaxPool3D = 'MaxPool3D'; - const MaxPool3DGrad = 'MaxPool3DGrad'; - const Mean = 'Mean'; - const Min = 'Min'; - const Minimum = 'Minimum'; - const MirrorPad = 'MirrorPad'; - const Mod = 'Mod'; - const Multiply = 'Multiply'; - const Neg = 'Neg'; - const NotEqual = 'NotEqual'; - const OnesLike = 'OnesLike'; - const OneHot = 'OneHot'; - const Pack = 'Pack'; - const PadV2 = 'PadV2'; - const Pow = 'Pow'; - const Prelu = 'Prelu'; - const Prod = 'Prod'; - const Real = 'Real'; - const Reciprocal = 'Reciprocal'; - const Relu = 'Relu'; - const Reshape = 'Reshape'; - const ResizeNearestNeighbor = 'ResizeNearestNeighbor'; - const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad'; - const ResizeBilinear = 'ResizeBilinear'; - const ResizeBilinearGrad = 'ResizeBilinearGrad'; - const Relu6 = 'Relu6'; - const Reverse = 'Reverse'; - const Round = 'Round'; - const Rsqrt = 'Rsqrt'; - const Select = 'Select'; - const Selu = 'Selu'; - const Slice = 'Slice'; - const Sin = 'Sin'; - const Sinh = 'Sinh'; - const Sign = 'Sign'; - const Sigmoid = 'Sigmoid'; - const Softplus = 'Softplus'; - const Sqrt = 'Sqrt'; - const Sum = 'Sum'; - const SpaceToBatchND = 'SpaceToBatchND'; - const SplitV = 'SplitV'; - const Softmax = 'Softmax'; - const SquaredDifference = 'SquaredDifference'; - const Square = 'Square'; - const StridedSlice = 'StridedSlice'; - const Sub = 'Sub'; - const Tan = 'Tan'; - const Tanh = 'Tanh'; - const Tile = 'Tile'; - const TopK = 'TopK'; - const Transpose = 'Transpose'; - const Unique = 'Unique'; - const Unpack = 'Unpack'; - const UnsortedSegmentSum = 'UnsortedSegmentSum'; - const ZerosLike = 'ZerosLike'; - /** - * TensorFlow.js-only kernels - */ - const Step = 'Step'; - - /** - * @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. - * ============================================================================= - */ - const kernelRegistry = getGlobal('kernelRegistry', () => new Map()); - const gradRegistry = getGlobal('gradRegistry', () => new Map()); - /** - * Returns the kernel function (code) associated with the provided names. - * - * @param kernelName The official name of the kernel. - * @param backendName The official name of the backend. - */ - function getKernel(kernelName, backendName) { - const key = makeKey(kernelName, backendName); - return kernelRegistry.get(key); - } - /** - * Returns the registered gradient info associated with the provided kernel. - * @param kernelName The official TF kernel name. - */ - function getGradient(kernelName) { - return gradRegistry.get(kernelName); - } - function getKernelsForBackend(backendName) { - const it = kernelRegistry.entries(); - const result = []; - while (true) { - const { done, value } = it.next(); - if (done) { - break; - } - const [key, config] = value; - const [backend,] = key.split('_'); - if (backend === backendName) { - result.push(config); - } - } - return result; - } - /** - * Registers a gradient function for a given kernel in the global registry, - * to be used during the back-propagation of that kernel. - * - * @param config An object with the following properties: - * - `kernelName` The name of the kernel that the gradient function is for. - * - `gradFunc` The function to run during back-propagation. - */ - function registerGradient(config) { - const { kernelName } = config; - if (gradRegistry.has(kernelName)) { - // TODO (yassogba) after 3.0 assess whether we need to keep this gated - // to debug mode. - if (env().getBool('DEBUG')) { - console.warn(`Overriding the gradient for '${kernelName}'`); - } - } - gradRegistry.set(kernelName, config); - } - function makeKey(kernelName, backendName) { - return `${backendName}_${kernelName}`; - } - - /** - * @license - * Copyright 2017 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 noConversionNeeded(a, dtype) { - return (a instanceof Float32Array && dtype === 'float32') || - (a instanceof Int32Array && dtype === 'int32') || - (a instanceof Uint8Array && dtype === 'bool'); - } - function toTypedArray(a, dtype) { - if (dtype === 'string') { - throw new Error('Cannot convert a string[] to a TypedArray'); - } - if (Array.isArray(a)) { - a = flatten(a); - } - if (env().getBool('DEBUG')) { - checkConversionForErrors(a, dtype); - } - if (noConversionNeeded(a, dtype)) { - return a; - } - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(a); - } - else if (dtype === 'int32') { - return new Int32Array(a); - } - else if (dtype === 'bool') { - const bool = new Uint8Array(a.length); - for (let i = 0; i < bool.length; ++i) { - if (Math.round(a[i]) !== 0) { - bool[i] = 1; - } - } - return bool; - } - else { - throw new Error(`Unknown data type ${dtype}`); - } - } - /** - * Returns the current high-resolution time in milliseconds relative to an - * arbitrary time in the past. It works across different platforms (node.js, - * browsers). - * - * ```js - * console.log(tf.util.now()); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function now() { - return env().platform.now(); - } - /** - * Encodes the provided string into bytes using the provided encoding scheme. - * - * @param s The string to encode. - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ - function encodeString(s, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.encode(s, encoding); - } - /** - * Decodes the provided bytes into a string using the provided encoding scheme. - * @param bytes The bytes to decode. - * - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ - function decodeString(bytes, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.decode(bytes, encoding); - } - - /** - * @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 Profiler { - constructor(backendTimer, logger) { - this.backendTimer = backendTimer; - this.logger = logger; - if (logger == null) { - this.logger = new Logger(); - } - } - profileKernel(kernelName, inputs, f) { - let outputs; - const holdResultWrapperFn = () => { - outputs = f(); - }; - let timer; - const start = now(); - if (this.backendTimer.timerAvailable()) { - timer = this.backendTimer.time(holdResultWrapperFn); - } - else { - holdResultWrapperFn(); - for (const output of outputs) { - output.dataSync(); - } - timer = Promise.resolve({ kernelMs: now() - start }); - } - if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) { - for (let i = 0; i < outputs.length; i++) { - const output = outputs[i]; - // Dangling promise here because we don't want to propagate up - // asynchronicity. - output.data().then(tensorVals => { - checkComputationForErrors(tensorVals, output.dtype, kernelName); - }); - } - } - const kernelProfile = { - kernelName, - outputs, - inputs, - timeMs: timer.then(timing => timing.kernelMs), - extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ? - timing.getExtraProfileInfo() : - '') - }; - return kernelProfile; - } - logKernelProfile(kernelProfile) { - const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile; - outputs.forEach(result => { - Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => { - this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]); - }); - }); - } - } - function checkComputationForErrors(vals, dtype, kernelName) { - if (dtype !== 'float32') { - // Only floating point computations will generate NaN values - return false; - } - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - // Throwing custom exception so behavior is testable. - console.warn(`Found ${num} in the result of '${kernelName}'`); - return true; - } - } - return false; - } - class Logger { - logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { - const time = typeof timeMs === 'number' ? rightPad(`${timeMs}ms`, 9) : - timeMs['error']; - const paddedName = rightPad(name, 25); - const rank = result.rank; - const size = result.size; - const shape = rightPad(result.shape.toString(), 14); - let inputShapesDescription = ''; - for (const name in inputs) { - const input = inputs[name]; - if (input != null) { - // The input might be a non-tensor (e.g HTMLImageElement), in which case - // we claim the output shape as input shape. - const inputShape = input.shape || result.shape; - const inputRank = inputShape.length; - inputShapesDescription += - `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `; - } - } - console.log(`%c${paddedName}\t%c${time}\t%c${rank}D ${shape}\t%c${size}\t%c${inputShapesDescription}\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue'); - } - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Computes a list of TapeNodes that connect x to y, filtering everything else - * out and preserving the order of the original tape elements. - * - * @param tape The tape elements to filter. - * @param xs The input Tensors. - * @param y The output Tensor. - */ - function getFilteredNodesXToY(tape, xs, y) { - // Forward pass to compute all the nodes and Tensors that are transitively a - // function of x. - const tensorsFromX = {}; - const nodesFromX = {}; - for (let i = 0; i < xs.length; i++) { - tensorsFromX[xs[i].id] = true; - } - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - const nodeInputs = node.inputs; - for (const inputName in nodeInputs) { - const input = nodeInputs[inputName]; - let anyInputFromX = false; - for (let j = 0; j < xs.length; j++) { - if (tensorsFromX[input.id]) { - node.outputs.forEach(output => tensorsFromX[output.id] = true); - anyInputFromX = true; - nodesFromX[node.id] = true; - break; - } - } - if (anyInputFromX) { - break; - } - } - } - // Backward pass to find all of the nodes and Tensors that lead to y. - const tensorsLeadToY = {}; - tensorsLeadToY[y.id] = true; - const nodesToY = {}; - for (let i = tape.length - 1; i >= 0; i--) { - const node = tape[i]; - const nodeInputs = node.inputs; - // If any of the outputs lead to y, mark all of the inputs as leading to y. - for (let j = 0; j < node.outputs.length; j++) { - if (tensorsLeadToY[node.outputs[j].id]) { - for (const inputName in nodeInputs) { - tensorsLeadToY[nodeInputs[inputName].id] = true; - nodesToY[node.id] = true; - } - break; - } - } - } - // Return the paths that come from x and lead to y. - const filteredTape = []; - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - if (nodesFromX[node.id] && nodesToY[node.id]) { - // Prune the inputs from the node that aren't a function of x. - const prunedInputs = {}; - for (const inputName in node.inputs) { - const nodeInput = node.inputs[inputName]; - if (tensorsFromX[nodeInput.id]) { - prunedInputs[inputName] = nodeInput; - } - } - // Copy the node and overwrite inputsAndArgs to the pruned version. - const prunedNode = Object.assign({}, node); - prunedNode.inputs = prunedInputs; - prunedNode.outputs = node.outputs; - filteredTape.push(prunedNode); - } - } - return filteredTape; - } - /** - * Backpropagate gradients through the filtered TapeNodes. - * - * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map - * is mutated by this method. - * @param filteredTape The filtered TapeNodes to backprop through. - */ - function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) { - // Walk the tape backward and keep a map of Tensor to its gradient. - for (let i = filteredTape.length - 1; i >= 0; i--) { - const node = filteredTape[i]; - const dys = []; - node.outputs.forEach(o => { - const gradTensor = tensorAccumulatedGradientMap[o.id]; - if (gradTensor != null) { - dys.push(gradTensor); - } - else { - // This particular output is not in the back-propagation subgraph, so it - // does not affect the final output, thus we put null for its dy. - dys.push(null); - } - }); - if (node.gradient == null) { - throw new Error(`Cannot compute gradient: gradient function not found ` + - `for ${node.kernelName}.`); - } - // Backprop dy through this node and accumulate gradients over the inputs. - const inputGradients = node.gradient(dys); - for (const inputName in node.inputs) { - if (!(inputName in inputGradients)) { - throw new Error(`Cannot backprop through input ${inputName}. ` + - `Available gradients found: ${Object.keys(inputGradients)}.`); - } - // Call the gradient function. - const dx = tidy(() => inputGradients[inputName]()); - if (dx.dtype !== 'float32') { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); - } - const x = node.inputs[inputName]; - if (!arraysEqual(dx.shape, x.shape)) { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `'${inputName}' has shape '${dx.shape}', which does not match ` + - `the shape of the input '${x.shape}'`); - } - if (tensorAccumulatedGradientMap[x.id] == null) { - tensorAccumulatedGradientMap[x.id] = dx; - } - else { - const curGradient = tensorAccumulatedGradientMap[x.id]; - tensorAccumulatedGradientMap[x.id] = add(curGradient, dx); - curGradient.dispose(); - } - } - } - } - - /** - * @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. - * ============================================================================= - */ - // Maximum number of values before we decide to show ellipsis. - const FORMAT_LIMIT_NUM_VALS = 20; - // Number of first and last values to show when displaying a, b,...,y, z. - const FORMAT_NUM_FIRST_LAST_VALS = 3; - // Number of significant digits to show. - const FORMAT_NUM_SIG_DIGITS = 7; - function tensorToString(vals, shape, dtype, verbose) { - const strides = computeStrides(shape); - const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides); - const rank = shape.length; - const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol); - const lines = ['Tensor']; - if (verbose) { - lines.push(` dtype: ${dtype}`); - lines.push(` rank: ${rank}`); - lines.push(` shape: [${shape}]`); - lines.push(` values:`); - } - lines.push(valsLines.map(l => ' ' + l).join('\n')); - return lines.join('\n'); - } - function computeMaxSizePerColumn(vals, shape, dtype, strides) { - const n = sizeFromShape(shape); - const numCols = strides[strides.length - 1]; - const padPerCol = new Array(numCols).fill(0); - const rank = shape.length; - const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals; - if (rank > 1) { - for (let row = 0; row < n / numCols; row++) { - const offset = row * numCols; - for (let j = 0; j < numCols; j++) { - padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length); - } - } - } - return padPerCol; - } - function valToString(val, pad, dtype) { - let valStr; - if (Array.isArray(val)) { - valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` + - `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; - } - else if (isString(val)) { - valStr = `'${val}'`; - } - else if (dtype === 'bool') { - valStr = boolNumToString(val); - } - else { - valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); - } - return rightPad(valStr, pad); - } - function boolNumToString(v) { - return v === 0 ? 'false' : 'true'; - } - function subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) { - const storagePerElement = dtype === 'complex64' ? 2 : 1; - const size = shape[0]; - const rank = shape.length; - if (rank === 0) { - if (dtype === 'complex64') { - const complexTuple = createComplexTuples(vals); - return [valToString(complexTuple[0], 0, dtype)]; - } - if (dtype === 'bool') { - return [boolNumToString(vals[0])]; - } - return [vals[0].toString()]; - } - if (rank === 1) { - if (size > FORMAT_LIMIT_NUM_VALS) { - const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement; - let firstVals = Array.from(vals.slice(0, firstValsSize)); - let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement)); - if (dtype === 'complex64') { - firstVals = createComplexTuples(firstVals); - lastVals = createComplexTuples(lastVals); - } - return [ - '[' + - firstVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ', ..., ' + - lastVals - .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype)) - .join(', ') + - ']' - ]; - } - const displayVals = dtype === 'complex64' ? createComplexTuples(vals) : - Array.from(vals); - return [ - '[' + - displayVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ']' - ]; - } - // The array is rank 2 or more. - const subshape = shape.slice(1); - const substrides = strides.slice(1); - const stride = strides[0] * storagePerElement; - const lines = []; - if (size > FORMAT_LIMIT_NUM_VALS) { - for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */)); - } - lines.push('...'); - for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - else { - for (let i = 0; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - const sep = rank === 2 ? ',' : ''; - lines[0] = '[' + lines[0] + sep; - for (let i = 1; i < lines.length - 1; i++) { - lines[i] = ' ' + lines[i] + sep; - } - let newLineSep = ',\n'; - for (let i = 2; i < rank; i++) { - newLineSep += '\n'; - } - lines[lines.length - 1] = - ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); - return lines; - } - function createComplexTuples(vals) { - const complexTuples = []; - for (let i = 0; i < vals.length; i += 2) { - complexTuples.push([vals[i], vals[i + 1]]); - } - return complexTuples; - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - // For tracking tensor creation and disposal. - let trackerFn = null; - // Used by chaining methods to call into ops. - let opHandler = null; - /** - * An external consumer can register itself as the tensor tracker. This way - * the Tensor class can notify the tracker for every tensor created and - * disposed. - */ - function setTensorTracker(fn) { - trackerFn = fn; - } - /** - * A `tf.Tensor` object represents an immutable, multidimensional array of - * numbers that has a shape and a data type. - * - * For performance reasons, functions that create tensors do not necessarily - * perform a copy of the data passed to them (e.g. if the data is passed as a - * `Float32Array`), and changes to the data will change the tensor. This is not - * a feature and is not supported. To avoid this behavior, use the tensor before - * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`. - * - * See `tf.tensor` for details on how to create a `tf.Tensor`. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - class Tensor { - constructor(shape, dtype, dataId, id) { - /** Whether this tensor has been globally kept. */ - this.kept = false; - this.isDisposedInternal = false; - this.shape = shape.slice(); - this.dtype = dtype || 'float32'; - this.size = sizeFromShape(shape); - this.strides = computeStrides(shape); - this.dataId = dataId; - this.id = id; - this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); - } - get rank() { - return this.shape.length; - } - /** - * Returns a promise of `tf.TensorBuffer` that holds the underlying data. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async buffer() { - const vals = await this.data(); - return opHandler.buffer(this.shape, this.dtype, vals); - } - /** - * Returns a `tf.TensorBuffer` that holds the underlying data. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - bufferSync() { - return opHandler.buffer(this.shape, this.dtype, this.dataSync()); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * asynchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async array() { - const vals = await this.data(); - return toNestedArray(this.shape, vals, this.dtype === 'complex64'); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * synchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - arraySync() { - return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64'); - } - /** - * Asynchronously downloads the values from the `tf.Tensor`. Returns a - * promise of `TypedArray` that resolves when the computation has finished. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async data() { - this.throwIfDisposed(); - const data = trackerFn().read(this.dataId); - if (this.dtype === 'string') { - const bytes = await data; - try { - return bytes.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** - * Synchronously downloads the values from the `tf.Tensor`. This blocks the - * UI thread until the values are ready, which can cause performance issues. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dataSync() { - this.throwIfDisposed(); - const data = trackerFn().readSync(this.dataId); - if (this.dtype === 'string') { - try { - return data.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** Returns the underlying bytes of the tensor's data. */ - async bytes() { - this.throwIfDisposed(); - const data = await trackerFn().read(this.dataId); - if (this.dtype === 'string') { - return data; - } - else { - return new Uint8Array(data.buffer); - } - } - /** - * Disposes `tf.Tensor` from memory. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dispose() { - if (this.isDisposed) { - return; - } - trackerFn().disposeTensor(this); - this.isDisposedInternal = true; - } - get isDisposed() { - return this.isDisposedInternal; - } - throwIfDisposed() { - if (this.isDisposed) { - throw new Error(`Tensor is disposed.`); - } - } - /** - * Prints the `tf.Tensor`. See `tf.print` for details. - * - * @param verbose Whether to print verbose information about the tensor, - * including dtype and size. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - print(verbose = false) { - return opHandler.print(this, verbose); - } - /** - * Returns a copy of the tensor. See `tf.clone` for details. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - clone() { - this.throwIfDisposed(); - return opHandler.clone(this); - } - /** - * Returns a human-readable description of the tensor. Useful for logging. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - toString(verbose = false) { - const vals = this.dataSync(); - return tensorToString(vals, this.shape, this.dtype, verbose); - } - cast(dtype) { - this.throwIfDisposed(); - return opHandler.cast(this, dtype); - } - variable(trainable = true, name, dtype) { - this.throwIfDisposed(); - return trackerFn().makeVariable(this, trainable, name, dtype); - } - } - Object.defineProperty(Tensor, Symbol.hasInstance, { - value: (instance) => { - // Implementation note: we should use properties of the object that will be - // defined before the constructor body has finished executing (methods). - // This is because when this code is transpiled by babel, babel will call - // classCallCheck before the constructor body is run. - // See https://github.com/tensorflow/tfjs/issues/3384 for backstory. - return !!instance && instance.data != null && instance.dataSync != null && - instance.throwIfDisposed != null; - } - }); - function getGlobalTensorClass() { - // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules - // being returned for this file depending on the path they are loaded from. - return getGlobal('Tensor', () => { - return Tensor; - }); - } - // Global side effect. Cache global reference to Tensor class - getGlobalTensorClass(); - /** - * A mutable `tf.Tensor`, useful for persisting state, e.g. for training. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - class Variable extends Tensor { - constructor(initialValue, trainable, name, tensorId) { - super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); - this.trainable = trainable; - this.name = name; - } - /** - * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have - * the same shape and dtype as the old `tf.Tensor`. - * - * @param newValue New tensor to be assigned to this variable. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - assign(newValue) { - if (newValue.dtype !== this.dtype) { - throw new Error(`dtype of the new value (${newValue.dtype}) and ` + - `previous value (${this.dtype}) must match`); - } - if (!arraysEqual(newValue.shape, this.shape)) { - throw new Error(`shape of the new value (${newValue.shape}) and ` + - `previous value (${this.shape}) must match`); - } - trackerFn().disposeTensor(this); - this.dataId = newValue.dataId; - trackerFn().incRef(this, null /* backend */); - } - dispose() { - trackerFn().disposeVariable(this); - this.isDisposedInternal = true; - } - } - Object.defineProperty(Variable, Symbol.hasInstance, { - value: (instance) => { - return instance instanceof Tensor && instance.assign != null && - instance.assign instanceof Function; - } - }); - - /** - * @license - * Copyright 2017 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 Rank; - (function (Rank) { - Rank["R0"] = "R0"; - Rank["R1"] = "R1"; - Rank["R2"] = "R2"; - Rank["R3"] = "R3"; - Rank["R4"] = "R4"; - Rank["R5"] = "R5"; - Rank["R6"] = "R6"; - })(Rank || (Rank = {})); - // Looks for upcasting types. Used, for example, in operations with mixed dtype - // inputs. - var UpcastInt32AndMap; - (function (UpcastInt32AndMap) { - UpcastInt32AndMap["float32"] = "float32"; - UpcastInt32AndMap["int32"] = "int32"; - UpcastInt32AndMap["bool"] = "int32"; - UpcastInt32AndMap["complex64"] = "complex64"; - })(UpcastInt32AndMap || (UpcastInt32AndMap = {})); - var UpcastBoolAndMap; - (function (UpcastBoolAndMap) { - UpcastBoolAndMap["float32"] = "float32"; - UpcastBoolAndMap["int32"] = "int32"; - UpcastBoolAndMap["bool"] = "bool"; - UpcastBoolAndMap["complex64"] = "complex64"; - })(UpcastBoolAndMap || (UpcastBoolAndMap = {})); - var UpcastFloat32AndMap; - (function (UpcastFloat32AndMap) { - UpcastFloat32AndMap["float32"] = "float32"; - UpcastFloat32AndMap["int32"] = "float32"; - UpcastFloat32AndMap["bool"] = "float32"; - UpcastFloat32AndMap["complex64"] = "complex64"; - })(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); - var UpcastComplex64AndMap; - (function (UpcastComplex64AndMap) { - UpcastComplex64AndMap["float32"] = "complex64"; - UpcastComplex64AndMap["int32"] = "complex64"; - UpcastComplex64AndMap["bool"] = "complex64"; - UpcastComplex64AndMap["complex64"] = "complex64"; - })(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); - const upcastTypeMap = { - 'float32': UpcastFloat32AndMap, - 'int32': UpcastInt32AndMap, - 'bool': UpcastBoolAndMap, - 'complex64': UpcastComplex64AndMap - }; - function upcastType(typeA, typeB) { - if (typeA === 'string' || typeB === 'string') { - if (typeA === 'string' && typeB === 'string') { - return 'string'; - } - throw new Error(`Can not upcast ${typeA} with ${typeB}`); - } - return upcastTypeMap[typeA][typeB]; - } - - /** - * @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 makeTypesMatch(a, b) { - if (a.dtype === b.dtype) { - return [a, b]; - } - const dtype = upcastType(a.dtype, b.dtype); - return [a.cast(dtype), b.cast(dtype)]; - } - /** - * Extracts any `Tensor`s found within the provided object. - * - * @param container an object that may be a `Tensor` or may directly contain - * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it - * is safe to pass any object here, except that `Promise`s are not - * supported. - * @returns An array of `Tensors` found within the passed object. If the - * argument is simply a `Tensor', a list containing that `Tensor` is - * returned. If the object is not a `Tensor` or does not - * contain `Tensors`, an empty list is returned. - */ - function getTensorsInContainer(result) { - const list = []; - const seen = new Set(); - walkTensorContainer(result, list, seen); - return list; - } - function walkTensorContainer(container, list, seen) { - if (container == null) { - return; - } - if (container instanceof Tensor) { - list.push(container); - return; - } - if (!isIterable(container)) { - return; - } - // Iteration over keys works also for arrays. - const iterable = container; - for (const k in iterable) { - const val = iterable[k]; - if (!seen.has(val)) { - seen.add(val); - walkTensorContainer(val, list, seen); - } - } - } - // tslint:disable-next-line:no-any - function isIterable(obj) { - return Array.isArray(obj) || typeof obj === 'object'; - } - - /** - * @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 isRegisteredKernelInvocation(kernelInvocation) { - return kernelInvocation.kernelName != null; - } - class EngineState { - constructor() { - // Public since optimizers will use it. - this.registeredVariables = {}; - this.nextTapeNodeId = 0; - this.numBytes = 0; - this.numTensors = 0; - this.numStringTensors = 0; - this.numDataBuffers = 0; - // Number of nested tf.grad() statements when computing higher-order - // gradients. E.g. `1` for first-order gradients and `2` for second-order - // gradients. Used to track if the tape should be removed after a backprop. - this.gradientDepth = 0; - // Number of nested kernel calls. When kernel depth is greater than 1, we turn - // off the tape. - this.kernelDepth = 0; - this.scopeStack = []; - /** - * Keeps track of the number of data moves during a kernel execution. We - * maintain a stack since kernels can call other kernels, recursively. - */ - this.numDataMovesStack = []; - this.nextScopeId = 0; - this.tensorInfo = new WeakMap(); - this.profiling = false; - this.activeProfile = { - newBytes: 0, - newTensors: 0, - peakBytes: 0, - kernels: [], - result: null, - get kernelNames() { - return Array.from(new Set(this.kernels.map(k => k.name))); - } - }; - } - dispose() { - for (const variableName in this.registeredVariables) { - this.registeredVariables[variableName].dispose(); - } - } - } - class Engine { - constructor(ENV) { - this.ENV = ENV; - this.registry = {}; - this.registryFactory = {}; - this.pendingBackendInitId = 0; - this.state = new EngineState(); - } - async ready() { - if (this.pendingBackendInit != null) { - return this.pendingBackendInit.then(() => { }); - } - if (this.backendInstance != null) { - return; - } - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const success = await this.initializeBackend(backendName).success; - if (success) { - await this.setBackend(backendName); - return; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - get backend() { - if (this.pendingBackendInit != null) { - throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` + - `sure to await tf.ready() or await tf.setBackend() before calling ` + - `other methods`); - } - if (this.backendInstance == null) { - const { name, asyncInit } = this.initializeBackendsAndReturnBest(); - if (asyncInit) { - throw new Error(`The highest priority backend '${name}' has not yet been ` + - `initialized. Make sure to await tf.ready() or ` + - `await tf.setBackend() before calling other methods`); - } - this.setBackend(name); - } - return this.backendInstance; - } - backendNames() { - return Object.keys(this.registryFactory); - } - findBackend(backendName) { - if (!(backendName in this.registry)) { - // If the backend hasn't been initialized but we have a registry entry for - // it, initialize it and return it. - if (backendName in this.registryFactory) { - const { asyncInit } = this.initializeBackend(backendName); - if (asyncInit) { - // Backend is not ready yet. - return null; - } - } - else { - return null; - } - } - return this.registry[backendName]; - } - findBackendFactory(backendName) { - if (!(backendName in this.registryFactory)) { - return null; - } - return this.registryFactory[backendName].factory; - } - registerBackend(backendName, factory, priority = 1) { - if (backendName in this.registryFactory) { - console.warn(`${backendName} backend was already registered. ` + - `Reusing existing backend factory.`); - return false; - } - this.registryFactory[backendName] = { factory, priority }; - return true; - } - async setBackend(backendName) { - if (this.registryFactory[backendName] == null) { - throw new Error(`Backend name '${backendName}' not found in registry`); - } - this.backendName = backendName; - if (this.registry[backendName] == null) { - this.backendInstance = null; - const { success, asyncInit } = this.initializeBackend(backendName); - const result = asyncInit ? await success : success; - if (!result) { - return false; - } - } - this.backendInstance = this.registry[backendName]; - this.setupRegisteredKernels(); - // Reset the profiler. - this.profiler = new Profiler(this.backendInstance); - return true; - } - setupRegisteredKernels() { - const kernels = getKernelsForBackend(this.backendName); - kernels.forEach(kernel => { - if (kernel.setupFunc != null) { - kernel.setupFunc(this.backendInstance); - } - }); - } - disposeRegisteredKernels(backendName) { - const kernels = getKernelsForBackend(backendName); - kernels.forEach(kernel => { - if (kernel.disposeFunc != null) { - kernel.disposeFunc(this.registry[backendName]); - } - }); - } - /** - * Initializes a backend by looking up the backend name in the factory - * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if - * there is no backend in the factory registry. - */ - initializeBackend(backendName) { - const registryFactoryEntry = this.registryFactory[backendName]; - if (registryFactoryEntry == null) { - throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); - } - try { - const backend = registryFactoryEntry.factory(); - /* Test if the factory returns a promise. - Done in a more liberal way than - previous 'Promise.resolve(backend)===backend' - as we needed to account for custom Promise - implementations (e.g. Angular) */ - if (backend && !(backend instanceof KernelBackend) && - typeof backend.then === 'function') { - const promiseId = ++this.pendingBackendInitId; - const success = backend - .then(backendInstance => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.registry[backendName] = backendInstance; - this.pendingBackendInit = null; - return true; - }) - .catch(err => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.pendingBackendInit = null; - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return false; - }); - this.pendingBackendInit = success; - return { success, asyncInit: true }; - } - else { - this.registry[backendName] = backend; - return { success: true, asyncInit: false }; - } - } - catch (err) { - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return { success: false, asyncInit: false }; - } - } - removeBackend(backendName) { - if (!(backendName in this.registryFactory)) { - throw new Error(`${backendName} backend not found in registry`); - } - if (this.backendName === backendName && this.pendingBackendInit != null) { - // There is a pending promise of the backend we want to remove. Make it - // obsolete. - this.pendingBackendInitId++; - } - if (backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - delete this.registryFactory[backendName]; - // Unset the backend if it is active. - if (this.backendName === backendName) { - this.pendingBackendInit = null; - this.backendName = null; - this.backendInstance = null; - } - } - getSortedBackends() { - if (Object.keys(this.registryFactory).length === 0) { - throw new Error('No backend found in registry.'); - } - return Object.keys(this.registryFactory).sort((a, b) => { - // Highest priority comes first. - return this.registryFactory[b].priority - - this.registryFactory[a].priority; - }); - } - initializeBackendsAndReturnBest() { - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const { success, asyncInit } = this.initializeBackend(backendName); - if (asyncInit || success) { - return { name: backendName, asyncInit }; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - moveData(backend, dataId) { - const info = this.state.tensorInfo.get(dataId); - const srcBackend = info.backend; - const values = this.readSync(dataId); - const refCount = srcBackend.refCount(dataId); - // Delete the tensor from the old backend and move it to the new - // backend. - srcBackend.disposeData(dataId, true); - info.backend = backend; - backend.move(dataId, values, info.shape, info.dtype, refCount); - if (this.shouldCheckForMemLeaks()) { - // Track the number of moves during a kernel execution to correctly - // detect memory leaks. - this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; - } - } - tidy(nameOrFn, fn) { - let name = null; - if (fn == null) { - // Called with only 1 argument. - if (typeof nameOrFn !== 'function') { - throw new Error('Please provide a function to tidy()'); - } - fn = nameOrFn; - } - else { - // Called with 2 arguments. - if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { - throw new Error('When calling with two arguments, the first argument ' + - 'to tidy() must be a string'); - } - if (typeof fn !== 'function') { - throw new Error('When calling with two arguments, the 2nd argument ' + - 'to tidy() must be a function'); - } - name = nameOrFn; - // TODO(nsthorat,smilkov): Do operation logging and performance - // profiling. - } - let result; - return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { - result = fn(); - if (result instanceof Promise) { - console.error('Cannot return a Promise inside of tidy.'); - } - return result; - }); - } - scopedRun(start, end, f) { - start(); - try { - const res = f(); - end(); - return res; - } - catch (ex) { - end(); - throw ex; - } - } - nextTensorId() { - return Engine.nextTensorId++; - } - nextVariableId() { - return Engine.nextVariableId++; - } - /** - * This method is called instead of the public-facing tensor.clone() when - * saving a tensor for backwards pass. It makes sure to add the clone - * operation to the tape regardless of being called inside a kernel - * execution. - */ - clone(x) { - const y = ENGINE.runKernel(Identity, { x }); - const inputs = { x }; - const grad = (dy) => ({ - x: () => { - const dtype = 'float32'; - const gradInputs = { x: dy }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, gradInputs, - // tslint:disable-next-line: no-unnecessary-type-assertion - attrs); - } - }); - const saved = []; - this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {}); - return y; - } - /** - * Execute a kernel with the given name and return the output tensor. - * - * @param kernelName The name of the kernel to execute. - * @param inputs A map of input names to tensors. - * @param attrs A map of attribute names to their values. An attribute is a - * primitive (non-tensor) input to the kernel. - * @param inputsToSave A list of tensors, inputs to save for the backprop - * computation. - * @param outputsToSave A list of booleans, specifying which output to save - * for the backprop computation. These are booleans since the output - * tensors are not visible to the user. - */ - runKernel(kernelName, inputs, attrs) { - const hasKernel = getKernel(kernelName, this.backendName) != null; - if (!hasKernel) { - throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`); - } - return this.runKernelFunc({ kernelName, inputs, attrs }); - } - shouldCheckForMemLeaks() { - return this.ENV.getBool('IS_TEST'); - } - checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { - const numDataIdsAfter = this.backend.numDataIds(); - // Count the number of data ids associated with the result of the kernel. - let numOutputDataIds = 0; - outInfos.forEach(info => { - // Complex numbers allocate 3 data ids, one for 'real', one for - // 'imaginary', and one for the container that holds the former two. - numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1); - }); - // Account for the number of moves during kernel execution. A "data move" - // can happen in the middle of a kernel execution, placing a new (key,value) - // pair in the data storage. Since data moves have net zero effect (we - // always remove the data from the old backend), we have to cancel them out - // when detecting memory leaks. - const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; - const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; - if (dataIdsLeaked > 0) { - throw new Error(`Backend '${this.backendName}' has an internal memory leak ` + - `(${dataIdsLeaked} data ids) after running '${kernelName}'`); - } - } - /** - * Internal helper method to execute a kernel Func - * - * Use `runKernel` to execute kernels from outside of engine. - */ - runKernelFunc(kernelParams) { - let outputs; - let saved = []; - const isTapeOn = this.isTapeOn(); - const startingBytecount = this.state.numBytes; - const startingNumTensors = this.state.numTensors; - if (this.shouldCheckForMemLeaks()) { - this.state.numDataMovesStack.push(0); - } - let kernelFunc; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - let out; - const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ? - kernelParams.kernelName : - this.state.activeScope != null ? this.state.activeScope.name : ''; - // Create the kernelFunc from either a registered kernel OR passed in - // forward/backward functions (used by custom grad). In this context a - // kernelFunc wraps a kernel implementation with some bookkeeping. - if (isRegisteredKernelInvocation(kernelParams)) { - const { kernelName, inputs, attrs } = kernelParams; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - const kernel = getKernel(kernelName, this.backendName); - assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`); - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = kernel.kernelFunc({ inputs, attrs, backend: this.backend }); - const outInfos = Array.isArray(out) ? out : [out]; - if (this.shouldCheckForMemLeaks()) { - this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); - } - const outTensors = outInfos.map((outInfo) => { - // todo (yassogba) remove this option (Tensor) when node backend - // methods have been modularized and they all return tensorInfo. - // TensorInfos do not have a rank attribute. - if (outInfo.rank != null) { - return outInfo; - } - const { dataId, shape, dtype } = outInfo; - return this.makeTensorFromDataId(dataId, shape, dtype); - }); - // Save any required inputs and outputs. - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since there would be no backprop for these tensors - // (which would otherwise dispose them). - if (isTapeOn) { - const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors); - saved = this.saveTensorsForBackwardMode(tensorsToSave); - } - return outTensors; - }; - } - else { - const { forwardFunc } = kernelParams; - // Running a customGrad op. - const saveFunc = (tensors) => { - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since we would never run backprop, which disposes - // the kept tensors. - if (!isTapeOn) { - return; - } - saved = tensors.map(tensor => this.keep(this.clone(tensor))); - }; - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = this.tidy(() => forwardFunc(this.backend, saveFunc)); - const outs = (Array.isArray(out) ? out : [out]); - if (this.shouldCheckForMemLeaks()) { - // Scope name is used to print a more helpful error message if needed. - this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs); - } - return outs; - }; - } - // - // Run the kernelFunc. Optionally profiling it. - // - const { inputs, attrs } = kernelParams; - const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ? - null : - kernelParams.backwardsFunc; - let kernelProfile; - this.scopedRun( - // Stop recording to a tape when running a kernel. - () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { - if (!this.ENV.getBool('DEBUG') && !this.state.profiling) { - outputs = kernelFunc(); - } - else { - kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc()); - if (this.ENV.getBool('DEBUG')) { - this.profiler.logKernelProfile(kernelProfile); - } - outputs = kernelProfile.outputs; - } - }); - if (isTapeOn) { - this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs); - } - if (this.state.profiling) { - this.state.activeProfile.kernels.push({ - name: kernelOrScopeName, - bytesAdded: this.state.numBytes - startingBytecount, - totalBytesSnapshot: this.state.numBytes, - tensorsAdded: this.state.numTensors - startingNumTensors, - totalTensorsSnapshot: this.state.numTensors, - inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null), - outputShapes: outputs.map(item => item.shape), - kernelTimeMs: kernelProfile.timeMs, - extraInfo: kernelProfile.extraInfo - }); - } - return (Array.isArray(out) ? outputs : outputs[0]); - } - /** - * Saves tensors used in forward mode for use in backward mode. - * - * @param tensors the list of tensors to save. - */ - saveTensorsForBackwardMode(tensors) { - const saved = tensors.map(tensor => this.keep(this.clone(tensor))); - return saved; - } - /** - * Returns a list of tensors to save for a given gradient calculation. - * - * @param kernelName name of kernel to look up gradient for. - * @param inputs a map of input tensors. - * @param outputs an array of output tensors from forward mode of kernel. - */ - getTensorsForGradient(kernelName, inputs, outputs) { - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - const inputsToSave = gradConfig.inputsToSave || []; - const outputsToSave = gradConfig.outputsToSave || []; - // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs - // specified in inputsToSave will be saved. - let inputTensorsToSave; - if (gradConfig.saveAllInputs) { - assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.'); - inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); - } - else { - inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); - } - const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); - return inputTensorsToSave.concat(outputTensorsToSave); - } - // We return an empty list rather than throw an error because the kernel we - // are looking up may not actually be relevant to backproping through the - // overall function - // - // See 'does not error if irrelevant (pruned) ops are missing grads' test - // in gradients_test.ts for an example. - return []; - } - /** - * Internal method used by public APIs for tensor creation. Makes a new - * tensor with the provided shape, dtype and values. It always - * creates a new data id and writes the values to the underlying backend. - */ - makeTensor(values, shape, dtype, backend) { - if (values == null) { - throw new Error('Values passed to engine.makeTensor() are null'); - } - dtype = dtype || 'float32'; - backend = backend || this.backend; - let backendVals = values; - if (dtype === 'string' && isString(values[0])) { - backendVals = values.map(d => encodeString(d)); - } - const dataId = backend.write(backendVals, shape, dtype); - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - // Count bytes for string tensors. - if (dtype === 'string') { - const info = this.state.tensorInfo.get(dataId); - const newBytes = bytesFromStringArray(backendVals); - this.state.numBytes += newBytes - info.bytes; - info.bytes = newBytes; - } - return t; - } - /** - * Internal method used by backends. Makes a new tensor - * that is a wrapper around an existing data id. It doesn't create - * a new data id, only increments the ref count used in memory tracking. - */ - makeTensorFromDataId(dataId, shape, dtype, backend) { - dtype = dtype || 'float32'; - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - return t; - } - makeVariable(initialValue, trainable = true, name, dtype) { - name = name || this.nextVariableId().toString(); - if (dtype != null && dtype !== initialValue.dtype) { - initialValue = initialValue.cast(dtype); - } - const v = new Variable(initialValue, trainable, name, this.nextTensorId()); - if (this.state.registeredVariables[v.name] != null) { - throw new Error(`Variable with name ${v.name} was already registered`); - } - this.state.registeredVariables[v.name] = v; - this.incRef(v, this.backend); - return v; - } - trackTensor(a, backend) { - this.state.numTensors++; - if (a.dtype === 'string') { - this.state.numStringTensors++; - } - // Bytes for complex numbers are counted by their components. Bytes for - // string tensors are counted when writing values. - let bytes = 0; - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - bytes = a.size * bytesPerElement(a.dtype); - } - this.state.numBytes += bytes; - if (!this.state.tensorInfo.has(a.dataId)) { - this.state.numDataBuffers++; - this.state.tensorInfo.set(a.dataId, { - backend: backend || this.backend, - dtype: a.dtype, - shape: a.shape, - bytes - }); - } - if (!(a instanceof Variable)) { - this.track(a); - } - } - // Track the tensor by dataId and increase the refCount for the dataId in the - // backend. - // TODO(pyu10055): This is currently used by makeVariable method, to increase - // refCount on the backend for the dataId. It can potentially be replaced with - // Identity op indead of calling backend directly. - incRef(a, backend) { - this.trackTensor(a, backend); - this.backend.incRef(a.dataId); - } - removeDataId(dataId, backend) { - if (this.state.tensorInfo.has(dataId) && - this.state.tensorInfo.get(dataId).backend === backend) { - this.state.tensorInfo.delete(dataId); - this.state.numDataBuffers--; - } - } - disposeTensor(a) { - if (!this.state.tensorInfo.has(a.dataId)) { - return; - } - const info = this.state.tensorInfo.get(a.dataId); - this.state.numTensors--; - if (a.dtype === 'string') { - this.state.numStringTensors--; - this.state.numBytes -= info.bytes; - } - // Don't count bytes for complex numbers as they are counted by their - // components. - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - const bytes = a.size * bytesPerElement(a.dtype); - this.state.numBytes -= bytes; - } - // Remove the reference to dataId if backend dispose the data successfully - if (info.backend.disposeData(a.dataId)) { - this.removeDataId(a.dataId, info.backend); - } - // TODO(nsthorat): Construct an error and save the stack trace for - // debugging when in debug mode. Creating a stack trace is too expensive - // to do unconditionally. - } - disposeVariables() { - for (const varName in this.state.registeredVariables) { - const v = this.state.registeredVariables[varName]; - this.disposeVariable(v); - } - } - disposeVariable(v) { - this.disposeTensor(v); - if (this.state.registeredVariables[v.name] != null) { - delete this.state.registeredVariables[v.name]; - } - } - memory() { - const info = this.backend.memory(); - info.numTensors = this.state.numTensors; - info.numDataBuffers = this.state.numDataBuffers; - info.numBytes = this.state.numBytes; - if (this.state.numStringTensors > 0) { - info.unreliable = true; - if (info.reasons == null) { - info.reasons = []; - } - info.reasons.push('Memory usage by string tensors is approximate ' + - '(2 bytes per character)'); - } - return info; - } - async profile(query) { - this.state.profiling = true; - const startBytes = this.state.numBytes; - const startNumTensors = this.state.numTensors; - this.state.activeProfile.kernels = []; - this.state.activeProfile.result = await query(); - this.state.profiling = false; - this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot)); - this.state.activeProfile.newBytes = this.state.numBytes - startBytes; - this.state.activeProfile.newTensors = - this.state.numTensors - startNumTensors; - for (const kernel of this.state.activeProfile.kernels) { - kernel.kernelTimeMs = await kernel.kernelTimeMs; - kernel.extraInfo = await kernel.extraInfo; - } - return this.state.activeProfile; - } - isTapeOn() { - return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; - } - addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { - const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - gradientsFunc = gradConfig.gradFunc; - } - if (gradientsFunc != null) { - tapeNode.gradient = (dys) => { - // TODO(smilkov): To optimize back-prop, pass dys that are not used in - // the backprop graph to the user as null instead of zeros - dys = dys.map((dy, i) => { - if (dy == null) { - const output = outputs[i]; - const vals = makeZerosTypedArray(output.size, output.dtype); - return this.makeTensor(vals, output.shape, output.dtype); - } - return dy; - }); - // Grad functions of ops with single outputs expect a dy, while ops - // with multiple outputs expect dys (array of dy). - return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); - }; - } - this.state.activeTape.push(tapeNode); - } - keep(result) { - result.kept = true; - return result; - } - startTape() { - if (this.state.gradientDepth === 0) { - this.state.activeTape = []; - } - this.state.gradientDepth++; - } - endTape() { - this.state.gradientDepth--; - } - /** - * Start a scope. Use this with endScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - startScope(name) { - const scopeInfo = { - track: [], - name: 'unnamed scope', - id: this.state.nextScopeId++ - }; - if (name) { - scopeInfo.name = name; - } - this.state.scopeStack.push(scopeInfo); - this.state.activeScope = scopeInfo; - } - /** - * End a scope. Use this with startScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - endScope(result) { - const tensorsToTrackInParent = getTensorsInContainer(result); - const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id)); - // Dispose the arrays tracked in this scope. - for (let i = 0; i < this.state.activeScope.track.length; i++) { - const tensor = this.state.activeScope.track[i]; - if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) { - tensor.dispose(); - } - } - const oldScope = this.state.scopeStack.pop(); - this.state.activeScope = this.state.scopeStack.length === 0 ? - null : - this.state.scopeStack[this.state.scopeStack.length - 1]; - // Track the current result in the parent scope. - tensorsToTrackInParent.forEach(tensor => { - // Only track the tensor if was allocated in the inner scope and is not - // globally kept. - if (!tensor.kept && tensor.scopeId === oldScope.id) { - this.track(tensor); - } - }); - } - /** - * Returns gradients of `f` with respect to each of the `xs`. The gradients - * returned are of the same length as `xs`, but some might be null if `f` - * was not a function of that `x`. It also takes optional dy to multiply the - * gradient, which defaults to `1`. - */ - gradients(f, xs, dy, allowNoGradients = false) { - assert(xs.length > 0, () => 'gradients() received an empty list of xs.'); - if (dy != null && dy.dtype !== 'float32') { - throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); - } - const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f)); - assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.'); - // Filter out the nodes that don't connect x => y. - const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y); - if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { - throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + - 'that the f you passed encloses all operations that lead from x ' + - 'to y.'); - } - return this.tidy('backward', () => { - const accumulatedGradientMap = {}; - accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; - // Backprop gradients through the filtered nodes. - backpropagateGradients(accumulatedGradientMap, filteredTape, - // Pass the tidy function to avoid circular dep with `tape.ts`. - f => this.tidy(f), - // Pass an add function to avoide a circular dep with `tape.ts`. - add); - const grads = xs.map(x => accumulatedGradientMap[x.id]); - if (this.state.gradientDepth === 0) { - // This means that we are not computing higher-order gradients - // and can clean up the tape. - this.state.activeTape.forEach(node => { - for (const tensor of node.saved) { - tensor.dispose(); - } - }); - this.state.activeTape = null; - } - return { value: y, grads }; - }); - } - customGrad(f) { - assert(isFunction(f), () => 'The f passed in customGrad(f) must be a function.'); - return (...inputs) => { - assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' + - 'tensors'); - let res; - const inputMap = {}; - inputs.forEach((input, i) => { - inputMap[i] = input; - }); - const forwardFunc = (_, save) => { - res = f(...[...inputs, save]); - assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.value` is a tensor'); - assert(isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function.'); - return res.value; - }; - const backwardsFunc = (dy, saved) => { - const gradRes = res.gradFunc(dy, saved); - const grads = Array.isArray(gradRes) ? gradRes : [gradRes]; - assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'the same number of tensors as inputs passed to f(...).'); - assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'a list of only tensors.'); - const gradMap = {}; - grads.forEach((grad, i) => { - gradMap[i] = () => grad; - }); - return gradMap; - }; - return this.runKernelFunc({ - forwardFunc, - backwardsFunc, - inputs: inputMap, - }); - }; - } - readSync(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.readSync(dataId); - } - read(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.read(dataId); - } - async time(query) { - const start = now(); - const timingInfo = await this.backend.time(query); - timingInfo.wallMs = now() - start; - return timingInfo; - } - /** - * Tracks a Tensor in the current scope to be automatically cleaned up - * when the current scope ends, and returns the value. - * - * @param result The Tensor to track in the current scope. - */ - track(result) { - if (this.state.activeScope != null) { - result.scopeId = this.state.activeScope.id; - this.state.activeScope.track.push(result); - } - return result; - } - get registeredVariables() { - return this.state.registeredVariables; - } - /** - * Resets the engine state. Removes all backends but does not remove - * registered backend factories. - */ - reset() { - // Make any pending promise obsolete. - this.pendingBackendInitId++; - this.state.dispose(); - this.ENV.reset(); - this.state = new EngineState(); - for (const backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - this.backendName = null; - this.backendInstance = null; - this.pendingBackendInit = null; - } - } - Engine.nextTensorId = 0; - Engine.nextVariableId = 0; - function ones(shape) { - const values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); - return ENGINE.makeTensor(values, shape, 'float32'); - } - function getOrMakeEngine() { - const ns = getGlobalNamespace(); - if (ns._tfengine == null) { - const environment = new Environment(ns); - ns._tfengine = new Engine(environment); - } - setEnvironmentGlobal(ns._tfengine.ENV); - // Tell the current tensor interface that the global engine is responsible - // for tracking. - setTensorTracker(() => ns._tfengine); - return ns._tfengine; - } - const ENGINE = getOrMakeEngine(); - /** - * A implementation of the add op for use within engine and tape. - * - * This allows us to avoid a circular dependency between add.ts and engine. - * It is exported to be available in tape tests. - */ - function add(a, b) { - // We duplicate Add here to avoid a circular dependency with add.ts. - const inputs = { a, b }; - return ENGINE.runKernel(Add, inputs); - } - - /** - * @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 inferShape(val, dtype) { - let firstElem = val; - if (isTypedArray(val)) { - return dtype === 'string' ? [] : [val.length]; - } - if (!Array.isArray(val)) { - return []; // Scalar. - } - const shape = []; - while (Array.isArray(firstElem) || - isTypedArray(firstElem) && dtype !== 'string') { - shape.push(firstElem.length); - firstElem = firstElem[0]; - } - if (Array.isArray(val) && - env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) { - deepAssertShapeConsistency(val, shape, []); - } - return shape; - } - function deepAssertShapeConsistency(val, shape, indices) { - indices = indices || []; - if (!(Array.isArray(val)) && !isTypedArray(val)) { - assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` + - `but should be an array/TypedArray of ${shape[0]} elements`); - return; - } - assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` + - `but is an array of ${val.length} elements`); - assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` + - `elements, but has ${val.length} elements`); - const subShape = shape.slice(1); - for (let i = 0; i < val.length; ++i) { - deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); - } - } - function assertDtype(expectedDtype, actualDType, argName, functionName) { - if (expectedDtype === 'string_or_numeric') { - return; - } - if (expectedDtype == null) { - throw new Error(`Expected dtype cannot be null.`); - } - if (expectedDtype !== 'numeric' && expectedDtype !== actualDType || - expectedDtype === 'numeric' && actualDType === 'string') { - throw new Error(`Argument '${argName}' passed to '${functionName}' must ` + - `be ${expectedDtype} tensor, but got ${actualDType} tensor`); - } - } - function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') { - if (x instanceof Tensor) { - assertDtype(parseAsDtype, x.dtype, argName, functionName); - return x; - } - let inferredDtype = inferDtype(x); - // If the user expects a bool/int/float, use that info to update the - // inferredDtype when it is not a string. - if (inferredDtype !== 'string' && - ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) { - inferredDtype = parseAsDtype; - } - assertDtype(parseAsDtype, inferredDtype, argName, functionName); - if ((x == null) || - (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && - typeof x !== 'boolean' && typeof x !== 'string')) { - const type = x == null ? 'null' : x.constructor.name; - throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` + - `Tensor or TensorLike, but got '${type}'`); - } - const inferredShape = inferShape(x, inferredDtype); - if (!isTypedArray(x) && !Array.isArray(x)) { - x = [x]; - } - const skipTypedArray = true; - const values = inferredDtype !== 'string' ? - toTypedArray(x, inferredDtype) : - flatten(x, [], skipTypedArray); - return ENGINE.makeTensor(values, inferredShape, inferredDtype); - } - function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') { - if (!Array.isArray(arg)) { - throw new Error(`Argument ${argName} passed to ${functionName} must be a ` + - '`Tensor[]` or `TensorLike[]`'); - } - const tensors = arg; - return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype)); - } - - /** - * @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 OP_SCOPE_SUFFIX = '__op'; - /** - * Used for wrapping functions that perform math operations on - * Tensors. The function will be wrapped in a named scope that cleans all - * memory usage after the function is done. - */ - function op(f) { - const keys = Object.keys(f); - if (keys.length !== 1) { - throw new Error(`Please provide an object with a single key ` + - `(operation name) mapping to a function. Got an object with ` + - `${keys.length} keys.`); - } - let opName = keys[0]; - const fn = f[opName]; - // Strip the underscore from the end of the function name. - if (opName.endsWith('_')) { - opName = opName.substring(0, opName.length - 1); - } - // add an __op suffix to distinguish ops from kernels in tf.profile - opName = opName + OP_SCOPE_SUFFIX; - // tslint:disable-next-line:no-any - const f2 = (...args) => { - ENGINE.startScope(opName); - try { - const result = fn(...args); - if (isPromise(result)) { - console.error('Cannot return a Promise inside of tidy.'); - } - ENGINE.endScope(result); - return result; - } - catch (ex) { - ENGINE.endScope(null); - throw ex; - } - }; - Object.defineProperty(f2, 'name', { value: opName, configurable: true }); - // tslint:disable-next-line:no-any - return f2; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes absolute value element-wise: `abs(x)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.abs().print(); // or tf.abs(x) - * ``` - * @param x The input `tf.Tensor`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function abs_(x) { - const $x = convertToTensor(x, 'x', 'abs'); - if ($x.dtype === 'complex64') { - const inputs = { x: $x }; - return ENGINE.runKernel(ComplexAbs, inputs); - } - else { - const inputs = { x: $x }; - return ENGINE.runKernel(Abs, inputs); - } - } - const abs = op({ abs_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes acos of the input `tf.Tensor` element-wise: `acos(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.acos().print(); // or tf.acos(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function acos_(x) { - const $x = convertToTensor(x, 'x', 'acos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acos, inputs); - } - const acos = op({ acos_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise: - * `acosh(x)` - * - * ```js - * const x = tf.tensor1d([10, 1, 3, 5.7]); - * - * x.acosh().print(); // or tf.acosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function acosh_(x) { - const $x = convertToTensor(x, 'x', 'acosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acosh, inputs); - } - const acosh = op({ acosh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting. - * - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * - * ```js - * // Broadcast add a with b. - * const a = tf.scalar(5); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * @param a The first `tf.Tensor` to add. - * @param b The second `tf.Tensor` to add. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function add_(a, b) { - let $a = convertToTensor(a, 'a', 'add'); - let $b = convertToTensor(b, 'b', 'add'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Add, inputs); - } - const add$1 = op({ add_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the logical and of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.all().print(); // or tf.all(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.all(axis).print(); // or tf.all(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function all_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'all', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(All, inputs, attrs); - } - const all = op({ all_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the logical or of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.any().print(); // or tf.any(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.any(axis).print(); // or tf.any(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function any_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'any', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Any, inputs, attrs); - } - // tslint:disable-next-line:variable-name - const any = op({ any_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Returns the indices of the maximum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMax().print(); // or tf.argMax(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMax(axis).print(); // or tf.argMax(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function argMax_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMax'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMax, inputs, attrs); - } - const argMax = op({ argMax_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Returns the indices of the minimum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMin().print(); // or tf.argMin(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMin(axis).print(); // or tf.argMin(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function argMin_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMin'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMin, inputs, attrs); - } - const argMin = op({ argMin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes asin of the input `tf.Tensor` element-wise: `asin(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asin().print(); // or tf.asin(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function asin_(x) { - const $x = convertToTensor(x, 'x', 'asin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asin, inputs); - } - const asin = op({ asin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise: - * `asinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asinh().print(); // or tf.asinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function asinh_(x) { - const $x = convertToTensor(x, 'x', 'asinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asinh, inputs); - } - const asinh = op({ asinh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes atan of the input `tf.Tensor` element-wise: `atan(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.atan().print(); // or tf.atan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atan_(x) { - const $x = convertToTensor(x, 'x', 'atan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atan, inputs); - } - const atan = op({ atan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]); - * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]); - * - * tf.atan2(a, b).print() - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atan2_(a, b) { - let $a = convertToTensor(a, 'a', 'atan2'); - let $b = convertToTensor(b, 'b', 'atan2'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Atan2, inputs); - } - const atan2 = op({ atan2_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise: - * `atanh(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.atanh().print(); // or tf.atanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atanh_(x) { - const $x = convertToTensor(x, 'x', 'atanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atanh, inputs); - } - const atanh = op({ atanh_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Casts a `tf.Tensor` to a new dtype. - * - * ```js - * const x = tf.tensor1d([1.5, 2.5, 3]); - * tf.cast(x, 'int32').print(); - * ``` - * @param x The input tensor to be casted. - * @param dtype The dtype to cast the input tensor to. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function cast_(x, dtype) { - const $x = convertToTensor(x, 'x', 'cast'); - // Sanity checks. - if (!isValidDtype(dtype)) { - throw new Error(`Failed to cast to unknown dtype ${dtype}`); - } - if (dtype === 'string' && $x.dtype !== 'string' || - dtype !== 'string' && $x.dtype === 'string') { - throw new Error('Only strings can be casted to strings'); - } - const inputs = { x: $x }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, inputs, attrs); - } - const cast = op({ cast_ }); - - /** - * @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. - * ============================================================================= - */ - function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') { - const [filterHeight, filterWidth] = parseTupleParam(filterSize); - let filterShape; - if (dataFormat === 'channelsLast') { - filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; - } - else if (dataFormat === 'channelsFirst') { - filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); - } - /** - * Computes the information for a forward pass of a convolution/pooling - * operation. - */ - function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') { - let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; - if (dataFormat === 'channelsLast') { - [batchSize, inHeight, inWidth, inChannels] = inShape; - } - else if (dataFormat === 'channelsFirst') { - [batchSize, inChannels, inHeight, inWidth] = inShape; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - const [filterHeight, filterWidth, , filterChannels] = filterShape; - const [strideHeight, strideWidth] = parseTupleParam(strides); - const [dilationHeight, dilationWidth] = parseTupleParam(dilations); - const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); - const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); - const outChannels = depthwise ? filterChannels * inChannels : filterChannels; - let outShape; - if (dataFormat === 'channelsFirst') { - outShape = [batchSize, outChannels, outHeight, outWidth]; - } - else if (dataFormat === 'channelsLast') { - outShape = [batchSize, outHeight, outWidth, outChannels]; - } - return { - batchSize, - dataFormat, - inHeight, - inWidth, - inChannels, - outHeight, - outWidth, - outChannels, - padInfo, - strideHeight, - strideWidth, - filterHeight, - filterWidth, - effectiveFilterHeight, - effectiveFilterWidth, - dilationHeight, - dilationWidth, - inShape, - outShape, - filterShape - }; - } - function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) { - if (zeroPad == null) { - zeroPad = computeDefaultPad(inShape, fieldSize, stride); - } - const inputRows = inShape[0]; - const inputCols = inShape[1]; - const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - return [outputRows, outputCols]; - } - function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) { - const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); - return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); - } - function parseTupleParam(param) { - if (typeof param === 'number') { - return [param, param, param]; - } - if (param.length === 2) { - return [param[0], param[1], 1]; - } - return param; - } - /* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d - * Atrous convolution is equivalent to standard convolution with upsampled - * filters with effective_filter_height = - * filter_height + (filter_height - 1) * (dilation - 1) - * and effective_filter_width = - * filter_width + (filter_width - 1) * (dilation - 1), - * produced by inserting dilation - 1 zeros along consecutive elements across - * the filters' spatial dimensions. - * When there is a dilation, this converts a filter dimension to the - * effective filter dimension, so it can be used in a standard convolution. - */ - function getEffectiveFilterSize(filterSize, dilation) { - if (dilation <= 1) { - return filterSize; - } - return filterSize + (filterSize - 1) * (dilation - 1); - } - function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { - let padInfo; - let outHeight; - let outWidth; - if (typeof pad === 'number') { - const padType = (pad === 0) ? 'VALID' : 'NUMBER'; - padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; - const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode); - outHeight = outShape[0]; - outWidth = outShape[1]; - } - else if (pad === 'same') { - outHeight = Math.ceil(inHeight / strideHeight); - outWidth = Math.ceil(inWidth / strideWidth); - const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); - const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); - const top = Math.floor(padAlongHeight / 2); - const bottom = padAlongHeight - top; - const left = Math.floor(padAlongWidth / 2); - const right = padAlongWidth - left; - padInfo = { top, bottom, left, right, type: 'SAME' }; - } - else if (pad === 'valid') { - padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; - outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); - outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); - } - else if (typeof pad === 'object') { - const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0]; - const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1]; - const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0]; - const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1]; - const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ? - 'VALID' : - 'EXPLICIT'; - padInfo = { top, bottom, left, right, type: padType }; - outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); - outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); - } - else { - throw Error(`Unknown padding parameter: ${pad}`); - } - return { padInfo, outHeight, outWidth }; - } - /** - * Rounds a value depending on the rounding mode - * @param value - * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function round(value, roundingMode) { - if (!roundingMode) { - return Math.trunc(value); - } - switch (roundingMode) { - case 'round': - // used for Caffe Conv - return Math.round(value); - case 'ceil': - // used for Caffe Pool - return Math.ceil(value); - case 'floor': - return Math.floor(value); - default: - throw new Error(`Unknown roundingMode ${roundingMode}`); - } - } - function tupleValuesAreOne(param) { - const [dimA, dimB, dimC] = parseTupleParam(param); - return dimA === 1 && dimB === 1 && dimC === 1; - } - function eitherStridesOrDilationsAreOne(strides, dilations) { - return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Reshapes a `tf.Tensor` to a given shape. - * - * Given an input tensor, returns a new tensor with the same values as the - * input tensor with shape `shape`. - * - * If one component of shape is the special value -1, the size of that - * dimension is computed so that the total size remains constant. In - * particular, a shape of [-1] flattens into 1-D. At most one component of - * shape can be -1. - * - * If shape is 1-D or higher, then the operation returns a tensor with shape - * shape filled with the values of tensor. In this case, the number of - * elements implied by shape must be the same as the number of elements in - * tensor. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.reshape([2, 2]).print(); - * ``` - * - * @param x The input tensor to be reshaped. - * @param shape An array of integers defining the output tensor shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function reshape_(x, shape) { - const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric'); - const inputs = { x: $x }; - const attrs = { shape }; - return ENGINE.runKernel(Reshape, inputs, attrs); - } - const reshape = op({ reshape_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the 2D average pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'avgPool', 'float32'); - const dilations = 1; - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - let res = ENGINE.runKernel(AvgPool, inputs, attrs); - res = cast(res, $x.dtype); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const avgPool = op({ avgPool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a new tensor with the same values and shape as the specified - * tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * - * x.clone().print(); - * ``` - * - * @param x The tensor to clone. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function clone_(x) { - const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric'); - const inputs = { x: $x }; - // Note this op is called tf.identity in python. Hence the kernel name used - // here. - return ENGINE.runKernel(Identity, inputs); - } - const clone = op({ clone_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Concatenates a list of `tf.Tensor`s along a given axis. - * - * The tensors ranks and types must match, and their sizes must match in all - * dimensions except `axis`. - * - * Also available are stricter rank-specific methods that assert that - * `tensors` are of the given rank: - * - `tf.concat1d` - * - `tf.concat2d` - * - `tf.concat3d` - * - `tf.concat4d` - * - * Except `tf.concat1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * a.concat(b).print(); // or a.concat(b) - * ``` - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.concat([a, b, c]).print(); - * ``` - * - * ```js - * const a = tf.tensor2d([[1, 2], [10, 20]]); - * const b = tf.tensor2d([[3, 4], [30, 40]]); - * const axis = 1; - * tf.concat([a, b], axis).print(); - * ``` - * @param tensors A list of tensors to concatenate. - * @param axis The axis to concate along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function concat_(tensors, axis = 0) { - assert(tensors.length >= 1, () => 'Pass at least one tensor to concat'); - const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric'); - if ($tensors[0].dtype === 'complex64') { - $tensors.forEach(tensor => { - if (tensor.dtype !== 'complex64') { - throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${tensor.dtype}. `); - } - }); - } - if ($tensors.length === 1) { - return clone($tensors[0]); - } - const inputs = $tensors; - const attr = { axis }; - return ENGINE.runKernel(Concat, inputs, attr); - } - const concat = op({ concat_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the dot product of two matrices, A * B. These must be matrices. - * - * ```js - * const a = tf.tensor2d([1, 2], [1, 2]); - * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.matMul(b).print(); // or tf.matMul(a, b) - * ``` - * @param a First matrix in dot product operation. - * @param b Second matrix in dot product operation. - * @param transposeA If true, `a` is transposed before multiplication. - * @param transposeB If true, `b` is transposed before multiplication. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function matMul_(a, b, transposeA = false, transposeB = false) { - let $a = convertToTensor(a, 'a', 'matMul'); - let $b = convertToTensor(b, 'b', 'matMul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - const attrs = { transposeA, transposeB }; - return ENGINE.runKernel(BatchMatMul, inputs, attrs); - } - const matMul = op({ matMul_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting. - * - * We also expose `tf.mulStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([2, 3, 4, 5]); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * - * ```js - * // Broadcast mul a with b. - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.scalar(5); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * @param a The first tensor to multiply. - * @param b The second tensor to multiply. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function mul_(a, b) { - let $a = convertToTensor(a, 'a', 'mul'); - let $b = convertToTensor(b, 'b', 'mul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Multiply, inputs); - } - const mul = op({ mul_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes sigmoid element-wise, `1 / (1 + exp(-x))` - * - * ```js - * const x = tf.tensor1d([0, -1, 2, -3]); - * - * x.sigmoid().print(); // or tf.sigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sigmoid_(x) { - const $x = convertToTensor(x, 'x', 'sigmoid'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sigmoid, inputs); - } - const sigmoid = op({ sigmoid_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Extracts a slice from a `tf.Tensor` starting at coordinates `begin` - * and is of size `size`. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `x` is of the given rank: - * - `tf.slice1d` - * - `tf.slice2d` - * - `tf.slice3d` - * - `tf.slice4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.slice([1], [2]).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * x.slice([1, 0], [1, 2]).print(); - * ``` - * @param x The input `tf.Tensor` to slice from. - * @param begin The coordinates to start the slice from. The length can be - * less than the rank of x - the rest of the axes will have implicit 0 as - * start. Can also be a single number, in which case it specifies the - * first axis. - * @param size The size of the slice. The length can be less than the rank of - * x - the rest of the axes will have implicit -1. A value of -1 requests - * the rest of the dimensions in the axis. Can also be a single number, - * in which case it specifies the size of the first axis. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function slice_(x, begin, size) { - const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric'); - if ($x.rank === 0) { - throw new Error('Slicing scalar is not possible'); - } - const inputs = { x: $x }; - const attrs = { begin, size }; - return ENGINE.runKernel(Slice, inputs, attrs); - } - const slice = op({ slice_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, 70]); - * - * x.tanh().print(); // or tf.tanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function tanh_(x) { - const $x = convertToTensor(x, 'x', 'tanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tanh, inputs); - } - const tanh = op({ tanh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of - * shape `blockShape + [batch]`, interleaves these blocks back into the grid - * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with - * the same rank as the input. The spatial dimensions of this intermediate - * result are then optionally cropped according to `crops` to produce the - * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise - * description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); - * const blockShape = [2, 2]; - * const crops = [[0, 0], [0, 0]]; - * - * x.batchToSpaceND(blockShape, crops).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required - * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]` - * - * This operation is equivalent to the following steps: - * - * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ..., - * blockShape[M-1], batch / prod(blockShape), x.shape[1], ..., - * x.shape[N-1]]` - * - * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch / - * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M], - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch / - * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] * - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted` - * according to `crops` to produce the output of shape: `[batch / - * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1], - * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] - - * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function batchToSpaceND_(x, blockShape, crops) { - const $x = convertToTensor(x, 'x', 'batchToSpaceND'); - const prod = blockShape.reduce((a, b) => a * b); - assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); - assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); - assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` + - `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`); - const inputs = { x: $x }; - const attrs = { blockShape, crops }; - return ENGINE.runKernel(BatchToSpaceND, inputs, attrs); - } - const batchToSpaceND = op({ batchToSpaceND_ }); - - function xAs4D(x) { - let x4D; - if (x.rank === 0 || x.rank === 1) { - x4D = reshape(x, [1, 1, 1, x.size]); - } - else if (x.rank === 2) { - x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]); - } - else if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - else { - x4D = x; - } - return x4D; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Batch normalization. - * - * As described in - * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167). - * - * Mean, variance, scale, and offset can be of two shapes: - * - The same shape as the input. - * - In the common case, the depth dimension is the last dimension of x, so - * the values would be an `tf.Tensor1D` of shape [depth]. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that parameters passed are of given rank - * - `tf.batchNorm2d` - * - `tf.batchNorm3d` - * - `tf.batchNorm4d` - * - * @param x The input Tensor. - * @param mean A mean Tensor. - * @param variance A variance Tensor. - * @param offset An offset Tensor. - * @param scale A scale Tensor. - * @param varianceEpsilon A small float number to avoid dividing by 0. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) { - if (varianceEpsilon == null) { - varianceEpsilon = 0.001; - } - const $x = convertToTensor(x, 'x', 'batchNorm'); - const $mean = convertToTensor(mean, 'mean', 'batchNorm'); - const $variance = convertToTensor(variance, 'variance', 'batchNorm'); - let $scale; - if (scale != null) { - $scale = convertToTensor(scale, 'scale', 'batchNorm'); - } - let $offset; - if (offset != null) { - $offset = convertToTensor(offset, 'offset', 'batchNorm'); - } - assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' + - 'equal ranks.'); - assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' + - 'equal ranks.'); - assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' + - 'equal ranks.'); - const x4D = xAs4D($x); - const inputs = { - x: x4D, - scale: $scale, - offset: $offset, - mean: $mean, - variance: $variance - }; - const attrs = { varianceEpsilon }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs); - return reshape(res, $x.shape); - } - const batchNorm = op({ batchNorm_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Broadcast an array to a compatible shape NumPy-style. - * - * The tensor's shape is compared to the broadcast shape from end to beginning. - * Ones are prepended to the tensor's shape until is has the same length as - * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is - * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then - * the input tensor is tiled N times along that axis (using tf.tile). - * - * @param input The tensor that is to be broadcasted. - * @param shape The input is to be broadcast to this shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function broadcastTo_(x, shape) { - let input = convertToTensor(x, 'broadcastTo', 'x'); - const xShape = input.shape; - if (shape.some(d => !(d > 0) || d % 1 !== 0)) { - throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); - } - if (shape.length < input.rank) { - throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`); - } - if (shape.length > input.rank) { - const newShape = input.shape.slice(); - while (newShape.length < shape.length) { - newShape.unshift(1); - } - input = reshape(input, newShape); - } - const inputShape = input.shape; - const reps = Array.from(shape); - for (let i = shape.length - 1; i >= 0; i--) { - if (inputShape[i] === shape[i]) { - reps[i] = 1; - } - else if (input.shape[i] !== 1) { - throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); - } - } - const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0); - if (axes.length === 0) { - return clone(input); - } - // TODO call broadcastTo kernel directly once backends implement broadcstTo - const inputs = { x: input }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); - } - const broadcastTo = op({ broadcastTo_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)` - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.ceil().print(); // or tf.ceil(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function ceil_(x) { - const $x = convertToTensor(x, 'x', 'ceil'); - const inputs = { x: $x }; - return ENGINE.runKernel(Ceil, inputs); - } - const ceil = op({ ceil_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) - * ``` - * @param x The input tensor. - * @param clipValueMin Lower-bound of range to be clipped to. - * @param clipValueMax Upper-bound of range to be clipped to. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function clipByValue_(x, clipValueMin, clipValueMax) { - const $x = convertToTensor(x, 'x', 'clipByValue'); - assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` + - `less than or equal to max (${clipValueMax}).`); - const inputs = { x: $x }; - const attrs = { clipValueMin, clipValueMax }; - return ENGINE.runKernel(ClipByValue, inputs, attrs); - } - const clipByValue = op({ clipByValue_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Converts two real numbers to a complex number. - * - * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], - * where r represents the real part and i represents the imag part. - * - * The input tensors real and imag must have the same shape. - * - * ```js - * const real = tf.tensor1d([2.25, 3.25]); - * const imag = tf.tensor1d([4.75, 5.75]); - * const complex = tf.complex(real, imag); - * - * complex.print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function complex_(real, imag) { - const $real = convertToTensor(real, 'real', 'complex'); - const $imag = convertToTensor(imag, 'imag', 'complex'); - assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` + - `must match in call to tf.complex().`); - const inputs = { real: $real, imag: $imag }; - return ENGINE.runKernel(Complex, inputs); - } - const complex = op({ complex_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes a 2D convolution over the input x. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2d'); - const $filter = convertToTensor(filter, 'filter', 'conv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` + - `input depth for filter ${$filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const conv2d = op({ conv2d_ }); - - /** - * Computes a 1D convolution over the input x. - * - * @param x The input tensor, of rank 3 or rank 2, of shape - * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed. - * @param filter The filter, rank 3, of shape - * `[filterWidth, inDepth, outDepth]`. - * @param stride The number of entries by which the filter is moved right at - * each step. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat An optional string from "NWC", "NCW". Defaults to "NWC", - * the data is stored in the order of [batch, in_width, in_channels]. Only - * "NWC" is currently supported. - * @param dilation The dilation rate in which we sample input values in - * atrous convolution. Defaults to `1`. If it is greater than 1, then - * stride must be `1`. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv1d'); - const $filter = convertToTensor(filter, 'filter', 'conv1d'); - let x3D = $x; - let reshapedTo3D = false; - if ($x.rank === 2) { - reshapedTo3D = true; - x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]); - } - assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); - assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` + - `input depth for filter ${$filter.shape[1]}.`); - assert(eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' + - `Got stride ${stride} and dilation '${dilation}'`); - assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`); - const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]); - const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]); - const strides = [1, stride]; - const dilations = [1, dilation]; - const conv2dDataFormat = 'NHWC'; - const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); - if (reshapedTo3D) { - return reshape(res, [res.shape[2], res.shape[3]]); - } - return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]); - } - const conv1d = op({ conv1d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the input of a 2D convolution. - * - * @param xShape The shape of the input: [batch, height, width, inDepth]. - * If length of 3, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 4 or rank 3 of shape - * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape4D = xShape; - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - xShape4D = [1, xShape[0], xShape[1], xShape[2]]; - } - assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` + - `${xShape4D.length}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` + - `rank ${dy4D.rank}`); - assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` + - `rank ${filter.rank}`); - const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[2]}.`); - assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[3]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const conv2DBackpropInput = op({ conv2DBackpropInput_ }); - - /** - * Computes the transposed 2D convolution of an image, also known as a - * deconvolution. - * - * @param x The input image, of rank 4 or rank 3, of shape - * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, outDepth, inDepth]`. - * `inDepth` must match `inDepth` in `x`. - * @param outputShape Output shape, of rank 4 or rank 3: - * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed. - * @param strides The strides of the original convolution: - * `[strideHeight, strideWidth]`. - * @param pad The type of padding algorithm used in the non-transpose version - * of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2dTranspose'); - const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose'); - return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode); - } - const conv2dTranspose = op({ conv2dTranspose_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the input of a 3D convolution. - * - * @param xShape The shape of the input: [batch, depth, height, width, - * in_channels]. If length of 4, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 5 or rank 4 of shape - * `[batch, outDepth, outHeight, outWidth, in_channels]`. - * If rank 4, batch of 1 is assumed. - * @param filter The filter, rank 5, of shape - * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideDepth, strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - */ - function conv3DBackpropInput_(xShape, dy, filter, strides, pad) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape5D = xShape; - let dy5D = dy; - let reshapedTo5D = false; - if (dy.rank === 4) { - reshapedTo5D = true; - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; - } - const inDepth = xShape5D[4]; - const outDepth = dy5D.shape[4]; - assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` + - `${xShape5D.length}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` + - `rank ${dy5D.rank}`); - assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` + - `rank ${filter.rank}`); - assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[3]}.`); - assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[4]}.`); - const inputs = { dy: dy5D, filter }; - const attrs = { pad, strides, inputShape: xShape5D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const conv3DBackpropInput = op({ conv3DBackpropInput_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes cos of the input `tf.Tensor` element-wise: `cos(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.cos().print(); // or tf.cos(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function cos_(x) { - const $x = convertToTensor(x, 'x', 'cos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cos, inputs); - } - const cos = op({ cos_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.cosh().print(); // or tf.cosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function cosh_(x) { - const $x = convertToTensor(x, 'x', 'cosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cosh, inputs); - } - const cosh = op({ cosh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the cumulative sum of a `tf.Tensor` along `axis`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4]); - * x.cumsum().print(); - * ``` - * ```js - * const x = tf.tensor([[1, 2], [3, 4]]); - * x.cumsum().print(); - * ``` - * - * @param x The input tensor to be summed. - * @param axis The axis along which to sum. Optional. Defaults to 0. - * @param exclusive Whether to perform exclusive cumulative sum. Optional. - * Defaults to false. If set to true then the sum of each tensor entry - * does not include its own value, but only the values previous to it - * along the specified axis. - * @param reverse Whether to sum in the opposite direction. Optional. - * Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Scan'} - */ - function cumsum_(x, axis = 0, exclusive = false, reverse = false) { - const $x = convertToTensor(x, 'x', 'cumsum'); - const inputs = { x: $x }; - const attrs = { axis, exclusive, reverse }; - return ENGINE.runKernel(Cumsum, inputs, attrs); - } - const cumsum = op({ cumsum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Rearranges data from depth into blocks of spatial data. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `blockSize` indicates the input block size and how the data is - * moved. - * - * - Chunks of data of size `blockSize * blockSize` from depth are rearranged - * into non-overlapping blocks of size `blockSize x blockSize` - * - * - The width the output tensor is `inputWidth * blockSize`, whereas the - * height is `inputHeight * blockSize` - * - * - The Y, X coordinates within each block of the output image are determined - * by the high order component of the input channel index - * - * - The depth of the input tensor must be divisible by `blockSize * - * blockSize` - * - * The `dataFormat` attr specifies the layout of the input and output tensors - * with the following options: "NHWC": [ `batch, height, width, channels` ] - * "NCHW": [ `batch, channels, height, width` ] - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]); - * const blockSize = 2; - * const dataFormat = "NHWC"; - * - * tf.depthToSpace(x, blockSize, dataFormat).print(); - * ``` - * - * @param x The input tensor of rank 4 - * @param blockSIze An `int` that is `>= 2`. The size of the spatial block - * @param dataFormat An optional string from: "NHWC", "NCHW". Defaults to "NHWC" - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function depthToSpace_(x, blockSize, dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'depthToSpace'); - const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2]; - const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3]; - const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1]; - assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputHeight} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputWidth} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); - const inputs = { x: $x }; - const attrs = { blockSize, dataFormat }; - return ENGINE.runKernel(DepthToSpace, inputs, attrs); - } - const depthToSpace = op({ depthToSpace_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Depthwise 2D convolution. - * - * Given a 4D `input` array and a `filter` array of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing - * `inChannels` convolutional filters of depth 1, this op applies a - * different filter to each input channel (expanding from 1 channel to - * `channelMultiplier` channels for each), then concatenates the results - * together. The output has `inChannels * channelMultiplier` channels. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'depthwiseConv2d'); - const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` + - `(${x4D.shape[3]}) must match the inChannels dimension in ` + - `filter ${$filter.shape[2]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const depthwiseConv2d = op({ depthwiseConv2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the grayscale dilation over the input `x`. - * - * @param x The input tensor, rank 3 or rank 4 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filter The filter tensor, rank 3, of shape - * `[filterHeight, filterWidth, depth]`. - * @param strides The strides of the sliding window for each dimension of the - * input tensor: `[strideHeight, strideWidth]`. - * If `strides` is a single number, - * then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1*1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat Specify the data format of the input and output data. - * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations` - * is a single number, then `dilationHeight == dilationWidth`. If it is - * greater than 1, then all values of `strides` must be 1. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'dilation2d'); - const $filter = convertToTensor(filter, 'filter', 'dilation2d'); - assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` + - `${$x.rank}.`); - assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` + - `but got dataFormat of ${dataFormat}`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - reshapedTo4D = true; - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dilations }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Dilation2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const dilation2d = op({ dilation2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * The result is rounded with floor function. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.floorDiv(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.floorDiv(b).print(); // or tf.floorDiv(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function floorDiv_(a, b) { - let $a = convertToTensor(a, 'a', 'floorDiv'); - let $b = convertToTensor(b, 'b', 'floorDiv'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(FloorDiv, inputs); - } - const floorDiv = op({ floorDiv_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function div_(a, b) { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'int32' && $b.dtype === 'int32') { - return floorDiv($a, $b); - } - const inputs = { a: $a, b: $b }; - const attrs = {}; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(RealDiv, inputs, attrs); - } - const div = op({ div_ }); - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Returns the axes in the output space that should be reduced to produce - * the input space. - */ - function getReductionAxes(inShape, outShape) { - const result = []; - for (let i = 0; i < outShape.length; i++) { - const inDim = inShape[inShape.length - i - 1]; - const outAxis = outShape.length - i - 1; - const outDim = outShape[outAxis]; - if (inDim == null || (inDim === 1 && outDim > 1)) { - result.unshift(outAxis); - } - } - return result; - } - function assertAndGetBroadcastShape(shapeA, shapeB) { - const result = []; - const l = Math.max(shapeA.length, shapeB.length); - for (let i = 0; i < l; i++) { - let a = shapeA[shapeA.length - i - 1]; - if (a == null) { - a = 1; - } - let b = shapeB[shapeB.length - i - 1]; - if (b == null) { - b = 1; - } - if (a === 1) { - result.unshift(b); - } - else if (b === 1) { - result.unshift(a); - } - else if (a !== b) { - const errMsg = `Operands could not be broadcast together with shapes ` + - `${shapeA} and ${shapeB}.`; - throw Error(errMsg); - } - else { - result.unshift(a); - } - } - return result; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a == b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.equal(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function equal_(a, b) { - let $a = convertToTensor(a, 'a', 'equal'); - let $b = convertToTensor(b, 'b', 'equal'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Equal, inputs); - } - const equal = op({ equal_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the elements, either `a` or `b` depending on the `condition`. - * - * If the condition is true, select from `a`, otherwise select from `b`. - * - * ```js - * const cond = tf.tensor1d([false, false, true], 'bool'); - * const a = tf.tensor1d([1 , 2, 3]); - * const b = tf.tensor1d([-1, -2, -3]); - * - * a.where(cond, b).print(); - * ``` - * - * @param condition The input condition. Must be of dtype bool. - * @param a If `condition` is rank 1, `a` may have a higher rank but - * its first dimension must match the size of `condition`. - * @param b A tensor with the same dtype as `a` and with shape that is - * compatible with `a`. - * @return A tensor with same dtype as `a` and `b`, and shape that is - * broadcastable from `a` and `b`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function where_(condition, a, b) { - const $a = convertToTensor(a, 'a', 'where'); - const $b = convertToTensor(b, 'b', '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); - const $broadcastedA = broadcastTo($a, broadcastShape); - const $broadcastedB = broadcastTo($b, broadcastShape); - const inputs = { - condition: $broadcastedCondition, - t: $broadcastedA, - e: $broadcastedB - }; - return ENGINE.runKernel(Select, inputs); - } - const where = op({ where_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.zerosLike(x).print(); - * ``` - * - * @param x The tensor of required shape. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function zerosLike_(x) { - const $x = convertToTensor(x, 'x', 'zerosLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(ZerosLike, inputs); - } - const zerosLike = op({ zerosLike_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 - * if denominator is 0. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * const c = tf.tensor1d([0, 0, 0, 0]); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * const c = tf.scalar(0); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function divNoNan_(a, b) { - // TODO: Make this into its own kernel. - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - const divResult = div($a, $b); - const zeros = zerosLike(divResult); - const bEqualsZero = equal($b, zeros); - return where(bEqualsZero, zeros, divResult); - } - const divNoNan = op({ divNoNan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the dot product of two matrices and/or vectors, `t1` and `t2`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor2d([[1, 2], [3, 4]]); - * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * - * a.dot(b).print(); // or tf.dot(a, b) - * b.dot(a).print(); - * b.dot(c).print(); - * ``` - * @param t1 The first tensor in the dot operation. - * @param t2 The second tensor in the dot operation. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function dot_(t1, t2) { - const $t1 = convertToTensor(t1, 't1', 'dot'); - const $t2 = convertToTensor(t2, 't2', 'dot'); - assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` + - `${$t1.rank} and ${$t2.rank}.`); - const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); - const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); - assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` + - `${t1Inner} and ${t2Inner}.`); - if ($t1.rank === 1 && $t2.rank === 1) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, []); - } - else if ($t1.rank === 1 && $t2.rank === 2) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, [t1t2.size]); - } - else if ($t1.rank === 2 && $t2.rank === 1) { - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul($t1, t22D); - return reshape(t1t2, [t1t2.size]); - } - else { - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul($t1, t22D); - return t1t2; - } - } - const dot = op({ dot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`. - * - * ```js - * const x = tf.tensor1d([-1, 1, -3, 2]); - * - * x.elu().print(); // or tf.elu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function elu_(x) { - const $x = convertToTensor(x, 'x', 'elu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Elu, inputs); - } - const elu = op({ elu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes gause error function of the input `tf.Tensor` element-wise: - * `erf(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.erf().print(); // or tf.erf(x); - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function erf_(x) { - let $x = convertToTensor(x, 'x', 'erf'); - assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.'); - if ($x.dtype === 'int32') { - $x = cast($x, 'float32'); - } - const inputs = { x: $x }; - return ENGINE.runKernel(Erf, inputs); - } - const erf = op({ erf_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.exp().print(); // or tf.exp(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function exp_(x) { - const $x = convertToTensor(x, 'x', 'exp'); - const inputs = { x: $x }; - return ENGINE.runKernel(Exp, inputs); - } - const exp = op({ exp_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension - * into the tensor's shape. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const axis = 1; - * x.expandDims(axis).print(); - * ``` - * - * @param x The input tensor whose dimensions to be expanded. - * @param axis The dimension index at which to insert shape of `1`. Defaults - * to 0 (the first dimension). - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function expandDims_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric'); - assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor'); - const inputs = { input: $x }; - const attrs = { dim: axis }; - return ENGINE.runKernel(ExpandDims, inputs, attrs); - } - const expandDims = op({ expandDims_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential of the input `tf.Tensor` minus one element-wise. - * `e ^ x - 1` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.expm1().print(); // or tf.expm1(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function expm1_(x) { - const $x = convertToTensor(x, 'x', 'expm1'); - const inputs = { x: $x }; - return ENGINE.runKernel(Expm1, inputs); - } - const expm1 = op({ expm1_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Construct a tensor by repeating it the number of times given by reps. - * - * This operation creates a new tensor by replicating `input` `reps` - * times. The output tensor's i'th dimension has `input.shape[i] * - * reps[i]` elements, and the values of `input` are replicated - * `reps[i]` times along the i'th dimension. For example, tiling - * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * - * a.tile([2]).print(); // or a.tile([2]) - * ``` - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.tile([1, 2]).print(); // or a.tile([1, 2]) - * ``` - * @param x The tensor to tile. - * @param reps Determines the number of replications per dimension. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function tile_(x, reps) { - const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric'); - assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of reps ${reps}.`); - const inputs = { x: $x }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); - } - const tile = op({ tile_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes floor of input `tf.Tensor` element-wise: `floor(x)`. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.floor().print(); // or tf.floor(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function floor_(x) { - const $x = convertToTensor(x, 'x', 'floor'); - const inputs = { x: $x }; - return ENGINE.runKernel(Floor, inputs); - } - const floor = op({ floor_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Gather slices from tensor `x`'s axis `axis` according to `indices`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const indices = tf.tensor1d([1, 3, 3], 'int32'); - * - * x.gather(indices).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const indices = tf.tensor1d([1, 1, 0], 'int32'); - * - * x.gather(indices).print(); - * ``` - * @param x The input tensor whose slices to be gathered. - * @param indices The indices of the values to extract. - * @param axis The axis over which to select values. Defaults to 0. - * @param batchDims Optional. The number of batch dimensions. It must be less - * than or equal to rank(indices). Defaults to 0. - * The output tensor will have shape of - * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]` - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function gather_(x, indices, axis = 0, batchDims = 0) { - const $x = convertToTensor(x, 'x', 'gather'); - const $indices = convertToTensor(indices, 'indices', 'gather', 'int32'); - const inputs = { x: $x, indices: $indices }; - const attrs = { axis, batchDims }; - return ENGINE.runKernel(GatherV2, inputs, attrs); - } - const gather = op({ gather_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a > b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greater(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function greater_(a, b) { - let $a = convertToTensor(a, 'a', 'greater'); - let $b = convertToTensor(b, 'b', 'greater'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Greater, inputs); - } - const greater = op({ greater_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a >= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greaterEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function greaterEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'greaterEqual'); - let $b = convertToTensor(b, 'b', 'greaterEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(GreaterEqual, inputs); - } - const greaterEqual = op({ greaterEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the imaginary part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the imaginary part of each element in input considered as a complex number. - * If input is real, a tensor of all zeros is returned. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.imag(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function imag_(input) { - const $input = convertToTensor(input, 'input', 'imag'); - const inputs = { input: $input }; - return ENGINE.runKernel(Imag, inputs); - } - const imag = op({ imag_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns which elements of x are finite. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isFinite().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isFinite_(x) { - const $x = convertToTensor(x, 'x', 'isFinite'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsFinite, inputs); - } - const isFinite$1 = op({ isFinite_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns which elements of x are Infinity or -Infinity. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isInf().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isInf_(x) { - const $x = convertToTensor(x, 'x', 'isInf'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsInf, inputs); - } - const isInf = op({ isInf_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * RReturns which elements of x are NaN. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isNaN().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isNaN_(x) { - const $x = convertToTensor(x, 'x', 'isNaN'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsNan, inputs); - } - const isNaN$1 = op({ isNaN_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes leaky rectified linear element-wise. - * - * See - * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf]( - * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf) - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1) - * ``` - * @param x The input tensor. - * @param alpha The scaling factor for negative values, defaults to 0.2. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function leakyRelu_(x, alpha = 0.2) { - const $x = convertToTensor(x, 'x', 'leakyRelu'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(LeakyRelu, inputs, attrs); - } - const leakyRelu = op({ leakyRelu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a < b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.less(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function less_(a, b) { - let $a = convertToTensor(a, 'a', 'less'); - let $b = convertToTensor(b, 'b', 'less'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Less, inputs); - } - const less = op({ less_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a <= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.lessEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function lessEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'lessEqual'); - let $b = convertToTensor(b, 'b', 'lessEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LessEqual, inputs); - } - const lessEqual = op({ lessEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Normalizes the activation of a local neighborhood across or within - * channels. - * - * @param x The input tensor. The 4-D input tensor is treated as a 3-D array - * of 1D vectors (along the last dimension), and each vector is - * normalized independently. - * @param depthRadius The number of adjacent channels in the 1D normalization - * window. - * @param bias A constant bias term for the basis. - * @param alpha A scale factor, usually positive. - * @param beta An exponent. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const $x = convertToTensor(x, 'x', 'localResponseNormalization'); - assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${$x.rank}.`); - assert(isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` + - `integer but got depthRadius ${depthRadius}.`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - const inputs = { x: x4D }; - const attrs = { depthRadius, bias, alpha, beta }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(LRN, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - else { - return res; - } - } - const localResponseNormalization = op({ localResponseNormalization_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E]); - * - * x.log().print(); // or tf.log(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function log_(x) { - const $x = convertToTensor(x, 'x', 'log'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log, inputs); - } - const log = op({ log_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes natural logarithm of the input `tf.Tensor` plus one - * element-wise: `ln(1 + x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E - 1]); - * - * x.log1p().print(); // or tf.log1p(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function log1p_(x) { - const $x = convertToTensor(x, 'x', 'log1p'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log1p, inputs); - } - const log1p = op({ log1p_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Overrides the gradient computation of a function `f`. - * - * Takes a function - * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}` - * and returns another function `g(...inputs)` which takes the same inputs as - * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients - * with respect to each input of `f` are computed using `f().gradFunc`. - * - * The `save` function passsed to `f` should be used for saving tensors needed - * in the gradient. And the `saved` passed to the `gradFunc` is a - * `NamedTensorMap`, which contains those saved tensor. - * - * ```js - * const customOp = tf.customGrad((x, save) => { - * // Save x to make sure it's available later for the gradient. - * save([x]); - * // Override gradient of our custom x ^ 2 op to be dy * abs(x); - * return { - * value: x.square(), - * // Note `saved.x` which points to the `x` we saved earlier. - * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())] - * }; - * }); - * - * const x = tf.tensor1d([-1, -2, 3]); - * const dx = tf.grad(x => customOp(x)); - * - * console.log(`f(x):`); - * customOp(x).print(); - * console.log(`f'(x):`); - * dx(x).print(); - * ``` - * - * @param f The function to evaluate in forward mode, which should return - * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc` - * returns the custom gradients of `f` with respect to its inputs. - * - * @doc {heading: 'Training', subheading: 'Gradients'} - */ - function customGrad(f) { - return ENGINE.customGrad(f); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes `-1 * x` element-wise. - * - * ```js - * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]); - * - * x.neg().print(); // or tf.neg(x) - * ``` - * - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function neg_(x) { - const $x = convertToTensor(x, 'x', 'neg'); - const inputs = { x: $x }; - return ENGINE.runKernel(Neg, inputs); - } - const neg = op({ neg_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.softplus().print(); // or tf.softplus(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function softplus_(x) { - const $x = convertToTensor(x, 'x', 'softplus'); - const inputs = { x: $x }; - return ENGINE.runKernel(Softplus, inputs); - } - const softplus = op({ softplus_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes log sigmoid of the input `tf.Tensor` element-wise: - * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`. - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.logSigmoid().print(); // or tf.logSigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function logSigmoid_(x) { - const $x = convertToTensor(x, 'x', 'logSigmoid'); - // Use a custom gradient to maintain previous implementation. - // There is no LogSigmoid kernel in TF so we can't use engine.runKernel - // directly - const customOp = customGrad((x) => { - // TODO(yassogba) we can remove the chained softplus call here only - // after backends have modualrized softplus at which point we can call - // engine runKernel(..., Sotfplus, ...) directly. - const value = neg(softplus(neg(x))); - const gradFunc = (dy) => { - const derX = mul(dy, sigmoid(neg(x))); - return derX; - }; - return { value, gradFunc }; - }); - return customOp($x); - } - const logSigmoid = op({ logSigmoid_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the maximum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.max().print(); // or tf.max(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.max(axis).print(); // or tf.max(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function max_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'max'); - const inputs = { x: $x }; - const attrs = { reductionIndices: axis, keepDims }; - return ENGINE.runKernel(Max, inputs, attrs); - } - const max = op({ max_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * - * ```js - * // Broadcast subtract a with b. - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.scalar(5); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * @param a The first `tf.Tensor` to subtract from. - * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function sub_(a, b) { - let $a = convertToTensor(a, 'a', 'sub'); - let $b = convertToTensor(b, 'b', 'sub'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Sub, inputs); - } - const sub = op({ sub_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the sum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If axes has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.sum().print(); // or tf.sum(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.sum(axis).print(); // or tf.sum(x, axis) - * ``` - * - * @param x The input tensor to compute the sum over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function sum_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'sum'); - if ($x.dtype === 'bool') { - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Sum, inputs, attrs); - } - const sum = op({ sum_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the log softmax. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * @param logits The logits array. - * @param axis The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function logSoftmax_(logits, axis = -1) { - const $logits = convertToTensor(logits, 'logits', 'logSoftmax'); - if (axis === -1) { - axis = $logits.rank - 1; - } - if (axis !== $logits.rank - 1) { - throw Error('Log Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and axis was ${axis}`); - } - // const forward: ForwardFunc = (backend, save) => { - // const keepDims = true; - // const xMax = max(logits, axis, true); - // const shifted = sub(logits, xMax); - // const value = - // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, - // keepDims))); - // save([value]); - // return value; - // }; - // Use a custom gradient for numerical stability. - const customOp = customGrad((logits, save) => { - const keepDims = true; - const xMax = max(logits, axis, true); - const shifted = sub(logits, xMax); - const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims))); - save([value]); - const gradFunc = (dy, saved) => { - const [value] = saved; - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - }; - return { value, gradFunc }; - }); - return customOp($logits); - // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this. - // const inputs: LogSoftmaxInputs = {logits: $logits}; - // const attrs: LogSoftmaxAttrs = {axis}; - // return ENGINE.runKernel( - // LogSoftmax, inputs as {} as NamedTensorMap, - // attrs as {} as NamedAttrMap); - } - const logSoftmax = op({ logSoftmax_ }); - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Returns true if the axis specifies the inner most dimensions of the - * array. - */ - function axesAreInnerMostDims(axes, rank) { - for (let i = 0; i < axes.length; ++i) { - if (axes[axes.length - i - 1] !== rank - 1 - i) { - return false; - } - } - return true; - } - function combineLocations(outputLoc, reduceLoc, axes) { - const rank = outputLoc.length + reduceLoc.length; - const loc = []; - let outIdx = 0; - let reduceIdx = 0; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - loc.push(outputLoc[outIdx++]); - } - else { - loc.push(reduceLoc[reduceIdx++]); - } - } - return loc; - } - function computeOutAndReduceShapes(aShape, axes) { - const outShape = []; - const rank = aShape.length; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - outShape.push(aShape[dim]); - } - } - const reduceShape = axes.map(dim => aShape[dim]); - return [outShape, reduceShape]; - } - function expandShapeToKeepDim(shape, axes) { - const reduceSubShape = axes.map(x => 1); - return combineLocations(shape, reduceSubShape, axes); - } - /** - * Returns the axes permutation to be used with `tf.transpose`, if such - * permutation is necessary. Otherwise it returns null. This method is used by - * operations that operate only on inner-most axes. - */ - function getAxesPermutation(axes, rank) { - if (axesAreInnerMostDims(axes, rank)) { - return null; - } - const result = []; - for (let i = 0; i < rank; ++i) { - if (axes.indexOf(i) === -1) { - result.push(i); - } - } - axes.forEach(axis => result.push(axis)); - return result; - } - /** Returns the axes permutation that undoes the original permutation. */ - function getUndoAxesPermutation(axes) { - return axes.map((axis, i) => [i, axis]) - .sort((a, b) => a[1] - b[1]) - .map(x => x[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. - * ============================================================================= - */ - /** - * Computes the log(sum(exp(elements across the reduction dimensions)). - * - * Reduces the input along the dimensions given in `axis`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.logSumExp().print(); // or tf.logSumExp(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis) - * ``` - * @param x The input tensor. - * @param axis The dimension(s) to reduce. If null (the default), - * reduces all dimensions. - * @param keepDims If true, retains reduced dimensions with length - * of 1. Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function logSumExp_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'logSumExp'); - const axes = parseAxisParam(axis, $x.shape); - const xMax = max($x, axes, true /* keepDims */); - const a = sub($x, xMax); - const b = exp(a); - const c = sum(b, axes); - const d = log(c); - const res = add$1(reshape(xMax, d.shape), d); - if (keepDims) { - const newShape = expandShapeToKeepDim(res.shape, axes); - return reshape(res, newShape); - } - return res; - } - const logSumExp = op({ logSumExp_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a AND b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalAnd(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalAnd_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalAnd, inputs); - } - const logicalAnd = op({ logicalAnd_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `NOT x` element-wise. - * - * ```js - * const a = tf.tensor1d([false, true], 'bool'); - * - * a.logicalNot().print(); - * ``` - * - * @param x The input tensor. Must be of dtype 'bool'. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalNot_(x) { - const $x = convertToTensor(x, 'x', 'logicalNot', 'bool'); - const inputs = { x: $x }; - return ENGINE.runKernel(LogicalNot, inputs); - } - const logicalNot = op({ logicalNot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a OR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalOr(b).print(); - * ``` - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalOr_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalOr', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalOr', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalOr, inputs); - } - const logicalOr = op({ logicalOr_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a XOR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalXor(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalXor_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalXor', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalXor', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - // x ^ y = (x | y) & ~(x & y) - return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b))); - } - const logicalXor = op({ logicalXor_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the 2D max pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'maxPool'); - const dilations = 1; - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const maxPool = op({ maxPool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the max of a and b (`a > b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `tf.maximumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * ```js - * // Broadcast maximum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function maximum_(a, b) { - let $a = convertToTensor(a, 'a', 'maximum'); - let $b = convertToTensor(b, 'b', 'maximum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Maximum, inputs); - } - const maximum = op({ maximum_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the mean of elements across dimensions of a `tf.Tensor`. - * - * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is - * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with - * a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.mean().print(); // or tf.mean(a) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.mean(axis).print(); // or tf.mean(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function mean_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'mean'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Mean, inputs, attrs); - } - const mean = op({ mean_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 0. - * - * ```js - * tf.zeros([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Can - * be 'float32', 'int32' or 'bool'. Defaults to 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function zeros(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = zeros(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeZerosTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 1. - * - * ```js - * tf.ones([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Defaults to - * 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function ones$1(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = ones$1(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeOnesTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the minimum value from the input. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axes`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axes` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.min().print(); // or tf.min(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.min(axis).print(); // or tf.min(x, axis) - * ``` - * - * @param x The input Tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function min_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'min'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Min, inputs, attrs); - } - const min = op({ min_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the min of a and b (`a < b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `minimumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * ```js - * // Broadcast minimum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function minimum_(a, b) { - let $a = convertToTensor(a, 'a', 'minimum'); - let $b = convertToTensor(b, 'b', 'minimum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Minimum, inputs); - } - const minimum = op({ minimum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Pads a `tf.Tensor` using mirror padding. - * - * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad. - * - * ```js - * const x = tf.range(0, 9).reshape([1, 1, 3, 3]); - * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * In "reflect" mode, the padded regions do not include the borders, - * while in "symmetric" mode the padded regions do include the borders. - * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`, - * then the output is `[1, 2, 3, 2, 1]` in "reflect" mode, and - * `[1, 2, 3, 3, 2]` in "symmetric" mode. - * If `mode` is "reflect" then both `paddings[D, 0]` and `paddings[D, 1]` - * must be no greater than `x.shape[D] - 1`. If mode is "symmetric" - * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than - * `x.shape[D]` - * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'` - */ - /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ - function mirrorPad_(x, paddings, mode) { - assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` + - `Got ${mode}.`); - const $x = convertToTensor(x, 'x', 'mirrorPad'); - if ($x.rank === 0) { - throw new Error('mirrorPad(scalar) is not defined. ' + - 'Pass non-scalar to mirrorPad'); - } - assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` + - `Got ${paddings.length}.`); - const shapeOffset = mode === 'reflect' ? 1 : 0; - for (let i = 0; i < $x.rank; i++) { - assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`); - assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset && - paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` + - `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` + - `shape ${$x.shape}`); - } - const attrs = { paddings, mode }; - const inputs = { x: $x }; - return ENGINE.runKernel(MirrorPad, inputs, attrs); - } - const mirrorPad = op({ mirrorPad_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the mod of a and b element-wise. - * `floor(x / y) * y + mod(x, y) = x` - * Supports broadcasting. - * - * We also expose `tf.modStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * ```js - * // Broadcast a mod b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function mod_(a, b) { - let $a = convertToTensor(a, 'a', 'mod'); - let $b = convertToTensor(b, 'b', 'mod'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Mod, inputs); - } - const mod = op({ mod_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes square of `x` element-wise: `x ^ 2` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]); - * - * x.square().print(); // or tf.square(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function square_(x) { - const $x = convertToTensor(x, 'x', 'square'); - const attrs = {}; - return ENGINE.runKernel('Square', { x: $x }, attrs); - } - const square = op({ square_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a != b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([0, 2, 3]); - * - * a.notEqual(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function notEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'notEqual'); - let $b = convertToTensor(b, 'b', 'notEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(NotEqual, inputs); - } - const notEqual = op({ notEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take - * value `onValue` (defaults to 1), while all other locations take value - * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank - * `R+1` with the last axis of size `depth`. - * - * ```js - * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print(); - * ``` - * - * @param indices `tf.Tensor` of indices with dtype `int32`. - * @param depth The depth of the one hot dimension. - * @param onValue A number used to fill in the output when the index matches - * the location. - * @param offValue A number used to fill in the output when the index does - * not match the location. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function oneHot_(indices, depth, onValue = 1, offValue = 0) { - if (depth < 2) { - throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); - } - const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); - const inputs = { indices: $indices }; - const attrs = { depth, onValue, offValue }; - return ENGINE.runKernel(OneHot, inputs, attrs); - } - const oneHot = op({ oneHot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.onesLike(x).print(); - * ``` - * @param x A tensor. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function onesLike_(x) { - const $x = convertToTensor(x, 'x', 'onesLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(OnesLike, inputs); - } - const onesLike = op({ onesLike_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Pads a `tf.Tensor` with a given value and paddings. - * - * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`, - * refer to `tf.mirrorPad` - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `paddings` is of given length. - * - `tf.pad1d` - * - `tf.pad2d` - * - `tf.pad3d` - * - `tf.pad4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.pad([[1, 2]]).print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * @param constantValue The pad value to use. Defaults to 0. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function pad_(x, paddings, constantValue = 0) { - const $x = convertToTensor(x, 'x', 'pad'); - if ($x.rank === 0) { - throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); - } - const attrs = { paddings, constantValue }; - const inputs = { x: $x }; - return ENGINE.runKernel(PadV2, inputs, attrs); - } - const pad = op({ pad_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * This operation divides "spatial" dimensions `[1, ..., M]` of the input into - * a grid of blocks of shape `blockShape`, and interleaves these blocks with - * the "batch" dimension (0) such that in the output, the spatial - * dimensions `[1, ..., M]` correspond to the position within the grid, - * and the batch dimension combines both the position within a spatial block - * and the original batch position. Prior to division into blocks, - * the spatial dimensions of the input are optionally zero padded - * according to `paddings`. See below for a precise description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); - * const blockShape = [2, 2]; - * const paddings = [[0, 0], [0, 0]]; - * - * x.spaceToBatchND(blockShape, paddings).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >= - * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad - * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It - * is required that - * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0` - * - * This operation is equivalent to the following steps: - * - * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input - * according to `paddings` to produce `padded` of shape paddedShape. - * - * 2. Reshape `padded` to `reshapedPadded` of shape: - * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., - * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape` - * - * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded` - * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the - * batch dimension, producing an output tensor of shape: - * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function spaceToBatchND_(x, blockShape, paddings) { - const $x = convertToTensor(x, 'x', 'spaceToBatchND'); - assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); - assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); - assert($x.shape.reduce((a, b, i) => { - if (i > 0 && i <= blockShape.length) { - return a && - ((b + paddings[i - 1][0] + paddings[i - 1][1]) % - blockShape[i - 1] === - 0); - } - return a; - }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); - const inputs = { x: $x }; - const attrs = { blockShape, paddings }; - return ENGINE.runKernel(SpaceToBatchND, inputs, attrs); - } - const spaceToBatchND = op({ spaceToBatchND_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Performs an N-D pooling operation - * - * @param input The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param windowShape The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param poolingType The type of pooling, either 'max' or 'avg'. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function pool_(input, windowShape, poolingType, pad, dilations, strides) { - if (dilations == null) { - dilations = [1, 1]; - } - if (strides == null) { - strides = 1; - } - if (pad === 0) { - pad = 'valid'; - } - const $x = convertToTensor(input, 'x', 'maxPool'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad); - const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; - // The following implementation does batchToSpace(pool(spaceToBatch(x))) - // whenever dilation > 1 since the TF kernels do not support dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037 - let basePadding; - if (pad === 'same') { - basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation); - } - else { - basePadding = [[0, 0], [0, 0]]; - } - const isDilationOne = dilation[0] === 1 && dilation[1] === 1; - const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); - const convertedPad = isDilationOne ? pad : 'valid'; - const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding); - const forwardOp = poolingType === 'avg' ? - () => avgPool(convertedX, windowShape, strides, convertedPad) : - () => maxPool(convertedX, windowShape, strides, convertedPad); - const y = forwardOp(); - const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - // Helper function to compute crops and paddings for pool with dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184 - function requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) { - const padStart = basePadding.map(b => b[0]); - const origPadEnd = basePadding.map(b => b[1]); - const fullInputShape = inputShape.concat(padStart, origPadEnd); - const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b); - const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]); - const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]); - const crops = blockShape.map((_, i) => [0, padEndExtra[i]]); - return [paddings, crops]; - } - // Helper function to compute base paddings for pool with dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524 - function withSpaceToBatchBasePaddings(filterShape, dilation) { - // Spatial dimensions of the filters and the upsampled filters in which we - // introduce (rate - 1) zeros between consecutive filter values. - const dilatedFilterShape = filterShape.map((s, i) => { - return s + (s - 1) * (dilation[i] - 1); - }); - const padExtraShape = dilatedFilterShape.map(s => s - 1); - // When padding is odd, we pad more at end, following the same - // convention as conv2d. - const padExtraStart = padExtraShape.map(s => Math.floor(s / 2)); - const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]); - return padExtraShape.map((_, i) => { - return [padExtraStart[i], padExtraEnd[i]]; - }); - } - const pool = op({ pool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the power of one `tf.Tensor` to another. Supports broadcasting. - * - * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for - * corresponding elements in x and y. The result's dtype will be the upcasted - * type of the `base` and `exp` dtypes. - * - * ```js - * const a = tf.tensor([[2, 3], [4, 5]]) - * const b = tf.tensor([[1, 2], [3, 0]]).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * - * ```js - * const a = tf.tensor([[1, 2], [3, 4]]) - * const b = tf.tensor(2).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * We also expose `powStrict` which has the same signature as this op and - * asserts that `base` and `exp` are the same shape (does not broadcast). - * - * @param base The base `tf.Tensor` to pow element-wise. - * @param exp The exponent `tf.Tensor` to pow element-wise. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function pow_(base, exp) { - let $base = convertToTensor(base, 'base', 'pow'); - let $exp = convertToTensor(exp, 'exp', 'pow'); - [$base, $exp] = makeTypesMatch($base, $exp); - const inputs = { a: $base, b: $exp }; - return ENGINE.runKernel(Pow, inputs); - } - const pow = op({ pow_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes leaky rectified linear element-wise with parametric alphas. - * - * `x < 0 ? alpha * x : f(x) = x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * const alpha = tf.scalar(0.1); - * - * x.prelu(alpha).print(); // or tf.prelu(x, alpha) - * ``` - * @param x The input tensor. - * @param alpha Scaling factor for negative values. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function prelu_(x, alpha) { - const $x = convertToTensor(x, 'x', 'prelu'); - const $alpha = convertToTensor(alpha, 'alpha', 'prelu'); - const inputs = { x: $x, alpha: $alpha }; - return ENGINE.runKernel(Prelu, inputs); - } - const prelu = op({ prelu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the product of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.prod().print(); // or tf.prod(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.prod(axis).print(); // or tf.prod(x, axis) - * ``` - * - * @param x The input tensor to compute the product over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function prod_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'prod'); - if ($x.dtype === 'bool') { - // bool is not an allowed type for the underlying kernel. - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Prod, inputs, attrs); - } - const prod = op({ prod_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the real part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the real part of each element in input considered as a complex number. - * - * If the input is real, it simply makes a clone. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.real(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function real_(input) { - const $input = convertToTensor(input, 'input', 'real'); - const inputs = { input: $input }; - return ENGINE.runKernel(Real, inputs); - } - const real = op({ real_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes reciprocal of x element-wise: `1 / x` - * - * ```js - * const x = tf.tensor1d([0, 1, 2]); - * - * x.reciprocal().print(); // or tf.reciprocal(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function reciprocal_(x) { - const $x = convertToTensor(x, 'x', 'reciprocal'); - const inputs = { x: $x }; - return ENGINE.runKernel(Reciprocal, inputs); - } - const reciprocal = op({ reciprocal_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes rectified linear element-wise: `max(x, 0)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.relu().print(); // or tf.relu(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function relu_(x) { - const $x = convertToTensor(x, 'x', 'relu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu, inputs); - } - const relu = op({ relu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 8]); - * - * x.relu6().print(); // or tf.relu6(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function relu6_(x) { - const $x = convertToTensor(x, 'x', 'relu6'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu6, inputs); - } - const relu6 = op({ relu6_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Reverses a `tf.Tensor` along a specified axis. - * - * Also available are stricter rank-specific methods that assert that `x` is - * of the given rank: - * - `tf.reverse1d` - * - `tf.reverse2d` - * - `tf.reverse3d` - * - `tf.reverse4d` - * - * Except `tf.reverse1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.reverse().print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.reverse(axis).print(); - * ``` - * @param x The input tensor to be reversed. - * @param axis The set of dimensions to reverse. Must be in the - * range [-rank(x), rank(x)). Defaults to all axes. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function reverse_(x, axis) { - const $x = convertToTensor(x, 'x', 'reverse'); - const inputs = { x: $x }; - const attrs = { dims: axis }; - return ENGINE.runKernel(Reverse, inputs, attrs); - } - const reverse = op({ reverse_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes round of input `tf.Tensor` element-wise: `round(x)`. - * It implements banker's rounding. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.round().print(); // or tf.round(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function round_(x) { - const $x = convertToTensor(x, 'x', 'round'); - const inputs = { x: $x }; - return ENGINE.runKernel(Round, inputs); - } - const round$1 = op({ round_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes reciprocal of square root of the input `tf.Tensor` element-wise: - * `y = 1 / sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.rsqrt().print(); // or tf.rsqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function rsqrt_(x) { - const $x = convertToTensor(x, 'x', 'rsqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Rsqrt, inputs); - } - const rsqrt = op({ rsqrt_ }); - - /** - * @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. - * ============================================================================= - */ - /** This is shared code across all tensor creation methods. */ - function makeTensor(values, shape, inferredShape, dtype) { - if (dtype == null) { - dtype = inferDtype(values); - } - if (dtype === 'complex64') { - throw new Error(`Cannot construct a complex64 tensor directly. ` + - `Please use tf.complex(real, imag).`); - } - if (!isTypedArray(values) && !Array.isArray(values) && - typeof values !== 'number' && typeof values !== 'boolean' && - typeof values !== 'string') { - throw new Error('values passed to tensor(values) must be a number/boolean/string or ' + - 'an array of numbers/booleans/strings, or a TypedArray'); - } - if (shape != null) { - assertNonNegativeIntegerDimensions(shape); - const providedSize = sizeFromShape(shape); - const inferredSize = sizeFromShape(inferredShape); - assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` + - `${providedSize} values but has ${inferredSize}`); - for (let i = 0; i < inferredShape.length; ++i) { - const inferred = inferredShape[i]; - const flatDimsDontMatch = i === inferredShape.length - 1 ? - inferred !== sizeFromShape(shape.slice(i)) : - true; - assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` + - `(${inferredShape}) does not match the provided ` + - `shape (${shape}). `); - } - } - if (!isTypedArray(values) && !Array.isArray(values)) { - values = [values]; - } - shape = shape || inferredShape; - values = dtype !== 'string' ? - toTypedArray(values, dtype) : - flatten(values, [], true); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype. - * - * The same functionality can be achieved with `tf.tensor`, but in general - * we recommend using `tf.scalar` as it makes the code more readable. - * - * ```js - * tf.scalar(3.14).print(); - * ``` - * - * @param value The value of the scalar. - * @param dtype The data type. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function scalar(value, dtype) { - if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) && - dtype !== 'complex64') { - throw new Error('Error creating a new Scalar: value must be a primitive ' + - '(number|boolean|string)'); - } - if (dtype === 'string' && isTypedArray(value) && - !(value instanceof Uint8Array)) { - throw new Error('When making a scalar from encoded string, ' + - 'the value must be `Uint8Array`.'); - } - const shape = []; - const inferredShape = []; - return makeTensor(value, shape, inferredShape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes scaled exponential linear element-wise. - * - * `x < 0 ? scale * alpha * (exp(x) - 1) : x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.selu().print(); // or tf.selu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function selu_(x) { - const $x = convertToTensor(x, 'x', 'selu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Selu, inputs); - } - const selu = op({ selu_ }); - - /** - * 2-D convolution with separable filters. - * - * Performs a depthwise convolution that acts separately on channels followed - * by a pointwise convolution that mixes channels. Note that this is - * separability between dimensions [1, 2] and 3, not spatial separability - * between dimensions 1 and 2. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is - * the filter used in the first step. - * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape - * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is - * the filter used in the second step. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'separableConv2d'); - const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); - const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - if (dataFormat === 'NCHW') { - throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + - 'NHWC is supported'); - } - assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` + - ` must be 1, but got ${$pointwiseFilter.shape[0]}.`); - assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` + - `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`); - const inChannels = $depthwiseFilter.shape[2]; - const channelMultiplier = $depthwiseFilter.shape[3]; - assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` + - `must be ${inChannels * channelMultiplier}, ` + - `but got ${$pointwiseFilter.shape[2]}.`); - const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); - const pointwiseStride = 1; - const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const separableConv2d = op({ separableConv2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns an element-wise indication of the sign of a number. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]); - * - * x.sign().print(); // or tf.sign(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sign_(x) { - const $x = convertToTensor(x, 'x', 'sign'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sign, inputs); - } - const sign = op({ sign_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes sin of the input Tensor element-wise: `sin(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.sin().print(); // or tf.sin(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sin_(x) { - const $x = convertToTensor(x, 'x', 'sin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sin, inputs); - } - const sin = op({ sin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.sinh().print(); // or tf.sinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sinh_(x) { - const $x = convertToTensor(x, 'x', 'sinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sinh, inputs); - } - const sinh = op({ sinh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the softmax normalized vector given the logits. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * @param logits The logits array. - * @param dim The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function softmax_(logits, dim = -1) { - const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32'); - if (dim === -1) { - dim = $logits.rank - 1; - } - if (dim !== $logits.rank - 1) { - throw Error('Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and dim was ${dim}`); - } - const inputs = { logits: $logits }; - const attrs = { dim }; - return ENGINE.runKernel(Softmax, inputs, attrs); - } - const softmax = op({ softmax_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.fft().print(); // tf.spectral.fft(x).print(); - * ``` - * @param input The complex input to compute an fft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function fft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(FFT, inputs); - } - const fft = op({ fft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Inverse fast Fourier transform. - * - * Computes the inverse 1-dimensional discrete Fourier transform over the - * inner-most dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.ifft().print(); // tf.spectral.ifft(x).print(); - * ``` - * @param input The complex input to compute an ifft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function ifft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(IFFT, inputs); - } - const ifft = op({ ifft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Inversed real value input fast Fourier transform. - * - * Computes the 1-dimensional inversed discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([0, 0, 0]); - * const x = tf.complex(real, imag); - * - * x.irfft().print(); - * ``` - * @param input The real value input to compute an irfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function irfft_(input) { - const innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let ret; - if (innerDimensionSize <= 2) { - const complexInput = reshape(input, [batch, innerDimensionSize]); - ret = ifft(complexInput); - } - else { - // The length of unique components of the DFT of a real-valued signal - // is 2 * (input_len - 1) - const outputShape = [batch, 2 * (innerDimensionSize - 1)]; - const realInput = reshape(real(input), [batch, innerDimensionSize]); - const imagInput = reshape(imag(input), [batch, innerDimensionSize]); - const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); - const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1)); - const r = concat([realInput, realConjugate], 1); - const i = concat([imagInput, imagConjugate], 1); - const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]); - ret = ifft(complexInput); - } - ret = real(ret); - // reshape the result if the input is 3D tensor. - if (input.rank === 3 && input.shape[0] !== 0) { - const temp = ret; - const batch = input.shape[0]; - ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]); - temp.dispose(); - } - return ret; - } - const irfft = op({ irfft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Splits a `tf.Tensor` into sub tensors. - * - * If `numOrSizeSplits` is a number, splits `x` along dimension `axis` - * into `numOrSizeSplits` smaller tensors. - * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`. - * - * If `numOrSizeSplits` is a number array, splits `x` into - * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the - * same size as `x` except along dimension `axis` where the size is - * `numOrSizeSplits[i]`. - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - * const [a, b] = tf.split(x, 2, 1); - * a.print(); - * b.print(); - * - * const [c, d, e] = tf.split(x, [1, 2, 1], 1); - * c.print(); - * d.print(); - * e.print(); - * ``` - * - * @param x The input tensor to split. - * @param numOrSizeSplits Either an integer indicating the number of - * splits along the axis or an array of integers containing the sizes of - * each output tensor along the axis. If a number then it must evenly divide - * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`. - * Can contain one -1 indicating that dimension is to be inferred. - * @param axis The dimension along which to split. Defaults to 0 (the first - * dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function split_(x, numOrSizeSplits, axis = 0) { - const $x = convertToTensor(x, 'x', 'split'); - const inputs = { x: $x }; - const attr = { numOrSizeSplits, axis }; - return ENGINE.runKernel(SplitV, inputs, attr); - } - const split = op({ split_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Real value input fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * - * real.rfft().print(); - * ``` - * @param input The real value input to compute an rfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function rfft_(input, fftLength) { - assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`); - let innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let adjustedInput; - if (fftLength != null && fftLength < innerDimensionSize) { - // Need to crop - const begin = input.shape.map(v => 0); - const size = input.shape.map(v => v); - size[input.shape.length - 1] = fftLength; - adjustedInput = slice(input, begin, size); - innerDimensionSize = fftLength; - } - else if (fftLength != null && fftLength > innerDimensionSize) { - // Need to pad with zeros - const zerosShape = input.shape.map(v => v); - zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize; - adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1); - innerDimensionSize = fftLength; - } - else { - adjustedInput = input; - } - // Complement the input with zero imaginary numbers. - const zerosInput = zerosLike(adjustedInput); - const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]); - const ret = fft(complexInput); - // Exclude complex conjugations. These conjugations are put symmetrically. - const half = Math.floor(innerDimensionSize / 2) + 1; - const realValues = real(ret); - const imagValues = imag(ret); - const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1); - const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1); - const outputShape = adjustedInput.shape.slice(); - outputShape[adjustedInput.shape.length - 1] = half; - return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape); - } - const rfft = op({ rfft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.sqrt().print(); // or tf.sqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sqrt_(x) { - const $x = convertToTensor(x, 'x', 'sqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sqrt, inputs); - } - const sqrt = op({ sqrt_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns (a - b) * (a - b) element-wise. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * ```js - * // Broadcast squared difference a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function squaredDifference_(a, b) { - let $a = convertToTensor(a, 'a', 'squaredDifference'); - let $b = convertToTensor(b, 'b', 'squaredDifference'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - const attrs = {}; - return ENGINE.runKernel(SquaredDifference, inputs, attrs); - } - const squaredDifference = op({ squaredDifference_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Removes dimensions of size 1 from the shape of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]); - * x.squeeze().print(); - * ``` - * - * @param x The input tensor to be squeezed. - * @param axis An optional list of numbers. If specified, only - * squeezes the dimensions listed. The dimension index starts at 0. It - * is an error to squeeze a dimension that is not 1. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function squeeze_(x, axis) { - const $x = convertToTensor(x, 'x', 'squeeze'); - return reshape($x, squeezeShape($x.shape, axis).newShape); - } - const squeeze = op({ squeeze_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.stack([a, b, c]).print(); - * ``` - * - * @param tensors A list of tensor objects with the same shape and dtype. - * @param axis The axis to stack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function stack_(tensors, axis = 0) { - const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric'); - assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack'); - if ($tensors.length > 0) { - assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor'); - } - const inputs = $tensors; - const attrs = { axis }; - return ENGINE.runKernel(Pack, inputs, attrs); - } - const stack = op({ stack_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x` - * - * ```js - * const x = tf.tensor1d([0, 2, -1, -3]); - * - * x.step(.5).print(); // or tf.step(x, .5) - * ``` - * @param x The input tensor. - * @param alpha The gradient when input is negative. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function step_(x, alpha = 0.0) { - const $x = convertToTensor(x, 'x', 'step'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(Step, inputs, attrs); - } - const step = op({ step_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Extracts a strided slice of a tensor. - * - * Roughly speaking, this op extracts a slice of size (end-begin)/stride from - * the given input tensor (x). Starting at the location specified by begin the - * slice continues by adding stride to the index until all dimensions are not - * less than end. Note that a stride can be negative, which causes a reverse - * slice. - * - * ```js - * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6], - * [3, 2, 3]); - * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]] - * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3], - * // [4, 4, 4]]] - * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4], - * // [3, 3, 3]]] - * ``` - * - * @param x The tensor to stride slice. - * @param begin The coordinates to start the slice from. - * @param end: The coordinates to end the slice at. - * @param strides: The size of the slice. - * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param endMask: If the ith bit of endMask is set, end[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param shrinkAxisMask: a bitmask where bit i implies that - * the ith specification should shrink the dimensionality. begin and end must - * imply a slice of size 1 in the dimension. - * - * @doc {heading: 'Operations', subheading: 'Slicing and Joining'} - */ - function stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { - const $x = convertToTensor(x, 'x', 'stridedSlice'); - const inputs = { x: $x }; - const attrs = { - begin, - end, - strides, - beginMask, - endMask, - ellipsisMask, - newAxisMask, - shrinkAxisMask - }; - return ENGINE.runKernel(StridedSlice, inputs, attrs); - } - const stridedSlice = op({ stridedSlice_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes tan of the input `tf.Tensor` element-wise, `tan(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.tan().print(); // or tf.tan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function tan_(x) { - const $x = convertToTensor(x, 'x', 'tan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tan, inputs); - } - const tan = op({ tan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Finds the values and indices of the `k` largest entries along the last - * dimension. - * - * If the input is a vector (rank=1), finds the k largest entries in the vector - * and outputs their values and indices as vectors. Thus values[j] is the j-th - * largest entry in input, and its index is indices[j]. - * For higher rank inputs, computes the top k entries along the last dimension. - * - * If two elements are equal, the lower-index element appears first. - * - * ```js - * const a = tf.tensor2d([[1, 5], [4, 3]]); - * const {values, indices} = tf.topk(a); - * values.print(); - * indices.print(); - * ``` - * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`. - * @param k Number of top elements to look for along the last dimension. - * @param sorted If true, the resulting `k` elements will be sorted by the - * values in descending order. - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ - function topk_(x, k = 1, sorted = true) { - const $x = convertToTensor(x, 'x', 'topk'); - if ($x.rank === 0) { - throw new Error('topk() expects the input to be of rank 1 or higher'); - } - const lastDim = $x.shape[$x.shape.length - 1]; - if (k > lastDim) { - throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` + - `but got ${k}`); - } - const inputs = { x: $x }; - const attrs = { k, sorted }; - const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs); - return { values, indices }; - } - const topk = op({ topk_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Finds unique elements along an axis of a tensor. - * - * It returns a tensor `values` containing all of the unique elements along the - * `axis` of the given tensor `x` in the same order that they occur along the - * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor - * `indices` the same size as the number of the elements in `x` along the `axis` - * dimension. It contains the index in the unique output `values`. - * - * ```js - * // A 1-D tensor - * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]); - * const {values, indices} = tf.unique(a); - * values.print(); // [1, 2, 4, 7, 8,] - * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4] - * ``` - * - * ```js - * // A 2-D tensor with axis=0 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 0) - * values.print(); // [[1, 0, 0], - * // [2, 0, 0]] - * indices.print(); // [0, 0, 1] - * ``` - * - * ```js - * // A 2-D tensor with axis=1 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 1) - * values.print(); // [[1, 0], - * // [1, 0], - * // [2, 0]] - * indices.print(); // [0, 1, 1] - * ``` - * @param x A tensor (int32, string, bool). - * @param axis The axis of the tensor to find the unique elements. - * @returns [uniqueElements, indices] (see above for details) - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ - function unique_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric'); - assert($x.rank > 0, () => 'The input tensor must be at least 1D'); - const inputs = { x: $x }; - const attrs = { axis }; - const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs); - return { values, indices }; - } - const unique = op({ unique_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the sum along segments of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32'); - * const numSegments = 3; - * - * x.unsortedSegmentSum(segmentIds, numSegments).print() - * //or tf.unsortedSegmentSum(x, segmentIds, numSegments) - * ``` - * @param x The `tf.Tensor` that will be summed along its segments. - * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s - * dimension along the `axis`. Maps each element of `x` to a segment. - * @param numSegments The number of distinct `segmentIds`. - * - * @doc {heading: 'Operations', subheading: 'Segment'} - */ - function unsortedSegmentSum_(x, segmentIds, numSegments) { - const $x = convertToTensor(x, 'x', 'unsortedSegmentSum'); - const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); - assert(isInt(numSegments), () => 'numSegments must be of dtype int'); - const inputs = { x: $x, segmentIds: $segmentIds }; - const attrs = { numSegments }; - return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs); - } - const unsortedSegmentSum = op({ unsortedSegmentSum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * tf.unstack(a).forEach(tensor => tensor.print()); - * ``` - * - * @param x A tensor object. - * @param axis The axis to unstack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function unstack_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric'); - assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); - const inputs = { value: $x }; - const attrs = { axis }; - return ENGINE.runKernel(Unpack, inputs, attrs); - } - const unstack = op({ unstack_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`. - * - * The returned `tf.Tensor`'s dimension `i` will correspond to the input - * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`, - * where `n` is the rank of the input `tf.Tensor`. Hence by default, this - * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); - * - * a.transpose().print(); // or tf.transpose(a) - * ``` - * - * @param x The tensor to transpose. - * @param perm The permutation of the dimensions of a. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function transpose_(x, perm) { - const $x = convertToTensor(x, 'x', 'transpose'); - if (perm == null) { - perm = $x.shape.map((s, i) => i).reverse(); - } - assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of perm ${perm}.`); - perm.forEach(axis => { - assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` + - ` but got ${perm}`); - }); - if ($x.rank <= 1) { - return $x.clone(); - } - const inputs = { x: $x }; - const attrs = { perm }; - return ENGINE.runKernel(Transpose, inputs, attrs); - } - const transpose = op({ transpose_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the norm of scalar, vectors, and matrices. - * This function can compute several different vector norms (the 1-norm, the - * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) - * and matrix norms (Frobenius, 1-norm, and inf-norm). - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.norm().print(); // or tf.norm(x) - * ``` - * - * @param x The input array. - * @param ord Optional. Order of the norm. Supported norm types are - * following: - * - * | ord | norm for matrices | norm for vectors - * |------------|---------------------------|--------------------- - * |'euclidean' |Frobenius norm |2-norm - * |'fro' |Frobenius norm | - * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x)) - * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x)) - * |1 |max(sum(abs(x), axis=0)) |sum(abs(x)) - * |2 | |sum(abs(x)^2)^1/2* - * - * @param axis Optional. If axis is null (the default), the input is - * considered a vector and a single vector norm is computed over the entire - * set of values in the Tensor, i.e. norm(x, ord) is equivalent - * to norm(x.reshape([-1]), ord). If axis is a integer, the input - * is considered a batch of vectors, and axis determines the axis in x - * over which to compute vector norms. If axis is a 2-tuple of integer it is - * considered a batch of matrices and axis determines the axes in NDArray - * over which to compute a matrix norm. - * @param keepDims Optional. If true, the norm have the same dimensionality - * as the input. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function norm_(x, ord = 'euclidean', axis = null, keepDims = false) { - x = convertToTensor(x, 'x', 'norm'); - const norm = normImpl(x, ord, axis); - let keepDimsShape = norm.shape; - if (keepDims) { - const axes = parseAxisParam(axis, x.shape); - keepDimsShape = expandShapeToKeepDim(norm.shape, axes); - } - return reshape(norm, keepDimsShape); - } - function normImpl(x, p, axis = null) { - if (x.rank === 0) { - return abs(x); - } - // consider vector when no axis is specified - if (x.rank !== 1 && axis === null) { - return normImpl(reshape(x, [-1]), p, axis); - } - // vector - if (x.rank === 1 || typeof axis === 'number' || - Array.isArray(axis) && axis.length === 1) { - if (p === 1) { - return sum(abs(x), axis); - } - if (p === Infinity) { - return max(abs(x), axis); - } - if (p === -Infinity) { - return min(abs(x), axis); - } - if (p === 'euclidean' || p === 2) { - // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2 - return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - // matrix (assumption axis[0] < axis[1]) - if (Array.isArray(axis) && axis.length === 2) { - if (p === 1) { - return max(sum(abs(x), axis[0]), axis[1] - 1); - } - if (p === Infinity) { - return max(sum(abs(x), axis[1]), axis[0]); - } - if (p === -Infinity) { - return min(sum(abs(x), axis[1]), axis[0]); - } - if (p === 'fro' || p === 'euclidean') { - // norm(x) = sqrt(sum(pow(x, 2))) - return sqrt(sum(square(x), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - throw new Error(`Error in norm: invalid axis: ${axis}`); - } - const norm = op({ norm_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the filter of a 2D convolution. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed. - * @param dy The dy image, of rank 4 or rank 3, of shape - * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed. - * @param filterShape The shape of the filter, length 4, - * [filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` + - `${x4D.shape}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` + - `${dy4D.shape}.`); - assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` + - `${filterShape}.`); - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` + - `match input depth in filter (${filterShape[2]}.`); - assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` + - `match output depth for filter (${filterShape[3]}).`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs); - } - const conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dimRoundingMode, dilations, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs); - } - const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) { - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape }; - const res = - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Bilinear resize a single 3D image or a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to `false`. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers - * are at 0.5, which would make the floating point coordinates of the top - * left pixel 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ - function resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeBilinear'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` + - `${size}.`); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const resizeBilinear = op({ resizeBilinear_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * NearestNeighbor resize a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to False. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of - * half the actual dimensions, and yields more accurate resizes. This flag - * would also make the floating point coordinates of the top left pixel - * 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ - function resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` + - `${size}.`); - assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype'); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const resizeNearestNeighbor = op({ resizeNearestNeighbor_ }); - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.abs = function () { - this.throwIfDisposed(); - return abs(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.acos = function () { - this.throwIfDisposed(); - return acos(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.acosh = function () { - this.throwIfDisposed(); - return acosh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.add = function (b) { - this.throwIfDisposed(); - return add$1(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.all = function (axis, keepDims) { - this.throwIfDisposed(); - return all(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.any = function (axis, keepDims) { - this.throwIfDisposed(); - return any(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.argMax = function (axis) { - this.throwIfDisposed(); - return argMax(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.argMin = function (axis) { - this.throwIfDisposed(); - return argMin(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Converts a size-1 `tf.Tensor` to a `tf.Scalar`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.asScalar = function () { - this.throwIfDisposed(); - assert(this.size === 1, () => 'The array must have only 1 element.'); - return reshape(this, []); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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 (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Converts a `tf.Tensor` to a `tf.Tensor1D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.as1D = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns) { - this.throwIfDisposed(); - return reshape(this, [rows, columns]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth, depth2) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth, depth2, depth3) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2, depth3]); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.asin = function () { - this.throwIfDisposed(); - return asin(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.asinh = function () { - this.throwIfDisposed(); - return asinh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atan = function () { - this.throwIfDisposed(); - return atan(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atan2 = function (b) { - this.throwIfDisposed(); - return atan2(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atanh = function () { - this.throwIfDisposed(); - return atanh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.avgPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) { - this.throwIfDisposed(); - return batchToSpaceND(this, blockShape, crops); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) { - this.throwIfDisposed(); - return batchNorm(this, mean, variance, offset, scale, varianceEpsilon); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.broadcastTo = function (shape) { - this.throwIfDisposed(); - return broadcastTo(this, shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cast = function (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.ceil = function () { - this.throwIfDisposed(); - return ceil(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.clipByValue = function (min, max) { - this.throwIfDisposed(); - return clipByValue(this, min, max); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.concat = function (x, axis) { - this.throwIfDisposed(); - if (x instanceof Tensor) { - x = [x]; - } - return concat([this, ...x], axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { - this.throwIfDisposed(); - return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv2dTranspose = - function (filter, outputShape, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cos = function () { - this.throwIfDisposed(); - return cos(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cosh = function () { - this.throwIfDisposed(); - return cosh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) { - this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) { - this.throwIfDisposed(); - return depthToSpace(this, blockSize, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.depthwiseConv2d = - function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.dilation2d = - function (filter, strides, pad, dilations, dataFormat) { - this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad, dilations, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.divNoNan = function (b) { - this.throwIfDisposed(); - return divNoNan(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.div = function (b) { - this.throwIfDisposed(); - return div(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.dot = function (b) { - this.throwIfDisposed(); - return dot(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.elu = function () { - this.throwIfDisposed(); - return elu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.equal = function (b) { - this.throwIfDisposed(); - return equal(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.erf = function () { - this.throwIfDisposed(); - return erf(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.exp = function () { - this.throwIfDisposed(); - return exp(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.expandDims = function (axis) { - this.throwIfDisposed(); - return expandDims(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.expm1 = function () { - this.throwIfDisposed(); - return expm1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.fft = function () { - this.throwIfDisposed(); - return fft(this); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Flatten a Tensor to a 1D array. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.flatten = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.floor = function () { - this.throwIfDisposed(); - return floor(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.floorDiv = function (b) { - this.throwIfDisposed(); - return floorDiv(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.gather = function (indices, axis) { - this.throwIfDisposed(); - return gather(this, indices, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.greaterEqual = function (b) { - this.throwIfDisposed(); - return greaterEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.greater = function (b) { - this.throwIfDisposed(); - return greater(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.ifft = function () { - this.throwIfDisposed(); - return ifft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.irfft = function () { - this.throwIfDisposed(); - return irfft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isFinite = function () { - this.throwIfDisposed(); - return isFinite$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isInf = function () { - this.throwIfDisposed(); - return isInf(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isNaN = function () { - this.throwIfDisposed(); - return isNaN$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.leakyRelu = function (alpha) { - this.throwIfDisposed(); - return leakyRelu(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.lessEqual = function (b) { - this.throwIfDisposed(); - return lessEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.less = function (b) { - this.throwIfDisposed(); - return less(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.localResponseNormalization = - function (depthRadius, bias, alpha, beta) { - this.throwIfDisposed(); - return localResponseNormalization(this, depthRadius, bias, alpha, beta); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSigmoid = function () { - this.throwIfDisposed(); - return logSigmoid(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSoftmax = function (axis) { - this.throwIfDisposed(); - return logSoftmax(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) { - this.throwIfDisposed(); - return logSumExp(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.log = function () { - this.throwIfDisposed(); - return log(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.log1p = function () { - this.throwIfDisposed(); - return log1p(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalAnd = function (b) { - this.throwIfDisposed(); - return logicalAnd(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalNot = function () { - this.throwIfDisposed(); - return logicalNot(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalOr = function (b) { - this.throwIfDisposed(); - return logicalOr(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalXor = function (b) { - this.throwIfDisposed(); - return logicalXor(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) { - this.throwIfDisposed(); - return matMul(this, b, transposeA, transposeB); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.maxPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.max = function (axis, keepDims) { - this.throwIfDisposed(); - return max(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.maximum = function (b) { - this.throwIfDisposed(); - return maximum(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mean = function (axis, keepDims) { - this.throwIfDisposed(); - return mean(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.min = function (axis, keepDims) { - this.throwIfDisposed(); - return min(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.minimum = function (b) { - this.throwIfDisposed(); - return minimum(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) { - this.throwIfDisposed(); - return mirrorPad(this, paddings, mode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mod = function (b) { - this.throwIfDisposed(); - return mod(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mul = function (b) { - this.throwIfDisposed(); - return mul(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.neg = function () { - this.throwIfDisposed(); - return neg(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) { - this.throwIfDisposed(); - return norm(this, ord, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.notEqual = function (b) { - this.throwIfDisposed(); - return notEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) { - this.throwIfDisposed(); - return oneHot(this, depth, onValue, offValue); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.onesLike = function () { - this.throwIfDisposed(); - return onesLike(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pad = function (paddings, constantValue) { - this.throwIfDisposed(); - return pad(this, paddings, constantValue); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) { - this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pow = function (exp) { - this.throwIfDisposed(); - return pow(this, exp); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.prelu = function (alpha) { - this.throwIfDisposed(); - return prelu(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.prod = function (axis, keepDims) { - this.throwIfDisposed(); - return prod(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reciprocal = function () { - this.throwIfDisposed(); - return reciprocal(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.relu = function () { - this.throwIfDisposed(); - return relu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.relu6 = function () { - this.throwIfDisposed(); - return relu6(this); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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) { - this.throwIfDisposed(); - return reshape(this, x.shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reshape = function (shape) { - this.throwIfDisposed(); - return reshape(this, shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.resizeBilinear = - function (newShape2D, alignCorners, halfPixelCenters) { - this.throwIfDisposed(); - return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.resizeNearestNeighbor = - function (newShape2D, alignCorners, halfFloatCenters) { - this.throwIfDisposed(); - return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reverse = function (axis) { - this.throwIfDisposed(); - return reverse(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.rfft = function () { - this.throwIfDisposed(); - return rfft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.round = function () { - this.throwIfDisposed(); - return round$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.rsqrt = function () { - this.throwIfDisposed(); - return rsqrt(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.selu = function () { - this.throwIfDisposed(); - return selu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.separableConv2d = - function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { - this.throwIfDisposed(); - return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sigmoid = function () { - this.throwIfDisposed(); - return sigmoid(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sign = function () { - this.throwIfDisposed(); - return sign(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sin = function () { - this.throwIfDisposed(); - return sin(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sinh = function () { - this.throwIfDisposed(); - return sinh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.slice = function (begin, size) { - this.throwIfDisposed(); - return slice(this, begin, size); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.softmax = function (dim) { - this.throwIfDisposed(); - return softmax(this, dim); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.softplus = function () { - this.throwIfDisposed(); - return softplus(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) { - this.throwIfDisposed(); - return spaceToBatchND(this, blockShape, paddings); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) { - this.throwIfDisposed(); - return split(this, numOrSizeSplits, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sqrt = function () { - this.throwIfDisposed(); - return sqrt(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.square = function () { - this.throwIfDisposed(); - return square(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.squaredDifference = function (b) { - this.throwIfDisposed(); - return squaredDifference(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.squeeze = function (axis) { - this.throwIfDisposed(); - return squeeze(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.stack = function (x, axis) { - this.throwIfDisposed(); - const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x]; - return stack(tensorsToBeStacked, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.step = function (alpha) { - this.throwIfDisposed(); - return step(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { - this.throwIfDisposed(); - return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sub = function (b) { - this.throwIfDisposed(); - return sub(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sum = function (axis, keepDims) { - this.throwIfDisposed(); - return sum(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tan = function () { - this.throwIfDisposed(); - return tan(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tanh = function () { - this.throwIfDisposed(); - return tanh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tile = function (reps) { - this.throwIfDisposed(); - return tile(this, reps); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `bool` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toBool = function () { - this.throwIfDisposed(); - return cast(this, 'bool'); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `float32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toFloat = function () { - this.throwIfDisposed(); - return cast(this, 'float32'); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `int32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toInt = function () { - this.throwIfDisposed(); - return cast(this, 'int32'); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.topk = function (k, sorted) { - this.throwIfDisposed(); - return topk(this, k, sorted); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.transpose = function (perm) { - this.throwIfDisposed(); - return transpose(this, perm); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unique = function (axis) { - this.throwIfDisposed(); - return unique(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unsortedSegmentSum = - function (segmentIds, numSegments) { - this.throwIfDisposed(); - return unsortedSegmentSum(this, segmentIds, numSegments); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unstack = function (axis) { - this.throwIfDisposed(); - return unstack(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.where = function (condition, x) { - this.throwIfDisposed(); - return where(condition, this, x); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.zerosLike = function () { - this.throwIfDisposed(); - return zerosLike(this); - }; - - /** - * @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. - * ============================================================================= - */ - const absGradConfig = { - kernelName: Abs, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, step(cast(x, 'float32'), -1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const acosGradConfig = { - kernelName: Acos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = square(cast(x, 'float32')); - const b = sqrt(sub(scalar(1), a)); - return neg(div(dy, b)); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const acoshGradConfig = { - kernelName: Acosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(sub(square(cast(x, 'float32')), 1)); - return div(dy, a); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const addGradConfig = { - kernelName: Add, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const addNGradConfig = { - kernelName: AddN, - saveAllInputs: true, - gradFunc: (dy, saved) => { - const ders = {}; - saved.forEach((_, i) => { - ders[i] = () => dy.clone(); - }); - return ders; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 argMaxGradConfig = { - kernelName: ArgMax, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 argMinGradConfig = { - kernelName: ArgMin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const asinGradConfig = { - kernelName: Asin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const asinhGradConfig = { - kernelName: Asinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(add$1(scalar(1), square(cast(x, 'float32')))); - return div(dy, a); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atan2GradConfig = { - kernelName: Atan2, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const d = add$1(square(a), square(b)); - let res = mul(dy, div(b, d)); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - const d = add$1(square(a), square(b)); - let res = neg(mul(dy, div(a, d))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atanGradConfig = { - kernelName: Atan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(square(cast(x, 'float32')), 1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atanhGradConfig = { - kernelName: Atanh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 3d avg pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank4 of shape - * [batchSize, depth, height, width, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad'); - const $input = convertToTensor(input, 'input', 'avgPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const avgPool3dGrad = op({ avgPool3dGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const avgPool3DGradConfig = { - kernelName: AvgPool3D, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of an 2D avg pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The input image, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ - function avgPoolGrad_(dy, input, filterSize, strides, pad) { - const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad'); - const $input = convertToTensor(input, 'input', 'avgPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); - let input4D = $input; - let dy4D = $dy; - let reshapedTo4D = false; - if ($input.rank === 3) { - reshapedTo4D = true; - input4D = - reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]); - dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]); - } - assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` + - `${dy4D.rank}.`); - assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` + - `${input4D.rank}.`); - const inputs = { dy: dy4D, input: input4D }; - const attrs = { filterSize, strides, pad }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const avgPoolGrad = op({ avgPoolGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const avgPoolGradConfig = { - kernelName: AvgPool, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad } = attrs; - return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const batchMatMulGradConfig = { - kernelName: BatchMatMul, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved, attrs) => { - const [a, b] = saved; - const { transposeA, transposeB } = attrs; - if (!transposeA && !transposeB) { - return { - a: () => matMul(dy, b, false, true), - b: () => matMul(a, dy, true, false) - }; - } - else if (!transposeA && transposeB) { - return { - a: () => matMul(dy, b, false, false), - b: () => matMul(dy, a, true, false) - }; - } - else if (transposeA && !transposeB) { - return { - a: () => matMul(b, dy, false, true), - b: () => matMul(a, dy, false, false) - }; - } - else { - return { - a: () => matMul(b, dy, true, true), - b: () => matMul(dy, a, true, true) - }; - } - } - }; - - /** - * @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. - * ============================================================================= - */ - const batchToSpaceNDGradConfig = { - kernelName: BatchToSpaceND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, crops } = attrs; - return { x: () => spaceToBatchND(dy, blockShape, crops) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const broadcastToGradConfig = { - kernelName: BroadcastTo, - gradFunc: (dy, saved, attrs) => { - const broadCastToAttrs = attrs; - const inputShape = broadCastToAttrs.inputShape; - const outputShape = broadCastToAttrs.shape; - const reps = Array.from(outputShape); - for (let i = inputShape.length - 1; i >= 0; i--) { - if (inputShape[i] === outputShape[i]) { - reps[i] = 1; - } - else if (inputShape[i] !== 1) { - throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); - } - } - const axes = []; - for (let i = 0; i < reps.length; i++) { - if (reps[i] > 1) { - axes.push(i); - } - } - return { x: () => sum(dy, axes, true /* keepDims */) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const castGradConfig = { - kernelName: Cast, - gradFunc: (dy) => { - return { x: () => dy.clone() }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const ceilGradConfig = { - kernelName: Ceil, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports it. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const clipByValueGradConfig = { - kernelName: ClipByValue, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { clipValueMin, clipValueMax } = attrs; - return { - x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)), - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const complexAbsGradConfig = { - kernelName: ComplexAbs, - inputsToSave: ['x'], - gradFunc: absGradConfig.gradFunc, - }; - - /** - * @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. - * ============================================================================= - */ - const concatGradConfig = { - kernelName: Concat, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const shapes = saved.map(t => t.shape); - const { axis } = attrs; - const $axis = parseAxisParam(axis, saved[0].shape)[0]; - const sizeSplits = shapes.map(s => s[$axis]); - const derTensors = split(dy, sizeSplits, $axis); - return derTensors.map(t => () => t); - } - }; - - /** - * @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. - * ============================================================================= - */ - const conv2DGradConfig = { - kernelName: Conv2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x4D, $filter] = saved; - const { dilations, strides, pad, dataFormat } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' + - `are not yet supported in gradients. Got dilations '${dilations}'`); - return { - x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat), - filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const conv2DBackpropInputGradConfig = { - kernelName: Conv2DBackpropInput, - inputsToSave: ['dy', 'filter'], - gradFunc: (ddx, saved, attrs) => { - const [dy, filter] = saved; - const { strides, pad, dataFormat, dimRoundingMode } = attrs; - return { - dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode), - filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the filter of a 3D convolution. - * - * @param x The input tensor, of rank 5 or rank 4 of shape - * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is - * assumed. - * @param dy The dy image, of rank 5 or rank 4, of shape - * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is - * assumed. - * @param filterShape The shape of the filter, length 5, - * [filterDepth, filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideDepth, strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ - function conv3DBackpropFilter_(x, dy, filterShape, strides, pad) { - let x5D = x; - if (x.rank === 4) { - x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); - } - let dy5D = dy; - if (dy5D.rank === 4) { - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - } - assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` + - `${x5D.shape}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` + - `${dy5D.shape}.`); - assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` + - `${filterShape}.`); - assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` + - `match input depth in filter (${filterShape[3]}.`); - assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` + - `match output depth for filter (${filterShape[4]}).`); - const inputs = { x: x5D, dy: dy5D }; - const attrs = { strides, pad, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs); - } - const conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - const conv3DGradConfig = { - kernelName: Conv3D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' + - `not yet supported in gradients. Got dilations '${dilations}'`); - const [x5D, $filter] = saved; - return { - x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad), - filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const cosGradConfig = { - kernelName: Cos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const coshGradConfig = { - kernelName: Cosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(sinh(cast(x, 'float32')), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const cumsumGradConfig = { - kernelName: Cumsum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis, exclusive, reverse } = attrs; - return { - x: () => { - const permutation = getAxesPermutation([axis], x.rank); - let out = cumsum(dy, axis, exclusive, !reverse); - if (permutation != null) { - out = transpose(out, permutation); - } - return out; - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const depthwiseConv2dNativeGradConfig = { - kernelName: DepthwiseConv2dNative, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad, dimRoundingMode } = attrs; - const $dilations = dilations == null ? [1, 1] : dilations; - assert(tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' + - `greater than 1 are not yet supported. Got dilations ` + - `'${$dilations}'`); - const [x, filter] = saved; - assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` + - `rank 4, but got rank ${x.rank}.`); - assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` + - `rank 4, but got rank ${filter.rank}.`); - assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` + - `channels (${x.shape[3]}) must match the inChannels dimension ` + - `in filter ${filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' + - `dilations must be 1. Got strides ${strides} and dilations ` + - `'${$dilations}'.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - return { - x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode), - filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode), - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const dilation2dGradConfig = { - kernelName: Dilation2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x, filter] = saved; - const inputInputs = { x, filter, dy }; - const filterInputs = { x, filter, dy }; - return { - x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs), - filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const eluGradConfig = { - kernelName: Elu, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - const inputs = { dy, y }; - return { x: () => ENGINE.runKernel(EluGrad, inputs) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const erfGradConfig = { - kernelName: Erf, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI)); - return { x: () => mul(dy, a) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expGradConfig = { - kernelName: Exp, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, y) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expandDimsGradConfig = { - kernelName: ExpandDims, - inputsToSave: ['input'], - gradFunc: (dy, saved) => { - const [input] = saved; - return { input: () => reshape(dy, input.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expm1GradConfig = { - kernelName: Expm1, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, exp(x)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const floorGradConfig = { - kernelName: Floor, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const floorDivGradConfig = { - kernelName: FloorDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const fusedBatchNormGradConfig = { - kernelName: FusedBatchNorm, - inputsToSave: ['x', 'mean', 'variance', 'scale'], - gradFunc: (dy, saved, attrs) => { - const { varianceEpsilon } = attrs; - const [x, mean, variance, scale] = saved; - const scaleValue = scale == null ? scalar(1) : scale; - const reductionAxes = getReductionAxes(mean.shape, x.shape); - const tileShape = []; - if (mean.rank === 1) { - for (let i = 0; i < x.shape.length - 1; ++i) { - tileShape.push(x.shape[i]); - } - tileShape.push(1); - } - const xMinusMean = sub(x, mean); - const dyTimesScaleValue = mul(dy, scaleValue); - const oneOverSqrtVariance = rsqrt(add$1(variance, scalar(varianceEpsilon))); - const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); - const derX = () => { - if (mean.rank === 1) { - return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape); - } - else { - return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); - } - }; - const derMean = () => { - let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); - if (mean.rank === 1) { - meanDer = sum(meanDer, reductionAxes); - } - return reshape(meanDer, mean.shape); - }; - const derVariance = () => { - let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); - if (mean.rank === 1) { - varianceDer = sum(varianceDer, reductionAxes); - } - return reshape(varianceDer, mean.shape); - }; - const derScale = () => { - const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); - let scaleDer = mul(dy, xMinusMean2TimesRsqrt); - if (mean.rank === 1) { - scaleDer = sum(scaleDer, reductionAxes); - } - return reshape(scaleDer, mean.shape); - }; - const derOffset = () => { - let offsetDer = dy; - if (mean.rank === 1) { - offsetDer = sum(offsetDer, reductionAxes); - } - return reshape(offsetDer, mean.shape); - }; - return { - x: derX, - mean: derMean, - variance: derVariance, - scale: derScale, - offset: derOffset - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const gatherGradConfig = { - kernelName: GatherV2, - inputsToSave: ['x', 'indices'], - gradFunc: (dy, saved, attrs) => { - const [x, indices] = saved; - const { axis } = attrs; - const parsedAxis = parseAxisParam(axis, x.shape)[0]; - const derX = () => { - const paramsShape = x.shape; - const indicesSize = indices.size; - const outerShape = paramsShape.slice(0, parsedAxis); - const outerDims = outerShape.length; - const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); - const innerDims = innerShape.length; - const outerAxesIndices = arrayRange(0, outerDims); - const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); - const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); - const values = reshape(dy, valuesShape); - const reshapedIndices = reshape(indices, [indicesSize]); - const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); - const valuesTranspose = transpose(values, transposeDims); - let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]); - const invertTransposeDims = getUndoAxesPermutation(transposeDims); - paramsGrad = transpose(paramsGrad, invertTransposeDims); - return paramsGrad; - }; - return { x: derX, indices: () => indices }; - } - }; - function arrayRange(start, stop) { - const result = []; - for (let i = start; i < stop; ++i) { - result.push(i); - } - return result; - } - function arrayConcat(arrays) { - const result = []; - for (let i = 0; i < arrays.length; ++i) { - for (let j = 0; j < arrays[i].length; ++j) { - result.push(arrays[i][j]); - } - } - return result; - } - - /** - * @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. - * ============================================================================= - */ - const greaterEqualGradConfig = { - kernelName: GreaterEqual, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - return { a: () => zerosLike(a), b: () => zerosLike(b) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const identityGradConfig = { - kernelName: Identity, - gradFunc: (dy) => { - return { x: () => cast(dy, 'float32') }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isFiniteGradConfig = { - kernelName: IsFinite, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isInfGradConfig = { - kernelName: IsInf, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isNanGradConfig = { - kernelName: IsNan, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const leakyReluGradConfig = { - kernelName: LeakyRelu, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { alpha } = attrs; - const mask = greater(x, 0); - // Returns `gradients * (features > 0) + alpha * gradients * (features <= - // 0)`. - return { x: () => where(mask, dy, mul(dy, alpha)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const log1pGradConfig = { - kernelName: Log1p, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(x, 1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const logGradConfig = { - kernelName: Log, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, cast(x, 'float32')) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const logSoftmaxGradConfig = { - kernelName: LogSoftmax, - inputsToSave: [], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [value] = saved; - const { axis } = attrs; - return { - logits: () => { - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - function localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const inputs = { x, y, dy }; - const attrs = { depthRadius, bias, alpha, beta }; - return ENGINE.runKernel(LRNGrad, inputs, attrs); - } - const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ }); - - /** - * @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. - * ============================================================================= - */ - const lrnGradConfig = { - kernelName: LRN, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { depthRadius, bias, alpha, beta } = attrs; - return { - x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Gradient helper function for the min and max operations. - */ - function gradForMinAndMax(dy, y, xOrig, origAxes) { - if (y.rank < xOrig.rank) { - y = reshape(y, expandShapeToKeepDim(y.shape, origAxes)); - } - if (dy.rank < xOrig.rank) { - dy = reshape(dy, expandShapeToKeepDim(dy.shape, origAxes)); - } - return { - x: () => { - const dx = mul(dy, cast(equal(xOrig, y), dy.dtype)); - return dx; - } - }; - } - - /** - * @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. - * ============================================================================= - */ - const maxGradConfig = { - kernelName: Max, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const maxAttrs = attrs; - const { reductionIndices } = maxAttrs; - const x = saved[0]; - const y = saved[1]; - const origAxes = parseAxisParam(reductionIndices, x.shape); - const maxGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return maxGrad['x'](); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const maximumGradConfig = { - kernelName: Maximum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(less(a, b), 'float32')); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 3d max pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank 4 of shape - * [batchSize, depth, height, width, channels]. - * @param output The original output image, of rank 5 of shape - * [batchSize, outDepth, outHeight, outWidth, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad'); - const $input = convertToTensor(input, 'input', 'maxPool3dGrad'); - const $output = convertToTensor(output, 'output', 'maxPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let output5D = $output; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - output5D = reshape($output, [ - 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` + - `${output5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D, output: output5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const maxPool3dGrad = op({ maxPool3dGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const maxPool3DGradConfig = { - kernelName: MaxPool3D, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 2D max pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The original input image, of rank 4, of shape - * [batchSize, height, width, channels]. - * @param output The original output image, of rank 4, of shape - * [batchSize, outHeight, outWidth, channels]. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad'); - const $input = convertToTensor(input, 'input', 'maxPoolGrad'); - const $output = convertToTensor(output, 'output', 'maxPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` + - `(${$dy.rank})`); - assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` + - `${$dy.rank}.`); - assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` + - `${$input.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: $dy, input: $input, output: $output }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(MaxPoolGrad, inputs, attrs); - } - const maxPoolGrad = op({ maxPoolGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const maxPoolGradConfig = { - kernelName: MaxPool, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad } = attrs; - return { - x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const meanGradConfig = { - kernelName: Mean, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - const shapes = computeOutAndReduceShapes(x.shape, axes); - const reduceShape = shapes[1]; - const reduceSize = sizeFromShape(reduceShape); - const derX = () => { - const expandedDyShape = x.shape.slice(); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const res = div(mul(expandedDy, ones$1(x.shape, 'float32')), reduceSize); - return res; - }; - return { x: derX }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const minGradConfig = { - kernelName: Min, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const minAttrs = attrs; - const { axis } = minAttrs; - const [x, y] = saved; - const origAxes = parseAxisParam(axis, x.shape); - const minGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return minGrad['x'](); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const minimumGradConfig = { - kernelName: Minimum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(lessEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(greater(a, b), 'float32')); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const mirrorPadGradConfig = { - kernelName: MirrorPad, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const modGradConfig = { - kernelName: Mod, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(dy, reduceAxes), a.shape); - } - return dy; - }; - const derB = () => { - const res = mul(dy, neg(floor(div(a, b)))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const multiplyGradConfig = { - kernelName: Multiply, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = mul(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - const res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const negGradConfig = { - kernelName: Neg, - gradFunc: (dy) => { - return { x: () => neg(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const oneHotGradConfig = { - kernelName: OneHot, - inputsToSave: ['indices'], - gradFunc: (dy, saved) => { - const indices = saved[0]; - return { indices: () => zeros(indices.shape, 'float32') }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const onesLikeGradConfig = { - kernelName: OnesLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const packGradConfig = { - kernelName: Pack, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - const derTensors = unstack(dy, axis); - return derTensors.map(t => () => t); - } - }; - - /** - * @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. - * ============================================================================= - */ - const padV2GradConfig = { - kernelName: PadV2, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const powGradConfig = { - kernelName: Pow, - inputsToSave: ['a', 'b'], - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [a, b, y] = saved; - const base = a; - const exp = b; - const outShape = assertAndGetBroadcastShape(base.shape, exp.shape); - const derBase = () => { - const expFloat = cast(exp, 'float32'); - let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1))))); - const reduceAxes = getReductionAxes(base.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, base.shape); - }; - const derExp = () => { - const condition = greater(base, 0); - const logBase = where(condition, log(base), zerosLike(base)); - let res = mul(dy, mul(y, logBase)); - const reduceAxes = getReductionAxes(exp.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, exp.shape); - }; - return { a: derBase, b: derExp }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const preluGradConfig = { - kernelName: Prelu, - inputsToSave: ['x', 'alpha'], - gradFunc: (dy, saved) => { - const [x, alpha] = saved; - const mask = greater(x, 0); - return { - x: () => where(mask, dy, mul(dy, alpha)), - alpha: () => { - let res = where(mask, zerosLike(dy), mul(dy, x)); - const reduceAxes = getReductionAxes(alpha.shape, dy.shape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, alpha.shape); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const divGradConfig = { - kernelName: RealDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reciprocalGradConfig = { - kernelName: Reciprocal, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, neg(square(x))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const relu6GradConfig = { - kernelName: Relu6, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const mask = mul(lessEqual(x, 6), step(x)); - return { x: () => mul(dy, cast(mask, 'float32')) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reluGradConfig = { - kernelName: Relu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, cast(step(x), 'float32')) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 reshapeGradConfig = { - kernelName: Reshape, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => reshape(dy, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const resizeBilinearGradConfig = { - kernelName: ResizeBilinear, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs); - return { images: imagesDer }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const resizeNearestNeighborGradConfig = { - kernelName: ResizeNearestNeighbor, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs); - return { images: imagesDer }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reverseGradConfig = { - kernelName: Reverse, - gradFunc: (dy, saved, attrs) => { - const { dims } = attrs; - const axes = parseAxisParam(dims, dy.shape); - return { x: () => reverse(dy, axes) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const roundGradConfig = { - kernelName: Round, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const rsqrtGradConfig = { - kernelName: Rsqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const selectGradConfig = { - kernelName: Select, - inputsToSave: ['condition'], - gradFunc: (dy, saved) => { - const [condition] = saved; - return { - // TODO(julianoks): Return null for condition gradient - // when backprop supports it. - condition: () => cast(zerosLike(condition), 'float32'), - t: () => mul(dy, cast(condition, dy.dtype)), - e: () => mul(dy, cast(logicalNot(condition), dy.dtype)) - }; - } - }; - - /** - * @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 SELU_SCALEALPHA = 1.7580993408473768599402175208123; - const SELU_SCALE = 1.0507009873554804934193349852946; - - /** - * @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. - * ============================================================================= - */ - const seluGradConfig = { - kernelName: Selu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const mask = greater(x, scalar(0)); - const scaleAlpha = scalar(SELU_SCALEALPHA); - const scale = scalar(SELU_SCALE); - const greaterThanZeroDer = mul(dy, scale); - const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32'))); - return where(mask, greaterThanZeroDer, lessEqualZeroDer); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sigmoidGradConfig = { - kernelName: Sigmoid, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, mul(y, sub(scalar(1), y))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const signGradConfig = { - kernelName: Sign, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sinGradConfig = { - kernelName: Sin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cos(cast(x, 'float32')), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sinhGradConfig = { - kernelName: Sinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cosh(cast(x, 'float32')), dy) }; - } - }; - - /** - * @license - * Copyright 2017 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 parseSliceParams(x, begin, size) { - // The following logic allows for more ergonomic calls. - let begin_; - const xRank = x.shape.length; - if (typeof begin === 'number') { - begin_ = [begin, ...new Array(xRank - 1).fill(0)]; - } - else if (begin.length < xRank) { - begin_ = begin.concat(new Array(xRank - begin.length).fill(0)); - } - else { - begin_ = begin.slice(); - } - begin_.forEach(d => { - assert(d !== -1, () => 'slice() does not support negative begin indexing.'); - }); - let size_; - if (size == null) { - size_ = new Array(xRank).fill(-1); - } - else if (typeof size === 'number') { - size_ = [size, ...new Array(xRank - 1).fill(-1)]; - } - else if (size.length < xRank) { - size_ = size.concat(new Array(xRank - size.length).fill(-1)); - } - else { - size_ = size; - } - size_ = size_.map((d, i) => { - if (d >= 0) { - return d; - } - else { - assert(d === -1, () => `Negative size values should be exactly -1 but got ` + - `${d} for the slice() size at index ${i}.`); - return x.shape[i] - begin_[i]; - } - }); - return [begin_, size_]; - } - - /** - * @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. - * ============================================================================= - */ - const sliceGradConfig = { - kernelName: Slice, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { begin, size } = attrs; - const inputShape = x.shape; - const [begin_, size_] = parseSliceParams(x, begin, size); - // Create an Nx2 padding where the first column represents how many - // zeros are prepended (at start) for each dimension, and the second - // column indicates how many zeros are appended (at end). - // The number of zeros to append is the shape of the input - // elementwise-subtracted by both the begin vector and sizes vector. - const paddings = []; - for (let i = 0; i < dy.rank; i++) { - paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); - } - return { x: () => pad(dy, paddings) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const softmaxGradConfig = { - kernelName: Softmax, - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [y] = saved; - const { dim } = attrs; - const keepDims = true; - const dyTimesY = mul(dy, y); - return { - logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y)) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const softplusGradConfig = { - kernelName: Softplus, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, sigmoid(x)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const spaceToBatchNDGradConfig = { - kernelName: SpaceToBatchND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, paddings } = attrs; - return { x: () => batchToSpaceND(dy, blockShape, paddings) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const splitVGradConfig = { - kernelName: SplitV, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - return { x: () => concat(dy, axis) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sqrtGradConfig = { - kernelName: Sqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const squareGradConfig = { - kernelName: Square, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const squaredDifferenceGradConfig = { - kernelName: SquaredDifference, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const two = scalar(2); - const derA = () => mul(dy, mul(two, sub(a, b))); - const derB = () => mul(dy, mul(two, sub(b, a))); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const stepGradConfig = { - kernelName: Step, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports - // it. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const subGradConfig = { - kernelName: Sub, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(neg(res), b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 sumGradConfig = { - kernelName: Sum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const expandedDyShape = x.shape.slice(); - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const derX = mul(expandedDy, ones$1(x.shape, 'float32')); - return { x: () => derX }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tanGradConfig = { - kernelName: Tan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, square(cos(x))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tanhGradConfig = { - kernelName: Tanh, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(sub(scalar(1), square(y)), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tileGradConfig = { - kernelName: Tile, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { reps } = attrs; - const derX = () => { - let xGrad = zerosLike(x); - // TODO(cais): Maybe reduce memory footprint by avoiding repeated - // slicing. - if (x.rank === 1) { - for (let i = 0; i < reps[0]; ++i) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]])); - } - } - else if (x.rank === 2) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [ - x.shape[0], x.shape[1] - ])); - } - } - } - else if (x.rank === 3) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - xGrad = - add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); - } - } - } - } - else if (x.rank === 4) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - for (let l = 0; l < reps[3]; ++l) { - xGrad = - add$1(xGrad, slice(dy, [ - i * x.shape[0], j * x.shape[1], k * x.shape[2], - l * x.shape[3] - ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); - } - } - } - } - } - else { - throw new Error(`Gradient for tile operation is not implemented for rank-` + - `${x.rank} tensors yet.`); - } - return xGrad; - }; - return { x: derX }; - }, - }; - - /** - * @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. - * ============================================================================= - */ - const transposeGradConfig = { - kernelName: Transpose, - gradFunc: (dy, saved, attrs) => { - const transposeAttrs = attrs; - const { perm } = transposeAttrs; - const undoPerm = getUndoAxesPermutation(perm); - return { x: () => transpose(dy, undoPerm) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 unpackGradConfig = { - kernelName: Unpack, - gradFunc: (dy, saved, attrs) => { - const unpackAttrs = attrs; - const { axis } = unpackAttrs; - return { value: () => stack(dy, axis) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const unsortedSegmentSumGradConfig = { - kernelName: UnsortedSegmentSum, - inputsToSave: ['segmentIds'], - gradFunc: (dy, saved) => { - const [segmentIds] = saved; - const derX = () => { - return gatherDropNegatives(dy, segmentIds); - }; - return { x: derX }; - } - }; - function gatherDropNegatives(x, indices) { - // Helper function for unsorted segment ops. Gathers params for - // positive segment ids and gathers 0 for inputs with negative segment id. - // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py - const zeroClippedIndices = maximum(indices, zerosLike(indices)); - const gathered = gather(x, zeroClippedIndices); - let isPositive = greaterEqual(indices, scalar(0, 'int32')); - const numIters = gathered.rank - isPositive.rank; - for (let i = 0; i < numIters; ++i) { - isPositive = expandDims(isPositive, i + 1); - } - isPositive = logicalAnd(isPositive, ones$1(gathered.shape, 'bool')); - const zeroSlice = zerosLike(gathered); - return where(isPositive, gathered, zeroSlice); - } - - /** - * @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. - * ============================================================================= - */ - const zerosLikeGradConfig = { - kernelName: ZerosLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - // Export all kernel configs here so that the package can auto register them - const gradConfigs = [ - absGradConfig, - acosGradConfig, - acoshGradConfig, - addGradConfig, - addNGradConfig, - argMaxGradConfig, - argMinGradConfig, - asinGradConfig, - asinhGradConfig, - atan2GradConfig, - atanGradConfig, - atanhGradConfig, - avgPool3DGradConfig, - avgPoolGradConfig, - batchMatMulGradConfig, - batchToSpaceNDGradConfig, - broadcastToGradConfig, - castGradConfig, - ceilGradConfig, - clipByValueGradConfig, - complexAbsGradConfig, - concatGradConfig, - conv2DBackpropInputGradConfig, - conv2DGradConfig, - conv3DGradConfig, - cosGradConfig, - coshGradConfig, - cumsumGradConfig, - depthwiseConv2dNativeGradConfig, - dilation2dGradConfig, - divGradConfig, - eluGradConfig, - erfGradConfig, - expGradConfig, - expandDimsGradConfig, - expm1GradConfig, - floorDivGradConfig, - floorGradConfig, - fusedBatchNormGradConfig, - gatherGradConfig, - greaterEqualGradConfig, - identityGradConfig, - isFiniteGradConfig, - isInfGradConfig, - isNanGradConfig, - leakyReluGradConfig, - log1pGradConfig, - logGradConfig, - logSoftmaxGradConfig, - lrnGradConfig, - maxGradConfig, - maxGradConfig, - maximumGradConfig, - maxPool3DGradConfig, - maxPoolGradConfig, - meanGradConfig, - minGradConfig, - minimumGradConfig, - mirrorPadGradConfig, - modGradConfig, - multiplyGradConfig, - negGradConfig, - oneHotGradConfig, - onesLikeGradConfig, - packGradConfig, - padV2GradConfig, - padV2GradConfig, - powGradConfig, - preluGradConfig, - reciprocalGradConfig, - relu6GradConfig, - reluGradConfig, - reshapeGradConfig, - resizeBilinearGradConfig, - resizeNearestNeighborGradConfig, - reverseGradConfig, - roundGradConfig, - rsqrtGradConfig, - selectGradConfig, - seluGradConfig, - sigmoidGradConfig, - signGradConfig, - sinGradConfig, - sinhGradConfig, - sliceGradConfig, - softmaxGradConfig, - softplusGradConfig, - spaceToBatchNDGradConfig, - spaceToBatchNDGradConfig, - splitVGradConfig, - splitVGradConfig, - sqrtGradConfig, - squaredDifferenceGradConfig, - squareGradConfig, - stepGradConfig, - subGradConfig, - sumGradConfig, - tanGradConfig, - tanhGradConfig, - tileGradConfig, - transposeGradConfig, - unpackGradConfig, - unsortedSegmentSumGradConfig, - zerosLikeGradConfig - ]; - for (const gradientConfig of gradConfigs) { - registerGradient(gradientConfig); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - let _epsilon; - /** - * Returns the value of the fuzz factor used in numeric expressions. - */ - function epsilon() { - if (_epsilon == null) { - _epsilon = tfc.backend().epsilon(); - } - return _epsilon; - } - /** - * Returns the default image data format convention. - */ - function imageDataFormat() { - return 'channelsLast'; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ - // tslint:enable - /** - * Equivalent of Python's AttributeError. - */ - class AttributeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AttributeError.prototype); - } - } - /** - * Equivalent of Python's RuntimeError. - */ - class RuntimeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, RuntimeError.prototype); - } - } - /** - * Equivalent of Python's ValueError. - */ - class ValueError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, ValueError.prototype); - } - } - /** - * Equivalent of Python's NotImplementedError. - */ - class NotImplementedError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, NotImplementedError.prototype); - } - } - /** - * Equivalent of Python's AssertionError. - */ - class AssertionError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AssertionError.prototype); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ - // tslint:disable-next-line:no-any - function pyListRepeat(value, numValues) { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - let newArray = []; - for (let i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } - else { - const newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } - } - function assert$1(val, message) { - if (!val) { - throw new AssertionError(message); - } - } - /** - * Count the number of elements of the `array` that are equal to `reference`. - */ - function count(array, refernce) { - let counter = 0; - for (const item of array) { - if (item === refernce) { - counter++; - } - } - return counter; - } - /** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ - function singletonOrArray(xs) { - if (xs.length === 1) { - return xs[0]; - } - return xs; - } - /** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ - // tslint:disable-next-line:no-any - function toList(x) { - if (Array.isArray(x)) { - return x; - } - return [x]; - } - /** - * Converts string to snake-case. - * @param name - */ - function toSnakeCase(name) { - const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - const insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; - } - function toCamelCase(identifier) { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, (m, p1) => p1.toUpperCase()); - } - // tslint:disable-next-line:no-any - let _GLOBAL_CUSTOM_OBJECTS = {}; - function serializeKerasObject(instance) { - if (instance === null || instance === undefined) { - return null; - } - const dict = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; - } - /** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ - function convertNDArrayScalarsInConfig(config) { - if (config == null || typeof config !== 'object') { - return; - } - else if (Array.isArray(config)) { - config.forEach(configItem => convertNDArrayScalarsInConfig(configItem)); - } - else { - const fields = Object.keys(config); - for (const field of fields) { - const value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } - else { - convertNDArrayScalarsInConfig(value); - } - } - } - } - } - /** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ - // tslint:disable:no-any - function deserializeKerasObject(identifier, moduleObjects = {}, customObjects = {}, printableModuleName = 'object', fastWeightInit = false) { - // tslint:enable - if (typeof identifier === 'string') { - const functionName = identifier; - let fn; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } - else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } - else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${identifier}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } - else { - // In this case we are dealing with a Keras config dictionary. - const config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError(`${printableModuleName}: Improper config format: ` + - `${JSON.stringify(config)}.\n` + - `'className' and 'config' must set.`); - } - const className = config['className']; - let cls, fromConfig; - if (className in customObjects) { - [cls, fromConfig] = customObjects[className]; - } - else if (className in _GLOBAL_CUSTOM_OBJECTS) { - [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className']; - } - else if (className in moduleObjects) { - [cls, fromConfig] = moduleObjects[className]; - } - if (cls == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${className}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - // tslint:disable-next-line:no-any - const customObjectsCombined = {}; - for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) { - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (const key of Object.keys(customObjects)) { - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - const nestedConfig = config['config']; - nestedConfig['customObjects'] = customObjectsCombined; - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - const returnObj = fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - const returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - } - } - /** - * Compares two numbers for sorting. - * @param a - * @param b - */ - function numberCompare(a, b) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); - } - /** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ - function reverseNumberCompare(a, b) { - return -1 * numberCompare(a, b); - } - /** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ - function unique$1(xs) { - if (xs == null) { - return xs; - } - const out = []; - // TODO(cais): Maybe improve performance by sorting. - for (const x of xs) { - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; - } - /** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ - function isObjectEmpty(obj) { - if (obj == null) { - throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`); - } - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; - } - /** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ - function checkStringTypeUnionValue(values, label, value) { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(`${value} is not a valid ${label}. Valid values are ${values} or null/undefined.`); - } - } - /** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ - // tslint:disable:no-any - function checkArrayTypeAndLength(x, expectedType, minLength = 0, maxLength = Infinity) { - assert$1(minLength >= 0); - assert$1(maxLength >= minLength); - return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(e => typeof e === expectedType)); - } - // tslint:enable:no-any - /** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ - function assertPositiveInteger(value, name) { - if (Array.isArray(value)) { - tfc.util.assert(value.length > 0, () => `${name} is unexpectedly an empty array.`); - value.forEach((v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`)); - } - else { - tfc.util.assert(Number.isInteger(value) && value > 0, () => `Expected ${name} to be a positive integer, but got ` + - `${formatAsFriendlyString(value)}.`); - } - } - /** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ - // tslint:disable-next-line:no-any - function formatAsFriendlyString(value) { - if (value === null) { - return 'null'; - } - else if (Array.isArray(value)) { - return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']'; - } - else if (typeof value === 'string') { - return `"${value}"`; - } - else { - return `${value}`; - } - } - /** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ - function debounce(f, waitMs) { - let lastTime = tfc.util.now(); - let lastResult; - const f2 = (...args) => { - const now = tfc.util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f(...args); - return lastResult; - }; - return f2; - } - /** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ - function mapActivationToFusedKernel(activationName) { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function used by many of the Constraints to find the L2Norms. - */ - function calcL2Norms(w, axis) { - return tfc.tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true))); - } - /** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ - class Constraint extends tfc.serialization.Serializable { - getConfig() { - return {}; - } - } - class MaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMaxValue = 2; - this.defaultAxis = 0; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tfc.tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.clipByValue(norms, 0, this.maxValue); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - getConfig() { - return { maxValue: this.maxValue, axis: this.axis }; - } - } - /** @nocollapse */ - MaxNorm.className = 'MaxNorm'; - tfc.serialization.registerClass(MaxNorm); - class UnitNorm extends Constraint { - constructor(args) { - super(); - this.defaultAxis = 0; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tfc.tidy(() => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis)))); - } - getConfig() { - return { axis: this.axis }; - } - } - /** @nocollapse */ - UnitNorm.className = 'UnitNorm'; - tfc.serialization.registerClass(UnitNorm); - class NonNeg extends Constraint { - apply(w) { - return tfc.relu(w); - } - } - /** @nocollapse */ - NonNeg.className = 'NonNeg'; - tfc.serialization.registerClass(NonNeg); - class MinMaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMinValue = 0.0; - this.defaultMaxValue = 1.0; - this.defaultRate = 1.0; - this.defaultAxis = 0; - this.minValue = - args.minValue != null ? args.minValue : this.defaultMinValue; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.rate = args.rate != null ? args.rate : this.defaultRate; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tfc.tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.add(tfc.mul(this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)), tfc.mul(1.0 - this.rate, norms)); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - getConfig() { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - } - } - /** @nocollapse */ - MinMaxNorm.className = 'MinMaxNorm'; - tfc.serialization.registerClass(MinMaxNorm); - // Maps the JavaScript-like identifier keys to the corresponding registry - // symbols. - const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' - }; - function serializeConstraint(constraint) { - return serializeKerasObject(constraint); - } - function deserializeConstraint(config, customObjects = {}) { - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); - } - function getConstraint(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeConstraint(config); - } - else if (identifier instanceof Constraint) { - return identifier; - } - else { - return deserializeConstraint(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ - function maxNorm(args) { - return new MaxNorm(args); - } - /** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ - function unitNorm(args) { - return new UnitNorm(args); - } - /** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ - function nonNeg() { - return new NonNeg(); - } - /** @doc {heading: 'Constraints', namespace: 'constraints'} */ - function minMaxNorm(config) { - return new MinMaxNorm(config); - } - - var exports_constraints = /*#__PURE__*/Object.freeze({ - __proto__: null, - maxNorm: maxNorm, - unitNorm: unitNorm, - nonNeg: nonNeg, - minMaxNorm: minMaxNorm - }); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; - const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; - const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; - const VALID_POOL_MODE_VALUES = ['max', 'avg']; - const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // A map from the requested scoped name of a Tensor to the number of Tensors - // wanting that name so far. This allows enforcing name uniqueness by appending - // an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. - const nameMap = new Map(); - function checkDataFormat(value) { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); - } - function checkInterpolationFormat(value) { - checkStringTypeUnionValue(VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); - } - function checkPaddingMode(value) { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); - } - function checkPoolMode(value) { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); - } - const _nameScopeStack = []; - const _nameScopeDivider = '/'; - /** - * Enter namescope, which can be nested. - */ - function nameScope(name, fn) { - _nameScopeStack.push(name); - try { - const val = fn(); - _nameScopeStack.pop(); - return val; - } - catch (e) { - _nameScopeStack.pop(); - throw e; - } - } - /** - * Get the current namescope as a flat, concatenated string. - */ - function currentNameScopePrefix() { - if (_nameScopeStack.length === 0) { - return ''; - } - else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } - } - /** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ - function getScopedTensorName(tensorName) { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; - } - /** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ - function getUniqueTensorName(scopedName) { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - const index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - if (index > 0) { - const result = `${scopedName}_${index}`; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } - else { - return scopedName; - } - } - const tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); - /** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ - function isValidTensorName(name) { - return !!name.match(tensorNameRegex); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Determine if a number is an integer. - */ - function isInteger(x) { - return x === parseInt(x.toString(), 10); - } - /** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ - function arrayProd(array, begin, end) { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - let prod = 1; - for (let i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; - } - /** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ - function toArray1D(array) { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tfc.tensor1d(array); - } - /** - * Compute minimum value. - * @param array - * @return minimum value. - */ - function min$1(array) { - return tfc.min(toArray1D(array)).dataSync()[0]; - } - /** - * Compute maximum value. - * @param array - * @return maximum value - */ - function max$1(array) { - return tfc.max(toArray1D(array)).dataSync()[0]; - } - /** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ - function range(begin, end) { - if (end < begin) { - throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`); - } - const out = []; - for (let i = begin; i < end; ++i) { - out.push(i); - } - return out; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ - function cast$1(x, dtype) { - return x.asType(dtype); - } - /** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ - function expandDims$1(x, axis = -1) { - const outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); - } - /** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ - function repeat(x, n) { - return tfc.tidy(() => { - if (x.shape.length !== 2) { - throw new ValueError(`repeat() expects a rank-2 tensor, but received a ` + - `rank-${x.shape.length} tensor.`); - } - const y = expandDims$1(x, 1); - return tile$1(y, [1, n, 1]); - }); - } - /** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ - function flatten$1(x) { - const newShape = [arrayProd(x.shape)]; - return x.reshape(newShape); - } - /** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ - function batchFlatten(x) { - if (x.rank <= 1) { - throw new ValueError(`batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`); - } - const newShape = [x.shape[0], arrayProd(x.shape, 1)]; - return x.reshape(newShape); - } - /** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongFirstAxis(array, start, size) { - return tfc.tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); - case 3: - return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); - case 4: - return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return tfc.slice(array, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return tfc.slice(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError(`sliceAlongFirstAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); - } - /** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongLastAxis(array, start, size) { - return tfc.tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [0, start], [array.shape[0], size]); - case 3: - return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); - case 4: - return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); - } - /** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongAxis(array, start, size, axis) { - return tfc.tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); - } - /** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ - function concatenate(tensors, axis = -1) { - let rank; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } - else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return tfc.concat(tensors, axis); - } - /** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ - function concatAlongFirstAxis(a, b) { - switch (a.rank) { - case 1: - return tfc.concat1d([a, b]); - case 2: - return tfc.concat2d([a, b], 0); - case 3: - return tfc.concat3d([a, b], 0); - case 4: - return tfc.concat4d([a, b], 0); - default: - throw new ValueError(`concatAlongFirstAxis() received an unsupported ` + - `tensor rank: ${a.rank}`); - } - } - /** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ - function tile$1(x, n) { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError(`The length of input n (${n.length}) does not match ` + - `the number of dimensions in input x (${x.rank})`); - } - return tfc.tile(x, n); - } - /* Creation of random tensors. */ - /** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ - function randomNormal(shape, mean = 0.0, stddev = 1.0, dtype, seed) { - return tfc.randomNormal(shape, mean, stddev, dtype, seed); - } - /* Linear Algebra */ - /** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ - function dot$1(a, b, activation, bias) { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError(`dot requires both inputs to be rank >= 2` + - ` but got x shape = ${a.shape} and y shape = ${b.shape}`); - } - if (b.rank >= 3) { - const xLastDim = a.shape.slice(-1)[0]; - const ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError(`If rank y >= 3, then the second last dim` + - ` of y must equal the last dim of x but got x shape = ${a.shape} and ` + - ` y shape = ${b.shape}`); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - const transposeA = false; - const transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return tfc.fused.matMul({ - a, - b: b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }); - } - else { - // Reshape x into the analogous 2D Tensor. - const aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - const aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - const bShape = b.shape.slice(); - const bLastDim = bShape.pop(); - const ySecondLastDim = bShape.pop(); - const yOtherDims = [...bShape, bLastDim]; - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - const perm = Array.from({ length: b.rank }, (_, i) => { - if (i === 0) { - return b.rank - 2; - } - else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - // Multiply x and y as 2D Tensors, and then reshape back to original. - const outputShape = [...aFirstDims, ...yOtherDims]; - const transposeA = false; - const transposeB = false; - return tfc.fused - .matMul({ - a, - b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }) - .reshape(outputShape); - } - } - /* Elementary math functions. */ - /** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ - function gather$1(reference, indices, axis) { - return tfc.tidy(() => { - if (Array.isArray(indices)) { - indices = tfc.tensor1d(indices, 'int32'); - } - else { - indices = indices.toInt(); - } - return tfc.gather(reference, indices, axis); - }); - } - /** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ - function square$1(x) { - return tfc.mul(x, x); - } - /** - * Reshapes bias tensor according to rank of x. - */ - function reshapeBias(xRank, bias, dataFormat) { - const biasShape = bias.shape; - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError(`Unexpected bias dimensions: ${bias.rank}` + - `; expected it to be 1 or ${xRank}`); - } - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } - else { - return bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } - else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } - else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank < 3) { - return bias; - } - throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`); - } - /* Neural-network operations. */ - /** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ - function biasAdd(x, bias, dataFormat) { - return tfc.tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); - } - /** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ - function elu$1(x, alpha = 1) { - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError(`Support for alpha values other than 1 (${alpha}) is not implemented ` + - `yet.`); - } - return tfc.elu(x); - } - /** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ - function softsign(x) { - return tfc.tidy(() => tfc.div(x, tfc.abs(x).add(1))); - } - /** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ - function dropout(x, level, noiseShape, seed) { - return tfc.tidy(() => tfc.dropout(x, level, noiseShape, seed)); - } - /** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ - function hardSigmoid(x) { - return tfc.tidy(() => { - const y = tfc.add(.5, tfc.mul(.2, x)); - return tfc.clipByValue(y, 0, 1); - }); - } - /** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ - function inTrainPhase(x, alt, training = false) { - return training ? x() : alt(); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; - const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform', 'truncatedNormal']; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function checkFanMode(value) { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); - } - function checkDistribution(value) { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); - } - /** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ - class Initializer extends tfc.serialization.Serializable { - fromConfigUsesCustomObjects() { - return false; - } - getConfig() { - return {}; - } - } - class Zeros extends Initializer { - apply(shape, dtype) { - return tfc.zeros(shape, dtype); - } - } - /** @nocollapse */ - Zeros.className = 'Zeros'; - tfc.serialization.registerClass(Zeros); - class Ones extends Initializer { - apply(shape, dtype) { - return tfc.ones(shape, dtype); - } - } - /** @nocollapse */ - Ones.className = 'Ones'; - tfc.serialization.registerClass(Ones); - class Constant extends Initializer { - constructor(args) { - super(); - if (typeof args !== 'object') { - throw new ValueError(`Expected argument of type ConstantConfig but got ${args}`); - } - if (args.value === undefined) { - throw new ValueError(`config must have value set but got ${args}`); - } - this.value = args.value; - } - apply(shape, dtype) { - return tfc.tidy(() => tfc.mul(tfc.scalar(this.value), tfc.ones(shape, dtype))); - } - getConfig() { - return { - value: this.value, - }; - } - } - /** @nocollapse */ - Constant.className = 'Constant'; - tfc.serialization.registerClass(Constant); - class RandomUniform extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MINVAL = -0.05; - this.DEFAULT_MAXVAL = 0.05; - this.minval = args.minval || this.DEFAULT_MINVAL; - this.maxval = args.maxval || this.DEFAULT_MAXVAL; - this.seed = args.seed; - } - apply(shape, dtype) { - return tfc.randomUniform(shape, this.minval, this.maxval, dtype); - } - getConfig() { - return { minval: this.minval, maxval: this.maxval, seed: this.seed }; - } - } - /** @nocollapse */ - RandomUniform.className = 'RandomUniform'; - tfc.serialization.registerClass(RandomUniform); - class RandomNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`randomNormal does not support dType ${dtype}.`); - } - return randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } - } - /** @nocollapse */ - RandomNormal.className = 'RandomNormal'; - tfc.serialization.registerClass(RandomNormal); - class TruncatedNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`truncatedNormal does not support dType ${dtype}.`); - } - return tfc.truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } - } - /** @nocollapse */ - TruncatedNormal.className = 'TruncatedNormal'; - tfc.serialization.registerClass(TruncatedNormal); - class Identity$1 extends Initializer { - constructor(args) { - super(); - this.gain = args.gain != null ? args.gain : 1.0; - } - apply(shape, dtype) { - return tfc.tidy(() => { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError('Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } - else { - return tfc.mul(this.gain, tfc.eye(shape[0])); - } - }); - } - getConfig() { - return { gain: this.gain }; - } - } - /** @nocollapse */ - Identity$1.className = 'Identity'; - tfc.serialization.registerClass(Identity$1); - /** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ - function computeFans(shape, dataFormat = 'channelsLast') { - let fanIn; - let fanOut; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } - else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - const receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } - else if (dataFormat === 'channelsLast') { - const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } - else { - const shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - return [fanIn, fanOut]; - } - class VarianceScaling extends Initializer { - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - constructor(args) { - super(); - if (args.scale < 0.0) { - throw new ValueError(`scale must be a positive float. Got: ${args.scale}`); - } - this.scale = args.scale == null ? 1.0 : args.scale; - this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(this.mode); - this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(this.distribution); - this.seed = args.seed; - } - apply(shape, dtype) { - const fans = computeFans(shape); - const fanIn = fans[0]; - const fanOut = fans[1]; - let scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } - else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } - else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - if (this.distribution === 'normal') { - const stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`${this.getClassName()} does not support dType ${dtype}.`); - } - return tfc.truncatedNormal(shape, 0, stddev, dtype, this.seed); - } - else { - const limit = Math.sqrt(3 * scale); - return tfc.randomUniform(shape, -limit, limit, dtype); - } - } - getConfig() { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - } - } - /** @nocollapse */ - VarianceScaling.className = 'VarianceScaling'; - tfc.serialization.registerClass(VarianceScaling); - class GlorotUniform extends VarianceScaling { - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - GlorotUniform.className = 'GlorotUniform'; - tfc.serialization.registerClass(GlorotUniform); - class GlorotNormal extends VarianceScaling { - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - GlorotNormal.className = 'GlorotNormal'; - tfc.serialization.registerClass(GlorotNormal); - class HeNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - HeNormal.className = 'HeNormal'; - tfc.serialization.registerClass(HeNormal); - class HeUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - HeUniform.className = 'HeUniform'; - tfc.serialization.registerClass(HeUniform); - class LeCunNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - LeCunNormal.className = 'LeCunNormal'; - tfc.serialization.registerClass(LeCunNormal); - class LeCunUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } - } - /** @nocollapse */ - LeCunUniform.className = 'LeCunNormal'; - tfc.serialization.registerClass(LeCunUniform); - class Orthogonal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_GAIN = 1; - this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain; - this.seed = args.seed; - if (this.seed != null) { - throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); - } - } - apply(shape, dtype) { - return tfc.tidy(() => { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn(`Orthogonal initializer is being called on a matrix with more ` + - `than 2000 (${shape[0] * shape[1]}) elements: ` + - `Slowness may result.`); - } - // TODO(cais): Add seed support. - const normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - const a = randomNormal(normalizedShape, 0, 1, 'float32'); - let q = tfc.linalg.gramSchmidt(a); - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return tfc.mul(this.gain, q); - }); - } - getConfig() { - return { - gain: this.gain, - seed: this.seed, - }; - } - } - /** @nocollapse */ - Orthogonal.className = 'Orthogonal'; - tfc.serialization.registerClass(Orthogonal); - // Maps the JavaScript-like identifier keys to the corresponding registry - // symbols. - const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' - }; - function deserializeInitializer(config, customObjects = {}) { - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); - } - function serializeInitializer(initializer) { - return serializeKerasObject(initializer); - } - function getInitializer(identifier) { - if (typeof identifier === 'string') { - const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } - else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } - else if (className === 'HeNormal') { - return new HeNormal(); - } - else if (className === 'HeUniform') { - return new HeUniform(); - } - else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } - else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } - else { - const config = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } - else if (identifier instanceof Initializer) { - return identifier; - } - else { - return deserializeInitializer(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function zeros$1() { - return new Zeros(); - } - /** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function ones$2() { - return new Ones(); - } - /** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function constant(args) { - return new Constant(args); - } - /** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function randomUniform(args) { - return new RandomUniform(args); - } - /** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function randomNormal$1(args) { - return new RandomNormal(args); - } - /** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function truncatedNormal(args) { - return new TruncatedNormal(args); - } - /** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function identity(args) { - return new Identity$1(args); - } - /** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ - function varianceScaling(config) { - return new VarianceScaling(config); - } - /** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function glorotUniform(args) { - return new GlorotUniform(args); - } - /** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function glorotNormal(args) { - return new GlorotNormal(args); - } - /** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function heNormal(args) { - return new HeNormal(args); - } - /** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ - function heUniform(args) { - return new HeUniform(args); - } - /** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function leCunNormal(args) { - return new LeCunNormal(args); - } - /** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function leCunUniform(args) { - return new LeCunUniform(args); - } - /** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function orthogonal(args) { - return new Orthogonal(args); - } - - var exports_initializers = /*#__PURE__*/Object.freeze({ - __proto__: null, - zeros: zeros$1, - ones: ones$2, - constant: constant, - randomUniform: randomUniform, - randomNormal: randomNormal$1, - truncatedNormal: truncatedNormal, - identity: identity, - varianceScaling: varianceScaling, - glorotUniform: glorotUniform, - glorotNormal: glorotNormal, - heNormal: heNormal, - heUniform: heUniform, - leCunNormal: leCunNormal, - leCunUniform: leCunUniform, - orthogonal: orthogonal - }); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Utilities related to persistent state in the backend. - */ - /** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ - let _nextUniqueTensorId = 0; - function getNextUniqueTensorId() { - return _nextUniqueTensorId++; - } - const _uidPrefixes = {}; - /** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ - function getUid(prefix = '') { - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * Determine whether the input is an Array of Shapes. - */ - function isArrayOfShapes(x) { - return Array.isArray(x) && Array.isArray(x[0]); - } - /** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ - function normalizeShapeList(x) { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x]; - } - return x; - } - /** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ - function getExactlyOneTensor(xs) { - let x; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`); - } - x = xs[0]; - } - else { - x = xs; - } - return x; - } - /** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ - function getExactlyOneShape(shapes) { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes; - return shapes[0]; - } - else { - throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`); - } - } - else { - return shapes; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ - function countParamsInWeights(weights) { - let count = 0; - for (const weight of weights) { - if (weight.shape.length === 0) { - count += 1; - } - else { - count += weight.shape.reduce((a, b) => a * b); - } - } - return count; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - const DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; - /** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ - class LayerVariable { - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - constructor(val, dtype = 'float32', name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true, constraint = null) { - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - this.trainable_ = trainable; - this.constraint = constraint; - this.val = tfc.variable(val, this.trainable_, this.name, this.dtype); - } - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - read() { - this.assertNotDisposed(); - return this.val; - } - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - write(newVal) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - } - /** - * Dispose this LayersVariable instance from memory. - */ - dispose() { - this.assertNotDisposed(); - this.val.dispose(); - } - assertNotDisposed() { - if (this.val.isDisposed) { - throw new Error(`LayersVariable ${this.name} is already disposed.`); - } - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.trainable_ = trainable; - this.val.trainable = trainable; - } - } - function checkShapesMatch(x, y) { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } - } - /** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ - function batchGetValue(xs) { - return xs.map(x => x.read()); - } - /** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ - function batchSetValue(variablesAndValues) { - variablesAndValues.forEach(variableAndValue => { - const variable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ - class InputSpec { - constructor(args) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } - else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } - } - /** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - class SymbolicTensor { - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - constructor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { - this.dtype = dtype; - this.shape = shape; - this.sourceLayer = sourceLayer; - this.inputs = inputs; - this.callArgs = callArgs; - this.outputTensorIndex = outputTensorIndex; - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } - } - let _nextNodeID = 0; - /** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ - class Node { - constructor(args, - // TODO(michaelterry): Define actual type for this. - callArgs) { - this.callArgs = callArgs; - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - // Following 2 properties: input and output shapes. - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - // Add nodes to all layers involved. - for (const layer of args.inboundLayers) { - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - getConfig() { - const inboundNames = []; - for (const layer of this.inboundLayers) { - if (layer != null) { - inboundNames.push(layer.name); - } - else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - } - } - let _nextLayerID = 0; - /** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ - class Layer extends tfc.serialization.Serializable { - constructor(args = {}) { - super(); - this._callHook = null; - this._addedWeightNames = []; - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - this._stateful = false; - this.id = _nextLayerID++; - this.activityRegularizer = null; - this.inputSpec = null; - this.supportsMasking = false; - // These properties will be set upon call of this.build() - this._trainableWeights = []; - this._nonTrainableWeights = []; - this._losses = []; - this._updates = []; - this._built = false; - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - this.inboundNodes = []; - this.outboundNodes = []; - let name = args.name; - if (!name) { - const prefix = this.getClassName(); - name = toSnakeCase(prefix) + '_' + getUid(prefix); - } - this.name = name; - this.trainable_ = args.trainable == null ? true : args.trainable; - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - let batchInputShape; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } - else if (args.inputShape != null) { - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - this.batchInputShape = batchInputShape; - // Set dtype. - let dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - this.dtype = dtype; - } - if (args.weights != null) { - this.initialWeights = args.weights; - } - else { - this.initialWeights = null; - } - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - this._refCount = null; - this.fastWeightInitDuringBuild = false; - } - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - static nodeKey(layer, nodeIndex) { - return layer.name + '_ib-' + nodeIndex.toString(); - } - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - getNodeAtIndex(nodeIndex, attrName) { - if (this.inboundNodes.length === 0) { - throw new RuntimeError('The layer has never been called ' + - `and thus has no defined ${attrName}.`); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError(`Asked to get ${attrName} at node ${nodeIndex}, ` + - `but the layer has only ${this.inboundNodes.length} inbound nodes.`); - } - return this.inboundNodes[nodeIndex]; - } - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - getInputAt(nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - getOutputAt(nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - } - // Properties - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get input() { - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } - else if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' is not connected, no input to return.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get output() { - if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); - } - get losses() { - return this._losses; - } - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(lossFn => lossFn()); - } - get updates() { - return this._updates; - } - get built() { - return this._built; - } - set built(built) { - this._built = built; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this._trainableWeights.forEach(w => w.trainable = trainable); - this.trainable_ = trainable; - } - get trainableWeights() { - if (this.trainable_) { - return this._trainableWeights.filter(w => w.trainable); - } - else { - return []; - } - } - set trainableWeights(weights) { - this._trainableWeights = weights; - } - get nonTrainableWeights() { - if (this.trainable) { - return this._trainableWeights.filter(w => !w.trainable) - .concat(this._nonTrainableWeights); - } - else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - } - set nonTrainableWeights(weights) { - this._nonTrainableWeights = weights; - } - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - get stateful() { - return this._stateful; - } - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - resetStates() { - if (!this.stateful) { - throw new Error('Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - } - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - assertInputCompatibility(inputs) { - inputs = toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - const inputSpec = toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError(`Layer ${this.name} expects ${inputSpec.length} inputs, ` + - `but it received ${inputs.length} input tensors. ` + - `Input received: ${inputs}`); - } - for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - const x = inputs[inputIndex]; - const spec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - // Check ndim. - const ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}: ` + - `expected ndim=${spec.ndim}, found ndim=${ndim}`); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`); - } - } - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name} ` + - `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`); - } - } - // Check specific shape axes. - if (spec.axes) { - const xShape = x.shape; - for (const key in spec.axes) { - const axis = Number(key); - const value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - const xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected axis ${axis} of input shape to ` + - `have value ${value} but got shape ${xShape}.`); - } - } - } - // Check shape. - if (spec.shape != null) { - for (let i = 0; i < spec.shape.length; ++i) { - const specDim = spec.shape[i]; - const dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected shape=${spec.shape}, ` + - `found shape=${x.shape}.`); - } - } - } - } - } - } - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - call(inputs, kwargs) { - return inputs; - } - invokeCallHook(inputs, kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - } - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - setCallHook(callHook) { - this._callHook = callHook; - } - /** - * Clear call hook. - * This is currently used for testing only. - */ - clearCallHook() { - this._callHook = null; - } - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - apply(inputs, kwargs) { - kwargs = kwargs || {}; - this.assertNotDisposed(); - // Ensure inputs are all the same type. - const inputsList = toList(inputs); - let allAreSymbolic = true; - for (const input of inputsList) { - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - let noneAreSymbolic = true; - for (const input of inputsList) { - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError('Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, () => { - // Handle laying building (weight creating, input spec locking). - if (!this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - this.assertInputCompatibility(inputs); - // Collect input shapes to build layer. - const inputShapes = []; - for (const xElem of toList(inputs)) { - inputShapes.push(xElem.shape); - } - this.build(singletonOrArray(inputShapes)); - this.built = true; - // Load weights that were specified at layer instantiation. - if (this.initialWeights) { - this.setWeights(this.initialWeights); - } - if (this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - this._refCount = 1; - } - } - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - this.assertInputCompatibility(inputs); - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - let output = this.call(inputs, kwargs); - // TODO(michaelterry): Compute the outputMask - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - const outputList = toList(output); - const outputListCopy = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (let x of outputList) { - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = singletonOrArray(outputListCopy); - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Call addInboundNode()? - return output; - } - else { - const inputShape = collectInputShape(inputs); - const outputShape = this.computeOutputShape(inputShape); - let output; - const outputDType = guessOutputDType(inputs); - this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : - inputShape); - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = outputShape - .map((shape, index) => new SymbolicTensor(outputDType, shape, this, toList(inputs), kwargs, this.name, index)); - } - else { - output = new SymbolicTensor(outputDType, outputShape, this, toList(inputs), kwargs, this.name); - } - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); - this._refCount++; - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - return output; - } - }); - } - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - warnOnIncompatibleInputShape(inputShape) { - if (this.batchInputShape == null) { - return; - } - else if (inputShape.length !== this.batchInputShape.length) { - console.warn(`The rank of the input tensor provided (shape: ` + - `${JSON.stringify(inputShape)}) does not match that of the ` + - `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` + - `of the layer ${this.name}`); - } - else { - let dimMismatch = false; - this.batchInputShape.forEach((dimension, i) => { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch = true; - } - }); - if (dimMismatch) { - console.warn(`The shape of the input tensor ` + - `(${JSON.stringify(inputShape)}) does not ` + - `match the expectation of layer ${this.name}: ` + - `${JSON.stringify(this.batchInputShape)}`); - } - } - } - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get outputShape() { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError(`The layer ${this.name} has never been called and thus has no ` + - `defined output shape.`); - } - const allOutputShapes = []; - for (const node of this.inboundNodes) { - const shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - const outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return outputShapes[0]; - } - else { - return outputShapes; - } - } - else { - throw new AttributeError(`The layer ${this.name} has multiple inbound nodes with different ` + - `output shapes. Hence the notion of "output shape" is ill-defined ` + - `for the layer.`); - // TODO(cais): Implement getOutputShapeAt(). - } - } - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - countParams() { - if (!this.built) { - throw new RuntimeError(`You tried to call countParams() on ${this.name}, ` + - `but the layer is not built yet. Build it first by calling ` + - `build(batchInputShape).`); - } - return countParamsInWeights(this.weights); - } - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - build(inputShape) { - this.built = true; - } - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getWeights(trainableOnly = false) { - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - } - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - setWeights(weights) { - tfc.tidy(() => { - const params = this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError(`You called setWeights(weights) on layer "${this.name}" ` + - `with a weight list of length ${weights.length}, ` + - `but the layer was expecting ${params.length} weights. ` + - `Provided weights: ${weights}...`); - } - if (params.length === 0) { - return; - } - const weightValueTuples = []; - const paramValues = batchGetValue(params); - for (let i = 0; i < paramValues.length; ++i) { - const pv = paramValues[i]; - const p = params[i]; - const w = weights[i]; - if (!tfc.util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError(`Layer weight shape ${pv.shape} ` + - `not compatible with provided weight shape ${w.shape}`); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - } - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addWeight(name, shape, dtype, initializer, regularizer, trainable, constraint) { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError(`Duplicate weight name ${name} for layer ${this.name}`); - } - this._addedWeightNames.push(name); - if (dtype == null) { - dtype = 'float32'; - } - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - const initValue = initializer.apply(shape, dtype); - const weight = new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(() => regularizer.apply(weight.read())); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } - else { - this._nonTrainableWeights.push(weight); - } - return weight; - } - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - setFastWeightInitDuringBuild(value) { - this.fastWeightInitDuringBuild = value; - } - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addLoss(losses) { - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = toList(losses); - if (this._losses !== undefined && this._losses !== null) { - this.losses.push(...losses); - } - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - computeOutputShape(inputShape) { - return inputShape; - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(maskElement => { - if (maskElement != null) { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - }); - } - else { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - } - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - addInboundNode(inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs = null) { - const inputTensorList = toList(inputTensors); - outputTensors = toList(outputTensors); - inputMasks = toList(inputMasks); - outputMasks = toList(outputMasks); - inputShapes = normalizeShapeList(inputShapes); - outputShapes = normalizeShapeList(outputShapes); - // Collect input tensor(s) coordinates. - const inboundLayers = []; - const nodeIndices = []; - const tensorIndices = []; - for (const x of inputTensorList) { - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers, - nodeIndices, - tensorIndices, - inputTensors: inputTensorList, - outputTensors, - inputMasks, - outputMasks, - inputShapes, - outputShapes - }, kwargs); - // Update tensor history - for (let i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - } - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getConfig() { - const config = { name: this.name, trainable: this.trainable }; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - } - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - disposeWeights() { - this.weights.forEach(weight => weight.dispose()); - return this.weights.length; - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Layer '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - dispose() { - if (!this.built) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been ` + - `built yet.`); - } - if (this._refCount === null) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been used ` + - `yet.`); - } - this.assertNotDisposed(); - let numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - return { refCountAfterDispose: this._refCount, numDisposedVariables }; - } - } - /** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ - function collectInputShape(inputTensors) { - inputTensors = - toList(inputTensors); - const shapes = []; - for (const x of inputTensors) { - shapes.push(x.shape); - } - return singletonOrArray(shapes); - } - /** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ - function guessOutputDType(inputTensors) { - return 'float32'; - } - /** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ - function getSourceInputs(tensor, layer, nodeIndex) { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } - else { - const node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } - else { - const sourceTensors = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const previousSources = getSourceInputs(x, layer, nodeIndex); - // Avoid input redundancy. - for (const x of previousSources) { - if (sourceTensors.indexOf(x) === -1) { - sourceTensors.push(x); - } - } - } - return sourceTensors; - } - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class InputLayer extends Layer { - constructor(args) { - super({ - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }); - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - this.trainable = false; - this.built = true; - this.sparse = args.sparse; - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError('Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - let batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError('An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } - else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } - else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError('Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - const dtype = args.dtype || 'float32'; - this.batchInputShape = batchInputShape; - this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - this.inputSpec = [{ shape: batchInputShape }]; - const inputTensor = new SymbolicTensor(this.dtype, this.batchInputShape, this, [], {}, this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - } - apply(inputs, kwargs) { - throw new ValueError('Cannot pass any input to an ' + - `InputLayer's apply() method. InputLayer name: ${this.name}`); - } - dispose() { - // dispose() for InputLayer is overridden as no-op. - return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; - } - getConfig() { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - } - } - /** @nocollapse */ - InputLayer.className = 'InputLayer'; - tfc.serialization.registerClass(InputLayer); - function Input(config) { - if (config.batchShape == null && config.shape == null) { - throw new Error('Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError('Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - let batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - let dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - const inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype, - sparse: config.sparse - }); - const outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ - async function resolveScalarsInLogs(logs) { - if (logs == null) { - return; - } - const promises = []; - const keys = []; - const scalarsToDispose = []; - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - const valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (promises.length > 0) { - const values = await Promise.all(promises); - for (let i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - tfc.dispose(scalarsToDispose); - } - } - /** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ - function disposeTensorsInLogs(logs) { - if (logs == null) { - return; - } - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** Verbosity logging level when fitting a model. */ - var ModelLoggingVerbosity; - (function (ModelLoggingVerbosity) { - ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; - })(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); - /** How often to yield to the main thread when training (in ms). */ - const DEFAULT_YIELD_EVERY_MS = 125; - /** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ - class BaseCallback { - constructor() { - // TODO(michaelterry): This type is a best guess. - this.validationData = null; - } - setParams(params) { - this.params = params; - } - async onEpochBegin(epoch, logs) { } - async onEpochEnd(epoch, logs) { } - async onBatchBegin(batch, logs) { } - async onBatchEnd(batch, logs) { } - async onTrainBegin(logs) { } - async onTrainEnd(logs) { } - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - setModel(model) { - // Do nothing. Use Callback instead of BaseCallback to track the model. - } - } - /** - * Container abstracting a list of callbacks. - */ - class CallbackList { - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - constructor(callbacks, queueLength = 10) { - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - append(callback) { - this.callbacks.push(callback); - } - setParams(params) { - for (const callback of this.callbacks) { - callback.setParams(params); - } - } - setModel(model) { - for (const callback of this.callbacks) { - callback.setModel(model); - } - } - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochBegin(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochBegin(epoch, logs); - } - } - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochEnd(epoch, logs); - } - } - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchBegin(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchBegin(batch, logs); - } - } - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchEnd(batch, logs); - } - } - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - async onTrainBegin(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainBegin(logs); - } - } - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - async onTrainEnd(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainEnd(logs); - } - } - } - /** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ - class BaseLogger extends BaseCallback { - constructor() { - super(); - } - async onEpochBegin(epoch) { - this.seen = 0; - this.totals = {}; - } - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - const batchSize = logs['size'] == null ? 0 : logs['size']; - this.seen += batchSize; - for (const key in logs) { - const value = logs[key]; - if (typeof value === 'number') { - if (!this.totals.hasOwnProperty(key)) { - this.totals[key] = 0; - } - this.totals[key] = this.totals[key] + value * batchSize; - } - else { - let oldTotalsToDispose; - if (key in this.totals) { - oldTotalsToDispose = this.totals[key]; - } - else { - this.totals[key] = 0; - } - const total = tfc.tidy(() => tfc.add((this.totals[key]), tfc.mul(value, batchSize))); - this.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - } - } - async onEpochEnd(epoch, logs) { - if (logs != null) { - for (const key of this.params['metrics']) { - if (this.totals[key] == null) { - continue; - } - if (typeof this.totals[key] === 'number') { - logs[key] = this.totals[key] / this.seen; - } - else { - tfc.tidy(() => { - const log = tfc.mul(tfc.div(1, this.seen), this.totals[key]); - logs[key] = log; - this.totals[key].dispose(); - tfc.keep(logs[key]); - }); - } - } - } - } - } - /** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ - class History extends BaseCallback { - async onTrainBegin(logs) { - this.epoch = []; - this.history = {}; - } - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (const key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - } - /** - * Await the values of all losses and metrics. - */ - async syncData() { - const promises = []; - const keys = []; - const indices = []; - for (const key in this.history) { - const valueArray = this.history[key]; - for (let i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - const valueScalar = valueArray[i]; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - const values = await Promise.all(promises); - for (let n = 0; n < values.length; ++n) { - const tensorToDispose = this.history[keys[n]][indices[n]]; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - } - } - /** - * Custom callback for training. - */ - class CustomCallback extends BaseCallback { - constructor(args, yieldEvery) { - super(); - this.currentEpoch = 0; - this.yieldEvery = yieldEvery || 'auto'; - if (this.yieldEvery === 'auto') { - this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (this.yieldEvery === 'never' && args.onYield != null) { - throw new Error('yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (tfc.util.isNumber(this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - this.maybeWait = debounce(this.maybeWait.bind(this), this.yieldEvery); - } - this.trainBegin = args.onTrainBegin; - this.trainEnd = args.onTrainEnd; - this.epochBegin = args.onEpochBegin; - this.epochEnd = args.onEpochEnd; - this.batchBegin = args.onBatchBegin; - this.batchEnd = args.onBatchEnd; - this.yield = args.onYield; - } - async maybeWait(epoch, batch, logs) { - const ps = []; - if (this.yield != null) { - await resolveScalarsInLogs(logs); - ps.push(this.yield(epoch, batch, logs)); - } - ps.push(tfc.nextFrame()); - await Promise.all(ps); - } - async onEpochBegin(epoch, logs) { - this.currentEpoch = epoch; - if (this.epochBegin != null) { - await resolveScalarsInLogs(logs); - await this.epochBegin(epoch, logs); - } - } - async onEpochEnd(epoch, logs) { - const ps = []; - if (this.epochEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.epochEnd(epoch, logs)); - } - if (this.yieldEvery === 'epoch') { - ps.push(tfc.nextFrame()); - } - await Promise.all(ps); - } - async onBatchBegin(batch, logs) { - if (this.batchBegin != null) { - await resolveScalarsInLogs(logs); - await this.batchBegin(batch, logs); - } - } - async onBatchEnd(batch, logs) { - const ps = []; - if (this.batchEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.batchEnd(batch, logs)); - } - if (this.yieldEvery === 'batch') { - ps.push(tfc.nextFrame()); - } - else if (tfc.util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - await Promise.all(ps); - } - async onTrainBegin(logs) { - if (this.trainBegin != null) { - await resolveScalarsInLogs(logs); - await this.trainBegin(logs); - } - } - async onTrainEnd(logs) { - if (this.trainEnd != null) { - await resolveScalarsInLogs(logs); - await this.trainEnd(logs); - } - } - } - /** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ - function standardizeCallbacks(callbacks, yieldEvery) { - if (callbacks == null) { - callbacks = {}; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks; - } - // Convert custom callback configs to custom callback objects. - const callbackConfigs = toList(callbacks); - return callbackConfigs.map(callbackConfig => new CustomCallback(callbackConfig, yieldEvery)); - } - /** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ - class CallbackConstructorRegistry { - /** - * Blocks public access to constructor. - */ - constructor() { } - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - static registerCallbackConstructor(verbosityLevel, callbackConstructor) { - tfc.util.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), () => `Verbosity level is expected to be an integer >= 0, ` + - `but got ${verbosityLevel}`); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push(callbackConstructor); - } - static checkForDuplicate(callbackConstructor) { - for (const levelName in CallbackConstructorRegistry.constructors) { - const constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(ctor => { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - } - /** - * Clear all registered callback constructors. - */ - static clear() { - CallbackConstructorRegistry.constructors = {}; - } - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - static createCallbacks(verbosityLevel) { - const constructors = []; - for (const levelName in CallbackConstructorRegistry.constructors) { - const level = +levelName; - if (verbosityLevel >= level) { - constructors.push(...CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(ctor => new ctor()); - } - } - CallbackConstructorRegistry.constructors = {}; - function configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { - const history = new History(); - const actualCallbacks = [ - new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose) - ]; - if (callbacks != null) { - actualCallbacks.push(...callbacks); - } - actualCallbacks.push(history); - const callbackList = new CallbackList(actualCallbacks); - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - callbackList.setParams({ - epochs, - initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize, - verbose, - doValidation, - metrics: callbackMetrics, - }); - return { callbackList, history }; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ - function deserialize(config, customObjects = {}, fastWeightInit = false) { - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer', fastWeightInit); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ - function l2Normalize(x, axis) { - return tfc.tidy(() => { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - const squareSum = tfc.sum(square$1(x), axis, true); - const epsilonTensor = tfc.fill(squareSum.shape, epsilon()); - const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); - return tfc.div(x, norm); - }); - } - function meanSquaredError(yTrue, yPred) { - return tfc.tidy(() => tfc.mean(square$1(tfc.sub(yPred, yTrue)), -1)); - } - function meanAbsoluteError(yTrue, yPred) { - return tfc.tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1)); - } - function meanAbsolutePercentageError(yTrue, yPred) { - return tfc.tidy(() => { - const diff = tfc.sub(yTrue, yPred); - const clippedTrue = tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); - const absResult = tfc.abs(tfc.div(diff, clippedTrue)); - return tfc.mul(100, tfc.mean(absResult, -1)); - }); - } - function meanSquaredLogarithmicError(yTrue, yPred) { - return tfc.tidy(() => { - const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); - const firstLog = tfc.log(tfc.add(1, clippedPred)); - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); - const secondLog = tfc.log(tfc.add(1, clippedTrue)); - return tfc.mean(square$1(tfc.sub(firstLog, secondLog)), -1); - }); - } - function squaredHinge(yTrue, yPred) { - return tfc.tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(square$1(maxResult), -1); - }); - } - function hinge(yTrue, yPred) { - return tfc.tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(maxResult, -1); - }); - } - function categoricalHinge(yTrue, yPred) { - return tfc.tidy(() => { - const pos = tfc.sum(tfc.mul(yTrue, yPred), -1); - const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1); - return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos))); - }); - } - /** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ - function logcosh(yTrue, yPred) { - return tfc.tidy(() => { - const log2 = Math.log(2); - const predictionDiff = tfc.sub(yPred, yTrue); - const logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))), log2); - return tfc.mean(logcoshResult, -1); - }); - } - function categoricalCrossentropy(target, output, fromLogits = false) { - return tfc.tidy(() => { - if (fromLogits) { - output = tfc.softmax(output); - } - else { - // scale preds so that the class probabilities of each sample sum to 1. - const outputSum = tfc.sum(output, output.shape.length - 1, true); - output = tfc.div(output, outputSum); - } - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); - }); - } - /** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ - function sparseCategoricalCrossentropy(target, output, fromLogits = false) { - return tfc.tidy(() => { - const flatTarget = tfc.floor(flatten$1(target)).toInt(); - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - const outputShape = output.shape; - const oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); - } - /** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ - function sigmoidCrossEntropyWithLogits(labels, logits) { - if (!tfc.util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError(`logits and labels must have the same shape, but got shapes ` + - `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`); - } - return tfc.tidy(() => { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - const reluLogits = logits.relu(); - const negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); - } - function binaryCrossentropy(yTrue, yPred) { - return tfc.tidy(() => { - let y; - y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); - y = tfc.log(tfc.div(y, tfc.sub(1, y))); - return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); - } - function kullbackLeiblerDivergence(yTrue, yPred) { - return tfc.tidy(() => { - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); - const clippedPred = tfc.clipByValue(yPred, epsilon(), 1); - return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); - }); - } - function poisson(yTrue, yPred) { - return tfc.tidy(() => { - const logPred = tfc.log(tfc.add(epsilon(), yPred)); - return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); - }); - } - function cosineProximity(yTrue, yPred) { - return tfc.tidy(() => { - const trueNormalized = l2Normalize(yTrue, -1); - const predNormalized = l2Normalize(yPred, -1); - const trueXPred = tfc.mul(trueNormalized, predNormalized); - return tfc.neg(tfc.sum(trueXPred, -1)); - }); - } - // TODO(michaelterry): Add deserialize() function. - const lossesMap = { - meanSquaredError, - meanAbsoluteError, - meanAbsolutePercentageError, - meanSquaredLogarithmicError, - squaredHinge, - hinge, - categoricalHinge, - logcosh, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - binaryCrossentropy, - kullbackLeiblerDivergence, - poisson, - cosineProximity - }; - // Porting note: This diverges from the PyKeras implementation and may need to - // change based on (de)serialization requirements. - function get(identifierOrFn) { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - let errMsg = `Unknown loss ${identifierOrFn}`; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = `Unknown loss ${identifierOrFn}. ` + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } - else { - return identifierOrFn; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function binaryAccuracy(yTrue, yPred) { - return tfc.tidy(() => { - const threshold = tfc.mul(.5, tfc.onesLike(yPred)); - const yPredThresholded = cast$1(tfc.greater(yPred, threshold), yTrue.dtype); - return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); - }); - } - function categoricalAccuracy(yTrue, yPred) { - return tfc.tidy(() => cast$1(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32')); - } - function truePositives(yTrue, yPred) { - return tfc.tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); - } - function falseNegatives(yTrue, yPred) { - return tfc.tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); - } - function falsePositives(yTrue, yPred) { - return tfc.tidy(() => { - return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); - } - function precision(yTrue, yPred) { - return tfc.tidy(() => { - const tp = truePositives(yTrue, yPred); - const fp = falsePositives(yTrue, yPred); - const denominator = tp.add(fp); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); - } - function recall(yTrue, yPred) { - return tfc.tidy(() => { - const tp = truePositives(yTrue, yPred); - const fn = falseNegatives(yTrue, yPred); - const denominator = tp.add(fn); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); - } - function binaryCrossentropy$1(yTrue, yPred) { - return binaryCrossentropy(yTrue, yPred); - } - function sparseCategoricalAccuracy(yTrue, yPred) { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return tfc.equal(yTrue, yPred).asType('float32'); - } - // Aliases. - const mse = meanSquaredError; - const MSE = meanSquaredError; - const mae = meanAbsoluteError; - const MAE = meanAbsoluteError; - const mape = meanAbsolutePercentageError; - const MAPE = meanAbsolutePercentageError; - const categoricalCrossentropy$1 = categoricalCrossentropy; - const cosine = cosineProximity; - const sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy; - // TODO(cais, nielsene): Add serialize(). - const metricsMap = { - binaryAccuracy, - categoricalAccuracy, - precision, - categoricalCrossentropy: categoricalCrossentropy$1, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, - mse, - MSE, - mae, - MAE, - mape, - MAPE, - cosine - }; - function get$1(identifier) { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } - else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } - else { - throw new ValueError(`Unknown metric ${identifier}`); - } - } - /** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ - function getLossOrMetricName(fn) { - assert$1(fn !== null, `Unknown LossOrMetricFn ${fn}`); - if (typeof fn === 'string') { - return fn; - } - else { - let fnName; - for (const key of Object.keys(lossesMap)) { - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (const key of Object.keys(metricsMap)) { - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return fn.name; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // Add (de)serialize() - // Porting note: This diverges from the PyKeras implementation and may need to - // change based on (de)serialization requirements. - function getOptimizer(identifier) { - const optimizerMap = { - 'Adagrad': () => tfc.train.adagrad(0.01), - 'Adadelta': () => tfc.train.adadelta(1, 0.95, epsilon()), - 'Adam': () => tfc.train.adam(0.001, 0.9, 0.999, epsilon()), - 'Adamax': () => tfc.train.adamax(0.002, 0.9, 0.999, epsilon(), 0), - 'RMSProp': () => tfc.train.rmsprop(0.001, 0.9, 0, epsilon()), - 'SGD': () => tfc.train.sgd(0.01) - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError(`Unknown Optimizer ${identifier}`); - } - - /** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** Utility functions related to user-defined metadata. */ - // Maximum recommended serialized size for user-defined metadata. - // Beyond this limit, a warning message will be printed during model loading and - // saving. - const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; - /** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ - function checkUserDefinedMetadata(userDefinedMetadata, modelName, checkSize = false) { - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error('User-defined metadata is expected to be a JSON object, but is not.'); - } - if (checkSize) { - const out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn(`User-defined metadata of model "${modelName}" is too large in ` + - `size (length=${out.length} when serialized). It is not ` + - `recommended to store such large objects in user-defined metadata. ` + - `Please make sure its serialized length is <= ` + - `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`); - } - } - } - /** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ - // tslint:disable-next-line:no-any - function plainObjectCheck(x) { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } - else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - const keys = Object.keys(x); - for (const key of keys) { - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (const item of x) { - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } - else { - // `x` is not a JavaScript object or `null`. - const xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ - function printSummary(model, lineLength, positions, - // tslint:disable-next-line:no-any - printFn = console.log) { - const sequentialLike = isModelSequentialLike(model); - // Header names for different log elements. - const toDisplay = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } - else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(p => Math.floor(lineLength * p)); - } - let relevantNodes; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (const depth in model.nodesByDepth) { - relevantNodes.push(...model.nodesByDepth[depth]); - } - } - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - const layers = model.layers; - for (let i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } - else { - printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - // tslint:disable-next-line:no-any - model.checkTrainableWeightsConsistency(); - const trainableCount = countTrainableParams(model); - const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - printFn(`Total params: ${trainableCount + nonTrainableCount}`); - printFn(`Trainable params: ${trainableCount}`); - printFn(`Non-trainable params: ${nonTrainableCount}`); - printFn('_'.repeat(lineLength)); - } - function countTrainableParams(model) { - let trainableCount; - // tslint:disable:no-any - if (model.collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights(model.collectedTrainableWeights); - } - else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; - } - function isModelSequentialLike(model) { - let sequentialLike = true; - const nodesByDepth = []; - const nodes = []; - for (const depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (const depthNodes of nodesByDepth) { - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push(...depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (const layer of model.layers) { - let flag = false; - for (const node of layer.inboundNodes) { - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } - else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; - } - function printRow(fields, positions, - // tslint:disable-next-line:no-any - printFn = console.log) { - let line = ''; - for (let i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); - } - /** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ - function printLayerSummary(layer, positions, - // tslint:disable-next-line:no-any - printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const name = layer.name; - const className = layer.getClassName(); - const fields = [`${name} (${className})`, outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); - } - /** - * Prints a summary for a single Layer, with connectivity information. - */ - function printLayerSummaryWithConnections(layer, positions, relevantNodes, - // tslint:disable-next-line:no-any - printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const connections = []; - for (const node of layer.inboundNodes) { - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (let i = 0; i < node.inboundLayers.length; ++i) { - const inboundLayer = node.inboundLayers[i].name; - const inboundLayerIndex = node.nodeIndices[i]; - const inboundTensorIndex = node.tensorIndices[i]; - connections.push(`${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`); - } - } - const name = layer.name; - const className = layer.getClassName(); - const firstConnection = connections.length === 0 ? '' : connections[0]; - const fields = [ - `${name} (${className})`, outputShape, layer.countParams().toString(), - firstConnection - ]; - printRow(fields, positions, printFn); - for (let i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ - function isArrayItemInputOrOutputName(key, index, value) { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; - } - /** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ - function convertPythonicToTs(pythonicConfig, key) { - if (pythonicConfig === null) { - return null; - } - else if (typeof pythonicConfig === 'string') { - return toCamelCase(pythonicConfig); - } - else if ((typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } - else if (pythonicConfig instanceof Array) { - const tsArray = []; - const arrayLength = pythonicConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } - else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } - else { - const tsDict = {}; - for (const pythonicKey of Object.keys(pythonicConfig)) { - const pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } - else { - const tsKey = toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } - } - /** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ - function convertTsToPythonic(tsConfig, key) { - if (tsConfig === null || tsConfig === undefined) { - return null; - } - else if (typeof tsConfig === 'string') { - return toSnakeCase(tsConfig); - } - else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } - else if (tsConfig instanceof Array) { - const pyArray = []; - const arrayLength = tsConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } - else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } - else { - const pyDict = {}; - for (const tsKey of Object.keys(tsConfig)) { - const tsValue = tsConfig[tsKey]; - const pyKey = toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } - else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } - } - - /** @license See the LICENSE file. */ - // This code is auto-generated, do not modify this file! - const version = '3.6.0'; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function to check the dtype and shape compatibility of a feed value. - */ - function assertFeedCompatibility(key, val) { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return tfc.cast(val, key.dtype); - } - catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError(`The dtype of the feed (${val.dtype}) can not be cast to the dtype ` + - `of the key '${key.name}' (${key.dtype}).`); - } - } - /** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ - class FeedDict { - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - constructor(feeds) { - this.id2Value = {}; - this.id2Mask = {}; - this.name2Id = {}; - if (feeds instanceof FeedDict) { - for (const id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } - else { - if (feeds == null) { - return; - } - for (const feed of feeds) { - this.add(feed.key, feed.value); - } - } - } - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - add(key, value, mask) { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } - else { - throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`); - } - return this; - } - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - addFeed(feed) { - this.add(feed.key, feed.value); - } - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - hasKey(key) { - return this.id2Value[key.id] != null; - } - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - names() { - return Object.keys(this.name2Id); - } - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getValue(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Value[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Value[id]; - } - } - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getMask(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Mask[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Mask[id]; - } - } - /** Dispose all mask Tensors held by this object. */ - disposeMasks() { - if (this.id2Mask != null) { - tfc.dispose(this.id2Mask); - } - } - } - // Cache for topologically sorted SymbolicTensors for given execution - // targets (i.e., fetches). - const cachedSorted = {}; - // Cache for recipient count maps for given execution targets (i.e., fetches). - const cachedRecipientCounts = {}; - /** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ - function execute(fetches, feedDict, kwargs, probe) { - const training = kwargs == null ? false : kwargs['training']; - const arrayFetches = Array.isArray(fetches); - const fetchArray = arrayFetches ? fetches : [fetches]; - const outputNames = fetchArray.map(t => t.name); - const finalOutputs = []; - const feedNames = feedDict.names(); - for (const outputName of outputNames) { - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } - else { - finalOutputs.push(null); - } - } - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - // Check cache. - const fetchAndFeedKey = outputNames.join(',') + '|' + feedDict.names().join(','); - let sorted; - let recipientCounts; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - const internalFeedDict = new FeedDict(feedDict); - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (let i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - const numTensors = tfc.memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - const symbolic = sorted[i]; - const srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - const inputValues = []; - const inputMasks = []; - const tensorsToDispose = []; - let maskExists = false; - for (const input of symbolic.inputs) { - const value = internalFeedDict.getValue(input); - const mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - const outputTensors = toList(srcLayer.apply(inputValues, kwargs)); - let outputMask = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - const layerOutputs = getNodeOutputs(symbolic); - const outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (let i = 0; i < outputSymbolicTensors.length; ++i) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) { - internalFeedDict.add(outputSymbolicTensors[i], outputTensors[i], Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - const index = outputNames.indexOf(outputSymbolicTensors[i].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i]; - } - } - if (!training) { - // Clean up Tensors that are no longer needed. - tfc.dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - return arrayFetches ? finalOutputs : finalOutputs[0]; - } - /** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ - function getTopologicalSortAndRecipientCounts(fetches, feedDict) { - tfc.util.assert(fetches != null && fetches.length > 0, () => `Expected at least one fetch, got none`); - let finalSorted = []; - let finalRecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - const out = getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } - else { - const visited = new Set(); - for (const fetch of fetches) { - const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict); - // Merge sorted SymbolicTensor Arrays. - for (const symbolicTensor of sorted) { - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - // Merge recipient maps. - for (const name in recipientMap) { - if (finalRecipientMap[name] == null) { - finalRecipientMap[name] = new Set(); - } - recipientMap[name].forEach(recipient => finalRecipientMap[name].add(recipient)); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; - } - function recipientMap2Counts(recipientMap) { - const recipientCounts = {}; - for (const name in recipientMap) { - recipientCounts[name] = recipientMap[name].size; - } - return recipientCounts; - } - /** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ - function getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict) { - const visited = new Set(); - const sorted = []; - const recipientMap = {}; - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (const key of feedDict.names()) { - visited.add(key); - } - const stack = []; - const marks = []; - // Initial population of stack and marks. - stack.push(fetch); - while (stack.length > 0) { - const top = stack[stack.length - 1]; - if (visited.has(top.name)) { - stack.pop(); - continue; - } - const topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top); - visited.add(top.name); - if (topIsMarked) { - marks.pop(); - } - } - else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (const input of top.inputs) { - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top.name); - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return { sorted, recipientMap }; - } - /** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ - function getNodeOutputs(fetch) { - let layerOutputs; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } - else { - let nodeIndex = null; - for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (const outputTensor of fetch.sourceLayer.inboundNodes[i] - .outputTensors) { - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ - class Container extends Layer { - constructor(args) { - // No args passed to super's constructor. - super({}); - this.containerNodes = new Set(); - this.name = args.name; - if (this.name == null) { - const prefix = this.getClassName().toLowerCase(); - this.name = getUid(prefix); - } - this.supportsMasking = false; - this.trainable_ = true; - // TODO(michaelterry): Initialize perInputLosses/Updates here. - // Container-specific properties. - if (Array.isArray(args.inputs)) { - this.inputs = args.inputs.slice(); - } - else { - this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - this.outputs = args.outputs.slice(); - } - else { - this.outputs = [args.outputs]; - } - // Check for redundancy in inputs. - if (unique$1(this.inputs).length !== this.inputs.length) { - throw new ValueError('The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - `${this.inputs.map(x => x.name)}`); - } - // Check for redundancy in outputs. - if (unique$1(this.outputs).length !== this.outputs.length) { - console.warn('The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - `${this.outputs.map(x => x.name)}`); - } - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - this.inputLayers = []; - this.inputLayersNodeIndices = []; - this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - this.outputLayers = []; - this.outputLayersNodeIndices = []; - this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - this.layers = []; - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - this.internalContainerRefs = []; - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - // Build this.outputLayers: - for (const x of this.outputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - this.outputLayers.push(layer); - this.outputLayersNodeIndices.push(nodeIndex); - this.outputLayersTensorIndices.push(tensorIndex); - } - // TODO(michaelterry): Add output mask cache code. - // Build this.inputLayers: - for (const x of this.inputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - assert$1(nodeIndex === 0, 'input layer has >1 nodes'); - assert$1(tensorIndex === 0, 'input layer has >1 tensors'); - this.inputLayers.push(layer); - this.inputLayersNodeIndices.push(nodeIndex); - this.inputLayersTensorIndices.push(tensorIndex); - } - // Build this.inputNames and this.outputNames. - this.inputNames = []; - this.outputNames = []; - this.feedInputShapes = []; - this.feedInputNames = []; - this.feedOutputNames = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError('Input layers to a LayersModel must be InputLayer objects. ' + - `Received inputs: ${args.inputs}. ` + - `Input ${i} (0-based) originates ` + - `from layer type ${layer.getClassName()}.`); - } - this.inputNames.push(layer.name); - this.feedInputShapes.push(layer.batchInputShape); - this.feedInputNames.push(layer.name); - } - for (const layer of this.outputLayers) { - this.outputNames.push(layer.name); - } - this.internalInputShapes = this.inputs.map(x => x.shape); - this.internalOutputShapes = this.outputs.map(x => x.shape); - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - const nodesDepths = {}; - // To recover nodes from their ID. - const nodeIDToNode = {}; - const layersDepths = {}; - // To layers from their ID. - const layerIDToLayer = {}; - const layerIndices = {}; - const nodesInDecreasingDepth = []; - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - const buildMapOfGraph = (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) => { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - const node = layer.inboundNodes[nodeIndex]; - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError(`The tensor ${tensor.name} at layer "${layer.name}" ` + - 'is part of a cycle.'); - } - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - // Update containerNodes. - this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - // Propagate to all previous tensors connected to this node. - const numInboundLayers = node.inboundLayers.length; - for (let i = 0; i < numInboundLayers; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - buildMapOfGraph(x, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - const finishedNodes = []; - const nodesInProgress = []; - for (const x of this.outputs) { - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - const reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); - for (const node of reversedNodesInDecreasingDepth) { - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - let depth = nodesDepths[node.id]; - // Update the depth of the corresponding layer - const previousDepth = (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - // Update the depth of inbound nodes. - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const inboundNode = inboundLayer.inboundNodes[nodeIndex]; - const previousDepth = (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - // Build a dict {depth: list of nodes with this depth} - const nodesByDepth = {}; - for (const nodeID in nodesDepths) { - const depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - // Build a dict {depth: list of layers with this depth} - const layersByDepth = {}; - for (const layerID in layersDepths) { - const depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - // Get sorted list of layer depths. - let depthKeys = Object.keys(layersByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Set this.layers and this.layersByDepth. - this.layers = []; - for (const depth of depthKeys) { - const layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort((a, b) => { - const aIndex = layerIndices[a.id]; - const bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (const layer of layersForDepth) { - if (layer instanceof Container) { - this.internalContainerRefs.push(layer); - } - this.layers.push(layer); - } - } - this.layersByDepth = layersByDepth; - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - const computableTensors = this.inputs.slice(); - // To provide a better error msg. - const layersWithCompleteInput = []; - for (const depth of depthKeys) { - for (const node of nodesByDepth[depth]) { - const layer = node.outboundLayer; - if (layer != null) { - for (const x of node.inputTensors) { - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError(`Graph disconnected: cannot obtain value for tensor ${x}` + - ` at layer "${layer.name}". ` + - 'The following previous layers were accessed without ' + - `issue: ${layersWithCompleteInput}`); - } - } - for (const x of node.outputTensors) { - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - // Set this.containerNodes and this.nodesByDepth. - this.nodesByDepth = nodesByDepth; - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - const allNames = this.layers.map(x => x.name); - for (const name of allNames) { - const numOccurrences = allNames.filter(x => x === name).length; - if (numOccurrences !== 1) { - throw new RuntimeError(`The name "${name}" is used ${numOccurrences} times ` + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - } - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - this.inboundNodes = []; - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - inputMasks: this.inputs.map(x => null), - outputMasks: this.outputs.map(x => null), - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs.map(x => x.shape) - }); - this.built = true; - this._refCount = 1; // The ref count of a container always start at 1. - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Container '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - dispose() { - this.assertNotDisposed(); - const result = { refCountAfterDispose: null, numDisposedVariables: 0 }; - if (--this._refCount === 0) { - for (const layer of this.layers) { - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (const container of this.internalContainerRefs) { - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.layers.forEach(layer => { - // tslint:disable-next-line:no-any - layer._trainableWeights - .forEach(w => w.trainable = trainable); - }); - this.trainable_ = trainable; - } - get trainableWeights() { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - if (!this.trainable) { - return []; - } - let weights = []; - for (const layer of this.layers) { - weights = weights.concat(layer.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const layer of this.layers) { - weights.push(...layer.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const layer of this.layers) { - trainableWeights.push(...layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - loadWeights(weights, strict = true) { - const nameToWeight = {}; - let totalWeightsCount = 0; - for (const layer of this.layers) { - for (const weight of layer.weights) { - if (nameToWeight[weight.originalName] != null) { - throw new ValueError(`Duplicate weight name: ${weight.originalName}`); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - const weightValueTuples = []; - for (const name in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - let validatedName = name; - if (nameToWeight[name] == null) { - const tokens = name.split('/'); - const shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name]]); - } - else if (strict) { - throw new ValueError(`Provided weight data has no target variable: ${name}`); - } - delete nameToWeight[validatedName]; - } - if (strict) { - // Check that all weights are set. - const unsetNames = []; - for (const name in nameToWeight) { - unsetNames.push(name); - } - if (unsetNames.length > 0) { - throw new ValueError(`${unsetNames.length} of ${totalWeightsCount} weights are not set: ` + - `${unsetNames}`); - } - } - batchSetValue(weightValueTuples); - } - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - updatedConfig() { - const theConfig = this.getConfig(); - const modelConfig = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = `tfjs-layers ${version}`; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - } - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - toJSON(unused, returnString = true) { - const modelConfig = convertTsToPythonic(this.updatedConfig()); - return returnString ? JSON.stringify(modelConfig) : modelConfig; - } - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = toList(inputs); - const feedDict = new FeedDict(); - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - return execute(this.outputs, feedDict, kwargs); - }); - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - return tfc.tidy(() => { - inputs = toList(inputs); - let masks; - if (mask == null) { - masks = pyListRepeat(null, inputs.length); - } - else { - masks = toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return this.runInternalGraph(inputs, masks)[1]; - }); - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - computeOutputShape(inputShape) { - const inputShapes = normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError(`Invalid inputShape argument ${inputShape}: ` + - `model has ${this.inputLayers.length} tensor inputs.`); - } - // TODO(michaelterry): Add caching - const layersToOutputShapes = {}; - for (let i = 0; i < inputShapes.length; i++) { - const layer = this.inputLayers[i]; - const inputShape = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - const shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - const inputShapes = []; - for (let j = 0; j < node.inboundLayers.length; j++) { - const inboundLayer = node.inboundLayers[j]; - const nodeIndex = node.nodeIndices[j]; - const tensorIndex = node.tensorIndices[j]; - const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`; - const inputShape = layersToOutputShapes[shapeKey]; - inputShapes.push(inputShape); - } - const outputShape = layer.computeOutputShape(singletonOrArray(inputShapes)); - const outputShapes = normalizeShapeList(outputShape); - const nodeIndex = layer.inboundNodes.indexOf(node); - for (let j = 0; j < outputShapes.length; j++) { - const shapeKey = `${layer.name}_${nodeIndex}_${j}`; - layersToOutputShapes[shapeKey] = outputShapes[j]; - } - } - } - } - // Read final output shapes from layersToOutputShapes. - const outputShapes = []; - const outputShapeKeys = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const tensorIndex = this.outputLayersTensorIndices[i]; - const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`; - outputShapeKeys.push(shapeKey); - } - for (let i = 0; i < outputShapeKeys.length; i++) { - const key = outputShapeKeys[i]; - assert$1(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - // TODO(michaelterry): Update cache - return singletonOrArray(outputShapes); - } - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - runInternalGraph(inputs, masks) { - if (masks == null) { - masks = pyListRepeat(null, inputs.length); - } - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - const tensorMap = {}; - for (let i = 0; i < this.inputs.length; ++i) { - const x = this.inputs[i]; - const y = inputs[i]; - const mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - const referenceInputTensors = node.inputTensors; - const referenceOutputTensors = node.outputTensors; - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - const computedData = new Array(); - for (const x of referenceInputTensors) { - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - let kwargs = {}; - let computedTensors; - let computedMasks; - let outputTensors; - let outputMasks; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - const [computedTensor, computedMask] = computedData[0]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors = - toList(layer.call(computedTensor, kwargs)); - outputMasks = toList(layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } - else { - computedTensors = computedData.map(x => x[0]); - computedMasks = computedData.map(x => x[1]); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors = - toList(layer.call(computedTensors, kwargs)); - outputMasks = toList(layer.computeMask(computedTensors, computedMasks)); - } - if (layer.activityRegularizer) { - throw new NotImplementedError('LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - // Update tensor map. - for (let i = 0; i < referenceOutputTensors.length; ++i) { - const x = referenceOutputTensors[i]; - const y = outputTensors[i]; - const mask = outputMasks[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - const outputTensors = []; - const outputMasks = []; - const outputShapes = []; - for (const x of this.outputs) { - assert$1(x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); - const [tensor, mask] = tensorMap[x.id]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - } - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - buildNodeConversionMap(layers) { - const nodeConversionMap = {}; - let keptNodes; - for (const layer of this.layers) { - keptNodes = layer instanceof Container ? 1 : 0; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - } - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - getLayer(name, index) { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError(`Was asked to retrieve layer at index ${index}, but model only ` + - `has ${this.layers.length} layer(s).`); - } - else { - return this.layers[index]; - } - } - else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - for (const layer of this.layers) { - if (layer.name === name) { - return layer; - } - } - throw new ValueError(`No such layer: ${name}`); - } - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tfc.tidy(() => { - const losses = []; - for (const layer of this.layers) { - for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (this.containerNodes.has(nodeKey)) { - losses.push(...layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - } - getConfig() { - const config = { name: this.name }; - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - const nodeConversionMap = this.buildNodeConversionMap(this.layers); - // Serialize and save the layers in layerConfigs - const layerConfigs = []; - for (const layer of this.layers) { - const layerClassName = layer.getClassName(); - const layerConfig = layer.getConfig(); - const filteredInboundNodes = []; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const node = layer.inboundNodes[originalNodeIndex]; - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - let kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } - catch (err) { - console.warn(`Layer ${layer.name} was passed ` + - `non-serializable keyword arguments: ` + - `${node.callArgs}. They will not be included ` + - `in the serialized model (and thus will be ` + - `missing at deserialization time).`); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - const nodeData = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - const nodeKey = Container.nodeKey(inboundLayer, nodeIndex); - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - const dict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - const modelInputs = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - const nodeIndex = this.inputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - const modelOutputs = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - } - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - // Layer instances created during - // the graph reconstruction process - const createdLayers = {}; - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - const unprocessedNodes = {}; - function addUnprocessedNode(layer, nodeData) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } - else { - unprocessedNodes[layer.name].push(nodeData); - } - } - function processNode(layer, nodeData) { - const inputTensors = []; - let kwargs; - for (const inputData of nodeData) { - const inboundLayerName = inputData[0]; - const inboundNodeIndex = inputData[1]; - const inboundTensorIndex = inputData[2]; - kwargs = inputData[3] == null ? - {} : - inputData[3]; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply(singletonOrArray(inputTensors), kwargs); // was ** kwargs - } - } - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData) { - const layerName = layerData['name']; - // Instantiate layer. - const layer = deserialize(layerData, config['customObjects'] != null ? - config['customObjects'] : - {}); - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - const inboundNodesData = layerData['inboundNodes']; - inboundNodesData.forEach(nodeData => { - if (!(nodeData instanceof Array)) { - throw new ValueError(`Corrupted configuration, expected array for nodeData: ${nodeData}`); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - // First, we create all layers and enqueue nodes to be processed. - const name = config['name']; - const layersFromConfig = config['layers']; - for (const layerData of layersFromConfig) { - processLayer(layerData); - } - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!isObjectEmpty(unprocessedNodes)) { - for (const layerData of layersFromConfig) { - const layer = createdLayers[layerData['name']]; - if (layer.name in unprocessedNodes) { - const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (const nodeData of currentUnprocessedNodesForLayer) { - processNode(layer, nodeData); - } - } - } - } - const inputTensors = []; - const outputTensors = []; - const inputLayersFromConfig = config['inputLayers']; - for (const layerData of inputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - const outputLayersFromConfig = config['outputLayers']; - for (const layerData of outputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({ inputs: inputTensors, outputs: outputTensors, name }); - } - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get stateful() { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (const layer of this.layers) { - if (layer.stateful) { - return true; - } - } - return false; - } - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - resetStates() { - tfc.tidy(() => { - this.layers.forEach(layer => { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) { - const numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(name => null); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } - else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [xWeight[outputNames[0]]]; - } - else { - return [xWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error(`Provided ${weightType} is an array of ${xWeight.length} ` + - `element(s), but the model has ${numOutputs} outputs. ` + - `Make sure a set of weights is provided for each model output.`); - } - return xWeight; - } - else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof xWeight[Object.keys(xWeight)[0]] === - 'object') { - const output = []; - outputNames.forEach(outputName => { - if (outputName in xWeight) { - output.push(xWeight[outputName]); - } - else { - output.push(null); - } - }); - return output; - } - else { - throw new Error(`The model has multiple (${numOutputs}) outputs, ` + - `so ${weightType} must be either an array with ` + - `${numOutputs} elements or an object with ${outputNames} keys. ` + - `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`); - } - } - /** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ - function standardizeClassWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight'); - } - /** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ - async function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) { - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - if (classWeight != null) { - // Apply class weights per sample. - const yClasses = tfc.tidy(() => { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone(); - } - else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - const axis = 1; - return y.argMax(axis); - } - else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } - else { - throw new Error(`Encountered unexpected last-dimension size (${y.shape[1]}) ` + - `during handling of class weights. The size is expected to be ` + - `>= 1.`); - } - } - else { - throw new Error(`Unexpected rank of target (y) tensor (${y.rank}) during ` + - `handling of class weights. The rank is expected to be 1 or 2.`); - } - }); - const yClassIndices = Array.from(await yClasses.data()); - tfc.dispose(yClasses); - const classSampleWeight = []; - yClassIndices.forEach(classIndex => { - if (classWeight[classIndex] == null) { - throw new Error(`classWeight must contain all classes in the training data. ` + - `The class ${classIndex} exists in the data but not in ` + - `classWeight`); - } - else { - classSampleWeight.push(classWeight[classIndex]); - } - }); - return tfc.tensor1d(classSampleWeight, 'float32'); - } - else { - return null; - } - } - /** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ - function computeWeightedLoss(losses, sampleWeights) { - return tfc.mul(losses, sampleWeights); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // Default batch size used during tensor-based validation. - const DEFAULT_VALIDATION_BATCH_SIZE = 32; - /** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ - function standardizeDataIteratorOutput( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, iteratorOut) { - let xs; - let ys; - const iteratorOutObj = iteratorOut; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - tfc.util.assert(xs != null && ys != null, () => 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - `${iteratorOut}`); - const flattenedXs = flattenTensorOrArrayOrMap('input', model.inputNames, xs); - const flattenedYs = flattenTensorOrArrayOrMap('output', model.outputNames, ys); - const batchSize = flattenedXs[0].shape[0]; - tfc.util.assert(flattenedXs.length === model.inputs.length, () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` + - `provides ${flattenedXs.length} inputs. (Expected input keys: ` + - `${JSON.stringify(model.inputNames)})`); - tfc.util.assert(flattenedYs.length === model.outputs.length, () => `LayersModel has ${model.outputs.length} outputs, but the dataset ` + - `provides ${flattenedYs.length} outputs. (Expected output keys: ` + - `${JSON.stringify(model.outputNames)})`); - for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - tfc.util.assert(flattenedXs[xIndex].shape[0] === batchSize, () => `Batch size mismatch: input ` + - `${model.inputNames[xIndex]} has ${flattenedXs[xIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - tfc.util.assert(flattenedYs[yIndex].shape[0] === batchSize, () => `Batch size mismatch: output ` + - `${model.outputNames[yIndex]} has ${flattenedYs[yIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - return { xs: flattenedXs, ys: flattenedYs }; - } - function flattenTensorOrArrayOrMap(inputOrOutput, names, values) { - if (values instanceof tfc.Tensor) { - return [values]; - } - else if (Array.isArray(values)) { - tfc.util.assert(values.length === names.length, () => `Received an array of ${values.length} Tensors, but expected ${names.length} to match the ${inputOrOutput} keys ${names}.`); - return values; - } - else { - const result = []; - // Check that all the required keys are available. - for (const name of names) { - if (values[name] == null) { - throw new ValueError(`The feature data generated by the dataset lacks the required ` + - `${inputOrOutput} key '${name}'.`); - } - result.push(values[name]); - } - return result; - } - } - function standardizeTensorValidationData(data) { - if (data.length === 3) { - throw new NotImplementedError('Validation with sample weights is not implemented yet.'); - } - return { xs: data[0], ys: data[1] }; - } - async function fitDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, dataset, args) { - const hasBatchesPerEpoch = args.batchesPerEpoch != null; - tfc.util.assert(model.optimizer != null, () => 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'); - tfc.util.assert(args != null, () => `For fitDataset(), the 2nd argument (config) is required, ` + - `but it is not provided in this call.`); - tfc.util.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), () => `For fitDataset(), config.epochs is expected to be a positive ` + - `integer, but got ${args.epochs}`); - tfc.util.assert(!hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` + - `positive integer if specified, but got ${args.batchesPerEpoch}`); - tfc.util.assert( - // tslint:disable-next-line:no-any - args['validationSplit'] == null, () => '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'); - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - try { - const doValidation = args.validationData != null; - let valXs; - let valYs; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - tfc.util.assert(args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), () => `For fitDataset() with dataset-based validation, ` + - `config.validationBatches is expected not to be provided, ` + - `or to be a positive integer, ` + - `but got ${args.validationBatches}`); - } - else { - const validationData = standardizeTensorValidationData(args.validationData); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let callbackMetrics; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const verbose = args.verbose == null ? 1 : args.verbose; - const { callbackList, history } = configureCallbacks(callbacks, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - let epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - let dataIterator = await dataset.iterator(); - while (epoch < args.epochs) { - const epochLogs = {}; - await callbackList.onEpochBegin(epoch); - let stepsDone = 0; - let batchIndex = 0; - if (!hasBatchesPerEpoch) { - dataIterator = await dataset.iterator(); - } - while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) { - const iteratorOut = await dataIterator.next(); - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn('You provided `batchesPerEpoch` as ' + - `${args.batchesPerEpoch}, ` + - 'but your dataset iterator ran out of data after ' + - `${stepsDone} batches; ` + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - `${args.batchesPerEpoch * args.epochs} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - break; - } - if (iteratorOut.value != null) { - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const batchLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - await callbackList.onBatchBegin(batchIndex, batchLogs); - const sampleWeights = []; - if (args.classWeight != null) { - const standardClassWeights = standardizeClassWeights(args.classWeight, model.outputNames); - for (let i = 0; i < standardClassWeights.length; ++i) { - sampleWeights.push(await standardizeWeights(ys[i], null, standardClassWeights[i])); - } - } - // Train on batch. - const ins = xs.concat(ys).concat(sampleWeights); - const outs = trainFunction(ins); - tfc.dispose(ins); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - } - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - batchIndex++; - stepsDone++; - } - if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done) { - // Epoch finished. Perform validation. - if (doValidation) { - let valOuts; - if (isDatasetObject(args.validationData)) { - valOuts = toList(await model.evaluateDataset(args.validationData, { batches: args.validationBatches })); - } - else { - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - } - for (let i = 0; i < model.metricsNames.length; ++i) { - epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i]; - } - } - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - break; - } - if (model.stopTraining_) { - break; - } - } - await callbackList.onEpochEnd(epoch, epochLogs); - epoch++; - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; - } - finally { - model.isTraining = false; - } - } - /** Helper function that determines number of steps (batches) per epoch. */ - function getStepsPerEpoch(dataset, args) { - // Attempt to determine # of batches in an epoch. - let stepsPerEpoch = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } - else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; - } - // Check if provided object is a Dataset object by checking its .iterator - // element. - function isDatasetObject(dataset) { - return (typeof dataset.iterator === 'function'); - } - // Check if provided object is a LazyIterator object by checking it's .next - // element. - function isLazyIteratorObject(iterator) { - return (typeof iterator.next === 'function'); - } - async function evaluateDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, dataset, args) { - args = args || {}; - const hasBatches = args.batches != null; - const f = model.testFunction; - let outs = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - tfc.util.assert(!hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), () => 'Test loop expects `batches` to be a positive integer, but ' + - `received ${JSON.stringify(args.batches)}`); - const dataIterator = isLazyIteratorObject(dataset) ? - dataset : - await dataset.iterator(); - // Keeps track of number of examples used in this evaluation. - let numExamples = 0; - let batch = 0; - while (hasBatches ? batch < args.batches : true) { - const iteratorOut = await dataIterator.next(); - outs = tfc.tidy(() => { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const xsAndYs = xs.concat(ys); - const batchOuts = tfc.tidy(() => f(xsAndYs)); - tfc.dispose(xsAndYs); - if (batch === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - const batchSize = xsAndYs[0].shape[0]; - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - const oldScalar = outs[i]; - outs[i] = - tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut))); - if (batch > 0) { - tfc.dispose(oldScalar); - } - } - tfc.dispose(batchOuts); - numExamples += batchSize; - ++batch; - } - return outs; - }); - if (iteratorOut.done) { - if (hasBatches) { - console.warn('Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - `batches (in this case, ${args.batches} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - break; - } - } - for (let i = 0; i < outs.length; ++i) { - const oldScalar = outs[i]; - outs[i] = tfc.div(outs[i], numExamples); - tfc.dispose(oldScalar); - } - return singletonOrArray(outs); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function checkBatchSize(batchSize) { - tfc.util.assert(batchSize > 0 && Number.isInteger(batchSize), () => `batchSize is required to be a positive integer, but got ${batchSize}`); - } - /** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ - function sliceArrays(arrays, start, stop) { - if (arrays == null) { - return [null]; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start)); - } - else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } - } - /** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ - function sliceArraysByIndices(arrays, indices) { - return tfc.tidy(() => { - if (arrays == null) { - return null; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceArraysByIndices(array, indices)); - } - else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather$1(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); - } - /** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ - function makeBatches(size, batchSize) { - const output = []; - let batchStart = 0; - let batchEnd = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; - } - /** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ - async function fitLoop( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model, f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - // TODO(cais): Change const to let below when implementing validation. - let doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - const numTrainSamples = model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - let indexArray; - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - if (verbose == null) { - verbose = 1; - } - const { callbackList, history } = configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - // TODO(cais): Take care of callbacks.validation_data as in PyKeras. - // TODO(cais): Pre-convert feeds for performance as in PyKeras. - for (let epoch = initialEpoch; epoch < epochs; ++epoch) { - await callbackList.onEpochBegin(epoch); - const epochLogs = {}; - if (stepsPerEpoch != null) { - throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); - } - else { - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } - else if (shuffle) { - tfc.util.shuffle(indexArray); - } - // Convert the potentially shuffled indices to Tensor1D, to avoid the - // cost of repeated creation of Array1Ds later on. - const epochIndexArray1D = tfc.tensor1d(indexArray); - const batches = makeBatches(numTrainSamples, batchSize); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchLogs = {}; - await callbackList.onBatchBegin(batchIndex, batchLogs); - tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis(epochIndexArray1D, batchStart, batchEnd - batchStart); - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const outs = f(insBatch); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - if (batchIndex === batches.length - 1) { // Last batch. - if (doValidation) { - const valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = valOuts[i]; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - if (model.stopTraining_) { - break; - } - // TODO(cais): return outs as list of Tensor. - } - epochIndexArray1D.dispose(); - } - // TODO(cais): Run validation at the end of the epoch. - await callbackList.onEpochEnd(epoch, epochLogs); - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; - } - async function fitTensors( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model, x, y, args = {}) { - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - let inputs; - let targets; - let inputValX; - let inputValY; - let valX; - let valY; - let sampleWeights; - try { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // Validate user data. - // TODO(cais): Support sampleWeight. - const checkBatchAxis = false; - const standardizedOuts = await model.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize); - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - // Prepare validation data. - let doValidation = false; - let valIns; - if (args.validationData != null && args.validationData.length > 0) { - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } - else if (args.validationData.length === 3) { - throw new NotImplementedError('validationData including sample weights is not supported yet.'); - } - else { - throw new ValueError(`When passing validation data, it must contain 2 (valX, valY) ` + - `or 3 (valX, valY, valSampleWeight) items; ` + - `${args.validationData} is invalid.`); - } - const checkBatchAxis = true; - const valStandardized = await model.standardizeUserData(inputValX, inputValY, null, /** Unused sample weights. */ null, /** Unused class weights. */ checkBatchAxis, batchSize); - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - // Porting Note: In tfjs-layers, inputs[0] is always a Tensor. - const splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - const originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize); - inputs = sliceArrays(inputs, 0, splitAt); - valY = sliceArrays(targets, splitAt, originalBatchSize); - targets = sliceArrays(targets, 0, splitAt); - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - const ins = inputs.concat(targets).concat(sampleWeights); - model.checkTrainableWeightsConsistency(); - // TODO(cais): Handle use_learning_phase and learning_phase? - // Porting Note: Here we see a key deviation of tfjs-layers from - // Keras. - // Due to the imperative nature of tfjs-layers' backend (tfjs-core), - // we do not construct symbolic computation graphs to embody the - // training process. Instead, we define a function that performs the - // training action. In PyKeras, the data (inputs and targets) are fed - // through graph placeholders. In tfjs-layers, the data are fed as - // function arguments. Since the function are defined below in the - // scope, we don't have equivalents of PyKeras's - // `_make_train_funciton`. - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let valFunction; - let callbackMetrics; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const out = await fitLoop(model, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); - return out; - } - finally { - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX, inputValX); - disposeNewTensors(valY, inputValY); - if (sampleWeights != null) { - tfc.dispose(sampleWeights); - } - } - // TODO(cais): Add value to outLabels. - } - /** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ - function ensureTensorsRank2OrHigher(tensors) { - const outs = []; - if (tensors instanceof tfc.Tensor) { - tensors = [tensors]; - } - // Make Tensors at least 2D. - for (let i = 0; i < tensors.length; ++i) { - const tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims$1(tensor, 1)); - } - else if (tensor.rank === 0) { - throw new Error('Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } - else { - outs.push(tensor); - } - } - return outs; - } - /** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ - // TODO(cais, kangyizhang): Deduplicate with tfjs-data. - function disposeNewTensors(tensors, refTensors) { - if (tensors == null) { - return; - } - const oldTensorIds = []; - if (refTensors instanceof tfc.Tensor) { - oldTensorIds.push(refTensors.id); - } - else if (Array.isArray(refTensors)) { - refTensors.forEach(t => oldTensorIds.push(t.id)); - } - else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in refTensors) { - const oldTensor = refTensors[name]; - oldTensorIds.push(oldTensor.id); - } - } - const tensorsToDispose = []; - if (tensors instanceof tfc.Tensor) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } - else if (Array.isArray(tensors)) { - tensors.forEach(t => { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } - else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in tensors) { - const tensor = tensors[name]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - tensorsToDispose.forEach(t => { - if (!t.isDisposed) { - t.dispose(); - } - }); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ - function isDataTensor(x) { - return x instanceof tfc.Tensor; - } - /** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ - function isDataArray(x) { - return Array.isArray(x); - } - /** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ - function isDataDict(x) { - return !isDataTensor(x) && !isDataArray(x); - } - /** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ - function standardizeInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - let gotUnexpectedData = false; - if (isDataArray(data) && data.length > 0) { - gotUnexpectedData = true; - } - else if (isDataDict(data)) { - for (const key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } - else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError(`Error when checking model ${exceptionPrefix} expected no data, ` + - `but got ${data}`); - } - } - return []; - } - if (data == null) { - return names.map(name => null); - } - let arrays; - if (isDataDict(data)) { - data = data; - arrays = []; - for (const name of names) { - if (data[name] == null) { - throw new ValueError(`No data provided for "${name}". Need data for each key in: ` + - `${names}`); - } - arrays.push(data[name]); - } - } - else if (isDataArray(data)) { - data = data; - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `model expected. Expected to see ${names.length} Tensor(s), but ` + - `instead got the following list of Tensor(s): ${data}`); - } - arrays = data; - } - else { - data = data; - if (names.length > 1) { - throw new ValueError(`The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` + - `but only received one Tensor. Found: Tensor with shape ${data.shape}`); - } - arrays = [data]; - } - arrays = ensureTensorsRank2OrHigher(arrays); - // Check shape compatibility. - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s). but got array with ` + - `shape ${array.shape}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have shape [${shapes[i]}], but got array with shape ` + - `[${array.shape}].`); - } - } - } - } - return arrays; - } - /** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ - function checkArrayLengths(inputs, targets, weights) { - const setX = unique$1(inputs.map(input => input.shape[0])); - setX.sort(); - const setY = unique$1(targets.map(target => target.shape[0])); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError(`All input Tensors (x) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(inputs.map(input => input.shape))}`); - } - if (setY.length > 1) { - throw new ValueError(`All target Tensors (y) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(targets.map(target => target.shape))}`); - } - if (setX.length > 0 && setY.length > 0 && !tfc.util.arraysEqual(setX, setY)) { - throw new ValueError(`Input Tensors should have the same number of samples as target ` + - `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` + - `sample(s).`); - } - } - /** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ - function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { - // TODO(cais): Dedicated test coverage? - const keyLosses = [ - meanSquaredError, binaryCrossentropy, - categoricalCrossentropy - ]; - for (let i = 0; i < targets.length; ++i) { - const y = targets[i]; - const loss = lossFns[i]; - const shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError(`You are passing a target array of shape ${y.shape} while using ` + - `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` + - `expects targets to be binary matrices (1s and 0s) of shape ` + - `[samples, classes].`); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - const slicedYShape = y.shape.slice(1); - const slicedShape = shape.slice(1); - for (let j = 0; j < slicedYShape.length; ++j) { - const targetDim = slicedYShape[j]; - const outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError(`A target Tensor with shape ${y.shape} was passed for an ` + - `output of shape ${shape}, while using a loss function that ` + - `expects targets to have the same shape as the output.`); - } - } - } - } - } - /** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ - function checkInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - let arrays; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `the model expected. Expected to see ${names.length} Tensor(s),` + - ` but instead got ${data.length} Tensors(s).`); - } - arrays = data; - } - else { - if (names.length > 1) { - throw new ValueError(`The model expects ${names.length} ${exceptionPrefix} Tensors, ` + - `but only received one Tensor. Found: array with shape ` + - `${JSON.stringify(data.shape)}.`); - } - arrays = [data]; - } - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s), but got array with ` + - `shape ${JSON.stringify(array.shape)}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ` + - `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` + - `got array with shape ${JSON.stringify(array.shape)}.`); - } - } - } - } - } - } - /** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ - function collectMetrics(metrics, outputNames) { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(name => []); - } - let wrappedMetrics; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } - else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics; - } - else { - throw new TypeError('Type of metrics argument not understood. Expected an string,' + - `function, Array, or Object, found: ${metrics}`); - } - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map(name => wrappedMetrics); - } - else { - // In this case, metrics is a dict. - const nestedMetrics = []; - for (const name of outputNames) { - let outputMetrics = wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } - } - const LAYERS_MODEL_FORMAT_NAME = 'layers-model'; - /** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - class LayersModel extends Container { - constructor(args) { - super(args); - this.isTraining = false; - } - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - throw new ValueError(`This model has never been called, thus its weights have not been ` + - `created yet. So no summary can be displayed. Build the model ` + - `first (e.g., by calling it on some test data).`); - } - printSummary(this, lineLength, positions, printFn); - } - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - compile(args) { - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - if (typeof args.optimizer === 'string') { - this.optimizer_ = getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } - else { - if (!(args.optimizer instanceof tfc.Optimizer)) { - throw new ValueError(`User-defined optimizer must be an instance of tf.Optimizer.`); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - // Prepare loss functions. - let lossFunctions = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss; - for (const name in args.loss) { - if (this.outputNames.indexOf(name) === -1) { - throw new ValueError(`Unknown entry in loss dictionary: "${name}". ` + - `Only expected the following keys: ${this.outputNames}`); - } - } - for (const name of this.outputNames) { - if (args.loss[name] == null) { - console.warn(`Output "${name}" is missing from loss dictionary. We assume ` + - `this was done on purpose, and we will not be expecting data ` + - `to be passed to ${name} during training`); - } - lossFunctions.push(get(args.loss[name])); - } - } - else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError(`When passing an Array as loss, it should have one entry per ` + - `model output. The model has ${this.outputs.length} output(s), ` + - `but you passed loss=${args.loss}.`); - } - const theLosses = args.loss; - lossFunctions = theLosses.map(l => get(l)); - } - else { - const lossFunction = get(args.loss); - this.outputs.forEach(_ => { - lossFunctions.push(lossFunction); - }); - } - this.lossFunctions = lossFunctions; - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (let i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - const shape = this.internalOutputShapes[i]; - const name = this.outputNames[i]; - this.feedOutputNames.push(name); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - const skipTargetIndices = []; - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - const weightedLoss = this.lossFunctions[i]; - if (this.outputs.length > 1) { - this.metricsTensors.push([weightedLoss, i]); - this.metricsNames.push(this.outputNames[i] + '_loss'); - } - } - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - const nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - /** - * Helper function used in loop below. - */ - const appendMetric = (outputIndex, metricName, metricTensor) => { - if (this.outputNames.length > 1) { - metricName = this.outputNames[outputIndex] + '_' + metricName; - } - this.metricsNames.push(metricName); - this.metricsTensors.push([metricTensor, outputIndex]); - }; - nameScope('metric', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - const outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - // TODO(cais): Add optional arg `weights` to the following function. - const handleMetrics = (metrics) => { - const metricNamePrefix = ''; - let metricName; - let accFn; - let weightedMetricFn; - // TODO(cais): Use 'weights_' for weighted metrics. - for (const metric of metrics) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - const outputShape = this.internalOutputShapes[i]; - if (outputShape[outputShape.length - 1] === 1 || - this.lossFunctions[i] === binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = binaryAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = binaryCrossentropy$1; - } - } - else if (this.lossFunctions[i] === - sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = sparseCategoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = sparseCategoricalCrossentropy$1; - } - } - else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = categoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = categoricalCrossentropy$1; - } - } - let suffix; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } - else { - const metricFn = get$1(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + getLossOrMetricName(metric); - } - // TODO(cais): Add weighting and masking to metricResult. - let metricResult; - nameScope(metricName, () => { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - } - }; - handleMetrics(outputMetrics); - // TODO(cais): Call handleMetrics with weights. - } - }); - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - } - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - checkTrainableWeightsConsistency() { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn('Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - const checkBatchAxis = true; - const standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - const ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - const f = this.testFunction; - const testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } - finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - this.makeTestFunction(); - return evaluateDataset(this, dataset, args); - } - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - checkNumSamples(ins, batchSize, steps, stepsName = 'steps') { - let numSamples; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError(`If ${stepsName} is set, batchSize must be null or undefined.` + - `Got batchSize = ${batchSize}`); - } - } - else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } - else { - numSamples = ins.shape[0]; - } - } - else { - throw new ValueError(`Either the input data should have a defined shape, or ` + - `${stepsName} shoud be specified.`); - } - return numSamples; - } - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - execute(inputs, outputs) { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError('`outputs` is an empty Array, which is not allowed.'); - } - const outputsIsArray = Array.isArray(outputs); - const outputNames = (outputsIsArray ? outputs : [outputs]); - const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - // Format the input into a FeedDict. - const feedDict = new FeedDict(); - if (inputs instanceof tfc.Tensor) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError(`The number of inputs provided (${inputs.length}) ` + - `does not match the number of inputs of this model ` + - `(${this.inputs.length}).`); - } - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } - else { - for (const input of this.inputs) { - const tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError(`No value is provided for the model's input ${input.name}`); - } - feedDict.add(input, tensorValue); - } - } - // Run execution. - const executeOutputs = execute(outputSymbolicTensors, feedDict); - return outputsIsArray ? executeOutputs : executeOutputs[0]; - } - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - retrieveSymbolicTensors(symbolicTensorNames) { - const outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); - let outputsRemaining = symbolicTensorNames.length; - for (const layer of this.layers) { - const layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; - const layerOutputNames = layerOutputs.map(output => output.name); - for (let i = 0; i < symbolicTensorNames.length; ++i) { - const index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining > 0) { - const remainingNames = []; - outputSymbolicTensors.forEach((tensor, i) => { - if (tensor == null) { - remainingNames.push(symbolicTensorNames[i]); - } - }); - throw new ValueError(`Cannot find SymbolicTensors for output name(s): ` + - `${JSON.stringify(remainingNames)}`); - } - return outputSymbolicTensors; - } - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - predictLoop(ins, batchSize = 32, verbose = false) { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); - } - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - const batches = makeBatches(numSamples, batchSize); - const outsBatches = this.outputs.map(output => []); - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchOuts = tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - const insBatch = sliceArrays(ins, batchStart, batchEnd); - // Construct the feeds for execute(); - const feeds = []; - if (Array.isArray(insBatch)) { - for (let i = 0; i < insBatch.length; ++i) { - feeds.push({ key: this.inputs[i], value: insBatch[i] }); - } - } - else { - feeds.push({ key: this.inputs[0], value: insBatch }); - } - const feedDict = new FeedDict(feeds); - return execute(this.outputs, feedDict); - }); - batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut)); - } - return singletonOrArray(outsBatches.map(batches => tfc.concat(batches, 0))); - }); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - const xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } - finally { - disposeNewTensors(xsRank2OrHigher, x); - } - } - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predictOnBatch(x) { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - } - standardizeUserDataXY(x, y, checkBatchAxis = true, batchSize) { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError('You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - const outputShapes = []; - for (let i = 0; i < this.feedOutputShapes.length; ++i) { - const outputShape = this.feedOutputShapes[i]; - const lossFn = this.feedLossFns[i]; - if (lossFn === sparseCategoricalCrossentropy) { - outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); - } - else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError(`In a stateful network, you should only pass inputs with a ` + - `number of samples that is divisible by the batch size ` + - `${batchSize}. Found: ${x[0].shape[0]} sample(s).`); - } - } - return [x, y]; - } - async standardizeUserData(x, y, sampleWeight, classWeight, checkBatchAxis = true, batchSize) { - const [standardXs, standardYs] = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - let standardSampleWeights = null; - if (classWeight != null) { - const classWeights = standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - for (let i = 0; i < classWeights.length; ++i) { - standardSampleWeights.push(await standardizeWeights(standardYs[i], null, classWeights[i])); - } - } - // TODO(cais): Deal with the case of model.stateful == true. - return [standardXs, standardYs, standardSampleWeights]; - } - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - testLoop(f, ins, batchSize, verbose = 0, steps) { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps'); - const outs = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); - } - else { - const batches = makeBatches(numSamples, batchSize); - const indexArray = tfc.tensor1d(range(0, numSamples)); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const batchOuts = f(insBatch); - if (batchIndex === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - outs[i] = - tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut)); - } - } - for (let i = 0; i < outs.length; ++i) { - outs[i] = tfc.div(outs[i], numSamples); - } - } - return outs; - }); - } - getDedupedMetricsNames() { - const outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - const dedupedOutLabels = []; - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - let newLabel = label; - if (count(outLabels, label) > 1) { - const dupIndex = count(outLabels.slice(0, i), label); - newLabel += `_${dupIndex}`; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - } - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - makeTrainFunction() { - return (data) => { - const lossValues = []; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const sampleWeights = data.slice(this.inputs.length + this.outputs.length, this.inputs.length + this.outputs.length * 2); - const metricsValues = []; - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - const totalLossFunction = () => { - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict, { 'training': true }); - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - let totalLoss; - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - let loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - // TODO(cais): push Scalar instead. - const meanLoss = tfc.mean(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - } - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (let i = 0; i < this.metricsTensors.length; ++i) { - let weightedMetric; - if (this.outputs.length > 1 && i < this.outputs.length) { - weightedMetric = lossValues[i]; - } - else { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - weightedMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - } - tfc.keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - totalLoss = tfc.mean(totalLoss); - // Add regularizer penalties. - this.calculateLosses().forEach(regularizerLoss => { - totalLoss = tfc.add(totalLoss, regularizerLoss); - }); - return totalLoss; - }; - const variables = this.collectedTrainableWeights.map(param => param.read()); - const returnCost = true; - const totalLossValue = this.optimizer_.minimize(totalLossFunction, returnCost, variables); - return [totalLossValue].concat(metricsValues); - }; - } - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - makeTestFunction() { - this.testFunction = (data) => { - return tfc.tidy(() => { - const valOutputs = []; - let totalLoss; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict); - // Compute total loss. - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - const loss = tfc.mean(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (let i = 0; i < this.metricsTensors.length; ++i) { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - const meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric); - } - return valOutputs; - }); - }; - } - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - return fitTensors(this, x, y, args); - } - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fitDataset(dataset, args) { - return fitDataset(this, dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - // TODO(cais): Support sampleWeight and classWeight. - // TODO(cais): Support Dataset objects. - const standardizeOut = await this.standardizeUserData(x, y); - const inputs = standardizeOut[0]; - const targets = standardizeOut[1]; - const trainFunction = this.makeTrainFunction(); - const losses = trainFunction(inputs.concat(targets)); - const lossValues = []; - for (const loss of losses) { - const v = await loss.data(); - lossValues.push(v[0]); - } - tfc.dispose(losses); - return singletonOrArray(lossValues); - } - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - getNamedWeights(config) { - const namedWeights = []; - const trainableOnly = config != null && config.trainableOnly; - const weights = trainableOnly ? this.trainableWeights : this.weights; - const weightValues = this.getWeights(trainableOnly); - for (let i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); - } - return namedWeights; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - this.stopTraining_ = stop; - } - get stopTraining() { - return this.stopTraining_; - } - get optimizer() { - return this.optimizer_; - } - set optimizer(optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - } - dispose() { - const result = super.dispose(); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors; - } - return result; - } - getLossIdentifiers() { - let lossNames; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss); - } - else if (Array.isArray(this.loss)) { - for (const loss of this.loss) { - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = this.loss.map(name => toSnakeCase(name)); - } - else { - const outputNames = Object.keys(this.loss); - lossNames = {}; - const losses = this.loss; - for (const outputName of outputNames) { - if (typeof losses[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses[outputName]); - } - else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - } - getMetricIdentifiers() { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(getLossOrMetricName(this.metrics))]; - } - else if (Array.isArray(this.metrics)) { - return this.metrics.map(metric => toSnakeCase(getLossOrMetricName(metric))); - } - else { - const metricsIdentifiers = {}; - for (const key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - } - getTrainingConfig() { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - } - loadTrainingConfig(trainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config); - const optimizer = deserialize(tsConfig); - let loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } - else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry)); - } - else if (trainingConfig.loss != null) { - loss = {}; - for (const key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]); - } - } - let metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(metric => toCamelCase(metric)); - } - else if (trainingConfig.metrics != null) { - metrics = {}; - for (const key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - this.compile({ loss, metrics, optimizer }); - } - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async save(handlerOrURL, config) { - if (typeof handlerOrURL === 'string') { - const handlers = tfc.io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError(`Cannot find any save handlers for URL '${handlerOrURL}'`); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) save handlers for ` + - `URL '${handlerOrURL}'`); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError('LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - const weightDataAndSpecs = await tfc.io.encodeWeights(this.getNamedWeights(config)); - const returnString = false; - const unusedArg = null; - const modelConfig = this.toJSON(unusedArg, returnString); - const modelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: `TensorFlow.js tfjs-layers v${version}`, - convertedBy: null, - }; - const includeOptimizer = config == null ? false : config.includeOptimizer; - if (includeOptimizer && this.optimizer != null) { - modelArtifacts.trainingConfig = this.getTrainingConfig(); - const weightType = 'optimizer'; - const { data: optimizerWeightData, specs: optimizerWeightSpecs } = await tfc.io.encodeWeights(await this.optimizer.getWeights(), weightType); - weightDataAndSpecs.specs.push(...optimizerWeightSpecs); - weightDataAndSpecs.data = tfc.io.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); - } - if (this.userDefinedMetadata != null) { - // Check serialized size of user-defined metadata. - const checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return handlerOrURL.save(modelArtifacts); - } - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - setUserDefinedMetadata(userDefinedMetadata) { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - } - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - getUserDefinedMetadata() { - return this.userDefinedMetadata; - } - } - // The class name is 'Model' rather than 'LayersModel' for backwards - // compatibility since this class name shows up in the serialization format. - /** @nocollapse */ - LayersModel.className = 'Model'; - tfc.serialization.registerClass(LayersModel); - /** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ - /** @doc {heading: 'Models', subheading: 'Classes'} */ - class Functional extends LayersModel { - } - Functional.className = 'Functional'; - tfc.serialization.registerClass(Functional); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ - async function modelFromJSON(modelAndWeightsConfig, customObjects) { - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = { modelTopology: modelAndWeightsConfig }; - } - modelAndWeightsConfig = modelAndWeightsConfig; - let modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config']; - } - const tsConfig = convertPythonicToTs(modelTopology); - const model = deserialize(tsConfig, customObjects); - if (modelAndWeightsConfig.weightsManifest != null) { - // Load the weight values keyed by the original tensor names in the model - // file that was loaded. These should match the keys of the weight - // manifest. - const weightValues = await tfc.io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(weight => weight.originalName)); - // Map the weights to the unique tensor names generated during model loading - const uniqueWeightValues = {}; - for (const weight of model.weights) { - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - tfc.dispose(weightValues); - } - return model; - } - /** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ - async function loadLayersModelInternal(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - const handlers = tfc.io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(tfc.io.browserHTTPRequest(pathOrIOHandler, options)); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) load handlers for ` + - `URL '${pathOrIOHandler}'`); - } - pathOrIOHandler = handlers[0]; - } - return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options); - } - /** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ - async function loadLayersModelFromIOHandler(handler, customObjects, options) { - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - const artifacts = await handler.load(); - let modelTopology = artifacts.modelTopology; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config']; - } - const strict = options.strict == null ? true : options.strict; - // If weights are provided and the weight-loading mode is strict, use - // fast weight initialization. This skips costly initializers such as - // 'orthogonal' and saves unnecessary computation in cases where - // the initialized weight values will immediately be overwritten by - // loaded weight values. - const fastWeightInit = artifacts.weightData != null && artifacts.weightSpecs != null && strict; - const model = deserialize(convertPythonicToTs(modelTopology), customObjects, fastWeightInit); - const trainingConfig = artifacts.trainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - // If weightData is present, load the weights into the model. - if (artifacts.weightData != null) { - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError('LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - const { modelWeights, optimizerWeights } = decodeModelAndOptimizerWeights(artifacts.weightData, artifacts.weightSpecs); - model.loadWeights(modelWeights, strict); - if (model.optimizer != null && optimizerWeights.length > 0) { - await model.optimizer.setWeights(optimizerWeights); - } - // Dispose temporary weight values. - tfc.dispose(modelWeights); - tfc.dispose(optimizerWeights.map(w => w.tensor)); - } - return model; - } - function decodeModelAndOptimizerWeights(buffer, specs) { - const name2Tensor = tfc.io.decodeWeights(buffer, specs); - const modelWeights = {}; - const optimizerWeights = []; - specs.forEach(spec => { - if (spec.group === 'optimizer') { - optimizerWeights.push({ name: spec.name, tensor: name2Tensor[spec.name] }); - } - else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return { modelWeights, optimizerWeights }; - } - /** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - class Sequential extends LayersModel { - constructor(args) { - super({ inputs: [], outputs: [] }); - args = args || {}; - this.trainable = true; - this.built = false; - // Set model name. - this.name = (args.name != null) ? args.name : getUid('sequential_'); - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (const layer of args.layers) { - this.add(layer); - } - } - } - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - checkShape(layer) { - const shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(x => x < 0)) { - throw new ValueError('Negative dimension size caused by adding layer ' + - `${layer.name} with input shape [` + - `${layer.inboundNodes[0].inputTensors[0].shape}]`); - } - } - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - add(layer) { - const isLayerModelInstance = layer instanceof Sequential || layer instanceof LayersModel; - let modelLayer; - if (isLayerModelInstance) { - modelLayer = layer; - if (modelLayer.outputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError('The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - const x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } - else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError('A layer added to a Sequential model must not already be ' + - `connected somewhere else. LayersModel received layer ${layer.name} ` + - `which has ${layer.inboundNodes.length} pre-existing inbound ` + - 'connections.'); - } - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs[0].shape - }); - } - else { - const outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - this.layers.push(layer); - this.built = false; - } - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - pop() { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } - else { - const lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - } - call(inputs, kwargs) { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - } - build(inputShape) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError('Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - } - countParams() { - if (!this.built) { - this.build(); - } - return super.countParams(); - } - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - this.build(); - } - super.summary(lineLength, positions, printFn); - } - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - setWeights(weights) { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluateDataset(dataset, args); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - } - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - predictOnBatch(x) { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - } - /** - * See `LayersModel.compile`. - * - * @param args - */ - compile(args) { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = this.model.isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - } - get optimizer() { - return this.model == null ? undefined : this.model.optimizer; - } - set optimizer(optimizer) { - this.model.optimizer = optimizer; - } - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fit(x, y, args); - } - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async fitDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fitDataset(dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - return this.model.trainOnBatch(x, y); - } - /* See parent class for JsDoc */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - let configArray; - let extraModelConfig = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } - else { - tfc.util.assert(config['layers'] != null, () => `When the config data for a Sequential model is not an Array, ` + - `it must be an Object that contains the 'layers' field.`); - configArray = config['layers']; - delete config['layers']; - extraModelConfig = config; - } - const model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError(`Sequential.fromConfig called on non-Sequential input: ${model}`); - } - for (const conf of configArray) { - const customObjects = undefined; - const layer = deserialize(conf, customObjects, fastWeightInit); - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError('Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - } - get stopTraining() { - if (this.model == null) { - throw new ValueError('Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - } - // TODO(cais): Override get trainableWeights() here - // tslint:disable-next-line:no-any - getConfig() { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - const layers = []; - for (const layer of this.layers) { - const dict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return { name: this.name, layers }; - } - } - /** @nocollapse */ - Sequential.className = 'Sequential'; - tfc.serialization.registerClass(Sequential); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // TODO(cais): Add doc string to all the public static functions in this - // class; include exectuable JavaScript code snippets where applicable - // (b/74074458). - // LayersModel and related factory methods. - /** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ - function model(args) { - return new LayersModel(args); - } - /** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ - function sequential(config) { - return new Sequential(config); - } - /** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ - function loadLayersModel(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); - } - /** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ - function input(config) { - return Input(config); - } - function registerCallbackConstructor(verbosityLevel, callbackConstructor) { - CallbackConstructorRegistry.registerCallbackConstructor(verbosityLevel, callbackConstructor); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ - class Activation extends tfc.serialization.Serializable { - getConfig() { - return {}; - } - } - /** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ - class Elu$1 extends Activation { - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - apply(x, alpha = 1) { - return elu$1(x, alpha); - } - } - /** @nocollapse */ - Elu$1.className = 'elu'; - tfc.serialization.registerClass(Elu$1); - /** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ - class Selu$1 extends Activation { - apply(x) { - return tfc.selu(x); - } - } - /** @nocollapse */ - Selu$1.className = 'selu'; - tfc.serialization.registerClass(Selu$1); - /** - * Rectified linear unit - */ - class Relu$1 extends Activation { - apply(x) { - return tfc.relu(x); - } - } - /** @nocollapse */ - Relu$1.className = 'relu'; - tfc.serialization.registerClass(Relu$1); - /** - * Rectified linear unit activation maxing out at 6.0. - */ - class Relu6$1 extends Activation { - apply(x) { - return tfc.tidy(() => tfc.minimum(6.0, tfc.relu(x))); - } - } - /** @nocollapse */ - Relu6$1.className = 'relu6'; - tfc.serialization.registerClass(Relu6$1); - //* Linear activation (no-op) */ - class Linear extends Activation { - apply(x) { - return x; - } - } - /** @nocollapse */ - Linear.className = 'linear'; - tfc.serialization.registerClass(Linear); - /** - * Sigmoid activation function. - */ - class Sigmoid$1 extends Activation { - apply(x) { - return tfc.sigmoid(x); - } - } - /** @nocollapse */ - Sigmoid$1.className = 'sigmoid'; - tfc.serialization.registerClass(Sigmoid$1); - /** - * Segment-wise linear approximation of sigmoid. - */ - class HardSigmoid extends Activation { - apply(x) { - return hardSigmoid(x); - } - } - /** @nocollapse */ - HardSigmoid.className = 'hardSigmoid'; - tfc.serialization.registerClass(HardSigmoid); - /** - * Softplus activation function. - */ - class Softplus$1 extends Activation { - apply(x) { - return tfc.softplus(x); - } - } - /** @nocollapse */ - Softplus$1.className = 'softplus'; - tfc.serialization.registerClass(Softplus$1); - /** - * Softsign activation function. - */ - class Softsign extends Activation { - apply(x) { - return softsign(x); - } - } - /** @nocollapse */ - Softsign.className = 'softsign'; - tfc.serialization.registerClass(Softsign); - /** - * Hyperbolic tangent function. - */ - class Tanh$1 extends Activation { - apply(x) { - return tfc.tanh(x); - } - } - /** @nocollapse */ - Tanh$1.className = 'tanh'; - tfc.serialization.registerClass(Tanh$1); - /** - * Softmax activation function - */ - class Softmax$1 extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return tfc.softmax(x, axis); - } - } - /** @nocollapse */ - Softmax$1.className = 'softmax'; - tfc.serialization.registerClass(Softmax$1); - /** - * Log softmax activation function - */ - class LogSoftmax$1 extends Activation { - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return tfc.logSoftmax(x, axis); - } - } - /** @nocollapse */ - LogSoftmax$1.className = 'logSoftmax'; - tfc.serialization.registerClass(LogSoftmax$1); - /** - * Swish activation function - */ - class Swish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - apply(x, alpha = 1) { - return tfc.tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x)); - } - } - /** @nocollapse */ - Swish.className = 'swish'; - tfc.serialization.registerClass(Swish); - /** - * Mish activation function - */ - class Mish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - apply(x) { - return tfc.tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x)))); - } - } - /** @nocollapse */ - Mish.className = 'mish'; - tfc.serialization.registerClass(Mish); - function serializeActivation(activation) { - return activation.getClassName(); - } - function deserializeActivation(config, customObjects = {}) { - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); - } - function getActivation(identifier) { - if (identifier == null) { - const config = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - const config = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } - else if (identifier instanceof Activation) { - return identifier; - } - else { - return deserializeActivation(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function assertObjectArgs(args) { - if (args != null && typeof args !== 'object') { - throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an ` + - `object, but received: ${args}`); - } - } - /** - * Regularizer base class. - */ - class Regularizer extends tfc.serialization.Serializable { - } - class L1L2 extends Regularizer { - constructor(args) { - super(); - assertObjectArgs(args); - this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - this.hasL1 = this.l1 !== 0; - this.hasL2 = this.l2 !== 0; - } - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - apply(x) { - return tfc.tidy(() => { - let regularization = tfc.zeros([1]); - if (this.hasL1) { - regularization = tfc.add(regularization, tfc.sum(tfc.mul(this.l1, tfc.abs(x)))); - } - if (this.hasL2) { - regularization = - tfc.add(regularization, tfc.sum(tfc.mul(this.l2, square$1(x)))); - } - return regularization.asScalar(); - }); - } - getConfig() { - return { 'l1': this.l1, 'l2': this.l2 }; - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls({ l1: config['l1'], l2: config['l2'] }); - } - } - /** @nocollapse */ - L1L2.className = 'L1L2'; - tfc.serialization.registerClass(L1L2); - function l1(args) { - assertObjectArgs(args); - return new L1L2({ l1: args != null ? args.l1 : null, l2: 0 }); - } - function l2(args) { - assertObjectArgs(args); - return new L1L2({ l2: args != null ? args.l2 : null, l1: 0 }); - } - // Maps the JavaScript-like identifier keys to the corresponding keras symbols. - const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'l1l2': 'L1L2' - }; - function serializeRegularizer(constraint) { - return serializeKerasObject(constraint); - } - function deserializeRegularizer(config, customObjects = {}) { - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); - } - function getRegularizer(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeRegularizer(config); - } - else if (identifier instanceof Regularizer) { - return identifier; - } - else { - return deserializeRegularizer(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class ReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maxValue = args.maxValue; - } - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - let output = tfc.relu(inputs); - if (this.maxValue != null) { - output = tfc.clipByValue(output, 0, this.maxValue); - } - return output; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { maxValue: this.maxValue }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - ReLU.className = 'ReLU'; - tfc.serialization.registerClass(ReLU); - class LeakyReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 0.3; - if (args == null) { - args = {}; - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return tfc.leakyRelu(x, this.alpha); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - LeakyReLU.className = 'LeakyReLU'; - tfc.serialization.registerClass(LeakyReLU); - class PReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA_INITIALIZER = 'zeros'; - if (args == null) { - args = {}; - } - this.supportsMasking = true; - this.alphaInitializer = - getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); - this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - this.sharedAxes = null; - } - else if (Array.isArray(args.sharedAxes)) { - this.sharedAxes = args.sharedAxes; - } - else if (typeof args.sharedAxes === 'number') { - this.sharedAxes = [args.sharedAxes]; - } - else { - throw new ValueError(`Expected sharedAxes to be a number or an array of numbers, ` + - `but got ${args.sharedAxes}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const paramShape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (const i of this.sharedAxes) { - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight('alpha', paramShape, 'float32', this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - const axes = {}; - if (this.sharedAxes != null) { - for (let i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes, - })]; - this.built = true; - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - return tfc.prelu(inputs, this.alpha.read()); - } - getConfig() { - const config = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - PReLU.className = 'PReLU'; - tfc.serialization.registerClass(PReLU); - class ELU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 1.0; - if (args == null) { - args = {}; - } - if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) { - throw new NotImplementedError(`Non-default alpha value (${args.alpha}) is not supported by the ` + - `ELU layer yet.`); - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return tfc.elu(x); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - ELU.className = 'ELU'; - tfc.serialization.registerClass(ELU); - class ThresholdedReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_THETA = 1.0; - if (args == null) { - args = {}; - } - this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return x.mul(cast$1(x.greater(this.theta), 'float32')); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { theta: this.theta }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - ThresholdedReLU.className = 'ThresholdedReLU'; - tfc.serialization.registerClass(ThresholdedReLU); - class Softmax$2 extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_AXIS = 1.0; - if (args == null) { - args = {}; - } - this.softmax = new Softmax$1().apply; - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { axis: this.axis }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Softmax$2.className = 'Softmax'; - tfc.serialization.registerClass(Softmax$2); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ - function normalizeArray(value, n, name) { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } - else { - if (value.length !== n) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n} integers.` + - ` Received: ${value.length} elements.`); - } - for (let i = 0; i < n; ++i) { - const singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n}` + - ` integers. Received: ${JSON.stringify(value)} including a` + - ` non-integer number ${singleValue}`); - } - } - return value; - } - } - /** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ - function convOutputLength(inputLength, filterSize, padding, stride, dilation = 1) { - if (inputLength == null) { - return inputLength; - } - const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - let outputLength; - if (padding === 'same') { - outputLength = inputLength; - } - else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); - } - function deconvLength(dimSize, strideSize, kernelSize, padding) { - if (dimSize == null) { - return null; - } - if (padding === 'valid') { - dimSize = dimSize * strideSize + max$1([kernelSize - strideSize, 0]); - } - else if (padding === 'same') { - dimSize = dimSize * strideSize; - } - else { - throw new ValueError(`Unsupport padding mode: ${padding}.`); - } - return dimSize; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ - function preprocessConv2DInput(x, dataFormat) { - // TODO(cais): Cast type to float32 if not. - return tfc.tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } - else { - return x; - } - }); - } - /** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ - function preprocessConv3DInput(x, dataFormat) { - return tfc.tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } - else { - return x; - } - }); - } - /** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ - function conv1dWithBias(x, kernel, bias, strides = 1, padding = 'valid', dataFormat, dilationRate = 1) { - return tfc.tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError(`The input of a conv1dWithBias operation should be 3, but is ` + - `${x.shape.length} instead.`); - } - if (kernel.shape.length !== 3) { - throw new ValueError(`The kernel for a conv1dWithBias operation should be 3, but is ` + - `${kernel.shape.length} instead`); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError(`The bias for a conv1dWithBias operation should be 1, but is ` + - `${kernel.shape.length} instead`); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - let y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - return y; - }); - } - /** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ - function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = 'valid', dataFormat, dilationRate, activation = null) { - return tfc.tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects input to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - let y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.fused.conv2d({ - x: y, - filter: kernel, - strides: strides, - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias, - activation - }); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); - } - /** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ - function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding = 'valid', dataFormat, dilationRate) { - return tfc.tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError(`conv3dWithBias expects input to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - let y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.conv3d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); - } - return y; - }); - } - /** - * Abstract convolution layer. - */ - class BaseConv extends Layer { - constructor(rank, args) { - super(args); - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - BaseConv.verifyArgs(args); - this.rank = rank; - assertPositiveInteger(this.rank, 'rank'); - if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) { - throw new NotImplementedError(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is ` + - `not implemented yet.`); - } - this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - this.strides = normalizeArray(args.strides == null ? 1 : args.strides, rank, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.activation = getActivation(args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.biasConstraint = getConstraint(args.biasConstraint); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.dilationRate = normalizeArray(args.dilationRate == null ? 1 : args.dilationRate, rank, 'dilationRate'); - if (this.rank === 1 && - (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) { - throw new ValueError(`dilationRate must be a number or an array of a single number ` + - `for 1D convolution, but received ` + - `${JSON.stringify(this.dilationRate)}`); - } - else if (this.rank === 2) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = [this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 2) { - throw new ValueError(`dilationRate must be a number or array of two numbers for 2D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - else if (this.rank === 3) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = - [this.dilationRate, this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 3) { - throw new ValueError(`dilationRate must be a number or array of three numbers for 3D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - } - static verifyArgs(args) { - // Check config.kernelSize type and shape. - assert$1('kernelSize' in args, `required key 'kernelSize' not in config`); - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 3)) { - throw new ValueError(`BaseConv expects config.kernelSize to be number or number[] with ` + - `length 1, 2, or 3, but received ${JSON.stringify(args.kernelSize)}.`); - } - } - getConfig() { - const config = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ - class Conv extends BaseConv { - constructor(rank, args) { - super(rank, args); - this.kernel = null; - Conv.verifyArgs(args); - this.filters = args.filters; - assertPositiveInteger(this.filters, 'filters'); - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([inputDim, this.filters]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.inputSpec = [{ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } }]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs; - const biasValue = this.bias == null ? null : this.bias.read(); - const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); - if (fusedActivationName != null && this.rank === 2) { - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate, fusedActivationName); - } - else { - if (this.rank === 1) { - outputs = conv1dWithBias(inputs, this.kernel.read(), biasValue, this.strides[0], this.padding, this.dataFormat, this.dilationRate[0]); - } - else if (this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else if (this.rank === 3) { - outputs = conv3dWithBias(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else { - throw new NotImplementedError('convolutions greater than 3D are not implemented yet.'); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const newSpace = []; - const space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (let i = 0; i < space.length; ++i) { - const newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - let outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } - else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - } - getConfig() { - const config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - static verifyArgs(args) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError(`Convolution layer expected config.filters to be a 'number' > 0 ` + - `but got ${JSON.stringify(args.filters)}`); - } - } - } - class Conv2D$1 extends Conv { - constructor(args) { - super(2, args); - Conv2D$1.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 2)) { - throw new ValueError(`Conv2D expects config.kernelSize to be number or number[] with ` + - `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`); - } - } - } - /** @nocollapse */ - Conv2D$1.className = 'Conv2D'; - tfc.serialization.registerClass(Conv2D$1); - class Conv3D$1 extends Conv { - constructor(args) { - super(3, args); - Conv3D$1.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError(`Conv3D expects config.kernelSize to be number or` + - ` [number, number, number], but received ${JSON.stringify(args.kernelSize)}.`); - } - } - } - } - /** @nocollapse */ - Conv3D$1.className = 'Conv3D'; - tfc.serialization.registerClass(Conv3D$1); - class Conv2DTranspose extends Conv2D$1 { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv2DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 4) { - throw new ValueError('Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 4, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - if (this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } - else { - hAxis = 1; - wAxis = 2; - } - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - // Infer the dynamic output shape. - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - const outputShape = [batchSize, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 1]); - } - let outputs = tfc.conv2dTranspose(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 3, 1, 2]); - } - if (this.bias != null) { - outputs = - biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } - } - /** @nocollapse */ - Conv2DTranspose.className = 'Conv2DTranspose'; - tfc.serialization.registerClass(Conv2DTranspose); - class Conv3DTranspose extends Conv3D$1 { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv3DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 5) { - throw new ValueError('Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 5, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - let dAxis; - if (this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } - else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - const depth = inputShape[dAxis]; - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - // Infer the dynamic output shape. - const outDepth = deconvLength(depth, strideD, kernelD, this.padding); - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Same as `conv2dTranspose`. We always assumes channelsLast. - const outputShape = [batchSize, outDepth, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 4, 1]); - } - let outputs = tfc.conv3dTranspose(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]); - } - if (this.bias !== null) { - outputs = - biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation !== null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let depthAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } - else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } - } - /** @nocollapse */ - Conv3DTranspose.className = 'Conv3DTranspose'; - tfc.serialization.registerClass(Conv3DTranspose); - class SeparableConv extends Conv { - constructor(rank, config) { - super(rank, config); - this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; - this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; - this.depthwiseKernel = null; - this.pointwiseKernel = null; - if (config.filters == null) { - throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError(`SeparableConv${this.rank}D supports only padding modes: ` + - `'same' and 'valid', but received ${JSON.stringify(config.padding)}`); - } - this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); - this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); - this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError(`Inputs to SeparableConv${this.rank}D should have rank ` + - `${this.rank + 2}, but received input shape: ` + - `${JSON.stringify(inputShape)}`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError(`The channel dimension of the inputs should be defined, ` + - `but found ${JSON.stringify(inputShape[channelAxis])}`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); - const pointwiseKernelShape = []; - for (let i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - const trainable = true; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); - } - else { - this.bias = null; - } - this.inputSpec = - [new InputSpec({ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = getExactlyOneTensor(inputs); - let output; - if (this.rank === 1) { - throw new NotImplementedError('1D separable convolution is not implemented yet.'); - } - else if (this.rank === 2) { - if (this.dataFormat === 'channelsFirst') { - inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - output = tfc.separableConv2d(inputs, this.depthwiseKernel.read(), this.pointwiseKernel.read(), this.strides, this.padding, this.dilationRate, 'NHWC'); - } - if (this.useBias) { - output = biasAdd(output, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - if (this.dataFormat === 'channelsFirst') { - output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - } - } - /** @nocollapse */ - SeparableConv.className = 'SeparableConv'; - class SeparableConv2D extends SeparableConv { - constructor(args) { - super(2, args); - } - } - /** @nocollapse */ - SeparableConv2D.className = 'SeparableConv2D'; - tfc.serialization.registerClass(SeparableConv2D); - class Conv1D extends Conv { - constructor(args) { - super(1, args); - Conv1D.verifyArgs(args); - this.inputSpec = [{ ndim: 3 }]; - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['dataFormat']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 1)) { - throw new ValueError(`Conv1D expects config.kernelSize to be number or number[] with ` + - `length 1, but received ${JSON.stringify(args.kernelSize)}.`); - } - } - } - /** @nocollapse */ - Conv1D.className = 'Conv1D'; - tfc.serialization.registerClass(Conv1D); - class Cropping2D extends Layer { - constructor(args) { - super(args); - if (typeof args.cropping === 'number') { - this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } - else if (typeof args.cropping[0] === 'number') { - this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1], args.cropping[1]] - ]; - } - else { - this.cropping = args.cropping; - } - this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - this.inputSpec = [{ ndim: 4 }]; - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } - else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - const hSliced = sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2); - return sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3); - } - else { - const hSliced = sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3); - return sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4); - } - }); - } - getConfig() { - const config = { cropping: this.cropping, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Cropping2D.className = 'Cropping2D'; - tfc.serialization.registerClass(Cropping2D); - class UpSampling2D extends Layer { - constructor(args) { - super(args); - this.DEFAULT_SIZE = [2, 2]; - this.inputSpec = [{ ndim: 4 }]; - this.size = args.size == null ? this.DEFAULT_SIZE : args.size; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(this.interpolation); - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - const height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; - const width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } - else { - const height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; - const width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - if (this.dataFormat === 'channelsFirst') { - input = tfc.transpose(input, [0, 2, 3, 1]); - const height = this.size[0] * inputShape[2]; - const width = this.size[1] * inputShape[3]; - const resized = this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return tfc.transpose(resized, [0, 3, 1, 2]); - } - else { - const height = this.size[0] * inputShape[1]; - const width = this.size[1] * inputShape[2]; - return this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - } - getConfig() { - const config = { size: this.size, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - UpSampling2D.className = 'UpSampling2D'; - tfc.serialization.registerClass(UpSampling2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ - function depthwiseConv2d$1(x, depthwiseKernel, strides = [1, 1], padding = 'valid', dataFormat, dilationRate) { - return tfc.tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - let y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError(`Input for depthwiseConv2d is required to be 4-D, but is instead ` + - `${x.rank}-D`); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError(`depthwiseKernel is required to be 4-D, but is instead ` + - `${depthwiseKernel.rank}-D`); - } - y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); - } - class DepthwiseConv2D extends BaseConv { - constructor(args) { - super(2, args); - this.depthwiseKernel = null; - this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - this.depthwiseInitializer = getInitializer(args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError(`Inputs to DepthwiseConv2D should have rank 4. ` + - `Received input shape: ${JSON.stringify(inputShape)}.`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + - `be defined, but is not (${inputShape[channelAxis]}).`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs = depthwiseConv2d$1(inputs, this.depthwiseKernel.read(), this.strides, this.padding, this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (this.useBias) { - outputs = biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - const cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - const outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - const outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); - const outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } - else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - } - getConfig() { - const config = super.getConfig(); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - } - } - /** @nocollapse */ - DepthwiseConv2D.className = 'DepthwiseConv2D'; - tfc.serialization.registerClass(DepthwiseConv2D); - - /*! ***************************************************************************** - 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. - ***************************************************************************** */ - - function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ - function standardizeArgs(inputs, initialState, constants, numConstants) { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError('When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - function toListOrNull(x) { - if (x == null || Array.isArray(x)) { - return x; - } - else { - return [x]; - } - } - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - return { inputs, initialState, constants }; - } - /** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ - function rnn(stepFunction, inputs, initialStates, goBackwards = false, mask, constants, unroll = false, needPerStepOutputs = false) { - return tfc.tidy(() => { - const ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`); - } - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - const axes = [1, 0].concat(range(2, ndim)); - inputs = tfc.transpose(inputs, axes); - if (constants != null) { - throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = tfc.expandDims(mask, -1); - } - mask = tfc.transpose(mask, axes); - } - if (goBackwards) { - inputs = tfc.reverse(inputs, 0); - if (mask != null) { - mask = tfc.reverse(mask, 0); - } - } - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - const perStepOutputs = []; - let lastOutput; - let states = initialStates; - const timeSteps = inputs.shape[0]; - const perStepInputs = tfc.unstack(inputs); - let perStepMasks; - if (mask != null) { - perStepMasks = tfc.unstack(mask); - } - for (let t = 0; t < timeSteps; ++t) { - const currentInput = perStepInputs[t]; - const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states)); - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } - else { - const maskedOutputs = tfc.tidy(() => { - const stepMask = perStepMasks[t]; - const negStepMask = tfc.onesLike(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - const output = stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - const newStates = states.map((state, i) => { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return { output, newStates }; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - } - let outputs; - if (needPerStepOutputs) { - const axis = 1; - outputs = tfc.stack(perStepOutputs, axis); - } - return [lastOutput, outputs, states]; - }); - } - class RNN extends Layer { - constructor(args) { - super(args); - let cell; - if (args.cell == null) { - throw new ValueError('cell property is missing for the constructor of RNN.'); - } - else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({ cells: args.cell }); - } - else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - this.cell = cell; - this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - this.returnState = args.returnState == null ? false : args.returnState; - this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - this._stateful = args.stateful == null ? false : args.stateful; - this.unroll = args.unroll == null ? false : args.unroll; - this.supportsMasking = true; - this.inputSpec = [new InputSpec({ ndim: 3 })]; - this.stateSpec = null; - this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - this.keptStates = []; - } - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - getStates() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return range(0, numStates).map(x => null); - } - else { - return this.states_; - } - } - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - setStates(states) { - this.states_ = states; - } - computeOutputShape(inputShape) { - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - // TODO(cais): Remove the casting once stacked RNN cells become supported. - let stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - const outputDim = stateSize[0]; - let outputShape; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } - else { - outputShape = [inputShape[0], outputDim]; - } - if (this.returnState) { - const stateShape = []; - for (const dim of stateSize) { - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } - else { - return outputShape; - } - } - computeMask(inputs, mask) { - return tfc.tidy(() => { - if (Array.isArray(mask)) { - mask = mask[0]; - } - const outputMask = this.returnSequences ? mask : null; - if (this.returnState) { - const stateMask = this.states.map(s => null); - return [outputMask].concat(stateMask); - } - else { - return outputMask; - } - }); - } - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get states() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - const output = []; - for (let i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } - else { - return this.states_; - } - } - set states(s) { - this.states_ = s; - } - build(inputShape) { - if (this.numConstants != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - const batchSize = this.stateful ? inputShape[0] : null; - const inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({ shape: [batchSize, null, ...inputDim] }); - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - const stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - { - this.cell.build(stepInputShape); - } - // Set or validate stateSpec. - let stateSize; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } - else { - stateSize = [this.cell.stateSize]; - } - if (this.stateSpec != null) { - if (!tfc.util.arraysEqual(this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]), stateSize)) { - throw new ValueError(`An initialState was passed that is not compatible with ` + - `cell.stateSize. Received stateSpec=${this.stateSpec}; ` + - `However cell.stateSize is ${this.cell.stateSize}`); - } - } - else { - this.stateSpec = - stateSize.map(dim => new InputSpec({ shape: [null, dim] })); - } - if (this.stateful) { - this.resetStates(); - } - } - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - resetStates(states, training = false) { - tfc.tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const batchSize = this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.states_ == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } - else { - this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } - else { - this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - tfc.dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const dim = Array.isArray(this.cell.stateSize) ? - this.cell.stateSize[index] : - this.cell.stateSize; - const expectedShape = [batchSize, dim]; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - apply(inputs, kwargs) { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - let additionalInputs = []; - let additionalSpecs = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (const state of initialState) { - this.stateSpec.push(new InputSpec({ shape: state.shape })); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - const isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - // tslint:disable-next-line:no-any - call(inputs, kwargs) { - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tfc.tidy(() => { - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - let initialState = kwargs == null ? null : kwargs['initialState']; - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (this.stateful) { - initialState = this.states_; - } - else { - initialState = this.getInitialState(inputs); - } - } - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError(`RNN Layer has ${numStates} state(s) but was passed ` + - `${initialState.length} initial state(s).`); - } - if (this.unroll) { - console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - const cellCallKwargs = { training }; - // TODO(cais): Add support for constants. - const step = (inputs, states) => { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - const outputs = this.cell.call([inputs].concat(states), cellCallKwargs); - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)]; - }; - // TODO(cais): Add support for constants. - const rnnOutputs = rnn(step, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); - const lastOutput = rnnOutputs[0]; - const outputs = rnnOutputs[1]; - const states = rnnOutputs[2]; - if (this.stateful) { - this.resetStates(states, training); - } - const output = this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. - if (this.returnState) { - return [output].concat(states); - } - else { - return output; - } - }); - } - getInitialState(inputs) { - return tfc.tidy(() => { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - let initialState = tfc.zeros(inputs.shape); - // [Samples]. - initialState = tfc.sum(initialState, [1, 2]); - initialState = expandDims$1(initialState); // [Samples, 1]. - if (Array.isArray(this.cell.stateSize)) { - return this.cell.stateSize.map(dim => dim > 1 ? tile$1(initialState, [1, dim]) : initialState); - } - else { - return this.cell.stateSize > 1 ? - [tile$1(initialState, [1, this.cell.stateSize])] : - [initialState]; - } - }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - } - get nonTrainableWeights() { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - const cellConfig = this.cell.getConfig(); - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - }; - } - // this order is necessary, to prevent cell name from replacing layer name - return Object.assign({}, cellConfig, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cellConfig = config['cell']; - const cell = deserialize(cellConfig, customObjects); - return new cls(Object.assign(config, { cell })); - } - } - /** @nocollapse */ - RNN.className = 'RNN'; - tfc.serialization.registerClass(RNN); - // Porting Note: This is a common parent class for RNN cells. There is no - // equivalent of this in PyKeras. Having a common parent class forgoes the - // need for `has_attr(cell, ...)` checks or its TypeScript equivalent. - /** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ - class RNNCell extends Layer { - } - class SimpleRNNCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, `units`); - this.activation = getActivation(args.activation == null ? this.DEFAULT_ACTIVATION : args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`); - } - let prevOutput = inputs[1]; - inputs = inputs[0]; - const training = kwargs['training'] == null ? false : kwargs['training']; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(prevOutput), - rate: this.recurrentDropout, - training - }); - } - let h; - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - if (dpMask != null) { - h = dot$1(tfc.mul(inputs, dpMask), this.kernel.read()); - } - else { - h = dot$1(inputs, this.kernel.read()); - } - if (this.bias != null) { - h = biasAdd(h, this.bias.read()); - } - if (recDpMask != null) { - prevOutput = tfc.mul(prevOutput, recDpMask); - } - let output = tfc.add(h, dot$1(prevOutput, this.recurrentKernel.read())); - if (this.activation != null) { - output = this.activation.apply(output); - } - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - return Object.assign({}, baseConfig, config); - } - } - /** @nocollapse */ - SimpleRNNCell.className = 'SimpleRNNCell'; - tfc.serialization.registerClass(SimpleRNNCell); - class SimpleRNN extends RNN { - constructor(args) { - args.cell = new SimpleRNNCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } - } - /** @nocollapse */ - SimpleRNN.className = 'SimpleRNN'; - tfc.serialization.registerClass(SimpleRNN); - class GRUCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.resetAfter) { - throw new ValueError(`GRUCell does not support reset_after parameter set to true.`); - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`GRUCell expects 2 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] == null ? false : kwargs['training']; - let hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training, - count: 3 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 3 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - let z; - let r; - let hh; - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let matrixX = dot$1(inputs, this.kernel.read()); - if (this.useBias) { - matrixX = biasAdd(matrixX, this.bias.read()); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - const recurrentKernelValue = this.recurrentKernel.read(); - const [rk1, rk2] = tfc.split(recurrentKernelValue, [2 * this.units, this.units], recurrentKernelValue.rank - 1); - const matrixInner = dot$1(hTMinus1, rk1); - const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1); - const [recurrentZ, recurrentR] = tfc.split(matrixInner, 2, matrixInner.rank - 1); - z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); - r = this.recurrentActivation.apply(tfc.add(xR, recurrentR)); - const recurrentH = dot$1(tfc.mul(r, hTMinus1), rk2); - hh = this.activation.apply(tfc.add(xH, recurrentH)); - const h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - return Object.assign({}, baseConfig, config); - } - } - /** @nocollapse */ - GRUCell.className = 'GRUCell'; - tfc.serialization.registerClass(GRUCell); - class GRU extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } - } - /** @nocollapse */ - GRU.className = 'GRU'; - tfc.serialization.registerClass(GRU); - class LSTMCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.unitForgetBias = args.unitForgetBias; - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = [this.units, this.units]; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - let biasInitializer; - if (this.useBias) { - if (this.unitForgetBias) { - const capturedBiasInit = this.biasInitializer; - const capturedUnits = this.units; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - // TODO(cais): More informative variable names? - const bI = capturedBiasInit.apply([capturedUnits]); - const bF = (new Ones()).apply([capturedUnits]); - const bCAndH = capturedBiasInit.apply([capturedUnits * 2]); - return concatAlongFirstAxis(concatAlongFirstAxis(bI, bF), bCAndH); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs; - if (inputs.length !== 3) { - throw new ValueError(`LSTMCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - let hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs), - rate: this.dropout, - training, - count: 4 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 4 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - let i; - let f; - let c; - let o; - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let z = dot$1(inputs, this.kernel.read()); - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - z = tfc.add(z, dot$1(hTMinus1, this.recurrentKernel.read())); - if (this.useBias) { - z = biasAdd(z, this.bias.read()); - } - const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1); - i = this.recurrentActivation.apply(z0); - f = this.recurrentActivation.apply(z1); - c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2))); - o = this.recurrentActivation.apply(z3); - const h = tfc.mul(o, this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - return Object.assign({}, baseConfig, config); - } - } - /** @nocollapse */ - LSTMCell.className = 'LSTMCell'; - tfc.serialization.registerClass(LSTMCell); - class LSTM extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } - } - /** @nocollapse */ - LSTM.className = 'LSTM'; - tfc.serialization.registerClass(LSTM); - class StackedRNNCells extends RNNCell { - constructor(args) { - super(args); - this.cells = args.cells; - } - get stateSize() { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - const stateSize = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - stateSize.push(...cell.stateSize); - } - else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = inputs; - let states = inputs.slice(1); - // Recover per-cell states. - const nestedStates = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } - else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - // Call the cells in order and store the returned states. - const newNestedStates = []; - let callInputs; - for (let i = 0; i < this.cells.length; ++i) { - const cell = this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } - else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs); - newNestedStates.push(callInputs.slice(1)); - } - // Format the new states as a flat list in reverse cell order. - states = []; - for (const cellStates of newNestedStates.slice().reverse()) { - states.push(...cellStates); - } - return [callInputs[0]].concat(states); - }); - } - build(inputShape) { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = inputShape[0]; - } - inputShape = inputShape; - let outputDim; - this.cells.forEach((cell, i) => { - nameScope(`RNNCell_${i}`, () => { - // TODO(cais): Take care of input constants. - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } - else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim]; - }); - }); - this.built = true; - } - getConfig() { - const baseConfig = super.getConfig(); - const getCellConfig = (cell) => { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - const cellConfigs = this.cells.map(getCellConfig); - const config = { 'cells': cellConfigs }; - return Object.assign({}, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cells = []; - for (const cellConfig of config['cells']) { - cells.push(deserialize(cellConfig, customObjects)); - } - return new cls({ cells }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const cell of this.cells) { - trainableWeights.push(...cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - getWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.weights); - } - return batchGetValue(weights); - } - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - setWeights(weights) { - const tuples = []; - for (const cell of this.cells) { - const numParams = cell.weights.length; - const inputWeights = weights.splice(numParams); - for (let i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - } - } - /** @nocollapse */ - StackedRNNCells.className = 'StackedRNNCells'; - tfc.serialization.registerClass(StackedRNNCells); - function generateDropoutMask(args) { - const { ones, rate, training = false, count = 1 } = args; - const droppedInputs = () => dropout(ones(), rate); - const createMask = () => inTrainPhase(droppedInputs, ones, training); - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return tfc.keep(createMask().clone()); - } - const masks = Array(count).fill(undefined).map(createMask); - return masks.map(m => tfc.keep(m.clone())); - } - - /** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Base class for convolutional-recurrent layers. - */ - class ConvRNN2D extends RNN { - constructor(args) { - if (args.unroll) { - throw new NotImplementedError('Unrolling is not possible with convolutional RNNs.'); - } - if (Array.isArray(args.cell)) { - throw new NotImplementedError('It is not possible at the moment to stack convolutional cells.'); - } - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - computeOutputShape(inputShape) { - let outShape = this.computeSingleOutputShape(inputShape); - if (!this.returnSequences) { - outShape = [outShape[0], ...outShape.slice(2)]; - } - if (this.returnState) { - outShape = - [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])]; - } - return outShape; - } - getInitialState(inputs) { - return tfc.tidy(() => { - const { stateSize } = this.cell; - const inputShape = inputs.shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const initialState = tfc.zeros(stateShape); - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - return [initialState]; - }); - } - resetStates(states, training = false) { - tfc.tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const inputShape = this.inputSpec[0].shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const batchSize = inputShape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.getStates() == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } - else { - this.states_ = [tfc.zeros(stateShape)]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } - else { - this.states_[0] = tfc.zeros(stateShape); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - tfc.dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const expectedShape = stateShape; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - computeSingleOutputShape(inputShape) { - const { dataFormat, filters, kernelSize, padding, strides, dilationRate } = this.cell; - const isChannelsFirst = dataFormat === 'channelsFirst'; - const h = inputShape[isChannelsFirst ? 3 : 2]; - const w = inputShape[isChannelsFirst ? 4 : 3]; - const hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - const wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); - const outShape = [ - ...inputShape.slice(0, 2), - ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters]) - ]; - return outShape; - } - } - /** @nocollapse */ - ConvRNN2D.className = 'ConvRNN2D'; - class ConvLSTM2DCell extends LSTMCell { - constructor(args) { - const { filters, kernelSize, strides, padding, dataFormat, dilationRate, } = args; - super(Object.assign({}, args, { units: filters })); - this.filters = filters; - assertPositiveInteger(this.filters, 'filters'); - this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize')); - this.strides = normalizeArray(strides || 1, 2, 'strides'); - this.strides.forEach(stride => assertPositiveInteger(stride, 'strides')); - this.padding = padding || 'valid'; - checkPaddingMode(this.padding); - this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(this.dataFormat); - this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - this.dilationRate.forEach(rate => assertPositiveInteger(rate, 'dilationRate')); - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const numOfKernels = 4; - const kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - const recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - this.recurrentKernel = this.addWeight('recurrent_kernel', recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - let biasInitializer; - if (this.unitForgetBias) { - const init = this.biasInitializer; - const filters = this.filters; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - const biasI = init.apply([filters]); - const biasF = tfc.ones([filters]); - const biasCAndO = init.apply([filters * 2]); - return concatenate([biasI, biasF, biasCAndO]); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (inputs.length !== 3) { - throw new ValueError(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] || false; - const x = inputs[0]; // Current input - const hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - const numOfKernels = 4; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(x), - rate: this.dropout, - training, - count: numOfKernels - }); - } - const dropoutMask = this.dropoutMask; - const applyDropout = (x, mask, index) => { - if (!mask || !mask[index]) { - return x; - } - return tfc.mul(mask[index], x); - }; - let xI = applyDropout(x, dropoutMask, 0); - let xF = applyDropout(x, dropoutMask, 1); - let xC = applyDropout(x, dropoutMask, 2); - let xO = applyDropout(x, dropoutMask, 3); - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: numOfKernels - }); - } - const recDropoutMask = this.recurrentDropoutMask; - let hI = applyDropout(hTMinus1, recDropoutMask, 0); - let hF = applyDropout(hTMinus1, recDropoutMask, 1); - let hC = applyDropout(hTMinus1, recDropoutMask, 2); - let hO = applyDropout(hTMinus1, recDropoutMask, 3); - const kernelChannelAxis = 3; - const [kernelI, kernelF, kernelC, kernelO] = tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis); - const [biasI, biasF, biasC, biasO] = this.useBias ? - tfc.split(this.bias.read(), numOfKernels) : - [null, null, null, null]; - xI = this.inputConv(xI, kernelI, biasI, this.padding); - xF = this.inputConv(xF, kernelF, biasF, this.padding); - xC = this.inputConv(xC, kernelC, biasC, this.padding); - xO = this.inputConv(xO, kernelO, biasO, this.padding); - const [recKernelI, recKernelF, recKernelC, recKernelO] = tfc.split(this.recurrentKernel.read(), numOfKernels, kernelChannelAxis); - hI = this.recurrentConv(hI, recKernelI); - hF = this.recurrentConv(hF, recKernelF); - hC = this.recurrentConv(hC, recKernelC); - hO = this.recurrentConv(hO, recKernelO); - const i = this.recurrentActivation.apply(tfc.add(xI, hI)); - const f = this.recurrentActivation.apply(tfc.add(xF, hF)); - const c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(tfc.add(xC, hC)))); - const h = tfc.mul(this.recurrentActivation.apply(tfc.add(xO, hO)), this.activation.apply(c)); - return [h, h, c]; - }); - } - getConfig() { - const _a = super.getConfig(), baseConfig = __rest(_a, ['units']); - const config = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - return Object.assign({}, baseConfig, config); - } - inputConv(x, w, b, padding) { - const out = tfc.conv2d(x, w, this.strides, (padding || 'valid'), this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', this.dilationRate); - if (b) { - return biasAdd(out, b, this.dataFormat); - } - return out; - } - recurrentConv(x, w) { - const strides = 1; - return tfc.conv2d(x, w, strides, 'same', this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - } - } - /** @nocollapse */ - ConvLSTM2DCell.className = 'ConvLSTM2DCell'; - tfc.serialization.registerClass(ConvLSTM2DCell); - class ConvLSTM2D extends ConvRNN2D { - constructor(args) { - const cell = new ConvLSTM2DCell(args); - super(Object.assign({}, args, { cell })); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } - } - /** @nocollapse */ - ConvLSTM2D.className = 'ConvLSTM2D'; - tfc.serialization.registerClass(ConvLSTM2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class Dropout extends Layer { - constructor(args) { - super(args); - this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - this.noiseShape = args.noiseShape; - this.seed = args.seed; - this.supportsMasking = true; - } - getNoiseShape(input) { - if (this.noiseShape == null) { - return this.noiseShape; - } - const inputShape = input.shape; - const noiseShape = []; - for (let i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (0 < this.rate && this.rate < 1) { - const training = kwargs['training'] == null ? false : kwargs['training']; - const noiseShape = this.getNoiseShape(input); - const output = inTrainPhase(() => dropout(input, this.rate, noiseShape, this.seed), () => input, training); - return output; - } - return inputs; - }); - } - getConfig() { - const config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - dispose() { - return super.dispose(); - } - } - /** @nocollapse */ - Dropout.className = 'Dropout'; - tfc.serialization.registerClass(Dropout); - class SpatialDropout1D extends Dropout { - constructor(args) { - super(args); - this.inputSpec = [{ ndim: 3 }]; - } - getNoiseShape(input) { - const inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - } - } - /** @nocollapse */ - SpatialDropout1D.className = 'SpatialDropout1D'; - tfc.serialization.registerClass(SpatialDropout1D); - class Dense extends Layer { - constructor(args) { - super(args); - // Default activation: Linear (none). - this.activation = null; - this.useBias = true; - this.kernel = null; - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - this.batchInputShape = [batchSize, args.inputDim]; - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation); - if (args.useBias != null) { - this.useBias = args.useBias; - } - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.supportsMasking = true; - this.inputSpec = [{ minNDim: 2 }]; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - } - this.inputSpec = [{ minNDim: 2, axes: { [-1]: inputLastDim } }]; - this.built = true; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - const input = getExactlyOneTensor(inputs); - const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); - let output; - if (fusedActivationName != null) { - output = dot$1(input, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); - } - else { - output = dot$1(input, this.kernel.read()); - if (this.bias != null) { - output = biasAdd(output, this.bias.read()); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - } - return output; - }); - } - getConfig() { - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Dense.className = 'Dense'; - tfc.serialization.registerClass(Dense); - class Flatten extends Layer { - constructor(args) { - args = args || {}; - super(args); - this.inputSpec = [{ minNDim: 3 }]; - this.dataFormat = args.dataFormat; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - for (const dim of inputShape.slice(1)) { - if (dim == null) { - throw new ValueError(`The shape of the input to "Flatten" is not fully defined ` + - `(got ${inputShape.slice(1)}). Make sure to pass a complete ` + - `"input_shape" or "batch_input_shape" argument to the first ` + - `layer in your model.`); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - let input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsFirst' && input.rank > 1) { - const permutation = [0]; - for (let i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - return batchFlatten(input); - }); - } - getConfig() { - const config = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Flatten.className = 'Flatten'; - tfc.serialization.registerClass(Flatten); - class Activation$1 extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.activation = getActivation(args.activation); - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - return this.activation.apply(input); - }); - } - getConfig() { - const config = { activation: serializeActivation(this.activation) }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Activation$1.className = 'Activation'; - tfc.serialization.registerClass(Activation$1); - class RepeatVector extends Layer { - constructor(args) { - super(args); - this.n = args.n; - this.inputSpec = [{ ndim: 2 }]; - } - computeOutputShape(inputShape) { - return [inputShape[0], this.n, inputShape[1]]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = getExactlyOneTensor(inputs); - return repeat(inputs, this.n); - }); - } - getConfig() { - const config = { - n: this.n, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - RepeatVector.className = 'RepeatVector'; - tfc.serialization.registerClass(RepeatVector); - class Reshape$1 extends Layer { - constructor(args) { - super(args); - this.targetShape = args.targetShape; - // Make sure that all unknown dimensions are represented as `null`. - for (let i = 0; i < this.targetShape.length; ++i) { - if (this.isUnknown(this.targetShape[i])) { - this.targetShape[i] = null; - } - } - } - isUnknown(dim) { - return dim < 0 || dim == null; - } - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - fixUnknownDimension(inputShape, outputShape) { - const errorMsg = 'Total size of new array must be unchanged.'; - const finalShape = outputShape.slice(); - let known = 1; - let unknown = null; - for (let i = 0; i < finalShape.length; ++i) { - const dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } - else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } - else { - known *= dim; - } - } - const originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } - else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - return finalShape; - } - computeOutputShape(inputShape) { - let anyUnknownDims = false; - for (let i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } - else { - return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const outputShape = inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - return input.reshape(outputShape); - }); - } - getConfig() { - const config = { - targetShape: this.targetShape, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Reshape$1.className = 'Reshape'; - tfc.serialization.registerClass(Reshape$1); - class Permute extends Layer { - constructor(args) { - super(args); - if (args.dims == null) { - throw new Error('Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error('Permute constructor requires `dims` to be an Array, but received ' + - `${args.dims} instead.`); - } - // Check the validity of the permutation indices. - const expectedSortedIndices = range(1, args.dims.length + 1); - if (!tfc.util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error('Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - this.dims = args.dims; - this.dimsIncludingBatch = [0].concat(this.dims); - this.inputSpec = [new InputSpec({ ndim: this.dims.length + 1 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - this.dims.forEach((dim, i) => { - outputShape[i + 1] = inputShape[dim]; - }); - return outputShape; - } - call(inputs, kwargs) { - return tfc.transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - } - getConfig() { - const config = { - dims: this.dims, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Permute.className = 'Permute'; - tfc.serialization.registerClass(Permute); - class Masking extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } - else { - this.maskValue = 0; - } - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { maskValue: this.maskValue }; - Object.assign(config, baseConfig); - return config; - } - computeMask(inputs, mask) { - const input = getExactlyOneTensor(inputs); - const axis = -1; - return tfc.any(tfc.notEqual(input, this.maskValue), axis); - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const axis = -1; - const keepDims = true; - const booleanMask = tfc.any(tfc.notEqual(input, this.maskValue), axis, keepDims); - const output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - } - } - /** @nocollapse */ - Masking.className = 'Masking'; - tfc.serialization.registerClass(Masking); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class Embedding extends Layer { - constructor(args) { - super(args); - this.embeddings = null; - this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - this.batchInputShape = [batchSize, null]; - } - else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - this.batchInputShape = - [batchSize].concat(toList(args.inputLength)); - } - } - this.inputDim = args.inputDim; - assertPositiveInteger(this.inputDim, 'inputDim'); - this.outputDim = args.outputDim; - assertPositiveInteger(this.outputDim, 'outputDim'); - this.embeddingsInitializer = getInitializer(args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER); - this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - this.maskZero = args.maskZero; - this.supportsMasking = args.maskZero; - this.inputLength = args.inputLength; - } - build(inputShape) { - this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); - this.built = true; - } - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - warnOnIncompatibleInputShape(inputShape) { } - computeMask(inputs, mask) { - return tfc.tidy(() => { - if (!this.maskZero) { - return null; - } - else { - inputs = getExactlyOneTensor(inputs); - return tfc.notEqual(inputs, tfc.zerosLike(inputs)); - } - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return [...inputShape, this.outputDim]; - } - // inputLength can be an array if input is 3D or higher. - const inLens = toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else { - let i = 0; - for (let k = 0; k < inLens.length; ++k) { - const s1 = inLens[k]; - const s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0], ...inLens, this.outputDim]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - let input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = cast$1(input, 'int32'); - } - const output = gather$1(this.embeddings.read(), input.as1D()); - return output.reshape(getExactlyOneShape(this.computeOutputShape(input.shape))); - }); - } - getConfig() { - const config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Embedding.className = 'Embedding'; - tfc.serialization.registerClass(Embedding); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ - class Merge extends Layer { - constructor(args) { - super(args || {}); - this.supportsMasking = true; - } - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - mergeFunction(inputs) { - throw new NotImplementedError(); - } - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - computeElementwiseOpOutputShape(shape1, shape2) { - if (shape1 == null || shape2 == null) { - return null; - } - else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } - else if (shape2.length === 0) { - return shape1; - } - const outputShape = shape1.slice(0, shape1.length - shape2.length); - for (let k = 0; k < shape2.length; ++k) { - const i = shape1[shape1.length - shape2.length + k]; - const j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } - else if (i === 1) { - outputShape.push(j); - } - else if (j === 1) { - outputShape.push(i); - } - else { - if (i !== j) { - throw new ValueError('Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - } - build(inputShape) { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape; - if (inputShape.length < 2) { - throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + - ` Got ${inputShape.length} input(s).`); - } - // Make sure that there is at most one unique batch size among the input - // shapes. - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError(`Can not merge tensors with different batch sizes. ` + - `Got tensors with shapes: ${JSON.stringify(inputShape)}.`); - } - let outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - const allRanks = inputShape.map(shape => shape.length); - if (inputShape.indexOf(null) === -1 && - unique$1(allRanks).length === 1) { - this.reshapeRequired = false; - } - else { - this.reshapeRequired = true; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - inputs = inputs; - if (this.reshapeRequired) { - const reshapedInputs = []; - const inputDims = inputs.map(input => input.rank); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - const maxNDim = max$1(inputDims); - for (let x of inputs) { - const xNDim = x.rank; - for (let k = 0; k < maxNDim - xNDim; ++k) { - x = expandDims$1(x, 1); - } - reshapedInputs.push(x); - } - return this.mergeFunction(reshapedInputs); - } - else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - let transposed = false; - for (const x of inputs) { - const xNDim = x.rank; - if (xNDim == null) { - const xShape = x.shape; - const batchSize = xShape[0]; - const newShape = xShape.slice(1).concat([batchSize]); - let xTransposed = x.reshape([batchSize].concat(arrayProd(xShape.slice(1)))); - xTransposed = tfc.transpose(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } - else if (xNDim > 1) { - const dims = range(1, xNDim).concat([0]); - reshapedInputs.push(tfc.transpose(x, dims)); - transposed = true; - } - else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - let y = this.mergeFunction(reshapedInputs); - const yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - const yShape = y.shape; - const yNDim = yShape.length; - const batchSize = yShape[yNDim - 1]; - const newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } - else if (yNDim > 1) { - const dims = [yNDim - 1].concat(range(0, yNDim - 1)); - y = tfc.transpose(y, dims); - } - } - return y; - } - } - else { - return this.mergeFunction(inputs); - } - }); - } - computeOutputShape(inputShape) { - inputShape = inputShape; - let outputShape; - if (inputShape[0] == null) { - outputShape = null; - } - else { - outputShape = inputShape[0].slice(1); - } - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } - else { - outputShape = [null].concat(outputShape); - } - return outputShape; - } - computeMask(inputs, mask) { - return tfc.tidy(() => { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`The Array 'inputs' and 'mask' are expected to have the same ` + - `length, but have different lengths ` + - `(${inputs.length} vs ${mask.length})`); - } - if (mask.every(m => m == null)) { - return null; - } - mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0)); - let output = mask[0]; - for (let i = 1; i < mask.length - 1; ++i) { - output = tfc.logicalAnd(output, mask[i]); - } - return output; - }); - } - } - class Add$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tfc.tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return output; - }); - } - } - /** @nocollapse */ - Add$1.className = 'Add'; - tfc.serialization.registerClass(Add$1); - class Multiply$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tfc.tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.mul(output, inputs[i]); - } - return output; - }); - } - } - /** @nocollapse */ - Multiply$1.className = 'Multiply'; - tfc.serialization.registerClass(Multiply$1); - class Average extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tfc.tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return tfc.mul(1 / inputs.length, output); - }); - } - } - /** @nocollapse */ - Average.className = 'Average'; - tfc.serialization.registerClass(Average); - class Maximum$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tfc.tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.maximum(output, inputs[i]); - } - return output; - }); - } - } - /** @nocollapse */ - Maximum$1.className = 'Maximum'; - tfc.serialization.registerClass(Maximum$1); - class Minimum$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tfc.tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.minimum(output, inputs[i]); - } - return output; - }); - } - } - /** @nocollapse */ - Minimum$1.className = 'Minimum'; - tfc.serialization.registerClass(Minimum$1); - class Concatenate extends Merge { - constructor(args) { - super(args); - this.DEFAULT_AXIS = -1; - if (args == null) { - args = {}; - } - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape; - let allNoneShape = true; - for (const shape of inputShape) { - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - const shapeSet = []; - for (let i = 0; i < inputShape.length; ++i) { - const shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - let exists = false; - for (const shape of shapeSet) { - if (tfc.util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - } - mergeFunction(inputs) { - return tfc.tidy(() => { - return concatenate(inputs, this.axis); - }); - } - computeOutputShape(inputShape) { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); - } - const inputShapes = inputShape; - const outputShape = inputShapes[0].slice(); - const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (const shape of inputShapes.slice(1)) { - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - } - computeMask(inputs, mask) { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`Mismatch in the length of mask (${mask.length}) ` + - `and the legnth of inputs (${inputs.length})`); - } - return tfc.tidy(() => { - let allNullMasks = true; - mask.forEach(m => { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - const outputMasks = []; - for (let i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(tfc.onesLike(inputs[i]).asType('bool')); - } - else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(tfc.expandDims(mask[i], -1)); - } - else { - outputMasks.push(mask[i]); - } - } - const concatenatedMasks = tfc.concat(outputMasks, this.axis); - return tfc.all(concatenatedMasks, -1, false); - }); - } - getConfig() { - const config = { - 'axis': this.axis, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Concatenate.className = 'Concatenate'; - tfc.serialization.registerClass(Concatenate); - /** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ - function interpretAxis(axis, dim) { - while (axis < 0) { - axis += dim; - } - return axis; - } - function batchDot(x, y, axes) { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError('batchDot is not implemented for tensors of 4D or higher rank yet'); - } - tfc.util.assert(x.shape.length >= 2, () => `batchDot requires the rank of x to be >= 2, ` + - `but got ${x.shape.length}`); - tfc.util.assert(x.shape.length >= 2, () => `batchDot requires the rank of y to be >= 2, ` + - `but got ${y.shape.length}`); - if (typeof axes === 'number') { - axes = [axes, axes]; - } - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError('batchDot is not implemented for complex64-type Tensors yet.'); - } - const xNDim = x.shape.length; - const yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - const axesArray = axes; - return tfc.tidy(() => { - let diff; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } - else if (yNDim > xNDim) { - diff = yNDim - xNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } - else { - diff = 0; - } - let out; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } - else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } - else { - const adjX = axesArray[0] !== x.shape.length - 1; - const adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - if (diff > 0) { - let idx; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } - else { - idx = xNDim - 1; - } - const squeezeAxes = []; - for (let i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); - } - class Dot extends Merge { - constructor(args) { - super(args); - this.axes = args.axes; - this.normalize = args.normalize == null ? false : args.normalize; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0]; - const shape2 = inputShape[1]; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError(`Dimension incompatibility: ` + - `${shape1[axes[0]]} !== ${shape2[axes[1]]}`); - } - } - mergeFunction(inputs) { - if (inputs.length !== 2) { - throw new ValueError('A `Dot` layer must be called on exactly 2 inputs, ' + - `but received ${inputs.length} input(s).`); - } - let x1 = inputs[0]; - let x2 = inputs[1]; - let axes; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } - else { - axes = this.axes.map((axis, i) => interpretAxis(axis, inputs[i].shape.length)); - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - } - interpretAxes(shape1, shape2) { - let axes; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } - else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - } - computeOutputShape(inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0].slice(); - const shape2 = inputShape[1].slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - const outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - } - computeMask(inputs, mask) { - return null; - } - getConfig() { - const config = { - 'axes': this.axes, - 'normalize': this.normalize - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - Dot.className = 'Dot'; - tfc.serialization.registerClass(Dot); - // TODO(cais): Add functional interfaces for the merge layers. - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class GaussianNoise extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.stddev = args.stddev; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { stddev: this.stddev }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const noised = () => randomNormal(input.shape, 0, this.stddev).add(input); - const output = inTrainPhase(noised, () => input, kwargs['training'] || false); - return output; - }); - } - } - /** @nocollapse */ - GaussianNoise.className = 'GaussianNoise'; - tfc.serialization.registerClass(GaussianNoise); - class GaussianDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (this.rate > 0 && this.rate < 1) { - const noised = () => { - const stddev = Math.sqrt(this.rate / (1 - this.rate)); - return input.mul(randomNormal(input.shape, 1, stddev)); - }; - return inTrainPhase(noised, () => input, kwargs['training'] || false); - } - return input; - }); - } - } - /** @nocollapse */ - GaussianDropout.className = 'GaussianDropout'; - tfc.serialization.registerClass(GaussianDropout); - /** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ - class AlphaDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - this.noiseShape = args.noiseShape; - } - _getNoiseShape(inputs) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - if (this.rate < 1 && this.rate > 0) { - const noiseShape = this._getNoiseShape(inputs); - const droppedInputs = () => { - const input = getExactlyOneTensor(inputs); - const alpha = 1.6732632423543772848170429916717; - const scale = 1.0507009873554804934193349852946; - const alphaP = -alpha * scale; - let keptIdx = tfc.greaterEqual(tfc.randomUniform(noiseShape), this.rate); - keptIdx = cast$1(keptIdx, 'float32'); // get default dtype. - // Get affine transformation params. - const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; - const b = -a * alphaP * this.rate; - // Apply mask. - const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - return x.mul(a).add(b); - }; - return inTrainPhase(droppedInputs, () => getExactlyOneTensor(inputs), kwargs['training'] || false); - } - return inputs; - }); - } - } - /** @nocollapse */ - AlphaDropout.className = 'AlphaDropout'; - tfc.serialization.registerClass(AlphaDropout); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ - function batchNormalization(x, mean, variance, beta, gamma, epsilon = 1e-3) { - let out; - if (x.rank === 2) { - out = tfc.batchNorm2d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = tfc.batchNorm3d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 4) { - out = tfc.batchNorm4d(x, mean, variance, beta, gamma, epsilon); - } - else { - throw new NotImplementedError(`batchNormalization is not implemented for array of rank ${x.rank} ` + - `yet`); - } - return out; - } - /** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tfc.tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }); - } - /** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tfc.tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const targetShape = []; - for (const axis of range(0, x.rank)) { - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } - else { - targetShape.push(x.shape[axis]); - } - } - const broadcastMean = mean.reshape(targetShape); - const broadcastVariance = variance.reshape(targetShape); - const broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); - const broadcastBeta = beta == null ? null : beta.reshape(targetShape); - const normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); - return [normed, mean, variance]; - }); - } - /** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - if (tfc.util.arraysEqual(reductionAxes.slice().sort(), range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - } - class BatchNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.supportsMasking = true; - this.axis = args.axis == null ? -1 : args.axis; - this.momentum = args.momentum == null ? 0.99 : args.momentum; - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - this.betaConstraint = getConstraint(args.betaConstraint); - this.gammaConstraint = getConstraint(args.gammaConstraint); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - const dim = inputShape[axis]; - if (dim == null) { - throw new ValueError(`Axis ${axis} of input tensor should have a defined dimension but ` + - `the layer received an input with shape ` + - `${JSON.stringify(inputShape)}.`); - } - this.inputSpec = - [new InputSpec({ ndim: inputShape.length, axes: { [axis]: dim } })]; - const shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); - } - this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); - this.built = true; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const ndim = inputShape.length; - const reductionAxes = range(0, ndim); - const axis = this.axis >= 0 ? this.axis : (this.axis + ndim); - reductionAxes.splice(axis, 1); - const broadcastShape = pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - const sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - const needsBroadcasting = !tfc.util.arraysEqual(sortedReductionAxes, range(0, ndim).slice(0, ndim - 1)); - const normalizeInference = () => { - if (needsBroadcasting) { - const broadcastMovingMean = this.movingMean.read().reshape(broadcastShape); - const broadcastMovingVariance = this.movingVariance.read().reshape(broadcastShape); - const broadcastBeta = this.center ? this.beta.read().reshape(broadcastShape) : null; - const broadcastGamma = this.scale ? this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); - } - else { - return batchNormalization(input, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); - } - }; - if (!training) { - return normalizeInference(); - } - const [normedTraining, mean, variance] = normalizeBatchInTraining(input, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); - const doMovingAverage = (variable, value, momentum) => { - tfc.tidy(() => { - const decay = 1 - momentum; - const origValue = variable.read(); - const updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - const updateMovingMeanAndVariance = () => { - doMovingAverage(this.movingMean, mean, this.momentum); - doMovingAverage(this.movingVariance, variance, this.momentum); - }; - updateMovingMeanAndVariance(); - return normedTraining; - }); - } - getConfig() { - const config = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - BatchNormalization.className = 'BatchNormalization'; - tfc.serialization.registerClass(BatchNormalization); - class LayerNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.axis = args.axis == null ? -1 : args.axis; - if (typeof this.axis === 'number') { - if (!Number.isInteger(this.axis)) { - throw new Error(`Expected axis to be an integer, but received ${this.axis}`); - } - } - else if (Array.isArray(this.axis)) { - for (const axis of this.axis) { - if (!Number.isInteger(axis)) { - throw new Error(`Expected axis to be an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - } - } - else { - throw new Error(`Expected axis to be an integer or an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const nDims = inputShape.length; - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (let i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - // Further validate axes. - for (const axis of this.axis) { - if (axis < 0 || axis >= nDims) { - throw new Error(`Invalid axis: ${axis}`); - } - } - if (this.axis.length !== unique$1(this.axis).length) { - throw new Error(`Found duplicate axes in: ${this.axis}`); - } - const paramShape = this.axis.map(axis => inputShape[axis]); - const trainable = true; - if (this.scale) { - this.gamma = this.addWeight('gamma', paramShape, 'float32', this.gammaInitializer, this.gammaRegularizer, trainable); - } - else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight('beta', paramShape, 'float32', this.betaInitializer, this.betaRegularizer, trainable); - } - else { - this.beta = null; - } - this.built = true; - } - call(inputs, kwargs) { - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const nDims = inputShape.length; - return tfc.tidy(() => { - const keepDims = true; - let { mean, variance } = tfc.moments(input, this.axis, keepDims); - const broadcastShape = pyListRepeat(1, nDims); - for (const dim of this.axis) { - broadcastShape[dim] = inputShape[dim]; - } - const broadcast = (v) => { - if (v != null && v.shape.length !== nDims && - this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } - else { - return v; - } - }; - let scale = broadcast(this.gamma.read()); - let offset = broadcast(this.beta.read()); - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - const momentsTiling = []; - const scaleOffsetTiling = []; - for (let i = 0; i < nDims; ++i) { - if (this.axis.indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } - else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - return batchNormalization(input, mean, variance, offset, scale, this.epsilon); - }); - } - getConfig() { - const config = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - LayerNormalization.className = 'LayerNormalization'; - tfc.serialization.registerClass(LayerNormalization); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ - function spatial2dPadding(x, padding, dataFormat) { - return tfc.tidy(() => { - if (x.rank !== 4) { - throw new ValueError(`temporalPadding expects input tensor to be 4-D, but received a ` + - `${x.rank}-D tensor.`); - } - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError(`Unknown data format: ${dataFormat}. ` + - `Supported data formats are 'channelsLast' and 'channelsFirst.`); - } - let pattern; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } - else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - return tfc.pad(x, pattern); - }); - } - class ZeroPadding2D extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - this.padding = [[1, 1], [1, 1]]; - } - else if (typeof args.padding === 'number') { - this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } - else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError(`ZeroPadding2D expects padding to be a length-2 array, but ` + - `received a length-${args.padding.length} array.`); - } - let heightPadding; - let widthPadding; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1], args.padding[1]]; - } - else { - args.padding = args.padding; - if (args.padding[0].length !== 2) { - throw new ValueError(`ZeroPadding2D expects height padding to be a length-2 array, ` + - `but received a length-${args.padding[0].length} array.`); - } - heightPadding = args.padding[0]; - if (args.padding[1].length !== 2) { - throw new ValueError(`ZeroPadding2D expects width padding to be a length-2 array, ` + - `but received a length-${args.padding[1].length} array.`); - } - widthPadding = args.padding[1]; - } - this.padding = [heightPadding, widthPadding]; - } - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows; - let cols; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => spatial2dPadding(getExactlyOneTensor(inputs), this.padding, this.dataFormat)); - } - getConfig() { - const config = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - /** @nocollapse */ - ZeroPadding2D.className = 'ZeroPadding2D'; - tfc.serialization.registerClass(ZeroPadding2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ - function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = tfc.maxPool(x, poolSize, strides, paddingString); - } - else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = tfc.avgPool( - // TODO(cais): Rank check? - x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); - } - /** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ - function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x, dataFormat); - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = tfc.maxPool3d(x, poolSize, strides, paddingString); - } - else { // 'avg' - y = tfc.avgPool3d(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); - } - /** - * Abstract class for different pooling 1D layers. - */ - class Pooling1D extends Layer { - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - constructor(args) { - if (args.poolSize == null) { - args.poolSize = 2; - } - super(args); - if (typeof args.poolSize === 'number') { - this.poolSize = [args.poolSize]; - } - else if (Array.isArray(args.poolSize) && - args.poolSize.length === 1 && - typeof args.poolSize[0] === 'number') { - this.poolSize = args.poolSize; - } - else { - throw new ValueError(`poolSize for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.poolSize)}`); - } - assertPositiveInteger(this.poolSize, 'poolSize'); - if (args.strides == null) { - this.strides = this.poolSize; - } - else { - if (typeof args.strides === 'number') { - this.strides = [args.strides]; - } - else if (Array.isArray(args.strides) && - args.strides.length === 1 && - typeof args.strides[0] === 'number') { - this.strides = args.strides; - } - else { - throw new ValueError(`strides for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.strides)}`); - } - } - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = expandDims$1(getExactlyOneTensor(inputs), 2); - const output = this.poolingFunction(getExactlyOneTensor(inputs), [this.poolSize[0], 1], [this.strides[0], 1], this.padding, 'channelsLast'); - // Remove dummy last dimension. - return tfc.squeeze(output, [2]); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - class MaxPooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } - } - /** @nocollapse */ - MaxPooling1D.className = 'MaxPooling1D'; - tfc.serialization.registerClass(MaxPooling1D); - class AveragePooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } - } - /** @nocollapse */ - AveragePooling1D.className = 'AveragePooling1D'; - tfc.serialization.registerClass(AveragePooling1D); - /** - * Abstract class for different pooling 2D layers. - */ - class Pooling2D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError(`If the strides property of a 2D pooling layer is an Array, ` + - `it is expected to have a length of 2, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - class MaxPooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } - } - /** @nocollapse */ - MaxPooling2D.className = 'MaxPooling2D'; - tfc.serialization.registerClass(MaxPooling2D); - class AveragePooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } - } - /** @nocollapse */ - AveragePooling2D.className = 'AveragePooling2D'; - tfc.serialization.registerClass(AveragePooling2D); - /** - * Abstract class for different pooling 3D layers. - */ - class Pooling3D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError(`If the strides property of a 3D pooling layer is an Array, ` + - `it is expected to have a length of 3, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let depths = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let rows = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength(depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } - else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - class MaxPooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } - } - /** @nocollapse */ - MaxPooling3D.className = 'MaxPooling3D'; - tfc.serialization.registerClass(MaxPooling3D); - class AveragePooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } - } - /** @nocollapse */ - AveragePooling3D.className = 'AveragePooling3D'; - tfc.serialization.registerClass(AveragePooling3D); - /** - * Abstract class for different global pooling 1D layers. - */ - class GlobalPooling1D extends Layer { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - return [inputShape[0], inputShape[2]]; - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } - } - class GlobalAveragePooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tfc.tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.mean(input, 1); - }); - } - } - /** @nocollapse */ - GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; - tfc.serialization.registerClass(GlobalAveragePooling1D); - class GlobalMaxPooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tfc.tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.max(input, 1); - }); - } - } - /** @nocollapse */ - GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; - tfc.serialization.registerClass(GlobalMaxPooling1D); - /** - * Abstract class for different global pooling 2D layers. - */ - class GlobalPooling2D extends Layer { - constructor(args) { - super(args); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = inputShape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } - else { - return [inputShape[0], inputShape[1]]; - } - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } - getConfig() { - const config = { dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - } - class GlobalAveragePooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tfc.tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.mean(input, [1, 2]); - } - else { - return tfc.mean(input, [2, 3]); - } - }); - } - } - /** @nocollapse */ - GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; - tfc.serialization.registerClass(GlobalAveragePooling2D); - class GlobalMaxPooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tfc.tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.max(input, [1, 2]); - } - else { - return tfc.max(input, [2, 3]); - } - }); - } - } - /** @nocollapse */ - GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; - tfc.serialization.registerClass(GlobalMaxPooling2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ - class Wrapper extends Layer { - constructor(args) { - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - super(args); - this.layer = args.layer; - } - build(inputShape) { - this.built = true; - } - // TODO(cais): Implement activityRegularizer getter. - get trainable() { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } - else { - return false; - } - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - } - get trainableWeights() { - return this.layer.trainableWeights; - } - // TODO(cais): Implement setter for trainableWeights. - get nonTrainableWeights() { - return this.layer.nonTrainableWeights; - } - // TODO(cais): Implement setter for nonTrainableWeights. - get updates() { - // tslint:disable-next-line:no-any - return this.layer._updates; - } - // TODO(cais): Implement getUpdatesFor(). - get losses() { - return this.layer.losses; - } - // TODO(cais): Implement getLossesFor(). - getWeights() { - return this.layer.getWeights(); - } - setWeights(weights) { - this.layer.setWeights(weights); - } - getConfig() { - const config = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const layerConfig = config['layer']; - const layer = deserialize(layerConfig, customObjects); - delete config['layer']; - const newConfig = { layer }; - Object.assign(newConfig, config); - return new cls(newConfig); - } - } - class TimeDistributed extends Wrapper { - constructor(args) { - super(args); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError(`TimeDistributed layer expects an input shape >= 3D, but received ` + - `input shape ${JSON.stringify(inputShape)}`); - } - this.inputSpec = [{ shape: inputShape }]; - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - super.build(inputShape); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - const childOutputShape = this.layer.computeOutputShape(childInputShape); - const timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - } - call(inputs, kwargs) { - return tfc.tidy(() => { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - const step = (inputs, states) => { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - const output = getExactlyOneTensor(this.layer.call(inputs, kwargs)); - return [output, []]; - }; - const rnnOutputs = rnn(step, inputs, [], false /* goBackwards */, null /* mask */, null /* constants */, false /* unroll */, true /* needPerStepOutputs */); - const y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - } - } - /** @nocollapse */ - TimeDistributed.className = 'TimeDistributed'; - tfc.serialization.registerClass(TimeDistributed); - function checkBidirectionalMergeMode(value) { - checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); - } - const DEFAULT_BIDIRECTIONAL_MERGE_MODE = 'concat'; - class Bidirectional extends Wrapper { - constructor(args) { - super(args); - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - const layerConfig = args.layer.getConfig(); - const forwDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - this.forwardLayer = deserialize(forwDict); - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - const backDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - this.backwardLayer = deserialize(backDict); - this.forwardLayer.name = 'forward_' + this.forwardLayer.name; - this.backwardLayer.name = 'backward_' + this.backwardLayer.name; - this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(this.mergeMode); - if (args.weights) { - throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); - } - this._stateful = args.layer.stateful; - this.returnSequences = args.layer.returnSequences; - this.returnState = args.layer.returnState; - this.supportsMasking = true; - this._trainable = true; - this.inputSpec = args.layer.inputSpec; - this.numConstants = null; - } - get trainable() { - return this._trainable; - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - } - getWeights() { - return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); - } - setWeights(weights) { - const numWeights = weights.length; - const numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - } - computeOutputShape(inputShape) { - let layerShapes = this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes]; - } - layerShapes = layerShapes; - let outputShape; - let outputShapes; - let stateShape; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } - else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } - else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } - else { - outputShapes = [outputShape]; - } - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return singletonOrArray(outputShapes); - } - apply(inputs, kwargs) { - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - if (Array.isArray(inputs)) { - initialState = inputs.slice(1); - inputs = inputs[0]; - } - if ((initialState == null || initialState.length === 0) && - constants == null) { - return super.apply(inputs, kwargs); - } - const additionalInputs = []; - const additionalSpecs = []; - if (initialState != null) { - const numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push(...initialState); - const stateSpecs = initialState - .map(state => new InputSpec({ shape: state.shape })); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push(...stateSpecs); - } - if (constants != null) { - throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (const tensor of additionalInputs) { - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError('The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - call(inputs, kwargs) { - return tfc.tidy(() => { - const initialState = kwargs['initialState']; - let y; - let yRev; - if (initialState == null) { - y = this.forwardLayer.call(inputs, kwargs); - yRev = this.backwardLayer.call(inputs, kwargs); - } - else { - const forwardState = initialState.slice(0, initialState.length / 2); - const backwardState = initialState.slice(initialState.length / 2); - y = this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); - yRev = this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); - } - let states; - if (this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat(yRev.slice(1)); - } - y = y[0]; - yRev = yRev[0]; - } - if (this.returnSequences) { - yRev = tfc.reverse(yRev, 1); - } - let output; - if (this.mergeMode === 'concat') { - output = concatenate([y, yRev]); - } - else if (this.mergeMode === 'sum') { - output = tfc.add(y, yRev); - } - else if (this.mergeMode === 'ave') { - output = tfc.mul(.5, tfc.add(y, yRev)); - } - else if (this.mergeMode === 'mul') { - output = tfc.mul(y, yRev); - } - else if (this.mergeMode == null) { - output = [y, yRev]; - } - // TODO(cais): Properly set learning phase. - if (this.returnState) { - if (this.mergeMode == null) { - return output.concat(states); - } - return [output].concat(states); - } - return output; - }); - } - resetStates(states) { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - } - build(inputShape) { - nameScope(this.forwardLayer.name, () => { - this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, () => { - this.backwardLayer.build(inputShape); - }); - this.built = true; - } - computeMask(inputs, mask) { - if (Array.isArray(mask)) { - mask = mask[0]; - } - let outputMask; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } - else { - outputMask = mask; - } - } - else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } - else { - outputMask = null; - } - } - if (this.returnState) { - const states = this.forwardLayer.states; - const stateMask = states.map(state => null); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } - else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } - else { - return outputMask; - } - } - get trainableWeights() { - return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); - } - get nonTrainableWeights() { - return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); - } - // TODO(cais): Implement constraints(). - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const config = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - /** @nocollapse */ - static fromConfig(cls, config) { - const rnnLayer = deserialize(config['layer']); - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError(`Deserialization of a Bidirectional layer with numConstants ` + - `present is not supported yet.`); - } - // tslint:disable-next-line:no-any - const newConfig = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - } - } - /** @nocollapse */ - Bidirectional.className = 'Bidirectional'; - tfc.serialization.registerClass(Bidirectional); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // TODO(cais): Add doc string to all the public static functions in this - // class; include exectuable JavaScript code snippets where applicable - // (b/74074458). - // Input Layer. - /** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ - function inputLayer(args) { - return new InputLayer(args); - } - // Advanced Activation Layers. - /** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function elu$2(args) { - return new ELU(args); - } - /** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function reLU(args) { - return new ReLU(args); - } - /** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function leakyReLU(args) { - return new LeakyReLU(args); - } - /** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function prelu$1(args) { - return new PReLU(args); - } - /** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function softmax$1(args) { - return new Softmax$2(args); - } - /** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function thresholdedReLU(args) { - return new ThresholdedReLU(args); - } - // Convolutional Layers. - /** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv1d$1(args) { - return new Conv1D(args); - } - /** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv2d$1(args) { - return new Conv2D$1(args); - } - /** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv2dTranspose$1(args) { - return new Conv2DTranspose(args); - } - /** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv3d(args) { - return new Conv3D$1(args); - } - function conv3dTranspose(args) { - return new Conv3DTranspose(args); - } - /** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function separableConv2d$1(args) { - return new SeparableConv2D(args); - } - /** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function cropping2D(args) { - return new Cropping2D(args); - } - /** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function upSampling2d(args) { - return new UpSampling2D(args); - } - // Convolutional(depthwise) Layers. - /** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function depthwiseConv2d$2(args) { - return new DepthwiseConv2D(args); - } - // Basic Layers. - /** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function activation(args) { - return new Activation$1(args); - } - /** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function dense(args) { - return new Dense(args); - } - /** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function dropout$1(args) { - return new Dropout(args); - } - /** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function spatialDropout1d(args) { - return new SpatialDropout1D(args); - } - /** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function flatten$2(args) { - return new Flatten(args); - } - /** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function repeatVector(args) { - return new RepeatVector(args); - } - /** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function reshape$1(args) { - return new Reshape$1(args); - } - /** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function permute(args) { - return new Permute(args); - } - /** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function embedding(args) { - return new Embedding(args); - } - // Merge Layers. - /** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function add$2(args) { - return new Add$1(args); - } - /** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function average(args) { - return new Average(args); - } - /** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function concatenate$1(args) { - return new Concatenate(args); - } - /** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function maximum$1(args) { - return new Maximum$1(args); - } - /** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function minimum$1(args) { - return new Minimum$1(args); - } - /** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function multiply(args) { - return new Multiply$1(args); - } - /** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function dot$2(args) { - return new Dot(args); - } - // Normalization Layers. - /** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ - function batchNormalization$1(args) { - return new BatchNormalization(args); - } - /** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ - function layerNormalization(args) { - return new LayerNormalization(args); - } - // Padding Layers. - /** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ - function zeroPadding2d(args) { - return new ZeroPadding2D(args); - } - // Pooling Layers. - /** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling1d(args) { - return new AveragePooling1D(args); - } - function avgPool1d(args) { - return averagePooling1d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling1d(args) { - return averagePooling1d(args); - } - /** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling2d(args) { - return new AveragePooling2D(args); - } - function avgPool2d(args) { - return averagePooling2d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling2d(args) { - return averagePooling2d(args); - } - /** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling3d(args) { - return new AveragePooling3D(args); - } - function avgPool3d(args) { - return averagePooling3d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling3d(args) { - return averagePooling3d(args); - } - /** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalAveragePooling1d(args) { - return new GlobalAveragePooling1D(args); - } - /** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalAveragePooling2d(args) { - return new GlobalAveragePooling2D(args); - } - /** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalMaxPooling1d(args) { - return new GlobalMaxPooling1D(args); - } - /** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalMaxPooling2d(args) { - return new GlobalMaxPooling2D(args); - } - /** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling1d(args) { - return new MaxPooling1D(args); - } - /** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling2d(args) { - return new MaxPooling2D(args); - } - /** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling3d(args) { - return new MaxPooling3D(args); - } - // Recurrent Layers. - /** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function gru(args) { - return new GRU(args); - } - /** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function gruCell(args) { - return new GRUCell(args); - } - /** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function lstm(args) { - return new LSTM(args); - } - /** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function lstmCell(args) { - return new LSTMCell(args); - } - /** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function simpleRNN(args) { - return new SimpleRNN(args); - } - /** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function simpleRNNCell(args) { - return new SimpleRNNCell(args); - } - /** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ - /** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ - function convLstm2d(args) { - return new ConvLSTM2D(args); - } - /** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ - /** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ - function convLstm2dCell(args) { - return new ConvLSTM2DCell(args); - } - /** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function rnn$1(args) { - return new RNN(args); - } - /** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function stackedRNNCells(args) { - return new StackedRNNCells(args); - } - // Wrapper Layers. - /** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ - function bidirectional(args) { - return new Bidirectional(args); - } - /** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ - function timeDistributed(args) { - return new TimeDistributed(args); - } - // Aliases for pooling. - const globalMaxPool1d = globalMaxPooling1d; - const globalMaxPool2d = globalMaxPooling2d; - const maxPool1d = maxPooling1d; - const maxPool2d = maxPooling2d; - /** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function gaussianNoise(args) { - return new GaussianNoise(args); - } - /** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function gaussianDropout(args) { - return new GaussianDropout(args); - } - /** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function alphaDropout(args) { - return new AlphaDropout(args); - } - /** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ - function masking(args) { - return new Masking(args); - } - - var exports_layers = /*#__PURE__*/Object.freeze({ - __proto__: null, - inputLayer: inputLayer, - elu: elu$2, - reLU: reLU, - leakyReLU: leakyReLU, - prelu: prelu$1, - softmax: softmax$1, - thresholdedReLU: thresholdedReLU, - conv1d: conv1d$1, - conv2d: conv2d$1, - conv2dTranspose: conv2dTranspose$1, - conv3d: conv3d, - conv3dTranspose: conv3dTranspose, - separableConv2d: separableConv2d$1, - cropping2D: cropping2D, - upSampling2d: upSampling2d, - depthwiseConv2d: depthwiseConv2d$2, - activation: activation, - dense: dense, - dropout: dropout$1, - spatialDropout1d: spatialDropout1d, - flatten: flatten$2, - repeatVector: repeatVector, - reshape: reshape$1, - permute: permute, - embedding: embedding, - add: add$2, - average: average, - concatenate: concatenate$1, - maximum: maximum$1, - minimum: minimum$1, - multiply: multiply, - dot: dot$2, - batchNormalization: batchNormalization$1, - layerNormalization: layerNormalization, - zeroPadding2d: zeroPadding2d, - averagePooling1d: averagePooling1d, - avgPool1d: avgPool1d, - avgPooling1d: avgPooling1d, - averagePooling2d: averagePooling2d, - avgPool2d: avgPool2d, - avgPooling2d: avgPooling2d, - averagePooling3d: averagePooling3d, - avgPool3d: avgPool3d, - avgPooling3d: avgPooling3d, - globalAveragePooling1d: globalAveragePooling1d, - globalAveragePooling2d: globalAveragePooling2d, - globalMaxPooling1d: globalMaxPooling1d, - globalMaxPooling2d: globalMaxPooling2d, - maxPooling1d: maxPooling1d, - maxPooling2d: maxPooling2d, - maxPooling3d: maxPooling3d, - gru: gru, - gruCell: gruCell, - lstm: lstm, - lstmCell: lstmCell, - simpleRNN: simpleRNN, - simpleRNNCell: simpleRNNCell, - convLstm2d: convLstm2d, - convLstm2dCell: convLstm2dCell, - rnn: rnn$1, - stackedRNNCells: stackedRNNCells, - bidirectional: bidirectional, - timeDistributed: timeDistributed, - globalMaxPool1d: globalMaxPool1d, - globalMaxPool2d: globalMaxPool2d, - maxPool1d: maxPool1d, - maxPool2d: maxPool2d, - Layer: Layer, - RNN: RNN, - RNNCell: RNNCell, - input: input, - gaussianNoise: gaussianNoise, - gaussianDropout: gaussianDropout, - alphaDropout: alphaDropout, - masking: masking - }); - - /** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function binaryAccuracy$1(yTrue, yPred) { - return binaryAccuracy(yTrue, yPred); - } - /** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function binaryCrossentropy$2(yTrue, yPred) { - return binaryCrossentropy$1(yTrue, yPred); - } - /** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function sparseCategoricalAccuracy$1(yTrue, yPred) { - return sparseCategoricalAccuracy(yTrue, yPred); - } - /** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function categoricalAccuracy$1(yTrue, yPred) { - return categoricalAccuracy(yTrue, yPred); - } - /** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function categoricalCrossentropy$2(yTrue, yPred) { - return categoricalCrossentropy$1(yTrue, yPred); - } - /** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function precision$1(yTrue, yPred) { - return precision(yTrue, yPred); - } - /** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function recall$1(yTrue, yPred) { - return recall(yTrue, yPred); - } - /** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function cosineProximity$1(yTrue, yPred) { - return cosineProximity(yTrue, yPred); - } - /** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanAbsoluteError$1(yTrue, yPred) { - return meanAbsoluteError(yTrue, yPred); - } - /** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanAbsolutePercentageError$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - function MAPE$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - function mape$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - /** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanSquaredError$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - function MSE$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - function mse$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - - var exports_metrics = /*#__PURE__*/Object.freeze({ - __proto__: null, - binaryAccuracy: binaryAccuracy$1, - binaryCrossentropy: binaryCrossentropy$2, - sparseCategoricalAccuracy: sparseCategoricalAccuracy$1, - categoricalAccuracy: categoricalAccuracy$1, - categoricalCrossentropy: categoricalCrossentropy$2, - precision: precision$1, - recall: recall$1, - cosineProximity: cosineProximity$1, - meanAbsoluteError: meanAbsoluteError$1, - meanAbsolutePercentageError: meanAbsolutePercentageError$1, - MAPE: MAPE$1, - mape: mape$1, - meanSquaredError: meanSquaredError$1, - MSE: MSE$1, - mse: mse$1 - }); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - - var exports_models = /*#__PURE__*/Object.freeze({ - __proto__: null, - modelFromJSON: modelFromJSON - }); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l1l2(config) { - return new L1L2(config); - } - /** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l1$1(config) { - return l1(config); - } - /** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l2$1(config) { - return l2(config); - } - - var exports_regularizers = /*#__PURE__*/Object.freeze({ - __proto__: null, - l1l2: l1l2, - l1: l1$1, - l2: l2$1 - }); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - class Callback extends BaseCallback { - constructor() { - super(...arguments); - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - this.model = null; - } - setModel(model) { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - } - } - function less$1(currVal, prevVal) { - return currVal < prevVal; - } - function greater$1(currVal, prevVal) { - return currVal > prevVal; - } - /** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ - class EarlyStopping extends Callback { - constructor(args) { - super(); - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError('restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - this.monitor = args.monitor || 'val_loss'; - this.minDelta = Math.abs(args.minDelta || 0); - this.patience = args.patience || 0; - this.verbose = args.verbose || 0; - this.mode = args.mode || 'auto'; - this.baseline = args.baseline; - if (['auto', 'min', 'max'].indexOf(this.mode) === -1) { - console.warn(`EarlyStopping mode '${this.mode}' is invalid. ` + - `Falling back to mode 'auto'.`); - this.mode = 'auto'; - } - if (this.mode === 'min') { - this.monitorFunc = less$1; - } - else if (this.mode === 'max') { - this.monitorFunc = greater$1; - } - else { - // For mode === 'auto'. - if (this.monitor.indexOf('acc') !== -1) { - this.monitorFunc = greater$1; - } - else { - this.monitorFunc = less$1; - } - } - if (this.monitorFunc === less$1) { - this.minDelta *= -1; - } - } - async onTrainBegin(logs) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } - else { - this.best = this.monitorFunc === less$1 ? Infinity : -Infinity; - } - } - async onEpochEnd(epoch, logs) { - await resolveScalarsInLogs(logs); - const current = this.getMonitorValue(logs); - if (current == null) { - return; - } - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } - else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - } - async onTrainEnd(logs) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log(`Epoch ${this.stoppedEpoch}: early stopping.`); - } - } - getMonitorValue(logs) { - if (logs == null) { - logs = {}; - } - const monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn(`Metric for EarlyStopping ${this.monitor} is not available. ` + - `Available metrics are: ${Object.keys(logs)}`); - } - return monitorValue; - } - } - /** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ - function earlyStopping(args) { - return new EarlyStopping(args); - } - const callbacks = { earlyStopping }; - - exports.Callback = Callback; - exports.CallbackList = CallbackList; - exports.CustomCallback = CustomCallback; - exports.EarlyStopping = EarlyStopping; - exports.History = History; - exports.InputSpec = InputSpec; - exports.LayerVariable = LayerVariable; - exports.LayersModel = LayersModel; - exports.RNN = RNN; - exports.Sequential = Sequential; - exports.SymbolicTensor = SymbolicTensor; - exports.callbacks = callbacks; - exports.constraints = exports_constraints; - exports.initializers = exports_initializers; - exports.input = input; - exports.layers = exports_layers; - exports.loadLayersModel = loadLayersModel; - exports.metrics = exports_metrics; - exports.model = model; - exports.models = exports_models; - exports.registerCallbackConstructor = registerCallbackConstructor; - exports.regularizers = exports_regularizers; - exports.sequential = sequential; - exports.version_layers = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-layers.es2017.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js.map deleted file mode 100644 index 26f9fe33b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.es2017.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/optimizers.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_models.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nexport {modelFromJSON} from './models';\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["base.flatten","base.checkConversionForErrors","util.now","util.rightPad","util.arraysEqual","util.sizeFromShape","util.decodeString","util.assert","util.isString","util.encodeString","util.bytesPerElement","util.makeZerosTypedArray","util.isFunction","add","util.isValidDtype","conv_util.eitherStridesOrDilationsAreOne","util.isInt","util.assertShapesMatch","isFinite","isNaN","ones","conv_util.computePool2DInfo","round","axis_util.expandShapeToKeepDim","broadcast_util.assertAndGetBroadcastShape","broadcast_util.getReductionAxes","conv_util.tupleValuesAreOne","util.parseAxisParam","axis_util.getUndoAxesPermutation","backend","assert","unique","util","tidy","tfc.sqrt","tfc.sum","tfc.mul","serialization","tfc.clipByValue","tfc.div","tfc.add","tfc.relu","tensor1d","min","tfc.min","max","tfc.max","cast","expandDims","tile","flatten","math_utils.arrayProd","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","tfc.randomNormal","dot","tfc.fused","gather","tfc.gather","square","elu","tfc.elu","tfc.abs","tfc.dropout","zeros","mul","scalar","randomUniform","K.randomNormal","truncatedNormal","Identity","eye","linalg","randomNormal","tfc.variable","generic_utils.toSnakeCase","generic_utils.singletonOrArray","generic_utils.toList","variable_utils.countParamsInWeights","types_utils.normalizeShapeList","dispose","div","keep","generic_utils.debounce","nextFrame","K.square","tfc.fill","tfc.maximum","tfc.mean","tfc.sub","tfc.log","tfc.softplus","tfc.softmax","tfc.neg","tfc.floor","K.flatten","tfc.oneHot","tfc.onesLike","K.cast","tfc.greater","tfc.equal","tfc.argMax","tfc.logicalAnd","tfc.where","binaryCrossentropy","lossBinaryCrossentropy","categoricalCrossentropy","categoricalCrossentropyLoss","sparseCategoricalCrossentropy","sparseCategoricalCrossentropyLoss","get","train","generic_utils.toCamelCase","memory","generic_utils.unique","generic_utils.assert","generic_utils.reverseNumberCompare","layersVersion","generic_utils.pyListRepeat","deserializeLayer","generic_utils.isObjectEmpty","tfc.util","tfc.Tensor","tfc.dispose","tfc.keep","tfc.tidy","Tensor","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","optimizers.getOptimizer","Optimizer","losses.get","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","Metrics.get","Metrics.getLossOrMetricName","K.sliceAlongFirstAxis","tfc.memory","io","Elu","K.elu","Selu","tfc.selu","Relu","Relu6","tfc.minimum","Sigmoid","tfc.sigmoid","K.hardSigmoid","Softplus","K.softsign","Tanh","tfc.tanh","Softmax","LogSoftmax","tfc.logSoftmax","sum","abs","relu","clipByValue","leakyRelu","prelu","softmaxActivation","tfc.transpose","tfc.conv1d","K.biasAdd","tfc.conv3d","generic_utils.assertPositiveInteger","generic_utils.checkArrayTypeAndLength","generic_utils.mapActivationToFusedKernel","Conv2D","Conv3D","tfc.conv2dTranspose","tfc.conv3dTranspose","tfc.separableConv2d","K.sliceAlongAxis","depthwiseConv2d","tfc.depthwiseConv2d","math_utils.range","tfc.expandDims","tfc.reverse","tfc.unstack","tfc.stack","tfc.zeros","K.expandDims","K.tile","math_utils.min","math_utils.max","K.dot","tfc.split","K.concatAlongFirstAxis","K.dropout","K.inTrainPhase","tfc.ones","K.concatenate","tfc.conv2d","tfc.serialization","K.batchFlatten","Activation","K.repeat","Reshape","transpose","any","notEqual","zerosLike","K.gather","mathUtils.max","mathUtils.arrayProd","mathUtils.range","Add","Multiply","Maximum","Minimum","tfc.all","greaterEqual","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","tfc.moments","moments","tfc.pad","tfc.maxPool","tfc.avgPool","tfc.maxPool3d","tfc.avgPool3d","tfc.squeeze","generic_utils.checkStringTypeUnionValue","softmax","conv1d","conv2d","conv2dTranspose","separableConv2d","dropout","reshape","concatenate","maximum","minimum","batchNormalization","rnn","binaryAccuracy","metrics.binaryAccuracy","metrics.binaryCrossentropy","sparseCategoricalAccuracy","metrics.sparseCategoricalAccuracy","categoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","precision","metrics.precision","recall","metrics.recall","cosineProximity","losses.cosineProximity","meanAbsoluteError","losses.meanAbsoluteError","meanAbsolutePercentageError","losses.meanAbsolutePercentageError","MAPE","mape","meanSquaredError","MSE","mse","l1","regularizers.l1","l2","regularizers.l2","less","greater"],"mappings":";;;;;;;;;;;;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C,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IACM,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;ICrC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAKA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAAS,MAAM,CAAC,CAAC,EAAE;IACnB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IACM,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;;ICtCnC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IA+PA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAAS,UAAU,CAAC,CAAC,EAAE;IACvB,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC;;ICxTA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAKA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAAS,IAAI,CAAC,CAAC,EAAE;IACjB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC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CAAC,CAAC;aACpD;YACD,OAAO,YAAY,CAAC;SACrB;KACF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2CgB,aAAa,CAAC,IAAgC;QAC5D,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;UAEY,SAAS,GAAG,EAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js deleted file mode 100644 index b9bb9f5b4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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)}(this,(function(t,e){"use strict";function n(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function s(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function i(t,e=[],n=!1){if(null==e&&(e=[]),Array.isArray(t)||h(t)&&!n)for(let s=0;se)):[].concat(t)).every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),s(t.every((t=>o(t))),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function h(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function c(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error(`Unknown dtype ${t}`)}function p(t){return"string"==typeof t||t instanceof String}function d(t){return Array.isArray(t)?d(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":"number"==typeof t?"float32":p(t)?"string":function(t){return"boolean"==typeof t}(t)?"bool":"float32"}function f(t){return!!(t&&t.constructor&&t.call&&t.apply)}function g(t){const e=t.length;if(e<2)return[];const n=new Array(e-1);n[e-2]=t[e-1];for(let s=e-3;s>=0;--s)n[s]=n[s+1]*t[s+1];return n}function m(t,e,n,s=!1){const i=new Array;if(1===e.length){const r=e[0]*(s?2:1);for(let e=0;et*e))*(s?2:1);for(let e=0;et*e))*(n?2:1);if(0===s)return[];if(s!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return m(0,t,e,n)}function b(t,e){const n=w(t,e);for(let t=0;t{const[e,n]=t.split(":");this.urlFlags[e]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}(e,n)}))}}}function S(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((t,...n)=>(function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(e,n[0],n[1]),n.join("=")))),e}function I(){return z}let N,z=null;function A(){if(null==N){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof global)t=global;else if("undefined"!=typeof process)t=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}N=t}return N}function C(t,e){const n=function(){const t=A();return null==t._tfGlobals&&(t._tfGlobals=new Map),t._tfGlobals}();if(n.has(t))return n.get(t);{const s=e();return n.set(t,s),n.get(t)}}const $="Acos",D="Acosh",T="Add",E="ArgMax",F="ArgMin",L="Asin",_="Asinh",R="Atan",M="Atanh",O="Atan2",B="AvgPool",W="BatchMatMul",P="BatchToSpaceND",U="Cast",K="Ceil",V="ClipByValue",j="ComplexAbs",q="Concat",G="Conv2D",H="Conv2DBackpropInput",J="Cosh",Z="Cumsum",X="DepthwiseConv2dNative",Y="Dilation2D",Q="RealDiv",tt="ExpandDims",et="Expm1",nt="Floor",st="FloorDiv",it="FusedBatchNorm",rt="GatherV2",at="GreaterEqual",ot="Identity",lt="IsFinite",ut="IsInf",ht="IsNan",ct="LeakyRelu",pt="Log1p",dt="Maximum",ft="MaxPool",gt="Mean",mt="Minimum",yt="MirrorPad",bt="Multiply",wt="OnesLike",kt="OneHot",xt="Pack",vt="PadV2",St="Prelu",It="Reciprocal",Nt="Relu",zt="Reshape",At="ResizeNearestNeighbor",Ct="ResizeBilinear",$t="Relu6",Dt="Reverse",Tt="Round",Et="Rsqrt",Ft="Select",Lt="Selu",_t="Slice",Rt="Sinh",Mt="Sign",Ot="Sigmoid",Bt="Softplus",Wt="Sqrt",Pt="SpaceToBatchND",Ut="SplitV",Kt="Softmax",Vt="SquaredDifference",jt="Tanh",qt="Tile",Gt="Transpose",Ht="Unpack",Jt="UnsortedSegmentSum",Zt="ZerosLike",Xt="Step",Yt=C("kernelRegistry",(()=>new Map)),Qt=C("gradRegistry",(()=>new Map));function te(t,e){const n=function(t,e){return`${e}_${t}`}(t,e);return Yt.get(n)}function ee(t){return Qt.get(t)}function ne(t){const e=Yt.entries(),n=[];for(;;){const{done:s,value:i}=e.next();if(s)break;const[r,a]=i,[o]=r.split("_");o===t&&n.push(a)}return n}function se(t){const{kernelName:e}=t;Qt.has(e)&&I().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${e}'`),Qt.set(e,t)}function ie(t,e){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=i(t)),I().getBool("DEBUG")&&function(t,e){for(let n=0;n{s=n()};let r;const a=re();if(this.backendTimer.timerAvailable())r=this.backendTimer.time(i);else{i();for(const t of s)t.dataSync();r=Promise.resolve({kernelMs:re()-a})}if(I().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let e=0;e{le(e,n.dtype,t)}))}return{kernelName:t,outputs:s,inputs:e,timeMs:r.then((t=>t.kernelMs)),extraInfo:r.then((t=>null!=t.getExtraProfileInfo?t.getExtraProfileInfo():""))}}logKernelProfile(t){const{kernelName:e,outputs:n,timeMs:s,inputs:i,extraInfo:r}=t;n.forEach((t=>{Promise.all([t.data(),s,r]).then((n=>{this.logger.logKernelProfile(e,t,n[0],n[1],i,n[2])}))}))}}function le(t,e,n){if("float32"!==e)return!1;for(let e=0;e0?s:""} `}}console.log(`%c${o}\t%c${a}\t%c${u}D ${c}\t%c${h}\t%c${p}\t%c${r}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function he(t,e,n,s){const i=g(e),a=function(t,e,n,s){const i=r(e),a=s[s.length-1],o=new Array(a).fill(0),l=e.length,u="complex64"===n?fe(t):t;if(l>1)for(let t=0;t" "+t)).join("\n")),u.join("\n")}function ce(t,e,n){let s;return s=Array.isArray(t)?`${parseFloat(t[0].toFixed(7))} + ${parseFloat(t[1].toFixed(7))}j`:p(t)?`'${t}'`:"bool"===n?pe(t):parseFloat(t.toFixed(7)).toString(),l(s,e)}function pe(t){return 0===t?"false":"true"}function de(t,e,n,s,i,r=!0){const a="complex64"===n?2:1,o=e[0],l=e.length;if(0===l){if("complex64"===n){return[ce(fe(t)[0],0,n)]}return"bool"===n?[pe(t[0])]:[t[0].toString()]}if(1===l){if(o>20){const e=3*a;let s=Array.from(t.slice(0,e)),r=Array.from(t.slice((o-3)*a,o*a));return"complex64"===n&&(s=fe(s),r=fe(r)),["["+s.map(((t,e)=>ce(t,i[e],n))).join(", ")+", ..., "+r.map(((t,e)=>ce(t,i[o-3+e],n))).join(", ")+"]"]}return["["+("complex64"===n?fe(t):Array.from(t)).map(((t,e)=>ce(t,i[e],n))).join(", ")+"]"]}const u=e.slice(1),h=s.slice(1),c=s[0]*a,p=[];if(o>20){for(let e=0;e<3;e++){const s=e*c,r=s+c;p.push(...de(t.slice(s,r),u,n,h,i,!1))}p.push("...");for(let e=o-3;eae(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataSync(){this.throwIfDisposed();const t=ge().readSync(this.dataId);if("string"===this.dtype)try{return t.map((t=>ae(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();const t=await ge().read(this.dataId);return"string"===this.dtype?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(ge().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return me.print(this,t)}clone(){return this.throwIfDisposed(),me.clone(this)}toString(t=!1){return he(this.dataSync(),this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),me.cast(this,t)}variable(t=!0,e,n){return this.throwIfDisposed(),ge().makeVariable(this,t,e,n)}}function be(){return C("Tensor",(()=>ye))}Object.defineProperty(ye,Symbol.hasInstance,{value:t=>!!t&&null!=t.data&&null!=t.dataSync&&null!=t.throwIfDisposed}),be();class we extends ye{constructor(t,e,n,s){super(t.shape,t.dtype,t.dataId,s),this.trainable=e,this.name=n}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!a(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);ge().disposeTensor(this),this.dataId=t.dataId,ge().incRef(this,null)}dispose(){ge().disposeVariable(this),this.isDisposedInternal=!0}}var ke,xe,ve,Se,Ie;Object.defineProperty(we,Symbol.hasInstance,{value:t=>t instanceof ye&&null!=t.assign&&t.assign instanceof Function}),function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(ke||(ke={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(xe||(xe={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(ve||(ve={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(Se||(Se={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(Ie||(Ie={}));const Ne={float32:Se,int32:xe,bool:ve,complex64:Ie};function ze(t,e){if(t.dtype===e.dtype)return[t,e];const n=function(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return Ne[t][e]}(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function Ae(t){const e=[];return Ce(t,e,new Set),e}function Ce(t,e,n){if(null==t)return;if(t instanceof ye)return void e.push(t);if(s=t,!Array.isArray(s)&&"object"!=typeof s)return;var s;const i=t;for(const t in i){const s=i[t];n.has(s)||(n.add(s),Ce(s,e,n))}}function $e(t){return null!=t.kernelName}class De{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((t=>t.name))))}}}dispose(){for(const t in this.registeredVariables)this.registeredVariables[t].dispose()}}class Te{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new De}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const t=this.getSortedBackends();for(let e=0;e{null!=t.setupFunc&&t.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(t){ne(t).forEach((e=>{null!=e.disposeFunc&&e.disposeFunc(this.registry[t])}))}initializeBackend(t){const e=this.registryFactory[t];if(null==e)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{const s=e.factory();if(!s||s instanceof class{refCount(t){return n("refCount")}incRef(t){return n("incRef")}timerAvailable(){return!0}time(t){return n("time")}read(t){return n("read")}readSync(t){return n("readSync")}numDataIds(){return n("numDataIds")}disposeData(t,e){return n("disposeData")}write(t,e,s){return n("write")}move(t,e,s,i,r){return n("move")}memory(){return n("memory")}floatPrecision(){return n("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return n("dispose")}}||"function"!=typeof s.then)return this.registry[t]=s,{success:!0,asyncInit:!1};{const e=++this.pendingBackendInitId,n=s.then((n=>!(e(ethis.registryFactory[e].priority-this.registryFactory[t].priority))}initializeBackendsAndReturnBest(){const t=this.getSortedBackends();for(let e=0;ethis.startScope(s)),(()=>this.endScope(n)),(()=>(n=e(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(t,e,n){t();try{const t=n();return e(),t}catch(t){throw e(),t}}nextTensorId(){return Te.nextTensorId++}nextVariableId(){return Te.nextVariableId++}clone(t){const e=Ee.runKernel(ot,{x:t}),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],(t=>({x:()=>{const e={x:t},n={dtype:"float32"};return Ee.runKernel(U,e,n)}})),[],{}),e}runKernel(t,e,n){if(!(null!=te(t,this.backendName)))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,n){const s=this.backend.numDataIds();let i=0;n.forEach((t=>{i+="complex64"===t.dtype?3:1}));const r=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-e-i-r;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${t}'`)}runKernelFunc(t){let e,n=[];const i=this.isTapeOn(),r=this.state.numBytes,a=this.state.numTensors;let o,l;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const u=$e(t)?t.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if($e(t)){const{kernelName:e,inputs:r,attrs:a}=t;null==this.backendName&&this.backend;const u=te(e,this.backendName);s(null!=u,(()=>`Cannot find registered kernel '${e}' for backend '${this.backendName}'`)),o=()=>{const t=this.backend.numDataIds();l=u.kernelFunc({inputs:r,attrs:a,backend:this.backend});const s=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(e,t,s);const o=s.map((t=>{if(null!=t.rank)return t;const{dataId:e,shape:n,dtype:s}=t;return this.makeTensorFromDataId(e,n,s)}));if(i){const t=this.getTensorsForGradient(e,r,o);n=this.saveTensorsForBackwardMode(t)}return o}}else{const{forwardFunc:e}=t,s=t=>{i&&(n=t.map((t=>this.keep(this.clone(t)))))};o=()=>{const t=this.backend.numDataIds();l=this.tidy((()=>e(this.backend,s)));const n=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,t,n),n}}const{inputs:h,attrs:c}=t,p=$e(t)?null:t.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(u,h,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),e=d.outputs):e=o()})),i&&this.addTapeNode(u,h,e,p,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(h).map((t=>null!=h[t]?h[t].shape:null)),outputShapes:e.map((t=>t.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(l)?e:e[0]}saveTensorsForBackwardMode(t){return t.map((t=>this.keep(this.clone(t))))}getTensorsForGradient(t,e,n){const i=ee(t);if(null!=i){const t=i.inputsToSave||[],r=i.outputsToSave||[];let a;i.saveAllInputs?(s(Array.isArray(e),(()=>"saveAllInputs is true, expected inputs to be an array.")),a=Object.keys(e).map((t=>e[t]))):a=t.map((t=>e[t]));const o=n.filter(((t,e)=>r[e]));return a.concat(o)}return[]}makeTensor(t,e,n,s){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let i=t;"string"===n&&p(t[0])&&(i=t.map((t=>function(t,e="utf-8"){return e=e||"utf-8",I().platform.encode(t,e)}(t))));const r=s.write(i,e,n),a=new ye(e,n,r,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const t=this.state.tensorInfo.get(r),e=function(t){if(null==t)return 0;let e=0;return t.forEach((t=>e+=t.length)),e}(i);this.state.numBytes+=e-t.bytes,t.bytes=e}return a}makeTensorFromDataId(t,e,n,s){const i=new ye(e,n=n||"float32",t,this.nextTensorId());return this.trackTensor(i,s),i}makeVariable(t,e=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==t.dtype&&(t=t.cast(s));const i=new we(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(t,e){this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(n=t.size*c(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof we||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;const e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,"string"===t.dtype&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),"complex64"!==t.dtype&&"string"!==t.dtype){const e=t.size*c(t.dtype);this.state.numBytes-=e}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(const t in this.state.registeredVariables){const e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]}memory(){const t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;const e=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((t=>t.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const t of this.state.activeProfile.kernels)t.kernelTimeMs=await t.kernelTimeMs,t.extraInfo=await t.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(t,e,n,s,i,r){const a={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},o=ee(t);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=t=>(t=t.map(((t,e)=>{if(null==t){const t=n[e],s=w(t.size,t.dtype);return this.makeTensor(s,t.shape,t.dtype)}return t})),s(t.length>1?t:t[0],i,r))),this.state.activeTape.push(a)}keep(t){return t.kept=!0,t}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){const e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){const e=Ae(t),n=new Set(e.map((t=>t.id)));for(let t=0;t{t.kept||t.scopeId!==s.id||this.track(t)}))}gradients(t,e,n,i=!1){if(s(e.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const o=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",t)));s(o instanceof ye,(()=>"The result y returned by f() must be a tensor."));const l=function(t,e,n){const s={},i={};for(let t=0;ts[t.id]=!0)),o=!0,i[r.id]=!0;break}if(o)break}}const r={};r[n.id]=!0;const a={};for(let e=t.length-1;e>=0;e--){const n=t[e],s=n.inputs;for(let t=0;t0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const t={};t[o.id]=null==n?function(t){const e=b(r(t),"float32");return Ee.makeTensor(e,t,"float32")}(o.shape):n,function(t,e,n,s){for(let i=e.length-1;i>=0;i--){const r=e[i],o=[];if(r.outputs.forEach((e=>{const n=t[e.id];null!=n?o.push(n):o.push(null)})),null==r.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${r.kernelName}.`);const l=r.gradient(o);for(const e in r.inputs){if(!(e in l))throw new Error(`Cannot backprop through input ${e}. Available gradients found: ${Object.keys(l)}.`);const i=n((()=>l[e]()));if("float32"!==i.dtype)throw new Error(`Error in gradient for op ${r.kernelName}. The gradient of input ${e} must have 'float32' dtype, but has '${i.dtype}'`);const o=r.inputs[e];if(!a(i.shape,o.shape))throw new Error(`Error in gradient for op ${r.kernelName}. The gradient of input '${e}' has shape '${i.shape}', which does not match the shape of the input '${o.shape}'`);if(null==t[o.id])t[o.id]=i;else{const e=t[o.id];t[o.id]=s(e,i),e.dispose()}}}}(t,l,(t=>this.tidy(t)),Fe);const s=e.map((e=>t[e.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((t=>{for(const e of t.saved)e.dispose()})),this.state.activeTape=null),{value:o,grads:s}}))}customGrad(t){return s(f(t),(()=>"The f passed in customGrad(f) must be a function.")),(...e)=>{let n;s(e.every((t=>t instanceof ye)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const i={};e.forEach(((t,e)=>{i[e]=t}));return this.runKernelFunc({forwardFunc:(i,r)=>(n=t(...e,r),s(n.value instanceof ye,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),s(f(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(t,i)=>{const r=n.gradFunc(t,i),a=Array.isArray(r)?r:[r];s(a.length===e.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),s(a.every((t=>t instanceof ye)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return a.forEach(((t,e)=>{o[e]=()=>t})),o},inputs:i})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}async time(t){const e=re(),n=await this.backend.time(t);return n.wallMs=re()-e,n}track(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new De;for(const t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Te.nextTensorId=0,Te.nextVariableId=0;const Ee=function(){const t=A();if(null==t._tfengine){const e=new v(t);t._tfengine=new Te(e)}var e;return e=t._tfengine.ENV,z=e,ge=()=>t._tfengine,t._tfengine}();function Fe(t,e){const n={a:t,b:e};return Ee.runKernel(T,n)}function Le(t,e){let n=t;if(h(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];const s=[];for(;Array.isArray(n)||h(n)&&"string"!==e;)s.push(n.length),n=n[0];return Array.isArray(t)&&I().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&_e(t,s,[]),s}function _e(t,e,n){if(n=n||[],!Array.isArray(t)&&!h(t))return void s(0===e.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`));s(e.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`)),s(t.length===e[0],(()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`));const i=e.slice(1);for(let e=0;e=0&&(r=s),Re(s,r,e,n),null==t||!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){const s=null==t?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const a=Le(t,r);h(t)||Array.isArray(t)||(t=[t]);const o="string"!==r?ie(t,r):i(t,[],!0);return Ee.makeTensor(o,a,r)}function Oe(t,e,n,s="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map(((t,i)=>Me(t,`${e}[${i}]`,n,s)))}function Be(t){const e=Object.keys(t);if(1!==e.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const s=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const i=(...t)=>{Ee.startScope(n);try{const e=s(...t);return k(e)&&console.error("Cannot return a Promise inside of tidy."),Ee.endScope(e),e}catch(t){throw Ee.endScope(null),t}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}const We=Be({abs_:function(t){const e=Me(t,"x","abs");if("complex64"===e.dtype){const t={x:e};return Ee.runKernel(j,t)}{const t={x:e};return Ee.runKernel("Abs",t)}}});const Pe=Be({acos_:function(t){const e={x:Me(t,"x","acos")};return Ee.runKernel($,e)}});const Ue=Be({acosh_:function(t){const e={x:Me(t,"x","acosh")};return Ee.runKernel(D,e)}});const Ke=Be({add_:function(t,e){let n=Me(t,"a","add"),s=Me(e,"b","add");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel(T,i)}});const Ve=Be({all_:function(t,e=null,n=!1){const s={x:Me(t,"x","all","bool")},i={axis:e,keepDims:n};return Ee.runKernel("All",s,i)}});const je=Be({any_:function(t,e=null,n=!1){const s={x:Me(t,"x","any","bool")},i={axis:e,keepDims:n};return Ee.runKernel("Any",s,i)}});const qe=Be({argMax_:function(t,e=0){const n={x:Me(t,"x","argMax")},s={axis:e};return Ee.runKernel(E,n,s)}});const Ge=Be({argMin_:function(t,e=0){const n={x:Me(t,"x","argMin")},s={axis:e};return Ee.runKernel(F,n,s)}});const He=Be({asin_:function(t){const e={x:Me(t,"x","asin")};return Ee.runKernel(L,e)}});const Je=Be({asinh_:function(t){const e={x:Me(t,"x","asinh")};return Ee.runKernel(_,e)}});const Ze=Be({atan_:function(t){const e={x:Me(t,"x","atan")};return Ee.runKernel(R,e)}});const Xe=Be({atan2_:function(t,e){let n=Me(t,"a","atan2"),s=Me(e,"b","atan2");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel(O,i)}});const Ye=Be({atanh_:function(t){const e={x:Me(t,"x","atanh")};return Ee.runKernel(M,e)}});const Qe=Be({cast_:function(t,e){const n=Me(t,"x","cast");if(!function(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},i={dtype:e};return Ee.runKernel(U,s,i)}});function tn(t,e,n,s,i,r,a="channelsLast"){const[o,l]=en(e);let u;if("channelsLast"===a)u=[o,l,t[3],t[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[o,l,t[1],t[1]]}return function(t,e,n,s,i,r,a=!1,o="channelsLast"){let[l,u,h,c]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,h,c]=t;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,c,u,h]=t}const[p,d,,f]=e,[g,m]=en(n),[y,b]=en(s),w=nn(p,y),k=nn(d,b),{padInfo:x,outHeight:v,outWidth:S}=function(t,e,n,s,i,r,a,o,l){let u,h,c;if("number"==typeof t){u={top:t,bottom:t,left:t,right:t,type:0===t?"VALID":"NUMBER"};const i=function(t,e,n,s,i){null==s&&(s=function(t,e,n,s=1){const i=nn(e,s);return Math.floor((t[0]*(n-1)-n+i)/2)}(t,e,n));const r=t[0],a=t[1],o=sn((r-e+2*s)/n+1,i),l=sn((a-e+2*s)/n+1,i);return[o,l]}([e,n],r,s,t,o);h=i[0],c=i[1]}else if("same"===t){h=Math.ceil(e/s),c=Math.ceil(n/i);const t=Math.max(0,(h-1)*s+r-e),o=Math.max(0,(c-1)*i+a-n),l=Math.floor(t/2),p=t-l,d=Math.floor(o/2);u={top:l,bottom:p,left:d,right:o-d,type:"SAME"}}else if("valid"===t)u={top:0,bottom:0,left:0,right:0,type:"VALID"},h=Math.ceil((e-r+1)/s),c=Math.ceil((n-a+1)/i);else{if("object"!=typeof t)throw Error(`Unknown padding parameter: ${t}`);{const p="channelsLast"===l?t[1][0]:t[2][0],d="channelsLast"===l?t[1][1]:t[2][1],f="channelsLast"===l?t[2][0]:t[3][0],g="channelsLast"===l?t[2][1]:t[3][1];u={top:p,bottom:d,left:f,right:g,type:0===p&&0===d&&0===f&&0===g?"VALID":"EXPLICIT"},h=sn((e-r+p+d)/s+1,o),c=sn((n-a+f+g)/i+1,o)}}return{padInfo:u,outHeight:h,outWidth:c}}(i,u,h,g,m,w,k,r,o),I=a?f*c:f;let N;"channelsFirst"===o?N=[l,I,v,S]:"channelsLast"===o&&(N=[l,v,S,I]);return{batchSize:l,dataFormat:o,inHeight:u,inWidth:h,inChannels:c,outHeight:v,outWidth:S,outChannels:I,padInfo:x,strideHeight:g,strideWidth:m,filterHeight:p,filterWidth:d,effectiveFilterHeight:w,effectiveFilterWidth:k,dilationHeight:y,dilationWidth:b,inShape:t,outShape:N,filterShape:e}}(t,u,n,s,i,r,!1,a)}function en(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function nn(t,e){return e<=1?t:t+(t-1)*(e-1)}function sn(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function rn(t){const[e,n,s]=en(t);return 1===e&&1===n&&1===s}function an(t,e){return rn(t)||rn(e)}const on=Be({reshape_:function(t,e){const n={x:Me(t,"x","reshape","string_or_numeric")},s={shape:e};return Ee.runKernel(zt,n,s)}});const ln=Be({avgPool_:function(t,e,n,i,r){const a=Me(t,"x","avgPool","float32");s(an(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let l=a,u=!1;3===a.rank&&(u=!0,l=on(a,[1,a.shape[0],a.shape[1],a.shape[2]])),s(4===l.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${l.rank}.`)),null!=r&&s(o(i),(()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${i}.`));const h={x:l},c={filterSize:e,strides:n,pad:i,dimRoundingMode:r};let p=Ee.runKernel(B,h,c);return p=Qe(p,a.dtype),u?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const un=Be({clone_:function(t){const e={x:Me(t,"x","clone","string_or_numeric")};return Ee.runKernel(ot,e)}});const hn=Be({concat_:function(t,e=0){s(t.length>=1,(()=>"Pass at least one tensor to concat"));const n=Oe(t,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((t=>{if("complex64"!==t.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${t.dtype}. `)})),1===n.length)return un(n[0]);const i=n,r={axis:e};return Ee.runKernel(q,i,r)}});const cn=Be({matMul_:function(t,e,n=!1,s=!1){let i=Me(t,"a","matMul"),r=Me(e,"b","matMul");[i,r]=ze(i,r);const a={a:i,b:r},o={transposeA:n,transposeB:s};return Ee.runKernel(W,a,o)}});const pn=Be({mul_:function(t,e){let n=Me(t,"a","mul"),s=Me(e,"b","mul");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel(bt,i)}});const dn=Be({sigmoid_:function(t){const e={x:Me(t,"x","sigmoid")};return Ee.runKernel(Ot,e)}});const fn=Be({slice_:function(t,e,n){const s=Me(t,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const i={x:s},r={begin:e,size:n};return Ee.runKernel(_t,i,r)}});const gn=Be({tanh_:function(t){const e={x:Me(t,"x","tanh")};return Ee.runKernel(jt,e)}});const mn=Be({batchToSpaceND_:function(t,e,n){const i=Me(t,"x","batchToSpaceND"),r=e.reduce(((t,e)=>t*e));s(i.rank>=1+e.length,(()=>`input rank is ${i.rank} but should be > than blockShape.length ${e.length}`)),s(n.length===e.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`)),s(i.shape[0]%r==0,(()=>`input tensor batch is ${i.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${r}`));const a={x:i},o={blockShape:e,crops:n};return Ee.runKernel(P,a,o)}});const yn=Be({batchNorm_:function(t,e,n,i,r,a){null==a&&(a=.001);const o=Me(t,"x","batchNorm"),l=Me(e,"mean","batchNorm"),u=Me(n,"variance","batchNorm");let h,c;null!=r&&(h=Me(r,"scale","batchNorm")),null!=i&&(c=Me(i,"offset","batchNorm")),s(l.rank===u.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),s(null==c||l.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),s(null==h||l.rank===h.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const p={x:function(t){let e;return e=0===t.rank||1===t.rank?on(t,[1,1,1,t.size]):2===t.rank?on(t,[1,1,t.shape[0],t.shape[1]]):3===t.rank?on(t,[1,t.shape[0],t.shape[1],t.shape[2]]):t,e}(o),scale:h,offset:c,mean:l,variance:u},d={varianceEpsilon:a},f=Ee.runKernel(it,p,d);return on(f,o.shape)}});const bn=Be({broadcastTo_:function(t,e){let n=Me(t,"broadcastTo","x");const s=n.shape;if(e.some((t=>!(t>0)||t%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const t=n.shape.slice();for(;t.length=0;t--)if(i[t]===e[t])r[t]=1;else if(1!==n.shape[t])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${e}].`);if(0===r.map(((t,e)=>t>1?e:-1)).filter((t=>t>=0)).length)return un(n);const a={x:n},o={reps:r};return Ee.runKernel(qt,a,o)}});const wn=Be({ceil_:function(t){const e={x:Me(t,"x","ceil")};return Ee.runKernel(K,e)}});const kn=Be({clipByValue_:function(t,e,n){const i=Me(t,"x","clipByValue");s(e<=n,(()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`));const r={x:i},a={clipValueMin:e,clipValueMax:n};return Ee.runKernel(V,r,a)}});const xn=Be({complex_:function(t,e){const n=Me(t,"real","complex"),i=Me(e,"imag","complex");!function(t,e,n=""){s(a(t,e),(()=>n+` Shapes ${t} and ${e} must match`))}(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const r={real:n,imag:i};return Ee.runKernel("Complex",r)}});const vn=Be({conv2d_:function(t,e,n,i,r="NHWC",a=[1,1],l){const u=Me(t,"x","conv2d"),h=Me(e,"filter","conv2d");let c=u,p=!1;3===u.rank&&(p=!0,c=on(u,[1,u.shape[0],u.shape[1],u.shape[2]])),s(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),s(4===h.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`)),null!=l&&s(o(i),(()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${l} but got pad ${i}.`));const d="NHWC"===r?c.shape[3]:c.shape[1];s(d===h.shape[2],(()=>`Error in conv2d: depth of input (${d}) must match input depth for filter ${h.shape[2]}.`)),s(an(n,a),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`));const f={x:c,filter:h},g={strides:n,pad:i,dataFormat:r,dilations:a,dimRoundingMode:l},m=Ee.runKernel(G,f,g);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Sn=Be({conv1d_:function(t,e,n,i,r="NWC",a=1,l){const u=Me(t,"x","conv1d"),h=Me(e,"filter","conv1d");let c=u,p=!1;2===u.rank&&(p=!0,c=on(u,[1,u.shape[0],u.shape[1]])),s(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),s(3===h.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${h.rank}.`)),null!=l&&s(o(i),(()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${l} but got pad ${i}.`)),s(c.shape[2]===h.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${h.shape[1]}.`)),s(an(n,a),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${a}'`)),s("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const d=on(h,[1,h.shape[0],h.shape[1],h.shape[2]]),f=on(c,[c.shape[0],1,c.shape[1],c.shape[2]]),g=vn(f,d,[1,n],i,"NHWC",[1,a],l);return on(g,p?[g.shape[2],g.shape[3]]:[g.shape[0],g.shape[2],g.shape[3]])}});const In=Be({conv2DBackpropInput_:function(t,e,n,i,r,a="NHWC",l){s(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let u=t,h=e,c=!1;3===e.rank&&(c=!0,h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]),u=[1,t[0],t[1],t[2]]),s(4===u.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${u.length}.`)),s(4===h.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${h.rank}`)),s(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const p="NHWC"===a?u[3]:u[1],d="NHWC"===a?h.shape[3]:h.shape[1];s(p===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${n.shape[2]}.`)),s(d===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[3]}.`)),null!=l&&s(o(r),(()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${l} but got pad ${r}.`));const f={dy:h,filter:n},g={strides:i,pad:r,dataFormat:a,dimRoundingMode:l,inputShape:u},m=Ee.runKernel(H,f,g);return c?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Nn=Be({conv2dTranspose_:function(t,e,n,s,i,r){const a=Me(t,"x","conv2dTranspose"),o=Me(e,"filter","conv2dTranspose");return In(n,a,o,s,i,"NHWC",r)}});const zn=Be({conv3DBackpropInput_:function(t,e,n,i,r){s(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let a=t,o=e,l=!1;4===e.rank&&(l=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),a=[1,t[0],t[1],t[2],t[3]]);const u=a[4],h=o.shape[4];s(5===a.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${a.length}.`)),s(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),s(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),s(u===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[3]}.`)),s(h===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[4]}.`));const c={dy:o,filter:n},p={pad:r,strides:i,inputShape:a},d=Ee.runKernel("Conv3DBackpropInputV2",c,p);return l?on(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const An=Be({cos_:function(t){const e={x:Me(t,"x","cos")};return Ee.runKernel("Cos",e)}});const Cn=Be({cosh_:function(t){const e={x:Me(t,"x","cosh")};return Ee.runKernel(J,e)}});const $n=Be({cumsum_:function(t,e=0,n=!1,s=!1){const i={x:Me(t,"x","cumsum")},r={axis:e,exclusive:n,reverse:s};return Ee.runKernel(Z,i,r)}});const Dn=Be({depthToSpace_:function(t,e,n="NHWC"){const i=Me(t,"x","depthToSpace"),r="NHWC"===n?i.shape[1]:i.shape[2],a="NHWC"===n?i.shape[2]:i.shape[3],o="NHWC"===n?i.shape[3]:i.shape[1];s(r*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${e} for depthToSpace with input shape\n ${i.shape}`)),s(a*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${e} for depthToSpace with input shape\n ${i.shape}`)),s(o%(e*e)==0,(()=>`Dimension size must be evenly divisible by ${e*e} but is ${o} for depthToSpace with input shape ${i.shape}`));const l={x:i},u={blockSize:e,dataFormat:n};return Ee.runKernel("DepthToSpace",l,u)}});const Tn=Be({depthwiseConv2d_:function(t,e,n,i,r="NHWC",a=[1,1],l){const u=Me(t,"x","depthwiseConv2d"),h=Me(e,"filter","depthwiseConv2d");let c=u,p=!1;3===u.rank&&(p=!0,c=on(u,[1,u.shape[0],u.shape[1],u.shape[2]])),s(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),s(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`)),s(c.shape[3]===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${h.shape[2]}.`)),null!=l&&s(o(i),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${l} but got pad ${i}.`));const d={x:c,filter:h},f={strides:n,pad:i,dataFormat:r,dilations:a,dimRoundingMode:l},g=Ee.runKernel(X,d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3]]):g}});const En=Be({dilation2d_:function(t,e,n,i,r=[1,1],a="NHWC"){const o=Me(t,"x","dilation2d"),l=Me(e,"filter","dilation2d");s(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),s(3===l.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${l.rank}.`)),s("NHWC"===a,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${a}`));let u=o,h=!1;3===o.rank&&(u=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),h=!0);const c={x:u,filter:l},p={strides:n,pad:i,dilations:r},d=Ee.runKernel(Y,c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Fn=Be({floorDiv_:function(t,e){let n=Me(t,"a","floorDiv"),s=Me(e,"b","floorDiv");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel(st,i)}});const Ln=Be({div_:function(t,e){let n=Me(t,"a","div"),s=Me(e,"b","div");if([n,s]=ze(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Fn(n,s);const i={a:n,b:s};return Ee.runKernel(Q,i,{})}});function _n(t,e){const n=[];for(let s=0;s1)&&n.unshift(r)}return n}function Rn(t,e){const n=[],s=Math.max(t.length,e.length);for(let i=0;i`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${i.rank}.`));const r=1===n.rank?n.size:n.shape[1],a=1===i.rank?i.size:i.shape[0];if(s(r===a,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${a}.`)),1===n.rank&&1===i.rank){const t=on(n,[1,-1]),e=on(i,[-1,1]),s=cn(t,e);return on(s,[])}if(1===n.rank&&2===i.rank){const t=on(n,[1,-1]),e=on(i,[i.shape[0],i.shape[1]]),s=cn(t,e);return on(s,[s.size])}if(2===n.rank&&1===i.rank){const t=on(i,[-1,1]),e=cn(n,t);return on(e,[e.size])}{const t=on(i,[i.shape[0],i.shape[1]]);return cn(n,t)}}});const Un=Be({elu_:function(t){const e={x:Me(t,"x","elu")};return Ee.runKernel("Elu",e)}});const Kn=Be({erf_:function(t){let e=Me(t,"x","erf");s("int32"===e.dtype||"float32"===e.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===e.dtype&&(e=Qe(e,"float32"));const n={x:e};return Ee.runKernel("Erf",n)}});const Vn=Be({exp_:function(t){const e={x:Me(t,"x","exp")};return Ee.runKernel("Exp",e)}});const jn=Be({expandDims_:function(t,e=0){const n=Me(t,"x","expandDims","string_or_numeric");s(e<=n.rank,(()=>"Axis must be <= rank of the tensor"));const i={input:n},r={dim:e};return Ee.runKernel(tt,i,r)}});const qn=Be({expm1_:function(t){const e={x:Me(t,"x","expm1")};return Ee.runKernel(et,e)}});const Gn=Be({tile_:function(t,e){const n=Me(t,"x","tile","string_or_numeric");s(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`));const i={x:n},r={reps:e};return Ee.runKernel(qt,i,r)}});const Hn=Be({floor_:function(t){const e={x:Me(t,"x","floor")};return Ee.runKernel(nt,e)}});const Jn=Be({gather_:function(t,e,n=0,s=0){const i={x:Me(t,"x","gather"),indices:Me(e,"indices","gather","int32")},r={axis:n,batchDims:s};return Ee.runKernel(rt,i,r)}});const Zn=Be({greater_:function(t,e){let n=Me(t,"a","greater"),s=Me(e,"b","greater");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("Greater",i)}});const Xn=Be({greaterEqual_:function(t,e){let n=Me(t,"a","greaterEqual"),s=Me(e,"b","greaterEqual");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel(at,i)}});const Yn=Be({imag_:function(t){const e={input:Me(t,"input","imag")};return Ee.runKernel("Imag",e)}});const Qn=Be({isFinite_:function(t){const e={x:Me(t,"x","isFinite")};return Ee.runKernel(lt,e)}});const ts=Be({isInf_:function(t){const e={x:Me(t,"x","isInf")};return Ee.runKernel(ut,e)}});const es=Be({isNaN_:function(t){const e={x:Me(t,"x","isNaN")};return Ee.runKernel(ht,e)}});const ns=Be({leakyRelu_:function(t,e=.2){const n={x:Me(t,"x","leakyRelu")},s={alpha:e};return Ee.runKernel(ct,n,s)}});const ss=Be({less_:function(t,e){let n=Me(t,"a","less"),s=Me(e,"b","less");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("Less",i)}});const is=Be({lessEqual_:function(t,e){let n=Me(t,"a","lessEqual"),s=Me(e,"b","lessEqual");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("LessEqual",i)}});const rs=Be({localResponseNormalization_:function(t,e=5,n=1,i=1,r=.5){const a=Me(t,"x","localResponseNormalization");s(4===a.rank||3===a.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${a.rank}.`)),s(o(e),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`));let l=a,u=!1;3===a.rank&&(u=!0,l=on(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const h={x:l},c={depthRadius:e,bias:n,alpha:i,beta:r},p=Ee.runKernel("LRN",h,c);return u?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const as=Be({log_:function(t){const e={x:Me(t,"x","log")};return Ee.runKernel("Log",e)}});const os=Be({log1p_:function(t){const e={x:Me(t,"x","log1p")};return Ee.runKernel(pt,e)}});function ls(t){return Ee.customGrad(t)}const us=Be({neg_:function(t){const e={x:Me(t,"x","neg")};return Ee.runKernel("Neg",e)}});const hs=Be({softplus_:function(t){const e={x:Me(t,"x","softplus")};return Ee.runKernel(Bt,e)}});const cs=Be({logSigmoid_:function(t){const e=Me(t,"x","logSigmoid");return ls((t=>({value:us(hs(us(t))),gradFunc:e=>pn(e,dn(us(t)))})))(e)}});const ps=Be({max_:function(t,e=null,n=!1){const s={x:Me(t,"x","max")},i={reductionIndices:e,keepDims:n};return Ee.runKernel("Max",s,i)}});const ds=Be({sub_:function(t,e){let n=Me(t,"a","sub"),s=Me(e,"b","sub");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel("Sub",i)}});const fs=Be({sum_:function(t,e=null,n=!1){let s=Me(t,"x","sum");"bool"===s.dtype&&(s=Qe(s,"int32"));const i={x:s},r={axis:e,keepDims:n};return Ee.runKernel("Sum",i,r)}});const gs=Be({logSoftmax_:function(t,e=-1){const n=Me(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return ls(((t,n)=>{const s=ps(t,e,!0),i=ds(t,s),r=ds(Qe(i,"float32"),as(fs(Vn(i),e,!0)));n([r]);return{value:r,gradFunc:(t,n)=>{const[s]=n,i=Vn(s);return ds(t,pn(fs(t,e,!0),i))}}}))(n)}});function ms(t,e){return function(t,e,n){const s=t.length+e.length,i=[];let r=0,a=0;for(let o=0;o1)),e)}function ys(t){return t.map(((t,e)=>[e,t])).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}const bs=Be({logSumExp_:function(t,e=null,n=!1){const s=Me(t,"x","logSumExp"),i=u(e,s.shape),r=ps(s,i,!0),a=ds(s,r),o=Vn(a),l=fs(o,i),h=as(l),c=Ke(on(r,h.shape),h);if(n){const t=ms(c.shape,i);return on(c,t)}return c}});const ws=Be({logicalAnd_:function(t,e){const n=Me(t,"a","logicalAnd","bool"),s=Me(e,"b","logicalAnd","bool");Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("LogicalAnd",i)}});const ks=Be({logicalNot_:function(t){const e={x:Me(t,"x","logicalNot","bool")};return Ee.runKernel("LogicalNot",e)}});const xs=Be({logicalOr_:function(t,e){const n=Me(t,"a","logicalOr","bool"),s=Me(e,"b","logicalOr","bool");Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("LogicalOr",i)}});const vs=Be({logicalXor_:function(t,e){const n=Me(t,"a","logicalXor","bool"),s=Me(e,"b","logicalXor","bool");return Rn(n.shape,s.shape),ws(xs(t,e),ks(ws(t,e)))}});const Ss=Be({maxPool_:function(t,e,n,i,r){const a=Me(t,"x","maxPool");let l=a,u=!1;3===a.rank&&(u=!0,l=on(a,[1,a.shape[0],a.shape[1],a.shape[2]])),s(4===l.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${l.rank}.`)),s(an(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=r&&s(o(i),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${i}.`));const h={x:l},c={filterSize:e,strides:n,pad:i,dimRoundingMode:r},p=Ee.runKernel(ft,h,c);return u?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const Is=Be({maximum_:function(t,e){let n=Me(t,"a","maximum"),s=Me(e,"b","maximum");[n,s]=ze(n,s),"bool"===n.dtype&&(n=Qe(n,"int32"),s=Qe(s,"int32")),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel(dt,i)}});const Ns=Be({mean_:function(t,e=null,n=!1){const s={x:Me(t,"x","mean")},i={axis:e,keepDims:n};return Ee.runKernel(gt,s,i)}});function zs(t,e="float32"){if("complex64"===e){const e=zs(t,"float32"),n=zs(t,"float32");return xn(e,n)}const n=w(r(t),e);return Ee.makeTensor(n,t,e)}function As(t,e="float32"){if("complex64"===e){const e=As(t,"float32"),n=zs(t,"float32");return xn(e,n)}const n=b(r(t),e);return Ee.makeTensor(n,t,e)}const Cs=Be({min_:function(t,e=null,n=!1){const s={x:Me(t,"x","min")},i={axis:e,keepDims:n};return Ee.runKernel("Min",s,i)}});const $s=Be({minimum_:function(t,e){let n=Me(t,"a","minimum"),s=Me(e,"b","minimum");[n,s]=ze(n,s),"bool"===n.dtype&&(n=Qe(n,"int32"),s=Qe(s,"int32")),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel(mt,i)}});const Ds=Be({mirrorPad_:function(t,e,n){s("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const i=Me(t,"x","mirrorPad");if(0===i.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");s(e.length===i.rank,(()=>`Padding doesn't match input. Must be ${i.rank}. Got ${e.length}.`));const r="reflect"===n?1:0;for(let t=0;t"Invalid number of paddings. Must be length of 2 each.")),s(e[t][0]>=0&&e[t][0]<=i.shape[t]-r&&e[t][1]>=0&&e[t][1]<=i.shape[t]-r,(()=>`Padding in dimension ${t} cannot be greater than or equal to ${i.shape[t]-r} or less than 0 for input of shape ${i.shape}`));const a={paddings:e,mode:n},o={x:i};return Ee.runKernel(yt,o,a)}});const Ts=Be({mod_:function(t,e){let n=Me(t,"a","mod"),s=Me(e,"b","mod");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel("Mod",i)}});const Es=Be({square_:function(t){const e=Me(t,"x","square");return Ee.runKernel("Square",{x:e},{})}});const Fs=Be({notEqual_:function(t,e){let n=Me(t,"a","notEqual"),s=Me(e,"b","notEqual");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel("NotEqual",i)}});const Ls=Be({oneHot_:function(t,e,n=1,s=0){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:Me(t,"indices","oneHot","int32")},r={depth:e,onValue:n,offValue:s};return Ee.runKernel(kt,i,r)}});const _s=Be({onesLike_:function(t){const e={x:Me(t,"x","onesLike")};return Ee.runKernel(wt,e)}});const Rs=Be({pad_:function(t,e,n=0){const s=Me(t,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:n},r={x:s};return Ee.runKernel(vt,r,i)}});const Ms=Be({spaceToBatchND_:function(t,e,n){const i=Me(t,"x","spaceToBatchND");s(i.rank>=1+e.length,(()=>`input rank ${i.rank} should be > than [blockShape] ${e.length}`)),s(n.length===e.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`)),s(i.shape.reduce(((t,s,i)=>i>0&&i<=e.length?t&&(s+n[i-1][0]+n[i-1][1])%e[i-1]==0:t),!0),(()=>`input spatial dimensions ${i.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`));const r={x:i},a={blockShape:e,paddings:n};return Ee.runKernel(Pt,r,a)}});const Os=Be({pool_:function(t,e,n,i,r,a){null==r&&(r=[1,1]),null==a&&(a=1),0===i&&(i="valid");const o=Me(t,"x","maxPool");let l=o,u=!1;3===o.rank&&(u=!0,l=on(o,[1,o.shape[0],o.shape[1],o.shape[2]])),s(an(a,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${a} and dilations '${r}'`));const h=tn(l.shape,e,a,r,i),c=[h.dilationHeight,h.dilationWidth];let p;p="same"===i?function(t,e){const n=t.map(((t,n)=>t+(t-1)*(e[n]-1))).map((t=>t-1)),s=n.map((t=>Math.floor(t/2))),i=n.map(((t,e)=>t-s[e]));return n.map(((t,e)=>[s[e],i[e]]))}([h.filterHeight,h.filterWidth],c):[[0,0],[0,0]];const d=1===c[0]&&1===c[1],[f,g]=function(t,e,n){const s=n.map((t=>t[0])),i=n.map((t=>t[1])),r=t.concat(s,i),a=e.map(((t,e)=>(t-r[e]%t)%t)),o=i.map(((t,e)=>t+a[e])),l=e.map(((t,e)=>[s[e],o[e]])),u=e.map(((t,e)=>[0,a[e]]));return[l,u]}([h.inHeight,h.inWidth],c,p),m=d?i:"valid",y=d?l:Ms(l,c,f),b=("avg"===n?()=>ln(y,e,a,m):()=>Ss(y,e,a,m))(),w=d?b:mn(b,c,g);return u?on(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const Bs=Be({pow_:function(t,e){let n=Me(t,"base","pow"),s=Me(e,"exp","pow");[n,s]=ze(n,s);const i={a:n,b:s};return Ee.runKernel("Pow",i)}});const Ws=Be({prelu_:function(t,e){const n={x:Me(t,"x","prelu"),alpha:Me(e,"alpha","prelu")};return Ee.runKernel(St,n)}});const Ps=Be({prod_:function(t,e=null,n=!1){let s=Me(t,"x","prod");"bool"===s.dtype&&(s=Qe(s,"int32"));const i={x:s},r={axis:e,keepDims:n};return Ee.runKernel("Prod",i,r)}});const Us=Be({real_:function(t){const e={input:Me(t,"input","real")};return Ee.runKernel("Real",e)}});const Ks=Be({reciprocal_:function(t){const e={x:Me(t,"x","reciprocal")};return Ee.runKernel(It,e)}});const Vs=Be({relu_:function(t){const e={x:Me(t,"x","relu")};return Ee.runKernel(Nt,e)}});const js=Be({relu6_:function(t){const e={x:Me(t,"x","relu6")};return Ee.runKernel($t,e)}});const qs=Be({reverse_:function(t,e){const n={x:Me(t,"x","reverse")},s={dims:e};return Ee.runKernel(Dt,n,s)}});const Gs=Be({round_:function(t){const e={x:Me(t,"x","round")};return Ee.runKernel(Tt,e)}});const Hs=Be({rsqrt_:function(t){const e={x:Me(t,"x","rsqrt")};return Ee.runKernel(Et,e)}});function Js(t,e,n,a){if(null==a&&(a=d(t)),"complex64"===a)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){!function(t){t.forEach((e=>{s(Number.isInteger(e)&&e>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`))}))}(e);const t=r(e),i=r(n);s(t===i,(()=>`Based on the provided shape, [${e}], the tensor should have ${t} values but has ${i}`));for(let t=0;t`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `))}}return h(t)||Array.isArray(t)||(t=[t]),e=e||n,t="string"!==a?ie(t,a):i(t,[],!0),Ee.makeTensor(t,e,a)}function Zs(t,e){if((h(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&h(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Js(t,[],[],e)}const Xs=Be({selu_:function(t){const e={x:Me(t,"x","selu")};return Ee.runKernel(Lt,e)}});const Ys=Be({separableConv2d_:function(t,e,n,i,r,a=[1,1],o="NHWC"){const l=Me(t,"x","separableConv2d"),u=Me(e,"depthwiseFilter","separableConv2d"),h=Me(n,"pointwiseFilter","separableConv2d");let c=l,p=!1;if(3===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1],l.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");s(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),s(4===u.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${u.rank}.`)),s(4===h.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${u.rank}.`)),s(1===h.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${h.shape[0]}.`)),s(1===h.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${h.shape[1]}.`));const d=u.shape[2],f=u.shape[3];s(h.shape[2]===d*f,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*f}, but got ${h.shape[2]}.`));const g=Tn(c,u,i,r,o,a),m=vn(g,h,1,"valid",o);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Qs=Be({sign_:function(t){const e={x:Me(t,"x","sign")};return Ee.runKernel(Mt,e)}});const ti=Be({sin_:function(t){const e={x:Me(t,"x","sin")};return Ee.runKernel("Sin",e)}});const ei=Be({sinh_:function(t){const e={x:Me(t,"x","sinh")};return Ee.runKernel(Rt,e)}});const ni=Be({softmax_:function(t,e=-1){const n=Me(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const s={logits:n},i={dim:e};return Ee.runKernel(Kt,s,i)}});const si=Be({fft_:function(t){s("complex64"===t.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Ee.runKernel("FFT",e)}});const ii=Be({ifft_:function(t){s("complex64"===t.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Ee.runKernel("IFFT",e)}});const ri=Be({irfft_:function(t){const e=t.shape[t.shape.length-1],n=t.size/e;let s;if(e<=2){const i=on(t,[n,e]);s=ii(i)}else{const i=[n,2*(e-1)],r=on(Us(t),[n,e]),a=on(Yn(t),[n,e]),o=qs(fn(r,[0,1],[n,e-2]),1),l=pn(qs(fn(a,[0,1],[n,e-2]),1),Zs(-1)),u=hn([r,o],1),h=hn([a,l],1),c=on(xn(u,h),[i[0],i[1]]);s=ii(c)}if(s=Us(s),3===t.rank&&0!==t.shape[0]){const e=s,n=t.shape[0];s=on(s,[n,s.shape[0]/n,s.shape[1]]),e.dispose()}return s}});const ai=Be({split_:function(t,e,n=0){const s={x:Me(t,"x","split")},i={numOrSizeSplits:e,axis:n};return Ee.runKernel(Ut,s,i)}});const oi=Be({rfft_:function(t,e){s("float32"===t.dtype,(()=>`The dtype for rfft() must be real value but got ${t.dtype}`));let n=t.shape[t.shape.length-1];const i=t.size/n;let r;if(null!=e&&e0)),i=t.shape.map((t=>t));i[t.shape.length-1]=e,r=fn(t,s,i),n=e}else if(null!=e&&e>n){const s=t.shape.map((t=>t));s[t.shape.length-1]=e-n,r=hn([t,zs(s)],t.shape.length-1),n=e}else r=t;const a=Bn(r),o=on(xn(r,a),[i,n]),l=si(o),u=Math.floor(n/2)+1,h=Us(l),c=Yn(l),p=ai(h,[u,n-u],h.shape.length-1),d=ai(c,[u,n-u],c.shape.length-1),f=r.shape.slice();return f[r.shape.length-1]=u,on(xn(p[0],d[0]),f)}});const li=Be({sqrt_:function(t){const e={x:Me(t,"x","sqrt")};return Ee.runKernel(Wt,e)}});const ui=Be({squaredDifference_:function(t,e){let n=Me(t,"a","squaredDifference"),s=Me(e,"b","squaredDifference");[n,s]=ze(n,s),Rn(n.shape,s.shape);const i={a:n,b:s};return Ee.runKernel(Vt,i,{})}});const hi=Be({squeeze_:function(t,e){const n=Me(t,"x","squeeze");return on(n,function(t,e){const n=[],s=[],i=null!=e&&Array.isArray(e)&&0===e.length,r=null==e||i?null:u(e,t).sort();let a=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),s.push(e)),r[a]<=e&&a++}1!==t[e]&&(n.push(t[e]),s.push(e))}return{newShape:n,keptDims:s}}(n.shape,e).newShape)}});const ci=Be({stack_:function(t,e=0){const n=Oe(t,"tensors","stack","string_or_numeric");s(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&s(e<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,r={axis:e};return Ee.runKernel(xt,i,r)}});const pi=Be({step_:function(t,e=0){const n={x:Me(t,"x","step")},s={alpha:e};return Ee.runKernel(Xt,n,s)}});const di=Be({stridedSlice_:function(t,e,n,s,i=0,r=0,a=0,o=0,l=0){const u={x:Me(t,"x","stridedSlice")},h={begin:e,end:n,strides:s,beginMask:i,endMask:r,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return Ee.runKernel("StridedSlice",u,h)}});const fi=Be({tan_:function(t){const e={x:Me(t,"x","tan")};return Ee.runKernel("Tan",e)}});const gi=Be({topk_:function(t,e=1,n=!0){const s=Me(t,"x","topk");if(0===s.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=s.shape[s.shape.length-1];if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${e}`);const r={x:s},a={k:e,sorted:n},[o,l]=Ee.runKernel("TopK",r,a);return{values:o,indices:l}}});const mi=Be({unique_:function(t,e=0){const n=Me(t,"x","unique","string_or_numeric");s(n.rank>0,(()=>"The input tensor must be at least 1D"));const i={x:n},r={axis:e},[a,o]=Ee.runKernel("Unique",i,r);return{values:a,indices:o}}});const yi=Be({unsortedSegmentSum_:function(t,e,n){const i=Me(t,"x","unsortedSegmentSum"),r=Me(e,"segmentIds","unsortedSegmentSum","int32");s(o(n),(()=>"numSegments must be of dtype int"));const a={x:i,segmentIds:r},l={numSegments:n};return Ee.runKernel(Jt,a,l)}});const bi=Be({unstack_:function(t,e=0){const n=Me(t,"x","unstack","string_or_numeric");s(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`));const i={value:n},r={axis:e};return Ee.runKernel(Ht,i,r)}});const wi=Be({transpose_:function(t,e){const n=Me(t,"x","transpose");if(null==e&&(e=n.shape.map(((t,e)=>e)).reverse()),s(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${e}.`)),e.forEach((t=>{s(t>=0&&t"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${e}`))})),n.rank<=1)return n.clone();const i={x:n},r={perm:e};return Ee.runKernel(Gt,i,r)}});function ki(t,e,n=null){if(0===t.rank)return We(t);if(1!==t.rank&&null===n)return ki(on(t,[-1]),e,n);if(1===t.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===e)return fs(We(t),n);if(e===1/0)return ps(We(t),n);if(e===-1/0)return Cs(We(t),n);if("euclidean"===e||2===e)return li(fs(Bs(We(t),Zs(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}if(Array.isArray(n)&&2===n.length){if(1===e)return ps(fs(We(t),n[0]),n[1]-1);if(e===1/0)return ps(fs(We(t),n[1]),n[0]);if(e===-1/0)return Cs(fs(We(t),n[1]),n[0]);if("fro"===e||"euclidean"===e)return li(fs(Es(t),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const xi=Be({norm_:function(t,e="euclidean",n=null,s=!1){const i=ki(t=Me(t,"x","norm"),e,n);let r=i.shape;if(s){const e=u(n,t.shape);r=ms(i.shape,e)}return on(i,r)}});const vi=Be({conv2DBackpropFilter_:function(t,e,n,i,r,a="NHWC",l){let u=t;3===t.rank&&(u=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let h=e;3===h.rank&&(h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]])),s(4===u.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${u.shape}.`)),s(4===h.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${h.shape}.`)),s(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const c="NHWC"===a?u.shape[3]:u.shape[1],p="NHWC"===a?h.shape[3]:h.shape[1];s(c===n[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`)),s(p===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${n[3]}).`)),null!=l&&s(o(r),(()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${l} but got pad ${r}.`));const d={x:u,dy:h},f={strides:i,pad:r,dataFormat:a,dimRoundingMode:l,filterShape:n};return Ee.runKernel("Conv2DBackpropFilter",d,f)}});const Si=Be({depthwiseConv2dNativeBackpropFilter_:function(t,e,n,s,i,r=[1,1],a){let o=t;3===t.rank&&(o=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;3===l.rank&&(l=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={x:o,dy:l},h={strides:s,pad:i,dimRoundingMode:a,dilations:r,filterShape:n};return Ee.runKernel("DepthwiseConv2dNativeBackpropFilter",u,h)}});const Ii=Be({depthwiseConv2dNativeBackpropInput_:function(t,e,n,s,i,r=[1,1],a){let o=e,l=!1;3===e.rank&&(l=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={dy:o,filter:n},h={strides:s,pad:i,dimRoundingMode:a,dilations:r,inputShape:t},c=Ee.runKernel("DepthwiseConv2dNativeBackpropInput",u,h);return l?on(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Ni=Be({resizeBilinear_:function(t,e,n=!1,i=!1){const r=Me(t,"images","resizeBilinear");s(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),s(2===e.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`)),s(!1===i||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let a=r,o=!1;3===r.rank&&(o=!0,a=on(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const l={images:a},u={alignCorners:n,halfPixelCenters:i,size:e},h=Ee.runKernel(Ct,l,u);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const zi=Be({resizeNearestNeighbor_:function(t,e,n=!1,i=!1){const r=Me(t,"images","resizeNearestNeighbor");s(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),s(2===e.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`)),s("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),s(!1===i||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let a=r,o=!1;3===r.rank&&(o=!0,a=on(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const l={images:a},u={alignCorners:n,halfPixelCenters:i,size:e},h=Ee.runKernel(At,l,u);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});be().prototype.abs=function(){return this.throwIfDisposed(),We(this)},be().prototype.acos=function(){return this.throwIfDisposed(),Pe(this)},be().prototype.acosh=function(){return this.throwIfDisposed(),Ue(this)},be().prototype.add=function(t){return this.throwIfDisposed(),Ke(this,t)},be().prototype.all=function(t,e){return this.throwIfDisposed(),Ve(this,t,e)},be().prototype.any=function(t,e){return this.throwIfDisposed(),je(this,t,e)},be().prototype.argMax=function(t){return this.throwIfDisposed(),qe(this,t)},be().prototype.argMin=function(t){return this.throwIfDisposed(),Ge(this,t)},be().prototype.asScalar=function(){return this.throwIfDisposed(),s(1===this.size,(()=>"The array must have only 1 element.")),on(this,[])},be().prototype.asType=function(t){return this.throwIfDisposed(),Qe(this,t)},be().prototype.as1D=function(){return this.throwIfDisposed(),on(this,[this.size])},be().prototype.as2D=function(t,e){return this.throwIfDisposed(),on(this,[t,e])},be().prototype.as3D=function(t,e,n){return this.throwIfDisposed(),on(this,[t,e,n])},be().prototype.as4D=function(t,e,n,s){return this.throwIfDisposed(),on(this,[t,e,n,s])},be().prototype.as5D=function(t,e,n,s,i){return this.throwIfDisposed(),on(this,[t,e,n,s,i])},be().prototype.asin=function(){return this.throwIfDisposed(),He(this)},be().prototype.asinh=function(){return this.throwIfDisposed(),Je(this)},be().prototype.atan=function(){return this.throwIfDisposed(),Ze(this)},be().prototype.atan2=function(t){return this.throwIfDisposed(),Xe(this,t)},be().prototype.atanh=function(){return this.throwIfDisposed(),Ye(this)},be().prototype.avgPool=function(t,e,n,s){return this.throwIfDisposed(),ln(this,t,e,n,s)},be().prototype.batchToSpaceND=function(t,e){return this.throwIfDisposed(),mn(this,t,e)},be().prototype.batchNorm=function(t,e,n,s,i){return this.throwIfDisposed(),yn(this,t,e,n,s,i)},be().prototype.broadcastTo=function(t){return this.throwIfDisposed(),bn(this,t)},be().prototype.cast=function(t){return this.throwIfDisposed(),Qe(this,t)},be().prototype.ceil=function(){return this.throwIfDisposed(),wn(this)},be().prototype.clipByValue=function(t,e){return this.throwIfDisposed(),kn(this,t,e)},be().prototype.concat=function(t,e){return this.throwIfDisposed(),t instanceof ye&&(t=[t]),hn([this,...t],e)},be().prototype.conv1d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Sn(this,t,e,n,s,i,r)},be().prototype.conv2dTranspose=function(t,e,n,s,i){return this.throwIfDisposed(),Nn(this,t,e,n,s,i)},be().prototype.conv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),vn(this,t,e,n,s,i,r)},be().prototype.cos=function(){return this.throwIfDisposed(),An(this)},be().prototype.cosh=function(){return this.throwIfDisposed(),Cn(this)},be().prototype.cumsum=function(t,e,n){return this.throwIfDisposed(),$n(this,t,e,n)},be().prototype.depthToSpace=function(t,e){return this.throwIfDisposed(),Dn(this,t,e)},be().prototype.depthwiseConv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Tn(this,t,e,n,s,i,r)},be().prototype.dilation2d=function(t,e,n,s,i){return this.throwIfDisposed(),En(this,t,e,n,s,i)},be().prototype.divNoNan=function(t){return this.throwIfDisposed(),Wn(this,t)},be().prototype.div=function(t){return this.throwIfDisposed(),Ln(this,t)},be().prototype.dot=function(t){return this.throwIfDisposed(),Pn(this,t)},be().prototype.elu=function(){return this.throwIfDisposed(),Un(this)},be().prototype.equal=function(t){return this.throwIfDisposed(),Mn(this,t)},be().prototype.erf=function(){return this.throwIfDisposed(),Kn(this)},be().prototype.exp=function(){return this.throwIfDisposed(),Vn(this)},be().prototype.expandDims=function(t){return this.throwIfDisposed(),jn(this,t)},be().prototype.expm1=function(){return this.throwIfDisposed(),qn(this)},be().prototype.fft=function(){return this.throwIfDisposed(),si(this)},be().prototype.flatten=function(){return this.throwIfDisposed(),on(this,[this.size])},be().prototype.floor=function(){return this.throwIfDisposed(),Hn(this)},be().prototype.floorDiv=function(t){return this.throwIfDisposed(),Fn(this,t)},be().prototype.gather=function(t,e){return this.throwIfDisposed(),Jn(this,t,e)},be().prototype.greaterEqual=function(t){return this.throwIfDisposed(),Xn(this,t)},be().prototype.greater=function(t){return this.throwIfDisposed(),Zn(this,t)},be().prototype.ifft=function(){return this.throwIfDisposed(),ii(this)},be().prototype.irfft=function(){return this.throwIfDisposed(),ri(this)},be().prototype.isFinite=function(){return this.throwIfDisposed(),Qn(this)},be().prototype.isInf=function(){return this.throwIfDisposed(),ts(this)},be().prototype.isNaN=function(){return this.throwIfDisposed(),es(this)},be().prototype.leakyRelu=function(t){return this.throwIfDisposed(),ns(this,t)},be().prototype.lessEqual=function(t){return this.throwIfDisposed(),is(this,t)},be().prototype.less=function(t){return this.throwIfDisposed(),ss(this,t)},be().prototype.localResponseNormalization=function(t,e,n,s){return this.throwIfDisposed(),rs(this,t,e,n,s)},be().prototype.logSigmoid=function(){return this.throwIfDisposed(),cs(this)},be().prototype.logSoftmax=function(t){return this.throwIfDisposed(),gs(this,t)},be().prototype.logSumExp=function(t,e){return this.throwIfDisposed(),bs(this,t,e)},be().prototype.log=function(){return this.throwIfDisposed(),as(this)},be().prototype.log1p=function(){return this.throwIfDisposed(),os(this)},be().prototype.logicalAnd=function(t){return this.throwIfDisposed(),ws(this,t)},be().prototype.logicalNot=function(){return this.throwIfDisposed(),ks(this)},be().prototype.logicalOr=function(t){return this.throwIfDisposed(),xs(this,t)},be().prototype.logicalXor=function(t){return this.throwIfDisposed(),vs(this,t)},be().prototype.matMul=function(t,e,n){return this.throwIfDisposed(),cn(this,t,e,n)},be().prototype.maxPool=function(t,e,n,s){return this.throwIfDisposed(),Ss(this,t,e,n,s)},be().prototype.max=function(t,e){return this.throwIfDisposed(),ps(this,t,e)},be().prototype.maximum=function(t){return this.throwIfDisposed(),Is(this,t)},be().prototype.mean=function(t,e){return this.throwIfDisposed(),Ns(this,t,e)},be().prototype.min=function(t,e){return this.throwIfDisposed(),Cs(this,t,e)},be().prototype.minimum=function(t){return this.throwIfDisposed(),$s(this,t)},be().prototype.mirrorPad=function(t,e){return this.throwIfDisposed(),Ds(this,t,e)},be().prototype.mod=function(t){return this.throwIfDisposed(),Ts(this,t)},be().prototype.mul=function(t){return this.throwIfDisposed(),pn(this,t)},be().prototype.neg=function(){return this.throwIfDisposed(),us(this)},be().prototype.norm=function(t,e,n){return this.throwIfDisposed(),xi(this,t,e,n)},be().prototype.notEqual=function(t){return this.throwIfDisposed(),Fs(this,t)},be().prototype.oneHot=function(t,e=1,n=0){return this.throwIfDisposed(),Ls(this,t,e,n)},be().prototype.onesLike=function(){return this.throwIfDisposed(),_s(this)},be().prototype.pad=function(t,e){return this.throwIfDisposed(),Rs(this,t,e)},be().prototype.pool=function(t,e,n,s,i){return this.throwIfDisposed(),Os(this,t,e,n,s,i)},be().prototype.pow=function(t){return this.throwIfDisposed(),Bs(this,t)},be().prototype.prelu=function(t){return this.throwIfDisposed(),Ws(this,t)},be().prototype.prod=function(t,e){return this.throwIfDisposed(),Ps(this,t,e)},be().prototype.reciprocal=function(){return this.throwIfDisposed(),Ks(this)},be().prototype.relu=function(){return this.throwIfDisposed(),Vs(this)},be().prototype.relu6=function(){return this.throwIfDisposed(),js(this)},be().prototype.reshapeAs=function(t){return this.throwIfDisposed(),on(this,t.shape)},be().prototype.reshape=function(t){return this.throwIfDisposed(),on(this,t)},be().prototype.resizeBilinear=function(t,e,n){return this.throwIfDisposed(),Ni(this,t,e,n)},be().prototype.resizeNearestNeighbor=function(t,e,n){return this.throwIfDisposed(),zi(this,t,e,n)},be().prototype.reverse=function(t){return this.throwIfDisposed(),qs(this,t)},be().prototype.rfft=function(){return this.throwIfDisposed(),oi(this)},be().prototype.round=function(){return this.throwIfDisposed(),Gs(this)},be().prototype.rsqrt=function(){return this.throwIfDisposed(),Hs(this)},be().prototype.selu=function(){return this.throwIfDisposed(),Xs(this)},be().prototype.separableConv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Ys(this,t,e,n,s,i,r)},be().prototype.sigmoid=function(){return this.throwIfDisposed(),dn(this)},be().prototype.sign=function(){return this.throwIfDisposed(),Qs(this)},be().prototype.sin=function(){return this.throwIfDisposed(),ti(this)},be().prototype.sinh=function(){return this.throwIfDisposed(),ei(this)},be().prototype.slice=function(t,e){return this.throwIfDisposed(),fn(this,t,e)},be().prototype.softmax=function(t){return this.throwIfDisposed(),ni(this,t)},be().prototype.softplus=function(){return this.throwIfDisposed(),hs(this)},be().prototype.spaceToBatchND=function(t,e){return this.throwIfDisposed(),Ms(this,t,e)},be().prototype.split=function(t,e){return this.throwIfDisposed(),ai(this,t,e)},be().prototype.sqrt=function(){return this.throwIfDisposed(),li(this)},be().prototype.square=function(){return this.throwIfDisposed(),Es(this)},be().prototype.squaredDifference=function(t){return this.throwIfDisposed(),ui(this,t)},be().prototype.squeeze=function(t){return this.throwIfDisposed(),hi(this,t)},be().prototype.stack=function(t,e){this.throwIfDisposed();const n=t instanceof ye?[this,t]:[this,...t];return ci(n,e)},be().prototype.step=function(t){return this.throwIfDisposed(),pi(this,t)},be().prototype.stridedSlice=function(t,e,n,s,i,r,a,o){return this.throwIfDisposed(),di(this,t,e,n,s,i,r,a,o)},be().prototype.sub=function(t){return this.throwIfDisposed(),ds(this,t)},be().prototype.sum=function(t,e){return this.throwIfDisposed(),fs(this,t,e)},be().prototype.tan=function(){return this.throwIfDisposed(),fi(this)},be().prototype.tanh=function(){return this.throwIfDisposed(),gn(this)},be().prototype.tile=function(t){return this.throwIfDisposed(),Gn(this,t)},be().prototype.toBool=function(){return this.throwIfDisposed(),Qe(this,"bool")},be().prototype.toFloat=function(){return this.throwIfDisposed(),Qe(this,"float32")},be().prototype.toInt=function(){return this.throwIfDisposed(),Qe(this,"int32")},be().prototype.topk=function(t,e){return this.throwIfDisposed(),gi(this,t,e)},be().prototype.transpose=function(t){return this.throwIfDisposed(),wi(this,t)},be().prototype.unique=function(t){return this.throwIfDisposed(),mi(this,t)},be().prototype.unsortedSegmentSum=function(t,e){return this.throwIfDisposed(),yi(this,t,e)},be().prototype.unstack=function(t){return this.throwIfDisposed(),bi(this,t)},be().prototype.where=function(t,e){return this.throwIfDisposed(),On(t,this,e)},be().prototype.zerosLike=function(){return this.throwIfDisposed(),Bn(this)};const Ai={kernelName:"Abs",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pi(Qe(n,"float32"),-1))}}},Ci={kernelName:$,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Es(Qe(n,"float32")),s=li(ds(Zs(1),e));return us(Ln(t,s))}}}},$i={kernelName:D,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=li(ds(Es(Qe(n,"float32")),1));return Ln(t,e)}}}},Di={kernelName:T,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{let e=t;const s=_n(n.shape,i);return s.length>0&&(e=fs(e,s)),on(e,n.shape)},b:()=>{let e=t;const n=_n(s.shape,i);return n.length>0&&(e=fs(e,n)),on(e,s.shape)}}}},Ti={kernelName:"AddN",saveAllInputs:!0,gradFunc:(t,e)=>{const n={};return e.forEach(((e,s)=>{n[s]=()=>t.clone()})),n}},Ei={kernelName:E,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Bn(n)}}},Fi={kernelName:F,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Bn(n)}}},Li={kernelName:L,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,li(ds(Zs(1),Es(Qe(n,"float32")))))}}},_i={kernelName:_,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=li(Ke(Zs(1),Es(Qe(n,"float32"))));return Ln(t,e)}}}},Ri={kernelName:O,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{const e=Ke(Es(n),Es(s));let r=pn(t,Ln(s,e));const a=_n(n.shape,i);return a.length>0&&(r=fs(r,a)),on(r,n.shape)},b:()=>{const e=Ke(Es(n),Es(s));let r=us(pn(t,Ln(n,e)));const a=_n(s.shape,i);return a.length>0&&(r=fs(r,a)),on(r,s.shape)}}}},Mi={kernelName:R,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,Ke(Es(Qe(n,"float32")),1))}}},Oi={kernelName:M,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,ds(Zs(1),Es(Qe(n,"float32"))))}}};const Bi=Be({avgPool3dGrad_:function(t,e,n,i,r,a){const l=Me(t,"dy","avgPool3dGrad"),u=Me(e,"input","avgPool3dGrad");let h=l,c=u,p=!1;4===u.rank&&(p=!0,h=on(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),c=on(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),s(5===h.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${h.rank}.`)),s(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),null!=a&&s(o(r),(()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`));const d={dy:h,input:c},f={filterSize:n,strides:i,pad:r,dimRoundingMode:a},g=Ee.runKernel("AvgPool3DGrad",d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),Wi={kernelName:"AvgPool3D",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{filterSize:i,strides:r,pad:a,dimRoundingMode:o}=n;return{x:()=>Bi(t,s,i,r,a,o)}}};const Pi=Be({avgPoolGrad_:function(t,e,n,i,r){const a=Me(t,"dy","avgPoolGrad"),o=Me(e,"input","avgPoolGrad");s(o.rank===a.rank,(()=>`Rank of input (${o.rank}) does not match rank of dy (${a.rank})`));let l=o,u=a,h=!1;3===o.rank&&(h=!0,l=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),u=on(a,[1,a.shape[0],a.shape[1],a.shape[2]])),s(4===u.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${u.rank}.`)),s(4===l.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${l.rank}.`));const c={dy:u,input:l},p={filterSize:n,strides:i,pad:r},d=Ee.runKernel("AvgPoolGrad",c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Ui={kernelName:B,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{filterSize:i,strides:r,pad:a}=n;return{x:()=>Pi(t,s,i,r,a)}}},Ki={kernelName:W,inputsToSave:["a","b"],gradFunc:(t,e,n)=>{const[s,i]=e,{transposeA:r,transposeB:a}=n;return r||a?!r&&a?{a:()=>cn(t,i,!1,!1),b:()=>cn(t,s,!0,!1)}:r&&!a?{a:()=>cn(i,t,!1,!0),b:()=>cn(s,t,!1,!1)}:{a:()=>cn(i,t,!0,!0),b:()=>cn(t,s,!0,!0)}:{a:()=>cn(t,i,!1,!0),b:()=>cn(s,t,!0,!1)}}},Vi={kernelName:P,gradFunc:(t,e,n)=>{const{blockShape:s,crops:i}=n;return{x:()=>Ms(t,s,i)}}},ji={kernelName:"BroadcastTo",gradFunc:(t,e,n)=>{const s=n,i=s.inputShape,r=s.shape,a=Array.from(r);for(let t=i.length-1;t>=0;t--)if(i[t]===r[t])a[t]=1;else if(1!==i[t])throw new Error(`broadcastTo(): [${i}] cannot be broadcast to [${r}].`);const o=[];for(let t=0;t1&&o.push(t);return{x:()=>fs(t,o,!0)}}},qi={kernelName:U,gradFunc:t=>({x:()=>t.clone()})},Gi={kernelName:K,gradFunc:t=>({x:()=>Bn(t)})},Hi={kernelName:V,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{clipValueMin:i,clipValueMax:r}=n;return{x:()=>On(ws(Xn(s,i),is(s,r)),t,Bn(t))}}},Ji={kernelName:j,inputsToSave:["x"],gradFunc:Ai.gradFunc},Zi={kernelName:q,saveAllInputs:!0,gradFunc:(t,e,n)=>{const s=e.map((t=>t.shape)),{axis:i}=n,r=u(i,e[0].shape)[0],a=s.map((t=>t[r]));return ai(t,a,r).map((t=>()=>t))}},Xi={kernelName:G,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[i,r]=e,{dilations:a,strides:o,pad:l,dataFormat:u}=n;return s(rn(a),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`)),{x:()=>In(i.shape,t,r,o,l,u),filter:()=>vi(i,t,r.shape,o,l,u)}}},Yi={kernelName:H,inputsToSave:["dy","filter"],gradFunc:(t,e,n)=>{const[s,i]=e,{strides:r,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>vn(t,i,r,a,o,1,l),filter:()=>vi(t,s,i.shape,r,a,o,l)}}};const Qi=Be({conv3DBackpropFilter_:function(t,e,n,i,r){let a=t;4===t.rank&&(a=on(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]));let o=e;4===o.rank&&(o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]])),s(5===a.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${a.shape}.`)),s(5===o.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`)),s(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),s(a.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${a.shape[4]}) must match input depth in filter (${n[3]}.`)),s(o.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`));const l={x:a,dy:o},u={strides:i,pad:r,filterShape:n};return Ee.runKernel("Conv3DBackpropFilterV2",l,u)}}),tr={kernelName:"Conv3D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:r,pad:a}=n;s(rn(i),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const[o,l]=e;return{x:()=>zn(o.shape,t,l,r,a),filter:()=>Qi(o,t,l.shape,r,a)}}},er={kernelName:"Cos",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(us(ti(Qe(n,"float32"))),t)}}},nr={kernelName:J,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(ei(Qe(n,"float32")),t)}}},sr={kernelName:Z,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{axis:i,exclusive:r,reverse:a}=n;return{x:()=>{const e=function(t,e){if(function(t,e){for(let n=0;nn.push(t))),n}([i],s.rank);let n=$n(t,i,r,!a);return null!=e&&(n=wi(n,e)),n}}}},ir={kernelName:X,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:r,pad:a,dimRoundingMode:l}=n,u=null==i?[1,1]:i;s(rn(u),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${u}'`));const[h,c]=e;return s(4===h.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${h.rank}.`)),s(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),s(h.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),s(an(r,u),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${u}'.`)),null!=l&&s(o(a),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${l} but got pad ${a}.`)),{x:()=>Ii(h.shape,t,c,r,a,i,l),filter:()=>Si(h,t,c.shape,r,a,i,l)}}},rr={kernelName:Y,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[s,i]=e,r={x:s,filter:i,dy:t},a={x:s,filter:i,dy:t};return{x:()=>Ee.runKernel("Dilation2DBackpropInput",r,n),filter:()=>Ee.runKernel("Dilation2DBackpropFilter",a,n)}}},ar={kernelName:"Elu",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e,s={dy:t,y:n};return{x:()=>Ee.runKernel("EluGrad",s)}}},or={kernelName:"Erf",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,s=pn(Vn(us(Es(n))),2/Math.sqrt(Math.PI));return{x:()=>pn(t,s)}}},lr={kernelName:"Exp",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,n)}}},ur={kernelName:tt,inputsToSave:["input"],gradFunc:(t,e)=>{const[n]=e;return{input:()=>on(t,n.shape)}}},hr={kernelName:et,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,Vn(n))}}},cr={kernelName:nt,gradFunc:t=>({x:()=>Bn(t)})},pr={kernelName:st,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{const e=Ln(t,Qe(s,"float32")),r=_n(n.shape,i);return r.length>0?on(fs(e,r),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const r=_n(s.shape,i);r.length>0&&(e=on(fs(e,r),s.shape));const a=Es(s);return us(Ln(e,Qe(a,"float32")))}}}},dr={kernelName:it,inputsToSave:["x","mean","variance","scale"],gradFunc:(t,e,n)=>{const{varianceEpsilon:s}=n,[i,r,a,o]=e,l=null==o?Zs(1):o,u=_n(r.shape,i.shape),h=[];if(1===r.rank){for(let t=0;t1===r.rank?on(pn(pn(t,Gn(on(d,[1,1,1,r.shape[0]]),h)),l),i.shape):on(pn(pn(t,d),l),i.shape),mean:()=>{let t=pn(pn(d,Zs(-1)),p);return 1===r.rank&&(t=fs(t,u)),on(t,r.shape)},variance:()=>{let t=pn(pn(f,c),p);return 1===r.rank&&(t=fs(t,u)),on(t,r.shape)},scale:()=>{const e=pn(c,d);let n=pn(t,e);return 1===r.rank&&(n=fs(n,u)),on(n,r.shape)},offset:()=>{let e=t;return 1===r.rank&&(e=fs(e,u)),on(e,r.shape)}}}},fr={kernelName:rt,inputsToSave:["x","indices"],gradFunc:(t,e,n)=>{const[s,i]=e,{axis:r}=n,a=u(r,s.shape)[0];return{x:()=>{const e=s.shape,n=i.size,o=e.slice(0,a),l=o.length,u=e.slice(r,e.length).slice(1),h=u.length,c=gr(0,l),p=gr(l+1,l+1+h),d=mr([o,[n],u]),f=on(t,d),g=on(i,[n]),m=mr([[l],c,p]),y=wi(f,m);let b=yi(y,g,s.shape[a]);const w=ys(m);return b=wi(b,w),b},indices:()=>i}}};function gr(t,e){const n=[];for(let s=t;s{const[n,s]=e;return{a:()=>Bn(n),b:()=>Bn(s)}}},br={kernelName:ot,gradFunc:t=>({x:()=>Qe(t,"float32")})},wr={kernelName:lt,gradFunc:t=>({x:()=>Bn(t)})},kr={kernelName:ut,gradFunc:t=>({x:()=>Bn(t)})},xr={kernelName:ht,gradFunc:t=>({x:()=>Bn(t)})},vr={kernelName:ct,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{alpha:i}=n,r=Zn(s,0);return{x:()=>On(r,t,pn(t,i))}}},Sr={kernelName:pt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,Ke(n,1))}}},Ir={kernelName:"Log",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,Qe(n,"float32"))}}},Nr={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s]=e,{axis:i}=n;return{logits:()=>{const e=Vn(s);return ds(t,pn(fs(t,i,!0),e))}}}};const zr=Be({localResponseNormalizationBackprop_:function(t,e,n,s=5,i=1,r=1,a=.5){const o={x:t,y:e,dy:n},l={depthRadius:s,bias:i,alpha:r,beta:a};return Ee.runKernel("LRNGrad",o,l)}}),Ar={kernelName:"LRN",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{depthRadius:r,bias:a,alpha:o,beta:l}=n;return{x:()=>zr(s,i,t,r,a,o,l)}}};function Cr(t,e,n,s){return e.rankpn(t,Qe(Mn(n,e),t.dtype))}}const $r={kernelName:"Max",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const s=n,{reductionIndices:i}=s,r=e[0],a=Cr(t,e[1],r,u(i,r.shape));return{x:()=>a.x()}}},Dr={kernelName:dt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e;return{a:()=>pn(t,Qe(Xn(n,s),"float32")),b:()=>pn(t,Qe(ss(n,s),"float32"))}}};const Tr=Be({maxPool3dGrad_:function(t,e,n,i,r,a,l){const u=Me(t,"dy","maxPool3dGrad"),h=Me(e,"input","maxPool3dGrad"),c=Me(n,"output","maxPool3dGrad");let p=u,d=h,f=c,g=!1;4===h.rank&&(g=!0,p=on(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),d=on(h,[1,h.shape[0],h.shape[1],h.shape[2],h.shape[3]]),f=on(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),s(5===p.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${p.rank}.`)),s(5===d.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`)),s(5===f.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${f.rank}.`)),null!=l&&s(o(a),(()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${l} but got pad ${a}.`));const m={dy:p,input:d,output:f},y={filterSize:i,strides:r,pad:a,dimRoundingMode:l},b=Ee.runKernel("MaxPool3DGrad",m,y);return g?on(b,[b.shape[1],b.shape[2],b.shape[3],b.shape[4]]):b}}),Er={kernelName:"MaxPool3D",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{filterSize:r,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>Tr(t,s,i,r,a,o,l)}}};const Fr=Be({maxPoolGrad_:function(t,e,n,i,r,a,l){const u=Me(t,"dy","maxPoolGrad"),h=Me(e,"input","maxPoolGrad"),c=Me(n,"output","maxPoolGrad");s(h.rank===u.rank,(()=>`Rank of input (${h.rank}) does not match rank of dy (${u.rank})`)),s(4===u.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${u.rank}.`)),s(4===h.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${h.rank}.`)),null!=l&&s(o(a),(()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${l} but got pad ${a}.`));const p={dy:u,input:h,output:c},d={filterSize:i,strides:r,pad:a,dimRoundingMode:l};return Ee.runKernel("MaxPoolGrad",p,d)}}),Lr={kernelName:vt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const s=e[0],{paddings:i}=n,r=i.map((t=>t[0]));return{x:()=>fn(t,r,s.shape)}}};const _r={kernelName:Pt,gradFunc:(t,e,n)=>{const{blockShape:s,paddings:i}=n;return{x:()=>mn(t,s,i)}}},Rr={kernelName:Ut,gradFunc:(t,e,n)=>{const{axis:s}=n;return{x:()=>hn(t,s)}}};const Mr=[Ai,Ci,$i,Di,Ti,Ei,Fi,Li,_i,Ri,Mi,Oi,Wi,Ui,Ki,Vi,ji,qi,Gi,Hi,Ji,Zi,Yi,Xi,tr,er,nr,sr,ir,rr,{kernelName:Q,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{const e=Ln(t,Qe(s,"float32")),r=_n(n.shape,i);return r.length>0?on(fs(e,r),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const r=_n(s.shape,i);r.length>0&&(e=on(fs(e,r),s.shape));const a=Es(s);return us(Ln(e,Qe(a,"float32")))}}}},ar,or,lr,ur,hr,pr,cr,dr,fr,yr,br,wr,kr,xr,vr,Sr,Ir,Nr,Ar,$r,$r,Dr,Er,{kernelName:ft,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{filterSize:r,strides:a,pad:o}=n;return{x:()=>Fr(t,s,i,r,a,o)}}},{kernelName:gt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{axis:i}=n,a=u(i,s.shape),o=r(function(t,e){const n=[],s=t.length;for(let i=0;it[e]))]}(s.shape,a)[1]);return{x:()=>{const e=s.shape.slice();a.forEach((t=>{e[t]=1}));const n=on(t,e);return Ln(pn(n,As(s.shape,"float32")),o)}}}},{kernelName:"Min",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const s=n,{axis:i}=s,[r,a]=e,o=Cr(t,a,r,u(i,r.shape));return{x:()=>o.x()}}},{kernelName:mt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e;return{a:()=>pn(t,Qe(is(n,s),"float32")),b:()=>pn(t,Qe(Zn(n,s),"float32"))}}},{kernelName:yt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const s=e[0],{paddings:i}=n,r=i.map((t=>t[0]));return{x:()=>fn(t,r,s.shape)}}},{kernelName:"Mod",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{const e=_n(n.shape,i);return e.length>0?on(fs(t,e),n.shape):t},b:()=>{const e=pn(t,us(Hn(Ln(n,s)))),r=_n(s.shape,i);return r.length>0?on(fs(e,r),s.shape):e}}}},{kernelName:bt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{const e=pn(t,Qe(s,"float32")),r=_n(n.shape,i);return r.length>0?on(fs(e,r),n.shape):e},b:()=>{const e=pn(t,Qe(n,"float32")),r=_n(s.shape,i);return r.length>0?on(fs(e,r),s.shape):e}}}},{kernelName:"Neg",gradFunc:t=>({x:()=>us(t)})},{kernelName:kt,inputsToSave:["indices"],gradFunc:(t,e)=>{const n=e[0];return{indices:()=>zs(n.shape,"float32")}}},{kernelName:wt,gradFunc:t=>({x:()=>Bn(t)})},{kernelName:xt,saveAllInputs:!0,gradFunc:(t,e,n)=>{const{axis:s}=n;return bi(t,s).map((t=>()=>t))}},Lr,Lr,{kernelName:"Pow",inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(t,e)=>{const[n,s,i]=e,r=n,a=s,o=Rn(r.shape,a.shape);return{a:()=>{const e=Qe(a,"float32");let n=pn(t,pn(e,Bs(r,ds(e,Zs(1)))));const s=_n(r.shape,o);return s.length>0&&(n=fs(n,s)),on(n,r.shape)},b:()=>{const e=Zn(r,0),n=On(e,as(r),Bn(r));let s=pn(t,pn(i,n));const l=_n(a.shape,o);return l.length>0&&(s=fs(s,l)),on(s,a.shape)}}}},{kernelName:St,inputsToSave:["x","alpha"],gradFunc:(t,e)=>{const[n,s]=e,i=Zn(n,0);return{x:()=>On(i,t,pn(t,s)),alpha:()=>{let e=On(i,Bn(t),pn(t,n));const r=_n(s.shape,t.shape);return r.length>0&&(e=fs(e,r)),on(e,s.shape)}}}},{kernelName:It,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,us(Es(n)))}}},{kernelName:$t,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,s=pn(is(n,6),pi(n));return{x:()=>pn(t,Qe(s,"float32"))}}},{kernelName:Nt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,Qe(pi(n),"float32"))}}},{kernelName:zt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>on(t,n.shape)}}},{kernelName:Ct,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[s]=e,i={dy:t,images:s};return{images:()=>Ee.runKernel("ResizeBilinearGrad",i,n)}}},{kernelName:At,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[s]=e,i={dy:t,images:s};return{images:()=>Ee.runKernel("ResizeNearestNeighborGrad",i,n)}}},{kernelName:Dt,gradFunc:(t,e,n)=>{const{dims:s}=n,i=u(s,t.shape);return{x:()=>qs(t,i)}}},{kernelName:Tt,gradFunc:t=>({x:()=>Bn(t)})},{kernelName:Et,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>us(Ln(t,pn(Bs(n,1.5),2)))}}},{kernelName:Ft,inputsToSave:["condition"],gradFunc:(t,e)=>{const[n]=e;return{condition:()=>Qe(Bn(n),"float32"),t:()=>pn(t,Qe(n,t.dtype)),e:()=>pn(t,Qe(ks(n),t.dtype))}}},{kernelName:Lt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Zn(n,Zs(0)),s=Zs(1.7580993408473768),i=Zs(1.0507009873554805),r=pn(t,i),a=pn(pn(t,s),Vn(Qe(n,"float32")));return On(e,r,a)}}}},{kernelName:Ot,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(n,ds(Zs(1),n)))}}},{kernelName:Mt,gradFunc:t=>({x:()=>Bn(t)})},{kernelName:"Sin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(An(Qe(n,"float32")),t)}}},{kernelName:Rt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(Cn(Qe(n,"float32")),t)}}},{kernelName:_t,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[i]=e,{begin:r,size:a}=n,o=i.shape,[l,u]=function(t,e,n){let i;const r=t.shape.length;let a;return i="number"==typeof e?[e,...new Array(r-1).fill(0)]:e.length{s(-1!==t,(()=>"slice() does not support negative begin indexing."))})),a=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengthe>=0?e:(s(-1===e,(()=>`Negative size values should be exactly -1 but got ${e} for the slice() size at index ${n}.`)),t.shape[n]-i[n]))),[i,a]}(i,r,a),h=[];for(let e=0;eRs(t,h)}}},{kernelName:Kt,outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s]=e,{dim:i}=n,r=pn(t,s);return{logits:()=>ds(r,pn(fs(r,[i],true),s))}}},{kernelName:Bt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,dn(n))}}},_r,_r,Rr,Rr,{kernelName:Wt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,pn(li(Qe(n,"float32")),2))}}},{kernelName:Vt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Zs(2);return{a:()=>pn(t,pn(i,ds(n,s))),b:()=>pn(t,pn(i,ds(s,n)))}}},{kernelName:"Square",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(Qe(n,"float32"),2))}}},{kernelName:Xt,gradFunc:t=>({x:()=>Bn(t)})},{kernelName:"Sub",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=Rn(n.shape,s.shape);return{a:()=>{let e=t;const s=_n(n.shape,i);return s.length>0&&(e=fs(e,s)),on(e,n.shape)},b:()=>{let e=t;const n=_n(s.shape,i);return n.length>0&&(e=fs(e,n)),on(us(e),s.shape)}}}},{kernelName:"Sum",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,i=s.shape.slice(),{axis:r}=n;u(r,s.shape).forEach((t=>{i[t]=1}));const a=on(t,i),o=pn(a,As(s.shape,"float32"));return{x:()=>o}}},{kernelName:"Tan",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Ln(t,Es(An(n)))}}},{kernelName:jt,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(ds(Zs(1),Es(n)),t)}}},{kernelName:qt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{reps:i}=n;return{x:()=>{let e=Bn(s);if(1===s.rank)for(let n=0;n{const s=n,{perm:i}=s,r=ys(i);return{x:()=>wi(t,r)}}},{kernelName:Ht,gradFunc:(t,e,n)=>{const s=n,{axis:i}=s;return{value:()=>ci(t,i)}}},{kernelName:Jt,inputsToSave:["segmentIds"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>function(t,e){const n=Is(e,Bn(e)),s=Jn(t,n);let i=Xn(e,Zs(0,"int32"));const r=s.rank-i.rank;for(let t=0;t({x:()=>Bn(t)})}];for(const t of Mr)se(t);let Or;function Br(){return null==Or&&(Or=e.backend().epsilon()),Or}class Wr extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Wr.prototype)}}class Pr extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Pr.prototype)}}class Ur extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Ur.prototype)}}class Kr extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Kr.prototype)}}class Vr extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Vr.prototype)}}function jr(t,e){if(Array.isArray(t)){let n=[];for(let s=0;se.toUpperCase()))}let Yr={};function Qr(t){if(null==t)return null;const e={};return e.className=t.getClassName(),e.config=t.getConfig(),e}function ta(t){if(null!=t&&"object"==typeof t)if(Array.isArray(t))t.forEach((t=>ta(t)));else{const e=Object.keys(t);for(const n of e){const e=t[n];null!=e&&"object"==typeof e&&(Array.isArray(e)||"ndarray"!==e.type||"number"!=typeof e.value?ta(e):t[n]=e.value)}}}function ea(t,e={},n={},s="object",i=!1){if("string"==typeof t){const i=t;let r;if(i in n)r=n[i];else if(i in Yr)r=Yr[i];else if(r=e[i],null==r)throw new Ur(`Unknown ${s}: ${t}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return r}{const r=t;if(null==r.className||null==r.config)throw new Ur(`${s}: Improper config format: ${JSON.stringify(r)}.\n'className' and 'config' must set.`);const a=r.className;let o,l;if(a in n?[o,l]=n[a]:a in Yr?[o,l]=Yr.className:a in e&&([o,l]=e[a]),null==o)throw new Ur(`Unknown ${s}: ${a}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const t={};for(const e of Object.keys(Yr))t[e]=Yr[e];for(const e of Object.keys(n))t[e]=n[e];r.config.customObjects=t;const e=Object.assign({},Yr);for(const t of Object.keys(n))Yr[t]=n[t];ta(r.config);const s=l(o,r.config,n,i);return Yr=Object.assign({},e),s}{const t=Object.assign({},Yr);for(const t of Object.keys(n))Yr[t]=n[t];const e=new o(r.config);return Yr=Object.assign({},t),e}}}function na(t,e){return-1*function(t,e){return te?1:0}(t,e)}function sa(t){if(null==t)return t;const e=[];for(const n of t)-1===e.indexOf(n)&&e.push(n);return e}function ia(t){if(null==t)throw new Ur(`Invalid value in obj: ${JSON.stringify(t)}`);for(const e in t)if(t.hasOwnProperty(e))return!1;return!0}function ra(t,e,n){if(null!=n&&t.indexOf(n)<0)throw new Ur(`${n} is not a valid ${e}. Valid values are ${t} or null/undefined.`)}function aa(t,e,n=0,s=1/0){return qr(n>=0),qr(s>=n),Array.isArray(t)&&t.length>=n&&t.length<=s&&t.every((t=>typeof t===e))}function oa(t,n){Array.isArray(t)?(e.util.assert(t.length>0,(()=>`${n} is unexpectedly an empty array.`)),t.forEach(((t,e)=>oa(t,`element ${e+1} of ${n}`)))):e.util.assert(Number.isInteger(t)&&t>0,(()=>`Expected ${n} to be a positive integer, but got ${la(t)}.`))}function la(t){return null===t?"null":Array.isArray(t)?"["+t.map((t=>la(t))).join(",")+"]":"string"==typeof t?`"${t}"`:`${t}`}function ua(t){return"relu"===t?"relu":"linear"===t?"linear":"elu"===t?"elu":null}function ha(t,n){return e.tidy((()=>e.sqrt(e.sum(e.mul(t,t),n,!0))))}class ca extends e.serialization.Serializable{getConfig(){return{}}}class pa extends ca{constructor(t){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=t.maxValue?t.maxValue:this.defaultMaxValue,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return e.tidy((()=>{const n=ha(t,this.axis),s=e.clipByValue(n,0,this.maxValue);return e.mul(t,e.div(s,e.add(Br(),n)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}pa.className="MaxNorm",e.serialization.registerClass(pa);class da extends ca{constructor(t){super(),this.defaultAxis=0,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return e.tidy((()=>e.div(t,e.add(Br(),ha(t,this.axis)))))}getConfig(){return{axis:this.axis}}}da.className="UnitNorm",e.serialization.registerClass(da);class fa extends ca{apply(t){return e.relu(t)}}fa.className="NonNeg",e.serialization.registerClass(fa);class ga extends ca{constructor(t){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=t.minValue?t.minValue:this.defaultMinValue,this.maxValue=null!=t.maxValue?t.maxValue:this.defaultMaxValue,this.rate=null!=t.rate?t.rate:this.defaultRate,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return e.tidy((()=>{const n=ha(t,this.axis),s=e.add(e.mul(this.rate,e.clipByValue(n,this.minValue,this.maxValue)),e.mul(1-this.rate,n));return e.mul(t,e.div(s,e.add(Br(),n)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}ga.className="MinMaxNorm",e.serialization.registerClass(ga);const ma={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function ya(t){return Qr(t)}function ba(t,n={}){return ea(t,e.serialization.SerializationMap.getMap().classNameMap,n,"constraint")}function wa(t){if(null==t)return null;if("string"==typeof t){return ba({className:t in ma?ma[t]:t,config:{}})}return t instanceof ca?t:ba(t)}var ka=Object.freeze({__proto__:null,maxNorm:function(t){return new pa(t)},unitNorm:function(t){return new da(t)},nonNeg:function(){return new fa},minMaxNorm:function(t){return new ga(t)}});const xa=["channelsFirst","channelsLast"],va=["nearest","bilinear"],Sa=["valid","same","causal"],Ia=["max","avg"],Na=["sum","mul","concat","ave"],za=new Map;function Aa(t){ra(xa,"DataFormat",t)}function Ca(t){ra(Sa,"PaddingMode",t)}function $a(t){ra(Ia,"PoolMode",t)}const Da=[];function Ta(t,e){Da.push(t);try{const t=e();return Da.pop(),t}catch(t){throw Da.pop(),t}}function Ea(t){if(!_a(t))throw new Error("Not a valid tensor name: '"+t+"'");return(0===Da.length?"":Da.join("/")+"/")+t}function Fa(t){if(!_a(t))throw new Error("Not a valid tensor name: '"+t+"'");za.has(t)||za.set(t,0);const e=za.get(t);if(za.set(t,za.get(t)+1),e>0){const n=`${t}_${e}`;return za.set(n,1),n}return t}const La=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function _a(t){return!!t.match(La)}function Ra(t,e,n){null==e&&(e=0),null==n&&(n=t.length);let s=1;for(let i=e;i{switch(t.rank){case 1:return e.slice1d(t,n,s);case 2:return e.slice2d(t,[n,0],[s,t.shape[1]]);case 3:return e.slice3d(t,[n,0,0],[s,t.shape[1],t.shape[2]]);case 4:return e.slice4d(t,[n,0,0,0],[s,t.shape[1],t.shape[2],t.shape[3]]);case 5:return e.slice(t,[n,0,0,0,0],[s,t.shape[1],t.shape[2],t.shape[3],t.shape[4]]);case 6:return e.slice(t,[n,0,0,0,0,0],[s,t.shape[1],t.shape[2],t.shape[3],t.shape[4],t.shape[5]]);default:throw new Ur(`sliceAlongFirstAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function Va(t,n,s){return e.tidy((()=>{switch(t.rank){case 1:return e.slice1d(t,n,s);case 2:return e.slice2d(t,[0,n],[t.shape[0],s]);case 3:return e.slice3d(t,[0,0,n],[t.shape[0],t.shape[1],s]);case 4:return e.slice4d(t,[0,0,0,n],[t.shape[0],t.shape[1],t.shape[2],s]);default:throw new Ur(`sliceAlongLastAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function ja(t,n,s,i){return e.tidy((()=>{switch(t.rank){case 1:return e.slice1d(t,n,s);case 2:switch(i){case 1:return Ka(t,n,s);case 2:return Va(t,n,s);default:throw new Ur(`The axis is not within the rank of the tensor ${i}`)}case 3:switch(i){case 1:return Ka(t,n,s);case 2:return e.slice3d(t,[0,n,0],[t.shape[0],s,t.shape[2]]);case 3:return Va(t,n,s);default:throw new Ur(`The axis is not within the rank of the tensor ${i}`)}case 4:switch(i){case 1:return Ka(t,n,s);case 2:return e.slice4d(t,[0,n,0,0],[t.shape[0],s,t.shape[2],t.shape[3]]);case 3:return e.slice4d(t,[0,0,n,0],[t.shape[0],t.shape[1],s,t.shape[3]]);case 4:return Va(t,n,s);default:throw new Ur(`The axis is not within the rank of the tensor ${i}`)}default:throw new Ur(`sliceAlongLastAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function qa(t,n=-1){let s;return n<0&&(s=t[0].rank,n=0!==s?s:0),n===t[0].rank&&(n=-1),e.concat(t,n)}function Ga(t,n){switch(t.rank){case 1:return e.concat1d([t,n]);case 2:return e.concat2d([t,n],0);case 3:return e.concat3d([t,n],0);case 4:return e.concat4d([t,n],0);default:throw new Ur(`concatAlongFirstAxis() received an unsupported tensor rank: ${t.rank}`)}}function Ha(t,n){if(Array.isArray(n)||(n=[n]),t.rank!==n.length)throw new Ur(`The length of input n (${n.length}) does not match the number of dimensions in input x (${t.rank})`);return e.tile(t,n)}function Ja(t,n=0,s=1,i,r){return e.randomNormal(t,n,s,i,r)}function Za(t,n,s,i){if(t.rank<2||n.rank<2)throw new Kr(`dot requires both inputs to be rank >= 2 but got x shape = ${t.shape} and y shape = ${n.shape}`);if(n.rank>=3){if(t.shape.slice(-1)[0]!==n.shape.slice(-2)[0])throw new Kr(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${t.shape} and y shape = ${n.shape}`)}if(2===t.rank&&2===n.rank){const r=!1,a=!1;return e.fused.matMul({a:t,b:n,transposeA:r,transposeB:a,bias:i?Qa(t.rank,i,"channelsLast"):null,activation:s})}{const r=t.shape.slice(),a=r.pop();t=t.reshape([-1,a]);const o=n.shape.slice(),l=o.pop(),u=o.pop(),h=[...o,l],c=Array.from({length:n.rank},((t,e)=>0===e?n.rank-2:e<=n.rank-2?e-1:e));n=n.transpose(c).reshape([u,-1]);const p=[...r,...h],d=!1,f=!1;return e.fused.matMul({a:t,b:n,transposeA:d,transposeB:f,bias:i?Qa(t.rank,i,"channelsLast"):null,activation:s}).reshape(p)}}function Xa(t,n,s){return e.tidy((()=>(n=Array.isArray(n)?e.tensor1d(n,"int32"):n.toInt(),e.gather(t,n,s))))}function Ya(t){return e.mul(t,t)}function Qa(t,e,n){const s=e.shape;if(1!==e.rank&&e.rank!==t)throw new Ur(`Unexpected bias dimensions: ${e.rank}; expected it to be 1 or ${t}`);if(5===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1,1,1]):e.reshape([1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,1,1,s[0]]):e.reshape([1].concat(s))}else if(4===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1,1]):e.reshape([1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,1,s[0]]):e.reshape([1].concat(s))}else if(3===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1]):e.reshape([1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,s[0]]):e.reshape([1].concat(s))}else if(t<3)return e;throw new Ur(`Unsupported input rank by biasAdd: ${e.rank}`)}function to(t,n,s){return e.tidy((()=>(null==s&&(s="channelsLast"),Aa(s),t.add(Qa(t.rank,n,s)))))}function eo(t,n,s,i){return e.tidy((()=>e.dropout(t,n,s,i)))}function no(t,e,n=!1){return n?t():e()}const so=["fanIn","fanOut","fanAvg"],io=["normal","uniform","truncatedNormal"];class ro extends e.serialization.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class ao extends ro{apply(t,n){return e.zeros(t,n)}}ao.className="Zeros",e.serialization.registerClass(ao);class oo extends ro{apply(t,n){return e.ones(t,n)}}oo.className="Ones",e.serialization.registerClass(oo);class lo extends ro{constructor(t){if(super(),"object"!=typeof t)throw new Ur(`Expected argument of type ConstantConfig but got ${t}`);if(void 0===t.value)throw new Ur(`config must have value set but got ${t}`);this.value=t.value}apply(t,n){return e.tidy((()=>e.mul(e.scalar(this.value),e.ones(t,n))))}getConfig(){return{value:this.value}}}lo.className="Constant",e.serialization.registerClass(lo);class uo extends ro{constructor(t){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=t.minval||this.DEFAULT_MINVAL,this.maxval=t.maxval||this.DEFAULT_MAXVAL,this.seed=t.seed}apply(t,n){return e.randomUniform(t,this.minval,this.maxval,n)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}uo.className="RandomUniform",e.serialization.registerClass(uo);class ho extends ro{constructor(t){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=t.mean||this.DEFAULT_MEAN,this.stddev=t.stddev||this.DEFAULT_STDDEV,this.seed=t.seed}apply(t,e){if("float32"!==(e=e||"float32")&&"int32"!==e)throw new Kr(`randomNormal does not support dType ${e}.`);return Ja(t,this.mean,this.stddev,e,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}ho.className="RandomNormal",e.serialization.registerClass(ho);class co extends ro{constructor(t){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=t.mean||this.DEFAULT_MEAN,this.stddev=t.stddev||this.DEFAULT_STDDEV,this.seed=t.seed}apply(t,n){if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Kr(`truncatedNormal does not support dType ${n}.`);return e.truncatedNormal(t,this.mean,this.stddev,n,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}co.className="TruncatedNormal",e.serialization.registerClass(co);class po extends ro{constructor(t){super(),this.gain=null!=t.gain?t.gain:1}apply(t,n){return e.tidy((()=>{if(2!==t.length||t[0]!==t[1])throw new Ur("Identity matrix initializer can only be used for 2D square matrices.");return e.mul(this.gain,e.eye(t[0]))}))}getConfig(){return{gain:this.gain}}}po.className="Identity",e.serialization.registerClass(po);class fo extends ro{constructor(t){if(super(),t.scale<0)throw new Ur(`scale must be a positive float. Got: ${t.scale}`);var e;this.scale=null==t.scale?1:t.scale,this.mode=null==t.mode?"fanIn":t.mode,e=this.mode,ra(so,"FanMode",e),this.distribution=null==t.distribution?"normal":t.distribution,function(t){ra(io,"Distribution",t)}(this.distribution),this.seed=t.seed}apply(t,n){const s=function(t,e="channelsLast"){let n,s;if(Aa(e),2===t.length)n=t[0],s=t[1];else if(-1!==[3,4,5].indexOf(t.length)){if("channelsFirst"===e){const e=Ra(t,2);n=t[1]*e,s=t[0]*e}else if("channelsLast"===e){const e=Ra(t,0,t.length-2);n=t[t.length-2]*e,s=t[t.length-1]*e}}else{const e=Ra(t);n=Math.sqrt(e),s=Math.sqrt(e)}return[n,s]}(t),i=s[0],r=s[1];let a=this.scale;if("fanIn"===this.mode?a/=Math.max(1,i):"fanOut"===this.mode?a/=Math.max(1,r):a/=Math.max(1,(i+r)/2),"normal"===this.distribution){const s=Math.sqrt(a);if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Kr(`${this.getClassName()} does not support dType ${n}.`);return e.truncatedNormal(t,0,s,n,this.seed)}{const s=Math.sqrt(3*a);return e.randomUniform(t,-s,s,n)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}fo.className="VarianceScaling",e.serialization.registerClass(fo);class go extends fo{constructor(t){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return fo.className}}go.className="GlorotUniform",e.serialization.registerClass(go);class mo extends fo{constructor(t){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return fo.className}}mo.className="GlorotNormal",e.serialization.registerClass(mo);class yo extends fo{constructor(t){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return fo.className}}yo.className="HeNormal",e.serialization.registerClass(yo);class bo extends fo{constructor(t){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return fo.className}}bo.className="HeUniform",e.serialization.registerClass(bo);class wo extends fo{constructor(t){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return fo.className}}wo.className="LeCunNormal",e.serialization.registerClass(wo);class ko extends fo{constructor(t){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return fo.className}}ko.className="LeCunNormal",e.serialization.registerClass(ko);class xo extends ro{constructor(t){if(super(),this.DEFAULT_GAIN=1,this.gain=null==t.gain?this.DEFAULT_GAIN:t.gain,this.seed=t.seed,null!=this.seed)throw new Kr("Random seed is not implemented for Orthogonal Initializer yet.")}apply(t,n){return e.tidy((()=>{if(t.length<2)throw new Kr("Shape must be at least 2D.");t[0]*t[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${t[0]*t[1]}) elements: Slowness may result.`);const n=Ja(t[0]>t[1]?[t[1],t[0]]:t,0,1,"float32");let s=e.linalg.gramSchmidt(n);return t[0]>t[1]&&(s=s.transpose()),e.mul(this.gain,s)}))}getConfig(){return{gain:this.gain,seed:this.seed}}}xo.className="Orthogonal",e.serialization.registerClass(xo);const vo={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function So(t,n={}){return ea(t,e.serialization.SerializationMap.getMap().classNameMap,n,"initializer")}function Io(t){return Qr(t)}function No(t){if("string"==typeof t){const e=t in vo?vo[t]:t;if("GlorotNormal"===e)return new mo;if("GlorotUniform"===e)return new go;if("HeNormal"===e)return new yo;if("HeUniform"===e)return new bo;if("LeCunNormal"===e)return new wo;if("LeCunUniform"===e)return new ko;{const t={};return t.className=e,t.config={},So(t)}}return t instanceof ro?t:So(t)}var zo=Object.freeze({__proto__:null,zeros:function(){return new ao},ones:function(){return new oo},constant:function(t){return new lo(t)},randomUniform:function(t){return new uo(t)},randomNormal:function(t){return new ho(t)},truncatedNormal:function(t){return new co(t)},identity:function(t){return new po(t)},varianceScaling:function(t){return new fo(t)},glorotUniform:function(t){return new go(t)},glorotNormal:function(t){return new mo(t)},heNormal:function(t){return new yo(t)},heUniform:function(t){return new bo(t)},leCunNormal:function(t){return new wo(t)},leCunUniform:function(t){return new ko(t)},orthogonal:function(t){return new xo(t)}});let Ao=0;function Co(){return Ao++}const $o={};function Do(t=""){return t in $o||($o[t]=0),$o[t]+=1,t+$o[t].toString()}function To(t){return Array.isArray(t)&&Array.isArray(t[0])}function Eo(t){return 0===t.length?[]:Array.isArray(t[0])?t:[t]}function Fo(t){let e;if(Array.isArray(t)){if(1!==t.length)throw new Ur(`Expected Tensor length to be 1; got ${t.length}`);e=t[0]}else e=t;return e}function Lo(t){if(Array.isArray(t)&&Array.isArray(t[0])){if(1===t.length)return(t=t)[0];throw new Ur(`Expected exactly 1 Shape; got ${t.length}`)}return t}function _o(t){let e=0;for(const n of t)0===n.shape.length?e+=1:e+=n.shape.reduce(((t,e)=>t*e));return e}const Ro="Variable";class Mo{constructor(t,n="float32",s="Variable",i=!0,r=null){this.dtype=null==n?"float32":n,this.shape=t.shape,this.id=Co(),s=null==s?Ro:s,this.originalName=Ea(s),this.name=Fa(this.originalName),this.trainable_=i,this.constraint=r,this.val=e.variable(t,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(t){return this.assertNotDisposed(),function(t,e){if(t.shape.toString()!==e.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(t.shape)+" vs. "+JSON.stringify(e.shape))}(this.val,t),this.val.id!==t.id&&(this.val.assign(t),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(t){this.trainable_=t,this.val.trainable=t}}function Oo(t){return t.map((t=>t.read()))}function Bo(t){t.forEach((t=>{t[0].write(t[1])}))}class Wo{constructor(t){this.dtype=t.dtype,this.shape=t.shape,null!=t.shape?this.ndim=t.shape.length:this.ndim=t.ndim,this.maxNDim=t.maxNDim,this.minNDim=t.minNDim,this.axes=t.axes||{}}}class Po{constructor(t,e,n,s,i,r,a){this.dtype=t,this.shape=e,this.sourceLayer=n,this.inputs=s,this.callArgs=i,this.outputTensorIndex=a,this.id=Co(),null!=r&&(this.originalName=Ea(r),this.name=Fa(this.originalName)),this.rank=e.length}}let Uo=0;class Ko{constructor(t,e){this.callArgs=e,this.id=Uo++,this.outboundLayer=t.outboundLayer,this.inboundLayers=t.inboundLayers,this.nodeIndices=t.nodeIndices,this.tensorIndices=t.tensorIndices,this.inputTensors=t.inputTensors,this.outputTensors=t.outputTensors,this.inputMasks=t.inputMasks,this.outputMasks=t.outputMasks,this.inputShapes=t.inputShapes,this.outputShapes=t.outputShapes;for(const e of t.inboundLayers)null!=e&&e.outboundNodes.push(this);t.outboundLayer.inboundNodes.push(this)}getConfig(){const t=[];for(const e of this.inboundLayers)null!=e?t.push(e.name):t.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:t,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let Vo=0;class jo extends e.serialization.Serializable{constructor(t={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Vo++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let e=t.name;if(!e){const t=this.getClassName();e=Zr(t)+"_"+Do(t)}if(this.name=e,this.trainable_=null==t.trainable||t.trainable,null!=t.inputShape||null!=t.batchInputShape){let e;if(null!=t.batchInputShape)e=t.batchInputShape;else if(null!=t.inputShape){let n=null;null!=t.batchSize&&(n=t.batchSize),e=[n].concat(t.inputShape)}this.batchInputShape=e;let n=t.dtype;null==n&&(n=t.inputDType),null==n&&(n="float32"),this.dtype=n}null!=t.weights?this.initialWeights=t.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(t,e){return t.name+"_ib-"+e.toString()}getNodeAtIndex(t,e){if(0===this.inboundNodes.length)throw new Pr(`The layer has never been called and thus has no defined ${e}.`);if(this.inboundNodes.length<=t)throw new Ur(`Asked to get ${e} at node ${t}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[t]}getInputAt(t){return Hr(this.getNodeAtIndex(t,"input").inputTensors)}getOutputAt(t){return Hr(this.getNodeAtIndex(t,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new Wr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new Wr(`Layer ${this.name} is not connected, no input to return.`);return Hr(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new Wr(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new Wr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Hr(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((t=>t()))}get updates(){return this._updates}get built(){return this._built}set built(t){this._built=t}get trainable(){return this.trainable_}set trainable(t){this._trainableWeights.forEach((e=>e.trainable=t)),this.trainable_=t}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((t=>t.trainable)):[]}set trainableWeights(t){this._trainableWeights=t}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((t=>!t.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(t){this._nonTrainableWeights=t}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(t){if(t=Jr(t),null==this.inputSpec||0===this.inputSpec.length)return;const e=Jr(this.inputSpec);if(t.length!==e.length)throw new Ur(`Layer ${this.name} expects ${e.length} inputs, but it received ${t.length} input tensors. Input received: ${t}`);for(let n=0;ni.maxNDim)throw new Ur(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${i.maxNDim}, found ndim=${r}`);if(null!=i.minNDim&&r=0?t[s]:t[t.length+s];if(null!=r&&-1===[r,null].indexOf(a))throw new Ur(`Input ${n} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${r} but got shape ${t}.`)}}if(null!=i.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(t);const e=[];for(const n of Jr(t))e.push(n.shape);this.build(Hr(e)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&i&&(this._refCount=1)}if(this.assertInputCompatibility(t),i){let s=this.call(t,e);const i=Jr(s),r=[];for(let t of i)-1!==n.indexOf(t)&&(t=t.clone()),r.push(t);if(s=Hr(r),null!=this.activityRegularizer)throw new Kr("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(t){t=Jr(t);const e=[];for(const n of t)e.push(n.shape);return Hr(e)}(t),s=this.computeOutputShape(n);let i;const r="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(t)?n[0]:n),i=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new Po(r,n,this,Jr(t),e,this.name,s))):new Po(r,s,this,Jr(t),e,this.name),this.addInboundNode(t,i,null,null,n,s,e),this._refCount++,null!=this.activityRegularizer)throw new Kr("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return i}}))}warnOnIncompatibleInputShape(t){if(null!=this.batchInputShape)if(t.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(t)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let e=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=t[s]&&t[s]!==n&&(e=!0)})),e&&console.warn(`The shape of the input tensor (${JSON.stringify(t)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Wr(`The layer ${this.name} has never been called and thus has no defined output shape.`);const t=[];for(const e of this.inboundNodes){const n=JSON.stringify(e.outputShapes);-1===t.indexOf(n)&&t.push(n)}if(1===t.length){const t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&1===t.length?t[0]:t}throw new Wr(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Pr(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return _o(this.weights)}build(t){this.built=!0}getWeights(t=!1){return Oo(t?this.trainableWeights:this.weights)}setWeights(t){e.tidy((()=>{const n=this.weights;if(n.length!==t.length)throw new Ur(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${t.length}, but the layer was expecting ${n.length} weights. Provided weights: ${t}...`);if(0===n.length)return;const s=[],i=Oo(n);for(let r=0;ri.apply(l.read()))),null==r&&(r=!0),r?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(t){this.fastWeightInitDuringBuild=t}addLoss(t){null==t||Array.isArray(t)&&0===t.length||(t=Jr(t),void 0!==this._losses&&null!==this._losses&&this.losses.push(...t))}computeOutputShape(t){return t}computeMask(t,e){if(!this.supportsMasking){if(null!=e){if(!Array.isArray(e))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);e.forEach((t=>{if(null!=t)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return e}addInboundNode(t,e,n,s,i,r,a=null){const o=Jr(t);e=Jr(e),n=Jr(n),s=Jr(s),i=Eo(i),r=Eo(r);const l=[],u=[],h=[];for(const t of o)l.push(t.sourceLayer),u.push(t.nodeIndex),h.push(t.tensorIndex);new Ko({outboundLayer:this,inboundLayers:l,nodeIndices:u,tensorIndices:h,inputTensors:o,outputTensors:e,inputMasks:n,outputMasks:s,inputShapes:i,outputShapes:r},a);for(let t=0;tt.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let t=0;return 0==--this._refCount&&(t=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:t}}}function qo(t,e,n){if((null==e||null!=n&&n>0)&&(e=t.sourceLayer,n=t.nodeIndex),0===e.inboundNodes.length)return[t];{const t=e.inboundNodes[n];if(0===t.inboundLayers.length)return t.inputTensors;{const e=[];for(let n=0;n0){const r=await Promise.all(n);for(let e=0;ee.add(this.totals[t],e.mul(i,s))));this.totals[t]=r,null!=n&&n.dispose()}}}async onEpochEnd(t,n){if(null!=n)for(const t of this.params.metrics)null!=this.totals[t]&&("number"==typeof this.totals[t]?n[t]=this.totals[t]/this.seen:e.tidy((()=>{const s=e.mul(e.div(1,this.seen),this.totals[t]);n[t]=s,this.totals[t].dispose(),e.keep(n[t])})))}}class el extends Yo{async onTrainBegin(t){this.epoch=[],this.history={}}async onEpochEnd(t,e){null==e&&(e={}),this.epoch.push(t);for(const t in e)null==this.history[t]&&(this.history[t]=[]),this.history[t].push(e[t])}async syncData(){const t=[],e=[],n=[];for(const s in this.history){const i=this.history[s];for(let r=0;r{const a=e.util.now();return a-inew nl(t,e)))}class il{constructor(){}static registerCallbackConstructor(t,n){e.util.assert(t>=0&&Number.isInteger(t),(()=>`Verbosity level is expected to be an integer >= 0, but got ${t}`)),il.checkForDuplicate(n),null==il.constructors[t]&&(il.constructors[t]=[]),il.constructors[t].push(n)}static checkForDuplicate(t){for(const e in il.constructors){il.constructors[+e].forEach((e=>{if(e===t)throw new Ur("Duplicate callback constructor.")}))}}static clear(){il.constructors={}}static createCallbacks(t){const e=[];for(const n in il.constructors){const s=+n;t>=s&&e.push(...il.constructors[s])}return e.map((t=>new t))}}function rl(t,e,n,s,i,r,a,o,l){const u=new el,h=[new tl,...il.createCallbacks(e)];null!=t&&h.push(...t),h.push(u);const c=new Qo(h);return c.setParams({epochs:n,initialEpoch:s,samples:i,steps:r,batchSize:a,verbose:e,doValidation:o,metrics:l}),{callbackList:c,history:u}}function al(t,n={},s=!1){return ea(t,e.serialization.SerializationMap.getMap().classNameMap,n,"layer",s)}function ol(t,n){return e.tidy((()=>{"float32"!==t.dtype&&(t=t.asType("float32"));const s=e.sum(Ya(t),n,!0),i=e.fill(s.shape,Br()),r=e.sqrt(e.maximum(s,i));return e.div(t,r)}))}function ll(t,n){return e.tidy((()=>e.mean(Ya(e.sub(n,t)),-1)))}function ul(t,n){return e.tidy((()=>e.mean(e.abs(e.sub(n,t)),-1)))}function hl(t,n){return e.tidy((()=>{const s=e.sub(t,n),i=e.clipByValue(e.abs(t),Br(),Number.MAX_VALUE),r=e.abs(e.div(s,i));return e.mul(100,e.mean(r,-1))}))}function cl(t,n,s=!1){return e.tidy((()=>{if(s)n=e.softmax(n);else{const t=e.sum(n,n.shape.length-1,!0);n=e.div(n,t)}return n=e.clipByValue(n,Br(),1-Br()),e.neg(e.sum(e.mul(t.toFloat(),e.log(n)),n.shape.length-1))}))}function pl(t,n,s=!1){return e.tidy((()=>{const i=e.floor(function(t){const e=[Ra(t.shape)];return t.reshape(e)}(t)).toInt(),r=(n=e.clipByValue(n,Br(),1-Br())).shape;return cl(e.oneHot(i,r[r.length-1]).reshape(r),n,s)}))}function dl(t,n){return e.tidy((()=>{let s;return s=e.clipByValue(n,Br(),1-Br()),s=e.log(e.div(s,e.sub(1,s))),e.mean(function(t,n){if(!e.util.arraysEqual(t.shape,n.shape))throw new Ur(`logits and labels must have the same shape, but got shapes ${JSON.stringify(t.shape)} and ${JSON.stringify(n.shape)}`);return e.tidy((()=>{const e=n.relu(),s=n.abs().neg();return e.sub(n.mul(t)).add(s.exp().log1p())}))}(t,s),-1)}))}function fl(t,n){return e.tidy((()=>{const s=ol(t,-1),i=ol(n,-1),r=e.mul(s,i);return e.neg(e.sum(r,-1))}))}il.constructors={};const gl={meanSquaredError:ll,meanAbsoluteError:ul,meanAbsolutePercentageError:hl,meanSquaredLogarithmicError:function(t,n){return e.tidy((()=>{const s=e.clipByValue(n,Br(),Number.MAX_VALUE),i=e.log(e.add(1,s)),r=e.clipByValue(t,Br(),Number.MAX_VALUE),a=e.log(e.add(1,r));return e.mean(Ya(e.sub(i,a)),-1)}))},squaredHinge:function(t,n){return e.tidy((()=>{const s=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(Ya(s),-1)}))},hinge:function(t,n){return e.tidy((()=>{const s=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(s,-1)}))},categoricalHinge:function(t,n){return e.tidy((()=>{const s=e.sum(e.mul(t,n),-1),i=e.max(e.mul(e.sub(1,t),n),-1);return e.maximum(0,e.add(1,e.sub(i,s)))}))},logcosh:function(t,n){return e.tidy((()=>{const s=Math.log(2),i=e.sub(n,t),r=e.sub(e.add(i,e.softplus(e.mul(-2,i))),s);return e.mean(r,-1)}))},categoricalCrossentropy:cl,sparseCategoricalCrossentropy:pl,binaryCrossentropy:dl,kullbackLeiblerDivergence:function(t,n){return e.tidy((()=>{const s=e.clipByValue(t,Br(),1),i=e.clipByValue(n,Br(),1);return e.sum(e.mul(t,e.log(e.div(s,i))),-1)}))},poisson:function(t,n){return e.tidy((()=>{const s=e.log(e.add(Br(),n));return e.mean(e.sub(n,e.mul(t,s)),-1)}))},cosineProximity:fl};function ml(t){if("string"==typeof t){if(t in gl)return gl[t];let e=`Unknown loss ${t}`;throw t.toLowerCase().includes("softmaxcrossentropy")&&(e=`Unknown loss ${t}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new Ur(e)}return t}function yl(t,n){return e.tidy((()=>{const s=e.mul(.5,e.onesLike(n)),i=Pa(e.greater(n,s),t.dtype);return e.mean(e.equal(t,i),-1)}))}function bl(t,n){return e.tidy((()=>Pa(e.equal(e.argMax(t,-1),e.argMax(n,-1)),"float32")))}function wl(t,n){return e.tidy((()=>e.logicalAnd(t.equal(1),n.equal(1)).sum().cast("float32")))}function kl(t,n){return e.tidy((()=>{const s=wl(t,n),i=function(t,n){return e.tidy((()=>e.logicalAnd(t.equal(0),n.equal(1)).sum().cast("float32")))}(t,n),r=s.add(i);return e.where(e.greater(r,0),s.div(r),0).cast("float32")}))}function xl(t,n){return e.tidy((()=>{const s=wl(t,n),i=function(t,n){return e.tidy((()=>e.logicalAnd(t.equal(1),n.equal(0)).sum().cast("float32")))}(t,n),r=s.add(i);return e.where(e.greater(r,0),s.div(r),0).cast("float32")}))}function vl(t,e){return dl(t,e)}function Sl(t,n){return t.rank===n.rank&&(t=t.squeeze([t.rank-1])),(n=n.argMax(-1)).dtype!==t.dtype&&(n=n.asType(t.dtype)),e.equal(t,n).asType("float32")}const Il=cl,Nl=pl,zl={binaryAccuracy:yl,categoricalAccuracy:bl,precision:kl,categoricalCrossentropy:Il,sparseCategoricalCrossentropy:Nl,mse:ll,MSE:ll,mae:ul,MAE:ul,mape:hl,MAPE:hl,cosine:fl};function Al(t){if("string"==typeof t&&t in zl)return zl[t];if("string"!=typeof t&&null!=t)return t;throw new Ur(`Unknown metric ${t}`)}function Cl(t){if(qr(null!==t,`Unknown LossOrMetricFn ${t}`),"string"==typeof t)return t;{let e;for(const n of Object.keys(gl))if(gl[n]===t){e=n;break}if(void 0!==e)return e;for(const n of Object.keys(zl))if(zl[n]===t){e=n;break}return void 0!==e?e:t.name}}const $l=1048576;function Dl(t,e,n=!1){if(null==t||"object"!=typeof t||Object.getPrototypeOf(t)!==Object.prototype||!Tl(t))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(t);n.length>$l&&console.warn(`User-defined metadata of model "${e}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function Tl(t){if(null===t)return!0;if("object"==typeof t){if(Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);for(const n of e){if("string"!=typeof n)return!1;if(!Tl(t[n]))return!1}return!0}if(Array.isArray(t)){for(const e of t)if(!Tl(e))return!1;return!0}return!1}{const e=typeof t;return"string"===e||"number"===e||"boolean"===e}}function El(t,e,n,s=console.log){const i=function(t){let e=!0;const n=[],s=[];for(const e in t.nodesByDepth)n.push(t.nodesByDepth[e]);for(const t of n){if(t.length>1||1===t.length&&t[0].inboundLayers.length>1){e=!1;break}s.push(...t)}if(e)for(const n of t.layers){let t=!1;for(const i of n.inboundNodes)if(-1!==s.indexOf(i)){if(t){e=!1;break}t=!0}if(!e)break}return e}(t),r=["Layer (type)","Output shape","Param #"];let a;if(i?(e=e||65,n=n||[.45,.85,1]):(e=e||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map((t=>Math.floor(e*t)))),!i){r.push("Receives inputs"),a=[];for(const e in t.nodesByDepth)a.push(...t.nodesByDepth[e])}s("_".repeat(e)),Fl(r,n,s),s("=".repeat(e));const o=t.layers;for(let t=0;t0&&(s=s.slice(0,s.length-1)+" "),s+=t[n],s=s.slice(0,e[n]),s+=" ".repeat(e[n]-s.length);n(s)}function Ll(t,e,n){let s;try{s=JSON.stringify(t.outputShape)}catch(t){s="multiple"}Fl([`${t.name} (${t.getClassName()})`,s,t.countParams().toString()],e,n)}function _l(t,e,n,s){let i;try{i=JSON.stringify(t.outputShape)}catch(t){i="multiple"}const r=[];for(const e of t.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(e)))for(let t=0;tt.name)),u=[],h=n.names();for(const t of l)-1!==h.indexOf(t)?u.push(n.getValue(t)):u.push(null);null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);const c=l.join(",")+"|"+n.names().join(",");let p,d;if(null==Pl[c]){const t=function(t,n){e.util.assert(null!=t&&t.length>0,(()=>"Expected at least one fetch, got none"));let s=[],i={};if(1===t.length){const e=jl(t[0],n);s=e.sorted,i=e.recipientMap}else{const e=new Set;for(const r of t){const{sorted:t,recipientMap:a}=jl(r,n);for(const n of t)e.has(n.name)||(s.push(n),e.add(n.name));for(const t in a)null==i[t]&&(i[t]=new Set),a[t].forEach((e=>i[t].add(e)))}}return{sorted:s,recipientCounts:Vl(i)}}(o,n);p=t.sorted,d=t.recipientCounts,Pl[c]=p,Ul[c]=d}p=Pl[c],d={},r||Object.assign(d,Ul[c]);const f=new Wl(n);for(let t=0;ti.maxNumTensors&&(i.maxNumTensors=t),t0;){const t=r[r.length-1];if(n.has(t.name)){r.pop();continue}const e=a[a.length-1]===r.length-1;if(0===t.inputs.length||e)r.pop(),s.push(t),n.add(t.name),e&&a.pop();else{a.push(r.length-1);for(const e of t.inputs)null==i[e.name]&&(i[e.name]=new Set),i[e.name].add(t.name),n.has(e.name)||r.push(e)}}return{sorted:s,recipientMap:i}}function ql(t){let e;if(1===t.sourceLayer.inboundNodes.length)e=t.sourceLayer.output;else{let n=null;for(let e=0;et.name))}`);sa(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map((t=>t.name))}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const t of this.outputs){const e=t.sourceLayer,n=t.nodeIndex,s=t.tensorIndex;this.outputLayers.push(e),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const t of this.inputs){const e=t.sourceLayer,n=t.nodeIndex,s=t.tensorIndex;qr(0===n,"input layer has >1 nodes"),qr(0===s,"input layer has >1 tensors"),this.inputLayers.push(e),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let e=0;et.shape)),this.internalOutputShapes=this.outputs.map((t=>t.shape));const e={},n={},s={},i={},r={},a=[],o=(t,e,n,s,i,l)=>{null!=s&&null!=i&&null!=l||(s=t.sourceLayer,i=t.nodeIndex,l=t.tensorIndex);const u=s.inboundNodes[i];if(-1!==n.indexOf(u))throw new Pr(`The tensor ${t.name} at layer "${s.name}" is part of a cycle.`);if(-1!==e.indexOf(u))return;this.containerNodes.add(Gl.nodeKey(s,i)),s.id in r||(r[s.id]=Object.keys(r).length),-1===n.indexOf(u)&&n.push(u);const h=u.inboundLayers.length;for(let t=0;t=0;)n.splice(n.indexOf(u),1);a.push(u)},l=[],u=[];for(const t of this.outputs)o(t,l,u);const h=a.slice().reverse();for(const t of h){n[t.id]=t,t.id in e||(e[t.id]=0);let r=e[t.id];const a=null==s[t.outboundLayer.id]?0:s[t.outboundLayer.id];r=Math.max(r,a),s[t.outboundLayer.id]=r,i[t.outboundLayer.id]=t.outboundLayer,e[t.id]=r;for(let s=0;sparseInt(t,10))).sort(na);this.layers=[];for(const t of d){const e=p[t];e.sort(((t,e)=>{const n=r[t.id],s=r[e.id];return ns?1:0}));for(const t of e)t instanceof Gl&&this.internalContainerRefs.push(t),this.layers.push(t)}this.layersByDepth=p,d=Object.keys(c).map((t=>parseInt(t,10))).sort(na);const f=this.inputs.slice(),g=[];for(const t of d)for(const e of c[t]){const t=e.outboundLayer;if(null!=t){for(const n of e.inputTensors)if(-1===f.indexOf(n))throw new Pr(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${t.name}". The following previous layers were accessed without issue: ${g}`);for(const t of e.outputTensors)f.push(t);g.push(t.name)}}this.nodesByDepth=c;const m=this.layers.map((t=>t.name));for(const t of m){const e=m.filter((e=>e===t)).length;if(1!==e)throw new Pr(`The name "${t}" is used ${e} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(m))}this.outboundNodes=[],this.inboundNodes=[],new Ko({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((t=>null)),outputMasks:this.outputs.map((t=>null)),inputShapes:this.inputs.map((t=>t.shape)),outputShapes:this.outputs.map((t=>t.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const t={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const e of this.layers)t.numDisposedVariables+=e.dispose().numDisposedVariables;for(const e of this.internalContainerRefs)t.numDisposedVariables+=e.dispose().numDisposedVariables}return t.refCountAfterDispose=this._refCount,t}get trainable(){return this.trainable_}set trainable(t){this.layers.forEach((e=>{e._trainableWeights.forEach((e=>e.trainable=t))})),this.trainable_=t}get trainableWeights(){if(this._trainableWeights.length>0)throw new Ur("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let t=[];for(const e of this.layers)t=t.concat(e.trainableWeights);return t}get nonTrainableWeights(){const t=[];for(const e of this.layers)t.push(...e.nonTrainableWeights);if(!this.trainable){const e=[];for(const t of this.layers)e.push(...t.trainableWeights);return e.concat(t)}return t}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(t,e=!0){const n={};let s=0;for(const t of this.layers)for(const e of t.weights){if(null!=n[e.originalName])throw new Ur(`Duplicate weight name: ${e.originalName}`);n[e.originalName]=e,s++}const i=[];for(const s in t){let r=s;if(null==n[s]){const t=s.split("/");r=t.slice(0,-2).concat([t[t.length-1]]).join("/")}if(null!=n[r])i.push([n[r],t[s]]);else if(e)throw new Ur(`Provided weight data has no target variable: ${s}`);delete n[r]}if(e){const t=[];for(const e in n)t.push(e);if(t.length>0)throw new Ur(`${t.length} of ${s} weights are not set: ${t}`)}Bo(i)}updatedConfig(){const t=this.getConfig(),e={};return e.className=this.getClassName(),e.config=t,e.kerasVersion="tfjs-layers 3.6.0",e.backend="TensorFlow.js",e}toJSON(t,e=!0){const n=Ol(this.updatedConfig());return e?JSON.stringify(n):n}call(t,n){return e.tidy((()=>{t=Jr(t);const e=new Wl;for(let n=0;n{let e;return t=Jr(t),e=null==n?jr(null,t.length):Jr(n),this.runInternalGraph(t,e)[1]}))}computeOutputShape(t){const e=Eo(t);if(e.length!==this.inputLayers.length)throw new Ur(`Invalid inputShape argument ${t}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let t=0;tparseInt(t,10))).sort(na);if(s.length>1)for(const t of s){const e=this.nodesByDepth[t];for(const t of e){const e=t.outboundLayer;if(-1!==this.inputLayers.map((t=>t.id)).indexOf(e.id))continue;const s=[];for(let e=0;eparseInt(t,10))).sort(na);for(const t of s){const e=this.nodesByDepth[t];for(const t of e){const e=t.outboundLayer,s=t.inputTensors,i=t.outputTensors,r=new Array;for(const t of s)t.id in n&&r.push(n[t.id]);if(r.length===s.length){let s,a,o,l,u={};if(null!=t.callArgs&&(u=t.callArgs),1===r.length){const[t,n]=r[0];null==u.mask&&(u.mask=n),o=Jr(e.call(t,u)),l=Jr(e.computeMask(t,n)),s=[t],a=[n]}else s=r.map((t=>t[0])),a=r.map((t=>t[1])),null==u.mask&&(u.mask=a),o=Jr(e.call(s,u)),l=Jr(e.computeMask(s,a));if(e.activityRegularizer)throw new Kr("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let t=0;t{const t=[];for(const e of this.layers)for(let n=0;n0){const t=[];for(let n=0;n0&&t.apply(Hr(n),s)}function l(t){const n=t.name,r=al(t,null!=e.customObjects?e.customObjects:{});r.setFastWeightInitDuringBuild(s),i[n]=r;t.inboundNodes.forEach((t=>{if(!(t instanceof Array))throw new Ur(`Corrupted configuration, expected array for nodeData: ${t}`);a(r,t)}))}const u=e.name,h=e.layers;for(const t of h)l(t);for(;!ia(r);)for(const t of h){const e=i[t.name];if(e.name in r){const t=r[e.name];delete r[e.name];for(const n of t)o(e,n)}}const c=[],p=[],d=e.inputLayers;for(const t of d){const e=t[0],n=t[1],s=t[2];qr(e in i);const r=i[e].inboundNodes[n].outputTensors;c.push(r[s])}const f=e.outputLayers;for(const t of f){const e=t[0],n=t[1],s=t[2];qr(e in i);const r=i[e].inboundNodes[n].outputTensors;p.push(r[s])}return new t({inputs:c,outputs:p,name:u})}get stateful(){if(this._stateful)throw new Ur("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const t of this.layers)if(t.stateful)return!0;return!1}resetStates(){e.tidy((()=>{this.layers.forEach((t=>{t.stateful&&t.resetStates()}))}))}}function Hl(t,e){return function(t,e,n){const s=e.length;if(null==t||Array.isArray(t)&&0===t.length)return e.map((t=>null));if(1===s)return Array.isArray(t)&&1===t.length?t:"object"==typeof t&&e[0]in t?[t[e[0]]]:[t];if(Array.isArray(t)){if(t.length!==s)throw new Error(`Provided ${n} is an array of ${t.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return t}if("object"==typeof t&&Object.keys(t).length>0&&"object"==typeof t[Object.keys(t)[0]]){const n=[];return e.forEach((e=>{e in t?n.push(t[e]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${e} keys. Provided ${n} not understood: ${JSON.stringify(t)}`)}(t,e,"classWeight")}async function Jl(t,n,s,i){if(null!=n||null!=i)throw new Error("Support sampleWeight is not implemented yet");if(null!=s){const n=e.tidy((()=>{if(1===t.shape.length)return t.clone();if(2===t.shape.length){if(t.shape[1]>1){const e=1;return t.argMax(e)}if(1===t.shape[1])return t.reshape([t.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${t.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${t.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),i=Array.from(await n.data());e.dispose(n);const r=[];return i.forEach((t=>{if(null==s[t])throw new Error(`classWeight must contain all classes in the training data. The class ${t} exists in the data but not in classWeight`);r.push(s[t])})),e.tensor1d(r,"float32")}return null}function Zl(t,n){return e.mul(t,n)}function Xl(t,n){let s,i;const r=n;s=r.xs,i=r.ys,e.util.assert(null!=s&&null!=i,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${n}`));const a=Yl("input",t.inputNames,s),o=Yl("output",t.outputNames,i),l=a[0].shape[0];e.util.assert(a.length===t.inputs.length,(()=>`LayersModel has ${t.inputs.length} inputs, but the dataset provides ${a.length} inputs. (Expected input keys: ${JSON.stringify(t.inputNames)})`)),e.util.assert(o.length===t.outputs.length,(()=>`LayersModel has ${t.outputs.length} outputs, but the dataset provides ${o.length} outputs. (Expected output keys: ${JSON.stringify(t.outputNames)})`));for(let n=0;n`Batch size mismatch: input ${t.inputNames[n]} has ${a[n].shape[0]}; expected ${l} based on input ${t.inputNames[0]}.`));for(let n=0;n`Batch size mismatch: output ${t.outputNames[n]} has ${o[n].shape[0]}; expected ${l} based on input ${t.inputNames[0]}.`));return{xs:a,ys:o}}function Yl(t,n,s){if(s instanceof e.Tensor)return[s];if(Array.isArray(s))return e.util.assert(s.length===n.length,(()=>`Received an array of ${s.length} Tensors, but expected ${n.length} to match the ${t} keys ${n}.`)),s;{const e=[];for(const i of n){if(null==s[i])throw new Ur(`The feature data generated by the dataset lacks the required ${t} key '${i}'.`);e.push(s[i])}return e}}async function Ql(t,n,s){const i=null!=s.batchesPerEpoch;if(e.util.assert(null!=t.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),e.util.assert(null!=s,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),e.util.assert(null!=s.epochs&&s.epochs>0&&Number.isInteger(s.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${s.epochs}`)),e.util.assert(!i||s.batchesPerEpoch>0&&Number.isInteger(s.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${s.batchesPerEpoch}`)),e.util.assert(null==s.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");t.isTraining=!0;try{const r=null!=s.validationData;let a,o;if(r)if(tu(s.validationData))e.util.assert(null==s.validationBatches||s.validationBatches>0&&Number.isInteger(s.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${s.validationBatches}`));else{const t=function(t){if(3===t.length)throw new Kr("Validation with sample weights is not implemented yet.");return{xs:t[0],ys:t[1]}}(s.validationData);a=t.xs,o=t.ys}const l=t.makeTrainFunction(),u=t.getDedupedMetricsNames();let h;h=r?u.slice().concat(u.map((t=>"val_"+t))):u.slice();const c=sl(s.callbacks,s.yieldEvery),p=null==s.verbose?1:s.verbose,{callbackList:d,history:f}=rl(c,p,s.epochs,null,null,function(t,e){let n=null;null!=e.batchesPerEpoch?n=e.batchesPerEpoch:Number.isFinite(t.size)&&(n=t.size);return n}(n,s),null,r,h);d.setModel(t),t.history=f,await d.onTrainBegin(),t.stopTraining_=!1;let g=null==s.initialEpoch?0:s.initialEpoch,m=await n.iterator();for(;g=s.batchesPerEpoch:n.done){if(r){let e;e=tu(s.validationData)?Jr(await t.evaluateDataset(s.validationData,{batches:s.validationBatches})):Jr(t.evaluate(a,o,{batchSize:null==s.validationBatchSize?32:s.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(t),(()=>`batchSize is required to be a positive integer, but got ${t}`))}function nu(t,e,n){return null==t?[null]:Array.isArray(t)?t.map((t=>Ka(t,e,n-e))):Ka(t,e,n-e)}function su(t,n){return e.tidy((()=>null==t?null:Array.isArray(t)?t.map((t=>su(t,n))):Xa(t,"int32"===n.dtype?n:n.toInt())))}function iu(t,e){const n=[];let s=0,i=null;for(;s=t&&(i=t),n.push([s,i]),s=i;return n}async function ru(t,n,s,i={}){if(t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");let r,a,o,l,u,h,c;t.isTraining=!0;try{const p=null==i.batchSize?32:i.batchSize;eu(p);const d=!1,f=await t.standardizeUserData(n,s,i.sampleWeight,i.classWeight,d,p);r=f[0],a=f[1],c=f[2];let g,m=!1;if(null!=i.validationData&&i.validationData.length>0){if(m=!0,2!==i.validationData.length)throw 3===i.validationData.length?new Kr("validationData including sample weights is not supported yet."):new Ur(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${i.validationData} is invalid.`);o=i.validationData[0],l=i.validationData[1];const e=!0,n=await t.standardizeUserData(o,l,null,null,e,p);u=n[0],h=n[1],g=u.concat(h)}else if(null!=i.validationSplit&&i.validationSplit>0&&i.validationSplit<1){m=!0;const t=Math.floor(r[0].shape[0]*(1-i.validationSplit)),e=r[0].shape[0];u=nu(r,t,e),r=nu(r,0,t),h=nu(a,t,e),a=nu(a,0,t),g=u.concat(h)}else null!=i.validationSteps&&(m=!0);const y=r.concat(a).concat(c);t.checkTrainableWeightsConsistency();const b=t.makeTrainFunction(),w=t.getDedupedMetricsNames();let k,x;m?(t.makeTestFunction(),k=t.testFunction,x=w.slice().concat(w.map((t=>"val_"+t)))):(k=null,g=[],x=w.slice());const v=sl(i.callbacks,i.yieldEvery);return await async function(t,n,s,i,r,a,o,l,u,h,c,p,d,f,g){null==r&&(r=32),null==a&&(a=1),null==c&&(c=!0),null==d&&(d=0);let m=!1;if(null!=u&&null!=h&&(m=!0),null!=g&&(m=!0,null==f))throw new Ur("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const y=t.checkNumSamples(s,r,f,"steps_per_epoch");let b;null!=y&&(b=Wa(0,y)),null==o&&(o=1);const{callbackList:w,history:k}=rl(l,o,a,d,y,f,r,m,p);w.setModel(t),t.history=k,await w.onTrainBegin(),t.stopTraining_=!1;for(let o=d;o{const d=l[c][0],f=l[c][1],g=Ka(o,d,f-d);p.batch=c,p.size=f-d;const y=su(s,g),b=n(y);for(let t=0;ts.push(t.id)));else if(null!=n)for(const t in n){const e=n[t];s.push(e.id)}const i=[];if(t instanceof e.Tensor)-1===s.indexOf(t.id)&&i.push(t);else if(Array.isArray(t))t.forEach((t=>{-1===s.indexOf(t.id)&&i.push(t)}));else if(null!=t)for(const e in t){const n=t[e];-1===s.indexOf(n.id)&&i.push(n)}i.forEach((t=>{t.isDisposed||t.dispose()}))}function lu(t){return Array.isArray(t)}function uu(t){return!function(t){return t instanceof e.Tensor}(t)&&!lu(t)}function hu(t,e,n,s=!0,i=""){if(null==e||0===e.length){if(null!=t){let e=!1;if(lu(t)&&t.length>0)e=!0;else if(uu(t)){for(const n in t)if(t.hasOwnProperty(n)){e=!0;break}}else e=!0;if(e)throw new Ur(`Error when checking model ${i} expected no data, but got ${t}`)}return[]}if(null==t)return e.map((t=>null));let r;if(uu(t)){t=t,r=[];for(const n of e){if(null==t[n])throw new Ur(`No data provided for "${n}". Need data for each key in: ${e}`);r.push(t[n])}}else if(lu(t)){if((t=t).length!==e.length)throw new Ur(`Error when checking model ${i}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${e.length} Tensor(s), but instead got the following list of Tensor(s): ${t}`);r=t}else{if(t=t,e.length>1)throw new Ur(`The model ${i} expects ${e.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${t.shape}`);r=[t]}if(r=au(r),null!=n)for(let t=0;t=0&&o!==l)throw new Ur(`Error when checking ${i}: expected ${e[t]} to have shape [${n[t]}], but got array with shape [${a.shape}].`)}}return r}function cu(t,e,n,s=!0,i=""){let r;if(Array.isArray(t)){if(t.length!==e.length)throw new Ur(`Error when checking model ${i}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${e.length} Tensor(s), but instead got ${t.length} Tensors(s).`);r=t}else{if(e.length>1)throw new Ur(`The model expects ${e.length} ${i} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(t.shape)}.`);r=[t]}if(null!=n)for(let t=0;te.train.adagrad(.01),Adadelta:()=>e.train.adadelta(1,.95,Br()),Adam:()=>e.train.adam(.001,.9,.999,Br()),Adamax:()=>e.train.adamax(.002,.9,.999,Br(),0),RMSProp:()=>e.train.rmsprop(.001,.9,0,Br()),SGD:()=>e.train.sgd(.01)};if(n.adagrad=n.Adagrad,n.adadelta=n.Adadelta,n.adam=n.Adam,n.adamax=n.Adamax,n.rmsprop=n.RMSProp,n.sgd=n.SGD,t in n)return n[t]();throw new Ur(`Unknown Optimizer ${t}`)}(t.optimizer),this.isOptimizerOwned=!0;else{if(!(t.optimizer instanceof e.Optimizer))throw new Ur("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=t.optimizer,this.isOptimizerOwned=!1}let n=[];if(Array.isArray(t.loss)||"string"==typeof t.loss||"function"==typeof t.loss)if(Array.isArray(t.loss)){if(t.loss.length!==this.outputs.length)throw new Ur(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${t.loss}.`);const e=t.loss;n=e.map((t=>ml(t)))}else{const e=ml(t.loss);this.outputs.forEach((t=>{n.push(e)}))}else{t.loss=t.loss;for(const e in t.loss)if(-1===this.outputNames.indexOf(e))throw new Ur(`Unknown entry in loss dictionary: "${e}". Only expected the following keys: ${this.outputNames}`);for(const e of this.outputNames)null==t.loss[e]&&console.warn(`Output "${e}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${e} during training`),n.push(ml(t.loss[e]))}this.lossFunctions=n,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let t=0;t{for(let t=0;t1&&(this.metricsTensors.push([e,t]),this.metricsNames.push(this.outputNames[t]+"_loss"))}}));const i=function(t,e){if(null==t||Array.isArray(t)&&0===t.length)return e.map((t=>[]));let n;if("string"==typeof t||"function"==typeof t)n=[t];else{if(!Array.isArray(t)&&"object"!=typeof t)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${t}`);n=t}if(Array.isArray(n))return e.map((t=>n));{const t=[];for(const s of e){let e=n.hasOwnProperty(s)?n[s]:[];Array.isArray(e)||(e=[e]),t.push(e)}return t}}(t.metrics,this.outputNames),r=(t,e,n)=>{this.outputNames.length>1&&(e=this.outputNames[t]+"_"+e),this.metricsNames.push(e),this.metricsTensors.push([n,t])};Ta("metric",(()=>{for(let t=0;t{let n,s,i;for(const a of e){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const e=this.internalOutputShapes[t];let r;1===e[e.length-1]||this.lossFunctions[t]===dl?-1!==["accuracy","acc"].indexOf(a)?s=yl:-1!==["crossentropy","ce"].indexOf(a)&&(s=vl):this.lossFunctions[t]===pl?-1!==["accuracy","acc"].indexOf(a)?s=Sl:-1!==["crossentropy","ce"].indexOf(a)&&(s=Nl):-1!==["accuracy","acc"].indexOf(a)?s=bl:-1!==["crossentropy","ce"].indexOf(a)&&(s=Il),-1!==["accuracy","acc"].indexOf(a)?r="acc":-1!==["crossentropy","ce"].indexOf(a)&&(r="ce"),i=s,n=""+r}else{const t=Al(a);i=t,n=""+Cl(a)}let e;Ta(n,(()=>{e=i})),r(t,n,e)}})(i[t])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(t,e,n={}){const s=null==n.batchSize?32:n.batchSize;eu(s);const i=this.standardizeUserDataXY(t,e,!0,s);try{const r=i[0].concat(i[1]);this.makeTestFunction();const a=this.testFunction;return Hr(this.testLoop(a,r,s,n.verbose,n.steps))}finally{ou(i[0],t),ou(i[1],e)}}async evaluateDataset(t,n){return this.makeTestFunction(),async function(t,n,s){const i=null!=(s=s||{}).batches,r=t.testFunction;let a=[];if(s.verbose>0)throw new Kr("Verbose mode is not implemented yet.");e.util.assert(!i||s.batches>0&&Number.isInteger(s.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(s.batches)}`));const o="function"==typeof n.next?n:await n.iterator();let l=0,u=0;for(;!i||u{if(n.value){const{xs:s,ys:i}=Xl(t,n.value),o=s.concat(i),h=e.tidy((()=>r(o)));if(e.dispose(o),0===u)for(let t=0;te.add(a[t],e.mul(c,n)))),u>0&&e.dispose(s)}e.dispose(h),l+=c,++u}return a})),n.done){i&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${s.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let t=0;tt.name));for(let s=0;s0){const n=[];throw e.forEach(((e,s)=>{null==e&&n.push(t[s])})),new Ur(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return e}predictLoop(t,n=32,s=!1){return e.tidy((()=>{const i=this.checkNumSamples(t);if(s)throw new Kr("Verbose predictLoop() is not implemented yet.");const r=iu(i,n),a=this.outputs.map((t=>[]));for(let n=0;n{const e=r[n][0],s=r[n][1],i=nu(t,e,s),a=[];if(Array.isArray(i))for(let t=0;ta[e].push(t)))}return Hr(a.map((t=>e.concat(t,0))))}))}predict(t,e={}){const n=au(t);cu(n,this.inputNames,this.feedInputShapes,!1);try{const s=null==e.batchSize?32:e.batchSize;return eu(s),this.predictLoop(n,s)}finally{ou(n,t)}}predictOnBatch(t){cu(t,this.inputNames,this.feedInputShapes,!0);const e=(Array.isArray(t)?t[0]:t).shape[0];return this.predictLoop(t,e)}standardizeUserDataXY(t,n,s=!0,i){if(null==this.optimizer_)throw new Pr("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let t=0;tt.shape[0])));i.sort();const r=sa(n.map((t=>t.shape[0])));if(r.sort(),i.length>1)throw new Ur(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((t=>t.shape)))}`);if(r.length>1)throw new Ur(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(n.map((t=>t.shape)))}`);if(i.length>0&&r.length>0&&!e.util.arraysEqual(i,r))throw new Ur(`Input Tensors should have the same number of samples as target Tensors. Found ${i[0]} input sample(s) and ${r[0]} target sample(s).`)}(t=hu(t,this.feedInputNames,this.feedInputShapes,!1,"input"),n=hu(n,this.feedOutputNames,r,!1,"target")),function(t,e,n){const s=[ll,dl,cl];for(let i=0;i0&&t[0].shape[0]%i!=0)throw new Ur(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${i}. Found: ${t[0].shape[0]} sample(s).`);return[t,n]}async standardizeUserData(t,e,n,s,i=!0,r){const[a,o]=this.standardizeUserDataXY(t,e,i,r);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const t=Hl(s,this.outputNames);l=[];for(let e=0;e{const a=this.checkNumSamples(n,s,r,"steps"),o=[];if(i>0)throw new Kr("Verbose mode is not implemented yet.");if(null!=r)throw new Kr("steps mode in testLoop() is not implemented yet");{const i=iu(a,s),r=e.tensor1d(Wa(0,a));for(let s=0;s1){i+=`_${Gr(t.slice(0,n),s)}`}e.push(i)}return e}makeTrainFunction(){return t=>{const n=[],s=t.slice(0,this.inputs.length),i=t.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=t.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),a=[],o=this.collectedTrainableWeights.map((t=>t.read()));return[this.optimizer_.minimize((()=>{const t=[];for(let e=0;e1&&t{u=e.add(u,t)})),u}),!0,o)].concat(a)}}makeTestFunction(){this.testFunction=t=>e.tidy((()=>{const n=[];let s;const i=t.slice(0,this.inputs.length),r=t.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=[];for(let t=0;tZr(t)))}else{const e=Object.keys(this.loss);t={};const n=this.loss;for(const s of e){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");t[s]=Zr(n[s])}}return t}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[Zr(Cl(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((t=>Zr(Cl(t))));{const t={};for(const e in this.metrics)t[e]=Zr(Cl(this.metrics[e]));return t}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(t){if(null!=t.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=t.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=t.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const e=al(Ml(t.optimizer_config));let n,s;if("string"==typeof t.loss)n=Xr(t.loss);else if(Array.isArray(t.loss))n=t.loss.map((t=>Xr(t)));else if(null!=t.loss){n={};for(const e in t.loss)n[e]=Xr(t.loss[e])}if(Array.isArray(t.metrics))s=t.metrics.map((t=>Xr(t)));else if(null!=t.metrics){s={};for(const e in t.metrics)s[e]=Xr(t.metrics[e])}this.compile({loss:n,metrics:s,optimizer:e})}async save(t,n){if("string"==typeof t){const n=e.io.getSaveHandlers(t);if(0===n.length)throw new Ur(`Cannot find any save handlers for URL '${t}'`);if(n.length>1)throw new Ur(`Found more than one (${n.length}) save handlers for URL '${t}'`);t=n[0]}if(null==t.save)throw new Ur("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const s=await e.io.encodeWeights(this.getNamedWeights(n)),i={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v3.6.0",convertedBy:null};if(null!=n&&n.includeOptimizer&&null!=this.optimizer){i.trainingConfig=this.getTrainingConfig();const t="optimizer",{data:n,specs:r}=await e.io.encodeWeights(await this.optimizer.getWeights(),t);s.specs.push(...r),s.data=e.io.concatenateArrayBuffers([s.data,n])}if(null!=this.userDefinedMetadata){const t=!0;Dl(this.userDefinedMetadata,this.name,t),i.userDefinedMetadata=this.userDefinedMetadata}return i.weightData=s.data,i.weightSpecs=s.specs,t.save(i)}setUserDefinedMetadata(t){Dl(t,this.name),this.userDefinedMetadata=t}getUserDefinedMetadata(){return this.userDefinedMetadata}}pu.className="Model",e.serialization.registerClass(pu);class du extends pu{}async function fu(t,n){if(null==n&&(n={}),"string"==typeof t){const s=e.io.getLoadHandlers(t,n);if(0===s.length)s.push(e.io.browserHTTPRequest(t,n));else if(s.length>1)throw new Ur(`Found more than one (${s.length}) load handlers for URL '${t}'`);t=s[0]}return async function(t,n,s){null==s&&(s={});if(null==t.load)throw new Ur("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const i=await t.load();let r=i.modelTopology;null!=r.model_config&&(r=r.model_config);const a=null==s.strict||s.strict,o=null!=i.weightData&&null!=i.weightSpecs&&a,l=al(Ml(r),n,o),u=i.trainingConfig;null!=u&&l.loadTrainingConfig(u);null!=i.userDefinedMetadata&&l.setUserDefinedMetadata(i.userDefinedMetadata);if(null!=i.weightData){if(null==i.weightSpecs)throw new Ur("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:t,optimizerWeights:n}=function(t,n){const s=e.io.decodeWeights(t,n),i={},r=[];return n.forEach((t=>{"optimizer"===t.group?r.push({name:t.name,tensor:s[t.name]}):i[t.name]=s[t.name]})),{modelWeights:i,optimizerWeights:r}}(i.weightData,i.weightSpecs);l.loadWeights(t,a),null!=l.optimizer&&n.length>0&&await l.optimizer.setWeights(n),e.dispose(t),e.dispose(n.map((t=>t.tensor)))}return l}(t,void 0,n)}du.className="Functional",e.serialization.registerClass(du);class gu extends pu{constructor(t){if(super({inputs:[],outputs:[]}),t=t||{},this.trainable=!0,this.built=!1,this.name=null!=t.name?t.name:Do("sequential_"),null!=t.layers)for(const e of t.layers)this.add(e)}checkShape(t){if(t.inboundNodes[0].outputTensors[0].shape.some((t=>t<0)))throw new Ur(`Negative dimension size caused by adding layer ${t.name} with input shape [${t.inboundNodes[0].inputTensors[0].shape}]`)}add(t){const e=t instanceof gu||t instanceof pu;let n;if(e){if(n=t,1!==n.outputs.length)throw new Ur("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new Ur("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===t.inboundNodes.length){if(null==t.batchInputShape)throw new Ur("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const e=Ho({batchShape:t.batchInputShape,dtype:t.dtype,name:t.name+"_input"});t.apply(e)}if(e)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==t.inboundNodes.length)throw new Ur(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${t.name} which has ${t.inboundNodes.length} pre-existing inbound connections.`);if(1!==t.inboundNodes[0].outputTensors.length)throw new Ur("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(t),this.outputs=[t.inboundNodes[0].outputTensors[0]],this.inputs=qo(this.outputs[0])}this.inboundNodes=[],new Ko({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:jr(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((t=>t.shape)),outputShapes:this.outputs[0].shape})}else{const e=t.apply(this.outputs[0]);if(Array.isArray(e))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(t),this.outputs=[e],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(t),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const t=this.layers.length-1;this.layers[t].outboundNodes=[],this.outputs=[this.layers[t].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(t,e){return null==this.model&&this.build(),this.model.call(t,e)}build(t){if(Lo(t),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new pu({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(t,e,n=console.log){this.built||this.build(),super.summary(t,e,n)}setWeights(t){null==this.model&&this.build(),this.model.setWeights(t)}evaluate(t,e,n={}){if(!this.built)throw new Pr("The model needs to be compiled before being used.");return this.model.evaluate(t,e,n)}async evaluateDataset(t,e){if(!this.built)throw new Pr("The model needs to be compiled before being used.");return this.model.evaluateDataset(t,e)}predict(t,e={}){return null==this.model&&this.build(),this.model.predict(t,e)}predictOnBatch(t){return null==this.model&&this.build(),this.model.predictOnBatch(t)}compile(t){this.build(),this.model.compile(t),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(t){this.model.optimizer=t}async fit(t,e,n={}){if(!this.built)throw new Pr("The model needs to be compiled before being used.");return this.model.fit(t,e,n)}async fitDataset(t,e){if(!this.built)throw new Pr("The model needs to be compiled before being used.");return this.model.fitDataset(t,e)}async trainOnBatch(t,e){return this.model.trainOnBatch(t,e)}static fromConfig(t,n,s={},i=!1){let r,a={};if(n instanceof Array){if(null==n[0].className||"Merge"===n[0].className)throw new Ur("Legacy serialization format not supported yet.");r=n}else e.util.assert(null!=n.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=n.layers,delete n.layers,a=n;const o=new t(a);if(!(o instanceof gu))throw new Kr(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const t of r){const e=al(t,void 0,i);i&&e.setFastWeightInitDuringBuild(!0),o.add(e)}return o}set stopTraining(t){if(null==this.model)throw new Ur("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=t}get stopTraining(){if(null==this.model)throw new Ur("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const t=[];for(const e of this.layers){const n={};n.className=e.getClassName(),n.config=e.getConfig(),t.push(n)}return{name:this.name,layers:t}}}function mu(t){return Ho(t)}gu.className="Sequential",e.serialization.registerClass(gu);class yu extends e.serialization.Serializable{getConfig(){return{}}}class bu extends yu{apply(t,n=1){return function(t,n=1){if(1!==n)throw new Kr(`Support for alpha values other than 1 (${n}) is not implemented yet.`);return e.elu(t)}(t,n)}}bu.className="elu",e.serialization.registerClass(bu);class wu extends yu{apply(t){return e.selu(t)}}wu.className="selu",e.serialization.registerClass(wu);class ku extends yu{apply(t){return e.relu(t)}}ku.className="relu",e.serialization.registerClass(ku);class xu extends yu{apply(t){return e.tidy((()=>e.minimum(6,e.relu(t))))}}xu.className="relu6",e.serialization.registerClass(xu);class vu extends yu{apply(t){return t}}vu.className="linear",e.serialization.registerClass(vu);class Su extends yu{apply(t){return e.sigmoid(t)}}Su.className="sigmoid",e.serialization.registerClass(Su);class Iu extends yu{apply(t){return function(t){return e.tidy((()=>{const n=e.add(.5,e.mul(.2,t));return e.clipByValue(n,0,1)}))}(t)}}Iu.className="hardSigmoid",e.serialization.registerClass(Iu);class Nu extends yu{apply(t){return e.softplus(t)}}Nu.className="softplus",e.serialization.registerClass(Nu);class zu extends yu{apply(t){return function(t){return e.tidy((()=>e.div(t,e.abs(t).add(1))))}(t)}}zu.className="softsign",e.serialization.registerClass(zu);class Au extends yu{apply(t){return e.tanh(t)}}Au.className="tanh",e.serialization.registerClass(Au);class Cu extends yu{apply(t,n=-1){return e.softmax(t,n)}}Cu.className="softmax",e.serialization.registerClass(Cu);class $u extends yu{apply(t,n=-1){return e.logSoftmax(t,n)}}$u.className="logSoftmax",e.serialization.registerClass($u);class Du extends yu{apply(t,n=1){return e.tidy((()=>e.sigmoid(t.mul(n)).mul(t)))}}Du.className="swish",e.serialization.registerClass(Du);class Tu extends yu{apply(t){return e.tidy((()=>e.mul(t,e.tanh(e.softplus(t)))))}}function Eu(t){return t.getClassName()}function Fu(t,n={}){return ea(t,e.serialization.SerializationMap.getMap().classNameMap,n,"activation")}function Lu(t){if(null==t){const t={className:"linear",config:{}};return Fu(t)}if("string"==typeof t){const e={};return e.className=t,e.config={},Fu(e)}return t instanceof yu?t:Fu(t)}function _u(t){if(null!=t&&"object"!=typeof t)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${t}`)}Tu.className="mish",e.serialization.registerClass(Tu);class Ru extends e.serialization.Serializable{}class Mu extends Ru{constructor(t){super(),_u(t),this.l1=null==t||null==t.l1?.01:t.l1,this.l2=null==t||null==t.l2?.01:t.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(t){return e.tidy((()=>{let n=e.zeros([1]);return this.hasL1&&(n=e.add(n,e.sum(e.mul(this.l1,e.abs(t))))),this.hasL2&&(n=e.add(n,e.sum(e.mul(this.l2,Ya(t))))),n.asScalar()}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(t,e){return new t({l1:e.l1,l2:e.l2})}}Mu.className="L1L2",e.serialization.registerClass(Mu);const Ou={l1l2:"L1L2"};function Bu(t){return Qr(t)}function Wu(t,n={}){return ea(t,e.serialization.SerializationMap.getMap().classNameMap,n,"regularizer")}function Pu(t){if(null==t)return null;if("string"==typeof t){return Wu({className:t in Ou?Ou[t]:t,config:{}})}return t instanceof Ru?t:Wu(t)}class Uu extends jo{constructor(t){super(null==t?{}:t),this.supportsMasking=!0,null!=t&&(this.maxValue=t.maxValue)}call(t,n){t=Fo(t);let s=e.relu(t);return null!=this.maxValue&&(s=e.clipByValue(s,0,this.maxValue)),s}computeOutputShape(t){return t}getConfig(){const t={maxValue:this.maxValue},e=super.getConfig();return Object.assign(t,e),t}}Uu.className="ReLU",e.serialization.registerClass(Uu);class Ku extends jo{constructor(t){super(null==t?{}:t),this.DEFAULT_ALPHA=.3,null==t&&(t={}),this.alpha=null==t.alpha?this.DEFAULT_ALPHA:t.alpha}call(t,n){const s=Fo(t);return e.leakyRelu(s,this.alpha)}computeOutputShape(t){return t}getConfig(){const t={alpha:this.alpha},e=super.getConfig();return Object.assign(t,e),t}}Ku.className="LeakyReLU",e.serialization.registerClass(Ku);class Vu extends jo{constructor(t){if(super(null==t?{}:t),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==t&&(t={}),this.supportsMasking=!0,this.alphaInitializer=No(t.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=Pu(t.alphaRegularizer),this.alphaConstraint=wa(t.alphaConstraint),null==t.sharedAxes)this.sharedAxes=null;else if(Array.isArray(t.sharedAxes))this.sharedAxes=t.sharedAxes;else{if("number"!=typeof t.sharedAxes)throw new Ur(`Expected sharedAxes to be a number or an array of numbers, but got ${t.sharedAxes}`);this.sharedAxes=[t.sharedAxes]}}build(t){const e=(t=Lo(t)).slice(1);if(null!=this.sharedAxes)for(const t of this.sharedAxes)e[t-1]=1;this.alpha=this.addWeight("alpha",e,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let e=1;e(Aa(n),"channelsFirst"===n?e.transpose(t,[0,2,3,1]):t)))}function Yu(t,n){return e.tidy((()=>(Aa(n),"channelsFirst"===n?e.transpose(t,[0,2,3,4,1]):t)))}function Qu(t,n,s,i=[1,1],r="valid",a,o,l=null){return e.tidy((()=>{if(null==a&&(a="channelsLast"),Aa(a),3!==t.rank&&4!==t.rank)throw new Ur(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${t.rank}.`);if(3!==n.rank&&4!==n.rank)throw new Ur(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${t.rank}.`);let u=Xu(t,a);if("causal"===r)throw new Kr("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return u=e.fused.conv2d({x:u,filter:n,strides:i,pad:"same"===r?"same":"valid",dilations:o,dataFormat:"NHWC",bias:s,activation:l}),"channelsFirst"===a&&(u=e.transpose(u,[0,3,1,2])),u}))}Gu.className="Softmax",e.serialization.registerClass(Gu);class th extends jo{constructor(t,e){if(super(e),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",th.verifyArgs(e),this.rank=t,oa(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Kr(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=Hu(e.kernelSize,t,"kernelSize"),this.strides=Hu(null==e.strides?1:e.strides,t,"strides"),this.padding=null==e.padding?"valid":e.padding,Ca(this.padding),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Aa(this.dataFormat),this.activation=Lu(e.activation),this.useBias=null==e.useBias||e.useBias,this.biasInitializer=No(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=wa(e.biasConstraint),this.biasRegularizer=Pu(e.biasRegularizer),this.activityRegularizer=Pu(e.activityRegularizer),this.dilationRate=Hu(null==e.dilationRate?1:e.dilationRate,t,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new Ur(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new Ur(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new Ur(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(t){if(qr("kernelSize"in t,"required key 'kernelSize' not in config"),"number"!=typeof t.kernelSize&&!aa(t.kernelSize,"number",1,3))throw new Ur(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(t.kernelSize)}.`)}getConfig(){const t={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Eu(this.activation),useBias:this.useBias,biasInitializer:Io(this.biasInitializer),biasRegularizer:Bu(this.biasRegularizer),activityRegularizer:Bu(this.activityRegularizer),biasConstraint:ya(this.biasConstraint)},e=super.getConfig();return Object.assign(t,e),t}}class eh extends th{constructor(t,e){super(t,e),this.kernel=null,eh.verifyArgs(e),this.filters=e.filters,oa(this.filters,"filters"),this.kernelInitializer=No(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=wa(e.kernelConstraint),this.kernelRegularizer=Pu(e.kernelRegularizer)}build(t){t=Lo(t);const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new Ur(`The channel dimension of the input should be defined. Found ${t[e]}`);const n=t[e],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[e]:n}}],this.built=!0}call(t,n){return e.tidy((()=>{let n;t=Fo(t);const s=null==this.bias?null:this.bias.read(),i=ua(this.activation.getClassName());if(null!=i&&2===this.rank)n=Qu(t,this.kernel.read(),s,this.strides,this.padding,this.dataFormat,this.dilationRate,i);else{if(1===this.rank)n=function(t,n,s,i=1,r="valid",a,o=1){return e.tidy((()=>{if(null==a&&(a="channelsLast"),Aa(a),3!==t.shape.length)throw new Ur(`The input of a conv1dWithBias operation should be 3, but is ${t.shape.length} instead.`);if(3!==n.shape.length)throw new Ur(`The kernel for a conv1dWithBias operation should be 3, but is ${n.shape.length} instead`);if(null!=s&&1!==s.shape.length)throw new Ur(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===a&&(t=e.transpose(t,[0,2,1])),"causal"===r)throw new Kr("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let l=e.conv1d(t,n,i,"same"===r?"same":"valid","NWC",o);return null!=s&&(l=to(l,s)),l}))}(t,this.kernel.read(),s,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)n=Qu(t,this.kernel.read(),s,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Kr("convolutions greater than 3D are not implemented yet.");n=function(t,n,s,i=[1,1,1],r="valid",a,o){return e.tidy((()=>{if(null==a&&(a="channelsLast"),Aa(a),4!==t.rank&&5!==t.rank)throw new Ur(`conv3dWithBias expects input to be of rank 4 or 5, but received ${t.rank}.`);if(4!==n.rank&&5!==n.rank)throw new Ur(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${t.rank}.`);let l=Yu(t,a);if("causal"===r)throw new Kr("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return l=e.conv3d(l,n,i,"same"===r?"same":"valid","NDHWC",o),null!=s&&(l=to(l,s)),"channelsFirst"===a&&(l=e.transpose(l,[0,4,1,2,3])),l}))}(t,this.kernel.read(),s,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(n=this.activation.apply(n))}return n}))}computeOutputShape(t){t=Lo(t);const e=[],n="channelsLast"===this.dataFormat?t.slice(1,t.length-1):t.slice(2);for(let t=0;t 0 but got ${JSON.stringify(t.filters)}`)}}class nh extends eh{constructor(t){super(2,t),nh.verifyArgs(t)}getConfig(){const t=super.getConfig();return delete t.rank,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&!aa(t.kernelSize,"number",1,2))throw new Ur(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(t.kernelSize)}.`)}}nh.className="Conv2D",e.serialization.registerClass(nh);class sh extends eh{constructor(t){super(3,t),sh.verifyArgs(t)}getConfig(){const t=super.getConfig();return delete t.rank,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&(!Array.isArray(t.kernelSize)||1!==t.kernelSize.length&&3!==t.kernelSize.length))throw new Ur(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(t.kernelSize)}.`)}}sh.className="Conv3D",e.serialization.registerClass(sh);class ih extends nh{constructor(t){if(super(t),this.inputSpec=[new Wo({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new Ur(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(t){if(4!==(t=Lo(t)).length)throw new Ur("Input should have rank 4; Received input shape: "+JSON.stringify(t));const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new Ur("The channel dimension of the inputs should be defined. Found `None`.");const n=t[e],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Wo({ndim:4,axes:{[e]:n}})],this.built=!0}call(t,n){return e.tidy((()=>{let n=Fo(t);if(4!==n.shape.length)throw new Ur(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);const s=n.shape,i=s[0];let r,a;"channelsFirst"===this.dataFormat?(r=2,a=3):(r=1,a=2);const o=s[r],l=s[a],u=this.kernelSize[0],h=this.kernelSize[1],c=this.strides[0],p=this.strides[1],d=[i,Zu(o,c,u,this.padding),Zu(l,p,h,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(n=e.transpose(n,[0,2,3,1]));let f=e.conv2dTranspose(n,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(f=e.transpose(f,[0,3,1,2])),null!=this.bias&&(f=to(f,this.bias.read(),this.dataFormat)),null!=this.activation&&(f=this.activation.apply(f)),f}))}computeOutputShape(t){const e=(t=Lo(t)).slice();let n,s,i;"channelsFirst"===this.dataFormat?(n=1,s=2,i=3):(n=3,s=1,i=2);const r=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return e[n]=this.filters,e[s]=Zu(e[s],o,r,this.padding),e[i]=Zu(e[i],l,a,this.padding),e}getConfig(){const t=super.getConfig();return delete t.dilationRate,t}}ih.className="Conv2DTranspose",e.serialization.registerClass(ih);class rh extends sh{constructor(t){if(super(t),this.inputSpec=[new Wo({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new Ur(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(t){if(5!==(t=Lo(t)).length)throw new Ur("Input should have rank 5; Received input shape: "+JSON.stringify(t));const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new Ur("The channel dimension of the inputs should be defined. Found `None`.");const n=t[e],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Wo({ndim:5,axes:{[e]:n}})],this.built=!0}call(t,n){return e.tidy((()=>{let n=Fo(t);if(5!==n.shape.length)throw new Ur(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);const s=n.shape,i=s[0];let r,a,o;"channelsFirst"===this.dataFormat?(o=2,r=3,a=4):(o=1,r=2,a=3);const l=s[o],u=s[r],h=s[a],c=this.kernelSize[0],p=this.kernelSize[1],d=this.kernelSize[2],f=this.strides[0],g=this.strides[1],m=this.strides[2],y=[i,Zu(l,f,c,this.padding),Zu(u,g,p,this.padding),Zu(h,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(n=e.transpose(n,[0,2,3,4,1]));let b=e.conv3dTranspose(n,this.kernel.read(),y,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(b=e.transpose(b,[0,4,1,2,3])),null!==this.bias&&(b=to(b,this.bias.read(),this.dataFormat)),null!==this.activation&&(b=this.activation.apply(b)),b}))}computeOutputShape(t){const e=(t=Lo(t)).slice();let n,s,i,r;"channelsFirst"===this.dataFormat?(n=1,s=2,i=3,r=4):(n=4,s=1,i=2,r=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],h=this.strides[1],c=this.strides[2];return e[n]=this.filters,e[s]=Zu(e[s],u,a,this.padding),e[i]=Zu(e[i],h,o,this.padding),e[r]=Zu(e[r],c,l,this.padding),e}getConfig(){const t=super.getConfig();return delete t.dilationRate,t}}rh.className="Conv3DTranspose",e.serialization.registerClass(rh);class ah extends eh{constructor(t,e){if(super(t,e),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==e.filters)throw new Ur("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=e.kernelInitializer||null!=e.kernelRegularizer||null!=e.kernelConstraint)throw new Ur("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=e.padding&&"same"!==e.padding&&"valid"!==e.padding)throw new Ur(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(e.padding)}`);this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=No(e.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=Pu(e.depthwiseRegularizer),this.depthwiseConstraint=wa(e.depthwiseConstraint),this.pointwiseInitializer=No(e.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=Pu(e.pointwiseRegularizer),this.pointwiseConstraint=wa(e.pointwiseConstraint)}build(t){if((t=Lo(t)).length{let n;if(t=Fo(t),1===this.rank)throw new Kr("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(t=e.transpose(t,[0,2,3,1])),n=e.separableConv2d(t,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=to(n,this.bias.read(),this.dataFormat)),null!=this.activation&&(n=this.activation.apply(n)),"channelsFirst"===this.dataFormat&&(n=e.transpose(n,[0,3,1,2])),n}))}getConfig(){const t=super.getConfig();return delete t.rank,delete t.kernelInitializer,delete t.kernelRegularizer,delete t.kernelConstraint,t.depthwiseInitializer=Io(this.depthwiseInitializer),t.pointwiseInitializer=Io(this.pointwiseInitializer),t.depthwiseRegularizer=Bu(this.depthwiseRegularizer),t.pointwiseRegularizer=Bu(this.pointwiseRegularizer),t.depthwiseConstraint=ya(this.depthwiseConstraint),t.pointwiseConstraint=ya(this.pointwiseConstraint),t}}ah.className="SeparableConv";class oh extends ah{constructor(t){super(2,t)}}oh.className="SeparableConv2D",e.serialization.registerClass(oh);class lh extends eh{constructor(t){super(1,t),lh.verifyArgs(t),this.inputSpec=[{ndim:3}]}getConfig(){const t=super.getConfig();return delete t.rank,delete t.dataFormat,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&!aa(t.kernelSize,"number",1,1))throw new Ur(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(t.kernelSize)}.`)}}lh.className="Conv1D",e.serialization.registerClass(lh);class uh extends jo{constructor(t){super(t),"number"==typeof t.cropping?this.cropping=[[t.cropping,t.cropping],[t.cropping,t.cropping]]:"number"==typeof t.cropping[0]?this.cropping=[[t.cropping[0],t.cropping[0]],[t.cropping[1],t.cropping[1]]]:this.cropping=t.cropping,this.dataFormat=void 0===t.dataFormat?"channelsLast":t.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(t){return"channelsFirst"===this.dataFormat?[t[0],t[1],t[2]-this.cropping[0][0]-this.cropping[0][1],t[3]-this.cropping[1][0]-this.cropping[1][1]]:[t[0],t[1]-this.cropping[0][0]-this.cropping[0][1],t[2]-this.cropping[1][0]-this.cropping[1][1],t[3]]}call(t,n){return e.tidy((()=>{if(t=Fo(t),"channelsLast"===this.dataFormat){const e=ja(t,this.cropping[0][0],t.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return ja(e,this.cropping[1][0],t.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const e=ja(t,this.cropping[0][0],t.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return ja(e,this.cropping[1][0],t.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const t={cropping:this.cropping,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}uh.className="Cropping2D",e.serialization.registerClass(uh);class hh extends jo{constructor(t){var e;super(t),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==t.size?this.DEFAULT_SIZE:t.size,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Aa(this.dataFormat),this.interpolation=null==t.interpolation?"nearest":t.interpolation,e=this.interpolation,ra(va,"InterpolationFormat",e)}computeOutputShape(t){if("channelsFirst"===this.dataFormat){const e=null==t[2]?null:this.size[0]*t[2],n=null==t[3]?null:this.size[1]*t[3];return[t[0],t[1],e,n]}{const e=null==t[1]?null:this.size[0]*t[1],n=null==t[2]?null:this.size[1]*t[2];return[t[0],e,n,t[3]]}}call(t,n){return e.tidy((()=>{let n=Fo(t);const s=n.shape;if("channelsFirst"===this.dataFormat){n=e.transpose(n,[0,2,3,1]);const t=this.size[0]*s[2],i=this.size[1]*s[3],r="nearest"===this.interpolation?n.resizeNearestNeighbor([t,i]):n.resizeBilinear([t,i]);return e.transpose(r,[0,3,1,2])}{const t=this.size[0]*s[1],e=this.size[1]*s[2];return"nearest"===this.interpolation?n.resizeNearestNeighbor([t,e]):n.resizeBilinear([t,e])}}))}getConfig(){const t={size:this.size,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}hh.className="UpSampling2D",e.serialization.registerClass(hh);class ch extends th{constructor(t){super(2,t),this.depthwiseKernel=null,this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=No(t.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=wa(t.depthwiseConstraint),this.depthwiseRegularizer=Pu(t.depthwiseRegularizer)}build(t){if((t=Lo(t)).length<4)throw new Ur(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(t)}.`);const e="channelsFirst"===this.dataFormat?1:3;if(null==t[e]||t[e]<0)throw new Ur(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${t[e]}).`);const n=t[e],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,n){return e.tidy((()=>{let n=function(t,n,s=[1,1],i="valid",r,a){return e.tidy((()=>{null==r&&(r="channelsLast"),Aa(r);let o=Xu(t,r);if(4!==t.rank)throw new Ur(`Input for depthwiseConv2d is required to be 4-D, but is instead ${t.rank}-D`);if(4!==n.rank)throw new Ur(`depthwiseKernel is required to be 4-D, but is instead ${n.rank}-D`);return o=e.depthwiseConv2d(o,n,s,"same"===i?"same":"valid","NHWC",a),"channelsFirst"===r&&(o=e.transpose(o,[0,3,1,2])),o}))}(t=Fo(t),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=to(n,this.bias.read(),this.dataFormat)),null!=this.activation&&(n=this.activation.apply(n)),n}))}computeOutputShape(t){t=Lo(t);const e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],s="channelsFirst"===this.dataFormat?t[1]*this.depthMultiplier:t[3]*this.depthMultiplier,i=Ju(e,this.kernelSize[0],this.padding,this.strides[0]),r=Ju(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[t[0],s,i,r]:[t[0],i,r,s]}getConfig(){const t=super.getConfig();return t.depthMultiplier=this.depthMultiplier,t.depthwiseInitializer=Io(this.depthwiseInitializer),t.depthwiseRegularizer=Bu(this.depthwiseRegularizer),t.depthwiseConstraint=ya(this.depthwiseRegularizer),t}}function ph(t,e,n,s){if(Array.isArray(t)){if(null!=e||null!=n)throw new Ur("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=t.slice(t.length-s,t.length),t=t.slice(0,t.length-s)),t.length>1&&(e=t.slice(1,t.length)),t=t[0]}function i(t){return null==t||Array.isArray(t)?t:[t]}return{inputs:t,initialState:e=i(e),constants:n=i(n)}}function dh(t,n,s,i=!1,r,a,o=!1,l=!1){return e.tidy((()=>{const u=n.shape.length;if(u<3)throw new Ur(`Input should be at least 3D, but is ${u}D.`);const h=[1,0].concat(Wa(2,u));if(n=e.transpose(n,h),null!=a)throw new Kr("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=r&&((r=r.asType("bool").asType("float32")).rank===u-1&&(r=e.expandDims(r,-1)),r=e.transpose(r,h)),i&&(n=e.reverse(n,0),null!=r&&(r=e.reverse(r,0)));const c=[];let p,d=s;const f=n.shape[0],g=e.unstack(n);let m,y;null!=r&&(m=e.unstack(r));for(let n=0;nt(s,d)));if(null==r)p=i[0],d=i[1];else{const t=e.tidy((()=>{const t=m[n],s=e.onesLike(t).sub(t);return{output:i[0].mul(t).add(d[0].mul(s)),newStates:d.map(((e,n)=>i[1][n].mul(t).add(e.mul(s))))}}));p=t.output,d=t.newStates}l&&c.push(p)}if(l){const t=1;y=e.stack(c,t)}return[p,y,d]}))}ch.className="DepthwiseConv2D",e.serialization.registerClass(ch);class fh extends jo{constructor(t){let e;if(super(t),null==t.cell)throw new Ur("cell property is missing for the constructor of RNN.");if(e=Array.isArray(t.cell)?new vh({cells:t.cell}):t.cell,null==e.stateSize)throw new Ur("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=e,this.returnSequences=null!=t.returnSequences&&t.returnSequences,this.returnState=null!=t.returnState&&t.returnState,this.goBackwards=null!=t.goBackwards&&t.goBackwards,this._stateful=null!=t.stateful&&t.stateful,this.unroll=null!=t.unroll&&t.unroll,this.supportsMasking=!0,this.inputSpec=[new Wo({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return Wa(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((t=>null))}return this.states_}setStates(t){this.states_=t}computeOutputShape(t){To(t)&&(t=t[0]),t=t;let e=this.cell.stateSize;Array.isArray(e)||(e=[e]);const n=e[0];let s;if(s=this.returnSequences?[t[0],t[1],n]:[t[0],n],this.returnState){const n=[];for(const s of e)n.push([t[0],s]);return[s].concat(n)}return s}computeMask(t,n){return e.tidy((()=>{Array.isArray(n)&&(n=n[0]);const t=this.returnSequences?n:null;if(this.returnState){const e=this.states.map((t=>null));return[t].concat(e)}return t}))}get states(){if(null==this.states_){const t=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,e=[];for(let n=0;nt.shape[t.shape.length-1])),r))throw new Ur(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((t=>new Wo({shape:[null,t]})));this.stateful&&this.resetStates()}resetStates(t,n=!1){e.tidy((()=>{if(!this.stateful)throw new Wr("Cannot call resetStates() on an RNN Layer that is not stateful.");const s=this.inputSpec[0].shape[0];if(null==s)throw new Ur("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((t=>e.zeros([s,t]))):this.states_=[e.zeros([s,this.cell.stateSize])];else if(null==t)e.dispose(this.states_),null!=this.keptStates&&(e.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((t=>e.zeros([s,t]))):this.states_[0]=e.zeros([s,this.cell.stateSize]);else{if(Array.isArray(t)||(t=[t]),t.length!==this.states_.length)throw new Ur(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${t.length} state value(s). Input received: ${t}`);!0===n?this.keptStates.push(this.states_.slice()):e.dispose(this.states_);for(let n=0;ne.keep(t.clone())))}))}apply(t,e){let n=null==e?null:e.initialState,s=null==e?null:e.constants;null==e&&(e={});const i=ph(t,n,s,this.numConstants);t=i.inputs,n=i.initialState,s=i.constants;let r=[],a=[];if(null!=n){e.initialState=n,r=r.concat(n),this.stateSpec=[];for(const t of n)this.stateSpec.push(new Wo({shape:t.shape}));a=a.concat(this.stateSpec)}null!=s&&(e.constants=s,r=r.concat(s),this.numConstants=s.length);if(r[0]instanceof Po){const n=[t].concat(r),s=this.inputSpec.concat(a),i=this.inputSpec;this.inputSpec=s;const o=super.apply(n,e);return this.inputSpec=i,o}return super.apply(t,e)}call(t,n){return e.tidy((()=>{const e=null==n?null:n.mask,s=null==n?null:n.training;let i=null==n?null:n.initialState;t=Fo(t),null==i&&(i=this.stateful?this.states_:this.getInitialState(t));const r=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(i.length!==r)throw new Ur(`RNN Layer has ${r} state(s) but was passed ${i.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const a={training:s},o=dh(((t,e)=>{const n=this.cell.call([t].concat(e),a);return[n[0],n.slice(1)]}),t,i,this.goBackwards,e,null,this.unroll,this.returnSequences),l=o[0],u=o[1],h=o[2];this.stateful&&this.resetStates(h,s);const c=this.returnSequences?u:l;return this.returnState?[c].concat(h):c}))}getInitialState(t){return e.tidy((()=>{let n=e.zeros(t.shape);return n=e.sum(n,[1,2]),n=Ua(n),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((t=>t>1?Ha(n,[1,t]):n)):this.cell.stateSize>1?[Ha(n,[1,this.cell.stateSize])]:[n]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(t)}getConfig(){const t=super.getConfig(),e={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(e.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===fh.className&&(e.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,t,e)}static fromConfig(t,e,n={}){const s=al(e.cell,n);return new t(Object.assign(e,{cell:s}))}}fh.className="RNN",e.serialization.registerClass(fh);class gh extends jo{}class mh extends gh{constructor(t){super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=t.units,oa(this.units,"units"),this.activation=Lu(null==t.activation?this.DEFAULT_ACTIVATION:t.activation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=No(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=No(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=No(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Pu(t.kernelRegularizer),this.recurrentRegularizer=Pu(t.recurrentRegularizer),this.biasRegularizer=Pu(t.biasRegularizer),this.kernelConstraint=wa(t.kernelConstraint),this.recurrentConstraint=wa(t.recurrentConstraint),this.biasConstraint=wa(t.biasConstraint),this.dropout=Oa([1,Ba([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=Oa([1,Ba([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){t=Lo(t),this.kernel=this.addWeight("kernel",[t[t.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,n){return e.tidy((()=>{if(2!==(t=t).length)throw new Ur(`SimpleRNNCell expects 2 input Tensors, got ${t.length}.`);let s=t[1];t=t[0];const i=null!=n.training&&n.training;let r;0e.onesLike(t),rate:this.dropout,training:i})),0e.onesLike(s),rate:this.recurrentDropout,training:i}));const a=this.dropoutMask,o=this.recurrentDropoutMask;r=Za(null!=a?e.mul(t,a):t,this.kernel.read()),null!=this.bias&&(r=to(r,this.bias.read())),null!=o&&(s=e.mul(s,o));let l=e.add(r,Za(s,this.recurrentKernel.read()));return null!=this.activation&&(l=this.activation.apply(l)),[l,l]}))}getConfig(){const t=super.getConfig(),e={units:this.units,activation:Eu(this.activation),useBias:this.useBias,kernelInitializer:Io(this.kernelInitializer),recurrentInitializer:Io(this.recurrentInitializer),biasInitializer:Io(this.biasInitializer),kernelRegularizer:Bu(this.kernelRegularizer),recurrentRegularizer:Bu(this.recurrentRegularizer),biasRegularizer:Bu(this.biasRegularizer),activityRegularizer:Bu(this.activityRegularizer),kernelConstraint:ya(this.kernelConstraint),recurrentConstraint:ya(this.recurrentConstraint),biasConstraint:ya(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},t,e)}}mh.className="SimpleRNNCell",e.serialization.registerClass(mh);class yh extends fh{constructor(t){t.cell=new mh(t),super(t)}call(t,n){return e.tidy((()=>{null!=this.cell.dropoutMask&&(e.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(e.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const s=null==n?null:n.mask,i=null==n?null:n.training,r=null==n?null:n.initialState;return super.call(t,{mask:s,training:i,initialState:r})}))}static fromConfig(t,e){return new t(e)}}yh.className="SimpleRNN",e.serialization.registerClass(yh);class bh extends gh{constructor(t){if(super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",t.resetAfter)throw new Ur("GRUCell does not support reset_after parameter set to true.");this.units=t.units,oa(this.units,"units"),this.activation=Lu(void 0===t.activation?this.DEFAULT_ACTIVATION:t.activation),this.recurrentActivation=Lu(void 0===t.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=No(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=No(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=No(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Pu(t.kernelRegularizer),this.recurrentRegularizer=Pu(t.recurrentRegularizer),this.biasRegularizer=Pu(t.biasRegularizer),this.kernelConstraint=wa(t.kernelConstraint),this.recurrentConstraint=wa(t.recurrentConstraint),this.biasConstraint=wa(t.biasConstraint),this.dropout=Oa([1,Ba([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=Oa([1,Ba([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.implementation=t.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){const e=(t=Lo(t))[t.length-1];this.kernel=this.addWeight("kernel",[e,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,n){return e.tidy((()=>{if(2!==(t=t).length)throw new Ur(`GRUCell expects 2 input Tensors (inputs, h, c), got ${t.length}.`);const s=null!=n.training&&n.training;let i=t[1];t=t[0],0e.onesLike(t),rate:this.dropout,training:s,count:3})),0e.onesLike(i),rate:this.recurrentDropout,training:s,count:3}));const r=this.dropoutMask,a=this.recurrentDropoutMask;let o,l,u;0{null!=this.cell.dropoutMask&&(e.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(e.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const s=null==n?null:n.mask,i=null==n?null:n.training,r=null==n?null:n.initialState;return super.call(t,{mask:s,training:i,initialState:r})}))}static fromConfig(t,e){return 0===e.implmentation&&(e.implementation=1),new t(e)}}wh.className="GRU",e.serialization.registerClass(wh);class kh extends gh{constructor(t){super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=t.units,oa(this.units,"units"),this.activation=Lu(void 0===t.activation?this.DEFAULT_ACTIVATION:t.activation),this.recurrentActivation=Lu(void 0===t.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=No(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=No(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=No(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=t.unitForgetBias,this.kernelRegularizer=Pu(t.kernelRegularizer),this.recurrentRegularizer=Pu(t.recurrentRegularizer),this.biasRegularizer=Pu(t.biasRegularizer),this.kernelConstraint=wa(t.kernelConstraint),this.recurrentConstraint=wa(t.recurrentConstraint),this.biasConstraint=wa(t.biasConstraint),this.dropout=Oa([1,Ba([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=Oa([1,Ba([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.implementation=t.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){var e;const n=(t=Lo(t))[t.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const t=this.biasInitializer,n=this.units;s=new((e=class extends ro{apply(e,s){const i=t.apply([n]),r=(new oo).apply([n]),a=t.apply([2*n]);return Ga(Ga(i,r),a)}}).className="CustomInit",e)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(t,n){return e.tidy((()=>{const s=null!=n.training&&n.training;if(3!==(t=t).length)throw new Ur(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${t.length}.`);let i=t[1];const r=t[2];t=t[0],0e.onesLike(t),rate:this.dropout,training:s,count:4})),0e.onesLike(i),rate:this.recurrentDropout,training:s,count:4}));const a=this.dropoutMask,o=this.recurrentDropoutMask;let l,u,h,c;0{null!=this.cell.dropoutMask&&(e.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(e.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const s=null==n?null:n.mask,i=null==n?null:n.training,r=null==n?null:n.initialState;return super.call(t,{mask:s,training:i,initialState:r})}))}static fromConfig(t,e){return 0===e.implmentation&&(e.implementation=1),new t(e)}}xh.className="LSTM",e.serialization.registerClass(xh);class vh extends gh{constructor(t){super(t),this.cells=t.cells}get stateSize(){const t=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?t.push(...e.stateSize):t.push(e.stateSize);return t}call(t,n){return e.tidy((()=>{let e=(t=t).slice(1);const s=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?s.push(e.splice(0,t.stateSize.length)):s.push(e.splice(0,1));s.reverse();const i=[];let r;for(let a=0;a{Ta(`RNNCell_${s}`,(()=>{n.build(t),e=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,t=[t[0],e]}))})),this.built=!0}getConfig(){const t=super.getConfig(),e={cells:this.cells.map((t=>({className:t.getClassName(),config:t.getConfig()})))};return Object.assign({},t,e)}static fromConfig(t,e,n={}){const s=[];for(const t of e.cells)s.push(al(t,n));return new t({cells:s})}get trainableWeights(){if(!this.trainable)return[];const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t}get nonTrainableWeights(){const t=[];for(const e of this.cells)t.push(...e.nonTrainableWeights);if(!this.trainable){const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e.concat(t)}return t}getWeights(){const t=[];for(const e of this.cells)t.push(...e.weights);return Oo(t)}setWeights(t){const e=[];for(const n of this.cells){const s=n.weights.length,i=t.splice(s);for(let t=0;teo(n(),s),o=()=>no(a,n,i);if(!r||r<=1)return e.keep(o().clone());return Array(r).fill(void 0).map(o).map((t=>e.keep(t.clone())))}vh.className="StackedRNNCells",e.serialization.registerClass(vh);class Ih extends fh{constructor(t){if(t.unroll)throw new Kr("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(t.cell))throw new Kr("It is not possible at the moment to stack convolutional cells.");super(t),this.inputSpec=[new Wo({ndim:5})]}call(t,n){return e.tidy((()=>{if(null!=this.cell.dropoutMask&&(e.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(e.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),n&&n.constants)throw new Ur("ConvRNN2D cell does not support constants");const s=null==n?null:n.mask,i=null==n?null:n.training,r=null==n?null:n.initialState;return super.call(t,{mask:s,training:i,initialState:r})}))}computeOutputShape(t){let e=this.computeSingleOutputShape(t);return this.returnSequences||(e=[e[0],...e.slice(2)]),this.returnState&&(e=[e,...Array(2).fill([t[0],...e.slice(-3)])]),e}getInitialState(t){return e.tidy((()=>{const{stateSize:n}=this.cell,s=t.shape,i=this.computeSingleOutputShape(s),r=[i[0],...i.slice(2)],a=e.zeros(r);return Array.isArray(n)?Array(n.length).fill(a):[a]}))}resetStates(t,n=!1){e.tidy((()=>{if(!this.stateful)throw new Wr("Cannot call resetStates() on an RNN Layer that is not stateful.");const s=this.inputSpec[0].shape,i=this.computeSingleOutputShape(s),r=[i[0],...i.slice(2)];if(null==s[0])throw new Ur("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>e.zeros(r))):this.states_=[e.zeros(r)];else if(null==t)e.dispose(this.states_),null!=this.keptStates&&(e.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>e.zeros(r))):this.states_[0]=e.zeros(r);else{if(Array.isArray(t)||(t=[t]),t.length!==this.states_.length)throw new Ur(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${t.length} state value(s). Input received: ${t}`);n?this.keptStates.push(this.states_.slice()):e.dispose(this.states_);for(let n=0;ne.keep(t.clone())))}))}computeSingleOutputShape(t){const{dataFormat:e,filters:n,kernelSize:s,padding:i,strides:r,dilationRate:a}=this.cell,o="channelsFirst"===e,l=t[o?3:2],u=t[o?4:3],h=Ju(l,s[0],i,r[0],a[0]),c=Ju(u,s[1],i,r[1],a[1]);return[...t.slice(0,2),...o?[n,h,c]:[h,c,n]]}}Ih.className="ConvRNN2D";class Nh extends kh{constructor(t){const{filters:e,kernelSize:n,strides:s,padding:i,dataFormat:r,dilationRate:a}=t;super(Object.assign({},t,{units:e})),this.filters=e,oa(this.filters,"filters"),this.kernelSize=Hu(n,2,"kernelSize"),this.kernelSize.forEach((t=>oa(t,"kernelSize"))),this.strides=Hu(s||1,2,"strides"),this.strides.forEach((t=>oa(t,"strides"))),this.padding=i||"valid",Ca(this.padding),this.dataFormat=r||"channelsLast",Aa(this.dataFormat),this.dilationRate=Hu(a||1,2,"dilationRate"),this.dilationRate.forEach((t=>oa(t,"dilationRate")))}build(t){var n;t=Lo(t);const s="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[s])throw new Ur(`The channel dimension of the input should be defined. Found ${t[s]}`);const i=t[s],r=this.kernelSize.concat([i,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const a=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",a,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let t;if(this.unitForgetBias){const s=this.biasInitializer,i=this.filters;t=new((n=class extends ro{apply(t,n){return qa([s.apply([i]),e.ones([i]),s.apply([2*i])])}}).className="CustomInit",n)}else t=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,t,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(t,n){return e.tidy((()=>{if(3!==t.length)throw new Ur(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${t.length}.`);const s=n.training||!1,i=t[0],r=t[1],a=t[2];0e.onesLike(i),rate:this.dropout,training:s,count:4}));const o=this.dropoutMask,l=(t,n,s)=>n&&n[s]?e.mul(n[s],t):t;let u=l(i,o,0),h=l(i,o,1),c=l(i,o,2),p=l(i,o,3);0e.onesLike(r),rate:this.recurrentDropout,training:s,count:4}));const d=this.recurrentDropoutMask;let f=l(r,d,0),g=l(r,d,1),m=l(r,d,2),y=l(r,d,3);const[b,w,k,x]=e.split(this.kernel.read(),4,3),[v,S,I,N]=this.useBias?e.split(this.bias.read(),4):[null,null,null,null];u=this.inputConv(u,b,v,this.padding),h=this.inputConv(h,w,S,this.padding),c=this.inputConv(c,k,I,this.padding),p=this.inputConv(p,x,N,this.padding);const[z,A,C,$]=e.split(this.recurrentKernel.read(),4,3);f=this.recurrentConv(f,z),g=this.recurrentConv(g,A),m=this.recurrentConv(m,C),y=this.recurrentConv(y,$);const D=this.recurrentActivation.apply(e.add(u,f)),T=this.recurrentActivation.apply(e.add(h,g)),E=e.add(e.mul(T,a),e.mul(D,this.activation.apply(e.add(c,m)))),F=e.mul(this.recurrentActivation.apply(e.add(p,y)),this.activation.apply(E));return[F,F,E]}))}getConfig(){const t=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(t);i{this.invokeCallHook(t,n);const e=Fo(t);if(0eo(e,this.rate,s,this.seed)),(()=>e),t)}return t}))}getConfig(){const t={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},e=super.getConfig();return Object.assign(t,e),t}dispose(){return super.dispose()}}Ah.className="Dropout",e.serialization.registerClass(Ah);class Ch extends Ah{constructor(t){super(t),this.inputSpec=[{ndim:3}]}getNoiseShape(t){const e=t.shape;return[e[0],1,e[2]]}}Ch.className="SpatialDropout1D",e.serialization.registerClass(Ch);class $h extends jo{constructor(t){if(super(t),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==t.batchInputShape&&null==t.inputShape&&null!=t.inputDim){let e=null;null!=t.batchSize&&(e=t.batchSize),this.batchInputShape=[e,t.inputDim]}this.units=t.units,oa(this.units,"units"),this.activation=Lu(t.activation),null!=t.useBias&&(this.useBias=t.useBias),this.kernelInitializer=No(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=No(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=wa(t.kernelConstraint),this.biasConstraint=wa(t.biasConstraint),this.kernelRegularizer=Pu(t.kernelRegularizer),this.biasRegularizer=Pu(t.biasRegularizer),this.activityRegularizer=Pu(t.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(t){const e=(t=Lo(t))[t.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[e,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:e}}],this.built=!0}computeOutputShape(t){const e=(t=Lo(t)).slice();return e[e.length-1]=this.units,e}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n);const e=Fo(t),s=ua(this.activation.getClassName());let i;return null!=s?i=Za(e,this.kernel.read(),s,this.bias?this.bias.read():null):(i=Za(e,this.kernel.read()),null!=this.bias&&(i=to(i,this.bias.read())),null!=this.activation&&(i=this.activation.apply(i))),i}))}getConfig(){const t={units:this.units,activation:Eu(this.activation),useBias:this.useBias,kernelInitializer:Io(this.kernelInitializer),biasInitializer:Io(this.biasInitializer),kernelRegularizer:Bu(this.kernelRegularizer),biasRegularizer:Bu(this.biasRegularizer),activityRegularizer:Bu(this.activityRegularizer),kernelConstraint:ya(this.kernelConstraint),biasConstraint:ya(this.biasConstraint)},e=super.getConfig();return Object.assign(t,e),t}}$h.className="Dense",e.serialization.registerClass($h);class Dh extends jo{constructor(t){super(t=t||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=t.dataFormat}computeOutputShape(t){t=Lo(t);for(const e of t.slice(1))if(null==e)throw new Ur(`The shape of the input to "Flatten" is not fully defined (got ${t.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[t[0],Ra(t,1)]}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n);let e=Fo(t);if("channelsFirst"===this.dataFormat&&e.rank>1){const t=[0];for(let n=2;n{this.invokeCallHook(t,n);const e=Fo(t);return this.activation.apply(e)}))}getConfig(){const t={activation:Eu(this.activation)},e=super.getConfig();return Object.assign(t,e),t}}Th.className="Activation",e.serialization.registerClass(Th);class Eh extends jo{constructor(t){super(t),this.n=t.n,this.inputSpec=[{ndim:2}]}computeOutputShape(t){return[t[0],this.n,t[1]]}call(t,n){return e.tidy((()=>{return t=Fo(t),n=t,s=this.n,e.tidy((()=>{if(2!==n.shape.length)throw new Ur(`repeat() expects a rank-2 tensor, but received a rank-${n.shape.length} tensor.`);return Ha(Ua(n,1),[1,s,1])}));var n,s}))}getConfig(){const t={n:this.n},e=super.getConfig();return Object.assign(t,e),t}}Eh.className="RepeatVector",e.serialization.registerClass(Eh);class Fh extends jo{constructor(t){super(t),this.targetShape=t.targetShape;for(let t=0;t{this.invokeCallHook(t,n);const e=Fo(t),s=e.shape,i=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return e.reshape(i)}))}getConfig(){const t={targetShape:this.targetShape},e=super.getConfig();return Object.assign(t,e),t}}Fh.className="Reshape",e.serialization.registerClass(Fh);class Lh extends jo{constructor(t){if(super(t),null==t.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(t.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${t.dims} instead.`);const n=Wa(1,t.dims.length+1);if(!e.util.arraysEqual(t.dims.slice().sort(),n))throw new Error("Invalid permutation `dims`: "+JSON.stringify(t.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=t.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Wo({ndim:this.dims.length+1})]}computeOutputShape(t){const e=(t=Lo(t)).slice();return this.dims.forEach(((n,s)=>{e[s+1]=t[n]})),e}call(t,n){return e.transpose(Fo(t),this.dimsIncludingBatch)}getConfig(){const t={dims:this.dims},e=super.getConfig();return Object.assign(t,e),t}}Lh.className="Permute",e.serialization.registerClass(Lh);class _h extends jo{constructor(t){super(null==t?{}:t),this.supportsMasking=!0,this.maskValue=null!=t?null==t.maskValue?0:t.maskValue:0}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={maskValue:this.maskValue};return Object.assign(e,t),e}computeMask(t,n){const s=Fo(t);return e.any(e.notEqual(s,this.maskValue),-1)}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n);const s=Fo(t),i=e.any(e.notEqual(s,this.maskValue),-1,!0);return s.mul(i.asType(s.dtype))}))}}_h.className="Masking",e.serialization.registerClass(_h);class Rh extends jo{constructor(t){if(super(t),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==t.batchInputShape&&null==t.inputShape){let e=null;null!=t.batchSize&&(e=t.batchSize),null==t.inputLength?this.batchInputShape=[e,null]:this.batchInputShape=[e].concat(Jr(t.inputLength))}this.inputDim=t.inputDim,oa(this.inputDim,"inputDim"),this.outputDim=t.outputDim,oa(this.outputDim,"outputDim"),this.embeddingsInitializer=No(t.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=Pu(t.embeddingsRegularizer),this.activityRegularizer=Pu(t.activityRegularizer),this.embeddingsConstraint=wa(t.embeddingsConstraint),this.maskZero=t.maskZero,this.supportsMasking=t.maskZero,this.inputLength=t.inputLength}build(t){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(t){}computeMask(t,n){return e.tidy((()=>this.maskZero?(t=Fo(t),e.notEqual(t,e.zerosLike(t))):null))}computeOutputShape(t){if(t=Lo(t),null==this.inputLength)return[...t,this.outputDim];const e=Jr(this.inputLength);if(e.length!==t.length-1)throw new Ur(`"inputLength" is ${this.inputLength}, but received input shape has shape ${t}`);{let n=0;for(let s=0;s{this.invokeCallHook(t,n);let e=Fo(t);"int32"!==e.dtype&&(e=Pa(e,"int32"));return Xa(this.embeddings.read(),e.as1D()).reshape(Lo(this.computeOutputShape(e.shape)))}))}getConfig(){const t={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Io(this.embeddingsInitializer),embeddingsRegularizer:Bu(this.embeddingsRegularizer),activityRegularizer:Bu(this.activityRegularizer),embeddingsConstraint:ya(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},e=super.getConfig();return Object.assign(t,e),t}}Rh.className="Embedding",e.serialization.registerClass(Rh);class Mh extends jo{constructor(t){super(t||{}),this.supportsMasking=!0}mergeFunction(t){throw new Kr}computeElementwiseOpOutputShape(t,e){if(null==t||null==e)return null;if(t.length1)throw new Ur(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(t)}.`);let n=null==t[0]?null:t[0].slice(1);for(let e=1;et.length));-1===t.indexOf(null)&&1===sa(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(t,n){return e.tidy((()=>{if(t=t,this.reshapeRequired){const n=[],s=t.map((t=>t.rank));if(-1===s.indexOf(null)){const e=Ba(s);for(let s of t){const t=s.rank;for(let n=0;n1){const r=Wa(1,t).concat([0]);n.push(e.transpose(i,r)),s=!0}else n.push(i)}let i=this.mergeFunction(n);const r=i.rank;if(s)if(null==r){const t=i.shape,n=t[t.length-1],s=[n].concat(t.slice(0,t.length-1));i=e.transpose(i.reshape([-1,n]),[1,0]).reshape(s)}else if(r>1){const t=[r-1].concat(Wa(0,r-1));i=e.transpose(i,t)}return i}}return this.mergeFunction(t)}))}computeOutputShape(t){let e;e=null==(t=t)[0]?null:t[0].slice(1);for(let n=1;n{if(null==n)return null;if(!Array.isArray(n))throw new Ur("`mask` should be an Array");if(!Array.isArray(t))throw new Ur("`inputs` should be an Array");if(n.length!==t.length)throw new Ur(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${t.length} vs ${n.length})`);if(n.every((t=>null==t)))return null;let s=(n=n.map((t=>null==t?t:e.expandDims(t,0))))[0];for(let t=1;t{let n=t[0].clone();for(let s=1;s{let n=t[0].clone();for(let s=1;s{let n=t[0].clone();for(let s=1;s{let n=t[0];for(let s=1;s{let n=t[0];for(let s=1;s1)throw new Ur("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(t))}mergeFunction(t){return e.tidy((()=>qa(t,this.axis)))}computeOutputShape(t){if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Ur("A `Concatenate` layer should be called on a list of inputs.");const e=t,n=e[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const t of e.slice(1)){if(null==n[s]||null==t[s]){n[s]=null;break}n[s]+=t[s]}return n}computeMask(t,n){if(null==n)return null;if(!Array.isArray(n))throw new Ur("`mask` should be an array for Concatenate");if(!Array.isArray(t))throw new Ur("`inputs` should be an array for Concatenate");if(n.length!==t.length)throw new Ur(`Mismatch in the length of mask (${n.length}) and the legnth of inputs (${t.length})`);return e.tidy((()=>{let s=!0;if(n.forEach((t=>{null==t||(s=!1)})),s)return null;const i=[];for(let s=0;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const n=t[0],s=t[1];if(n.length>3||s.length>3)throw new Kr("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(n,s);if(n[i[0]]!==s[i[1]])throw new Ur(`Dimension incompatibility: ${n[i[0]]} !== ${s[i[1]]}`)}mergeFunction(t){if(2!==t.length)throw new Ur(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${t.length} input(s).`);let n,s=t[0],i=t[1];return n=Array.isArray(this.axes)?this.axes.map(((e,n)=>Vh(e,t[n].shape.length))):[Vh(this.axes,s.shape.length),Vh(this.axes,i.shape.length)],this.normalize&&(s=ol(s,n[0]),i=ol(i,n[1])),function(t,n,s){if(t.shape.length>3||n.shape.length>3)throw new Kr("batchDot is not implemented for tensors of 4D or higher rank yet");if(e.util.assert(t.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${t.shape.length}`)),e.util.assert(t.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${n.shape.length}`)),"number"==typeof s&&(s=[s,s]),"complex64"===t.dtype||"complex64"===n.dtype)throw new Kr("batchDot is not implemented for complex64-type Tensors yet.");const i=t.shape.length,r=n.shape.length;null==s&&(s=[i-1,r-2]);const a=s;return e.tidy((()=>{let e,s;if(i>r){e=i-r;const t=[];for(let n=0;ni){e=r-i;const n=[];for(let t=0;t0){let t;t=i>r?i+r-3:i-1;const n=[];for(let s=t;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const n=t[0].slice(),s=t[1].slice();if(n.length>3||s.length>3)throw new Kr("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(n,s);n.splice(i[0],1),s.splice(i[1],1),s.splice(0,1);const r=n.concat(s);return 1===r.length&&r.push(1),r}computeMask(t,e){return null}getConfig(){const t={axes:this.axes,normalize:this.normalize},e=super.getConfig();return Object.assign(t,e),t}}jh.className="Dot",e.serialization.registerClass(jh);class qh extends jo{constructor(t){super(t),this.supportsMasking=!0,this.stddev=t.stddev}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={stddev:this.stddev};return Object.assign(e,t),e}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n);const e=Fo(t);return no((()=>Ja(e.shape,0,this.stddev).add(e)),(()=>e),n.training||!1)}))}}qh.className="GaussianNoise",e.serialization.registerClass(qh);class Gh extends jo{constructor(t){super(t),this.supportsMasking=!0,this.rate=t.rate}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={rate:this.rate};return Object.assign(e,t),e}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n);const e=Fo(t);if(this.rate>0&&this.rate<1){return no((()=>{const t=Math.sqrt(this.rate/(1-this.rate));return e.mul(Ja(e.shape,1,t))}),(()=>e),n.training||!1)}return e}))}}Gh.className="GaussianDropout",e.serialization.registerClass(Gh);class Hh extends jo{constructor(t){super(t),this.supportsMasking=!0,this.rate=t.rate,this.noiseShape=t.noiseShape}_getNoiseShape(t){return this.noiseShape||Fo(t).shape}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={rate:this.rate};return Object.assign(e,t),e}call(t,n){return e.tidy((()=>{if(this.rate<1&&this.rate>0){const s=this._getNoiseShape(t);return no((()=>{const n=Fo(t),i=-1.7580993408473766;let r=e.greaterEqual(e.randomUniform(s),this.rate);r=Pa(r,"float32");const a=((1-this.rate)*(1+this.rate*i**2))**-.5,o=-a*i*this.rate;return n.mul(r).add(r.add(-1).mul(i)).mul(a).add(o)}),(()=>Fo(t)),n.training||!1)}return t}))}}function Jh(t,n,s,i,r,a=.001){let o;if(2===t.rank)o=e.batchNorm2d(t,n,s,i,r,a);else if(3===t.rank)o=e.batchNorm3d(t,n,s,i,r,a);else{if(4!==t.rank)throw new Kr(`batchNormalization is not implemented for array of rank ${t.rank} yet`);o=e.batchNorm4d(t,n,s,i,r,a)}return o}function Zh(t,n,s,i,r=.001){return e.util.arraysEqual(i.slice().sort(),Wa(0,t.rank-1))?function(t,n,s,i,r=.001){return e.tidy((()=>{const a=e.moments(t,i),o=a.mean,l=a.variance;return[Jh(t,o,l,s,n,r),o,l]}))}(t,n,s,i,r):function(t,n,s,i,r=.001){return e.tidy((()=>{const a=e.moments(t,i),o=a.mean,l=a.variance,u=[];for(const e of Wa(0,t.rank))-1!==i.indexOf(e)?u.push(1):u.push(t.shape[e]);const h=o.reshape(u),c=l.reshape(u),p=null==n?null:n.reshape(u),d=null==s?null:s.reshape(u);return[Jh(t,h,c,d,p,r),o,l]}))}(t,n,s,i,r)}Hh.className="AlphaDropout",e.serialization.registerClass(Hh);class Xh extends jo{constructor(t){null==t&&(t={}),super(t),this.supportsMasking=!0,this.axis=null==t.axis?-1:t.axis,this.momentum=null==t.momentum?.99:t.momentum,this.epsilon=null==t.epsilon?.001:t.epsilon,this.center=null==t.center||t.center,this.scale=null==t.scale||t.scale,this.betaInitializer=No(t.betaInitializer||"zeros"),this.gammaInitializer=No(t.gammaInitializer||"ones"),this.movingMeanInitializer=No(t.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=No(t.movingVarianceInitializer||"ones"),this.betaConstraint=wa(t.betaConstraint),this.gammaConstraint=wa(t.gammaConstraint),this.betaRegularizer=Pu(t.betaRegularizer),this.gammaRegularizer=Pu(t.gammaRegularizer)}build(t){t=Lo(t);const e=this.axis>=0?this.axis:this.axis+t.length,n=t[e];if(null==n)throw new Ur(`Axis ${e} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(t)}.`);this.inputSpec=[new Wo({ndim:t.length,axes:{[e]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(t,n){return e.tidy((()=>{const s=null!=n.training&&n.training,i=Fo(t),r=i.shape,a=r.length,o=Wa(0,a),l=this.axis>=0?this.axis:this.axis+a;o.splice(l,1);const u=jr(1,a);u[l]=r[l];const h=o.slice();h.sort();const c=!e.util.arraysEqual(h,Wa(0,a).slice(0,a-1));if(!s)return(()=>{if(c){const t=this.movingMean.read().reshape(u),e=this.movingVariance.read().reshape(u),n=this.center?this.beta.read().reshape(u):null,s=this.scale?this.gamma.read().reshape(u):null;return Jh(i,t,e,n,s,this.epsilon)}return Jh(i,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[p,d,f]=Zh(i,this.gamma.read(),this.beta.read(),o,this.epsilon),g=(t,n,s)=>{e.tidy((()=>{const e=1-s,i=t.read(),r=i.sub(n).mul(e);t.write(i.sub(r))}))};return(()=>{g(this.movingMean,d,this.momentum),g(this.movingVariance,f,this.momentum)})(),p}))}getConfig(){const t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Io(this.betaInitializer),gammaInitializer:Io(this.gammaInitializer),movingMeanInitializer:Io(this.movingMeanInitializer),movingVarianceInitializer:Io(this.movingVarianceInitializer),betaRegularizer:Bu(this.betaRegularizer),gammaRegularizer:Bu(this.gammaRegularizer),betaConstraint:ya(this.betaConstraint),gammaConstraint:ya(this.gammaConstraint)},e=super.getConfig();return Object.assign(t,e),t}}Xh.className="BatchNormalization",e.serialization.registerClass(Xh);class Yh extends jo{constructor(t){if(null==t&&(t={}),super(t),this.axis=null==t.axis?-1:t.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==t.epsilon?.001:t.epsilon,this.center=null==t.center||t.center,this.scale=null==t.scale||t.scale,this.betaInitializer=No(t.betaInitializer||"zeros"),this.gammaInitializer=No(t.gammaInitializer||"ones"),this.betaRegularizer=Pu(t.betaRegularizer),this.gammaRegularizer=Pu(t.gammaRegularizer),this.supportsMasking=!0}build(t){const e=(t=Lo(t)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let t=0;t=e)throw new Error(`Invalid axis: ${t}`);if(this.axis.length!==sa(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((e=>t[e]));this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,true):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,true):this.beta=null,this.built=!0}call(t,n){const s=Fo(t),i=s.shape,r=i.length;return e.tidy((()=>{let{mean:t,variance:n}=e.moments(s,this.axis,!0);const a=jr(1,r);for(const t of this.axis)a[t]=i[t];const o=t=>null!=t&&t.shape.length!==r&&this.axis!==[r-1]?t.reshape(a):t;let l=o(this.gamma.read()),u=o(this.beta.read());const h=[],c=[];for(let t=0;t=0?t[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[3]&&t[3]>=0?t[3]+this.padding[1][0]+this.padding[1][1]:null,[t[0],t[1],e,n]):(e=null!=t[1]&&t[1]>=0?t[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[2]&&t[2]>=0?t[2]+this.padding[1][0]+this.padding[1][1]:null,[t[0],e,n,t[3]])}call(t,n){return e.tidy((()=>{return n=Fo(t),s=this.padding,i=this.dataFormat,e.tidy((()=>{if(4!==n.rank)throw new Ur(`temporalPadding expects input tensor to be 4-D, but received a ${n.rank}-D tensor.`);if(null==s&&(s=[[1,1],[1,1]]),2!==s.length||2!==s[0].length||2!==s[1].length)throw new Ur("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new Ur(`Unknown data format: ${i}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let t;return t="channelsFirst"===i?[[0,0],[0,0],s[0],s[1]]:[[0,0],s[0],s[1],[0,0]],e.pad(n,t)}));var n,s,i}))}getConfig(){const t={padding:this.padding,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}function tc(t,n,s,i,r,a){return e.tidy((()=>{let o;Aa(r),$a(a),Ca(i),null==s&&(s=[1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),t=Xu(t,r);const l="same"===i?"same":"valid";return o="max"===a?e.maxPool(t,n,s,l):e.avgPool(t,n,s,l),"channelsFirst"===r&&(o=e.transpose(o,[0,3,1,2])),o}))}function ec(t,n,s,i,r,a){return e.tidy((()=>{let o;Aa(r),$a(a),Ca(i),null==s&&(s=[1,1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),t=Yu(t,r);const l="same"===i?"same":"valid";return o="max"===a?e.maxPool3d(t,n,s,l):e.avgPool3d(t,n,s,l),"channelsFirst"===r&&(o=e.transpose(o,[0,4,1,2,3])),o}))}Qh.className="ZeroPadding2D",e.serialization.registerClass(Qh);class nc extends jo{constructor(t){if(null==t.poolSize&&(t.poolSize=2),super(t),"number"==typeof t.poolSize)this.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new Ur(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(t.poolSize)}`);this.poolSize=t.poolSize}if(oa(this.poolSize,"poolSize"),null==t.strides)this.strides=this.poolSize;else if("number"==typeof t.strides)this.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new Ur(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(t.strides)}`);this.strides=t.strides}oa(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,Ca(this.padding),this.inputSpec=[new Wo({ndim:3})]}computeOutputShape(t){const e=Ju((t=Lo(t))[1],this.poolSize[0],this.padding,this.strides[0]);return[t[0],e,t[2]]}call(t,n){return e.tidy((()=>{this.invokeCallHook(t,n),t=Ua(Fo(t),2);const s=this.poolingFunction(Fo(t),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return e.squeeze(s,[2])}))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},e=super.getConfig();return Object.assign(t,e),t}}class sc extends nc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),tc(t,e,n,s,i,"max")}}sc.className="MaxPooling1D",e.serialization.registerClass(sc);class ic extends nc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),tc(t,e,n,s,i,"avg")}}ic.className="AveragePooling1D",e.serialization.registerClass(ic);class rc extends jo{constructor(t){if(null==t.poolSize&&(t.poolSize=[2,2]),super(t),this.poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)this.strides=this.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new Ur(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${t.strides.length}.`);this.strides=t.strides}else this.strides=[t.strides,t.strides];oa(this.poolSize,"poolSize"),oa(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Aa(this.dataFormat),Ca(this.padding),this.inputSpec=[new Wo({ndim:4})]}computeOutputShape(t){t=Lo(t);let e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2];return e=Ju(e,this.poolSize[0],this.padding,this.strides[0]),n=Ju(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n]:[t[0],e,n,t[3]]}call(t,n){return e.tidy((()=>(this.invokeCallHook(t,n),this.poolingFunction(Fo(t),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class ac extends rc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),tc(t,e,n,s,i,"max")}}ac.className="MaxPooling2D",e.serialization.registerClass(ac);class oc extends rc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),tc(t,e,n,s,i,"avg")}}oc.className="AveragePooling2D",e.serialization.registerClass(oc);class lc extends jo{constructor(t){if(null==t.poolSize&&(t.poolSize=[2,2,2]),super(t),this.poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize,t.poolSize],null==t.strides)this.strides=this.poolSize;else if(Array.isArray(t.strides)){if(3!==t.strides.length)throw new Ur(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${t.strides.length}.`);this.strides=t.strides}else this.strides=[t.strides,t.strides,t.strides];oa(this.poolSize,"poolSize"),oa(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Aa(this.dataFormat),Ca(this.padding),this.inputSpec=[new Wo({ndim:5})]}computeOutputShape(t){t=Lo(t);let e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],s="channelsFirst"===this.dataFormat?t[4]:t[3];return e=Ju(e,this.poolSize[0],this.padding,this.strides[0]),n=Ju(n,this.poolSize[1],this.padding,this.strides[1]),s=Ju(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n,s]:[t[0],e,n,s,t[4]]}call(t,n){return e.tidy((()=>(this.invokeCallHook(t,n),this.poolingFunction(Fo(t),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class uc extends lc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),ec(t,e,n,s,i,"max")}}uc.className="MaxPooling3D",e.serialization.registerClass(uc);class hc extends lc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Aa(i),Ca(s),ec(t,e,n,s,i,"avg")}}hc.className="AveragePooling3D",e.serialization.registerClass(hc);class cc extends jo{constructor(t){super(t),this.inputSpec=[new Wo({ndim:3})]}computeOutputShape(t){return[t[0],t[2]]}call(t,e){throw new Kr}}class pc extends cc{constructor(t){super(t||{})}call(t,n){return e.tidy((()=>{const n=Fo(t);return e.mean(n,1)}))}}pc.className="GlobalAveragePooling1D",e.serialization.registerClass(pc);class dc extends cc{constructor(t){super(t||{})}call(t,n){return e.tidy((()=>{const n=Fo(t);return e.max(n,1)}))}}dc.className="GlobalMaxPooling1D",e.serialization.registerClass(dc);class fc extends jo{constructor(t){super(t),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Aa(this.dataFormat),this.inputSpec=[new Wo({ndim:4})]}computeOutputShape(t){return t=t,"channelsLast"===this.dataFormat?[t[0],t[3]]:[t[0],t[1]]}call(t,e){throw new Kr}getConfig(){const t={dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class gc extends fc{call(t,n){return e.tidy((()=>{const n=Fo(t);return"channelsLast"===this.dataFormat?e.mean(n,[1,2]):e.mean(n,[2,3])}))}}gc.className="GlobalAveragePooling2D",e.serialization.registerClass(gc);class mc extends fc{call(t,n){return e.tidy((()=>{const n=Fo(t);return"channelsLast"===this.dataFormat?e.max(n,[1,2]):e.max(n,[2,3])}))}}mc.className="GlobalMaxPooling2D",e.serialization.registerClass(mc);class yc extends jo{constructor(t){super(t),this.layer=t.layer}build(t){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(t){null!=this.layer&&(this.layer.trainable=t)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(t){this.layer.setWeights(t)}getConfig(){const t={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},e=super.getConfig();return Object.assign(t,e),t}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(t)}static fromConfig(t,e,n={}){const s=al(e.layer,n);delete e.layer;const i={layer:s};return Object.assign(i,e),new t(i)}}class bc extends yc{constructor(t){super(t),this.supportsMasking=!0}build(t){if((t=Lo(t)).length<3)throw new Ur(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(t)}`);this.inputSpec=[{shape:t}];const e=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(e),this.layer.built=!0),super.build(t)}computeOutputShape(t){const e=[(t=Lo(t))[0]].concat(t.slice(2)),n=this.layer.computeOutputShape(e),s=t[1];return[n[0],s].concat(n.slice(1))}call(t,n){return e.tidy((()=>dh(((t,e)=>[Fo(this.layer.call(t,n)),[]]),t=Fo(t),[],!1,null,null,!1,!0)[1]))}}bc.className="TimeDistributed",e.serialization.registerClass(bc);class wc extends yc{constructor(t){super(t);const e=t.layer.getConfig(),n={};n.className=t.layer.getClassName(),n.config=e,this.forwardLayer=al(n),e.goBackwards=!0!==e.goBackwards;const s={};var i;if(s.className=t.layer.getClassName(),s.config=e,this.backwardLayer=al(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===t.mergeMode?"concat":t.mergeMode,i=this.mergeMode,ra(Na,"BidirectionalMergeMode",i),t.weights)throw new Kr("weights support is not implemented for Bidirectional layer yet.");this._stateful=t.layer.stateful,this.returnSequences=t.layer.returnSequences,this.returnState=t.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=t.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(t){this._trainable=t,null!=this.forwardLayer&&(this.forwardLayer.trainable=t),null!=this.backwardLayer&&(this.backwardLayer.trainable=t)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(t){const e=t.length,n=Math.floor(e/2);this.forwardLayer.setWeights(t.slice(0,n)),this.backwardLayer.setWeights(t.slice(n))}computeOutputShape(t){let e,n,s,i=this.forwardLayer.computeOutputShape(t);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(s=i.slice(1),e=i[0]):e=i[0],e=e,"concat"===this.mergeMode?(e[e.length-1]*=2,n=[e]):n=null==this.mergeMode?[e,e.slice()]:[e],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[e].concat(s).concat(s.slice()):Hr(n)}apply(t,e){let n=null==e?null:e.initialState,s=null==e?null:e.constants;null==e&&(e={});const i=ph(t,n,s,this.numConstants);if(t=i.inputs,n=i.initialState,s=i.constants,Array.isArray(t)&&(n=t.slice(1),t=t[0]),(null==n||0===n.length)&&null==s)return super.apply(t,e);const r=[],a=[];if(null!=n){const t=n.length;if(t%2>0)throw new Ur("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");e.initialState=n,r.push(...n);const s=n.map((t=>new Wo({shape:t.shape})));this.forwardLayer.stateSpec=s.slice(0,t/2),this.backwardLayer.stateSpec=s.slice(t/2),a.push(...s)}if(null!=s)throw new Kr("Support for constants in Bidirectional layers is not implemented yet.");const o=r[0]instanceof Po;for(const t of r)if(t instanceof Po!==o)throw new Ur("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[t].concat(r),s=this.inputSpec.concat(a),i=this.inputSpec;this.inputSpec=s;const o=super.apply(n,e);return this.inputSpec=i,o}return super.apply(t,e)}call(t,n){return e.tidy((()=>{const s=n.initialState;let i,r,a,o;if(null==s)i=this.forwardLayer.call(t,n),r=this.backwardLayer.call(t,n);else{const e=s.slice(0,s.length/2),a=s.slice(s.length/2);i=this.forwardLayer.call(t,Object.assign(n,{initialState:e})),r=this.backwardLayer.call(t,Object.assign(n,{initialState:a}))}return this.returnState&&(Array.isArray(i)&&(a=i.slice(1).concat(r.slice(1))),i=i[0],r=r[0]),this.returnSequences&&(r=e.reverse(r,1)),"concat"===this.mergeMode?o=qa([i,r]):"sum"===this.mergeMode?o=e.add(i,r):"ave"===this.mergeMode?o=e.mul(.5,e.add(i,r)):"mul"===this.mergeMode?o=e.mul(i,r):null==this.mergeMode&&(o=[i,r]),this.returnState?null==this.mergeMode?o.concat(a):[o].concat(a):o}))}resetStates(t){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(t){Ta(this.forwardLayer.name,(()=>{this.forwardLayer.build(t)})),Ta(this.backwardLayer.name,(()=>{this.backwardLayer.build(t)})),this.built=!0}computeMask(t,e){let n;if(Array.isArray(e)&&(e=e[0]),n=this.returnSequences?null==this.mergeMode?[e,e]:e:null==this.mergeMode?[null,null]:null,this.returnState){const t=this.forwardLayer.states.map((t=>null));return Array.isArray(n)?n.concat(t).concat(t):[n].concat(t).concat(t)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(t),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(t)}getConfig(){const t={mergeMode:this.mergeMode},e=super.getConfig();return Object.assign(t,e),t}static fromConfig(t,e){const n=al(e.layer);if(delete e.layer,null!=e.numConstants)throw new Kr("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=e;return s.layer=n,new t(s)}}function kc(t){return new ic(t)}function xc(t){return new oc(t)}function vc(t){return new hc(t)}function Sc(t){return new dc(t)}function Ic(t){return new mc(t)}function Nc(t){return new sc(t)}function zc(t){return new ac(t)}wc.className="Bidirectional",e.serialization.registerClass(wc);const Ac=Sc,Cc=Ic,$c=Nc,Dc=zc;var Tc=Object.freeze({__proto__:null,inputLayer:function(t){return new Go(t)},elu:function(t){return new ju(t)},reLU:function(t){return new Uu(t)},leakyReLU:function(t){return new Ku(t)},prelu:function(t){return new Vu(t)},softmax:function(t){return new Gu(t)},thresholdedReLU:function(t){return new qu(t)},conv1d:function(t){return new lh(t)},conv2d:function(t){return new nh(t)},conv2dTranspose:function(t){return new ih(t)},conv3d:function(t){return new sh(t)},conv3dTranspose:function(t){return new rh(t)},separableConv2d:function(t){return new oh(t)},cropping2D:function(t){return new uh(t)},upSampling2d:function(t){return new hh(t)},depthwiseConv2d:function(t){return new ch(t)},activation:function(t){return new Th(t)},dense:function(t){return new $h(t)},dropout:function(t){return new Ah(t)},spatialDropout1d:function(t){return new Ch(t)},flatten:function(t){return new Dh(t)},repeatVector:function(t){return new Eh(t)},reshape:function(t){return new Fh(t)},permute:function(t){return new Lh(t)},embedding:function(t){return new Rh(t)},add:function(t){return new Oh(t)},average:function(t){return new Wh(t)},concatenate:function(t){return new Kh(t)},maximum:function(t){return new Ph(t)},minimum:function(t){return new Uh(t)},multiply:function(t){return new Bh(t)},dot:function(t){return new jh(t)},batchNormalization:function(t){return new Xh(t)},layerNormalization:function(t){return new Yh(t)},zeroPadding2d:function(t){return new Qh(t)},averagePooling1d:kc,avgPool1d:function(t){return kc(t)},avgPooling1d:function(t){return kc(t)},averagePooling2d:xc,avgPool2d:function(t){return xc(t)},avgPooling2d:function(t){return xc(t)},averagePooling3d:vc,avgPool3d:function(t){return vc(t)},avgPooling3d:function(t){return vc(t)},globalAveragePooling1d:function(t){return new pc(t)},globalAveragePooling2d:function(t){return new gc(t)},globalMaxPooling1d:Sc,globalMaxPooling2d:Ic,maxPooling1d:Nc,maxPooling2d:zc,maxPooling3d:function(t){return new uc(t)},gru:function(t){return new wh(t)},gruCell:function(t){return new bh(t)},lstm:function(t){return new xh(t)},lstmCell:function(t){return new kh(t)},simpleRNN:function(t){return new yh(t)},simpleRNNCell:function(t){return new mh(t)},convLstm2d:function(t){return new zh(t)},convLstm2dCell:function(t){return new Nh(t)},rnn:function(t){return new fh(t)},stackedRNNCells:function(t){return new vh(t)},bidirectional:function(t){return new wc(t)},timeDistributed:function(t){return new bc(t)},globalMaxPool1d:Ac,globalMaxPool2d:Cc,maxPool1d:$c,maxPool2d:Dc,Layer:jo,RNN:fh,RNNCell:gh,input:mu,gaussianNoise:function(t){return new qh(t)},gaussianDropout:function(t){return new Gh(t)},alphaDropout:function(t){return new Hh(t)},masking:function(t){return new _h(t)}});var Ec=Object.freeze({__proto__:null,binaryAccuracy:function(t,e){return yl(t,e)},binaryCrossentropy:function(t,e){return vl(t,e)},sparseCategoricalAccuracy:function(t,e){return Sl(t,e)},categoricalAccuracy:function(t,e){return bl(t,e)},categoricalCrossentropy:function(t,e){return Il(t,e)},precision:function(t,e){return kl(t,e)},recall:function(t,e){return xl(t,e)},cosineProximity:function(t,e){return fl(t,e)},meanAbsoluteError:function(t,e){return ul(t,e)},meanAbsolutePercentageError:function(t,e){return hl(t,e)},MAPE:function(t,e){return hl(t,e)},mape:function(t,e){return hl(t,e)},meanSquaredError:function(t,e){return ll(t,e)},MSE:function(t,e){return ll(t,e)},mse:function(t,e){return ll(t,e)}}),Fc=Object.freeze({__proto__:null,modelFromJSON:async function(t,n){"modelTopology"in t||(t={modelTopology:t});let s=(t=t).modelTopology;null!=s.model_config&&(s=s.model_config);const i=al(Ml(s),n);if(null!=t.weightsManifest){const n=await e.io.loadWeights(t.weightsManifest,t.pathPrefix,i.weights.map((t=>t.originalName))),s={};for(const t of i.weights)s[t.originalName]=n[t.originalName];i.loadWeights(s),e.dispose(n)}return i}});var Lc=Object.freeze({__proto__:null,l1l2:function(t){return new Mu(t)},l1:function(t){return _u(e=t),new Mu({l1:null!=e?e.l1:null,l2:0});var e},l2:function(t){return _u(e=t),new Mu({l2:null!=e?e.l2:null,l1:0});var e}});class _c extends Yo{constructor(){super(...arguments),this.model=null}setModel(t){if(!(t instanceof pu))throw new Error("model must be a LayersModel, not some other Container");this.model=t}}function Rc(t,e){return te}class Oc extends _c{constructor(t){if(super(),null==t&&(t={}),t.restoreBestWeights)throw new Kr("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=t.monitor||"val_loss",this.minDelta=Math.abs(t.minDelta||0),this.patience=t.patience||0,this.verbose=t.verbose||0,this.mode=t.mode||"auto",this.baseline=t.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=Rc:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=Mc:this.monitorFunc=Rc,this.monitorFunc===Rc&&(this.minDelta*=-1)}async onTrainBegin(t){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Rc?1/0:-1/0}async onEpochEnd(t,e){await Jo(e);const n=this.getMonitorValue(e);null!=n&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=t,this.model.stopTraining=!0)))}async onTrainEnd(t){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(t){null==t&&(t={});const e=t[this.monitor];return null==e&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(t)}`),e}}const Bc={earlyStopping:function(t){return new Oc(t)}};t.Callback=_c,t.CallbackList=Qo,t.CustomCallback=nl,t.EarlyStopping=Oc,t.History=el,t.InputSpec=Wo,t.LayerVariable=Mo,t.LayersModel=pu,t.RNN=fh,t.Sequential=gu,t.SymbolicTensor=Po,t.callbacks=Bc,t.constraints=ka,t.initializers=zo,t.input=mu,t.layers=Tc,t.loadLayersModel=function(t,e){return null==e&&(e={}),fu(t,e)},t.metrics=Ec,t.model=function(t){return new pu(t)},t.models=Fc,t.registerCallbackConstructor=function(t,e){il.registerCallbackConstructor(t,e)},t.regularizers=Lc,t.sequential=function(t){return new gu(t)},t.version_layers=Bl,Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=tf-layers.es2017.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.html b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.html deleted file mode 100644 index 11babe691..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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-layers/dist/tf-layers.es2017.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.map deleted file mode 100644 index 9325d6973..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.es2017.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.es2017.min.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/optimizers.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["notYetImplemented","kernelName","Error","assert","expr","msg","flatten","arr","result","skipTypedArray","Array","isArray","isTypedArray","i","length","push","sizeFromShape","shape","size","arraysEqual","n1","n2","isInt","a","rightPad","repeat","parseAxisParam","axis","rank","map","s","concat","every","ax","Float32Array","Int32Array","Uint8Array","bytesPerElement","dtype","isString","value","String","inferDtype","values","isBoolean","isFunction","f","constructor","call","apply","computeStrides","strides","createNestedArray","offset","isComplex","ret","d","rest","slice","len","reduce","acc","c","toNestedArray","makeOnesTypedArray","array","makeZerosTypedArray","isPromise","object","then","TENSORFLOWJS_FLAGS_PREFIX","Environment","[object Object]","global","this","flags","flagRegistry","urlFlags","getQueryParams","populateURLFlags","platformName","platform","console","warn","flagName","evaluationFn","setHook","flagValue","set","evaluateFlag","get","features","Object","assign","location","search","urlParams","split","forEach","keyValue","key","toLowerCase","parseValue","queryString","params","replace","t","name","decodeURIComponent","decodeParam","join","env","ENV","globalNameSpace","getGlobalNamespace","ns","window","process","self","getGlobal","init","globalMap","_tfGlobals","Map","getGlobalMap","has","singleton","Acos","Acosh","Add","ArgMax","ArgMin","Asin","Asinh","Atan","Atanh","Atan2","AvgPool","BatchMatMul","BatchToSpaceND","Cast","Ceil","ClipByValue","ComplexAbs","Concat","Conv2D","Conv2DBackpropInput","Cosh","Cumsum","DepthwiseConv2dNative","Dilation2D","RealDiv","ExpandDims","Expm1","Floor","FloorDiv","FusedBatchNorm","GatherV2","GreaterEqual","Identity","IsFinite","IsInf","IsNan","LeakyRelu","Log1p","Maximum","MaxPool","Mean","Minimum","MirrorPad","Multiply","OnesLike","OneHot","Pack","PadV2","Prelu","Reciprocal","Relu","Reshape","ResizeNearestNeighbor","ResizeBilinear","Relu6","Reverse","Round","Rsqrt","Select","Selu","Slice","Sinh","Sign","Sigmoid","Softplus","Sqrt","SpaceToBatchND","SplitV","Softmax","SquaredDifference","Tanh","Tile","Transpose","Unpack","UnsortedSegmentSum","ZerosLike","Step","kernelRegistry","gradRegistry","getKernel","backendName","makeKey","getGradient","getKernelsForBackend","it","entries","done","next","config","backend","registerGradient","getBool","toTypedArray","base.flatten","vals","num","isNaN","isFinite","base.checkConversionForErrors","noConversionNeeded","bool","Math","round","now","decodeString","bytes","encoding","decode","Profiler","backendTimer","logger","Logger","inputs","outputs","holdResultWrapperFn","timer","start","util.now","timerAvailable","time","output","dataSync","Promise","resolve","kernelMs","data","tensorVals","checkComputationForErrors","timeMs","timing","extraInfo","getExtraProfileInfo","kernelProfile","all","valueContainer","logKernelProfile","util.rightPad","paddedName","toString","inputShapesDescription","input","inputShape","inputRank","log","tensorToString","verbose","padPerCol","n","numCols","fill","valuesOrTuples","createComplexTuples","row","j","max","valToString","computeMaxSizePerColumn","valsLines","subTensorToString","lines","l","val","pad","valStr","parseFloat","toFixed","boolNumToString","v","isLast","storagePerElement","firstValsSize","firstVals","from","lastVals","x","subshape","substrides","stride","end","sep","newLineSep","complexTuples","trackerFn","opHandler","Tensor","dataId","id","kept","isDisposedInternal","util.sizeFromShape","rankType","buffer","throwIfDisposed","read","b","util.decodeString","_a","readSync","isDisposed","disposeTensor","print","clone","cast","trainable","makeVariable","getGlobalTensorClass","defineProperty","Symbol","hasInstance","instance","Variable","initialValue","tensorId","super","newValue","util.arraysEqual","incRef","disposeVariable","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","UpcastComplex64AndMap","Function","upcastTypeMap","float32","int32","complex64","makeTypesMatch","typeA","typeB","upcastType","getTensorsInContainer","list","walkTensorContainer","Set","container","seen","obj","iterable","k","add","isRegisteredKernelInvocation","kernelInvocation","EngineState","registeredVariables","nextTapeNodeId","numBytes","numTensors","numStringTensors","numDataBuffers","gradientDepth","kernelDepth","scopeStack","numDataMovesStack","nextScopeId","tensorInfo","WeakMap","profiling","activeProfile","newBytes","newTensors","peakBytes","kernels","kernelNames","variableName","dispose","Engine","registry","registryFactory","pendingBackendInitId","state","pendingBackendInit","backendInstance","sortedBackends","getSortedBackends","initializeBackend","success","setBackend","asyncInit","initializeBackendsAndReturnBest","keys","factory","priority","setupRegisteredKernels","profiler","kernel","setupFunc","disposeFunc","registryFactoryEntry","force","refCount","floatPrecision","promiseId","catch","err","stack","message","disposeRegisteredKernels","sort","info","srcBackend","disposeData","move","shouldCheckForMemLeaks","nameOrFn","fn","scopedRun","startScope","endScope","error","res","ex","nextTensorId","nextVariableId","y","ENGINE","runKernel","addTapeNode","activeScope","dy","gradInputs","attrs","runKernelFunc","numDataIdsBefore","outInfos","numDataIdsAfter","numDataIds","numOutputDataIds","numMoves","dataIdsLeaked","kernelParams","saved","isTapeOn","startingBytecount","startingNumTensors","kernelFunc","out","kernelOrScopeName","util.assert","checkKernelForMemLeak","outTensors","outInfo","makeTensorFromDataId","tensorsToSave","getTensorsForGradient","saveTensorsForBackwardMode","forwardFunc","saveFunc","tensors","tensor","keep","tidy","outs","backwardsFunc","profileKernel","bytesAdded","totalBytesSnapshot","tensorsAdded","totalTensorsSnapshot","inputShapes","outputShapes","item","kernelTimeMs","gradConfig","inputsToSave","outputsToSave","inputTensorsToSave","saveAllInputs","inputName","outputTensorsToSave","filter","_","backendVals","util.isString","encode","util.encodeString","write","trackTensor","bytesFromStringArray","util.bytesPerElement","track","delete","removeDataId","varName","memory","unreliable","reasons","query","startBytes","startNumTensors","gradientsFunc","tapeNode","gradFunc","gradient","dys","util.makeZerosTypedArray","makeTensor","activeTape","scopeInfo","tensorsToTrackInParent","tensorsToTrackInParentSet","oldScope","pop","scopeId","xs","allowNoGradients","startTape","endTape","filteredTape","tape","tensorsFromX","nodesFromX","node","nodeInputs","anyInputFromX","tensorsLeadToY","nodesToY","prunedInputs","nodeInput","prunedNode","getFilteredNodesXToY","accumulatedGradientMap","ones","tensorAccumulatedGradientMap","o","gradTensor","inputGradients","dx","curGradient","backpropagateGradients","grads","util.isFunction","inputMap","save","gradRes","gradMap","grad","timingInfo","wallMs","reset","_tfengine","environment","getOrMakeEngine","inferShape","firstElem","deepAssertShapeConsistency","indices","subShape","assertDtype","expectedDtype","actualDType","argName","functionName","convertToTensor","parseAsDtype","inferredDtype","indexOf","type","inferredShape","convertToTensorArray","arg","op","opName","endsWith","substring","f2","args","configurable","abs","abs_","$x","acos","acos_","acosh","acosh_","add_","$a","$b","all_","keepDims","any","any_","argMax","argMax_","argMin","argMin_","asin","asin_","asinh","asinh_","atan","atan_","atan2","atan2_","atanh","atanh_","cast_","util.isValidDtype","computePool2DInfo","inShape","filterSize","dilations","roundingMode","dataFormat","filterHeight","filterWidth","parseTupleParam","filterShape","depthwise","batchSize","inHeight","inWidth","inChannels","filterChannels","strideHeight","strideWidth","dilationHeight","dilationWidth","effectiveFilterHeight","getEffectiveFilterSize","effectiveFilterWidth","padInfo","outHeight","outWidth","top","bottom","left","right","outShape","fieldSize","zeroPad","dilation","effectiveFieldSize","floor","computeDefaultPad","inputRows","inputCols","outputRows","outputCols","computeOutputShape2D","ceil","padAlongHeight","padAlongWidth","getPadAndOutInfo","outChannels","computeConv2DInfo","param","trunc","tupleValuesAreOne","dimA","dimB","dimC","eitherStridesOrDilationsAreOne","reshape","reshape_","avgPool","avgPool_","dimRoundingMode","conv_util.eitherStridesOrDilationsAreOne","x4D","reshapedTo4D","util.isInt","clone_","concat_","$tensors","attr","matMul","matMul_","transposeA","transposeB","mul","mul_","sigmoid","sigmoid_","slice_","begin","tanh","tanh_","batchToSpaceND","batchToSpaceND_","blockShape","crops","prod","batchNorm","batchNorm_","mean","variance","scale","varianceEpsilon","$mean","$variance","$scale","$offset","xAs4D","broadcastTo","broadcastTo_","xShape","some","newShape","unshift","reps","ceil_","clipByValue","clipByValue_","clipValueMin","clipValueMax","complex","complex_","real","imag","$real","$imag","shapeA","shapeB","errorMessagePrefix","util.assertShapesMatch","conv2d","conv2d_","$filter","inDepth","conv1d","conv1d_","x3D","reshapedTo3D","filter4D","input4D","conv2DBackpropInput","conv2DBackpropInput_","xShape4D","dy4D","outDepth","conv2dTranspose","conv2dTranspose_","outputShape","conv3DBackpropInput","conv3DBackpropInput_","xShape5D","dy5D","reshapedTo5D","cos","cos_","cosh","cosh_","cumsum","cumsum_","exclusive","reverse","depthToSpace","depthToSpace_","blockSize","inputHeight","inputWidth","inputDepth","depthwiseConv2d","depthwiseConv2d_","dilation2d","dilation2d_","floorDiv","floorDiv_","div","div_","getReductionAxes","inDim","outAxis","outDim","assertAndGetBroadcastShape","equal","equal_","where","where_","condition","$condition","broadcastShape","e","zerosLike","zerosLike_","divNoNan","divNoNan_","divResult","zeros","bEqualsZero","dot","dot_","t1","t2","$t1","$t2","t1Inner","t2Inner","t12D","t22D","t1t2","elu","elu_","erf","erf_","exp","exp_","expandDims","expandDims_","dim","expm1","expm1_","tile","tile_","floor_","gather","gather_","batchDims","greater","greater_","greaterEqual","greaterEqual_","imag_","isFinite_","isInf","isInf_","isNaN_","leakyRelu","leakyRelu_","alpha","less","less_","lessEqual","lessEqual_","localResponseNormalization","localResponseNormalization_","depthRadius","bias","beta","log_","log1p","log1p_","customGrad","neg","neg_","softplus","softplus_","logSigmoid","logSigmoid_","customOp","max_","reductionIndices","sub","sub_","sum","sum_","logSoftmax","logSoftmax_","logits","$logits","xMax","shifted","softmax","expandShapeToKeepDim","axes","outputLoc","reduceLoc","loc","outIdx","reduceIdx","combineLocations","getUndoAxesPermutation","logSumExp","logSumExp_","logicalAnd","logicalAnd_","logicalNot","logicalNot_","logicalOr","logicalOr_","logicalXor","logicalXor_","maxPool","maxPool_","maximum","maximum_","mean_","min","min_","minimum","minimum_","mirrorPad","mirrorPad_","paddings","mode","shapeOffset","mod","mod_","square","square_","notEqual","notEqual_","oneHot","oneHot_","depth","onValue","offValue","onesLike","onesLike_","pad_","constantValue","spaceToBatchND","spaceToBatchND_","pool","pool_","windowShape","poolingType","convInfo","conv_util.computePool2DInfo","basePadding","padExtraShape","padExtraStart","padExtraEnd","withSpaceToBatchBasePaddings","isDilationOne","adjustedPadding","adjustedCrops","padStart","origPadEnd","fullInputShape","padEndExtra","padEnd","requiredSpaceToBatchPaddings","convertedPad","convertedX","pow","pow_","base","$base","$exp","prelu","prelu_","prod_","real_","reciprocal","reciprocal_","relu","relu_","relu6","relu6_","reverse_","dims","round_","rsqrt","rsqrt_","dimSize","Number","isInteger","assertNonNegativeIntegerDimensions","providedSize","inferredSize","inferred","flatDimsDontMatch","scalar","selu","selu_","separableConv2d","separableConv2d_","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","sign","sign_","sin","sin_","sinh","sinh_","softmax_","fft","fft_","ifft","ifft_","irfft","irfft_","innerDimensionSize","batch","complexInput","realInput","imagInput","realConjugate","imagConjugate","r","temp","split_","numOrSizeSplits","rfft","rfft_","fftLength","adjustedInput","zerosShape","zerosInput","half","realValues","imagValues","realComplexConjugate","imagComplexConjugate","sqrt","sqrt_","squaredDifference","squaredDifference_","squeeze","squeeze_","keptDims","isEmptyArray","squeezeShape","stack_","step","step_","stridedSlice","stridedSlice_","beginMask","endMask","ellipsisMask","newAxisMask","shrinkAxisMask","tan","tan_","topk","topk_","sorted","lastDim","unique","unique_","unsortedSegmentSum","unsortedSegmentSum_","segmentIds","numSegments","$segmentIds","unstack","unstack_","transpose","transpose_","perm","normImpl","p","Infinity","norm","norm_","ord","keepDimsShape","axis_util.expandShapeToKeepDim","conv2DBackpropFilter","conv2DBackpropFilter_","depthwiseConv2dNativeBackpropFilter","depthwiseConv2dNativeBackpropFilter_","depthwiseConv2dNativeBackpropInput","depthwiseConv2dNativeBackpropInput_","resizeBilinear","resizeBilinear_","images","alignCorners","halfPixelCenters","$images","batchImages","resizeNearestNeighbor","resizeNearestNeighbor_","prototype","asScalar","asType","as1D","as2D","rows","columns","as3D","as4D","depth2","as5D","depth3","padding","dilationRate","reshapeAs","newShape2D","halfFloatCenters","tensorsToBeStacked","toBool","toFloat","toInt","absGradConfig","acosGradConfig","acoshGradConfig","addGradConfig","broadcast_util.assertAndGetBroadcastShape","reduceAxes","broadcast_util.getReductionAxes","addNGradConfig","ders","argMaxGradConfig","argMinGradConfig","asinGradConfig","asinhGradConfig","atan2GradConfig","atanGradConfig","atanhGradConfig","avgPool3dGrad","avgPool3dGrad_","$dy","$input","input5D","avgPool3DGradConfig","avgPoolGrad","avgPoolGrad_","avgPoolGradConfig","batchMatMulGradConfig","batchToSpaceNDGradConfig","broadcastToGradConfig","broadCastToAttrs","castGradConfig","ceilGradConfig","clipByValueGradConfig","complexAbsGradConfig","concatGradConfig","shapes","$axis","sizeSplits","conv2DGradConfig","conv_util.tupleValuesAreOne","conv2DBackpropInputGradConfig","ddx","conv3DBackpropFilter","conv3DBackpropFilter_","x5D","conv3DGradConfig","cosGradConfig","coshGradConfig","cumsumGradConfig","permutation","axesAreInnerMostDims","getAxesPermutation","depthwiseConv2dNativeGradConfig","$dilations","dilation2dGradConfig","inputInputs","filterInputs","eluGradConfig","erfGradConfig","PI","expGradConfig","expandDimsGradConfig","expm1GradConfig","floorGradConfig","floorDivGradConfig","tmp","fusedBatchNormGradConfig","scaleValue","reductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","gatherGradConfig","parsedAxis","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","stop","arrays","greaterEqualGradConfig","identityGradConfig","isFiniteGradConfig","isInfGradConfig","isNanGradConfig","leakyReluGradConfig","mask","log1pGradConfig","logGradConfig","logSoftmaxGradConfig","localResponseNormalizationBackprop","localResponseNormalizationBackprop_","lrnGradConfig","gradForMinAndMax","xOrig","origAxes","maxGradConfig","maxAttrs","maxGrad","util.parseAxisParam","maximumGradConfig","maxPool3dGrad","maxPool3dGrad_","$output","output5D","maxPool3DGradConfig","maxPoolGrad","maxPoolGrad_","padV2GradConfig","spaceToBatchNDGradConfig","splitVGradConfig","gradConfigs","reduceSize","aShape","computeOutAndReduceShapes","expandedDyShape","expandedDy","minAttrs","minGrad","expFloat","logBase","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","begin_","size_","xRank","parseSliceParams","dyTimesY","two","derX","xGrad","transposeAttrs","undoPerm","axis_util.getUndoAxesPermutation","unpackAttrs","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gatherDropNegatives","gradientConfig","_epsilon","epsilon","AttributeError","setPrototypeOf","RuntimeError","ValueError","NotImplementedError","AssertionError","pyListRepeat","numValues","newArray","count","refernce","counter","singletonOrArray","toList","toSnakeCase","insecure","toCamelCase","identifier","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","dict","getClassName","getConfig","convertNDArrayScalarsInConfig","configItem","fields","field","deserializeKerasObject","moduleObjects","customObjects","printableModuleName","fastWeightInit","JSON","stringify","className","cls","fromConfig","customObjectsCombined","backupCustomObjects","returnObj","reverseNumberCompare","numberCompare","isObjectEmpty","hasOwnProperty","checkStringTypeUnionValue","label","checkArrayTypeAndLength","expectedType","minLength","maxLength","assertPositiveInteger","util","formatAsFriendlyString","mapActivationToFusedKernel","activationName","calcL2Norms","w","tfc.sqrt","tfc.sum","tfc.mul","Constraint","serialization","Serializable","MaxNorm","maxValue","defaultMaxValue","defaultAxis","norms","desired","tfc.clipByValue","tfc.div","tfc.add","registerClass","UnitNorm","NonNeg","tfc.relu","MinMaxNorm","minValue","defaultMinValue","rate","defaultRate","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","constraint","deserializeConstraint","SerializationMap","getMap","classNameMap","getConstraint","VALID_DATA_FORMAT_VALUES","VALID_INTERPOLATION_FORMAT_VALUES","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","VALID_BIDIRECTIONAL_MERGE_MODES","nameMap","checkDataFormat","checkPaddingMode","checkPoolMode","_nameScopeStack","nameScope","getScopedTensorName","tensorName","isValidTensorName","getUniqueTensorName","scopedName","index","tensorNameRegex","RegExp","match","arrayProd","toArray1D","tensor1d","tfc.min","tfc.max","range","splice","sliceAlongFirstAxis","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","sliceAlongLastAxis","sliceAlongAxis","concatenate","tfc.concat","concatAlongFirstAxis","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","randomNormal","stddev","seed","tfc.randomNormal","activation","tfc.fused","reshapeBias","aFirstDims","aLastDim","bShape","bLastDim","ySecondLastDim","yOtherDims","reference","tfc.gather","biasShape","biasAdd","dropout","level","noiseShape","tfc.dropout","inTrainPhase","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","Ones","Constant","undefined","RandomUniform","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","randomUniform","RandomNormal","DEFAULT_MEAN","DEFAULT_STDDEV","K.randomNormal","TruncatedNormal","truncatedNormal","gain","eye","VarianceScaling","distribution","checkDistribution","fans","fanIn","fanOut","receptiveFieldSize","shapeProd","computeFans","limit","GlorotUniform","GlorotNormal","HeNormal","HeUniform","LeCunNormal","LeCunUniform","Orthogonal","DEFAULT_GAIN","q","linalg","gramSchmidt","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","heUniform","identity","leCunNormal","leCunUniform","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","initializer","getInitializer","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","prefix","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","weights","weight","DEFAULT_VARIABLE_NAME_PREFIX","LayerVariable","originalName","trainable_","tfc.variable","assertNotDisposed","newVal","checkShapesMatch","batchGetValue","batchSetValue","variablesAndValues","variableAndValue","InputSpec","ndim","maxNDim","minNDim","SymbolicTensor","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","Node","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","layer","outboundNodes","inboundNodes","inboundNames","_nextLayerID","Layer","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","batchInputShape","inputDType","initialWeights","_refCount","fastWeightInitDuringBuild","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","updates","built","trainableWeights","nonTrainableWeights","stateful","_stateful","generic_utils.toList","inputIndex","spec","xShapeAtAxis","specDim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","noneAreSymbolic","assertInputCompatibility","xElem","build","setWeights","outputList","outputListCopy","collectInputShape","computeOutputShape","outputDType","warnOnIncompatibleInputShape","addInboundNode","dimMismatch","dimension","allOutputShapes","shapeString","variable_utils.countParamsInWeights","trainableOnly","weightValueTuples","paramValues","pv","regularizer","_addedWeightNames","initValue","addLoss","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","tensorIndex","numDisposedVariables","disposeWeights","refCountAfterDispose","getSourceInputs","sourceTensors","previousSources","InputLayer","sparse","inputTensor","Input","batchShape","async","resolveScalarsInLogs","logs","promises","scalarsToDispose","valueScalar","disposeTensorsInLogs","ModelLoggingVerbosity","BaseCallback","epoch","model","CallbackList","callbacks","queueLength","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","totals","oldTotalsToDispose","total","History","history","valueArray","CustomCallback","yieldEvery","onYield","isNumber","maybeWait","waitMs","lastResult","lastTime","generic_utils.debounce","bind","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","yield","ps","nextFrame","currentEpoch","standardizeCallbacks","callbackConfig","CallbackConstructorRegistry","verbosityLevel","callbackConstructor","checkForDuplicate","constructors","levelName","ctor","configureCallbacks","epochs","initialEpoch","numTrainSamples","stepsPerEpoch","doValidation","callbackMetrics","actualCallbacks","createCallbacks","callbackList","samples","steps","metrics","deserialize","l2Normalize","squareSum","K.square","epsilonTensor","tfc.fill","tfc.maximum","meanSquaredError","yTrue","yPred","tfc.mean","tfc.sub","meanAbsoluteError","tfc.abs","meanAbsolutePercentageError","diff","clippedTrue","MAX_VALUE","absResult","categoricalCrossentropy","target","fromLogits","tfc.softmax","outputSum","tfc.neg","tfc.log","sparseCategoricalCrossentropy","flatTarget","tfc.floor","math_utils.arrayProd","K.flatten","tfc.oneHot","binaryCrossentropy","labels","reluLogits","negAbsLogits","sigmoidCrossEntropyWithLogits","cosineProximity","trueNormalized","predNormalized","trueXPred","lossesMap","meanSquaredLogarithmicError","clippedPred","firstLog","secondLog","squaredHinge","maxResult","hinge","categoricalHinge","pos","logcosh","log2","predictionDiff","logcoshResult","tfc.softplus","kullbackLeiblerDivergence","poisson","logPred","identifierOrFn","errMsg","includes","binaryAccuracy","threshold","tfc.onesLike","yPredThresholded","K.cast","tfc.greater","tfc.equal","categoricalAccuracy","tfc.argMax","truePositives","tfc.logicalAnd","precision","tp","fp","falsePositives","denominator","tfc.where","recall","falseNegatives","lossBinaryCrossentropy","sparseCategoricalAccuracy","categoricalCrossentropyLoss","sparseCategoricalCrossentropyLoss","metricsMap","mse","MSE","mae","MAE","mape","MAPE","cosine","getLossOrMetricName","fnName","MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH","checkUserDefinedMetadata","userDefinedMetadata","modelName","checkSize","getPrototypeOf","plainObjectCheck","xType","printSummary","lineLength","positions","printFn","sequentialLike","nodesByDepth","nodes","depthNodes","layers","flag","isModelSequentialLike","toDisplay","relevantNodes","printRow","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","trainableCount","collectedTrainableWeights","countTrainableParams","nonTrainableCount","line","countParams","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","isArrayItemInputOrOutputName","convertPythonicToTs","pythonicConfig","generic_utils.toCamelCase","tsArray","arrayLength","tsDict","pythonicKey","pythonicValue","tsKey","convertTsToPythonic","tsConfig","pyArray","pyDict","tsValue","pyKey","version","FeedDict","feeds","id2Value","id2Mask","feed","assertFeedCompatibility","name2Id","cachedSorted","cachedRecipientCounts","execute","fetches","feedDict","probe","arrayFetches","fetchArray","outputNames","finalOutputs","feedNames","names","outputName","getValue","maxNumTensors","minNumTensors","fetchAndFeedKey","recipientCounts","finalSorted","finalRecipientMap","getTopologicalSortAndRecipientCountsForOneFetch","recipientMap","visited","fetch","symbolicTensor","recipient","recipientMap2Counts","getTopologicalSortAndRecipientCounts","internalFeedDict","symbolic","srcLayer","inputValues","tensorsToDispose","maskExists","getMask","hasKey","outputMask","computeMask","layerOutputs","getNodeOutputs","outputSymbolicTensors","disposeMasks","marks","topIsMarked","outputTensor","getOutputAt","Container","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","internalContainerRefs","generic_utils.assert","inputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","finishedNodes","nodesInProgress","containerNodes","nodeKey","numInboundLayers","reversedNodesInDecreasingDepth","previousDepth","inboundNode","nodeID","layersByDepth","layerID","depthKeys","parseInt","generic_utils.reverseNumberCompare","layersForDepth","aIndex","bIndex","computableTensors","layersWithCompleteInput","allNames","numOccurrences","strict","nameToWeight","totalWeightsCount","validatedName","tokens","unsetNames","theConfig","modelConfig","unused","returnString","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","outputShapeKeys","shapeKey","tensorMap","referenceInputTensors","referenceOutputTensors","computedData","computedTensors","computedMasks","computedTensor","computedMask","nodeConversionMap","keptNodes","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","addUnprocessedNode","processNode","inputData","inboundLayerName","inboundNodeIndex","processLayer","layerData","layerName","deserializeLayer","setFastWeightInitDuringBuild","layersFromConfig","generic_utils.isObjectEmpty","currentUnprocessedNodesForLayer","inputLayersFromConfig","layerOutputTensors","outputLayersFromConfig","resetStates","standardizeClassWeights","classWeight","xWeight","weightType","numOutputs","standardizeSampleOrClassWeights","standardizeWeights","sampleWeight","sampleWeightMode","yClasses","yClassIndices","classSampleWeight","classIndex","computeWeightedLoss","sampleWeights","standardizeDataIteratorOutput","iteratorOut","ys","iteratorOutObj","tfc.util","flattenedXs","flattenTensorOrArrayOrMap","flattenedYs","xIndex","yIndex","inputOrOutput","tfc.Tensor","fitDataset","dataset","hasBatchesPerEpoch","batchesPerEpoch","optimizer","isTraining","validationData","valXs","valYs","isDatasetObject","validationBatches","standardizeTensorValidationData","trainFunction","makeTrainFunction","outLabels","getDedupedMetricsNames","getStepsPerEpoch","stopTraining_","dataIterator","iterator","epochLogs","stepsDone","batchIndex","batchLogs","standardClassWeights","ins","tfc.dispose","tfc.keep","valOuts","evaluateDataset","batches","evaluate","validationBatchSize","metricsNames","syncData","checkBatchSize","sliceArrays","sliceArraysByIndices","tfc.tidy","makeBatches","batchStart","fitTensors","targets","inputValX","inputValY","valX","valY","checkBatchAxis","standardizedOuts","standardizeUserData","valIns","valStandardized","validationSplit","splitAt","originalBatchSize","validationSteps","valFunction","makeTestFunction","testFunction","valF","shuffle","checkNumSamples","indexArray","epochIndexArray1D","batchIds","insBatch","testLoop","fitLoop","disposeNewTensors","ensureTensorsRank2OrHigher","refTensors","oldTensorIds","oldTensor","isDataArray","isDataDict","isDataTensor","standardizeInputData","exceptionPrefix","gotUnexpectedData","refDim","checkInputData","LayersModel","loss","optimizer_","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","optimizers.getOptimizer","isOptimizerOwned","Optimizer","lossFunctions","theLosses","losses.get","lossFunction","feedOutputShapes","feedLossFns","skipTargetIndices","metricsTensors","weightedLoss","nestedMetrics","wrappedMetrics","outputMetrics","collectMetrics","appendMetric","outputIndex","metricName","metricTensor","accFn","weightedMetricFn","metric","suffix","losses.binaryCrossentropy","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","metricFn","Metrics.get","Metrics.getLossOrMetricName","metricResult","handleMetrics","standardizeUserDataXY","hasBatches","numExamples","xsAndYs","batchOuts","batchOut","oldScalar","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","tensorValue","executeOutputs","symbolicTensorNames","outputsRemaining","layerOutputNames","remainingNames","outsBatches","xsRank2OrHigher","predictLoop","setX","setY","checkArrayLengths","lossFns","keyLosses","losses.meanSquaredError","losses.categoricalCrossentropy","slicedYShape","slicedShape","targetDim","checkLossAndTargetCompatibility","standardXs","standardYs","standardSampleWeights","classWeights","K.sliceAlongFirstAxis","dedupedOutLabels","newLabel","lossValues","metricsValues","variables","minimize","totalLoss","meanLoss","weightedMetric","regularizerLoss","valOutputs","meanMetric","standardizeOut","namedWeights","weightValues","getWeights","stopTraining","numTensorsBeforeOptmizerDisposal","tfc.memory","lossNames","metricsIdentifiers","getLossIdentifiers","getMetricIdentifiers","optimizer_config","class_name","trainingConfig","weighted_metrics","loss_weights","sample_weight_mode","lossEntry","compile","handlerOrURL","handlers","io","getSaveHandlers","weightDataAndSpecs","encodeWeights","getNamedWeights","modelArtifacts","modelTopology","toJSON","format","generatedBy","convertedBy","includeOptimizer","getTrainingConfig","optimizerWeightData","specs","optimizerWeightSpecs","concatenateArrayBuffers","weightData","weightSpecs","Functional","loadLayersModelInternal","pathOrIOHandler","options","getLoadHandlers","browserHTTPRequest","handler","load","artifacts","loadTrainingConfig","setUserDefinedMetadata","modelWeights","optimizerWeights","name2Tensor","decodeWeights","group","decodeModelAndOptimizerWeights","loadWeights","loadLayersModelFromIOHandler","Sequential","isLayerModelInstance","modelLayer","checkShape","lastLayerIndex","summary","predict","predictOnBatch","fit","trainOnBatch","configArray","extraModelConfig","conf","Activation","Elu","tfc.elu","K.elu","tfc.selu","tfc.minimum","Linear","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softsign","K.softsign","tfc.tanh","LogSoftmax","tfc.logSoftmax","Swish","Mish","serializeActivation","deserializeActivation","getActivation","assertObjectArgs","Regularizer","L1L2","l1","l2","hasL1","hasL2","regularization","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","ReLU","baseConfig","LeakyReLU","DEFAULT_ALPHA","PReLU","alphaInitializer","DEFAULT_ALPHA_INITIALIZER","alphaRegularizer","alphaConstraint","sharedAxes","paramShape","addWeight","ELU","ThresholdedReLU","theta","DEFAULT_THETA","softmaxActivation","DEFAULT_AXIS","normalizeArray","singleValue","convOutputLength","inputLength","outputLength","deconvLength","strideSize","kernelSize","preprocessConv2DInput","tfc.transpose","preprocessConv3DInput","conv2dWithBiasActivation","BaseConv","verifyArgs","generic_utils.assertPositiveInteger","useBias","biasInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","biasRegularizer","generic_utils.checkArrayTypeAndLength","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","biasValue","fusedActivationName","generic_utils.mapActivationToFusedKernel","tfc.conv1d","K.biasAdd","conv1dWithBias","tfc.conv3d","conv3dWithBias","newSpace","space","newDim","Conv3D","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","tfc.conv2dTranspose","heightAxis","widthAxis","Conv3DTranspose","dAxis","kernelD","strideD","tfc.conv3dTranspose","depthAxis","SeparableConv","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","SeparableConv2D","Conv1D","Cropping2D","cropping","hSliced","K.sliceAlongAxis","UpSampling2D","DEFAULT_SIZE","interpolation","resized","DepthwiseConv2D","tfc.depthwiseConv2d","cols","outFilters","outRows","outCols","standardizeArgs","initialState","constants","numConstants","toListOrNull","rnn","stepFunction","initialStates","goBackwards","unroll","needPerStepOutputs","math_utils.range","tfc.expandDims","tfc.reverse","perStepOutputs","lastOutput","states","timeSteps","perStepInputs","tfc.unstack","perStepMasks","currentInput","stepOutputs","maskedOutputs","stepMask","negStepMask","newStates","tfc.stack","RNN","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","states_","keptStates","outputDim","stateShape","stateMask","numStates","stepInputShape","tfc.zeros","expectedShape","standardized","additionalInputs","additionalSpecs","fullInput","fullInputSpec","originalInputSpec","getInitialState","cellCallKwargs","rnnOutputs","K.expandDims","K.tile","cellConfig","RNNCell","SimpleRNNCell","units","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","K.dot","SimpleRNN","GRUCell","resetAfter","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","hTMinus1","z","hh","matrixX","recurrentKernelValue","rk1","rk2","tfc.split","matrixInner","xZ","xR","xH","recurrentZ","recurrentR","recurrentH","GRU","LSTMCell","unitForgetBias","capturedBiasInit","capturedUnits","bI","bF","bCAndH","K.concatAlongFirstAxis","cTMinus1","z0","z1","z2","z3","LSTM","nestedStates","newNestedStates","callInputs","cellStates","tuples","numParams","inputWeights","droppedInputs","K.dropout","createMask","K.inTrainPhase","ConvRNN2D","computeSingleOutputShape","getStates","isChannelsFirst","hOut","wOut","ConvLSTM2DCell","recurrentKernelShape","K.concatenate","tfc.ones","applyDropout","xI","xF","xC","xO","recDropoutMask","hI","hF","hC","hO","kernelI","kernelF","kernelC","kernelO","biasI","biasF","biasC","biasO","inputConv","recKernelI","recKernelF","recKernelC","recKernelO","recurrentConv","tfc.conv2d","ConvLSTM2D","Dropout","invokeCallHook","getNoiseShape","SpatialDropout1D","Dense","inputLastDim","Flatten","K.batchFlatten","RepeatVector","targetShape","isUnknown","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","Permute","expectedSortedIndices","dimsIncludingBatch","Masking","maskValue","booleanMask","Embedding","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","embeddings","inLens","s1","s2","K.gather","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","xNDim","mergeFunction","transposed","xTransposed","mathUtils.arrayProd","mathUtils.range","yNDim","yShape","Average","Concatenate","allNoneShape","shapeSet","shapeWithoutConcatAxis","exists","allNullMasks","concatenatedMasks","tfc.all","interpretAxis","Dot","normalize","interpretAxes","x1","x2","axesArray","diffShape","adjX","adjY","idx","squeezeAxes","batchDot","GaussianNoise","GaussianDropout","AlphaDropout","_getNoiseShape","alphaP","keptIdx","batchNormalization","gamma","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","normalizeBatchInTraining","meanAndVariance","tfc.moments","regularNormalizeBatchInTraining","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","broadcastNormalizeBatchInTraining","BatchNormalization","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","movingMean","movingVariance","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","doMovingAverage","variable","decay","origValue","updateDelta","updateMovingMeanAndVariance","LayerNormalization","nDims","moments","broadcast","momentsTiling","scaleOffsetTiling","ZeroPadding2D","heightPadding","widthPadding","spatial2dPadding","pattern","tfc.pad","pool2d","poolSize","poolMode","paddingString","tfc.maxPool","tfc.avgPool","pool3d","tfc.maxPool3d","tfc.avgPool3d","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","Pooling3D","depths","MaxPooling3D","AveragePooling3D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","timesteps","Bidirectional","forwDict","forwardLayer","backDict","backwardLayer","mergeMode","generic_utils.checkStringTypeUnionValue","_trainable","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","yRev","forwardState","backwardState","rnnLayer","averagePooling1d","averagePooling2d","averagePooling3d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","globalMaxPool1d","globalMaxPool2d","maxPool1d","maxPool2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.sparseCategoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","metrics.precision","metrics.recall","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","modelAndWeightsConfig","weightsManifest","pathPrefix","uniqueWeightValues","Callback","currVal","prevVal","EarlyStopping","restoreBestWeights","monitor","minDelta","patience","baseline","monitorFunc","wait","stoppedEpoch","best","current","getMonitorValue","monitorValue","earlyStopping","registerCallbackConstructor"],"mappings":";;;;;;;;;;;;;;;;sQAmGA,SAASA,EAAkBC,GACvB,MAAM,IAAIC,MAAM,IAAID,6HCuCjB,SAASE,EAAOC,EAAMC,GACzB,IAAKD,EACD,MAAM,IAAIF,MAAqB,iBAARG,EAAmBA,EAAMA,KA4BjD,SAASC,EAAQC,EAAKC,EAAS,GAAIC,GAAiB,GAIvD,GAHc,MAAVD,IACAA,EAAS,IAETE,MAAMC,QAAQJ,IAAQK,EAAaL,KAASE,EAC5C,IAAK,IAAII,EAAI,EAAGA,EAAIN,EAAIO,SAAUD,EAC9BP,EAAQC,EAAIM,GAAIL,EAAQC,QAI5BD,EAAOO,KAAKR,GAEhB,OAAOC,EAaJ,SAASQ,EAAcC,GAC1B,GAAqB,IAAjBA,EAAMH,OAEN,OAAO,EAEX,IAAII,EAAOD,EAAM,GACjB,IAAK,IAAIJ,EAAI,EAAGA,EAAII,EAAMH,OAAQD,IAC9BK,GAAQD,EAAMJ,GAElB,OAAOK,EAKJ,SAASC,EAAYC,EAAIC,GAC5B,GAAID,IAAOC,EACP,OAAO,EAEX,GAAU,MAAND,GAAoB,MAANC,EACd,OAAO,EAEX,GAAID,EAAGN,SAAWO,EAAGP,OACjB,OAAO,EAEX,IAAK,IAAID,EAAI,EAAGA,EAAIO,EAAGN,OAAQD,IAC3B,GAAIO,EAAGP,KAAOQ,E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AI4/D,GAAW5/D"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js deleted file mode 100644 index dc0ee2175..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js +++ /dev/null @@ -1,35433 +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 { backend, util, serialization, tidy, sqrt as sqrt$1, sum as sum$1, mul as mul$1, clipByValue as clipByValue$1, div as div$1, add as add$3, relu as relu$1, max as max$2, tensor1d, min as min$2, slice as slice$1, slice4d, slice3d, slice2d, slice1d, gather as gather$2, tile as tile$2, randomNormal as randomNormal$2, elu as elu$3, abs as abs$1, dropout as dropout$2, concat as concat$1, fused, concat4d, concat3d, concat2d, concat1d, zeros as zeros$2, ones as ones$3, scalar as scalar$1, randomUniform as randomUniform$1, truncatedNormal as truncatedNormal$1, eye, linalg, variable, dispose, nextFrame, keep, log as log$1, sub as sub$1, mean as mean$1, softmax as softmax$2, neg as neg$1, fill, maximum as maximum$2, floor as floor$1, oneHot as oneHot$1, softplus as softplus$1, onesLike as onesLike$1, greater as greater$2, equal as equal$1, argMax as argMax$1, logicalAnd as logicalAnd$1, where as where$1, train, memory, cast as cast$2, Tensor as Tensor$1, Optimizer, io, selu as selu$1, minimum as minimum$2, sigmoid as sigmoid$1, tanh as tanh$1, logSoftmax as logSoftmax$1, leakyRelu as leakyRelu$1, prelu as prelu$2, transpose as transpose$1, conv2dTranspose as conv2dTranspose$2, conv3dTranspose as conv3dTranspose$1, conv1d as conv1d$2, conv3d as conv3d$1, separableConv2d as separableConv2d$2, depthwiseConv2d as depthwiseConv2d$3, expandDims as expandDims$2, reverse as reverse$1, unstack as unstack$1, stack as stack$1, split as split$1, conv2d as conv2d$2, any as any$1, notEqual as notEqual$1, zerosLike as zerosLike$1, all as all$1, greaterEqual as greaterEqual$1, moments, batchNorm2d, batchNorm3d, batchNorm4d, pad as pad$1, maxPool as maxPool$1, avgPool as avgPool$1, maxPool3d, avgPool3d as avgPool3d$1, squeeze as squeeze$1 } from '@tensorflow/tfjs-core'; - -/** - * @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. - * ============================================================================= - */ -const EPSILON_FLOAT32 = 1e-7; -const EPSILON_FLOAT16 = 1e-4; -/** - * The interface that defines the kernels that should be implemented when - * adding a new backend. New backends don't need to implement every one of the - * methods, this can be done gradually (throw an error for unimplemented - * methods). - */ -class KernelBackend { - refCount(dataId) { - return notYetImplemented('refCount'); - } - incRef(dataId) { - return notYetImplemented('incRef'); - } - timerAvailable() { - return true; - } - time(f) { - return notYetImplemented('time'); - } - read(dataId) { - return notYetImplemented('read'); - } - readSync(dataId) { - return notYetImplemented('readSync'); - } - numDataIds() { - return notYetImplemented('numDataIds'); - } - disposeData(dataId, force) { - return notYetImplemented('disposeData'); - } - write(values, shape, dtype) { - return notYetImplemented('write'); - } - move(dataId, values, shape, dtype, refCount) { - return notYetImplemented('move'); - } - memory() { - return notYetImplemented('memory'); - } - /** Returns the highest precision for floats in bits (e.g. 16 or 32) */ - floatPrecision() { - return notYetImplemented('floatPrecision'); - } - /** Returns the smallest representable number. */ - epsilon() { - return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16; - } - dispose() { - return notYetImplemented('dispose'); - } -} -function notYetImplemented(kernelName) { - throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` + - `This kernel may not be supported by the tfjs backend you have chosen`); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Asserts that the expression is true. Otherwise throws an error with the - * provided message. - * - * ```js - * const x = 2; - * tf.util.assert(x === 2, 'x is not 2'); - * ``` - * - * @param expr The expression to assert (as a boolean). - * @param msg A function that returns the message to report when throwing an - * error. We use a function for performance reasons. - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function assert(expr, msg) { - if (!expr) { - throw new Error(typeof msg === 'string' ? msg : msg()); - } -} -function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') { - assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); -} -// NOTE: We explicitly type out what T extends instead of any so that -// util.flatten on a nested array of number doesn't try to infer T as a -// number[][], causing us to explicitly type util.flatten(). -/** - * Flattens an arbitrarily nested array. - * - * ```js - * const a = [[1, 2], [3, 4], [5, [6, [7]]]]; - * const flat = tf.util.flatten(a); - * console.log(flat); - * ``` - * - * @param arr The nested array to flatten. - * @param result The destination array which holds the elements. - * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults - * to false. - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function flatten(arr, result = [], skipTypedArray = false) { - if (result == null) { - result = []; - } - if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) { - for (let i = 0; i < arr.length; ++i) { - flatten(arr[i], result, skipTypedArray); - } - } - else { - result.push(arr); - } - return result; -} -/** - * Returns the size (number of elements) of the tensor given its shape. - * - * ```js - * const shape = [3, 4, 2]; - * const size = tf.util.sizeFromShape(shape); - * console.log(size); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function sizeFromShape(shape) { - if (shape.length === 0) { - // Scalar. - return 1; - } - let size = shape[0]; - for (let i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; -} -function arraysEqual(n1, n2) { - if (n1 === n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - if (n1.length !== n2.length) { - return false; - } - for (let i = 0; i < n1.length; i++) { - if (n1[i] !== n2[i]) { - return false; - } - } - return true; -} -function isInt(a) { - return a % 1 === 0; -} -function rightPad(a, size) { - if (size <= a.length) { - return a; - } - return a + ' '.repeat(size - a.length); -} -function parseAxisParam(axis, shape) { - const rank = shape.length; - // Normalize input - axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); - // Check for valid range - assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + - `got axis ${axis}`); - // Check for only integers - assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` + - `got axis ${axis}`); - // Handle negative axis. - return axis.map(a => a < 0 ? rank + a : a); -} -/** Reduces the shape by removing all dimensions of shape 1. */ -function squeezeShape(shape, axis) { - const newShape = []; - const keptDims = []; - const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; - const axes = (axis == null || isEmptyArray) ? - null : - parseAxisParam(axis, shape).sort(); - let j = 0; - for (let i = 0; i < shape.length; ++i) { - if (axes != null) { - if (axes[j] === i && shape[i] !== 1) { - throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); - } - if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - if (axes[j] <= i) { - j++; - } - } - if (shape[i] !== 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - } - return { newShape, keptDims }; -} -function checkConversionForErrors(vals, dtype) { - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); - } - } -} -/** Returns true if the dtype is valid. */ -function isValidDtype(dtype) { - return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' || - dtype === 'int32' || dtype === 'string'; -} -function isTypedArray(a) { - return a instanceof Float32Array || a instanceof Int32Array || - a instanceof Uint8Array; -} -function bytesPerElement(dtype) { - if (dtype === 'float32' || dtype === 'int32') { - return 4; - } - else if (dtype === 'complex64') { - return 8; - } - else if (dtype === 'bool') { - return 1; - } - else { - throw new Error(`Unknown dtype ${dtype}`); - } -} -/** - * Returns the approximate number of bytes allocated in the string array - 2 - * bytes per character. Computing the exact bytes for a native string in JS is - * not possible since it depends on the encoding of the html page that serves - * the website. - */ -function bytesFromStringArray(arr) { - if (arr == null) { - return 0; - } - let bytes = 0; - arr.forEach(x => bytes += x.length); - return bytes; -} -/** Returns true if the value is a string. */ -function isString(value) { - return typeof value === 'string' || value instanceof String; -} -function isBoolean(value) { - return typeof value === 'boolean'; -} -function isNumber(value) { - return typeof value === 'number'; -} -function inferDtype(values) { - if (Array.isArray(values)) { - return inferDtype(values[0]); - } - if (values instanceof Float32Array) { - return 'float32'; - } - else if (values instanceof Int32Array || values instanceof Uint8Array) { - return 'int32'; - } - else if (isNumber(values)) { - return 'float32'; - } - else if (isString(values)) { - return 'string'; - } - else if (isBoolean(values)) { - return 'bool'; - } - return 'float32'; -} -function isFunction(f) { - return !!(f && f.constructor && f.call && f.apply); -} -function computeStrides(shape) { - const rank = shape.length; - if (rank < 2) { - return []; - } - // Last dimension has implicit stride of 1, thus having D-1 (instead of D) - // strides. - const strides = new Array(rank - 1); - strides[rank - 2] = shape[rank - 1]; - for (let i = rank - 3; i >= 0; --i) { - strides[i] = strides[i + 1] * shape[i + 1]; - } - return strides; -} -function createNestedArray(offset, shape, a, isComplex = false) { - const ret = new Array(); - if (shape.length === 1) { - const d = shape[0] * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = a[offset + i]; - } - } - else { - const d = shape[0]; - const rest = shape.slice(1); - const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = createNestedArray(offset + i * len, rest, a, isComplex); - } - } - return ret; -} -// Provide a nested array of TypedArray in given shape. -function toNestedArray(shape, a, isComplex = false) { - if (shape.length === 0) { - // Scalar type should return a single number. - return a[0]; - } - const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - if (size === 0) { - // A tensor with shape zero should be turned into empty list. - return []; - } - if (size !== a.length) { - throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`); - } - return createNestedArray(0, shape, a, isComplex); -} -function makeOnesTypedArray(size, dtype) { - const array = makeZerosTypedArray(size, dtype); - for (let i = 0; i < array.length; i++) { - array[i] = 1; - } - return array; -} -function makeZerosTypedArray(size, dtype) { - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(size); - } - else if (dtype === 'int32') { - return new Int32Array(size); - } - else if (dtype === 'bool') { - return new Uint8Array(size); - } - else { - throw new Error(`Unknown data type ${dtype}`); - } -} -function assertNonNegativeIntegerDimensions(shape) { - shape.forEach(dimSize => { - assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` + - `shape [${shape}].`); - }); -} -/** - * This method asserts whether an object is a Promise instance. - * @param object - */ -// tslint:disable-next-line: no-any -function isPromise(object) { - // We chose to not use 'obj instanceOf Promise' for two reasons: - // 1. It only reliably works for es6 Promise, not other Promise - // implementations. - // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch - // the async calls, so it is possible the obj (patched) is comparing to a - // pre-patched Promise. - return object && object.then && typeof object.then === 'function'; -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true. -const TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; -/** - * The environment contains evaluated flags as well as the registered platform. - * This is always used as a global singleton and can be retrieved with - * `tf.env()`. - * - * @doc {heading: 'Environment'} - */ -class Environment { - // tslint:disable-next-line: no-any - constructor(global) { - this.global = global; - this.flags = {}; - this.flagRegistry = {}; - this.urlFlags = {}; - // Jasmine spies on this in 'environment_test.ts' - this.getQueryParams = getQueryParams; - this.populateURLFlags(); - } - setPlatform(platformName, platform) { - if (this.platform != null) { - console.warn(`Platform ${this.platformName} has already been set. ` + - `Overwriting the platform with ${platform}.`); - } - this.platformName = platformName; - this.platform = platform; - } - registerFlag(flagName, evaluationFn, setHook) { - this.flagRegistry[flagName] = { evaluationFn, setHook }; - // Override the flag value from the URL. This has to happen here because the - // environment is initialized before flags get registered. - if (this.urlFlags[flagName] != null) { - const flagValue = this.urlFlags[flagName]; - console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`); - this.set(flagName, flagValue); - } - } - async getAsync(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - this.flags[flagName] = await this.evaluateFlag(flagName); - return this.flags[flagName]; - } - get(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - const flagValue = this.evaluateFlag(flagName); - if (isPromise(flagValue)) { - throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` + - `Please use getAsync() instead.`); - } - this.flags[flagName] = flagValue; - return this.flags[flagName]; - } - getNumber(flagName) { - return this.get(flagName); - } - getBool(flagName) { - return this.get(flagName); - } - getFlags() { - return this.flags; - } - // For backwards compatibility. - get features() { - return this.flags; - } - set(flagName, value) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); - } - this.flags[flagName] = value; - if (this.flagRegistry[flagName].setHook != null) { - this.flagRegistry[flagName].setHook(value); - } - } - evaluateFlag(flagName) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); - } - return this.flagRegistry[flagName].evaluationFn(); - } - setFlags(flags) { - this.flags = Object.assign({}, flags); - } - reset() { - this.flags = {}; - this.urlFlags = {}; - this.populateURLFlags(); - } - populateURLFlags() { - if (typeof this.global === 'undefined' || - typeof this.global.location === 'undefined' || - typeof this.global.location.search === 'undefined') { - return; - } - const urlParams = this.getQueryParams(this.global.location.search); - if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { - const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); - keyValues.forEach(keyValue => { - const [key, value] = keyValue.split(':'); - this.urlFlags[key] = parseValue(key, value); - }); - } - } -} -function getQueryParams(queryString) { - const params = {}; - queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { - decodeParam(params, t[0], t[1]); - return t.join('='); - }); - return params; -} -function decodeParam(params, name, value) { - params[decodeURIComponent(name)] = decodeURIComponent(value || ''); -} -function parseValue(flagName, value) { - value = value.toLowerCase(); - if (value === 'true' || value === 'false') { - return value === 'true'; - } - else if (`${+value}` === value) { - return +value; - } - throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); -} -/** - * Returns the current environment (a global singleton). - * - * The environment object contains the evaluated feature values as well as the - * active platform. - * - * @doc {heading: 'Environment'} - */ -function env() { - return ENV; -} -let ENV = null; -function setEnvironmentGlobal(environment) { - ENV = environment; -} - -/** - * @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. - * ============================================================================= - */ -// Note that the identifier globalNameSpace is scoped to this module, but will -// always resolve to the same global object regardless of how the module is -// resolved. -// tslint:disable-next-line:no-any -let globalNameSpace; -// tslint:disable-next-line:no-any -function getGlobalNamespace() { - if (globalNameSpace == null) { - // tslint:disable-next-line:no-any - let ns; - if (typeof (window) !== 'undefined') { - ns = window; - } - else if (typeof (global) !== 'undefined') { - ns = global; - } - else if (typeof (process) !== 'undefined') { - ns = process; - } - else if (typeof (self) !== 'undefined') { - ns = self; - } - else { - throw new Error('Could not find a global object'); - } - globalNameSpace = ns; - } - return globalNameSpace; -} -// tslint:disable-next-line:no-any -function getGlobalMap() { - const ns = getGlobalNamespace(); - if (ns._tfGlobals == null) { - ns._tfGlobals = new Map(); - } - return ns._tfGlobals; -} -/** - * Returns a globally accessible 'singleton' object. - * - * @param key the name of the object - * @param init a function to initialize to initialize this object - * the first time it is fetched. - */ -function getGlobal(key, init) { - const globalMap = getGlobalMap(); - if (globalMap.has(key)) { - return globalMap.get(key); - } - else { - const singleton = init(); - globalMap.set(key, singleton); - return globalMap.get(key); - } -} - -const Abs = 'Abs'; -const Acos = 'Acos'; -const Acosh = 'Acosh'; -const Add = 'Add'; -const AddN = 'AddN'; -const All = 'All'; -const Any = 'Any'; -const ArgMax = 'ArgMax'; -const ArgMin = 'ArgMin'; -const Asin = 'Asin'; -const Asinh = 'Asinh'; -const Atan = 'Atan'; -const Atanh = 'Atanh'; -const Atan2 = 'Atan2'; -const AvgPool = 'AvgPool'; -const AvgPoolGrad = 'AvgPoolGrad'; -const AvgPool3D = 'AvgPool3D'; -const AvgPool3DGrad = 'AvgPool3DGrad'; -const BatchMatMul = 'BatchMatMul'; -const BatchToSpaceND = 'BatchToSpaceND'; -const BroadcastTo = 'BroadcastTo'; -const Cast = 'Cast'; -const Ceil = 'Ceil'; -const ClipByValue = 'ClipByValue'; -const Complex = 'Complex'; -const ComplexAbs = 'ComplexAbs'; -const Concat = 'Concat'; -const Conv2D = 'Conv2D'; -const Conv2DBackpropFilter = 'Conv2DBackpropFilter'; -const Conv2DBackpropInput = 'Conv2DBackpropInput'; -const Conv3D = 'Conv3D'; -const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2'; -const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2'; -const Cos = 'Cos'; -const Cosh = 'Cosh'; -const Cumsum = 'Cumsum'; -const DepthToSpace = 'DepthToSpace'; -const DepthwiseConv2dNative = 'DepthwiseConv2dNative'; -const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter'; -const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput'; -const Dilation2D = 'Dilation2D'; -const Dilation2DBackpropInput = 'Dilation2DBackpropInput'; -const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter'; -const RealDiv = 'RealDiv'; -const Elu = 'Elu'; -const EluGrad = 'EluGrad'; -const Erf = 'Erf'; -const Equal = 'Equal'; -const Exp = 'Exp'; -const ExpandDims = 'ExpandDims'; -const Expm1 = 'Expm1'; -const FFT = 'FFT'; -const Floor = 'Floor'; -const FloorDiv = 'FloorDiv'; -const FusedBatchNorm = 'FusedBatchNorm'; -const GatherV2 = 'GatherV2'; -const Greater = 'Greater'; -const GreaterEqual = 'GreaterEqual'; -const Identity = 'Identity'; -const IFFT = 'IFFT'; -const Imag = 'Imag'; -const IsFinite = 'IsFinite'; -const IsInf = 'IsInf'; -const IsNan = 'IsNan'; -const LeakyRelu = 'LeakyRelu'; -const Less = 'Less'; -const LessEqual = 'LessEqual'; -const Log = 'Log'; -const Log1p = 'Log1p'; -const LogicalAnd = 'LogicalAnd'; -const LogicalNot = 'LogicalNot'; -const LogicalOr = 'LogicalOr'; -const LogSoftmax = 'LogSoftmax'; -const LRN = 'LRN'; -const LRNGrad = 'LRNGrad'; -const Max = 'Max'; -const Maximum = 'Maximum'; -const MaxPool = 'MaxPool'; -const MaxPoolGrad = 'MaxPoolGrad'; -const MaxPool3D = 'MaxPool3D'; -const MaxPool3DGrad = 'MaxPool3DGrad'; -const Mean = 'Mean'; -const Min = 'Min'; -const Minimum = 'Minimum'; -const MirrorPad = 'MirrorPad'; -const Mod = 'Mod'; -const Multiply = 'Multiply'; -const Neg = 'Neg'; -const NotEqual = 'NotEqual'; -const OnesLike = 'OnesLike'; -const OneHot = 'OneHot'; -const Pack = 'Pack'; -const PadV2 = 'PadV2'; -const Pow = 'Pow'; -const Prelu = 'Prelu'; -const Prod = 'Prod'; -const Real = 'Real'; -const Reciprocal = 'Reciprocal'; -const Relu = 'Relu'; -const Reshape = 'Reshape'; -const ResizeNearestNeighbor = 'ResizeNearestNeighbor'; -const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad'; -const ResizeBilinear = 'ResizeBilinear'; -const ResizeBilinearGrad = 'ResizeBilinearGrad'; -const Relu6 = 'Relu6'; -const Reverse = 'Reverse'; -const Round = 'Round'; -const Rsqrt = 'Rsqrt'; -const Select = 'Select'; -const Selu = 'Selu'; -const Slice = 'Slice'; -const Sin = 'Sin'; -const Sinh = 'Sinh'; -const Sign = 'Sign'; -const Sigmoid = 'Sigmoid'; -const Softplus = 'Softplus'; -const Sqrt = 'Sqrt'; -const Sum = 'Sum'; -const SpaceToBatchND = 'SpaceToBatchND'; -const SplitV = 'SplitV'; -const Softmax = 'Softmax'; -const SquaredDifference = 'SquaredDifference'; -const Square = 'Square'; -const StridedSlice = 'StridedSlice'; -const Sub = 'Sub'; -const Tan = 'Tan'; -const Tanh = 'Tanh'; -const Tile = 'Tile'; -const TopK = 'TopK'; -const Transpose = 'Transpose'; -const Unique = 'Unique'; -const Unpack = 'Unpack'; -const UnsortedSegmentSum = 'UnsortedSegmentSum'; -const ZerosLike = 'ZerosLike'; -/** - * TensorFlow.js-only kernels - */ -const Step = 'Step'; - -/** - * @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. - * ============================================================================= - */ -const kernelRegistry = getGlobal('kernelRegistry', () => new Map()); -const gradRegistry = getGlobal('gradRegistry', () => new Map()); -/** - * Returns the kernel function (code) associated with the provided names. - * - * @param kernelName The official name of the kernel. - * @param backendName The official name of the backend. - */ -function getKernel(kernelName, backendName) { - const key = makeKey(kernelName, backendName); - return kernelRegistry.get(key); -} -/** - * Returns the registered gradient info associated with the provided kernel. - * @param kernelName The official TF kernel name. - */ -function getGradient(kernelName) { - return gradRegistry.get(kernelName); -} -function getKernelsForBackend(backendName) { - const it = kernelRegistry.entries(); - const result = []; - while (true) { - const { done, value } = it.next(); - if (done) { - break; - } - const [key, config] = value; - const [backend,] = key.split('_'); - if (backend === backendName) { - result.push(config); - } - } - return result; -} -/** - * Registers a gradient function for a given kernel in the global registry, - * to be used during the back-propagation of that kernel. - * - * @param config An object with the following properties: - * - `kernelName` The name of the kernel that the gradient function is for. - * - `gradFunc` The function to run during back-propagation. - */ -function registerGradient(config) { - const { kernelName } = config; - if (gradRegistry.has(kernelName)) { - // TODO (yassogba) after 3.0 assess whether we need to keep this gated - // to debug mode. - if (env().getBool('DEBUG')) { - console.warn(`Overriding the gradient for '${kernelName}'`); - } - } - gradRegistry.set(kernelName, config); -} -function makeKey(kernelName, backendName) { - return `${backendName}_${kernelName}`; -} - -/** - * @license - * Copyright 2017 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 noConversionNeeded(a, dtype) { - return (a instanceof Float32Array && dtype === 'float32') || - (a instanceof Int32Array && dtype === 'int32') || - (a instanceof Uint8Array && dtype === 'bool'); -} -function toTypedArray(a, dtype) { - if (dtype === 'string') { - throw new Error('Cannot convert a string[] to a TypedArray'); - } - if (Array.isArray(a)) { - a = flatten(a); - } - if (env().getBool('DEBUG')) { - checkConversionForErrors(a, dtype); - } - if (noConversionNeeded(a, dtype)) { - return a; - } - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(a); - } - else if (dtype === 'int32') { - return new Int32Array(a); - } - else if (dtype === 'bool') { - const bool = new Uint8Array(a.length); - for (let i = 0; i < bool.length; ++i) { - if (Math.round(a[i]) !== 0) { - bool[i] = 1; - } - } - return bool; - } - else { - throw new Error(`Unknown data type ${dtype}`); - } -} -/** - * Returns the current high-resolution time in milliseconds relative to an - * arbitrary time in the past. It works across different platforms (node.js, - * browsers). - * - * ```js - * console.log(tf.util.now()); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function now() { - return env().platform.now(); -} -/** - * Encodes the provided string into bytes using the provided encoding scheme. - * - * @param s The string to encode. - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ -function encodeString(s, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.encode(s, encoding); -} -/** - * Decodes the provided bytes into a string using the provided encoding scheme. - * @param bytes The bytes to decode. - * - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ -function decodeString(bytes, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.decode(bytes, encoding); -} - -/** - * @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 Profiler { - constructor(backendTimer, logger) { - this.backendTimer = backendTimer; - this.logger = logger; - if (logger == null) { - this.logger = new Logger(); - } - } - profileKernel(kernelName, inputs, f) { - let outputs; - const holdResultWrapperFn = () => { - outputs = f(); - }; - let timer; - const start = now(); - if (this.backendTimer.timerAvailable()) { - timer = this.backendTimer.time(holdResultWrapperFn); - } - else { - holdResultWrapperFn(); - for (const output of outputs) { - output.dataSync(); - } - timer = Promise.resolve({ kernelMs: now() - start }); - } - if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) { - for (let i = 0; i < outputs.length; i++) { - const output = outputs[i]; - // Dangling promise here because we don't want to propagate up - // asynchronicity. - output.data().then(tensorVals => { - checkComputationForErrors(tensorVals, output.dtype, kernelName); - }); - } - } - const kernelProfile = { - kernelName, - outputs, - inputs, - timeMs: timer.then(timing => timing.kernelMs), - extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ? - timing.getExtraProfileInfo() : - '') - }; - return kernelProfile; - } - logKernelProfile(kernelProfile) { - const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile; - outputs.forEach(result => { - Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => { - this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]); - }); - }); - } -} -function checkComputationForErrors(vals, dtype, kernelName) { - if (dtype !== 'float32') { - // Only floating point computations will generate NaN values - return false; - } - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - // Throwing custom exception so behavior is testable. - console.warn(`Found ${num} in the result of '${kernelName}'`); - return true; - } - } - return false; -} -class Logger { - logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { - const time = typeof timeMs === 'number' ? rightPad(`${timeMs}ms`, 9) : - timeMs['error']; - const paddedName = rightPad(name, 25); - const rank = result.rank; - const size = result.size; - const shape = rightPad(result.shape.toString(), 14); - let inputShapesDescription = ''; - for (const name in inputs) { - const input = inputs[name]; - if (input != null) { - // The input might be a non-tensor (e.g HTMLImageElement), in which case - // we claim the output shape as input shape. - const inputShape = input.shape || result.shape; - const inputRank = inputShape.length; - inputShapesDescription += - `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `; - } - } - console.log(`%c${paddedName}\t%c${time}\t%c${rank}D ${shape}\t%c${size}\t%c${inputShapesDescription}\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue'); - } -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Computes a list of TapeNodes that connect x to y, filtering everything else - * out and preserving the order of the original tape elements. - * - * @param tape The tape elements to filter. - * @param xs The input Tensors. - * @param y The output Tensor. - */ -function getFilteredNodesXToY(tape, xs, y) { - // Forward pass to compute all the nodes and Tensors that are transitively a - // function of x. - const tensorsFromX = {}; - const nodesFromX = {}; - for (let i = 0; i < xs.length; i++) { - tensorsFromX[xs[i].id] = true; - } - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - const nodeInputs = node.inputs; - for (const inputName in nodeInputs) { - const input = nodeInputs[inputName]; - let anyInputFromX = false; - for (let j = 0; j < xs.length; j++) { - if (tensorsFromX[input.id]) { - node.outputs.forEach(output => tensorsFromX[output.id] = true); - anyInputFromX = true; - nodesFromX[node.id] = true; - break; - } - } - if (anyInputFromX) { - break; - } - } - } - // Backward pass to find all of the nodes and Tensors that lead to y. - const tensorsLeadToY = {}; - tensorsLeadToY[y.id] = true; - const nodesToY = {}; - for (let i = tape.length - 1; i >= 0; i--) { - const node = tape[i]; - const nodeInputs = node.inputs; - // If any of the outputs lead to y, mark all of the inputs as leading to y. - for (let j = 0; j < node.outputs.length; j++) { - if (tensorsLeadToY[node.outputs[j].id]) { - for (const inputName in nodeInputs) { - tensorsLeadToY[nodeInputs[inputName].id] = true; - nodesToY[node.id] = true; - } - break; - } - } - } - // Return the paths that come from x and lead to y. - const filteredTape = []; - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - if (nodesFromX[node.id] && nodesToY[node.id]) { - // Prune the inputs from the node that aren't a function of x. - const prunedInputs = {}; - for (const inputName in node.inputs) { - const nodeInput = node.inputs[inputName]; - if (tensorsFromX[nodeInput.id]) { - prunedInputs[inputName] = nodeInput; - } - } - // Copy the node and overwrite inputsAndArgs to the pruned version. - const prunedNode = Object.assign({}, node); - prunedNode.inputs = prunedInputs; - prunedNode.outputs = node.outputs; - filteredTape.push(prunedNode); - } - } - return filteredTape; -} -/** - * Backpropagate gradients through the filtered TapeNodes. - * - * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map - * is mutated by this method. - * @param filteredTape The filtered TapeNodes to backprop through. - */ -function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) { - // Walk the tape backward and keep a map of Tensor to its gradient. - for (let i = filteredTape.length - 1; i >= 0; i--) { - const node = filteredTape[i]; - const dys = []; - node.outputs.forEach(o => { - const gradTensor = tensorAccumulatedGradientMap[o.id]; - if (gradTensor != null) { - dys.push(gradTensor); - } - else { - // This particular output is not in the back-propagation subgraph, so it - // does not affect the final output, thus we put null for its dy. - dys.push(null); - } - }); - if (node.gradient == null) { - throw new Error(`Cannot compute gradient: gradient function not found ` + - `for ${node.kernelName}.`); - } - // Backprop dy through this node and accumulate gradients over the inputs. - const inputGradients = node.gradient(dys); - for (const inputName in node.inputs) { - if (!(inputName in inputGradients)) { - throw new Error(`Cannot backprop through input ${inputName}. ` + - `Available gradients found: ${Object.keys(inputGradients)}.`); - } - // Call the gradient function. - const dx = tidy(() => inputGradients[inputName]()); - if (dx.dtype !== 'float32') { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); - } - const x = node.inputs[inputName]; - if (!arraysEqual(dx.shape, x.shape)) { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `'${inputName}' has shape '${dx.shape}', which does not match ` + - `the shape of the input '${x.shape}'`); - } - if (tensorAccumulatedGradientMap[x.id] == null) { - tensorAccumulatedGradientMap[x.id] = dx; - } - else { - const curGradient = tensorAccumulatedGradientMap[x.id]; - tensorAccumulatedGradientMap[x.id] = add(curGradient, dx); - curGradient.dispose(); - } - } - } -} - -/** - * @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. - * ============================================================================= - */ -// Maximum number of values before we decide to show ellipsis. -const FORMAT_LIMIT_NUM_VALS = 20; -// Number of first and last values to show when displaying a, b,...,y, z. -const FORMAT_NUM_FIRST_LAST_VALS = 3; -// Number of significant digits to show. -const FORMAT_NUM_SIG_DIGITS = 7; -function tensorToString(vals, shape, dtype, verbose) { - const strides = computeStrides(shape); - const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides); - const rank = shape.length; - const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol); - const lines = ['Tensor']; - if (verbose) { - lines.push(` dtype: ${dtype}`); - lines.push(` rank: ${rank}`); - lines.push(` shape: [${shape}]`); - lines.push(` values:`); - } - lines.push(valsLines.map(l => ' ' + l).join('\n')); - return lines.join('\n'); -} -function computeMaxSizePerColumn(vals, shape, dtype, strides) { - const n = sizeFromShape(shape); - const numCols = strides[strides.length - 1]; - const padPerCol = new Array(numCols).fill(0); - const rank = shape.length; - const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals; - if (rank > 1) { - for (let row = 0; row < n / numCols; row++) { - const offset = row * numCols; - for (let j = 0; j < numCols; j++) { - padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length); - } - } - } - return padPerCol; -} -function valToString(val, pad, dtype) { - let valStr; - if (Array.isArray(val)) { - valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` + - `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; - } - else if (isString(val)) { - valStr = `'${val}'`; - } - else if (dtype === 'bool') { - valStr = boolNumToString(val); - } - else { - valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); - } - return rightPad(valStr, pad); -} -function boolNumToString(v) { - return v === 0 ? 'false' : 'true'; -} -function subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) { - const storagePerElement = dtype === 'complex64' ? 2 : 1; - const size = shape[0]; - const rank = shape.length; - if (rank === 0) { - if (dtype === 'complex64') { - const complexTuple = createComplexTuples(vals); - return [valToString(complexTuple[0], 0, dtype)]; - } - if (dtype === 'bool') { - return [boolNumToString(vals[0])]; - } - return [vals[0].toString()]; - } - if (rank === 1) { - if (size > FORMAT_LIMIT_NUM_VALS) { - const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement; - let firstVals = Array.from(vals.slice(0, firstValsSize)); - let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement)); - if (dtype === 'complex64') { - firstVals = createComplexTuples(firstVals); - lastVals = createComplexTuples(lastVals); - } - return [ - '[' + - firstVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ', ..., ' + - lastVals - .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype)) - .join(', ') + - ']' - ]; - } - const displayVals = dtype === 'complex64' ? createComplexTuples(vals) : - Array.from(vals); - return [ - '[' + - displayVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ']' - ]; - } - // The array is rank 2 or more. - const subshape = shape.slice(1); - const substrides = strides.slice(1); - const stride = strides[0] * storagePerElement; - const lines = []; - if (size > FORMAT_LIMIT_NUM_VALS) { - for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */)); - } - lines.push('...'); - for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - else { - for (let i = 0; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - const sep = rank === 2 ? ',' : ''; - lines[0] = '[' + lines[0] + sep; - for (let i = 1; i < lines.length - 1; i++) { - lines[i] = ' ' + lines[i] + sep; - } - let newLineSep = ',\n'; - for (let i = 2; i < rank; i++) { - newLineSep += '\n'; - } - lines[lines.length - 1] = - ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); - return lines; -} -function createComplexTuples(vals) { - const complexTuples = []; - for (let i = 0; i < vals.length; i += 2) { - complexTuples.push([vals[i], vals[i + 1]]); - } - return complexTuples; -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -// For tracking tensor creation and disposal. -let trackerFn = null; -// Used by chaining methods to call into ops. -let opHandler = null; -/** - * An external consumer can register itself as the tensor tracker. This way - * the Tensor class can notify the tracker for every tensor created and - * disposed. - */ -function setTensorTracker(fn) { - trackerFn = fn; -} -/** - * A `tf.Tensor` object represents an immutable, multidimensional array of - * numbers that has a shape and a data type. - * - * For performance reasons, functions that create tensors do not necessarily - * perform a copy of the data passed to them (e.g. if the data is passed as a - * `Float32Array`), and changes to the data will change the tensor. This is not - * a feature and is not supported. To avoid this behavior, use the tensor before - * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`. - * - * See `tf.tensor` for details on how to create a `tf.Tensor`. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -class Tensor { - constructor(shape, dtype, dataId, id) { - /** Whether this tensor has been globally kept. */ - this.kept = false; - this.isDisposedInternal = false; - this.shape = shape.slice(); - this.dtype = dtype || 'float32'; - this.size = sizeFromShape(shape); - this.strides = computeStrides(shape); - this.dataId = dataId; - this.id = id; - this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); - } - get rank() { - return this.shape.length; - } - /** - * Returns a promise of `tf.TensorBuffer` that holds the underlying data. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async buffer() { - const vals = await this.data(); - return opHandler.buffer(this.shape, this.dtype, vals); - } - /** - * Returns a `tf.TensorBuffer` that holds the underlying data. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - bufferSync() { - return opHandler.buffer(this.shape, this.dtype, this.dataSync()); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * asynchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async array() { - const vals = await this.data(); - return toNestedArray(this.shape, vals, this.dtype === 'complex64'); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * synchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - arraySync() { - return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64'); - } - /** - * Asynchronously downloads the values from the `tf.Tensor`. Returns a - * promise of `TypedArray` that resolves when the computation has finished. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async data() { - this.throwIfDisposed(); - const data = trackerFn().read(this.dataId); - if (this.dtype === 'string') { - const bytes = await data; - try { - return bytes.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** - * Synchronously downloads the values from the `tf.Tensor`. This blocks the - * UI thread until the values are ready, which can cause performance issues. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dataSync() { - this.throwIfDisposed(); - const data = trackerFn().readSync(this.dataId); - if (this.dtype === 'string') { - try { - return data.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** Returns the underlying bytes of the tensor's data. */ - async bytes() { - this.throwIfDisposed(); - const data = await trackerFn().read(this.dataId); - if (this.dtype === 'string') { - return data; - } - else { - return new Uint8Array(data.buffer); - } - } - /** - * Disposes `tf.Tensor` from memory. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dispose() { - if (this.isDisposed) { - return; - } - trackerFn().disposeTensor(this); - this.isDisposedInternal = true; - } - get isDisposed() { - return this.isDisposedInternal; - } - throwIfDisposed() { - if (this.isDisposed) { - throw new Error(`Tensor is disposed.`); - } - } - /** - * Prints the `tf.Tensor`. See `tf.print` for details. - * - * @param verbose Whether to print verbose information about the tensor, - * including dtype and size. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - print(verbose = false) { - return opHandler.print(this, verbose); - } - /** - * Returns a copy of the tensor. See `tf.clone` for details. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - clone() { - this.throwIfDisposed(); - return opHandler.clone(this); - } - /** - * Returns a human-readable description of the tensor. Useful for logging. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - toString(verbose = false) { - const vals = this.dataSync(); - return tensorToString(vals, this.shape, this.dtype, verbose); - } - cast(dtype) { - this.throwIfDisposed(); - return opHandler.cast(this, dtype); - } - variable(trainable = true, name, dtype) { - this.throwIfDisposed(); - return trackerFn().makeVariable(this, trainable, name, dtype); - } -} -Object.defineProperty(Tensor, Symbol.hasInstance, { - value: (instance) => { - // Implementation note: we should use properties of the object that will be - // defined before the constructor body has finished executing (methods). - // This is because when this code is transpiled by babel, babel will call - // classCallCheck before the constructor body is run. - // See https://github.com/tensorflow/tfjs/issues/3384 for backstory. - return !!instance && instance.data != null && instance.dataSync != null && - instance.throwIfDisposed != null; - } -}); -function getGlobalTensorClass() { - // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules - // being returned for this file depending on the path they are loaded from. - return getGlobal('Tensor', () => { - return Tensor; - }); -} -// Global side effect. Cache global reference to Tensor class -getGlobalTensorClass(); -/** - * A mutable `tf.Tensor`, useful for persisting state, e.g. for training. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -class Variable extends Tensor { - constructor(initialValue, trainable, name, tensorId) { - super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); - this.trainable = trainable; - this.name = name; - } - /** - * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have - * the same shape and dtype as the old `tf.Tensor`. - * - * @param newValue New tensor to be assigned to this variable. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - assign(newValue) { - if (newValue.dtype !== this.dtype) { - throw new Error(`dtype of the new value (${newValue.dtype}) and ` + - `previous value (${this.dtype}) must match`); - } - if (!arraysEqual(newValue.shape, this.shape)) { - throw new Error(`shape of the new value (${newValue.shape}) and ` + - `previous value (${this.shape}) must match`); - } - trackerFn().disposeTensor(this); - this.dataId = newValue.dataId; - trackerFn().incRef(this, null /* backend */); - } - dispose() { - trackerFn().disposeVariable(this); - this.isDisposedInternal = true; - } -} -Object.defineProperty(Variable, Symbol.hasInstance, { - value: (instance) => { - return instance instanceof Tensor && instance.assign != null && - instance.assign instanceof Function; - } -}); - -/** - * @license - * Copyright 2017 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 Rank; -(function (Rank) { - Rank["R0"] = "R0"; - Rank["R1"] = "R1"; - Rank["R2"] = "R2"; - Rank["R3"] = "R3"; - Rank["R4"] = "R4"; - Rank["R5"] = "R5"; - Rank["R6"] = "R6"; -})(Rank || (Rank = {})); -// Looks for upcasting types. Used, for example, in operations with mixed dtype -// inputs. -var UpcastInt32AndMap; -(function (UpcastInt32AndMap) { - UpcastInt32AndMap["float32"] = "float32"; - UpcastInt32AndMap["int32"] = "int32"; - UpcastInt32AndMap["bool"] = "int32"; - UpcastInt32AndMap["complex64"] = "complex64"; -})(UpcastInt32AndMap || (UpcastInt32AndMap = {})); -var UpcastBoolAndMap; -(function (UpcastBoolAndMap) { - UpcastBoolAndMap["float32"] = "float32"; - UpcastBoolAndMap["int32"] = "int32"; - UpcastBoolAndMap["bool"] = "bool"; - UpcastBoolAndMap["complex64"] = "complex64"; -})(UpcastBoolAndMap || (UpcastBoolAndMap = {})); -var UpcastFloat32AndMap; -(function (UpcastFloat32AndMap) { - UpcastFloat32AndMap["float32"] = "float32"; - UpcastFloat32AndMap["int32"] = "float32"; - UpcastFloat32AndMap["bool"] = "float32"; - UpcastFloat32AndMap["complex64"] = "complex64"; -})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); -var UpcastComplex64AndMap; -(function (UpcastComplex64AndMap) { - UpcastComplex64AndMap["float32"] = "complex64"; - UpcastComplex64AndMap["int32"] = "complex64"; - UpcastComplex64AndMap["bool"] = "complex64"; - UpcastComplex64AndMap["complex64"] = "complex64"; -})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); -const upcastTypeMap = { - 'float32': UpcastFloat32AndMap, - 'int32': UpcastInt32AndMap, - 'bool': UpcastBoolAndMap, - 'complex64': UpcastComplex64AndMap -}; -function upcastType(typeA, typeB) { - if (typeA === 'string' || typeB === 'string') { - if (typeA === 'string' && typeB === 'string') { - return 'string'; - } - throw new Error(`Can not upcast ${typeA} with ${typeB}`); - } - return upcastTypeMap[typeA][typeB]; -} - -/** - * @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 makeTypesMatch(a, b) { - if (a.dtype === b.dtype) { - return [a, b]; - } - const dtype = upcastType(a.dtype, b.dtype); - return [a.cast(dtype), b.cast(dtype)]; -} -/** - * Extracts any `Tensor`s found within the provided object. - * - * @param container an object that may be a `Tensor` or may directly contain - * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it - * is safe to pass any object here, except that `Promise`s are not - * supported. - * @returns An array of `Tensors` found within the passed object. If the - * argument is simply a `Tensor', a list containing that `Tensor` is - * returned. If the object is not a `Tensor` or does not - * contain `Tensors`, an empty list is returned. - */ -function getTensorsInContainer(result) { - const list = []; - const seen = new Set(); - walkTensorContainer(result, list, seen); - return list; -} -function walkTensorContainer(container, list, seen) { - if (container == null) { - return; - } - if (container instanceof Tensor) { - list.push(container); - return; - } - if (!isIterable(container)) { - return; - } - // Iteration over keys works also for arrays. - const iterable = container; - for (const k in iterable) { - const val = iterable[k]; - if (!seen.has(val)) { - seen.add(val); - walkTensorContainer(val, list, seen); - } - } -} -// tslint:disable-next-line:no-any -function isIterable(obj) { - return Array.isArray(obj) || typeof obj === 'object'; -} - -/** - * @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 isRegisteredKernelInvocation(kernelInvocation) { - return kernelInvocation.kernelName != null; -} -class EngineState { - constructor() { - // Public since optimizers will use it. - this.registeredVariables = {}; - this.nextTapeNodeId = 0; - this.numBytes = 0; - this.numTensors = 0; - this.numStringTensors = 0; - this.numDataBuffers = 0; - // Number of nested tf.grad() statements when computing higher-order - // gradients. E.g. `1` for first-order gradients and `2` for second-order - // gradients. Used to track if the tape should be removed after a backprop. - this.gradientDepth = 0; - // Number of nested kernel calls. When kernel depth is greater than 1, we turn - // off the tape. - this.kernelDepth = 0; - this.scopeStack = []; - /** - * Keeps track of the number of data moves during a kernel execution. We - * maintain a stack since kernels can call other kernels, recursively. - */ - this.numDataMovesStack = []; - this.nextScopeId = 0; - this.tensorInfo = new WeakMap(); - this.profiling = false; - this.activeProfile = { - newBytes: 0, - newTensors: 0, - peakBytes: 0, - kernels: [], - result: null, - get kernelNames() { - return Array.from(new Set(this.kernels.map(k => k.name))); - } - }; - } - dispose() { - for (const variableName in this.registeredVariables) { - this.registeredVariables[variableName].dispose(); - } - } -} -class Engine { - constructor(ENV) { - this.ENV = ENV; - this.registry = {}; - this.registryFactory = {}; - this.pendingBackendInitId = 0; - this.state = new EngineState(); - } - async ready() { - if (this.pendingBackendInit != null) { - return this.pendingBackendInit.then(() => { }); - } - if (this.backendInstance != null) { - return; - } - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const success = await this.initializeBackend(backendName).success; - if (success) { - await this.setBackend(backendName); - return; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - get backend() { - if (this.pendingBackendInit != null) { - throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` + - `sure to await tf.ready() or await tf.setBackend() before calling ` + - `other methods`); - } - if (this.backendInstance == null) { - const { name, asyncInit } = this.initializeBackendsAndReturnBest(); - if (asyncInit) { - throw new Error(`The highest priority backend '${name}' has not yet been ` + - `initialized. Make sure to await tf.ready() or ` + - `await tf.setBackend() before calling other methods`); - } - this.setBackend(name); - } - return this.backendInstance; - } - backendNames() { - return Object.keys(this.registryFactory); - } - findBackend(backendName) { - if (!(backendName in this.registry)) { - // If the backend hasn't been initialized but we have a registry entry for - // it, initialize it and return it. - if (backendName in this.registryFactory) { - const { asyncInit } = this.initializeBackend(backendName); - if (asyncInit) { - // Backend is not ready yet. - return null; - } - } - else { - return null; - } - } - return this.registry[backendName]; - } - findBackendFactory(backendName) { - if (!(backendName in this.registryFactory)) { - return null; - } - return this.registryFactory[backendName].factory; - } - registerBackend(backendName, factory, priority = 1) { - if (backendName in this.registryFactory) { - console.warn(`${backendName} backend was already registered. ` + - `Reusing existing backend factory.`); - return false; - } - this.registryFactory[backendName] = { factory, priority }; - return true; - } - async setBackend(backendName) { - if (this.registryFactory[backendName] == null) { - throw new Error(`Backend name '${backendName}' not found in registry`); - } - this.backendName = backendName; - if (this.registry[backendName] == null) { - this.backendInstance = null; - const { success, asyncInit } = this.initializeBackend(backendName); - const result = asyncInit ? await success : success; - if (!result) { - return false; - } - } - this.backendInstance = this.registry[backendName]; - this.setupRegisteredKernels(); - // Reset the profiler. - this.profiler = new Profiler(this.backendInstance); - return true; - } - setupRegisteredKernels() { - const kernels = getKernelsForBackend(this.backendName); - kernels.forEach(kernel => { - if (kernel.setupFunc != null) { - kernel.setupFunc(this.backendInstance); - } - }); - } - disposeRegisteredKernels(backendName) { - const kernels = getKernelsForBackend(backendName); - kernels.forEach(kernel => { - if (kernel.disposeFunc != null) { - kernel.disposeFunc(this.registry[backendName]); - } - }); - } - /** - * Initializes a backend by looking up the backend name in the factory - * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if - * there is no backend in the factory registry. - */ - initializeBackend(backendName) { - const registryFactoryEntry = this.registryFactory[backendName]; - if (registryFactoryEntry == null) { - throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); - } - try { - const backend = registryFactoryEntry.factory(); - /* Test if the factory returns a promise. - Done in a more liberal way than - previous 'Promise.resolve(backend)===backend' - as we needed to account for custom Promise - implementations (e.g. Angular) */ - if (backend && !(backend instanceof KernelBackend) && - typeof backend.then === 'function') { - const promiseId = ++this.pendingBackendInitId; - const success = backend - .then(backendInstance => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.registry[backendName] = backendInstance; - this.pendingBackendInit = null; - return true; - }) - .catch(err => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.pendingBackendInit = null; - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return false; - }); - this.pendingBackendInit = success; - return { success, asyncInit: true }; - } - else { - this.registry[backendName] = backend; - return { success: true, asyncInit: false }; - } - } - catch (err) { - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return { success: false, asyncInit: false }; - } - } - removeBackend(backendName) { - if (!(backendName in this.registryFactory)) { - throw new Error(`${backendName} backend not found in registry`); - } - if (this.backendName === backendName && this.pendingBackendInit != null) { - // There is a pending promise of the backend we want to remove. Make it - // obsolete. - this.pendingBackendInitId++; - } - if (backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - delete this.registryFactory[backendName]; - // Unset the backend if it is active. - if (this.backendName === backendName) { - this.pendingBackendInit = null; - this.backendName = null; - this.backendInstance = null; - } - } - getSortedBackends() { - if (Object.keys(this.registryFactory).length === 0) { - throw new Error('No backend found in registry.'); - } - return Object.keys(this.registryFactory).sort((a, b) => { - // Highest priority comes first. - return this.registryFactory[b].priority - - this.registryFactory[a].priority; - }); - } - initializeBackendsAndReturnBest() { - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const { success, asyncInit } = this.initializeBackend(backendName); - if (asyncInit || success) { - return { name: backendName, asyncInit }; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - moveData(backend, dataId) { - const info = this.state.tensorInfo.get(dataId); - const srcBackend = info.backend; - const values = this.readSync(dataId); - const refCount = srcBackend.refCount(dataId); - // Delete the tensor from the old backend and move it to the new - // backend. - srcBackend.disposeData(dataId, true); - info.backend = backend; - backend.move(dataId, values, info.shape, info.dtype, refCount); - if (this.shouldCheckForMemLeaks()) { - // Track the number of moves during a kernel execution to correctly - // detect memory leaks. - this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; - } - } - tidy(nameOrFn, fn) { - let name = null; - if (fn == null) { - // Called with only 1 argument. - if (typeof nameOrFn !== 'function') { - throw new Error('Please provide a function to tidy()'); - } - fn = nameOrFn; - } - else { - // Called with 2 arguments. - if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { - throw new Error('When calling with two arguments, the first argument ' + - 'to tidy() must be a string'); - } - if (typeof fn !== 'function') { - throw new Error('When calling with two arguments, the 2nd argument ' + - 'to tidy() must be a function'); - } - name = nameOrFn; - // TODO(nsthorat,smilkov): Do operation logging and performance - // profiling. - } - let result; - return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { - result = fn(); - if (result instanceof Promise) { - console.error('Cannot return a Promise inside of tidy.'); - } - return result; - }); - } - scopedRun(start, end, f) { - start(); - try { - const res = f(); - end(); - return res; - } - catch (ex) { - end(); - throw ex; - } - } - nextTensorId() { - return Engine.nextTensorId++; - } - nextVariableId() { - return Engine.nextVariableId++; - } - /** - * This method is called instead of the public-facing tensor.clone() when - * saving a tensor for backwards pass. It makes sure to add the clone - * operation to the tape regardless of being called inside a kernel - * execution. - */ - clone(x) { - const y = ENGINE.runKernel(Identity, { x }); - const inputs = { x }; - const grad = (dy) => ({ - x: () => { - const dtype = 'float32'; - const gradInputs = { x: dy }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, gradInputs, - // tslint:disable-next-line: no-unnecessary-type-assertion - attrs); - } - }); - const saved = []; - this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {}); - return y; - } - /** - * Execute a kernel with the given name and return the output tensor. - * - * @param kernelName The name of the kernel to execute. - * @param inputs A map of input names to tensors. - * @param attrs A map of attribute names to their values. An attribute is a - * primitive (non-tensor) input to the kernel. - * @param inputsToSave A list of tensors, inputs to save for the backprop - * computation. - * @param outputsToSave A list of booleans, specifying which output to save - * for the backprop computation. These are booleans since the output - * tensors are not visible to the user. - */ - runKernel(kernelName, inputs, attrs) { - const hasKernel = getKernel(kernelName, this.backendName) != null; - if (!hasKernel) { - throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`); - } - return this.runKernelFunc({ kernelName, inputs, attrs }); - } - shouldCheckForMemLeaks() { - return this.ENV.getBool('IS_TEST'); - } - checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { - const numDataIdsAfter = this.backend.numDataIds(); - // Count the number of data ids associated with the result of the kernel. - let numOutputDataIds = 0; - outInfos.forEach(info => { - // Complex numbers allocate 3 data ids, one for 'real', one for - // 'imaginary', and one for the container that holds the former two. - numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1); - }); - // Account for the number of moves during kernel execution. A "data move" - // can happen in the middle of a kernel execution, placing a new (key,value) - // pair in the data storage. Since data moves have net zero effect (we - // always remove the data from the old backend), we have to cancel them out - // when detecting memory leaks. - const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; - const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; - if (dataIdsLeaked > 0) { - throw new Error(`Backend '${this.backendName}' has an internal memory leak ` + - `(${dataIdsLeaked} data ids) after running '${kernelName}'`); - } - } - /** - * Internal helper method to execute a kernel Func - * - * Use `runKernel` to execute kernels from outside of engine. - */ - runKernelFunc(kernelParams) { - let outputs; - let saved = []; - const isTapeOn = this.isTapeOn(); - const startingBytecount = this.state.numBytes; - const startingNumTensors = this.state.numTensors; - if (this.shouldCheckForMemLeaks()) { - this.state.numDataMovesStack.push(0); - } - let kernelFunc; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - let out; - const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ? - kernelParams.kernelName : - this.state.activeScope != null ? this.state.activeScope.name : ''; - // Create the kernelFunc from either a registered kernel OR passed in - // forward/backward functions (used by custom grad). In this context a - // kernelFunc wraps a kernel implementation with some bookkeeping. - if (isRegisteredKernelInvocation(kernelParams)) { - const { kernelName, inputs, attrs } = kernelParams; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - const kernel = getKernel(kernelName, this.backendName); - assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`); - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = kernel.kernelFunc({ inputs, attrs, backend: this.backend }); - const outInfos = Array.isArray(out) ? out : [out]; - if (this.shouldCheckForMemLeaks()) { - this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); - } - const outTensors = outInfos.map((outInfo) => { - // todo (yassogba) remove this option (Tensor) when node backend - // methods have been modularized and they all return tensorInfo. - // TensorInfos do not have a rank attribute. - if (outInfo.rank != null) { - return outInfo; - } - const { dataId, shape, dtype } = outInfo; - return this.makeTensorFromDataId(dataId, shape, dtype); - }); - // Save any required inputs and outputs. - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since there would be no backprop for these tensors - // (which would otherwise dispose them). - if (isTapeOn) { - const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors); - saved = this.saveTensorsForBackwardMode(tensorsToSave); - } - return outTensors; - }; - } - else { - const { forwardFunc } = kernelParams; - // Running a customGrad op. - const saveFunc = (tensors) => { - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since we would never run backprop, which disposes - // the kept tensors. - if (!isTapeOn) { - return; - } - saved = tensors.map(tensor => this.keep(this.clone(tensor))); - }; - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = this.tidy(() => forwardFunc(this.backend, saveFunc)); - const outs = (Array.isArray(out) ? out : [out]); - if (this.shouldCheckForMemLeaks()) { - // Scope name is used to print a more helpful error message if needed. - this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs); - } - return outs; - }; - } - // - // Run the kernelFunc. Optionally profiling it. - // - const { inputs, attrs } = kernelParams; - const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ? - null : - kernelParams.backwardsFunc; - let kernelProfile; - this.scopedRun( - // Stop recording to a tape when running a kernel. - () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { - if (!this.ENV.getBool('DEBUG') && !this.state.profiling) { - outputs = kernelFunc(); - } - else { - kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc()); - if (this.ENV.getBool('DEBUG')) { - this.profiler.logKernelProfile(kernelProfile); - } - outputs = kernelProfile.outputs; - } - }); - if (isTapeOn) { - this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs); - } - if (this.state.profiling) { - this.state.activeProfile.kernels.push({ - name: kernelOrScopeName, - bytesAdded: this.state.numBytes - startingBytecount, - totalBytesSnapshot: this.state.numBytes, - tensorsAdded: this.state.numTensors - startingNumTensors, - totalTensorsSnapshot: this.state.numTensors, - inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null), - outputShapes: outputs.map(item => item.shape), - kernelTimeMs: kernelProfile.timeMs, - extraInfo: kernelProfile.extraInfo - }); - } - return (Array.isArray(out) ? outputs : outputs[0]); - } - /** - * Saves tensors used in forward mode for use in backward mode. - * - * @param tensors the list of tensors to save. - */ - saveTensorsForBackwardMode(tensors) { - const saved = tensors.map(tensor => this.keep(this.clone(tensor))); - return saved; - } - /** - * Returns a list of tensors to save for a given gradient calculation. - * - * @param kernelName name of kernel to look up gradient for. - * @param inputs a map of input tensors. - * @param outputs an array of output tensors from forward mode of kernel. - */ - getTensorsForGradient(kernelName, inputs, outputs) { - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - const inputsToSave = gradConfig.inputsToSave || []; - const outputsToSave = gradConfig.outputsToSave || []; - // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs - // specified in inputsToSave will be saved. - let inputTensorsToSave; - if (gradConfig.saveAllInputs) { - assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.'); - inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); - } - else { - inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); - } - const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); - return inputTensorsToSave.concat(outputTensorsToSave); - } - // We return an empty list rather than throw an error because the kernel we - // are looking up may not actually be relevant to backproping through the - // overall function - // - // See 'does not error if irrelevant (pruned) ops are missing grads' test - // in gradients_test.ts for an example. - return []; - } - /** - * Internal method used by public APIs for tensor creation. Makes a new - * tensor with the provided shape, dtype and values. It always - * creates a new data id and writes the values to the underlying backend. - */ - makeTensor(values, shape, dtype, backend) { - if (values == null) { - throw new Error('Values passed to engine.makeTensor() are null'); - } - dtype = dtype || 'float32'; - backend = backend || this.backend; - let backendVals = values; - if (dtype === 'string' && isString(values[0])) { - backendVals = values.map(d => encodeString(d)); - } - const dataId = backend.write(backendVals, shape, dtype); - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - // Count bytes for string tensors. - if (dtype === 'string') { - const info = this.state.tensorInfo.get(dataId); - const newBytes = bytesFromStringArray(backendVals); - this.state.numBytes += newBytes - info.bytes; - info.bytes = newBytes; - } - return t; - } - /** - * Internal method used by backends. Makes a new tensor - * that is a wrapper around an existing data id. It doesn't create - * a new data id, only increments the ref count used in memory tracking. - */ - makeTensorFromDataId(dataId, shape, dtype, backend) { - dtype = dtype || 'float32'; - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - return t; - } - makeVariable(initialValue, trainable = true, name, dtype) { - name = name || this.nextVariableId().toString(); - if (dtype != null && dtype !== initialValue.dtype) { - initialValue = initialValue.cast(dtype); - } - const v = new Variable(initialValue, trainable, name, this.nextTensorId()); - if (this.state.registeredVariables[v.name] != null) { - throw new Error(`Variable with name ${v.name} was already registered`); - } - this.state.registeredVariables[v.name] = v; - this.incRef(v, this.backend); - return v; - } - trackTensor(a, backend) { - this.state.numTensors++; - if (a.dtype === 'string') { - this.state.numStringTensors++; - } - // Bytes for complex numbers are counted by their components. Bytes for - // string tensors are counted when writing values. - let bytes = 0; - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - bytes = a.size * bytesPerElement(a.dtype); - } - this.state.numBytes += bytes; - if (!this.state.tensorInfo.has(a.dataId)) { - this.state.numDataBuffers++; - this.state.tensorInfo.set(a.dataId, { - backend: backend || this.backend, - dtype: a.dtype, - shape: a.shape, - bytes - }); - } - if (!(a instanceof Variable)) { - this.track(a); - } - } - // Track the tensor by dataId and increase the refCount for the dataId in the - // backend. - // TODO(pyu10055): This is currently used by makeVariable method, to increase - // refCount on the backend for the dataId. It can potentially be replaced with - // Identity op indead of calling backend directly. - incRef(a, backend) { - this.trackTensor(a, backend); - this.backend.incRef(a.dataId); - } - removeDataId(dataId, backend) { - if (this.state.tensorInfo.has(dataId) && - this.state.tensorInfo.get(dataId).backend === backend) { - this.state.tensorInfo.delete(dataId); - this.state.numDataBuffers--; - } - } - disposeTensor(a) { - if (!this.state.tensorInfo.has(a.dataId)) { - return; - } - const info = this.state.tensorInfo.get(a.dataId); - this.state.numTensors--; - if (a.dtype === 'string') { - this.state.numStringTensors--; - this.state.numBytes -= info.bytes; - } - // Don't count bytes for complex numbers as they are counted by their - // components. - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - const bytes = a.size * bytesPerElement(a.dtype); - this.state.numBytes -= bytes; - } - // Remove the reference to dataId if backend dispose the data successfully - if (info.backend.disposeData(a.dataId)) { - this.removeDataId(a.dataId, info.backend); - } - // TODO(nsthorat): Construct an error and save the stack trace for - // debugging when in debug mode. Creating a stack trace is too expensive - // to do unconditionally. - } - disposeVariables() { - for (const varName in this.state.registeredVariables) { - const v = this.state.registeredVariables[varName]; - this.disposeVariable(v); - } - } - disposeVariable(v) { - this.disposeTensor(v); - if (this.state.registeredVariables[v.name] != null) { - delete this.state.registeredVariables[v.name]; - } - } - memory() { - const info = this.backend.memory(); - info.numTensors = this.state.numTensors; - info.numDataBuffers = this.state.numDataBuffers; - info.numBytes = this.state.numBytes; - if (this.state.numStringTensors > 0) { - info.unreliable = true; - if (info.reasons == null) { - info.reasons = []; - } - info.reasons.push('Memory usage by string tensors is approximate ' + - '(2 bytes per character)'); - } - return info; - } - async profile(query) { - this.state.profiling = true; - const startBytes = this.state.numBytes; - const startNumTensors = this.state.numTensors; - this.state.activeProfile.kernels = []; - this.state.activeProfile.result = await query(); - this.state.profiling = false; - this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot)); - this.state.activeProfile.newBytes = this.state.numBytes - startBytes; - this.state.activeProfile.newTensors = - this.state.numTensors - startNumTensors; - for (const kernel of this.state.activeProfile.kernels) { - kernel.kernelTimeMs = await kernel.kernelTimeMs; - kernel.extraInfo = await kernel.extraInfo; - } - return this.state.activeProfile; - } - isTapeOn() { - return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; - } - addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { - const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - gradientsFunc = gradConfig.gradFunc; - } - if (gradientsFunc != null) { - tapeNode.gradient = (dys) => { - // TODO(smilkov): To optimize back-prop, pass dys that are not used in - // the backprop graph to the user as null instead of zeros - dys = dys.map((dy, i) => { - if (dy == null) { - const output = outputs[i]; - const vals = makeZerosTypedArray(output.size, output.dtype); - return this.makeTensor(vals, output.shape, output.dtype); - } - return dy; - }); - // Grad functions of ops with single outputs expect a dy, while ops - // with multiple outputs expect dys (array of dy). - return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); - }; - } - this.state.activeTape.push(tapeNode); - } - keep(result) { - result.kept = true; - return result; - } - startTape() { - if (this.state.gradientDepth === 0) { - this.state.activeTape = []; - } - this.state.gradientDepth++; - } - endTape() { - this.state.gradientDepth--; - } - /** - * Start a scope. Use this with endScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - startScope(name) { - const scopeInfo = { - track: [], - name: 'unnamed scope', - id: this.state.nextScopeId++ - }; - if (name) { - scopeInfo.name = name; - } - this.state.scopeStack.push(scopeInfo); - this.state.activeScope = scopeInfo; - } - /** - * End a scope. Use this with startScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - endScope(result) { - const tensorsToTrackInParent = getTensorsInContainer(result); - const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id)); - // Dispose the arrays tracked in this scope. - for (let i = 0; i < this.state.activeScope.track.length; i++) { - const tensor = this.state.activeScope.track[i]; - if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) { - tensor.dispose(); - } - } - const oldScope = this.state.scopeStack.pop(); - this.state.activeScope = this.state.scopeStack.length === 0 ? - null : - this.state.scopeStack[this.state.scopeStack.length - 1]; - // Track the current result in the parent scope. - tensorsToTrackInParent.forEach(tensor => { - // Only track the tensor if was allocated in the inner scope and is not - // globally kept. - if (!tensor.kept && tensor.scopeId === oldScope.id) { - this.track(tensor); - } - }); - } - /** - * Returns gradients of `f` with respect to each of the `xs`. The gradients - * returned are of the same length as `xs`, but some might be null if `f` - * was not a function of that `x`. It also takes optional dy to multiply the - * gradient, which defaults to `1`. - */ - gradients(f, xs, dy, allowNoGradients = false) { - assert(xs.length > 0, () => 'gradients() received an empty list of xs.'); - if (dy != null && dy.dtype !== 'float32') { - throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); - } - const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f)); - assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.'); - // Filter out the nodes that don't connect x => y. - const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y); - if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { - throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + - 'that the f you passed encloses all operations that lead from x ' + - 'to y.'); - } - return this.tidy('backward', () => { - const accumulatedGradientMap = {}; - accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; - // Backprop gradients through the filtered nodes. - backpropagateGradients(accumulatedGradientMap, filteredTape, - // Pass the tidy function to avoid circular dep with `tape.ts`. - f => this.tidy(f), - // Pass an add function to avoide a circular dep with `tape.ts`. - add); - const grads = xs.map(x => accumulatedGradientMap[x.id]); - if (this.state.gradientDepth === 0) { - // This means that we are not computing higher-order gradients - // and can clean up the tape. - this.state.activeTape.forEach(node => { - for (const tensor of node.saved) { - tensor.dispose(); - } - }); - this.state.activeTape = null; - } - return { value: y, grads }; - }); - } - customGrad(f) { - assert(isFunction(f), () => 'The f passed in customGrad(f) must be a function.'); - return (...inputs) => { - assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' + - 'tensors'); - let res; - const inputMap = {}; - inputs.forEach((input, i) => { - inputMap[i] = input; - }); - const forwardFunc = (_, save) => { - res = f(...[...inputs, save]); - assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.value` is a tensor'); - assert(isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function.'); - return res.value; - }; - const backwardsFunc = (dy, saved) => { - const gradRes = res.gradFunc(dy, saved); - const grads = Array.isArray(gradRes) ? gradRes : [gradRes]; - assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'the same number of tensors as inputs passed to f(...).'); - assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'a list of only tensors.'); - const gradMap = {}; - grads.forEach((grad, i) => { - gradMap[i] = () => grad; - }); - return gradMap; - }; - return this.runKernelFunc({ - forwardFunc, - backwardsFunc, - inputs: inputMap, - }); - }; - } - readSync(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.readSync(dataId); - } - read(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.read(dataId); - } - async time(query) { - const start = now(); - const timingInfo = await this.backend.time(query); - timingInfo.wallMs = now() - start; - return timingInfo; - } - /** - * Tracks a Tensor in the current scope to be automatically cleaned up - * when the current scope ends, and returns the value. - * - * @param result The Tensor to track in the current scope. - */ - track(result) { - if (this.state.activeScope != null) { - result.scopeId = this.state.activeScope.id; - this.state.activeScope.track.push(result); - } - return result; - } - get registeredVariables() { - return this.state.registeredVariables; - } - /** - * Resets the engine state. Removes all backends but does not remove - * registered backend factories. - */ - reset() { - // Make any pending promise obsolete. - this.pendingBackendInitId++; - this.state.dispose(); - this.ENV.reset(); - this.state = new EngineState(); - for (const backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - this.backendName = null; - this.backendInstance = null; - this.pendingBackendInit = null; - } -} -Engine.nextTensorId = 0; -Engine.nextVariableId = 0; -function ones(shape) { - const values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); - return ENGINE.makeTensor(values, shape, 'float32'); -} -function getOrMakeEngine() { - const ns = getGlobalNamespace(); - if (ns._tfengine == null) { - const environment = new Environment(ns); - ns._tfengine = new Engine(environment); - } - setEnvironmentGlobal(ns._tfengine.ENV); - // Tell the current tensor interface that the global engine is responsible - // for tracking. - setTensorTracker(() => ns._tfengine); - return ns._tfengine; -} -const ENGINE = getOrMakeEngine(); -/** - * A implementation of the add op for use within engine and tape. - * - * This allows us to avoid a circular dependency between add.ts and engine. - * It is exported to be available in tape tests. - */ -function add(a, b) { - // We duplicate Add here to avoid a circular dependency with add.ts. - const inputs = { a, b }; - return ENGINE.runKernel(Add, inputs); -} - -/** - * @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 inferShape(val, dtype) { - let firstElem = val; - if (isTypedArray(val)) { - return dtype === 'string' ? [] : [val.length]; - } - if (!Array.isArray(val)) { - return []; // Scalar. - } - const shape = []; - while (Array.isArray(firstElem) || - isTypedArray(firstElem) && dtype !== 'string') { - shape.push(firstElem.length); - firstElem = firstElem[0]; - } - if (Array.isArray(val) && - env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) { - deepAssertShapeConsistency(val, shape, []); - } - return shape; -} -function deepAssertShapeConsistency(val, shape, indices) { - indices = indices || []; - if (!(Array.isArray(val)) && !isTypedArray(val)) { - assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` + - `but should be an array/TypedArray of ${shape[0]} elements`); - return; - } - assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` + - `but is an array of ${val.length} elements`); - assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` + - `elements, but has ${val.length} elements`); - const subShape = shape.slice(1); - for (let i = 0; i < val.length; ++i) { - deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); - } -} -function assertDtype(expectedDtype, actualDType, argName, functionName) { - if (expectedDtype === 'string_or_numeric') { - return; - } - if (expectedDtype == null) { - throw new Error(`Expected dtype cannot be null.`); - } - if (expectedDtype !== 'numeric' && expectedDtype !== actualDType || - expectedDtype === 'numeric' && actualDType === 'string') { - throw new Error(`Argument '${argName}' passed to '${functionName}' must ` + - `be ${expectedDtype} tensor, but got ${actualDType} tensor`); - } -} -function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') { - if (x instanceof Tensor) { - assertDtype(parseAsDtype, x.dtype, argName, functionName); - return x; - } - let inferredDtype = inferDtype(x); - // If the user expects a bool/int/float, use that info to update the - // inferredDtype when it is not a string. - if (inferredDtype !== 'string' && - ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) { - inferredDtype = parseAsDtype; - } - assertDtype(parseAsDtype, inferredDtype, argName, functionName); - if ((x == null) || - (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && - typeof x !== 'boolean' && typeof x !== 'string')) { - const type = x == null ? 'null' : x.constructor.name; - throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` + - `Tensor or TensorLike, but got '${type}'`); - } - const inferredShape = inferShape(x, inferredDtype); - if (!isTypedArray(x) && !Array.isArray(x)) { - x = [x]; - } - const skipTypedArray = true; - const values = inferredDtype !== 'string' ? - toTypedArray(x, inferredDtype) : - flatten(x, [], skipTypedArray); - return ENGINE.makeTensor(values, inferredShape, inferredDtype); -} -function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') { - if (!Array.isArray(arg)) { - throw new Error(`Argument ${argName} passed to ${functionName} must be a ` + - '`Tensor[]` or `TensorLike[]`'); - } - const tensors = arg; - return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype)); -} - -/** - * @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 OP_SCOPE_SUFFIX = '__op'; -/** - * Used for wrapping functions that perform math operations on - * Tensors. The function will be wrapped in a named scope that cleans all - * memory usage after the function is done. - */ -function op(f) { - const keys = Object.keys(f); - if (keys.length !== 1) { - throw new Error(`Please provide an object with a single key ` + - `(operation name) mapping to a function. Got an object with ` + - `${keys.length} keys.`); - } - let opName = keys[0]; - const fn = f[opName]; - // Strip the underscore from the end of the function name. - if (opName.endsWith('_')) { - opName = opName.substring(0, opName.length - 1); - } - // add an __op suffix to distinguish ops from kernels in tf.profile - opName = opName + OP_SCOPE_SUFFIX; - // tslint:disable-next-line:no-any - const f2 = (...args) => { - ENGINE.startScope(opName); - try { - const result = fn(...args); - if (isPromise(result)) { - console.error('Cannot return a Promise inside of tidy.'); - } - ENGINE.endScope(result); - return result; - } - catch (ex) { - ENGINE.endScope(null); - throw ex; - } - }; - Object.defineProperty(f2, 'name', { value: opName, configurable: true }); - // tslint:disable-next-line:no-any - return f2; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes absolute value element-wise: `abs(x)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.abs().print(); // or tf.abs(x) - * ``` - * @param x The input `tf.Tensor`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function abs_(x) { - const $x = convertToTensor(x, 'x', 'abs'); - if ($x.dtype === 'complex64') { - const inputs = { x: $x }; - return ENGINE.runKernel(ComplexAbs, inputs); - } - else { - const inputs = { x: $x }; - return ENGINE.runKernel(Abs, inputs); - } -} -const abs = op({ abs_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes acos of the input `tf.Tensor` element-wise: `acos(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.acos().print(); // or tf.acos(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function acos_(x) { - const $x = convertToTensor(x, 'x', 'acos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acos, inputs); -} -const acos = op({ acos_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise: - * `acosh(x)` - * - * ```js - * const x = tf.tensor1d([10, 1, 3, 5.7]); - * - * x.acosh().print(); // or tf.acosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function acosh_(x) { - const $x = convertToTensor(x, 'x', 'acosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acosh, inputs); -} -const acosh = op({ acosh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting. - * - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * - * ```js - * // Broadcast add a with b. - * const a = tf.scalar(5); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * @param a The first `tf.Tensor` to add. - * @param b The second `tf.Tensor` to add. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function add_(a, b) { - let $a = convertToTensor(a, 'a', 'add'); - let $b = convertToTensor(b, 'b', 'add'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Add, inputs); -} -const add$1 = op({ add_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the logical and of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.all().print(); // or tf.all(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.all(axis).print(); // or tf.all(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function all_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'all', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(All, inputs, attrs); -} -const all = op({ all_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the logical or of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.any().print(); // or tf.any(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.any(axis).print(); // or tf.any(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function any_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'any', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Any, inputs, attrs); -} -// tslint:disable-next-line:variable-name -const any = op({ any_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Returns the indices of the maximum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMax().print(); // or tf.argMax(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMax(axis).print(); // or tf.argMax(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function argMax_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMax'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMax, inputs, attrs); -} -const argMax = op({ argMax_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Returns the indices of the minimum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMin().print(); // or tf.argMin(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMin(axis).print(); // or tf.argMin(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function argMin_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMin'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMin, inputs, attrs); -} -const argMin = op({ argMin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes asin of the input `tf.Tensor` element-wise: `asin(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asin().print(); // or tf.asin(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function asin_(x) { - const $x = convertToTensor(x, 'x', 'asin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asin, inputs); -} -const asin = op({ asin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise: - * `asinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asinh().print(); // or tf.asinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function asinh_(x) { - const $x = convertToTensor(x, 'x', 'asinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asinh, inputs); -} -const asinh = op({ asinh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes atan of the input `tf.Tensor` element-wise: `atan(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.atan().print(); // or tf.atan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atan_(x) { - const $x = convertToTensor(x, 'x', 'atan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atan, inputs); -} -const atan = op({ atan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]); - * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]); - * - * tf.atan2(a, b).print() - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atan2_(a, b) { - let $a = convertToTensor(a, 'a', 'atan2'); - let $b = convertToTensor(b, 'b', 'atan2'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Atan2, inputs); -} -const atan2 = op({ atan2_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise: - * `atanh(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.atanh().print(); // or tf.atanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atanh_(x) { - const $x = convertToTensor(x, 'x', 'atanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atanh, inputs); -} -const atanh = op({ atanh_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Casts a `tf.Tensor` to a new dtype. - * - * ```js - * const x = tf.tensor1d([1.5, 2.5, 3]); - * tf.cast(x, 'int32').print(); - * ``` - * @param x The input tensor to be casted. - * @param dtype The dtype to cast the input tensor to. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function cast_(x, dtype) { - const $x = convertToTensor(x, 'x', 'cast'); - // Sanity checks. - if (!isValidDtype(dtype)) { - throw new Error(`Failed to cast to unknown dtype ${dtype}`); - } - if (dtype === 'string' && $x.dtype !== 'string' || - dtype !== 'string' && $x.dtype === 'string') { - throw new Error('Only strings can be casted to strings'); - } - const inputs = { x: $x }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, inputs, attrs); -} -const cast = op({ cast_ }); - -/** - * @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. - * ============================================================================= - */ -function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') { - const [filterHeight, filterWidth] = parseTupleParam(filterSize); - let filterShape; - if (dataFormat === 'channelsLast') { - filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; - } - else if (dataFormat === 'channelsFirst') { - filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); -} -/** - * Computes the information for a forward pass of a convolution/pooling - * operation. - */ -function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') { - let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; - if (dataFormat === 'channelsLast') { - [batchSize, inHeight, inWidth, inChannels] = inShape; - } - else if (dataFormat === 'channelsFirst') { - [batchSize, inChannels, inHeight, inWidth] = inShape; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - const [filterHeight, filterWidth, , filterChannels] = filterShape; - const [strideHeight, strideWidth] = parseTupleParam(strides); - const [dilationHeight, dilationWidth] = parseTupleParam(dilations); - const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); - const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); - const outChannels = depthwise ? filterChannels * inChannels : filterChannels; - let outShape; - if (dataFormat === 'channelsFirst') { - outShape = [batchSize, outChannels, outHeight, outWidth]; - } - else if (dataFormat === 'channelsLast') { - outShape = [batchSize, outHeight, outWidth, outChannels]; - } - return { - batchSize, - dataFormat, - inHeight, - inWidth, - inChannels, - outHeight, - outWidth, - outChannels, - padInfo, - strideHeight, - strideWidth, - filterHeight, - filterWidth, - effectiveFilterHeight, - effectiveFilterWidth, - dilationHeight, - dilationWidth, - inShape, - outShape, - filterShape - }; -} -function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) { - if (zeroPad == null) { - zeroPad = computeDefaultPad(inShape, fieldSize, stride); - } - const inputRows = inShape[0]; - const inputCols = inShape[1]; - const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - return [outputRows, outputCols]; -} -function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) { - const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); - return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); -} -function parseTupleParam(param) { - if (typeof param === 'number') { - return [param, param, param]; - } - if (param.length === 2) { - return [param[0], param[1], 1]; - } - return param; -} -/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d - * Atrous convolution is equivalent to standard convolution with upsampled - * filters with effective_filter_height = - * filter_height + (filter_height - 1) * (dilation - 1) - * and effective_filter_width = - * filter_width + (filter_width - 1) * (dilation - 1), - * produced by inserting dilation - 1 zeros along consecutive elements across - * the filters' spatial dimensions. - * When there is a dilation, this converts a filter dimension to the - * effective filter dimension, so it can be used in a standard convolution. - */ -function getEffectiveFilterSize(filterSize, dilation) { - if (dilation <= 1) { - return filterSize; - } - return filterSize + (filterSize - 1) * (dilation - 1); -} -function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { - let padInfo; - let outHeight; - let outWidth; - if (typeof pad === 'number') { - const padType = (pad === 0) ? 'VALID' : 'NUMBER'; - padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; - const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode); - outHeight = outShape[0]; - outWidth = outShape[1]; - } - else if (pad === 'same') { - outHeight = Math.ceil(inHeight / strideHeight); - outWidth = Math.ceil(inWidth / strideWidth); - const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); - const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); - const top = Math.floor(padAlongHeight / 2); - const bottom = padAlongHeight - top; - const left = Math.floor(padAlongWidth / 2); - const right = padAlongWidth - left; - padInfo = { top, bottom, left, right, type: 'SAME' }; - } - else if (pad === 'valid') { - padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; - outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); - outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); - } - else if (typeof pad === 'object') { - const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0]; - const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1]; - const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0]; - const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1]; - const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ? - 'VALID' : - 'EXPLICIT'; - padInfo = { top, bottom, left, right, type: padType }; - outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); - outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); - } - else { - throw Error(`Unknown padding parameter: ${pad}`); - } - return { padInfo, outHeight, outWidth }; -} -/** - * Rounds a value depending on the rounding mode - * @param value - * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function round(value, roundingMode) { - if (!roundingMode) { - return Math.trunc(value); - } - switch (roundingMode) { - case 'round': - // used for Caffe Conv - return Math.round(value); - case 'ceil': - // used for Caffe Pool - return Math.ceil(value); - case 'floor': - return Math.floor(value); - default: - throw new Error(`Unknown roundingMode ${roundingMode}`); - } -} -function tupleValuesAreOne(param) { - const [dimA, dimB, dimC] = parseTupleParam(param); - return dimA === 1 && dimB === 1 && dimC === 1; -} -function eitherStridesOrDilationsAreOne(strides, dilations) { - return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Reshapes a `tf.Tensor` to a given shape. - * - * Given an input tensor, returns a new tensor with the same values as the - * input tensor with shape `shape`. - * - * If one component of shape is the special value -1, the size of that - * dimension is computed so that the total size remains constant. In - * particular, a shape of [-1] flattens into 1-D. At most one component of - * shape can be -1. - * - * If shape is 1-D or higher, then the operation returns a tensor with shape - * shape filled with the values of tensor. In this case, the number of - * elements implied by shape must be the same as the number of elements in - * tensor. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.reshape([2, 2]).print(); - * ``` - * - * @param x The input tensor to be reshaped. - * @param shape An array of integers defining the output tensor shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function reshape_(x, shape) { - const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric'); - const inputs = { x: $x }; - const attrs = { shape }; - return ENGINE.runKernel(Reshape, inputs, attrs); -} -const reshape = op({ reshape_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the 2D average pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'avgPool', 'float32'); - const dilations = 1; - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - let res = ENGINE.runKernel(AvgPool, inputs, attrs); - res = cast(res, $x.dtype); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const avgPool = op({ avgPool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a new tensor with the same values and shape as the specified - * tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * - * x.clone().print(); - * ``` - * - * @param x The tensor to clone. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function clone_(x) { - const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric'); - const inputs = { x: $x }; - // Note this op is called tf.identity in python. Hence the kernel name used - // here. - return ENGINE.runKernel(Identity, inputs); -} -const clone = op({ clone_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Concatenates a list of `tf.Tensor`s along a given axis. - * - * The tensors ranks and types must match, and their sizes must match in all - * dimensions except `axis`. - * - * Also available are stricter rank-specific methods that assert that - * `tensors` are of the given rank: - * - `tf.concat1d` - * - `tf.concat2d` - * - `tf.concat3d` - * - `tf.concat4d` - * - * Except `tf.concat1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * a.concat(b).print(); // or a.concat(b) - * ``` - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.concat([a, b, c]).print(); - * ``` - * - * ```js - * const a = tf.tensor2d([[1, 2], [10, 20]]); - * const b = tf.tensor2d([[3, 4], [30, 40]]); - * const axis = 1; - * tf.concat([a, b], axis).print(); - * ``` - * @param tensors A list of tensors to concatenate. - * @param axis The axis to concate along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function concat_(tensors, axis = 0) { - assert(tensors.length >= 1, () => 'Pass at least one tensor to concat'); - const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric'); - if ($tensors[0].dtype === 'complex64') { - $tensors.forEach(tensor => { - if (tensor.dtype !== 'complex64') { - throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${tensor.dtype}. `); - } - }); - } - if ($tensors.length === 1) { - return clone($tensors[0]); - } - const inputs = $tensors; - const attr = { axis }; - return ENGINE.runKernel(Concat, inputs, attr); -} -const concat = op({ concat_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the dot product of two matrices, A * B. These must be matrices. - * - * ```js - * const a = tf.tensor2d([1, 2], [1, 2]); - * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.matMul(b).print(); // or tf.matMul(a, b) - * ``` - * @param a First matrix in dot product operation. - * @param b Second matrix in dot product operation. - * @param transposeA If true, `a` is transposed before multiplication. - * @param transposeB If true, `b` is transposed before multiplication. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function matMul_(a, b, transposeA = false, transposeB = false) { - let $a = convertToTensor(a, 'a', 'matMul'); - let $b = convertToTensor(b, 'b', 'matMul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - const attrs = { transposeA, transposeB }; - return ENGINE.runKernel(BatchMatMul, inputs, attrs); -} -const matMul = op({ matMul_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting. - * - * We also expose `tf.mulStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([2, 3, 4, 5]); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * - * ```js - * // Broadcast mul a with b. - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.scalar(5); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * @param a The first tensor to multiply. - * @param b The second tensor to multiply. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function mul_(a, b) { - let $a = convertToTensor(a, 'a', 'mul'); - let $b = convertToTensor(b, 'b', 'mul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Multiply, inputs); -} -const mul = op({ mul_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes sigmoid element-wise, `1 / (1 + exp(-x))` - * - * ```js - * const x = tf.tensor1d([0, -1, 2, -3]); - * - * x.sigmoid().print(); // or tf.sigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sigmoid_(x) { - const $x = convertToTensor(x, 'x', 'sigmoid'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sigmoid, inputs); -} -const sigmoid = op({ sigmoid_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Extracts a slice from a `tf.Tensor` starting at coordinates `begin` - * and is of size `size`. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `x` is of the given rank: - * - `tf.slice1d` - * - `tf.slice2d` - * - `tf.slice3d` - * - `tf.slice4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.slice([1], [2]).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * x.slice([1, 0], [1, 2]).print(); - * ``` - * @param x The input `tf.Tensor` to slice from. - * @param begin The coordinates to start the slice from. The length can be - * less than the rank of x - the rest of the axes will have implicit 0 as - * start. Can also be a single number, in which case it specifies the - * first axis. - * @param size The size of the slice. The length can be less than the rank of - * x - the rest of the axes will have implicit -1. A value of -1 requests - * the rest of the dimensions in the axis. Can also be a single number, - * in which case it specifies the size of the first axis. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function slice_(x, begin, size) { - const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric'); - if ($x.rank === 0) { - throw new Error('Slicing scalar is not possible'); - } - const inputs = { x: $x }; - const attrs = { begin, size }; - return ENGINE.runKernel(Slice, inputs, attrs); -} -const slice = op({ slice_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, 70]); - * - * x.tanh().print(); // or tf.tanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function tanh_(x) { - const $x = convertToTensor(x, 'x', 'tanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tanh, inputs); -} -const tanh = op({ tanh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of - * shape `blockShape + [batch]`, interleaves these blocks back into the grid - * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with - * the same rank as the input. The spatial dimensions of this intermediate - * result are then optionally cropped according to `crops` to produce the - * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise - * description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); - * const blockShape = [2, 2]; - * const crops = [[0, 0], [0, 0]]; - * - * x.batchToSpaceND(blockShape, crops).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required - * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]` - * - * This operation is equivalent to the following steps: - * - * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ..., - * blockShape[M-1], batch / prod(blockShape), x.shape[1], ..., - * x.shape[N-1]]` - * - * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch / - * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M], - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch / - * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] * - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted` - * according to `crops` to produce the output of shape: `[batch / - * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1], - * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] - - * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function batchToSpaceND_(x, blockShape, crops) { - const $x = convertToTensor(x, 'x', 'batchToSpaceND'); - const prod = blockShape.reduce((a, b) => a * b); - assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); - assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); - assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` + - `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`); - const inputs = { x: $x }; - const attrs = { blockShape, crops }; - return ENGINE.runKernel(BatchToSpaceND, inputs, attrs); -} -const batchToSpaceND = op({ batchToSpaceND_ }); - -function xAs4D(x) { - let x4D; - if (x.rank === 0 || x.rank === 1) { - x4D = reshape(x, [1, 1, 1, x.size]); - } - else if (x.rank === 2) { - x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]); - } - else if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - else { - x4D = x; - } - return x4D; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Batch normalization. - * - * As described in - * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167). - * - * Mean, variance, scale, and offset can be of two shapes: - * - The same shape as the input. - * - In the common case, the depth dimension is the last dimension of x, so - * the values would be an `tf.Tensor1D` of shape [depth]. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that parameters passed are of given rank - * - `tf.batchNorm2d` - * - `tf.batchNorm3d` - * - `tf.batchNorm4d` - * - * @param x The input Tensor. - * @param mean A mean Tensor. - * @param variance A variance Tensor. - * @param offset An offset Tensor. - * @param scale A scale Tensor. - * @param varianceEpsilon A small float number to avoid dividing by 0. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) { - if (varianceEpsilon == null) { - varianceEpsilon = 0.001; - } - const $x = convertToTensor(x, 'x', 'batchNorm'); - const $mean = convertToTensor(mean, 'mean', 'batchNorm'); - const $variance = convertToTensor(variance, 'variance', 'batchNorm'); - let $scale; - if (scale != null) { - $scale = convertToTensor(scale, 'scale', 'batchNorm'); - } - let $offset; - if (offset != null) { - $offset = convertToTensor(offset, 'offset', 'batchNorm'); - } - assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' + - 'equal ranks.'); - assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' + - 'equal ranks.'); - assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' + - 'equal ranks.'); - const x4D = xAs4D($x); - const inputs = { - x: x4D, - scale: $scale, - offset: $offset, - mean: $mean, - variance: $variance - }; - const attrs = { varianceEpsilon }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs); - return reshape(res, $x.shape); -} -const batchNorm = op({ batchNorm_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Broadcast an array to a compatible shape NumPy-style. - * - * The tensor's shape is compared to the broadcast shape from end to beginning. - * Ones are prepended to the tensor's shape until is has the same length as - * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is - * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then - * the input tensor is tiled N times along that axis (using tf.tile). - * - * @param input The tensor that is to be broadcasted. - * @param shape The input is to be broadcast to this shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function broadcastTo_(x, shape) { - let input = convertToTensor(x, 'broadcastTo', 'x'); - const xShape = input.shape; - if (shape.some(d => !(d > 0) || d % 1 !== 0)) { - throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); - } - if (shape.length < input.rank) { - throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`); - } - if (shape.length > input.rank) { - const newShape = input.shape.slice(); - while (newShape.length < shape.length) { - newShape.unshift(1); - } - input = reshape(input, newShape); - } - const inputShape = input.shape; - const reps = Array.from(shape); - for (let i = shape.length - 1; i >= 0; i--) { - if (inputShape[i] === shape[i]) { - reps[i] = 1; - } - else if (input.shape[i] !== 1) { - throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); - } - } - const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0); - if (axes.length === 0) { - return clone(input); - } - // TODO call broadcastTo kernel directly once backends implement broadcstTo - const inputs = { x: input }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); -} -const broadcastTo = op({ broadcastTo_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)` - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.ceil().print(); // or tf.ceil(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function ceil_(x) { - const $x = convertToTensor(x, 'x', 'ceil'); - const inputs = { x: $x }; - return ENGINE.runKernel(Ceil, inputs); -} -const ceil = op({ ceil_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) - * ``` - * @param x The input tensor. - * @param clipValueMin Lower-bound of range to be clipped to. - * @param clipValueMax Upper-bound of range to be clipped to. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function clipByValue_(x, clipValueMin, clipValueMax) { - const $x = convertToTensor(x, 'x', 'clipByValue'); - assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` + - `less than or equal to max (${clipValueMax}).`); - const inputs = { x: $x }; - const attrs = { clipValueMin, clipValueMax }; - return ENGINE.runKernel(ClipByValue, inputs, attrs); -} -const clipByValue = op({ clipByValue_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Converts two real numbers to a complex number. - * - * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], - * where r represents the real part and i represents the imag part. - * - * The input tensors real and imag must have the same shape. - * - * ```js - * const real = tf.tensor1d([2.25, 3.25]); - * const imag = tf.tensor1d([4.75, 5.75]); - * const complex = tf.complex(real, imag); - * - * complex.print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function complex_(real, imag) { - const $real = convertToTensor(real, 'real', 'complex'); - const $imag = convertToTensor(imag, 'imag', 'complex'); - assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` + - `must match in call to tf.complex().`); - const inputs = { real: $real, imag: $imag }; - return ENGINE.runKernel(Complex, inputs); -} -const complex = op({ complex_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes a 2D convolution over the input x. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2d'); - const $filter = convertToTensor(filter, 'filter', 'conv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` + - `input depth for filter ${$filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const conv2d = op({ conv2d_ }); - -/** - * Computes a 1D convolution over the input x. - * - * @param x The input tensor, of rank 3 or rank 2, of shape - * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed. - * @param filter The filter, rank 3, of shape - * `[filterWidth, inDepth, outDepth]`. - * @param stride The number of entries by which the filter is moved right at - * each step. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat An optional string from "NWC", "NCW". Defaults to "NWC", - * the data is stored in the order of [batch, in_width, in_channels]. Only - * "NWC" is currently supported. - * @param dilation The dilation rate in which we sample input values in - * atrous convolution. Defaults to `1`. If it is greater than 1, then - * stride must be `1`. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv1d'); - const $filter = convertToTensor(filter, 'filter', 'conv1d'); - let x3D = $x; - let reshapedTo3D = false; - if ($x.rank === 2) { - reshapedTo3D = true; - x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]); - } - assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); - assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` + - `input depth for filter ${$filter.shape[1]}.`); - assert(eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' + - `Got stride ${stride} and dilation '${dilation}'`); - assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`); - const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]); - const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]); - const strides = [1, stride]; - const dilations = [1, dilation]; - const conv2dDataFormat = 'NHWC'; - const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); - if (reshapedTo3D) { - return reshape(res, [res.shape[2], res.shape[3]]); - } - return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]); -} -const conv1d = op({ conv1d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the input of a 2D convolution. - * - * @param xShape The shape of the input: [batch, height, width, inDepth]. - * If length of 3, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 4 or rank 3 of shape - * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape4D = xShape; - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - xShape4D = [1, xShape[0], xShape[1], xShape[2]]; - } - assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` + - `${xShape4D.length}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` + - `rank ${dy4D.rank}`); - assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` + - `rank ${filter.rank}`); - const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[2]}.`); - assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[3]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const conv2DBackpropInput = op({ conv2DBackpropInput_ }); - -/** - * Computes the transposed 2D convolution of an image, also known as a - * deconvolution. - * - * @param x The input image, of rank 4 or rank 3, of shape - * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, outDepth, inDepth]`. - * `inDepth` must match `inDepth` in `x`. - * @param outputShape Output shape, of rank 4 or rank 3: - * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed. - * @param strides The strides of the original convolution: - * `[strideHeight, strideWidth]`. - * @param pad The type of padding algorithm used in the non-transpose version - * of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2dTranspose'); - const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose'); - return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode); -} -const conv2dTranspose = op({ conv2dTranspose_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the input of a 3D convolution. - * - * @param xShape The shape of the input: [batch, depth, height, width, - * in_channels]. If length of 4, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 5 or rank 4 of shape - * `[batch, outDepth, outHeight, outWidth, in_channels]`. - * If rank 4, batch of 1 is assumed. - * @param filter The filter, rank 5, of shape - * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideDepth, strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - */ -function conv3DBackpropInput_(xShape, dy, filter, strides, pad) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape5D = xShape; - let dy5D = dy; - let reshapedTo5D = false; - if (dy.rank === 4) { - reshapedTo5D = true; - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; - } - const inDepth = xShape5D[4]; - const outDepth = dy5D.shape[4]; - assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` + - `${xShape5D.length}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` + - `rank ${dy5D.rank}`); - assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` + - `rank ${filter.rank}`); - assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[3]}.`); - assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[4]}.`); - const inputs = { dy: dy5D, filter }; - const attrs = { pad, strides, inputShape: xShape5D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const conv3DBackpropInput = op({ conv3DBackpropInput_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes cos of the input `tf.Tensor` element-wise: `cos(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.cos().print(); // or tf.cos(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function cos_(x) { - const $x = convertToTensor(x, 'x', 'cos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cos, inputs); -} -const cos = op({ cos_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.cosh().print(); // or tf.cosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function cosh_(x) { - const $x = convertToTensor(x, 'x', 'cosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cosh, inputs); -} -const cosh = op({ cosh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the cumulative sum of a `tf.Tensor` along `axis`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4]); - * x.cumsum().print(); - * ``` - * ```js - * const x = tf.tensor([[1, 2], [3, 4]]); - * x.cumsum().print(); - * ``` - * - * @param x The input tensor to be summed. - * @param axis The axis along which to sum. Optional. Defaults to 0. - * @param exclusive Whether to perform exclusive cumulative sum. Optional. - * Defaults to false. If set to true then the sum of each tensor entry - * does not include its own value, but only the values previous to it - * along the specified axis. - * @param reverse Whether to sum in the opposite direction. Optional. - * Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Scan'} - */ -function cumsum_(x, axis = 0, exclusive = false, reverse = false) { - const $x = convertToTensor(x, 'x', 'cumsum'); - const inputs = { x: $x }; - const attrs = { axis, exclusive, reverse }; - return ENGINE.runKernel(Cumsum, inputs, attrs); -} -const cumsum = op({ cumsum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Rearranges data from depth into blocks of spatial data. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `blockSize` indicates the input block size and how the data is - * moved. - * - * - Chunks of data of size `blockSize * blockSize` from depth are rearranged - * into non-overlapping blocks of size `blockSize x blockSize` - * - * - The width the output tensor is `inputWidth * blockSize`, whereas the - * height is `inputHeight * blockSize` - * - * - The Y, X coordinates within each block of the output image are determined - * by the high order component of the input channel index - * - * - The depth of the input tensor must be divisible by `blockSize * - * blockSize` - * - * The `dataFormat` attr specifies the layout of the input and output tensors - * with the following options: "NHWC": [ `batch, height, width, channels` ] - * "NCHW": [ `batch, channels, height, width` ] - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]); - * const blockSize = 2; - * const dataFormat = "NHWC"; - * - * tf.depthToSpace(x, blockSize, dataFormat).print(); - * ``` - * - * @param x The input tensor of rank 4 - * @param blockSIze An `int` that is `>= 2`. The size of the spatial block - * @param dataFormat An optional string from: "NHWC", "NCHW". Defaults to "NHWC" - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function depthToSpace_(x, blockSize, dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'depthToSpace'); - const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2]; - const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3]; - const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1]; - assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputHeight} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputWidth} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); - const inputs = { x: $x }; - const attrs = { blockSize, dataFormat }; - return ENGINE.runKernel(DepthToSpace, inputs, attrs); -} -const depthToSpace = op({ depthToSpace_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Depthwise 2D convolution. - * - * Given a 4D `input` array and a `filter` array of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing - * `inChannels` convolutional filters of depth 1, this op applies a - * different filter to each input channel (expanding from 1 channel to - * `channelMultiplier` channels for each), then concatenates the results - * together. The output has `inChannels * channelMultiplier` channels. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'depthwiseConv2d'); - const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` + - `(${x4D.shape[3]}) must match the inChannels dimension in ` + - `filter ${$filter.shape[2]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const depthwiseConv2d = op({ depthwiseConv2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the grayscale dilation over the input `x`. - * - * @param x The input tensor, rank 3 or rank 4 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filter The filter tensor, rank 3, of shape - * `[filterHeight, filterWidth, depth]`. - * @param strides The strides of the sliding window for each dimension of the - * input tensor: `[strideHeight, strideWidth]`. - * If `strides` is a single number, - * then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1*1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat Specify the data format of the input and output data. - * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations` - * is a single number, then `dilationHeight == dilationWidth`. If it is - * greater than 1, then all values of `strides` must be 1. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'dilation2d'); - const $filter = convertToTensor(filter, 'filter', 'dilation2d'); - assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` + - `${$x.rank}.`); - assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` + - `but got dataFormat of ${dataFormat}`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - reshapedTo4D = true; - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dilations }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Dilation2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const dilation2d = op({ dilation2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * The result is rounded with floor function. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.floorDiv(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.floorDiv(b).print(); // or tf.floorDiv(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function floorDiv_(a, b) { - let $a = convertToTensor(a, 'a', 'floorDiv'); - let $b = convertToTensor(b, 'b', 'floorDiv'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(FloorDiv, inputs); -} -const floorDiv = op({ floorDiv_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function div_(a, b) { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'int32' && $b.dtype === 'int32') { - return floorDiv($a, $b); - } - const inputs = { a: $a, b: $b }; - const attrs = {}; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(RealDiv, inputs, attrs); -} -const div = op({ div_ }); - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Returns the axes in the output space that should be reduced to produce - * the input space. - */ -function getReductionAxes(inShape, outShape) { - const result = []; - for (let i = 0; i < outShape.length; i++) { - const inDim = inShape[inShape.length - i - 1]; - const outAxis = outShape.length - i - 1; - const outDim = outShape[outAxis]; - if (inDim == null || (inDim === 1 && outDim > 1)) { - result.unshift(outAxis); - } - } - return result; -} -function assertAndGetBroadcastShape(shapeA, shapeB) { - const result = []; - const l = Math.max(shapeA.length, shapeB.length); - for (let i = 0; i < l; i++) { - let a = shapeA[shapeA.length - i - 1]; - if (a == null) { - a = 1; - } - let b = shapeB[shapeB.length - i - 1]; - if (b == null) { - b = 1; - } - if (a === 1) { - result.unshift(b); - } - else if (b === 1) { - result.unshift(a); - } - else if (a !== b) { - const errMsg = `Operands could not be broadcast together with shapes ` + - `${shapeA} and ${shapeB}.`; - throw Error(errMsg); - } - else { - result.unshift(a); - } - } - return result; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a == b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.equal(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function equal_(a, b) { - let $a = convertToTensor(a, 'a', 'equal'); - let $b = convertToTensor(b, 'b', 'equal'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Equal, inputs); -} -const equal = op({ equal_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the elements, either `a` or `b` depending on the `condition`. - * - * If the condition is true, select from `a`, otherwise select from `b`. - * - * ```js - * const cond = tf.tensor1d([false, false, true], 'bool'); - * const a = tf.tensor1d([1 , 2, 3]); - * const b = tf.tensor1d([-1, -2, -3]); - * - * a.where(cond, b).print(); - * ``` - * - * @param condition The input condition. Must be of dtype bool. - * @param a If `condition` is rank 1, `a` may have a higher rank but - * its first dimension must match the size of `condition`. - * @param b A tensor with the same dtype as `a` and with shape that is - * compatible with `a`. - * @return A tensor with same dtype as `a` and `b`, and shape that is - * broadcastable from `a` and `b`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function where_(condition, a, b) { - const $a = convertToTensor(a, 'a', 'where'); - const $b = convertToTensor(b, 'b', '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); - const $broadcastedA = broadcastTo($a, broadcastShape); - const $broadcastedB = broadcastTo($b, broadcastShape); - const inputs = { - condition: $broadcastedCondition, - t: $broadcastedA, - e: $broadcastedB - }; - return ENGINE.runKernel(Select, inputs); -} -const where = op({ where_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.zerosLike(x).print(); - * ``` - * - * @param x The tensor of required shape. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function zerosLike_(x) { - const $x = convertToTensor(x, 'x', 'zerosLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(ZerosLike, inputs); -} -const zerosLike = op({ zerosLike_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 - * if denominator is 0. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * const c = tf.tensor1d([0, 0, 0, 0]); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * const c = tf.scalar(0); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function divNoNan_(a, b) { - // TODO: Make this into its own kernel. - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - const divResult = div($a, $b); - const zeros = zerosLike(divResult); - const bEqualsZero = equal($b, zeros); - return where(bEqualsZero, zeros, divResult); -} -const divNoNan = op({ divNoNan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the dot product of two matrices and/or vectors, `t1` and `t2`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor2d([[1, 2], [3, 4]]); - * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * - * a.dot(b).print(); // or tf.dot(a, b) - * b.dot(a).print(); - * b.dot(c).print(); - * ``` - * @param t1 The first tensor in the dot operation. - * @param t2 The second tensor in the dot operation. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function dot_(t1, t2) { - const $t1 = convertToTensor(t1, 't1', 'dot'); - const $t2 = convertToTensor(t2, 't2', 'dot'); - assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` + - `${$t1.rank} and ${$t2.rank}.`); - const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); - const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); - assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` + - `${t1Inner} and ${t2Inner}.`); - if ($t1.rank === 1 && $t2.rank === 1) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, []); - } - else if ($t1.rank === 1 && $t2.rank === 2) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, [t1t2.size]); - } - else if ($t1.rank === 2 && $t2.rank === 1) { - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul($t1, t22D); - return reshape(t1t2, [t1t2.size]); - } - else { - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul($t1, t22D); - return t1t2; - } -} -const dot = op({ dot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`. - * - * ```js - * const x = tf.tensor1d([-1, 1, -3, 2]); - * - * x.elu().print(); // or tf.elu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function elu_(x) { - const $x = convertToTensor(x, 'x', 'elu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Elu, inputs); -} -const elu = op({ elu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes gause error function of the input `tf.Tensor` element-wise: - * `erf(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.erf().print(); // or tf.erf(x); - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function erf_(x) { - let $x = convertToTensor(x, 'x', 'erf'); - assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.'); - if ($x.dtype === 'int32') { - $x = cast($x, 'float32'); - } - const inputs = { x: $x }; - return ENGINE.runKernel(Erf, inputs); -} -const erf = op({ erf_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.exp().print(); // or tf.exp(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function exp_(x) { - const $x = convertToTensor(x, 'x', 'exp'); - const inputs = { x: $x }; - return ENGINE.runKernel(Exp, inputs); -} -const exp = op({ exp_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension - * into the tensor's shape. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const axis = 1; - * x.expandDims(axis).print(); - * ``` - * - * @param x The input tensor whose dimensions to be expanded. - * @param axis The dimension index at which to insert shape of `1`. Defaults - * to 0 (the first dimension). - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function expandDims_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric'); - assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor'); - const inputs = { input: $x }; - const attrs = { dim: axis }; - return ENGINE.runKernel(ExpandDims, inputs, attrs); -} -const expandDims = op({ expandDims_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential of the input `tf.Tensor` minus one element-wise. - * `e ^ x - 1` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.expm1().print(); // or tf.expm1(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function expm1_(x) { - const $x = convertToTensor(x, 'x', 'expm1'); - const inputs = { x: $x }; - return ENGINE.runKernel(Expm1, inputs); -} -const expm1 = op({ expm1_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Construct a tensor by repeating it the number of times given by reps. - * - * This operation creates a new tensor by replicating `input` `reps` - * times. The output tensor's i'th dimension has `input.shape[i] * - * reps[i]` elements, and the values of `input` are replicated - * `reps[i]` times along the i'th dimension. For example, tiling - * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * - * a.tile([2]).print(); // or a.tile([2]) - * ``` - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.tile([1, 2]).print(); // or a.tile([1, 2]) - * ``` - * @param x The tensor to tile. - * @param reps Determines the number of replications per dimension. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function tile_(x, reps) { - const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric'); - assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of reps ${reps}.`); - const inputs = { x: $x }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); -} -const tile = op({ tile_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes floor of input `tf.Tensor` element-wise: `floor(x)`. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.floor().print(); // or tf.floor(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function floor_(x) { - const $x = convertToTensor(x, 'x', 'floor'); - const inputs = { x: $x }; - return ENGINE.runKernel(Floor, inputs); -} -const floor = op({ floor_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Gather slices from tensor `x`'s axis `axis` according to `indices`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const indices = tf.tensor1d([1, 3, 3], 'int32'); - * - * x.gather(indices).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const indices = tf.tensor1d([1, 1, 0], 'int32'); - * - * x.gather(indices).print(); - * ``` - * @param x The input tensor whose slices to be gathered. - * @param indices The indices of the values to extract. - * @param axis The axis over which to select values. Defaults to 0. - * @param batchDims Optional. The number of batch dimensions. It must be less - * than or equal to rank(indices). Defaults to 0. - * The output tensor will have shape of - * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]` - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function gather_(x, indices, axis = 0, batchDims = 0) { - const $x = convertToTensor(x, 'x', 'gather'); - const $indices = convertToTensor(indices, 'indices', 'gather', 'int32'); - const inputs = { x: $x, indices: $indices }; - const attrs = { axis, batchDims }; - return ENGINE.runKernel(GatherV2, inputs, attrs); -} -const gather = op({ gather_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a > b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greater(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function greater_(a, b) { - let $a = convertToTensor(a, 'a', 'greater'); - let $b = convertToTensor(b, 'b', 'greater'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Greater, inputs); -} -const greater = op({ greater_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a >= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greaterEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function greaterEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'greaterEqual'); - let $b = convertToTensor(b, 'b', 'greaterEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(GreaterEqual, inputs); -} -const greaterEqual = op({ greaterEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the imaginary part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the imaginary part of each element in input considered as a complex number. - * If input is real, a tensor of all zeros is returned. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.imag(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function imag_(input) { - const $input = convertToTensor(input, 'input', 'imag'); - const inputs = { input: $input }; - return ENGINE.runKernel(Imag, inputs); -} -const imag = op({ imag_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns which elements of x are finite. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isFinite().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isFinite_(x) { - const $x = convertToTensor(x, 'x', 'isFinite'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsFinite, inputs); -} -const isFinite$1 = op({ isFinite_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns which elements of x are Infinity or -Infinity. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isInf().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isInf_(x) { - const $x = convertToTensor(x, 'x', 'isInf'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsInf, inputs); -} -const isInf = op({ isInf_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * RReturns which elements of x are NaN. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isNaN().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isNaN_(x) { - const $x = convertToTensor(x, 'x', 'isNaN'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsNan, inputs); -} -const isNaN$1 = op({ isNaN_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes leaky rectified linear element-wise. - * - * See - * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf]( - * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf) - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1) - * ``` - * @param x The input tensor. - * @param alpha The scaling factor for negative values, defaults to 0.2. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function leakyRelu_(x, alpha = 0.2) { - const $x = convertToTensor(x, 'x', 'leakyRelu'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(LeakyRelu, inputs, attrs); -} -const leakyRelu = op({ leakyRelu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a < b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.less(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function less_(a, b) { - let $a = convertToTensor(a, 'a', 'less'); - let $b = convertToTensor(b, 'b', 'less'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Less, inputs); -} -const less = op({ less_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a <= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.lessEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function lessEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'lessEqual'); - let $b = convertToTensor(b, 'b', 'lessEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LessEqual, inputs); -} -const lessEqual = op({ lessEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Normalizes the activation of a local neighborhood across or within - * channels. - * - * @param x The input tensor. The 4-D input tensor is treated as a 3-D array - * of 1D vectors (along the last dimension), and each vector is - * normalized independently. - * @param depthRadius The number of adjacent channels in the 1D normalization - * window. - * @param bias A constant bias term for the basis. - * @param alpha A scale factor, usually positive. - * @param beta An exponent. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const $x = convertToTensor(x, 'x', 'localResponseNormalization'); - assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${$x.rank}.`); - assert(isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` + - `integer but got depthRadius ${depthRadius}.`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - const inputs = { x: x4D }; - const attrs = { depthRadius, bias, alpha, beta }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(LRN, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - else { - return res; - } -} -const localResponseNormalization = op({ localResponseNormalization_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E]); - * - * x.log().print(); // or tf.log(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function log_(x) { - const $x = convertToTensor(x, 'x', 'log'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log, inputs); -} -const log = op({ log_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes natural logarithm of the input `tf.Tensor` plus one - * element-wise: `ln(1 + x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E - 1]); - * - * x.log1p().print(); // or tf.log1p(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function log1p_(x) { - const $x = convertToTensor(x, 'x', 'log1p'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log1p, inputs); -} -const log1p = op({ log1p_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Overrides the gradient computation of a function `f`. - * - * Takes a function - * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}` - * and returns another function `g(...inputs)` which takes the same inputs as - * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients - * with respect to each input of `f` are computed using `f().gradFunc`. - * - * The `save` function passsed to `f` should be used for saving tensors needed - * in the gradient. And the `saved` passed to the `gradFunc` is a - * `NamedTensorMap`, which contains those saved tensor. - * - * ```js - * const customOp = tf.customGrad((x, save) => { - * // Save x to make sure it's available later for the gradient. - * save([x]); - * // Override gradient of our custom x ^ 2 op to be dy * abs(x); - * return { - * value: x.square(), - * // Note `saved.x` which points to the `x` we saved earlier. - * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())] - * }; - * }); - * - * const x = tf.tensor1d([-1, -2, 3]); - * const dx = tf.grad(x => customOp(x)); - * - * console.log(`f(x):`); - * customOp(x).print(); - * console.log(`f'(x):`); - * dx(x).print(); - * ``` - * - * @param f The function to evaluate in forward mode, which should return - * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc` - * returns the custom gradients of `f` with respect to its inputs. - * - * @doc {heading: 'Training', subheading: 'Gradients'} - */ -function customGrad(f) { - return ENGINE.customGrad(f); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes `-1 * x` element-wise. - * - * ```js - * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]); - * - * x.neg().print(); // or tf.neg(x) - * ``` - * - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function neg_(x) { - const $x = convertToTensor(x, 'x', 'neg'); - const inputs = { x: $x }; - return ENGINE.runKernel(Neg, inputs); -} -const neg = op({ neg_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.softplus().print(); // or tf.softplus(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function softplus_(x) { - const $x = convertToTensor(x, 'x', 'softplus'); - const inputs = { x: $x }; - return ENGINE.runKernel(Softplus, inputs); -} -const softplus = op({ softplus_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes log sigmoid of the input `tf.Tensor` element-wise: - * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`. - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.logSigmoid().print(); // or tf.logSigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function logSigmoid_(x) { - const $x = convertToTensor(x, 'x', 'logSigmoid'); - // Use a custom gradient to maintain previous implementation. - // There is no LogSigmoid kernel in TF so we can't use engine.runKernel - // directly - const customOp = customGrad((x) => { - // TODO(yassogba) we can remove the chained softplus call here only - // after backends have modualrized softplus at which point we can call - // engine runKernel(..., Sotfplus, ...) directly. - const value = neg(softplus(neg(x))); - const gradFunc = (dy) => { - const derX = mul(dy, sigmoid(neg(x))); - return derX; - }; - return { value, gradFunc }; - }); - return customOp($x); -} -const logSigmoid = op({ logSigmoid_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the maximum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.max().print(); // or tf.max(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.max(axis).print(); // or tf.max(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function max_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'max'); - const inputs = { x: $x }; - const attrs = { reductionIndices: axis, keepDims }; - return ENGINE.runKernel(Max, inputs, attrs); -} -const max = op({ max_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * - * ```js - * // Broadcast subtract a with b. - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.scalar(5); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * @param a The first `tf.Tensor` to subtract from. - * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function sub_(a, b) { - let $a = convertToTensor(a, 'a', 'sub'); - let $b = convertToTensor(b, 'b', 'sub'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Sub, inputs); -} -const sub = op({ sub_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the sum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If axes has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.sum().print(); // or tf.sum(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.sum(axis).print(); // or tf.sum(x, axis) - * ``` - * - * @param x The input tensor to compute the sum over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function sum_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'sum'); - if ($x.dtype === 'bool') { - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Sum, inputs, attrs); -} -const sum = op({ sum_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the log softmax. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * @param logits The logits array. - * @param axis The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function logSoftmax_(logits, axis = -1) { - const $logits = convertToTensor(logits, 'logits', 'logSoftmax'); - if (axis === -1) { - axis = $logits.rank - 1; - } - if (axis !== $logits.rank - 1) { - throw Error('Log Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and axis was ${axis}`); - } - // const forward: ForwardFunc = (backend, save) => { - // const keepDims = true; - // const xMax = max(logits, axis, true); - // const shifted = sub(logits, xMax); - // const value = - // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, - // keepDims))); - // save([value]); - // return value; - // }; - // Use a custom gradient for numerical stability. - const customOp = customGrad((logits, save) => { - const keepDims = true; - const xMax = max(logits, axis, true); - const shifted = sub(logits, xMax); - const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims))); - save([value]); - const gradFunc = (dy, saved) => { - const [value] = saved; - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - }; - return { value, gradFunc }; - }); - return customOp($logits); - // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this. - // const inputs: LogSoftmaxInputs = {logits: $logits}; - // const attrs: LogSoftmaxAttrs = {axis}; - // return ENGINE.runKernel( - // LogSoftmax, inputs as {} as NamedTensorMap, - // attrs as {} as NamedAttrMap); -} -const logSoftmax = op({ logSoftmax_ }); - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Returns true if the axis specifies the inner most dimensions of the - * array. - */ -function axesAreInnerMostDims(axes, rank) { - for (let i = 0; i < axes.length; ++i) { - if (axes[axes.length - i - 1] !== rank - 1 - i) { - return false; - } - } - return true; -} -function combineLocations(outputLoc, reduceLoc, axes) { - const rank = outputLoc.length + reduceLoc.length; - const loc = []; - let outIdx = 0; - let reduceIdx = 0; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - loc.push(outputLoc[outIdx++]); - } - else { - loc.push(reduceLoc[reduceIdx++]); - } - } - return loc; -} -function computeOutAndReduceShapes(aShape, axes) { - const outShape = []; - const rank = aShape.length; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - outShape.push(aShape[dim]); - } - } - const reduceShape = axes.map(dim => aShape[dim]); - return [outShape, reduceShape]; -} -function expandShapeToKeepDim(shape, axes) { - const reduceSubShape = axes.map(x => 1); - return combineLocations(shape, reduceSubShape, axes); -} -/** - * Returns the axes permutation to be used with `tf.transpose`, if such - * permutation is necessary. Otherwise it returns null. This method is used by - * operations that operate only on inner-most axes. - */ -function getAxesPermutation(axes, rank) { - if (axesAreInnerMostDims(axes, rank)) { - return null; - } - const result = []; - for (let i = 0; i < rank; ++i) { - if (axes.indexOf(i) === -1) { - result.push(i); - } - } - axes.forEach(axis => result.push(axis)); - return result; -} -/** Returns the axes permutation that undoes the original permutation. */ -function getUndoAxesPermutation(axes) { - return axes.map((axis, i) => [i, axis]) - .sort((a, b) => a[1] - b[1]) - .map(x => x[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. - * ============================================================================= - */ -/** - * Computes the log(sum(exp(elements across the reduction dimensions)). - * - * Reduces the input along the dimensions given in `axis`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.logSumExp().print(); // or tf.logSumExp(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis) - * ``` - * @param x The input tensor. - * @param axis The dimension(s) to reduce. If null (the default), - * reduces all dimensions. - * @param keepDims If true, retains reduced dimensions with length - * of 1. Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function logSumExp_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'logSumExp'); - const axes = parseAxisParam(axis, $x.shape); - const xMax = max($x, axes, true /* keepDims */); - const a = sub($x, xMax); - const b = exp(a); - const c = sum(b, axes); - const d = log(c); - const res = add$1(reshape(xMax, d.shape), d); - if (keepDims) { - const newShape = expandShapeToKeepDim(res.shape, axes); - return reshape(res, newShape); - } - return res; -} -const logSumExp = op({ logSumExp_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a AND b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalAnd(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalAnd_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalAnd, inputs); -} -const logicalAnd = op({ logicalAnd_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `NOT x` element-wise. - * - * ```js - * const a = tf.tensor1d([false, true], 'bool'); - * - * a.logicalNot().print(); - * ``` - * - * @param x The input tensor. Must be of dtype 'bool'. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalNot_(x) { - const $x = convertToTensor(x, 'x', 'logicalNot', 'bool'); - const inputs = { x: $x }; - return ENGINE.runKernel(LogicalNot, inputs); -} -const logicalNot = op({ logicalNot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a OR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalOr(b).print(); - * ``` - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalOr_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalOr', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalOr', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalOr, inputs); -} -const logicalOr = op({ logicalOr_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a XOR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalXor(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalXor_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalXor', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalXor', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - // x ^ y = (x | y) & ~(x & y) - return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b))); -} -const logicalXor = op({ logicalXor_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the 2D max pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'maxPool'); - const dilations = 1; - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const maxPool = op({ maxPool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the max of a and b (`a > b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `tf.maximumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * ```js - * // Broadcast maximum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function maximum_(a, b) { - let $a = convertToTensor(a, 'a', 'maximum'); - let $b = convertToTensor(b, 'b', 'maximum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Maximum, inputs); -} -const maximum = op({ maximum_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the mean of elements across dimensions of a `tf.Tensor`. - * - * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is - * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with - * a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.mean().print(); // or tf.mean(a) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.mean(axis).print(); // or tf.mean(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function mean_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'mean'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Mean, inputs, attrs); -} -const mean = op({ mean_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 0. - * - * ```js - * tf.zeros([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Can - * be 'float32', 'int32' or 'bool'. Defaults to 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function zeros(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = zeros(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeZerosTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 1. - * - * ```js - * tf.ones([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Defaults to - * 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function ones$1(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = ones$1(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeOnesTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the minimum value from the input. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axes`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axes` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.min().print(); // or tf.min(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.min(axis).print(); // or tf.min(x, axis) - * ``` - * - * @param x The input Tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function min_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'min'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Min, inputs, attrs); -} -const min = op({ min_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the min of a and b (`a < b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `minimumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * ```js - * // Broadcast minimum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function minimum_(a, b) { - let $a = convertToTensor(a, 'a', 'minimum'); - let $b = convertToTensor(b, 'b', 'minimum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Minimum, inputs); -} -const minimum = op({ minimum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Pads a `tf.Tensor` using mirror padding. - * - * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad. - * - * ```js - * const x = tf.range(0, 9).reshape([1, 1, 3, 3]); - * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * In "reflect" mode, the padded regions do not include the borders, - * while in "symmetric" mode the padded regions do include the borders. - * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`, - * then the output is `[1, 2, 3, 2, 1]` in "reflect" mode, and - * `[1, 2, 3, 3, 2]` in "symmetric" mode. - * If `mode` is "reflect" then both `paddings[D, 0]` and `paddings[D, 1]` - * must be no greater than `x.shape[D] - 1`. If mode is "symmetric" - * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than - * `x.shape[D]` - * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'` - */ -/** @doc {heading: 'Tensors', subheading: 'Transformations'} */ -function mirrorPad_(x, paddings, mode) { - assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` + - `Got ${mode}.`); - const $x = convertToTensor(x, 'x', 'mirrorPad'); - if ($x.rank === 0) { - throw new Error('mirrorPad(scalar) is not defined. ' + - 'Pass non-scalar to mirrorPad'); - } - assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` + - `Got ${paddings.length}.`); - const shapeOffset = mode === 'reflect' ? 1 : 0; - for (let i = 0; i < $x.rank; i++) { - assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`); - assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset && - paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` + - `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` + - `shape ${$x.shape}`); - } - const attrs = { paddings, mode }; - const inputs = { x: $x }; - return ENGINE.runKernel(MirrorPad, inputs, attrs); -} -const mirrorPad = op({ mirrorPad_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the mod of a and b element-wise. - * `floor(x / y) * y + mod(x, y) = x` - * Supports broadcasting. - * - * We also expose `tf.modStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * ```js - * // Broadcast a mod b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function mod_(a, b) { - let $a = convertToTensor(a, 'a', 'mod'); - let $b = convertToTensor(b, 'b', 'mod'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Mod, inputs); -} -const mod = op({ mod_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes square of `x` element-wise: `x ^ 2` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]); - * - * x.square().print(); // or tf.square(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function square_(x) { - const $x = convertToTensor(x, 'x', 'square'); - const attrs = {}; - return ENGINE.runKernel('Square', { x: $x }, attrs); -} -const square = op({ square_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a != b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([0, 2, 3]); - * - * a.notEqual(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function notEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'notEqual'); - let $b = convertToTensor(b, 'b', 'notEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(NotEqual, inputs); -} -const notEqual = op({ notEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take - * value `onValue` (defaults to 1), while all other locations take value - * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank - * `R+1` with the last axis of size `depth`. - * - * ```js - * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print(); - * ``` - * - * @param indices `tf.Tensor` of indices with dtype `int32`. - * @param depth The depth of the one hot dimension. - * @param onValue A number used to fill in the output when the index matches - * the location. - * @param offValue A number used to fill in the output when the index does - * not match the location. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function oneHot_(indices, depth, onValue = 1, offValue = 0) { - if (depth < 2) { - throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); - } - const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); - const inputs = { indices: $indices }; - const attrs = { depth, onValue, offValue }; - return ENGINE.runKernel(OneHot, inputs, attrs); -} -const oneHot = op({ oneHot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.onesLike(x).print(); - * ``` - * @param x A tensor. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function onesLike_(x) { - const $x = convertToTensor(x, 'x', 'onesLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(OnesLike, inputs); -} -const onesLike = op({ onesLike_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Pads a `tf.Tensor` with a given value and paddings. - * - * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`, - * refer to `tf.mirrorPad` - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `paddings` is of given length. - * - `tf.pad1d` - * - `tf.pad2d` - * - `tf.pad3d` - * - `tf.pad4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.pad([[1, 2]]).print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * @param constantValue The pad value to use. Defaults to 0. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function pad_(x, paddings, constantValue = 0) { - const $x = convertToTensor(x, 'x', 'pad'); - if ($x.rank === 0) { - throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); - } - const attrs = { paddings, constantValue }; - const inputs = { x: $x }; - return ENGINE.runKernel(PadV2, inputs, attrs); -} -const pad = op({ pad_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * This operation divides "spatial" dimensions `[1, ..., M]` of the input into - * a grid of blocks of shape `blockShape`, and interleaves these blocks with - * the "batch" dimension (0) such that in the output, the spatial - * dimensions `[1, ..., M]` correspond to the position within the grid, - * and the batch dimension combines both the position within a spatial block - * and the original batch position. Prior to division into blocks, - * the spatial dimensions of the input are optionally zero padded - * according to `paddings`. See below for a precise description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); - * const blockShape = [2, 2]; - * const paddings = [[0, 0], [0, 0]]; - * - * x.spaceToBatchND(blockShape, paddings).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >= - * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad - * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It - * is required that - * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0` - * - * This operation is equivalent to the following steps: - * - * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input - * according to `paddings` to produce `padded` of shape paddedShape. - * - * 2. Reshape `padded` to `reshapedPadded` of shape: - * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., - * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape` - * - * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded` - * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the - * batch dimension, producing an output tensor of shape: - * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function spaceToBatchND_(x, blockShape, paddings) { - const $x = convertToTensor(x, 'x', 'spaceToBatchND'); - assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); - assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); - assert($x.shape.reduce((a, b, i) => { - if (i > 0 && i <= blockShape.length) { - return a && - ((b + paddings[i - 1][0] + paddings[i - 1][1]) % - blockShape[i - 1] === - 0); - } - return a; - }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); - const inputs = { x: $x }; - const attrs = { blockShape, paddings }; - return ENGINE.runKernel(SpaceToBatchND, inputs, attrs); -} -const spaceToBatchND = op({ spaceToBatchND_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Performs an N-D pooling operation - * - * @param input The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param windowShape The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param poolingType The type of pooling, either 'max' or 'avg'. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function pool_(input, windowShape, poolingType, pad, dilations, strides) { - if (dilations == null) { - dilations = [1, 1]; - } - if (strides == null) { - strides = 1; - } - if (pad === 0) { - pad = 'valid'; - } - const $x = convertToTensor(input, 'x', 'maxPool'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad); - const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; - // The following implementation does batchToSpace(pool(spaceToBatch(x))) - // whenever dilation > 1 since the TF kernels do not support dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037 - let basePadding; - if (pad === 'same') { - basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation); - } - else { - basePadding = [[0, 0], [0, 0]]; - } - const isDilationOne = dilation[0] === 1 && dilation[1] === 1; - const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); - const convertedPad = isDilationOne ? pad : 'valid'; - const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding); - const forwardOp = poolingType === 'avg' ? - () => avgPool(convertedX, windowShape, strides, convertedPad) : - () => maxPool(convertedX, windowShape, strides, convertedPad); - const y = forwardOp(); - const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -// Helper function to compute crops and paddings for pool with dilation > 1. -// tslint:disable-next-line:max-line-length -// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184 -function requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) { - const padStart = basePadding.map(b => b[0]); - const origPadEnd = basePadding.map(b => b[1]); - const fullInputShape = inputShape.concat(padStart, origPadEnd); - const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b); - const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]); - const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]); - const crops = blockShape.map((_, i) => [0, padEndExtra[i]]); - return [paddings, crops]; -} -// Helper function to compute base paddings for pool with dilation > 1. -// tslint:disable-next-line:max-line-length -// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524 -function withSpaceToBatchBasePaddings(filterShape, dilation) { - // Spatial dimensions of the filters and the upsampled filters in which we - // introduce (rate - 1) zeros between consecutive filter values. - const dilatedFilterShape = filterShape.map((s, i) => { - return s + (s - 1) * (dilation[i] - 1); - }); - const padExtraShape = dilatedFilterShape.map(s => s - 1); - // When padding is odd, we pad more at end, following the same - // convention as conv2d. - const padExtraStart = padExtraShape.map(s => Math.floor(s / 2)); - const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]); - return padExtraShape.map((_, i) => { - return [padExtraStart[i], padExtraEnd[i]]; - }); -} -const pool = op({ pool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the power of one `tf.Tensor` to another. Supports broadcasting. - * - * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for - * corresponding elements in x and y. The result's dtype will be the upcasted - * type of the `base` and `exp` dtypes. - * - * ```js - * const a = tf.tensor([[2, 3], [4, 5]]) - * const b = tf.tensor([[1, 2], [3, 0]]).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * - * ```js - * const a = tf.tensor([[1, 2], [3, 4]]) - * const b = tf.tensor(2).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * We also expose `powStrict` which has the same signature as this op and - * asserts that `base` and `exp` are the same shape (does not broadcast). - * - * @param base The base `tf.Tensor` to pow element-wise. - * @param exp The exponent `tf.Tensor` to pow element-wise. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function pow_(base, exp) { - let $base = convertToTensor(base, 'base', 'pow'); - let $exp = convertToTensor(exp, 'exp', 'pow'); - [$base, $exp] = makeTypesMatch($base, $exp); - const inputs = { a: $base, b: $exp }; - return ENGINE.runKernel(Pow, inputs); -} -const pow = op({ pow_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes leaky rectified linear element-wise with parametric alphas. - * - * `x < 0 ? alpha * x : f(x) = x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * const alpha = tf.scalar(0.1); - * - * x.prelu(alpha).print(); // or tf.prelu(x, alpha) - * ``` - * @param x The input tensor. - * @param alpha Scaling factor for negative values. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function prelu_(x, alpha) { - const $x = convertToTensor(x, 'x', 'prelu'); - const $alpha = convertToTensor(alpha, 'alpha', 'prelu'); - const inputs = { x: $x, alpha: $alpha }; - return ENGINE.runKernel(Prelu, inputs); -} -const prelu = op({ prelu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the product of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.prod().print(); // or tf.prod(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.prod(axis).print(); // or tf.prod(x, axis) - * ``` - * - * @param x The input tensor to compute the product over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function prod_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'prod'); - if ($x.dtype === 'bool') { - // bool is not an allowed type for the underlying kernel. - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Prod, inputs, attrs); -} -const prod = op({ prod_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the real part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the real part of each element in input considered as a complex number. - * - * If the input is real, it simply makes a clone. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.real(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function real_(input) { - const $input = convertToTensor(input, 'input', 'real'); - const inputs = { input: $input }; - return ENGINE.runKernel(Real, inputs); -} -const real = op({ real_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes reciprocal of x element-wise: `1 / x` - * - * ```js - * const x = tf.tensor1d([0, 1, 2]); - * - * x.reciprocal().print(); // or tf.reciprocal(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function reciprocal_(x) { - const $x = convertToTensor(x, 'x', 'reciprocal'); - const inputs = { x: $x }; - return ENGINE.runKernel(Reciprocal, inputs); -} -const reciprocal = op({ reciprocal_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes rectified linear element-wise: `max(x, 0)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.relu().print(); // or tf.relu(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function relu_(x) { - const $x = convertToTensor(x, 'x', 'relu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu, inputs); -} -const relu = op({ relu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 8]); - * - * x.relu6().print(); // or tf.relu6(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function relu6_(x) { - const $x = convertToTensor(x, 'x', 'relu6'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu6, inputs); -} -const relu6 = op({ relu6_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Reverses a `tf.Tensor` along a specified axis. - * - * Also available are stricter rank-specific methods that assert that `x` is - * of the given rank: - * - `tf.reverse1d` - * - `tf.reverse2d` - * - `tf.reverse3d` - * - `tf.reverse4d` - * - * Except `tf.reverse1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.reverse().print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.reverse(axis).print(); - * ``` - * @param x The input tensor to be reversed. - * @param axis The set of dimensions to reverse. Must be in the - * range [-rank(x), rank(x)). Defaults to all axes. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function reverse_(x, axis) { - const $x = convertToTensor(x, 'x', 'reverse'); - const inputs = { x: $x }; - const attrs = { dims: axis }; - return ENGINE.runKernel(Reverse, inputs, attrs); -} -const reverse = op({ reverse_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes round of input `tf.Tensor` element-wise: `round(x)`. - * It implements banker's rounding. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.round().print(); // or tf.round(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function round_(x) { - const $x = convertToTensor(x, 'x', 'round'); - const inputs = { x: $x }; - return ENGINE.runKernel(Round, inputs); -} -const round$1 = op({ round_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes reciprocal of square root of the input `tf.Tensor` element-wise: - * `y = 1 / sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.rsqrt().print(); // or tf.rsqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function rsqrt_(x) { - const $x = convertToTensor(x, 'x', 'rsqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Rsqrt, inputs); -} -const rsqrt = op({ rsqrt_ }); - -/** - * @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. - * ============================================================================= - */ -/** This is shared code across all tensor creation methods. */ -function makeTensor(values, shape, inferredShape, dtype) { - if (dtype == null) { - dtype = inferDtype(values); - } - if (dtype === 'complex64') { - throw new Error(`Cannot construct a complex64 tensor directly. ` + - `Please use tf.complex(real, imag).`); - } - if (!isTypedArray(values) && !Array.isArray(values) && - typeof values !== 'number' && typeof values !== 'boolean' && - typeof values !== 'string') { - throw new Error('values passed to tensor(values) must be a number/boolean/string or ' + - 'an array of numbers/booleans/strings, or a TypedArray'); - } - if (shape != null) { - assertNonNegativeIntegerDimensions(shape); - const providedSize = sizeFromShape(shape); - const inferredSize = sizeFromShape(inferredShape); - assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` + - `${providedSize} values but has ${inferredSize}`); - for (let i = 0; i < inferredShape.length; ++i) { - const inferred = inferredShape[i]; - const flatDimsDontMatch = i === inferredShape.length - 1 ? - inferred !== sizeFromShape(shape.slice(i)) : - true; - assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` + - `(${inferredShape}) does not match the provided ` + - `shape (${shape}). `); - } - } - if (!isTypedArray(values) && !Array.isArray(values)) { - values = [values]; - } - shape = shape || inferredShape; - values = dtype !== 'string' ? - toTypedArray(values, dtype) : - flatten(values, [], true); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype. - * - * The same functionality can be achieved with `tf.tensor`, but in general - * we recommend using `tf.scalar` as it makes the code more readable. - * - * ```js - * tf.scalar(3.14).print(); - * ``` - * - * @param value The value of the scalar. - * @param dtype The data type. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function scalar(value, dtype) { - if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) && - dtype !== 'complex64') { - throw new Error('Error creating a new Scalar: value must be a primitive ' + - '(number|boolean|string)'); - } - if (dtype === 'string' && isTypedArray(value) && - !(value instanceof Uint8Array)) { - throw new Error('When making a scalar from encoded string, ' + - 'the value must be `Uint8Array`.'); - } - const shape = []; - const inferredShape = []; - return makeTensor(value, shape, inferredShape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes scaled exponential linear element-wise. - * - * `x < 0 ? scale * alpha * (exp(x) - 1) : x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.selu().print(); // or tf.selu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function selu_(x) { - const $x = convertToTensor(x, 'x', 'selu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Selu, inputs); -} -const selu = op({ selu_ }); - -/** - * 2-D convolution with separable filters. - * - * Performs a depthwise convolution that acts separately on channels followed - * by a pointwise convolution that mixes channels. Note that this is - * separability between dimensions [1, 2] and 3, not spatial separability - * between dimensions 1 and 2. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is - * the filter used in the first step. - * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape - * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is - * the filter used in the second step. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'separableConv2d'); - const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); - const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - if (dataFormat === 'NCHW') { - throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + - 'NHWC is supported'); - } - assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` + - ` must be 1, but got ${$pointwiseFilter.shape[0]}.`); - assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` + - `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`); - const inChannels = $depthwiseFilter.shape[2]; - const channelMultiplier = $depthwiseFilter.shape[3]; - assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` + - `must be ${inChannels * channelMultiplier}, ` + - `but got ${$pointwiseFilter.shape[2]}.`); - const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); - const pointwiseStride = 1; - const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const separableConv2d = op({ separableConv2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns an element-wise indication of the sign of a number. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]); - * - * x.sign().print(); // or tf.sign(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sign_(x) { - const $x = convertToTensor(x, 'x', 'sign'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sign, inputs); -} -const sign = op({ sign_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes sin of the input Tensor element-wise: `sin(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.sin().print(); // or tf.sin(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sin_(x) { - const $x = convertToTensor(x, 'x', 'sin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sin, inputs); -} -const sin = op({ sin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.sinh().print(); // or tf.sinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sinh_(x) { - const $x = convertToTensor(x, 'x', 'sinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sinh, inputs); -} -const sinh = op({ sinh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the softmax normalized vector given the logits. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * @param logits The logits array. - * @param dim The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function softmax_(logits, dim = -1) { - const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32'); - if (dim === -1) { - dim = $logits.rank - 1; - } - if (dim !== $logits.rank - 1) { - throw Error('Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and dim was ${dim}`); - } - const inputs = { logits: $logits }; - const attrs = { dim }; - return ENGINE.runKernel(Softmax, inputs, attrs); -} -const softmax = op({ softmax_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.fft().print(); // tf.spectral.fft(x).print(); - * ``` - * @param input The complex input to compute an fft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function fft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(FFT, inputs); -} -const fft = op({ fft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Inverse fast Fourier transform. - * - * Computes the inverse 1-dimensional discrete Fourier transform over the - * inner-most dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.ifft().print(); // tf.spectral.ifft(x).print(); - * ``` - * @param input The complex input to compute an ifft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function ifft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(IFFT, inputs); -} -const ifft = op({ ifft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Inversed real value input fast Fourier transform. - * - * Computes the 1-dimensional inversed discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([0, 0, 0]); - * const x = tf.complex(real, imag); - * - * x.irfft().print(); - * ``` - * @param input The real value input to compute an irfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function irfft_(input) { - const innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let ret; - if (innerDimensionSize <= 2) { - const complexInput = reshape(input, [batch, innerDimensionSize]); - ret = ifft(complexInput); - } - else { - // The length of unique components of the DFT of a real-valued signal - // is 2 * (input_len - 1) - const outputShape = [batch, 2 * (innerDimensionSize - 1)]; - const realInput = reshape(real(input), [batch, innerDimensionSize]); - const imagInput = reshape(imag(input), [batch, innerDimensionSize]); - const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); - const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1)); - const r = concat([realInput, realConjugate], 1); - const i = concat([imagInput, imagConjugate], 1); - const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]); - ret = ifft(complexInput); - } - ret = real(ret); - // reshape the result if the input is 3D tensor. - if (input.rank === 3 && input.shape[0] !== 0) { - const temp = ret; - const batch = input.shape[0]; - ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]); - temp.dispose(); - } - return ret; -} -const irfft = op({ irfft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Splits a `tf.Tensor` into sub tensors. - * - * If `numOrSizeSplits` is a number, splits `x` along dimension `axis` - * into `numOrSizeSplits` smaller tensors. - * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`. - * - * If `numOrSizeSplits` is a number array, splits `x` into - * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the - * same size as `x` except along dimension `axis` where the size is - * `numOrSizeSplits[i]`. - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - * const [a, b] = tf.split(x, 2, 1); - * a.print(); - * b.print(); - * - * const [c, d, e] = tf.split(x, [1, 2, 1], 1); - * c.print(); - * d.print(); - * e.print(); - * ``` - * - * @param x The input tensor to split. - * @param numOrSizeSplits Either an integer indicating the number of - * splits along the axis or an array of integers containing the sizes of - * each output tensor along the axis. If a number then it must evenly divide - * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`. - * Can contain one -1 indicating that dimension is to be inferred. - * @param axis The dimension along which to split. Defaults to 0 (the first - * dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function split_(x, numOrSizeSplits, axis = 0) { - const $x = convertToTensor(x, 'x', 'split'); - const inputs = { x: $x }; - const attr = { numOrSizeSplits, axis }; - return ENGINE.runKernel(SplitV, inputs, attr); -} -const split = op({ split_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Real value input fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * - * real.rfft().print(); - * ``` - * @param input The real value input to compute an rfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function rfft_(input, fftLength) { - assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`); - let innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let adjustedInput; - if (fftLength != null && fftLength < innerDimensionSize) { - // Need to crop - const begin = input.shape.map(v => 0); - const size = input.shape.map(v => v); - size[input.shape.length - 1] = fftLength; - adjustedInput = slice(input, begin, size); - innerDimensionSize = fftLength; - } - else if (fftLength != null && fftLength > innerDimensionSize) { - // Need to pad with zeros - const zerosShape = input.shape.map(v => v); - zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize; - adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1); - innerDimensionSize = fftLength; - } - else { - adjustedInput = input; - } - // Complement the input with zero imaginary numbers. - const zerosInput = zerosLike(adjustedInput); - const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]); - const ret = fft(complexInput); - // Exclude complex conjugations. These conjugations are put symmetrically. - const half = Math.floor(innerDimensionSize / 2) + 1; - const realValues = real(ret); - const imagValues = imag(ret); - const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1); - const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1); - const outputShape = adjustedInput.shape.slice(); - outputShape[adjustedInput.shape.length - 1] = half; - return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape); -} -const rfft = op({ rfft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.sqrt().print(); // or tf.sqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sqrt_(x) { - const $x = convertToTensor(x, 'x', 'sqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sqrt, inputs); -} -const sqrt = op({ sqrt_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns (a - b) * (a - b) element-wise. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * ```js - * // Broadcast squared difference a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function squaredDifference_(a, b) { - let $a = convertToTensor(a, 'a', 'squaredDifference'); - let $b = convertToTensor(b, 'b', 'squaredDifference'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - const attrs = {}; - return ENGINE.runKernel(SquaredDifference, inputs, attrs); -} -const squaredDifference = op({ squaredDifference_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Removes dimensions of size 1 from the shape of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]); - * x.squeeze().print(); - * ``` - * - * @param x The input tensor to be squeezed. - * @param axis An optional list of numbers. If specified, only - * squeezes the dimensions listed. The dimension index starts at 0. It - * is an error to squeeze a dimension that is not 1. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function squeeze_(x, axis) { - const $x = convertToTensor(x, 'x', 'squeeze'); - return reshape($x, squeezeShape($x.shape, axis).newShape); -} -const squeeze = op({ squeeze_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.stack([a, b, c]).print(); - * ``` - * - * @param tensors A list of tensor objects with the same shape and dtype. - * @param axis The axis to stack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function stack_(tensors, axis = 0) { - const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric'); - assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack'); - if ($tensors.length > 0) { - assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor'); - } - const inputs = $tensors; - const attrs = { axis }; - return ENGINE.runKernel(Pack, inputs, attrs); -} -const stack = op({ stack_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x` - * - * ```js - * const x = tf.tensor1d([0, 2, -1, -3]); - * - * x.step(.5).print(); // or tf.step(x, .5) - * ``` - * @param x The input tensor. - * @param alpha The gradient when input is negative. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function step_(x, alpha = 0.0) { - const $x = convertToTensor(x, 'x', 'step'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(Step, inputs, attrs); -} -const step = op({ step_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Extracts a strided slice of a tensor. - * - * Roughly speaking, this op extracts a slice of size (end-begin)/stride from - * the given input tensor (x). Starting at the location specified by begin the - * slice continues by adding stride to the index until all dimensions are not - * less than end. Note that a stride can be negative, which causes a reverse - * slice. - * - * ```js - * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6], - * [3, 2, 3]); - * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]] - * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3], - * // [4, 4, 4]]] - * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4], - * // [3, 3, 3]]] - * ``` - * - * @param x The tensor to stride slice. - * @param begin The coordinates to start the slice from. - * @param end: The coordinates to end the slice at. - * @param strides: The size of the slice. - * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param endMask: If the ith bit of endMask is set, end[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param shrinkAxisMask: a bitmask where bit i implies that - * the ith specification should shrink the dimensionality. begin and end must - * imply a slice of size 1 in the dimension. - * - * @doc {heading: 'Operations', subheading: 'Slicing and Joining'} - */ -function stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { - const $x = convertToTensor(x, 'x', 'stridedSlice'); - const inputs = { x: $x }; - const attrs = { - begin, - end, - strides, - beginMask, - endMask, - ellipsisMask, - newAxisMask, - shrinkAxisMask - }; - return ENGINE.runKernel(StridedSlice, inputs, attrs); -} -const stridedSlice = op({ stridedSlice_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes tan of the input `tf.Tensor` element-wise, `tan(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.tan().print(); // or tf.tan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function tan_(x) { - const $x = convertToTensor(x, 'x', 'tan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tan, inputs); -} -const tan = op({ tan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Finds the values and indices of the `k` largest entries along the last - * dimension. - * - * If the input is a vector (rank=1), finds the k largest entries in the vector - * and outputs their values and indices as vectors. Thus values[j] is the j-th - * largest entry in input, and its index is indices[j]. - * For higher rank inputs, computes the top k entries along the last dimension. - * - * If two elements are equal, the lower-index element appears first. - * - * ```js - * const a = tf.tensor2d([[1, 5], [4, 3]]); - * const {values, indices} = tf.topk(a); - * values.print(); - * indices.print(); - * ``` - * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`. - * @param k Number of top elements to look for along the last dimension. - * @param sorted If true, the resulting `k` elements will be sorted by the - * values in descending order. - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ -function topk_(x, k = 1, sorted = true) { - const $x = convertToTensor(x, 'x', 'topk'); - if ($x.rank === 0) { - throw new Error('topk() expects the input to be of rank 1 or higher'); - } - const lastDim = $x.shape[$x.shape.length - 1]; - if (k > lastDim) { - throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` + - `but got ${k}`); - } - const inputs = { x: $x }; - const attrs = { k, sorted }; - const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs); - return { values, indices }; -} -const topk = op({ topk_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Finds unique elements along an axis of a tensor. - * - * It returns a tensor `values` containing all of the unique elements along the - * `axis` of the given tensor `x` in the same order that they occur along the - * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor - * `indices` the same size as the number of the elements in `x` along the `axis` - * dimension. It contains the index in the unique output `values`. - * - * ```js - * // A 1-D tensor - * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]); - * const {values, indices} = tf.unique(a); - * values.print(); // [1, 2, 4, 7, 8,] - * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4] - * ``` - * - * ```js - * // A 2-D tensor with axis=0 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 0) - * values.print(); // [[1, 0, 0], - * // [2, 0, 0]] - * indices.print(); // [0, 0, 1] - * ``` - * - * ```js - * // A 2-D tensor with axis=1 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 1) - * values.print(); // [[1, 0], - * // [1, 0], - * // [2, 0]] - * indices.print(); // [0, 1, 1] - * ``` - * @param x A tensor (int32, string, bool). - * @param axis The axis of the tensor to find the unique elements. - * @returns [uniqueElements, indices] (see above for details) - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ -function unique_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric'); - assert($x.rank > 0, () => 'The input tensor must be at least 1D'); - const inputs = { x: $x }; - const attrs = { axis }; - const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs); - return { values, indices }; -} -const unique = op({ unique_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the sum along segments of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32'); - * const numSegments = 3; - * - * x.unsortedSegmentSum(segmentIds, numSegments).print() - * //or tf.unsortedSegmentSum(x, segmentIds, numSegments) - * ``` - * @param x The `tf.Tensor` that will be summed along its segments. - * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s - * dimension along the `axis`. Maps each element of `x` to a segment. - * @param numSegments The number of distinct `segmentIds`. - * - * @doc {heading: 'Operations', subheading: 'Segment'} - */ -function unsortedSegmentSum_(x, segmentIds, numSegments) { - const $x = convertToTensor(x, 'x', 'unsortedSegmentSum'); - const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); - assert(isInt(numSegments), () => 'numSegments must be of dtype int'); - const inputs = { x: $x, segmentIds: $segmentIds }; - const attrs = { numSegments }; - return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs); -} -const unsortedSegmentSum = op({ unsortedSegmentSum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * tf.unstack(a).forEach(tensor => tensor.print()); - * ``` - * - * @param x A tensor object. - * @param axis The axis to unstack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function unstack_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric'); - assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); - const inputs = { value: $x }; - const attrs = { axis }; - return ENGINE.runKernel(Unpack, inputs, attrs); -} -const unstack = op({ unstack_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`. - * - * The returned `tf.Tensor`'s dimension `i` will correspond to the input - * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`, - * where `n` is the rank of the input `tf.Tensor`. Hence by default, this - * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); - * - * a.transpose().print(); // or tf.transpose(a) - * ``` - * - * @param x The tensor to transpose. - * @param perm The permutation of the dimensions of a. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function transpose_(x, perm) { - const $x = convertToTensor(x, 'x', 'transpose'); - if (perm == null) { - perm = $x.shape.map((s, i) => i).reverse(); - } - assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of perm ${perm}.`); - perm.forEach(axis => { - assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` + - ` but got ${perm}`); - }); - if ($x.rank <= 1) { - return $x.clone(); - } - const inputs = { x: $x }; - const attrs = { perm }; - return ENGINE.runKernel(Transpose, inputs, attrs); -} -const transpose = op({ transpose_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the norm of scalar, vectors, and matrices. - * This function can compute several different vector norms (the 1-norm, the - * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) - * and matrix norms (Frobenius, 1-norm, and inf-norm). - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.norm().print(); // or tf.norm(x) - * ``` - * - * @param x The input array. - * @param ord Optional. Order of the norm. Supported norm types are - * following: - * - * | ord | norm for matrices | norm for vectors - * |------------|---------------------------|--------------------- - * |'euclidean' |Frobenius norm |2-norm - * |'fro' |Frobenius norm | - * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x)) - * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x)) - * |1 |max(sum(abs(x), axis=0)) |sum(abs(x)) - * |2 | |sum(abs(x)^2)^1/2* - * - * @param axis Optional. If axis is null (the default), the input is - * considered a vector and a single vector norm is computed over the entire - * set of values in the Tensor, i.e. norm(x, ord) is equivalent - * to norm(x.reshape([-1]), ord). If axis is a integer, the input - * is considered a batch of vectors, and axis determines the axis in x - * over which to compute vector norms. If axis is a 2-tuple of integer it is - * considered a batch of matrices and axis determines the axes in NDArray - * over which to compute a matrix norm. - * @param keepDims Optional. If true, the norm have the same dimensionality - * as the input. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function norm_(x, ord = 'euclidean', axis = null, keepDims = false) { - x = convertToTensor(x, 'x', 'norm'); - const norm = normImpl(x, ord, axis); - let keepDimsShape = norm.shape; - if (keepDims) { - const axes = parseAxisParam(axis, x.shape); - keepDimsShape = expandShapeToKeepDim(norm.shape, axes); - } - return reshape(norm, keepDimsShape); -} -function normImpl(x, p, axis = null) { - if (x.rank === 0) { - return abs(x); - } - // consider vector when no axis is specified - if (x.rank !== 1 && axis === null) { - return normImpl(reshape(x, [-1]), p, axis); - } - // vector - if (x.rank === 1 || typeof axis === 'number' || - Array.isArray(axis) && axis.length === 1) { - if (p === 1) { - return sum(abs(x), axis); - } - if (p === Infinity) { - return max(abs(x), axis); - } - if (p === -Infinity) { - return min(abs(x), axis); - } - if (p === 'euclidean' || p === 2) { - // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2 - return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - // matrix (assumption axis[0] < axis[1]) - if (Array.isArray(axis) && axis.length === 2) { - if (p === 1) { - return max(sum(abs(x), axis[0]), axis[1] - 1); - } - if (p === Infinity) { - return max(sum(abs(x), axis[1]), axis[0]); - } - if (p === -Infinity) { - return min(sum(abs(x), axis[1]), axis[0]); - } - if (p === 'fro' || p === 'euclidean') { - // norm(x) = sqrt(sum(pow(x, 2))) - return sqrt(sum(square(x), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - throw new Error(`Error in norm: invalid axis: ${axis}`); -} -const norm = op({ norm_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the filter of a 2D convolution. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed. - * @param dy The dy image, of rank 4 or rank 3, of shape - * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed. - * @param filterShape The shape of the filter, length 4, - * [filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` + - `${x4D.shape}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` + - `${dy4D.shape}.`); - assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` + - `${filterShape}.`); - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` + - `match input depth in filter (${filterShape[2]}.`); - assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` + - `match output depth for filter (${filterShape[3]}).`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs); -} -const conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dimRoundingMode, dilations, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs); -} -const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) { - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape }; - const res = - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Bilinear resize a single 3D image or a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to `false`. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers - * are at 0.5, which would make the floating point coordinates of the top - * left pixel 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ -function resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeBilinear'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` + - `${size}.`); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const resizeBilinear = op({ resizeBilinear_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * NearestNeighbor resize a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to False. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of - * half the actual dimensions, and yields more accurate resizes. This flag - * would also make the floating point coordinates of the top left pixel - * 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ -function resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` + - `${size}.`); - assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype'); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const resizeNearestNeighbor = op({ resizeNearestNeighbor_ }); - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.abs = function () { - this.throwIfDisposed(); - return abs(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.acos = function () { - this.throwIfDisposed(); - return acos(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.acosh = function () { - this.throwIfDisposed(); - return acosh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.add = function (b) { - this.throwIfDisposed(); - return add$1(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.all = function (axis, keepDims) { - this.throwIfDisposed(); - return all(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.any = function (axis, keepDims) { - this.throwIfDisposed(); - return any(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.argMax = function (axis) { - this.throwIfDisposed(); - return argMax(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.argMin = function (axis) { - this.throwIfDisposed(); - return argMin(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Converts a size-1 `tf.Tensor` to a `tf.Scalar`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.asScalar = function () { - this.throwIfDisposed(); - assert(this.size === 1, () => 'The array must have only 1 element.'); - return reshape(this, []); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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 (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Converts a `tf.Tensor` to a `tf.Tensor1D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as1D = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns) { - this.throwIfDisposed(); - return reshape(this, [rows, columns]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth, depth2) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth, depth2, depth3) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2, depth3]); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.asin = function () { - this.throwIfDisposed(); - return asin(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.asinh = function () { - this.throwIfDisposed(); - return asinh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atan = function () { - this.throwIfDisposed(); - return atan(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atan2 = function (b) { - this.throwIfDisposed(); - return atan2(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atanh = function () { - this.throwIfDisposed(); - return atanh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.avgPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) { - this.throwIfDisposed(); - return batchToSpaceND(this, blockShape, crops); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) { - this.throwIfDisposed(); - return batchNorm(this, mean, variance, offset, scale, varianceEpsilon); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.broadcastTo = function (shape) { - this.throwIfDisposed(); - return broadcastTo(this, shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cast = function (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.ceil = function () { - this.throwIfDisposed(); - return ceil(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.clipByValue = function (min, max) { - this.throwIfDisposed(); - return clipByValue(this, min, max); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.concat = function (x, axis) { - this.throwIfDisposed(); - if (x instanceof Tensor) { - x = [x]; - } - return concat([this, ...x], axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { - this.throwIfDisposed(); - return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv2dTranspose = - function (filter, outputShape, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cos = function () { - this.throwIfDisposed(); - return cos(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cosh = function () { - this.throwIfDisposed(); - return cosh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) { - this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) { - this.throwIfDisposed(); - return depthToSpace(this, blockSize, dataFormat); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.depthwiseConv2d = - function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.dilation2d = - function (filter, strides, pad, dilations, dataFormat) { - this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad, dilations, dataFormat); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.divNoNan = function (b) { - this.throwIfDisposed(); - return divNoNan(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.div = function (b) { - this.throwIfDisposed(); - return div(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.dot = function (b) { - this.throwIfDisposed(); - return dot(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.elu = function () { - this.throwIfDisposed(); - return elu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.equal = function (b) { - this.throwIfDisposed(); - return equal(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.erf = function () { - this.throwIfDisposed(); - return erf(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.exp = function () { - this.throwIfDisposed(); - return exp(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.expandDims = function (axis) { - this.throwIfDisposed(); - return expandDims(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.expm1 = function () { - this.throwIfDisposed(); - return expm1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.fft = function () { - this.throwIfDisposed(); - return fft(this); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Flatten a Tensor to a 1D array. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.flatten = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.floor = function () { - this.throwIfDisposed(); - return floor(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.floorDiv = function (b) { - this.throwIfDisposed(); - return floorDiv(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.gather = function (indices, axis) { - this.throwIfDisposed(); - return gather(this, indices, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.greaterEqual = function (b) { - this.throwIfDisposed(); - return greaterEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.greater = function (b) { - this.throwIfDisposed(); - return greater(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.ifft = function () { - this.throwIfDisposed(); - return ifft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.irfft = function () { - this.throwIfDisposed(); - return irfft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isFinite = function () { - this.throwIfDisposed(); - return isFinite$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isInf = function () { - this.throwIfDisposed(); - return isInf(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isNaN = function () { - this.throwIfDisposed(); - return isNaN$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.leakyRelu = function (alpha) { - this.throwIfDisposed(); - return leakyRelu(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.lessEqual = function (b) { - this.throwIfDisposed(); - return lessEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.less = function (b) { - this.throwIfDisposed(); - return less(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.localResponseNormalization = - function (depthRadius, bias, alpha, beta) { - this.throwIfDisposed(); - return localResponseNormalization(this, depthRadius, bias, alpha, beta); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSigmoid = function () { - this.throwIfDisposed(); - return logSigmoid(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSoftmax = function (axis) { - this.throwIfDisposed(); - return logSoftmax(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) { - this.throwIfDisposed(); - return logSumExp(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.log = function () { - this.throwIfDisposed(); - return log(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.log1p = function () { - this.throwIfDisposed(); - return log1p(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalAnd = function (b) { - this.throwIfDisposed(); - return logicalAnd(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalNot = function () { - this.throwIfDisposed(); - return logicalNot(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalOr = function (b) { - this.throwIfDisposed(); - return logicalOr(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalXor = function (b) { - this.throwIfDisposed(); - return logicalXor(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) { - this.throwIfDisposed(); - return matMul(this, b, transposeA, transposeB); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.maxPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.max = function (axis, keepDims) { - this.throwIfDisposed(); - return max(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.maximum = function (b) { - this.throwIfDisposed(); - return maximum(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mean = function (axis, keepDims) { - this.throwIfDisposed(); - return mean(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.min = function (axis, keepDims) { - this.throwIfDisposed(); - return min(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.minimum = function (b) { - this.throwIfDisposed(); - return minimum(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) { - this.throwIfDisposed(); - return mirrorPad(this, paddings, mode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mod = function (b) { - this.throwIfDisposed(); - return mod(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mul = function (b) { - this.throwIfDisposed(); - return mul(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.neg = function () { - this.throwIfDisposed(); - return neg(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) { - this.throwIfDisposed(); - return norm(this, ord, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.notEqual = function (b) { - this.throwIfDisposed(); - return notEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) { - this.throwIfDisposed(); - return oneHot(this, depth, onValue, offValue); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.onesLike = function () { - this.throwIfDisposed(); - return onesLike(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pad = function (paddings, constantValue) { - this.throwIfDisposed(); - return pad(this, paddings, constantValue); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) { - this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pow = function (exp) { - this.throwIfDisposed(); - return pow(this, exp); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.prelu = function (alpha) { - this.throwIfDisposed(); - return prelu(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.prod = function (axis, keepDims) { - this.throwIfDisposed(); - return prod(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reciprocal = function () { - this.throwIfDisposed(); - return reciprocal(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.relu = function () { - this.throwIfDisposed(); - return relu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.relu6 = function () { - this.throwIfDisposed(); - return relu6(this); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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) { - this.throwIfDisposed(); - return reshape(this, x.shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reshape = function (shape) { - this.throwIfDisposed(); - return reshape(this, shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.resizeBilinear = - function (newShape2D, alignCorners, halfPixelCenters) { - this.throwIfDisposed(); - return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.resizeNearestNeighbor = - function (newShape2D, alignCorners, halfFloatCenters) { - this.throwIfDisposed(); - return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reverse = function (axis) { - this.throwIfDisposed(); - return reverse(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.rfft = function () { - this.throwIfDisposed(); - return rfft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.round = function () { - this.throwIfDisposed(); - return round$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.rsqrt = function () { - this.throwIfDisposed(); - return rsqrt(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.selu = function () { - this.throwIfDisposed(); - return selu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.separableConv2d = - function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { - this.throwIfDisposed(); - return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sigmoid = function () { - this.throwIfDisposed(); - return sigmoid(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sign = function () { - this.throwIfDisposed(); - return sign(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sin = function () { - this.throwIfDisposed(); - return sin(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sinh = function () { - this.throwIfDisposed(); - return sinh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.slice = function (begin, size) { - this.throwIfDisposed(); - return slice(this, begin, size); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.softmax = function (dim) { - this.throwIfDisposed(); - return softmax(this, dim); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.softplus = function () { - this.throwIfDisposed(); - return softplus(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) { - this.throwIfDisposed(); - return spaceToBatchND(this, blockShape, paddings); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) { - this.throwIfDisposed(); - return split(this, numOrSizeSplits, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sqrt = function () { - this.throwIfDisposed(); - return sqrt(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.square = function () { - this.throwIfDisposed(); - return square(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.squaredDifference = function (b) { - this.throwIfDisposed(); - return squaredDifference(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.squeeze = function (axis) { - this.throwIfDisposed(); - return squeeze(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.stack = function (x, axis) { - this.throwIfDisposed(); - const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x]; - return stack(tensorsToBeStacked, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.step = function (alpha) { - this.throwIfDisposed(); - return step(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { - this.throwIfDisposed(); - return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sub = function (b) { - this.throwIfDisposed(); - return sub(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sum = function (axis, keepDims) { - this.throwIfDisposed(); - return sum(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tan = function () { - this.throwIfDisposed(); - return tan(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tanh = function () { - this.throwIfDisposed(); - return tanh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tile = function (reps) { - this.throwIfDisposed(); - return tile(this, reps); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `bool` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toBool = function () { - this.throwIfDisposed(); - return cast(this, 'bool'); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `float32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toFloat = function () { - this.throwIfDisposed(); - return cast(this, 'float32'); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `int32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toInt = function () { - this.throwIfDisposed(); - return cast(this, 'int32'); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.topk = function (k, sorted) { - this.throwIfDisposed(); - return topk(this, k, sorted); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.transpose = function (perm) { - this.throwIfDisposed(); - return transpose(this, perm); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unique = function (axis) { - this.throwIfDisposed(); - return unique(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unsortedSegmentSum = - function (segmentIds, numSegments) { - this.throwIfDisposed(); - return unsortedSegmentSum(this, segmentIds, numSegments); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unstack = function (axis) { - this.throwIfDisposed(); - return unstack(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.where = function (condition, x) { - this.throwIfDisposed(); - return where(condition, this, x); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.zerosLike = function () { - this.throwIfDisposed(); - return zerosLike(this); -}; - -/** - * @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. - * ============================================================================= - */ -const absGradConfig = { - kernelName: Abs, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, step(cast(x, 'float32'), -1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const acosGradConfig = { - kernelName: Acos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = square(cast(x, 'float32')); - const b = sqrt(sub(scalar(1), a)); - return neg(div(dy, b)); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const acoshGradConfig = { - kernelName: Acosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(sub(square(cast(x, 'float32')), 1)); - return div(dy, a); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const addGradConfig = { - kernelName: Add, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const addNGradConfig = { - kernelName: AddN, - saveAllInputs: true, - gradFunc: (dy, saved) => { - const ders = {}; - saved.forEach((_, i) => { - ders[i] = () => dy.clone(); - }); - return ders; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 argMaxGradConfig = { - kernelName: ArgMax, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 argMinGradConfig = { - kernelName: ArgMin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const asinGradConfig = { - kernelName: Asin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const asinhGradConfig = { - kernelName: Asinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(add$1(scalar(1), square(cast(x, 'float32')))); - return div(dy, a); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atan2GradConfig = { - kernelName: Atan2, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const d = add$1(square(a), square(b)); - let res = mul(dy, div(b, d)); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - const d = add$1(square(a), square(b)); - let res = neg(mul(dy, div(a, d))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atanGradConfig = { - kernelName: Atan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(square(cast(x, 'float32')), 1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atanhGradConfig = { - kernelName: Atanh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 3d avg pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank4 of shape - * [batchSize, depth, height, width, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad'); - const $input = convertToTensor(input, 'input', 'avgPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const avgPool3dGrad = op({ avgPool3dGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const avgPool3DGradConfig = { - kernelName: AvgPool3D, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of an 2D avg pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The input image, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ -function avgPoolGrad_(dy, input, filterSize, strides, pad) { - const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad'); - const $input = convertToTensor(input, 'input', 'avgPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); - let input4D = $input; - let dy4D = $dy; - let reshapedTo4D = false; - if ($input.rank === 3) { - reshapedTo4D = true; - input4D = - reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]); - dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]); - } - assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` + - `${dy4D.rank}.`); - assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` + - `${input4D.rank}.`); - const inputs = { dy: dy4D, input: input4D }; - const attrs = { filterSize, strides, pad }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const avgPoolGrad = op({ avgPoolGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const avgPoolGradConfig = { - kernelName: AvgPool, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad } = attrs; - return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const batchMatMulGradConfig = { - kernelName: BatchMatMul, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved, attrs) => { - const [a, b] = saved; - const { transposeA, transposeB } = attrs; - if (!transposeA && !transposeB) { - return { - a: () => matMul(dy, b, false, true), - b: () => matMul(a, dy, true, false) - }; - } - else if (!transposeA && transposeB) { - return { - a: () => matMul(dy, b, false, false), - b: () => matMul(dy, a, true, false) - }; - } - else if (transposeA && !transposeB) { - return { - a: () => matMul(b, dy, false, true), - b: () => matMul(a, dy, false, false) - }; - } - else { - return { - a: () => matMul(b, dy, true, true), - b: () => matMul(dy, a, true, true) - }; - } - } -}; - -/** - * @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. - * ============================================================================= - */ -const batchToSpaceNDGradConfig = { - kernelName: BatchToSpaceND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, crops } = attrs; - return { x: () => spaceToBatchND(dy, blockShape, crops) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const broadcastToGradConfig = { - kernelName: BroadcastTo, - gradFunc: (dy, saved, attrs) => { - const broadCastToAttrs = attrs; - const inputShape = broadCastToAttrs.inputShape; - const outputShape = broadCastToAttrs.shape; - const reps = Array.from(outputShape); - for (let i = inputShape.length - 1; i >= 0; i--) { - if (inputShape[i] === outputShape[i]) { - reps[i] = 1; - } - else if (inputShape[i] !== 1) { - throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); - } - } - const axes = []; - for (let i = 0; i < reps.length; i++) { - if (reps[i] > 1) { - axes.push(i); - } - } - return { x: () => sum(dy, axes, true /* keepDims */) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const castGradConfig = { - kernelName: Cast, - gradFunc: (dy) => { - return { x: () => dy.clone() }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const ceilGradConfig = { - kernelName: Ceil, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports it. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const clipByValueGradConfig = { - kernelName: ClipByValue, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { clipValueMin, clipValueMax } = attrs; - return { - x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)), - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const complexAbsGradConfig = { - kernelName: ComplexAbs, - inputsToSave: ['x'], - gradFunc: absGradConfig.gradFunc, -}; - -/** - * @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. - * ============================================================================= - */ -const concatGradConfig = { - kernelName: Concat, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const shapes = saved.map(t => t.shape); - const { axis } = attrs; - const $axis = parseAxisParam(axis, saved[0].shape)[0]; - const sizeSplits = shapes.map(s => s[$axis]); - const derTensors = split(dy, sizeSplits, $axis); - return derTensors.map(t => () => t); - } -}; - -/** - * @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. - * ============================================================================= - */ -const conv2DGradConfig = { - kernelName: Conv2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x4D, $filter] = saved; - const { dilations, strides, pad, dataFormat } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' + - `are not yet supported in gradients. Got dilations '${dilations}'`); - return { - x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat), - filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const conv2DBackpropInputGradConfig = { - kernelName: Conv2DBackpropInput, - inputsToSave: ['dy', 'filter'], - gradFunc: (ddx, saved, attrs) => { - const [dy, filter] = saved; - const { strides, pad, dataFormat, dimRoundingMode } = attrs; - return { - dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode), - filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the filter of a 3D convolution. - * - * @param x The input tensor, of rank 5 or rank 4 of shape - * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is - * assumed. - * @param dy The dy image, of rank 5 or rank 4, of shape - * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is - * assumed. - * @param filterShape The shape of the filter, length 5, - * [filterDepth, filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideDepth, strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ -function conv3DBackpropFilter_(x, dy, filterShape, strides, pad) { - let x5D = x; - if (x.rank === 4) { - x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); - } - let dy5D = dy; - if (dy5D.rank === 4) { - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - } - assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` + - `${x5D.shape}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` + - `${dy5D.shape}.`); - assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` + - `${filterShape}.`); - assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` + - `match input depth in filter (${filterShape[3]}.`); - assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` + - `match output depth for filter (${filterShape[4]}).`); - const inputs = { x: x5D, dy: dy5D }; - const attrs = { strides, pad, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs); -} -const conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -const conv3DGradConfig = { - kernelName: Conv3D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' + - `not yet supported in gradients. Got dilations '${dilations}'`); - const [x5D, $filter] = saved; - return { - x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad), - filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const cosGradConfig = { - kernelName: Cos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const coshGradConfig = { - kernelName: Cosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(sinh(cast(x, 'float32')), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const cumsumGradConfig = { - kernelName: Cumsum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis, exclusive, reverse } = attrs; - return { - x: () => { - const permutation = getAxesPermutation([axis], x.rank); - let out = cumsum(dy, axis, exclusive, !reverse); - if (permutation != null) { - out = transpose(out, permutation); - } - return out; - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const depthwiseConv2dNativeGradConfig = { - kernelName: DepthwiseConv2dNative, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad, dimRoundingMode } = attrs; - const $dilations = dilations == null ? [1, 1] : dilations; - assert(tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' + - `greater than 1 are not yet supported. Got dilations ` + - `'${$dilations}'`); - const [x, filter] = saved; - assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` + - `rank 4, but got rank ${x.rank}.`); - assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` + - `rank 4, but got rank ${filter.rank}.`); - assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` + - `channels (${x.shape[3]}) must match the inChannels dimension ` + - `in filter ${filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' + - `dilations must be 1. Got strides ${strides} and dilations ` + - `'${$dilations}'.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - return { - x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode), - filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode), - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const dilation2dGradConfig = { - kernelName: Dilation2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x, filter] = saved; - const inputInputs = { x, filter, dy }; - const filterInputs = { x, filter, dy }; - return { - x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs), - filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const eluGradConfig = { - kernelName: Elu, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - const inputs = { dy, y }; - return { x: () => ENGINE.runKernel(EluGrad, inputs) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const erfGradConfig = { - kernelName: Erf, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI)); - return { x: () => mul(dy, a) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expGradConfig = { - kernelName: Exp, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, y) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expandDimsGradConfig = { - kernelName: ExpandDims, - inputsToSave: ['input'], - gradFunc: (dy, saved) => { - const [input] = saved; - return { input: () => reshape(dy, input.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expm1GradConfig = { - kernelName: Expm1, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, exp(x)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const floorGradConfig = { - kernelName: Floor, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const floorDivGradConfig = { - kernelName: FloorDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const fusedBatchNormGradConfig = { - kernelName: FusedBatchNorm, - inputsToSave: ['x', 'mean', 'variance', 'scale'], - gradFunc: (dy, saved, attrs) => { - const { varianceEpsilon } = attrs; - const [x, mean, variance, scale] = saved; - const scaleValue = scale == null ? scalar(1) : scale; - const reductionAxes = getReductionAxes(mean.shape, x.shape); - const tileShape = []; - if (mean.rank === 1) { - for (let i = 0; i < x.shape.length - 1; ++i) { - tileShape.push(x.shape[i]); - } - tileShape.push(1); - } - const xMinusMean = sub(x, mean); - const dyTimesScaleValue = mul(dy, scaleValue); - const oneOverSqrtVariance = rsqrt(add$1(variance, scalar(varianceEpsilon))); - const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); - const derX = () => { - if (mean.rank === 1) { - return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape); - } - else { - return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); - } - }; - const derMean = () => { - let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); - if (mean.rank === 1) { - meanDer = sum(meanDer, reductionAxes); - } - return reshape(meanDer, mean.shape); - }; - const derVariance = () => { - let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); - if (mean.rank === 1) { - varianceDer = sum(varianceDer, reductionAxes); - } - return reshape(varianceDer, mean.shape); - }; - const derScale = () => { - const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); - let scaleDer = mul(dy, xMinusMean2TimesRsqrt); - if (mean.rank === 1) { - scaleDer = sum(scaleDer, reductionAxes); - } - return reshape(scaleDer, mean.shape); - }; - const derOffset = () => { - let offsetDer = dy; - if (mean.rank === 1) { - offsetDer = sum(offsetDer, reductionAxes); - } - return reshape(offsetDer, mean.shape); - }; - return { - x: derX, - mean: derMean, - variance: derVariance, - scale: derScale, - offset: derOffset - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const gatherGradConfig = { - kernelName: GatherV2, - inputsToSave: ['x', 'indices'], - gradFunc: (dy, saved, attrs) => { - const [x, indices] = saved; - const { axis } = attrs; - const parsedAxis = parseAxisParam(axis, x.shape)[0]; - const derX = () => { - const paramsShape = x.shape; - const indicesSize = indices.size; - const outerShape = paramsShape.slice(0, parsedAxis); - const outerDims = outerShape.length; - const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); - const innerDims = innerShape.length; - const outerAxesIndices = arrayRange(0, outerDims); - const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); - const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); - const values = reshape(dy, valuesShape); - const reshapedIndices = reshape(indices, [indicesSize]); - const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); - const valuesTranspose = transpose(values, transposeDims); - let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]); - const invertTransposeDims = getUndoAxesPermutation(transposeDims); - paramsGrad = transpose(paramsGrad, invertTransposeDims); - return paramsGrad; - }; - return { x: derX, indices: () => indices }; - } -}; -function arrayRange(start, stop) { - const result = []; - for (let i = start; i < stop; ++i) { - result.push(i); - } - return result; -} -function arrayConcat(arrays) { - const result = []; - for (let i = 0; i < arrays.length; ++i) { - for (let j = 0; j < arrays[i].length; ++j) { - result.push(arrays[i][j]); - } - } - return result; -} - -/** - * @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. - * ============================================================================= - */ -const greaterEqualGradConfig = { - kernelName: GreaterEqual, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - return { a: () => zerosLike(a), b: () => zerosLike(b) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const identityGradConfig = { - kernelName: Identity, - gradFunc: (dy) => { - return { x: () => cast(dy, 'float32') }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isFiniteGradConfig = { - kernelName: IsFinite, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isInfGradConfig = { - kernelName: IsInf, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isNanGradConfig = { - kernelName: IsNan, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const leakyReluGradConfig = { - kernelName: LeakyRelu, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { alpha } = attrs; - const mask = greater(x, 0); - // Returns `gradients * (features > 0) + alpha * gradients * (features <= - // 0)`. - return { x: () => where(mask, dy, mul(dy, alpha)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const log1pGradConfig = { - kernelName: Log1p, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(x, 1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const logGradConfig = { - kernelName: Log, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, cast(x, 'float32')) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const logSoftmaxGradConfig = { - kernelName: LogSoftmax, - inputsToSave: [], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [value] = saved; - const { axis } = attrs; - return { - logits: () => { - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -function localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const inputs = { x, y, dy }; - const attrs = { depthRadius, bias, alpha, beta }; - return ENGINE.runKernel(LRNGrad, inputs, attrs); -} -const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ }); - -/** - * @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. - * ============================================================================= - */ -const lrnGradConfig = { - kernelName: LRN, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { depthRadius, bias, alpha, beta } = attrs; - return { - x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Gradient helper function for the min and max operations. - */ -function gradForMinAndMax(dy, y, xOrig, origAxes) { - if (y.rank < xOrig.rank) { - y = reshape(y, expandShapeToKeepDim(y.shape, origAxes)); - } - if (dy.rank < xOrig.rank) { - dy = reshape(dy, expandShapeToKeepDim(dy.shape, origAxes)); - } - return { - x: () => { - const dx = mul(dy, cast(equal(xOrig, y), dy.dtype)); - return dx; - } - }; -} - -/** - * @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. - * ============================================================================= - */ -const maxGradConfig = { - kernelName: Max, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const maxAttrs = attrs; - const { reductionIndices } = maxAttrs; - const x = saved[0]; - const y = saved[1]; - const origAxes = parseAxisParam(reductionIndices, x.shape); - const maxGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return maxGrad['x'](); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const maximumGradConfig = { - kernelName: Maximum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(less(a, b), 'float32')); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 3d max pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank 4 of shape - * [batchSize, depth, height, width, channels]. - * @param output The original output image, of rank 5 of shape - * [batchSize, outDepth, outHeight, outWidth, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad'); - const $input = convertToTensor(input, 'input', 'maxPool3dGrad'); - const $output = convertToTensor(output, 'output', 'maxPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let output5D = $output; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - output5D = reshape($output, [ - 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` + - `${output5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D, output: output5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const maxPool3dGrad = op({ maxPool3dGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const maxPool3DGradConfig = { - kernelName: MaxPool3D, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 2D max pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The original input image, of rank 4, of shape - * [batchSize, height, width, channels]. - * @param output The original output image, of rank 4, of shape - * [batchSize, outHeight, outWidth, channels]. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad'); - const $input = convertToTensor(input, 'input', 'maxPoolGrad'); - const $output = convertToTensor(output, 'output', 'maxPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` + - `(${$dy.rank})`); - assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` + - `${$dy.rank}.`); - assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` + - `${$input.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: $dy, input: $input, output: $output }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(MaxPoolGrad, inputs, attrs); -} -const maxPoolGrad = op({ maxPoolGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const maxPoolGradConfig = { - kernelName: MaxPool, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad } = attrs; - return { - x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const meanGradConfig = { - kernelName: Mean, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - const shapes = computeOutAndReduceShapes(x.shape, axes); - const reduceShape = shapes[1]; - const reduceSize = sizeFromShape(reduceShape); - const derX = () => { - const expandedDyShape = x.shape.slice(); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const res = div(mul(expandedDy, ones$1(x.shape, 'float32')), reduceSize); - return res; - }; - return { x: derX }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const minGradConfig = { - kernelName: Min, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const minAttrs = attrs; - const { axis } = minAttrs; - const [x, y] = saved; - const origAxes = parseAxisParam(axis, x.shape); - const minGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return minGrad['x'](); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const minimumGradConfig = { - kernelName: Minimum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(lessEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(greater(a, b), 'float32')); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const mirrorPadGradConfig = { - kernelName: MirrorPad, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const modGradConfig = { - kernelName: Mod, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(dy, reduceAxes), a.shape); - } - return dy; - }; - const derB = () => { - const res = mul(dy, neg(floor(div(a, b)))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const multiplyGradConfig = { - kernelName: Multiply, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = mul(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - const res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const negGradConfig = { - kernelName: Neg, - gradFunc: (dy) => { - return { x: () => neg(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const oneHotGradConfig = { - kernelName: OneHot, - inputsToSave: ['indices'], - gradFunc: (dy, saved) => { - const indices = saved[0]; - return { indices: () => zeros(indices.shape, 'float32') }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const onesLikeGradConfig = { - kernelName: OnesLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const packGradConfig = { - kernelName: Pack, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - const derTensors = unstack(dy, axis); - return derTensors.map(t => () => t); - } -}; - -/** - * @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. - * ============================================================================= - */ -const padV2GradConfig = { - kernelName: PadV2, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const powGradConfig = { - kernelName: Pow, - inputsToSave: ['a', 'b'], - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [a, b, y] = saved; - const base = a; - const exp = b; - const outShape = assertAndGetBroadcastShape(base.shape, exp.shape); - const derBase = () => { - const expFloat = cast(exp, 'float32'); - let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1))))); - const reduceAxes = getReductionAxes(base.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, base.shape); - }; - const derExp = () => { - const condition = greater(base, 0); - const logBase = where(condition, log(base), zerosLike(base)); - let res = mul(dy, mul(y, logBase)); - const reduceAxes = getReductionAxes(exp.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, exp.shape); - }; - return { a: derBase, b: derExp }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const preluGradConfig = { - kernelName: Prelu, - inputsToSave: ['x', 'alpha'], - gradFunc: (dy, saved) => { - const [x, alpha] = saved; - const mask = greater(x, 0); - return { - x: () => where(mask, dy, mul(dy, alpha)), - alpha: () => { - let res = where(mask, zerosLike(dy), mul(dy, x)); - const reduceAxes = getReductionAxes(alpha.shape, dy.shape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, alpha.shape); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const divGradConfig = { - kernelName: RealDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reciprocalGradConfig = { - kernelName: Reciprocal, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, neg(square(x))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const relu6GradConfig = { - kernelName: Relu6, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const mask = mul(lessEqual(x, 6), step(x)); - return { x: () => mul(dy, cast(mask, 'float32')) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reluGradConfig = { - kernelName: Relu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, cast(step(x), 'float32')) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 reshapeGradConfig = { - kernelName: Reshape, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => reshape(dy, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const resizeBilinearGradConfig = { - kernelName: ResizeBilinear, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs); - return { images: imagesDer }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const resizeNearestNeighborGradConfig = { - kernelName: ResizeNearestNeighbor, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs); - return { images: imagesDer }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reverseGradConfig = { - kernelName: Reverse, - gradFunc: (dy, saved, attrs) => { - const { dims } = attrs; - const axes = parseAxisParam(dims, dy.shape); - return { x: () => reverse(dy, axes) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const roundGradConfig = { - kernelName: Round, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const rsqrtGradConfig = { - kernelName: Rsqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const selectGradConfig = { - kernelName: Select, - inputsToSave: ['condition'], - gradFunc: (dy, saved) => { - const [condition] = saved; - return { - // TODO(julianoks): Return null for condition gradient - // when backprop supports it. - condition: () => cast(zerosLike(condition), 'float32'), - t: () => mul(dy, cast(condition, dy.dtype)), - e: () => mul(dy, cast(logicalNot(condition), dy.dtype)) - }; - } -}; - -/** - * @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 SELU_SCALEALPHA = 1.7580993408473768599402175208123; -const SELU_SCALE = 1.0507009873554804934193349852946; - -/** - * @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. - * ============================================================================= - */ -const seluGradConfig = { - kernelName: Selu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const mask = greater(x, scalar(0)); - const scaleAlpha = scalar(SELU_SCALEALPHA); - const scale = scalar(SELU_SCALE); - const greaterThanZeroDer = mul(dy, scale); - const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32'))); - return where(mask, greaterThanZeroDer, lessEqualZeroDer); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sigmoidGradConfig = { - kernelName: Sigmoid, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, mul(y, sub(scalar(1), y))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const signGradConfig = { - kernelName: Sign, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sinGradConfig = { - kernelName: Sin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cos(cast(x, 'float32')), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sinhGradConfig = { - kernelName: Sinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cosh(cast(x, 'float32')), dy) }; - } -}; - -/** - * @license - * Copyright 2017 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 parseSliceParams(x, begin, size) { - // The following logic allows for more ergonomic calls. - let begin_; - const xRank = x.shape.length; - if (typeof begin === 'number') { - begin_ = [begin, ...new Array(xRank - 1).fill(0)]; - } - else if (begin.length < xRank) { - begin_ = begin.concat(new Array(xRank - begin.length).fill(0)); - } - else { - begin_ = begin.slice(); - } - begin_.forEach(d => { - assert(d !== -1, () => 'slice() does not support negative begin indexing.'); - }); - let size_; - if (size == null) { - size_ = new Array(xRank).fill(-1); - } - else if (typeof size === 'number') { - size_ = [size, ...new Array(xRank - 1).fill(-1)]; - } - else if (size.length < xRank) { - size_ = size.concat(new Array(xRank - size.length).fill(-1)); - } - else { - size_ = size; - } - size_ = size_.map((d, i) => { - if (d >= 0) { - return d; - } - else { - assert(d === -1, () => `Negative size values should be exactly -1 but got ` + - `${d} for the slice() size at index ${i}.`); - return x.shape[i] - begin_[i]; - } - }); - return [begin_, size_]; -} - -/** - * @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. - * ============================================================================= - */ -const sliceGradConfig = { - kernelName: Slice, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { begin, size } = attrs; - const inputShape = x.shape; - const [begin_, size_] = parseSliceParams(x, begin, size); - // Create an Nx2 padding where the first column represents how many - // zeros are prepended (at start) for each dimension, and the second - // column indicates how many zeros are appended (at end). - // The number of zeros to append is the shape of the input - // elementwise-subtracted by both the begin vector and sizes vector. - const paddings = []; - for (let i = 0; i < dy.rank; i++) { - paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); - } - return { x: () => pad(dy, paddings) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const softmaxGradConfig = { - kernelName: Softmax, - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [y] = saved; - const { dim } = attrs; - const keepDims = true; - const dyTimesY = mul(dy, y); - return { - logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y)) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const softplusGradConfig = { - kernelName: Softplus, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, sigmoid(x)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const spaceToBatchNDGradConfig = { - kernelName: SpaceToBatchND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, paddings } = attrs; - return { x: () => batchToSpaceND(dy, blockShape, paddings) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const splitVGradConfig = { - kernelName: SplitV, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - return { x: () => concat(dy, axis) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sqrtGradConfig = { - kernelName: Sqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const squareGradConfig = { - kernelName: Square, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const squaredDifferenceGradConfig = { - kernelName: SquaredDifference, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const two = scalar(2); - const derA = () => mul(dy, mul(two, sub(a, b))); - const derB = () => mul(dy, mul(two, sub(b, a))); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const stepGradConfig = { - kernelName: Step, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports - // it. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const subGradConfig = { - kernelName: Sub, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(neg(res), b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 sumGradConfig = { - kernelName: Sum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const expandedDyShape = x.shape.slice(); - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const derX = mul(expandedDy, ones$1(x.shape, 'float32')); - return { x: () => derX }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tanGradConfig = { - kernelName: Tan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, square(cos(x))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tanhGradConfig = { - kernelName: Tanh, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(sub(scalar(1), square(y)), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tileGradConfig = { - kernelName: Tile, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { reps } = attrs; - const derX = () => { - let xGrad = zerosLike(x); - // TODO(cais): Maybe reduce memory footprint by avoiding repeated - // slicing. - if (x.rank === 1) { - for (let i = 0; i < reps[0]; ++i) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]])); - } - } - else if (x.rank === 2) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [ - x.shape[0], x.shape[1] - ])); - } - } - } - else if (x.rank === 3) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - xGrad = - add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); - } - } - } - } - else if (x.rank === 4) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - for (let l = 0; l < reps[3]; ++l) { - xGrad = - add$1(xGrad, slice(dy, [ - i * x.shape[0], j * x.shape[1], k * x.shape[2], - l * x.shape[3] - ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); - } - } - } - } - } - else { - throw new Error(`Gradient for tile operation is not implemented for rank-` + - `${x.rank} tensors yet.`); - } - return xGrad; - }; - return { x: derX }; - }, -}; - -/** - * @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. - * ============================================================================= - */ -const transposeGradConfig = { - kernelName: Transpose, - gradFunc: (dy, saved, attrs) => { - const transposeAttrs = attrs; - const { perm } = transposeAttrs; - const undoPerm = getUndoAxesPermutation(perm); - return { x: () => transpose(dy, undoPerm) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 unpackGradConfig = { - kernelName: Unpack, - gradFunc: (dy, saved, attrs) => { - const unpackAttrs = attrs; - const { axis } = unpackAttrs; - return { value: () => stack(dy, axis) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const unsortedSegmentSumGradConfig = { - kernelName: UnsortedSegmentSum, - inputsToSave: ['segmentIds'], - gradFunc: (dy, saved) => { - const [segmentIds] = saved; - const derX = () => { - return gatherDropNegatives(dy, segmentIds); - }; - return { x: derX }; - } -}; -function gatherDropNegatives(x, indices) { - // Helper function for unsorted segment ops. Gathers params for - // positive segment ids and gathers 0 for inputs with negative segment id. - // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py - const zeroClippedIndices = maximum(indices, zerosLike(indices)); - const gathered = gather(x, zeroClippedIndices); - let isPositive = greaterEqual(indices, scalar(0, 'int32')); - const numIters = gathered.rank - isPositive.rank; - for (let i = 0; i < numIters; ++i) { - isPositive = expandDims(isPositive, i + 1); - } - isPositive = logicalAnd(isPositive, ones$1(gathered.shape, 'bool')); - const zeroSlice = zerosLike(gathered); - return where(isPositive, gathered, zeroSlice); -} - -/** - * @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. - * ============================================================================= - */ -const zerosLikeGradConfig = { - kernelName: ZerosLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -// Export all kernel configs here so that the package can auto register them -const gradConfigs = [ - absGradConfig, - acosGradConfig, - acoshGradConfig, - addGradConfig, - addNGradConfig, - argMaxGradConfig, - argMinGradConfig, - asinGradConfig, - asinhGradConfig, - atan2GradConfig, - atanGradConfig, - atanhGradConfig, - avgPool3DGradConfig, - avgPoolGradConfig, - batchMatMulGradConfig, - batchToSpaceNDGradConfig, - broadcastToGradConfig, - castGradConfig, - ceilGradConfig, - clipByValueGradConfig, - complexAbsGradConfig, - concatGradConfig, - conv2DBackpropInputGradConfig, - conv2DGradConfig, - conv3DGradConfig, - cosGradConfig, - coshGradConfig, - cumsumGradConfig, - depthwiseConv2dNativeGradConfig, - dilation2dGradConfig, - divGradConfig, - eluGradConfig, - erfGradConfig, - expGradConfig, - expandDimsGradConfig, - expm1GradConfig, - floorDivGradConfig, - floorGradConfig, - fusedBatchNormGradConfig, - gatherGradConfig, - greaterEqualGradConfig, - identityGradConfig, - isFiniteGradConfig, - isInfGradConfig, - isNanGradConfig, - leakyReluGradConfig, - log1pGradConfig, - logGradConfig, - logSoftmaxGradConfig, - lrnGradConfig, - maxGradConfig, - maxGradConfig, - maximumGradConfig, - maxPool3DGradConfig, - maxPoolGradConfig, - meanGradConfig, - minGradConfig, - minimumGradConfig, - mirrorPadGradConfig, - modGradConfig, - multiplyGradConfig, - negGradConfig, - oneHotGradConfig, - onesLikeGradConfig, - packGradConfig, - padV2GradConfig, - padV2GradConfig, - powGradConfig, - preluGradConfig, - reciprocalGradConfig, - relu6GradConfig, - reluGradConfig, - reshapeGradConfig, - resizeBilinearGradConfig, - resizeNearestNeighborGradConfig, - reverseGradConfig, - roundGradConfig, - rsqrtGradConfig, - selectGradConfig, - seluGradConfig, - sigmoidGradConfig, - signGradConfig, - sinGradConfig, - sinhGradConfig, - sliceGradConfig, - softmaxGradConfig, - softplusGradConfig, - spaceToBatchNDGradConfig, - spaceToBatchNDGradConfig, - splitVGradConfig, - splitVGradConfig, - sqrtGradConfig, - squaredDifferenceGradConfig, - squareGradConfig, - stepGradConfig, - subGradConfig, - sumGradConfig, - tanGradConfig, - tanhGradConfig, - tileGradConfig, - transposeGradConfig, - unpackGradConfig, - unsortedSegmentSumGradConfig, - zerosLikeGradConfig -]; -for (const gradientConfig of gradConfigs) { - registerGradient(gradientConfig); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -let _epsilon; -/** - * Returns the value of the fuzz factor used in numeric expressions. - */ -function epsilon() { - if (_epsilon == null) { - _epsilon = backend().epsilon(); - } - return _epsilon; -} -/** - * Returns the default image data format convention. - */ -function imageDataFormat() { - return 'channelsLast'; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ -// tslint:enable -/** - * Equivalent of Python's AttributeError. - */ -class AttributeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AttributeError.prototype); - } -} -/** - * Equivalent of Python's RuntimeError. - */ -class RuntimeError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, RuntimeError.prototype); - } -} -/** - * Equivalent of Python's ValueError. - */ -class ValueError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, ValueError.prototype); - } -} -/** - * Equivalent of Python's NotImplementedError. - */ -class NotImplementedError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, NotImplementedError.prototype); - } -} -/** - * Equivalent of Python's AssertionError. - */ -class AssertionError extends Error { - constructor(message) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AssertionError.prototype); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ -// tslint:disable-next-line:no-any -function pyListRepeat(value, numValues) { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - let newArray = []; - for (let i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } - else { - const newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } -} -function assert$1(val, message) { - if (!val) { - throw new AssertionError(message); - } -} -/** - * Count the number of elements of the `array` that are equal to `reference`. - */ -function count(array, refernce) { - let counter = 0; - for (const item of array) { - if (item === refernce) { - counter++; - } - } - return counter; -} -/** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ -function singletonOrArray(xs) { - if (xs.length === 1) { - return xs[0]; - } - return xs; -} -/** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ -// tslint:disable-next-line:no-any -function toList(x) { - if (Array.isArray(x)) { - return x; - } - return [x]; -} -/** - * Converts string to snake-case. - * @param name - */ -function toSnakeCase(name) { - const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - const insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; -} -function toCamelCase(identifier) { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, (m, p1) => p1.toUpperCase()); -} -// tslint:disable-next-line:no-any -let _GLOBAL_CUSTOM_OBJECTS = {}; -function serializeKerasObject(instance) { - if (instance === null || instance === undefined) { - return null; - } - const dict = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; -} -/** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ -function convertNDArrayScalarsInConfig(config) { - if (config == null || typeof config !== 'object') { - return; - } - else if (Array.isArray(config)) { - config.forEach(configItem => convertNDArrayScalarsInConfig(configItem)); - } - else { - const fields = Object.keys(config); - for (const field of fields) { - const value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } - else { - convertNDArrayScalarsInConfig(value); - } - } - } - } -} -/** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ -// tslint:disable:no-any -function deserializeKerasObject(identifier, moduleObjects = {}, customObjects = {}, printableModuleName = 'object', fastWeightInit = false) { - // tslint:enable - if (typeof identifier === 'string') { - const functionName = identifier; - let fn; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } - else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } - else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${identifier}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } - else { - // In this case we are dealing with a Keras config dictionary. - const config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError(`${printableModuleName}: Improper config format: ` + - `${JSON.stringify(config)}.\n` + - `'className' and 'config' must set.`); - } - const className = config['className']; - let cls, fromConfig; - if (className in customObjects) { - [cls, fromConfig] = customObjects[className]; - } - else if (className in _GLOBAL_CUSTOM_OBJECTS) { - [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className']; - } - else if (className in moduleObjects) { - [cls, fromConfig] = moduleObjects[className]; - } - if (cls == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${className}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - // tslint:disable-next-line:no-any - const customObjectsCombined = {}; - for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) { - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (const key of Object.keys(customObjects)) { - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - const nestedConfig = config['config']; - nestedConfig['customObjects'] = customObjectsCombined; - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - const returnObj = fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - const returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - } -} -/** - * Compares two numbers for sorting. - * @param a - * @param b - */ -function numberCompare(a, b) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); -} -/** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ -function reverseNumberCompare(a, b) { - return -1 * numberCompare(a, b); -} -/** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ -function unique$1(xs) { - if (xs == null) { - return xs; - } - const out = []; - // TODO(cais): Maybe improve performance by sorting. - for (const x of xs) { - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; -} -/** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ -function isObjectEmpty(obj) { - if (obj == null) { - throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`); - } - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; -} -/** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ -function checkStringTypeUnionValue(values, label, value) { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(`${value} is not a valid ${label}. Valid values are ${values} or null/undefined.`); - } -} -/** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ -// tslint:disable:no-any -function checkArrayTypeAndLength(x, expectedType, minLength = 0, maxLength = Infinity) { - assert$1(minLength >= 0); - assert$1(maxLength >= minLength); - return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(e => typeof e === expectedType)); -} -// tslint:enable:no-any -/** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ -function assertPositiveInteger(value, name) { - if (Array.isArray(value)) { - util.assert(value.length > 0, () => `${name} is unexpectedly an empty array.`); - value.forEach((v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`)); - } - else { - util.assert(Number.isInteger(value) && value > 0, () => `Expected ${name} to be a positive integer, but got ` + - `${formatAsFriendlyString(value)}.`); - } -} -/** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ -// tslint:disable-next-line:no-any -function formatAsFriendlyString(value) { - if (value === null) { - return 'null'; - } - else if (Array.isArray(value)) { - return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']'; - } - else if (typeof value === 'string') { - return `"${value}"`; - } - else { - return `${value}`; - } -} -/** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ -function debounce(f, waitMs) { - let lastTime = util.now(); - let lastResult; - const f2 = (...args) => { - const now = util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f(...args); - return lastResult; - }; - return f2; -} -/** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ -function mapActivationToFusedKernel(activationName) { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function used by many of the Constraints to find the L2Norms. - */ -function calcL2Norms(w, axis) { - return tidy(() => sqrt$1(sum$1(mul$1(w, w), axis, true))); -} -/** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ -class Constraint extends serialization.Serializable { - getConfig() { - return {}; - } -} -class MaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMaxValue = 2; - this.defaultAxis = 0; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = clipByValue$1(norms, 0, this.maxValue); - return mul$1(w, div$1(desired, add$3(epsilon(), norms))); - }); - } - getConfig() { - return { maxValue: this.maxValue, axis: this.axis }; - } -} -/** @nocollapse */ -MaxNorm.className = 'MaxNorm'; -serialization.registerClass(MaxNorm); -class UnitNorm extends Constraint { - constructor(args) { - super(); - this.defaultAxis = 0; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => div$1(w, add$3(epsilon(), calcL2Norms(w, this.axis)))); - } - getConfig() { - return { axis: this.axis }; - } -} -/** @nocollapse */ -UnitNorm.className = 'UnitNorm'; -serialization.registerClass(UnitNorm); -class NonNeg extends Constraint { - apply(w) { - return relu$1(w); - } -} -/** @nocollapse */ -NonNeg.className = 'NonNeg'; -serialization.registerClass(NonNeg); -class MinMaxNorm extends Constraint { - constructor(args) { - super(); - this.defaultMinValue = 0.0; - this.defaultMaxValue = 1.0; - this.defaultRate = 1.0; - this.defaultAxis = 0; - this.minValue = - args.minValue != null ? args.minValue : this.defaultMinValue; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.rate = args.rate != null ? args.rate : this.defaultRate; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - apply(w) { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = add$3(mul$1(this.rate, clipByValue$1(norms, this.minValue, this.maxValue)), mul$1(1.0 - this.rate, norms)); - return mul$1(w, div$1(desired, add$3(epsilon(), norms))); - }); - } - getConfig() { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - } -} -/** @nocollapse */ -MinMaxNorm.className = 'MinMaxNorm'; -serialization.registerClass(MinMaxNorm); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' -}; -function serializeConstraint(constraint) { - return serializeKerasObject(constraint); -} -function deserializeConstraint(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); -} -function getConstraint(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeConstraint(config); - } - else if (identifier instanceof Constraint) { - return identifier; - } - else { - return deserializeConstraint(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ -function maxNorm(args) { - return new MaxNorm(args); -} -/** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -function unitNorm(args) { - return new UnitNorm(args); -} -/** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -function nonNeg() { - return new NonNeg(); -} -/** @doc {heading: 'Constraints', namespace: 'constraints'} */ -function minMaxNorm(config) { - return new MinMaxNorm(config); -} - -var exports_constraints = /*#__PURE__*/Object.freeze({ - __proto__: null, - maxNorm: maxNorm, - unitNorm: unitNorm, - nonNeg: nonNeg, - minMaxNorm: minMaxNorm -}); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; -const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; -const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; -const VALID_POOL_MODE_VALUES = ['max', 'avg']; -const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// A map from the requested scoped name of a Tensor to the number of Tensors -// wanting that name so far. This allows enforcing name uniqueness by appending -// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. -const nameMap = new Map(); -function checkDataFormat(value) { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); -} -function checkInterpolationFormat(value) { - checkStringTypeUnionValue(VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); -} -function checkPaddingMode(value) { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); -} -function checkPoolMode(value) { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); -} -const _nameScopeStack = []; -const _nameScopeDivider = '/'; -/** - * Enter namescope, which can be nested. - */ -function nameScope(name, fn) { - _nameScopeStack.push(name); - try { - const val = fn(); - _nameScopeStack.pop(); - return val; - } - catch (e) { - _nameScopeStack.pop(); - throw e; - } -} -/** - * Get the current namescope as a flat, concatenated string. - */ -function currentNameScopePrefix() { - if (_nameScopeStack.length === 0) { - return ''; - } - else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } -} -/** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ -function getScopedTensorName(tensorName) { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; -} -/** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ -function getUniqueTensorName(scopedName) { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - const index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - if (index > 0) { - const result = `${scopedName}_${index}`; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } - else { - return scopedName; - } -} -const tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); -/** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ -function isValidTensorName(name) { - return !!name.match(tensorNameRegex); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Determine if a number is an integer. - */ -function isInteger(x) { - return x === parseInt(x.toString(), 10); -} -/** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ -function arrayProd(array, begin, end) { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - let prod = 1; - for (let i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; -} -/** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ -function toArray1D(array) { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tensor1d(array); -} -/** - * Compute minimum value. - * @param array - * @return minimum value. - */ -function min$1(array) { - return min$2(toArray1D(array)).dataSync()[0]; -} -/** - * Compute maximum value. - * @param array - * @return maximum value - */ -function max$1(array) { - return max$2(toArray1D(array)).dataSync()[0]; -} -/** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ -function range(begin, end) { - if (end < begin) { - throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`); - } - const out = []; - for (let i = begin; i < end; ++i) { - out.push(i); - } - return out; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ -function cast$1(x, dtype) { - return x.asType(dtype); -} -/** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ -function expandDims$1(x, axis = -1) { - const outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); -} -/** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ -function repeat(x, n) { - return tidy(() => { - if (x.shape.length !== 2) { - throw new ValueError(`repeat() expects a rank-2 tensor, but received a ` + - `rank-${x.shape.length} tensor.`); - } - const y = expandDims$1(x, 1); - return tile$1(y, [1, n, 1]); - }); -} -/** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ -function flatten$1(x) { - const newShape = [arrayProd(x.shape)]; - return x.reshape(newShape); -} -/** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ -function batchFlatten(x) { - if (x.rank <= 1) { - throw new ValueError(`batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`); - } - const newShape = [x.shape[0], arrayProd(x.shape, 1)]; - return x.reshape(newShape); -} -/** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongFirstAxis(array, start, size) { - return tidy(() => { - switch (array.rank) { - case 1: - return slice1d(array, start, size); - case 2: - return slice2d(array, [start, 0], [size, array.shape[1]]); - case 3: - return slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); - case 4: - return slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return slice$1(array, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return slice$1(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError(`sliceAlongFirstAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongLastAxis(array, start, size) { - return tidy(() => { - switch (array.rank) { - case 1: - return slice1d(array, start, size); - case 2: - return slice2d(array, [0, start], [array.shape[0], size]); - case 3: - return slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); - case 4: - return slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongAxis(array, start, size, axis) { - return tidy(() => { - switch (array.rank) { - case 1: - return slice1d(array, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError(`The axis is not within the rank of the tensor ` + - `${axis}`); - } - default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} -/** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ -function concatenate(tensors, axis = -1) { - let rank; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } - else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return concat$1(tensors, axis); -} -/** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ -function concatAlongFirstAxis(a, b) { - switch (a.rank) { - case 1: - return concat1d([a, b]); - case 2: - return concat2d([a, b], 0); - case 3: - return concat3d([a, b], 0); - case 4: - return concat4d([a, b], 0); - default: - throw new ValueError(`concatAlongFirstAxis() received an unsupported ` + - `tensor rank: ${a.rank}`); - } -} -/** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ -function tile$1(x, n) { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError(`The length of input n (${n.length}) does not match ` + - `the number of dimensions in input x (${x.rank})`); - } - return tile$2(x, n); -} -/* Creation of random tensors. */ -/** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ -function randomNormal(shape, mean = 0.0, stddev = 1.0, dtype, seed) { - return randomNormal$2(shape, mean, stddev, dtype, seed); -} -/* Linear Algebra */ -/** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ -function dot$1(a, b, activation, bias) { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError(`dot requires both inputs to be rank >= 2` + - ` but got x shape = ${a.shape} and y shape = ${b.shape}`); - } - if (b.rank >= 3) { - const xLastDim = a.shape.slice(-1)[0]; - const ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError(`If rank y >= 3, then the second last dim` + - ` of y must equal the last dim of x but got x shape = ${a.shape} and ` + - ` y shape = ${b.shape}`); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - const transposeA = false; - const transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return fused.matMul({ - a, - b: b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }); - } - else { - // Reshape x into the analogous 2D Tensor. - const aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - const aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - const bShape = b.shape.slice(); - const bLastDim = bShape.pop(); - const ySecondLastDim = bShape.pop(); - const yOtherDims = [...bShape, bLastDim]; - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - const perm = Array.from({ length: b.rank }, (_, i) => { - if (i === 0) { - return b.rank - 2; - } - else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - // Multiply x and y as 2D Tensors, and then reshape back to original. - const outputShape = [...aFirstDims, ...yOtherDims]; - const transposeA = false; - const transposeB = false; - return fused - .matMul({ - a, - b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }) - .reshape(outputShape); - } -} -/* Elementary math functions. */ -/** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ -function gather$1(reference, indices, axis) { - return tidy(() => { - if (Array.isArray(indices)) { - indices = tensor1d(indices, 'int32'); - } - else { - indices = indices.toInt(); - } - return gather$2(reference, indices, axis); - }); -} -/** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ -function square$1(x) { - return mul$1(x, x); -} -/** - * Reshapes bias tensor according to rank of x. - */ -function reshapeBias(xRank, bias, dataFormat) { - const biasShape = bias.shape; - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError(`Unexpected bias dimensions: ${bias.rank}` + - `; expected it to be 1 or ${xRank}`); - } - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } - else { - return bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } - else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } - else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank < 3) { - return bias; - } - throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`); -} -/* Neural-network operations. */ -/** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ -function biasAdd(x, bias, dataFormat) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); -} -/** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ -function elu$1(x, alpha = 1) { - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError(`Support for alpha values other than 1 (${alpha}) is not implemented ` + - `yet.`); - } - return elu$3(x); -} -/** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ -function softsign(x) { - return tidy(() => div$1(x, abs$1(x).add(1))); -} -/** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ -function dropout(x, level, noiseShape, seed) { - return tidy(() => dropout$2(x, level, noiseShape, seed)); -} -/** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ -function hardSigmoid(x) { - return tidy(() => { - const y = add$3(.5, mul$1(.2, x)); - return clipByValue$1(y, 0, 1); - }); -} -/** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ -function inTrainPhase(x, alt, training = false) { - return training ? x() : alt(); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; -const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform', 'truncatedNormal']; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function checkFanMode(value) { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); -} -function checkDistribution(value) { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); -} -/** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ -class Initializer extends serialization.Serializable { - fromConfigUsesCustomObjects() { - return false; - } - getConfig() { - return {}; - } -} -class Zeros extends Initializer { - apply(shape, dtype) { - return zeros$2(shape, dtype); - } -} -/** @nocollapse */ -Zeros.className = 'Zeros'; -serialization.registerClass(Zeros); -class Ones extends Initializer { - apply(shape, dtype) { - return ones$3(shape, dtype); - } -} -/** @nocollapse */ -Ones.className = 'Ones'; -serialization.registerClass(Ones); -class Constant extends Initializer { - constructor(args) { - super(); - if (typeof args !== 'object') { - throw new ValueError(`Expected argument of type ConstantConfig but got ${args}`); - } - if (args.value === undefined) { - throw new ValueError(`config must have value set but got ${args}`); - } - this.value = args.value; - } - apply(shape, dtype) { - return tidy(() => mul$1(scalar$1(this.value), ones$3(shape, dtype))); - } - getConfig() { - return { - value: this.value, - }; - } -} -/** @nocollapse */ -Constant.className = 'Constant'; -serialization.registerClass(Constant); -class RandomUniform extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MINVAL = -0.05; - this.DEFAULT_MAXVAL = 0.05; - this.minval = args.minval || this.DEFAULT_MINVAL; - this.maxval = args.maxval || this.DEFAULT_MAXVAL; - this.seed = args.seed; - } - apply(shape, dtype) { - return randomUniform$1(shape, this.minval, this.maxval, dtype); - } - getConfig() { - return { minval: this.minval, maxval: this.maxval, seed: this.seed }; - } -} -/** @nocollapse */ -RandomUniform.className = 'RandomUniform'; -serialization.registerClass(RandomUniform); -class RandomNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`randomNormal does not support dType ${dtype}.`); - } - return randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } -} -/** @nocollapse */ -RandomNormal.className = 'RandomNormal'; -serialization.registerClass(RandomNormal); -class TruncatedNormal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_MEAN = 0.; - this.DEFAULT_STDDEV = 0.05; - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - apply(shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`truncatedNormal does not support dType ${dtype}.`); - } - return truncatedNormal$1(shape, this.mean, this.stddev, dtype, this.seed); - } - getConfig() { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - } -} -/** @nocollapse */ -TruncatedNormal.className = 'TruncatedNormal'; -serialization.registerClass(TruncatedNormal); -class Identity$1 extends Initializer { - constructor(args) { - super(); - this.gain = args.gain != null ? args.gain : 1.0; - } - apply(shape, dtype) { - return tidy(() => { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError('Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } - else { - return mul$1(this.gain, eye(shape[0])); - } - }); - } - getConfig() { - return { gain: this.gain }; - } -} -/** @nocollapse */ -Identity$1.className = 'Identity'; -serialization.registerClass(Identity$1); -/** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ -function computeFans(shape, dataFormat = 'channelsLast') { - let fanIn; - let fanOut; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } - else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - const receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } - else if (dataFormat === 'channelsLast') { - const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } - else { - const shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - return [fanIn, fanOut]; -} -class VarianceScaling extends Initializer { - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - constructor(args) { - super(); - if (args.scale < 0.0) { - throw new ValueError(`scale must be a positive float. Got: ${args.scale}`); - } - this.scale = args.scale == null ? 1.0 : args.scale; - this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(this.mode); - this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(this.distribution); - this.seed = args.seed; - } - apply(shape, dtype) { - const fans = computeFans(shape); - const fanIn = fans[0]; - const fanOut = fans[1]; - let scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } - else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } - else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - if (this.distribution === 'normal') { - const stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`${this.getClassName()} does not support dType ${dtype}.`); - } - return truncatedNormal$1(shape, 0, stddev, dtype, this.seed); - } - else { - const limit = Math.sqrt(3 * scale); - return randomUniform$1(shape, -limit, limit, dtype); - } - } - getConfig() { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - } -} -/** @nocollapse */ -VarianceScaling.className = 'VarianceScaling'; -serialization.registerClass(VarianceScaling); -class GlorotUniform extends VarianceScaling { - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -GlorotUniform.className = 'GlorotUniform'; -serialization.registerClass(GlorotUniform); -class GlorotNormal extends VarianceScaling { - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -GlorotNormal.className = 'GlorotNormal'; -serialization.registerClass(GlorotNormal); -class HeNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -HeNormal.className = 'HeNormal'; -serialization.registerClass(HeNormal); -class HeUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -HeUniform.className = 'HeUniform'; -serialization.registerClass(HeUniform); -class LeCunNormal extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -LeCunNormal.className = 'LeCunNormal'; -serialization.registerClass(LeCunNormal); -class LeCunUniform extends VarianceScaling { - constructor(args) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - getClassName() { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -/** @nocollapse */ -LeCunUniform.className = 'LeCunNormal'; -serialization.registerClass(LeCunUniform); -class Orthogonal extends Initializer { - constructor(args) { - super(); - this.DEFAULT_GAIN = 1; - this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain; - this.seed = args.seed; - if (this.seed != null) { - throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); - } - } - apply(shape, dtype) { - return tidy(() => { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn(`Orthogonal initializer is being called on a matrix with more ` + - `than 2000 (${shape[0] * shape[1]}) elements: ` + - `Slowness may result.`); - } - // TODO(cais): Add seed support. - const normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - const a = randomNormal(normalizedShape, 0, 1, 'float32'); - let q = linalg.gramSchmidt(a); - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return mul$1(this.gain, q); - }); - } - getConfig() { - return { - gain: this.gain, - seed: this.seed, - }; - } -} -/** @nocollapse */ -Orthogonal.className = 'Orthogonal'; -serialization.registerClass(Orthogonal); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' -}; -function deserializeInitializer(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); -} -function serializeInitializer(initializer) { - return serializeKerasObject(initializer); -} -function getInitializer(identifier) { - if (typeof identifier === 'string') { - const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } - else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } - else if (className === 'HeNormal') { - return new HeNormal(); - } - else if (className === 'HeUniform') { - return new HeUniform(); - } - else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } - else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } - else { - const config = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } - else if (identifier instanceof Initializer) { - return identifier; - } - else { - return deserializeInitializer(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function zeros$1() { - return new Zeros(); -} -/** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function ones$2() { - return new Ones(); -} -/** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function constant(args) { - return new Constant(args); -} -/** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function randomUniform(args) { - return new RandomUniform(args); -} -/** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function randomNormal$1(args) { - return new RandomNormal(args); -} -/** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function truncatedNormal(args) { - return new TruncatedNormal(args); -} -/** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function identity(args) { - return new Identity$1(args); -} -/** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -function varianceScaling(config) { - return new VarianceScaling(config); -} -/** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function glorotUniform(args) { - return new GlorotUniform(args); -} -/** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function glorotNormal(args) { - return new GlorotNormal(args); -} -/** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function heNormal(args) { - return new HeNormal(args); -} -/** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -function heUniform(args) { - return new HeUniform(args); -} -/** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function leCunNormal(args) { - return new LeCunNormal(args); -} -/** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function leCunUniform(args) { - return new LeCunUniform(args); -} -/** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function orthogonal(args) { - return new Orthogonal(args); -} - -var exports_initializers = /*#__PURE__*/Object.freeze({ - __proto__: null, - zeros: zeros$1, - ones: ones$2, - constant: constant, - randomUniform: randomUniform, - randomNormal: randomNormal$1, - truncatedNormal: truncatedNormal, - identity: identity, - varianceScaling: varianceScaling, - glorotUniform: glorotUniform, - glorotNormal: glorotNormal, - heNormal: heNormal, - heUniform: heUniform, - leCunNormal: leCunNormal, - leCunUniform: leCunUniform, - orthogonal: orthogonal -}); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Utilities related to persistent state in the backend. - */ -/** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ -let _nextUniqueTensorId = 0; -function getNextUniqueTensorId() { - return _nextUniqueTensorId++; -} -const _uidPrefixes = {}; -/** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ -function getUid(prefix = '') { - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * Determine whether the input is an Array of Shapes. - */ -function isArrayOfShapes(x) { - return Array.isArray(x) && Array.isArray(x[0]); -} -/** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ -function normalizeShapeList(x) { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x]; - } - return x; -} -/** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ -function getExactlyOneTensor(xs) { - let x; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`); - } - x = xs[0]; - } - else { - x = xs; - } - return x; -} -/** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ -function getExactlyOneShape(shapes) { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes; - return shapes[0]; - } - else { - throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`); - } - } - else { - return shapes; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ -function countParamsInWeights(weights) { - let count = 0; - for (const weight of weights) { - if (weight.shape.length === 0) { - count += 1; - } - else { - count += weight.shape.reduce((a, b) => a * b); - } - } - return count; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -const DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; -/** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ -class LayerVariable { - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - constructor(val, dtype = 'float32', name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true, constraint = null) { - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - this.trainable_ = trainable; - this.constraint = constraint; - this.val = variable(val, this.trainable_, this.name, this.dtype); - } - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - read() { - this.assertNotDisposed(); - return this.val; - } - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - write(newVal) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - } - /** - * Dispose this LayersVariable instance from memory. - */ - dispose() { - this.assertNotDisposed(); - this.val.dispose(); - } - assertNotDisposed() { - if (this.val.isDisposed) { - throw new Error(`LayersVariable ${this.name} is already disposed.`); - } - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.trainable_ = trainable; - this.val.trainable = trainable; - } -} -function checkShapesMatch(x, y) { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } -} -/** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ -function batchGetValue(xs) { - return xs.map(x => x.read()); -} -/** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ -function batchSetValue(variablesAndValues) { - variablesAndValues.forEach(variableAndValue => { - const variable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ -class InputSpec { - constructor(args) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } - else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } -} -/** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ -class SymbolicTensor { - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - constructor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { - this.dtype = dtype; - this.shape = shape; - this.sourceLayer = sourceLayer; - this.inputs = inputs; - this.callArgs = callArgs; - this.outputTensorIndex = outputTensorIndex; - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } -} -let _nextNodeID = 0; -/** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ -class Node { - constructor(args, - // TODO(michaelterry): Define actual type for this. - callArgs) { - this.callArgs = callArgs; - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - // Following 2 properties: input and output shapes. - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - // Add nodes to all layers involved. - for (const layer of args.inboundLayers) { - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - getConfig() { - const inboundNames = []; - for (const layer of this.inboundLayers) { - if (layer != null) { - inboundNames.push(layer.name); - } - else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - } -} -let _nextLayerID = 0; -/** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ -class Layer extends serialization.Serializable { - constructor(args = {}) { - super(); - this._callHook = null; - this._addedWeightNames = []; - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - this._stateful = false; - this.id = _nextLayerID++; - this.activityRegularizer = null; - this.inputSpec = null; - this.supportsMasking = false; - // These properties will be set upon call of this.build() - this._trainableWeights = []; - this._nonTrainableWeights = []; - this._losses = []; - this._updates = []; - this._built = false; - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - this.inboundNodes = []; - this.outboundNodes = []; - let name = args.name; - if (!name) { - const prefix = this.getClassName(); - name = toSnakeCase(prefix) + '_' + getUid(prefix); - } - this.name = name; - this.trainable_ = args.trainable == null ? true : args.trainable; - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - let batchInputShape; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } - else if (args.inputShape != null) { - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - this.batchInputShape = batchInputShape; - // Set dtype. - let dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - this.dtype = dtype; - } - if (args.weights != null) { - this.initialWeights = args.weights; - } - else { - this.initialWeights = null; - } - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - this._refCount = null; - this.fastWeightInitDuringBuild = false; - } - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - static nodeKey(layer, nodeIndex) { - return layer.name + '_ib-' + nodeIndex.toString(); - } - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - getNodeAtIndex(nodeIndex, attrName) { - if (this.inboundNodes.length === 0) { - throw new RuntimeError('The layer has never been called ' + - `and thus has no defined ${attrName}.`); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError(`Asked to get ${attrName} at node ${nodeIndex}, ` + - `but the layer has only ${this.inboundNodes.length} inbound nodes.`); - } - return this.inboundNodes[nodeIndex]; - } - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - getInputAt(nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - getOutputAt(nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - } - // Properties - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get input() { - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } - else if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' is not connected, no input to return.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); - } - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get output() { - if (this.inboundNodes.length === 0) { - throw new AttributeError(`Layer ${this.name}` + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError(`Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); - } - get losses() { - return this._losses; - } - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(lossFn => lossFn()); - } - get updates() { - return this._updates; - } - get built() { - return this._built; - } - set built(built) { - this._built = built; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this._trainableWeights.forEach(w => w.trainable = trainable); - this.trainable_ = trainable; - } - get trainableWeights() { - if (this.trainable_) { - return this._trainableWeights.filter(w => w.trainable); - } - else { - return []; - } - } - set trainableWeights(weights) { - this._trainableWeights = weights; - } - get nonTrainableWeights() { - if (this.trainable) { - return this._trainableWeights.filter(w => !w.trainable) - .concat(this._nonTrainableWeights); - } - else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - } - set nonTrainableWeights(weights) { - this._nonTrainableWeights = weights; - } - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - get stateful() { - return this._stateful; - } - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - resetStates() { - if (!this.stateful) { - throw new Error('Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - } - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - assertInputCompatibility(inputs) { - inputs = toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - const inputSpec = toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError(`Layer ${this.name} expects ${inputSpec.length} inputs, ` + - `but it received ${inputs.length} input tensors. ` + - `Input received: ${inputs}`); - } - for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - const x = inputs[inputIndex]; - const spec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - // Check ndim. - const ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}: ` + - `expected ndim=${spec.ndim}, found ndim=${ndim}`); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`); - } - } - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ${this.name} ` + - `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`); - } - } - // Check specific shape axes. - if (spec.axes) { - const xShape = x.shape; - for (const key in spec.axes) { - const axis = Number(key); - const value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - const xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected axis ${axis} of input shape to ` + - `have value ${value} but got shape ${xShape}.`); - } - } - } - // Check shape. - if (spec.shape != null) { - for (let i = 0; i < spec.shape.length; ++i) { - const specDim = spec.shape[i]; - const dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError(`Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected shape=${spec.shape}, ` + - `found shape=${x.shape}.`); - } - } - } - } - } - } - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - call(inputs, kwargs) { - return inputs; - } - invokeCallHook(inputs, kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - } - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - setCallHook(callHook) { - this._callHook = callHook; - } - /** - * Clear call hook. - * This is currently used for testing only. - */ - clearCallHook() { - this._callHook = null; - } - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - apply(inputs, kwargs) { - kwargs = kwargs || {}; - this.assertNotDisposed(); - // Ensure inputs are all the same type. - const inputsList = toList(inputs); - let allAreSymbolic = true; - for (const input of inputsList) { - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - let noneAreSymbolic = true; - for (const input of inputsList) { - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError('Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, () => { - // Handle laying building (weight creating, input spec locking). - if (!this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - this.assertInputCompatibility(inputs); - // Collect input shapes to build layer. - const inputShapes = []; - for (const xElem of toList(inputs)) { - inputShapes.push(xElem.shape); - } - this.build(singletonOrArray(inputShapes)); - this.built = true; - // Load weights that were specified at layer instantiation. - if (this.initialWeights) { - this.setWeights(this.initialWeights); - } - if (this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - this._refCount = 1; - } - } - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - this.assertInputCompatibility(inputs); - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - let output = this.call(inputs, kwargs); - // TODO(michaelterry): Compute the outputMask - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - const outputList = toList(output); - const outputListCopy = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (let x of outputList) { - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = singletonOrArray(outputListCopy); - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Call addInboundNode()? - return output; - } - else { - const inputShape = collectInputShape(inputs); - const outputShape = this.computeOutputShape(inputShape); - let output; - const outputDType = guessOutputDType(inputs); - this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : - inputShape); - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = outputShape - .map((shape, index) => new SymbolicTensor(outputDType, shape, this, toList(inputs), kwargs, this.name, index)); - } - else { - output = new SymbolicTensor(outputDType, outputShape, this, toList(inputs), kwargs, this.name); - } - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); - this._refCount++; - if (this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - return output; - } - }); - } - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - warnOnIncompatibleInputShape(inputShape) { - if (this.batchInputShape == null) { - return; - } - else if (inputShape.length !== this.batchInputShape.length) { - console.warn(`The rank of the input tensor provided (shape: ` + - `${JSON.stringify(inputShape)}) does not match that of the ` + - `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` + - `of the layer ${this.name}`); - } - else { - let dimMismatch = false; - this.batchInputShape.forEach((dimension, i) => { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch = true; - } - }); - if (dimMismatch) { - console.warn(`The shape of the input tensor ` + - `(${JSON.stringify(inputShape)}) does not ` + - `match the expectation of layer ${this.name}: ` + - `${JSON.stringify(this.batchInputShape)}`); - } - } - } - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get outputShape() { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError(`The layer ${this.name} has never been called and thus has no ` + - `defined output shape.`); - } - const allOutputShapes = []; - for (const node of this.inboundNodes) { - const shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - const outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return outputShapes[0]; - } - else { - return outputShapes; - } - } - else { - throw new AttributeError(`The layer ${this.name} has multiple inbound nodes with different ` + - `output shapes. Hence the notion of "output shape" is ill-defined ` + - `for the layer.`); - // TODO(cais): Implement getOutputShapeAt(). - } - } - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - countParams() { - if (!this.built) { - throw new RuntimeError(`You tried to call countParams() on ${this.name}, ` + - `but the layer is not built yet. Build it first by calling ` + - `build(batchInputShape).`); - } - return countParamsInWeights(this.weights); - } - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - build(inputShape) { - this.built = true; - } - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getWeights(trainableOnly = false) { - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - } - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - setWeights(weights) { - tidy(() => { - const params = this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError(`You called setWeights(weights) on layer "${this.name}" ` + - `with a weight list of length ${weights.length}, ` + - `but the layer was expecting ${params.length} weights. ` + - `Provided weights: ${weights}...`); - } - if (params.length === 0) { - return; - } - const weightValueTuples = []; - const paramValues = batchGetValue(params); - for (let i = 0; i < paramValues.length; ++i) { - const pv = paramValues[i]; - const p = params[i]; - const w = weights[i]; - if (!util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError(`Layer weight shape ${pv.shape} ` + - `not compatible with provided weight shape ${w.shape}`); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - } - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addWeight(name, shape, dtype, initializer, regularizer, trainable, constraint) { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError(`Duplicate weight name ${name} for layer ${this.name}`); - } - this._addedWeightNames.push(name); - if (dtype == null) { - dtype = 'float32'; - } - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - const initValue = initializer.apply(shape, dtype); - const weight = new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(() => regularizer.apply(weight.read())); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } - else { - this._nonTrainableWeights.push(weight); - } - return weight; - } - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - setFastWeightInitDuringBuild(value) { - this.fastWeightInitDuringBuild = value; - } - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addLoss(losses) { - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = toList(losses); - if (this._losses !== undefined && this._losses !== null) { - this.losses.push(...losses); - } - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - computeOutputShape(inputShape) { - return inputShape; - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(maskElement => { - if (maskElement != null) { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - }); - } - else { - throw new TypeError(`Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - } - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - addInboundNode(inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs = null) { - const inputTensorList = toList(inputTensors); - outputTensors = toList(outputTensors); - inputMasks = toList(inputMasks); - outputMasks = toList(outputMasks); - inputShapes = normalizeShapeList(inputShapes); - outputShapes = normalizeShapeList(outputShapes); - // Collect input tensor(s) coordinates. - const inboundLayers = []; - const nodeIndices = []; - const tensorIndices = []; - for (const x of inputTensorList) { - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers, - nodeIndices, - tensorIndices, - inputTensors: inputTensorList, - outputTensors, - inputMasks, - outputMasks, - inputShapes, - outputShapes - }, kwargs); - // Update tensor history - for (let i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - } - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getConfig() { - const config = { name: this.name, trainable: this.trainable }; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - } - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - disposeWeights() { - this.weights.forEach(weight => weight.dispose()); - return this.weights.length; - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Layer '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - dispose() { - if (!this.built) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been ` + - `built yet.`); - } - if (this._refCount === null) { - throw new Error(`Cannot dispose Layer ${this.name} because it has not been used ` + - `yet.`); - } - this.assertNotDisposed(); - let numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - return { refCountAfterDispose: this._refCount, numDisposedVariables }; - } -} -/** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ -function collectInputShape(inputTensors) { - inputTensors = - toList(inputTensors); - const shapes = []; - for (const x of inputTensors) { - shapes.push(x.shape); - } - return singletonOrArray(shapes); -} -/** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ -function guessOutputDType(inputTensors) { - return 'float32'; -} -/** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ -function getSourceInputs(tensor, layer, nodeIndex) { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } - else { - const node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } - else { - const sourceTensors = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const previousSources = getSourceInputs(x, layer, nodeIndex); - // Avoid input redundancy. - for (const x of previousSources) { - if (sourceTensors.indexOf(x) === -1) { - sourceTensors.push(x); - } - } - } - return sourceTensors; - } - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class InputLayer extends Layer { - constructor(args) { - super({ - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }); - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - this.trainable = false; - this.built = true; - this.sparse = args.sparse; - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError('Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - let batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError('An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } - else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } - else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError('Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - const dtype = args.dtype || 'float32'; - this.batchInputShape = batchInputShape; - this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - this.inputSpec = [{ shape: batchInputShape }]; - const inputTensor = new SymbolicTensor(this.dtype, this.batchInputShape, this, [], {}, this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - } - apply(inputs, kwargs) { - throw new ValueError('Cannot pass any input to an ' + - `InputLayer's apply() method. InputLayer name: ${this.name}`); - } - dispose() { - // dispose() for InputLayer is overridden as no-op. - return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; - } - getConfig() { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - } -} -/** @nocollapse */ -InputLayer.className = 'InputLayer'; -serialization.registerClass(InputLayer); -function Input(config) { - if (config.batchShape == null && config.shape == null) { - throw new Error('Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError('Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - let batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - let dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - const inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype, - sparse: config.sparse - }); - const outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ -async function resolveScalarsInLogs(logs) { - if (logs == null) { - return; - } - const promises = []; - const keys = []; - const scalarsToDispose = []; - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - const valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (promises.length > 0) { - const values = await Promise.all(promises); - for (let i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - dispose(scalarsToDispose); - } -} -/** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ -function disposeTensorsInLogs(logs) { - if (logs == null) { - return; - } - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Verbosity logging level when fitting a model. */ -var ModelLoggingVerbosity; -(function (ModelLoggingVerbosity) { - ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; -})(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); -/** How often to yield to the main thread when training (in ms). */ -const DEFAULT_YIELD_EVERY_MS = 125; -/** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ -class BaseCallback { - constructor() { - // TODO(michaelterry): This type is a best guess. - this.validationData = null; - } - setParams(params) { - this.params = params; - } - async onEpochBegin(epoch, logs) { } - async onEpochEnd(epoch, logs) { } - async onBatchBegin(batch, logs) { } - async onBatchEnd(batch, logs) { } - async onTrainBegin(logs) { } - async onTrainEnd(logs) { } - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - setModel(model) { - // Do nothing. Use Callback instead of BaseCallback to track the model. - } -} -/** - * Container abstracting a list of callbacks. - */ -class CallbackList { - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - constructor(callbacks, queueLength = 10) { - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - append(callback) { - this.callbacks.push(callback); - } - setParams(params) { - for (const callback of this.callbacks) { - callback.setParams(params); - } - } - setModel(model) { - for (const callback of this.callbacks) { - callback.setModel(model); - } - } - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochBegin(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochBegin(epoch, logs); - } - } - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochEnd(epoch, logs); - } - } - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchBegin(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchBegin(batch, logs); - } - } - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchEnd(batch, logs); - } - } - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - async onTrainBegin(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainBegin(logs); - } - } - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - async onTrainEnd(logs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainEnd(logs); - } - } -} -/** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ -class BaseLogger extends BaseCallback { - constructor() { - super(); - } - async onEpochBegin(epoch) { - this.seen = 0; - this.totals = {}; - } - async onBatchEnd(batch, logs) { - if (logs == null) { - logs = {}; - } - const batchSize = logs['size'] == null ? 0 : logs['size']; - this.seen += batchSize; - for (const key in logs) { - const value = logs[key]; - if (typeof value === 'number') { - if (!this.totals.hasOwnProperty(key)) { - this.totals[key] = 0; - } - this.totals[key] = this.totals[key] + value * batchSize; - } - else { - let oldTotalsToDispose; - if (key in this.totals) { - oldTotalsToDispose = this.totals[key]; - } - else { - this.totals[key] = 0; - } - const total = tidy(() => add$3((this.totals[key]), mul$1(value, batchSize))); - this.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - } - } - async onEpochEnd(epoch, logs) { - if (logs != null) { - for (const key of this.params['metrics']) { - if (this.totals[key] == null) { - continue; - } - if (typeof this.totals[key] === 'number') { - logs[key] = this.totals[key] / this.seen; - } - else { - tidy(() => { - const log = mul$1(div$1(1, this.seen), this.totals[key]); - logs[key] = log; - this.totals[key].dispose(); - keep(logs[key]); - }); - } - } - } - } -} -/** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ -class History extends BaseCallback { - async onTrainBegin(logs) { - this.epoch = []; - this.history = {}; - } - async onEpochEnd(epoch, logs) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (const key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - } - /** - * Await the values of all losses and metrics. - */ - async syncData() { - const promises = []; - const keys = []; - const indices = []; - for (const key in this.history) { - const valueArray = this.history[key]; - for (let i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - const valueScalar = valueArray[i]; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - const values = await Promise.all(promises); - for (let n = 0; n < values.length; ++n) { - const tensorToDispose = this.history[keys[n]][indices[n]]; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - } -} -/** - * Custom callback for training. - */ -class CustomCallback extends BaseCallback { - constructor(args, yieldEvery) { - super(); - this.currentEpoch = 0; - this.yieldEvery = yieldEvery || 'auto'; - if (this.yieldEvery === 'auto') { - this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (this.yieldEvery === 'never' && args.onYield != null) { - throw new Error('yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (util.isNumber(this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - this.maybeWait = debounce(this.maybeWait.bind(this), this.yieldEvery); - } - this.trainBegin = args.onTrainBegin; - this.trainEnd = args.onTrainEnd; - this.epochBegin = args.onEpochBegin; - this.epochEnd = args.onEpochEnd; - this.batchBegin = args.onBatchBegin; - this.batchEnd = args.onBatchEnd; - this.yield = args.onYield; - } - async maybeWait(epoch, batch, logs) { - const ps = []; - if (this.yield != null) { - await resolveScalarsInLogs(logs); - ps.push(this.yield(epoch, batch, logs)); - } - ps.push(nextFrame()); - await Promise.all(ps); - } - async onEpochBegin(epoch, logs) { - this.currentEpoch = epoch; - if (this.epochBegin != null) { - await resolveScalarsInLogs(logs); - await this.epochBegin(epoch, logs); - } - } - async onEpochEnd(epoch, logs) { - const ps = []; - if (this.epochEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.epochEnd(epoch, logs)); - } - if (this.yieldEvery === 'epoch') { - ps.push(nextFrame()); - } - await Promise.all(ps); - } - async onBatchBegin(batch, logs) { - if (this.batchBegin != null) { - await resolveScalarsInLogs(logs); - await this.batchBegin(batch, logs); - } - } - async onBatchEnd(batch, logs) { - const ps = []; - if (this.batchEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.batchEnd(batch, logs)); - } - if (this.yieldEvery === 'batch') { - ps.push(nextFrame()); - } - else if (util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - await Promise.all(ps); - } - async onTrainBegin(logs) { - if (this.trainBegin != null) { - await resolveScalarsInLogs(logs); - await this.trainBegin(logs); - } - } - async onTrainEnd(logs) { - if (this.trainEnd != null) { - await resolveScalarsInLogs(logs); - await this.trainEnd(logs); - } - } -} -/** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ -function standardizeCallbacks(callbacks, yieldEvery) { - if (callbacks == null) { - callbacks = {}; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks; - } - // Convert custom callback configs to custom callback objects. - const callbackConfigs = toList(callbacks); - return callbackConfigs.map(callbackConfig => new CustomCallback(callbackConfig, yieldEvery)); -} -/** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ -class CallbackConstructorRegistry { - /** - * Blocks public access to constructor. - */ - constructor() { } - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - static registerCallbackConstructor(verbosityLevel, callbackConstructor) { - util.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), () => `Verbosity level is expected to be an integer >= 0, ` + - `but got ${verbosityLevel}`); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push(callbackConstructor); - } - static checkForDuplicate(callbackConstructor) { - for (const levelName in CallbackConstructorRegistry.constructors) { - const constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(ctor => { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - } - /** - * Clear all registered callback constructors. - */ - static clear() { - CallbackConstructorRegistry.constructors = {}; - } - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - static createCallbacks(verbosityLevel) { - const constructors = []; - for (const levelName in CallbackConstructorRegistry.constructors) { - const level = +levelName; - if (verbosityLevel >= level) { - constructors.push(...CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(ctor => new ctor()); - } -} -CallbackConstructorRegistry.constructors = {}; -function configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { - const history = new History(); - const actualCallbacks = [ - new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose) - ]; - if (callbacks != null) { - actualCallbacks.push(...callbacks); - } - actualCallbacks.push(history); - const callbackList = new CallbackList(actualCallbacks); - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - callbackList.setParams({ - epochs, - initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize, - verbose, - doValidation, - metrics: callbackMetrics, - }); - return { callbackList, history }; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ -function deserialize(config, customObjects = {}, fastWeightInit = false) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer', fastWeightInit); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ -function l2Normalize(x, axis) { - return tidy(() => { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - const squareSum = sum$1(square$1(x), axis, true); - const epsilonTensor = fill(squareSum.shape, epsilon()); - const norm = sqrt$1(maximum$2(squareSum, epsilonTensor)); - return div$1(x, norm); - }); -} -function meanSquaredError(yTrue, yPred) { - return tidy(() => mean$1(square$1(sub$1(yPred, yTrue)), -1)); -} -function meanAbsoluteError(yTrue, yPred) { - return tidy(() => mean$1(abs$1(sub$1(yPred, yTrue)), -1)); -} -function meanAbsolutePercentageError(yTrue, yPred) { - return tidy(() => { - const diff = sub$1(yTrue, yPred); - const clippedTrue = clipByValue$1(abs$1(yTrue), epsilon(), Number.MAX_VALUE); - const absResult = abs$1(div$1(diff, clippedTrue)); - return mul$1(100, mean$1(absResult, -1)); - }); -} -function meanSquaredLogarithmicError(yTrue, yPred) { - return tidy(() => { - const clippedPred = clipByValue$1(yPred, epsilon(), Number.MAX_VALUE); - const firstLog = log$1(add$3(1, clippedPred)); - const clippedTrue = clipByValue$1(yTrue, epsilon(), Number.MAX_VALUE); - const secondLog = log$1(add$3(1, clippedTrue)); - return mean$1(square$1(sub$1(firstLog, secondLog)), -1); - }); -} -function squaredHinge(yTrue, yPred) { - return tidy(() => { - const maxResult = maximum$2(0, sub$1(1, mul$1(yTrue, yPred))); - return mean$1(square$1(maxResult), -1); - }); -} -function hinge(yTrue, yPred) { - return tidy(() => { - const maxResult = maximum$2(0, sub$1(1, mul$1(yTrue, yPred))); - return mean$1(maxResult, -1); - }); -} -function categoricalHinge(yTrue, yPred) { - return tidy(() => { - const pos = sum$1(mul$1(yTrue, yPred), -1); - const neg = max$2(mul$1(sub$1(1, yTrue), yPred), -1); - return maximum$2(0, add$3(1, sub$1(neg, pos))); - }); -} -/** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ -function logcosh(yTrue, yPred) { - return tidy(() => { - const log2 = Math.log(2); - const predictionDiff = sub$1(yPred, yTrue); - const logcoshResult = sub$1(add$3(predictionDiff, softplus$1(mul$1(-2, predictionDiff))), log2); - return mean$1(logcoshResult, -1); - }); -} -function categoricalCrossentropy(target, output, fromLogits = false) { - return tidy(() => { - if (fromLogits) { - output = softmax$2(output); - } - else { - // scale preds so that the class probabilities of each sample sum to 1. - const outputSum = sum$1(output, output.shape.length - 1, true); - output = div$1(output, outputSum); - } - output = clipByValue$1(output, epsilon(), 1 - epsilon()); - return neg$1(sum$1(mul$1(target.toFloat(), log$1(output)), output.shape.length - 1)); - }); -} -/** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ -function sparseCategoricalCrossentropy(target, output, fromLogits = false) { - return tidy(() => { - const flatTarget = floor$1(flatten$1(target)).toInt(); - output = clipByValue$1(output, epsilon(), 1 - epsilon()); - const outputShape = output.shape; - const oneHotTarget = oneHot$1(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); -} -/** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ -function sigmoidCrossEntropyWithLogits(labels, logits) { - if (!util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError(`logits and labels must have the same shape, but got shapes ` + - `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`); - } - return tidy(() => { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - const reluLogits = logits.relu(); - const negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); -} -function binaryCrossentropy(yTrue, yPred) { - return tidy(() => { - let y; - y = clipByValue$1(yPred, epsilon(), 1 - epsilon()); - y = log$1(div$1(y, sub$1(1, y))); - return mean$1(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); -} -function kullbackLeiblerDivergence(yTrue, yPred) { - return tidy(() => { - const clippedTrue = clipByValue$1(yTrue, epsilon(), 1); - const clippedPred = clipByValue$1(yPred, epsilon(), 1); - return sum$1(mul$1(yTrue, log$1(div$1(clippedTrue, clippedPred))), -1); - }); -} -function poisson(yTrue, yPred) { - return tidy(() => { - const logPred = log$1(add$3(epsilon(), yPred)); - return mean$1(sub$1(yPred, mul$1(yTrue, logPred)), -1); - }); -} -function cosineProximity(yTrue, yPred) { - return tidy(() => { - const trueNormalized = l2Normalize(yTrue, -1); - const predNormalized = l2Normalize(yPred, -1); - const trueXPred = mul$1(trueNormalized, predNormalized); - return neg$1(sum$1(trueXPred, -1)); - }); -} -// TODO(michaelterry): Add deserialize() function. -const lossesMap = { - meanSquaredError, - meanAbsoluteError, - meanAbsolutePercentageError, - meanSquaredLogarithmicError, - squaredHinge, - hinge, - categoricalHinge, - logcosh, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - binaryCrossentropy, - kullbackLeiblerDivergence, - poisson, - cosineProximity -}; -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -function get(identifierOrFn) { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - let errMsg = `Unknown loss ${identifierOrFn}`; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = `Unknown loss ${identifierOrFn}. ` + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } - else { - return identifierOrFn; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function binaryAccuracy(yTrue, yPred) { - return tidy(() => { - const threshold = mul$1(.5, onesLike$1(yPred)); - const yPredThresholded = cast$1(greater$2(yPred, threshold), yTrue.dtype); - return mean$1(equal$1(yTrue, yPredThresholded), -1); - }); -} -function categoricalAccuracy(yTrue, yPred) { - return tidy(() => cast$1(equal$1(argMax$1(yTrue, -1), argMax$1(yPred, -1)), 'float32')); -} -function truePositives(yTrue, yPred) { - return tidy(() => { - return logicalAnd$1(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); -} -function falseNegatives(yTrue, yPred) { - return tidy(() => { - return logicalAnd$1(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); -} -function falsePositives(yTrue, yPred) { - return tidy(() => { - return logicalAnd$1(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); -} -function precision(yTrue, yPred) { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fp = falsePositives(yTrue, yPred); - const denominator = tp.add(fp); - return where$1(greater$2(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -function recall(yTrue, yPred) { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fn = falseNegatives(yTrue, yPred); - const denominator = tp.add(fn); - return where$1(greater$2(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -function binaryCrossentropy$1(yTrue, yPred) { - return binaryCrossentropy(yTrue, yPred); -} -function sparseCategoricalAccuracy(yTrue, yPred) { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return equal$1(yTrue, yPred).asType('float32'); -} -// Aliases. -const mse = meanSquaredError; -const MSE = meanSquaredError; -const mae = meanAbsoluteError; -const MAE = meanAbsoluteError; -const mape = meanAbsolutePercentageError; -const MAPE = meanAbsolutePercentageError; -const categoricalCrossentropy$1 = categoricalCrossentropy; -const cosine = cosineProximity; -const sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy; -// TODO(cais, nielsene): Add serialize(). -const metricsMap = { - binaryAccuracy, - categoricalAccuracy, - precision, - categoricalCrossentropy: categoricalCrossentropy$1, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, - mse, - MSE, - mae, - MAE, - mape, - MAPE, - cosine -}; -function get$1(identifier) { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } - else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } - else { - throw new ValueError(`Unknown metric ${identifier}`); - } -} -/** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ -function getLossOrMetricName(fn) { - assert$1(fn !== null, `Unknown LossOrMetricFn ${fn}`); - if (typeof fn === 'string') { - return fn; - } - else { - let fnName; - for (const key of Object.keys(lossesMap)) { - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (const key of Object.keys(metricsMap)) { - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return fn.name; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// Add (de)serialize() -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -function getOptimizer(identifier) { - const optimizerMap = { - 'Adagrad': () => train.adagrad(0.01), - 'Adadelta': () => train.adadelta(1, 0.95, epsilon()), - 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()), - 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0), - 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()), - 'SGD': () => train.sgd(0.01) - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError(`Unknown Optimizer ${identifier}`); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Utility functions related to user-defined metadata. */ -// Maximum recommended serialized size for user-defined metadata. -// Beyond this limit, a warning message will be printed during model loading and -// saving. -const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; -/** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ -function checkUserDefinedMetadata(userDefinedMetadata, modelName, checkSize = false) { - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error('User-defined metadata is expected to be a JSON object, but is not.'); - } - if (checkSize) { - const out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn(`User-defined metadata of model "${modelName}" is too large in ` + - `size (length=${out.length} when serialized). It is not ` + - `recommended to store such large objects in user-defined metadata. ` + - `Please make sure its serialized length is <= ` + - `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`); - } - } -} -/** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ -// tslint:disable-next-line:no-any -function plainObjectCheck(x) { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } - else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - const keys = Object.keys(x); - for (const key of keys) { - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (const item of x) { - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } - else { - // `x` is not a JavaScript object or `null`. - const xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ -function printSummary(model, lineLength, positions, -// tslint:disable-next-line:no-any -printFn = console.log) { - const sequentialLike = isModelSequentialLike(model); - // Header names for different log elements. - const toDisplay = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } - else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(p => Math.floor(lineLength * p)); - } - let relevantNodes; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (const depth in model.nodesByDepth) { - relevantNodes.push(...model.nodesByDepth[depth]); - } - } - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - const layers = model.layers; - for (let i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } - else { - printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - // tslint:disable-next-line:no-any - model.checkTrainableWeightsConsistency(); - const trainableCount = countTrainableParams(model); - const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - printFn(`Total params: ${trainableCount + nonTrainableCount}`); - printFn(`Trainable params: ${trainableCount}`); - printFn(`Non-trainable params: ${nonTrainableCount}`); - printFn('_'.repeat(lineLength)); -} -function countTrainableParams(model) { - let trainableCount; - // tslint:disable:no-any - if (model.collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights(model.collectedTrainableWeights); - } - else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; -} -function isModelSequentialLike(model) { - let sequentialLike = true; - const nodesByDepth = []; - const nodes = []; - for (const depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (const depthNodes of nodesByDepth) { - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push(...depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (const layer of model.layers) { - let flag = false; - for (const node of layer.inboundNodes) { - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } - else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; -} -function printRow(fields, positions, -// tslint:disable-next-line:no-any -printFn = console.log) { - let line = ''; - for (let i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); -} -/** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ -function printLayerSummary(layer, positions, -// tslint:disable-next-line:no-any -printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const name = layer.name; - const className = layer.getClassName(); - const fields = [`${name} (${className})`, outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); -} -/** - * Prints a summary for a single Layer, with connectivity information. - */ -function printLayerSummaryWithConnections(layer, positions, relevantNodes, -// tslint:disable-next-line:no-any -printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const connections = []; - for (const node of layer.inboundNodes) { - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (let i = 0; i < node.inboundLayers.length; ++i) { - const inboundLayer = node.inboundLayers[i].name; - const inboundLayerIndex = node.nodeIndices[i]; - const inboundTensorIndex = node.tensorIndices[i]; - connections.push(`${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`); - } - } - const name = layer.name; - const className = layer.getClassName(); - const firstConnection = connections.length === 0 ? '' : connections[0]; - const fields = [ - `${name} (${className})`, outputShape, layer.countParams().toString(), - firstConnection - ]; - printRow(fields, positions, printFn); - for (let i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ -function isArrayItemInputOrOutputName(key, index, value) { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; -} -/** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -function convertPythonicToTs(pythonicConfig, key) { - if (pythonicConfig === null) { - return null; - } - else if (typeof pythonicConfig === 'string') { - return toCamelCase(pythonicConfig); - } - else if ((typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } - else if (pythonicConfig instanceof Array) { - const tsArray = []; - const arrayLength = pythonicConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } - else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } - else { - const tsDict = {}; - for (const pythonicKey of Object.keys(pythonicConfig)) { - const pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } - else { - const tsKey = toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } -} -/** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -function convertTsToPythonic(tsConfig, key) { - if (tsConfig === null || tsConfig === undefined) { - return null; - } - else if (typeof tsConfig === 'string') { - return toSnakeCase(tsConfig); - } - else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } - else if (tsConfig instanceof Array) { - const pyArray = []; - const arrayLength = tsConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } - else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } - else { - const pyDict = {}; - for (const tsKey of Object.keys(tsConfig)) { - const tsValue = tsConfig[tsKey]; - const pyKey = toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } - else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } -} - -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function to check the dtype and shape compatibility of a feed value. - */ -function assertFeedCompatibility(key, val) { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return cast$2(val, key.dtype); - } - catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError(`The dtype of the feed (${val.dtype}) can not be cast to the dtype ` + - `of the key '${key.name}' (${key.dtype}).`); - } -} -/** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ -class FeedDict { - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - constructor(feeds) { - this.id2Value = {}; - this.id2Mask = {}; - this.name2Id = {}; - if (feeds instanceof FeedDict) { - for (const id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } - else { - if (feeds == null) { - return; - } - for (const feed of feeds) { - this.add(feed.key, feed.value); - } - } - } - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - add(key, value, mask) { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } - else { - throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`); - } - return this; - } - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - addFeed(feed) { - this.add(feed.key, feed.value); - } - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - hasKey(key) { - return this.id2Value[key.id] != null; - } - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - names() { - return Object.keys(this.name2Id); - } - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getValue(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Value[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Value[id]; - } - } - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getMask(key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } - else { - return this.id2Mask[key.id]; - } - } - else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Mask[id]; - } - } - /** Dispose all mask Tensors held by this object. */ - disposeMasks() { - if (this.id2Mask != null) { - dispose(this.id2Mask); - } - } -} -// Cache for topologically sorted SymbolicTensors for given execution -// targets (i.e., fetches). -const cachedSorted = {}; -// Cache for recipient count maps for given execution targets (i.e., fetches). -const cachedRecipientCounts = {}; -/** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ -function execute(fetches, feedDict, kwargs, probe) { - const training = kwargs == null ? false : kwargs['training']; - const arrayFetches = Array.isArray(fetches); - const fetchArray = arrayFetches ? fetches : [fetches]; - const outputNames = fetchArray.map(t => t.name); - const finalOutputs = []; - const feedNames = feedDict.names(); - for (const outputName of outputNames) { - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } - else { - finalOutputs.push(null); - } - } - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - // Check cache. - const fetchAndFeedKey = outputNames.join(',') + '|' + feedDict.names().join(','); - let sorted; - let recipientCounts; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - const internalFeedDict = new FeedDict(feedDict); - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (let i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - const numTensors = memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - const symbolic = sorted[i]; - const srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - const inputValues = []; - const inputMasks = []; - const tensorsToDispose = []; - let maskExists = false; - for (const input of symbolic.inputs) { - const value = internalFeedDict.getValue(input); - const mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - const outputTensors = toList(srcLayer.apply(inputValues, kwargs)); - let outputMask = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - const layerOutputs = getNodeOutputs(symbolic); - const outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (let i = 0; i < outputSymbolicTensors.length; ++i) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) { - internalFeedDict.add(outputSymbolicTensors[i], outputTensors[i], Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - const index = outputNames.indexOf(outputSymbolicTensors[i].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i]; - } - } - if (!training) { - // Clean up Tensors that are no longer needed. - dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - return arrayFetches ? finalOutputs : finalOutputs[0]; -} -/** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCounts(fetches, feedDict) { - util.assert(fetches != null && fetches.length > 0, () => `Expected at least one fetch, got none`); - let finalSorted = []; - let finalRecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - const out = getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } - else { - const visited = new Set(); - for (const fetch of fetches) { - const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict); - // Merge sorted SymbolicTensor Arrays. - for (const symbolicTensor of sorted) { - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - // Merge recipient maps. - for (const name in recipientMap) { - if (finalRecipientMap[name] == null) { - finalRecipientMap[name] = new Set(); - } - recipientMap[name].forEach(recipient => finalRecipientMap[name].add(recipient)); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; -} -function recipientMap2Counts(recipientMap) { - const recipientCounts = {}; - for (const name in recipientMap) { - recipientCounts[name] = recipientMap[name].size; - } - return recipientCounts; -} -/** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict) { - const visited = new Set(); - const sorted = []; - const recipientMap = {}; - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (const key of feedDict.names()) { - visited.add(key); - } - const stack = []; - const marks = []; - // Initial population of stack and marks. - stack.push(fetch); - while (stack.length > 0) { - const top = stack[stack.length - 1]; - if (visited.has(top.name)) { - stack.pop(); - continue; - } - const topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top); - visited.add(top.name); - if (topIsMarked) { - marks.pop(); - } - } - else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (const input of top.inputs) { - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top.name); - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return { sorted, recipientMap }; -} -/** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ -function getNodeOutputs(fetch) { - let layerOutputs; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } - else { - let nodeIndex = null; - for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (const outputTensor of fetch.sourceLayer.inboundNodes[i] - .outputTensors) { - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ -class Container extends Layer { - constructor(args) { - // No args passed to super's constructor. - super({}); - this.containerNodes = new Set(); - this.name = args.name; - if (this.name == null) { - const prefix = this.getClassName().toLowerCase(); - this.name = getUid(prefix); - } - this.supportsMasking = false; - this.trainable_ = true; - // TODO(michaelterry): Initialize perInputLosses/Updates here. - // Container-specific properties. - if (Array.isArray(args.inputs)) { - this.inputs = args.inputs.slice(); - } - else { - this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - this.outputs = args.outputs.slice(); - } - else { - this.outputs = [args.outputs]; - } - // Check for redundancy in inputs. - if (unique$1(this.inputs).length !== this.inputs.length) { - throw new ValueError('The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - `${this.inputs.map(x => x.name)}`); - } - // Check for redundancy in outputs. - if (unique$1(this.outputs).length !== this.outputs.length) { - console.warn('The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - `${this.outputs.map(x => x.name)}`); - } - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - this.inputLayers = []; - this.inputLayersNodeIndices = []; - this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - this.outputLayers = []; - this.outputLayersNodeIndices = []; - this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - this.layers = []; - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - this.internalContainerRefs = []; - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - // Build this.outputLayers: - for (const x of this.outputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - this.outputLayers.push(layer); - this.outputLayersNodeIndices.push(nodeIndex); - this.outputLayersTensorIndices.push(tensorIndex); - } - // TODO(michaelterry): Add output mask cache code. - // Build this.inputLayers: - for (const x of this.inputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - assert$1(nodeIndex === 0, 'input layer has >1 nodes'); - assert$1(tensorIndex === 0, 'input layer has >1 tensors'); - this.inputLayers.push(layer); - this.inputLayersNodeIndices.push(nodeIndex); - this.inputLayersTensorIndices.push(tensorIndex); - } - // Build this.inputNames and this.outputNames. - this.inputNames = []; - this.outputNames = []; - this.feedInputShapes = []; - this.feedInputNames = []; - this.feedOutputNames = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError('Input layers to a LayersModel must be InputLayer objects. ' + - `Received inputs: ${args.inputs}. ` + - `Input ${i} (0-based) originates ` + - `from layer type ${layer.getClassName()}.`); - } - this.inputNames.push(layer.name); - this.feedInputShapes.push(layer.batchInputShape); - this.feedInputNames.push(layer.name); - } - for (const layer of this.outputLayers) { - this.outputNames.push(layer.name); - } - this.internalInputShapes = this.inputs.map(x => x.shape); - this.internalOutputShapes = this.outputs.map(x => x.shape); - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - const nodesDepths = {}; - // To recover nodes from their ID. - const nodeIDToNode = {}; - const layersDepths = {}; - // To layers from their ID. - const layerIDToLayer = {}; - const layerIndices = {}; - const nodesInDecreasingDepth = []; - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - const buildMapOfGraph = (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) => { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - const node = layer.inboundNodes[nodeIndex]; - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError(`The tensor ${tensor.name} at layer "${layer.name}" ` + - 'is part of a cycle.'); - } - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - // Update containerNodes. - this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - // Propagate to all previous tensors connected to this node. - const numInboundLayers = node.inboundLayers.length; - for (let i = 0; i < numInboundLayers; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - buildMapOfGraph(x, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - const finishedNodes = []; - const nodesInProgress = []; - for (const x of this.outputs) { - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - const reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); - for (const node of reversedNodesInDecreasingDepth) { - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - let depth = nodesDepths[node.id]; - // Update the depth of the corresponding layer - const previousDepth = (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - // Update the depth of inbound nodes. - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const inboundNode = inboundLayer.inboundNodes[nodeIndex]; - const previousDepth = (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - // Build a dict {depth: list of nodes with this depth} - const nodesByDepth = {}; - for (const nodeID in nodesDepths) { - const depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - // Build a dict {depth: list of layers with this depth} - const layersByDepth = {}; - for (const layerID in layersDepths) { - const depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - // Get sorted list of layer depths. - let depthKeys = Object.keys(layersByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Set this.layers and this.layersByDepth. - this.layers = []; - for (const depth of depthKeys) { - const layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort((a, b) => { - const aIndex = layerIndices[a.id]; - const bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (const layer of layersForDepth) { - if (layer instanceof Container) { - this.internalContainerRefs.push(layer); - } - this.layers.push(layer); - } - } - this.layersByDepth = layersByDepth; - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - const computableTensors = this.inputs.slice(); - // To provide a better error msg. - const layersWithCompleteInput = []; - for (const depth of depthKeys) { - for (const node of nodesByDepth[depth]) { - const layer = node.outboundLayer; - if (layer != null) { - for (const x of node.inputTensors) { - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError(`Graph disconnected: cannot obtain value for tensor ${x}` + - ` at layer "${layer.name}". ` + - 'The following previous layers were accessed without ' + - `issue: ${layersWithCompleteInput}`); - } - } - for (const x of node.outputTensors) { - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - // Set this.containerNodes and this.nodesByDepth. - this.nodesByDepth = nodesByDepth; - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - const allNames = this.layers.map(x => x.name); - for (const name of allNames) { - const numOccurrences = allNames.filter(x => x === name).length; - if (numOccurrences !== 1) { - throw new RuntimeError(`The name "${name}" is used ${numOccurrences} times ` + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - } - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - this.inboundNodes = []; - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - inputMasks: this.inputs.map(x => null), - outputMasks: this.outputs.map(x => null), - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs.map(x => x.shape) - }); - this.built = true; - this._refCount = 1; // The ref count of a container always start at 1. - } - assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Container '${this.name}' is already disposed.`); - } - } - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - dispose() { - this.assertNotDisposed(); - const result = { refCountAfterDispose: null, numDisposedVariables: 0 }; - if (--this._refCount === 0) { - for (const layer of this.layers) { - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (const container of this.internalContainerRefs) { - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.layers.forEach(layer => { - // tslint:disable-next-line:no-any - layer._trainableWeights - .forEach(w => w.trainable = trainable); - }); - this.trainable_ = trainable; - } - get trainableWeights() { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - if (!this.trainable) { - return []; - } - let weights = []; - for (const layer of this.layers) { - weights = weights.concat(layer.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const layer of this.layers) { - weights.push(...layer.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const layer of this.layers) { - trainableWeights.push(...layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - get weights() { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - loadWeights(weights, strict = true) { - const nameToWeight = {}; - let totalWeightsCount = 0; - for (const layer of this.layers) { - for (const weight of layer.weights) { - if (nameToWeight[weight.originalName] != null) { - throw new ValueError(`Duplicate weight name: ${weight.originalName}`); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - const weightValueTuples = []; - for (const name in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - let validatedName = name; - if (nameToWeight[name] == null) { - const tokens = name.split('/'); - const shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name]]); - } - else if (strict) { - throw new ValueError(`Provided weight data has no target variable: ${name}`); - } - delete nameToWeight[validatedName]; - } - if (strict) { - // Check that all weights are set. - const unsetNames = []; - for (const name in nameToWeight) { - unsetNames.push(name); - } - if (unsetNames.length > 0) { - throw new ValueError(`${unsetNames.length} of ${totalWeightsCount} weights are not set: ` + - `${unsetNames}`); - } - } - batchSetValue(weightValueTuples); - } - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - updatedConfig() { - const theConfig = this.getConfig(); - const modelConfig = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = `tfjs-layers ${version}`; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - } - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - toJSON(unused, returnString = true) { - const modelConfig = convertTsToPythonic(this.updatedConfig()); - return returnString ? JSON.stringify(modelConfig) : modelConfig; - } - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - call(inputs, kwargs) { - return tidy(() => { - inputs = toList(inputs); - const feedDict = new FeedDict(); - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - return execute(this.outputs, feedDict, kwargs); - }); - } - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs, mask) { - return tidy(() => { - inputs = toList(inputs); - let masks; - if (mask == null) { - masks = pyListRepeat(null, inputs.length); - } - else { - masks = toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return this.runInternalGraph(inputs, masks)[1]; - }); - } - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - computeOutputShape(inputShape) { - const inputShapes = normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError(`Invalid inputShape argument ${inputShape}: ` + - `model has ${this.inputLayers.length} tensor inputs.`); - } - // TODO(michaelterry): Add caching - const layersToOutputShapes = {}; - for (let i = 0; i < inputShapes.length; i++) { - const layer = this.inputLayers[i]; - const inputShape = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - const shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - const inputShapes = []; - for (let j = 0; j < node.inboundLayers.length; j++) { - const inboundLayer = node.inboundLayers[j]; - const nodeIndex = node.nodeIndices[j]; - const tensorIndex = node.tensorIndices[j]; - const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`; - const inputShape = layersToOutputShapes[shapeKey]; - inputShapes.push(inputShape); - } - const outputShape = layer.computeOutputShape(singletonOrArray(inputShapes)); - const outputShapes = normalizeShapeList(outputShape); - const nodeIndex = layer.inboundNodes.indexOf(node); - for (let j = 0; j < outputShapes.length; j++) { - const shapeKey = `${layer.name}_${nodeIndex}_${j}`; - layersToOutputShapes[shapeKey] = outputShapes[j]; - } - } - } - } - // Read final output shapes from layersToOutputShapes. - const outputShapes = []; - const outputShapeKeys = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const tensorIndex = this.outputLayersTensorIndices[i]; - const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`; - outputShapeKeys.push(shapeKey); - } - for (let i = 0; i < outputShapeKeys.length; i++) { - const key = outputShapeKeys[i]; - assert$1(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - // TODO(michaelterry): Update cache - return singletonOrArray(outputShapes); - } - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - runInternalGraph(inputs, masks) { - if (masks == null) { - masks = pyListRepeat(null, inputs.length); - } - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - const tensorMap = {}; - for (let i = 0; i < this.inputs.length; ++i) { - const x = this.inputs[i]; - const y = inputs[i]; - const mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(reverseNumberCompare); - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - const referenceInputTensors = node.inputTensors; - const referenceOutputTensors = node.outputTensors; - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - const computedData = new Array(); - for (const x of referenceInputTensors) { - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - let kwargs = {}; - let computedTensors; - let computedMasks; - let outputTensors; - let outputMasks; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - const [computedTensor, computedMask] = computedData[0]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors = - toList(layer.call(computedTensor, kwargs)); - outputMasks = toList(layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } - else { - computedTensors = computedData.map(x => x[0]); - computedMasks = computedData.map(x => x[1]); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors = - toList(layer.call(computedTensors, kwargs)); - outputMasks = toList(layer.computeMask(computedTensors, computedMasks)); - } - if (layer.activityRegularizer) { - throw new NotImplementedError('LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - // Update tensor map. - for (let i = 0; i < referenceOutputTensors.length; ++i) { - const x = referenceOutputTensors[i]; - const y = outputTensors[i]; - const mask = outputMasks[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - const outputTensors = []; - const outputMasks = []; - const outputShapes = []; - for (const x of this.outputs) { - assert$1(x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); - const [tensor, mask] = tensorMap[x.id]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - } - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - buildNodeConversionMap(layers) { - const nodeConversionMap = {}; - let keptNodes; - for (const layer of this.layers) { - keptNodes = layer instanceof Container ? 1 : 0; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - } - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - getLayer(name, index) { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError(`Was asked to retrieve layer at index ${index}, but model only ` + - `has ${this.layers.length} layer(s).`); - } - else { - return this.layers[index]; - } - } - else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - for (const layer of this.layers) { - if (layer.name === name) { - return layer; - } - } - throw new ValueError(`No such layer: ${name}`); - } - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses() { - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tidy(() => { - const losses = []; - for (const layer of this.layers) { - for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (this.containerNodes.has(nodeKey)) { - losses.push(...layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - } - getConfig() { - const config = { name: this.name }; - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - const nodeConversionMap = this.buildNodeConversionMap(this.layers); - // Serialize and save the layers in layerConfigs - const layerConfigs = []; - for (const layer of this.layers) { - const layerClassName = layer.getClassName(); - const layerConfig = layer.getConfig(); - const filteredInboundNodes = []; - for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const node = layer.inboundNodes[originalNodeIndex]; - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - let kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } - catch (err) { - console.warn(`Layer ${layer.name} was passed ` + - `non-serializable keyword arguments: ` + - `${node.callArgs}. They will not be included ` + - `in the serialized model (and thus will be ` + - `missing at deserialization time).`); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - const nodeData = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - const nodeKey = Container.nodeKey(inboundLayer, nodeIndex); - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - const dict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - const modelInputs = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - const nodeIndex = this.inputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - const modelOutputs = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - } - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - // Layer instances created during - // the graph reconstruction process - const createdLayers = {}; - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - const unprocessedNodes = {}; - function addUnprocessedNode(layer, nodeData) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } - else { - unprocessedNodes[layer.name].push(nodeData); - } - } - function processNode(layer, nodeData) { - const inputTensors = []; - let kwargs; - for (const inputData of nodeData) { - const inboundLayerName = inputData[0]; - const inboundNodeIndex = inputData[1]; - const inboundTensorIndex = inputData[2]; - kwargs = inputData[3] == null ? - {} : - inputData[3]; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply(singletonOrArray(inputTensors), kwargs); // was ** kwargs - } - } - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData) { - const layerName = layerData['name']; - // Instantiate layer. - const layer = deserialize(layerData, config['customObjects'] != null ? - config['customObjects'] : - {}); - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - const inboundNodesData = layerData['inboundNodes']; - inboundNodesData.forEach(nodeData => { - if (!(nodeData instanceof Array)) { - throw new ValueError(`Corrupted configuration, expected array for nodeData: ${nodeData}`); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - // First, we create all layers and enqueue nodes to be processed. - const name = config['name']; - const layersFromConfig = config['layers']; - for (const layerData of layersFromConfig) { - processLayer(layerData); - } - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!isObjectEmpty(unprocessedNodes)) { - for (const layerData of layersFromConfig) { - const layer = createdLayers[layerData['name']]; - if (layer.name in unprocessedNodes) { - const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (const nodeData of currentUnprocessedNodesForLayer) { - processNode(layer, nodeData); - } - } - } - } - const inputTensors = []; - const outputTensors = []; - const inputLayersFromConfig = config['inputLayers']; - for (const layerData of inputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - const outputLayersFromConfig = config['outputLayers']; - for (const layerData of outputLayersFromConfig) { - const layerName = layerData[0]; - const nodeIndex = layerData[1]; - const tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({ inputs: inputTensors, outputs: outputTensors, name }); - } - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get stateful() { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (const layer of this.layers) { - if (layer.stateful) { - return true; - } - } - return false; - } - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - resetStates() { - tidy(() => { - this.layers.forEach(layer => { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) { - const numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(name => null); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } - else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [xWeight[outputNames[0]]]; - } - else { - return [xWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error(`Provided ${weightType} is an array of ${xWeight.length} ` + - `element(s), but the model has ${numOutputs} outputs. ` + - `Make sure a set of weights is provided for each model output.`); - } - return xWeight; - } - else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof xWeight[Object.keys(xWeight)[0]] === - 'object') { - const output = []; - outputNames.forEach(outputName => { - if (outputName in xWeight) { - output.push(xWeight[outputName]); - } - else { - output.push(null); - } - }); - return output; - } - else { - throw new Error(`The model has multiple (${numOutputs}) outputs, ` + - `so ${weightType} must be either an array with ` + - `${numOutputs} elements or an object with ${outputNames} keys. ` + - `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`); - } -} -/** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ -function standardizeClassWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight'); -} -/** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ -async function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) { - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - if (classWeight != null) { - // Apply class weights per sample. - const yClasses = tidy(() => { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone(); - } - else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - const axis = 1; - return y.argMax(axis); - } - else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } - else { - throw new Error(`Encountered unexpected last-dimension size (${y.shape[1]}) ` + - `during handling of class weights. The size is expected to be ` + - `>= 1.`); - } - } - else { - throw new Error(`Unexpected rank of target (y) tensor (${y.rank}) during ` + - `handling of class weights. The rank is expected to be 1 or 2.`); - } - }); - const yClassIndices = Array.from(await yClasses.data()); - dispose(yClasses); - const classSampleWeight = []; - yClassIndices.forEach(classIndex => { - if (classWeight[classIndex] == null) { - throw new Error(`classWeight must contain all classes in the training data. ` + - `The class ${classIndex} exists in the data but not in ` + - `classWeight`); - } - else { - classSampleWeight.push(classWeight[classIndex]); - } - }); - return tensor1d(classSampleWeight, 'float32'); - } - else { - return null; - } -} -/** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ -function computeWeightedLoss(losses, sampleWeights) { - return mul$1(losses, sampleWeights); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// Default batch size used during tensor-based validation. -const DEFAULT_VALIDATION_BATCH_SIZE = 32; -/** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ -function standardizeDataIteratorOutput( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, iteratorOut) { - let xs; - let ys; - const iteratorOutObj = iteratorOut; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - util.assert(xs != null && ys != null, () => 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - `${iteratorOut}`); - const flattenedXs = flattenTensorOrArrayOrMap('input', model.inputNames, xs); - const flattenedYs = flattenTensorOrArrayOrMap('output', model.outputNames, ys); - const batchSize = flattenedXs[0].shape[0]; - util.assert(flattenedXs.length === model.inputs.length, () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` + - `provides ${flattenedXs.length} inputs. (Expected input keys: ` + - `${JSON.stringify(model.inputNames)})`); - util.assert(flattenedYs.length === model.outputs.length, () => `LayersModel has ${model.outputs.length} outputs, but the dataset ` + - `provides ${flattenedYs.length} outputs. (Expected output keys: ` + - `${JSON.stringify(model.outputNames)})`); - for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - util.assert(flattenedXs[xIndex].shape[0] === batchSize, () => `Batch size mismatch: input ` + - `${model.inputNames[xIndex]} has ${flattenedXs[xIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - util.assert(flattenedYs[yIndex].shape[0] === batchSize, () => `Batch size mismatch: output ` + - `${model.outputNames[yIndex]} has ${flattenedYs[yIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - return { xs: flattenedXs, ys: flattenedYs }; -} -function flattenTensorOrArrayOrMap(inputOrOutput, names, values) { - if (values instanceof Tensor$1) { - return [values]; - } - else if (Array.isArray(values)) { - util.assert(values.length === names.length, () => `Received an array of ${values.length} Tensors, but expected ${names.length} to match the ${inputOrOutput} keys ${names}.`); - return values; - } - else { - const result = []; - // Check that all the required keys are available. - for (const name of names) { - if (values[name] == null) { - throw new ValueError(`The feature data generated by the dataset lacks the required ` + - `${inputOrOutput} key '${name}'.`); - } - result.push(values[name]); - } - return result; - } -} -function standardizeTensorValidationData(data) { - if (data.length === 3) { - throw new NotImplementedError('Validation with sample weights is not implemented yet.'); - } - return { xs: data[0], ys: data[1] }; -} -async function fitDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - const hasBatchesPerEpoch = args.batchesPerEpoch != null; - util.assert(model.optimizer != null, () => 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'); - util.assert(args != null, () => `For fitDataset(), the 2nd argument (config) is required, ` + - `but it is not provided in this call.`); - util.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), () => `For fitDataset(), config.epochs is expected to be a positive ` + - `integer, but got ${args.epochs}`); - util.assert(!hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` + - `positive integer if specified, but got ${args.batchesPerEpoch}`); - util.assert( - // tslint:disable-next-line:no-any - args['validationSplit'] == null, () => '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'); - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - try { - const doValidation = args.validationData != null; - let valXs; - let valYs; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - util.assert(args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), () => `For fitDataset() with dataset-based validation, ` + - `config.validationBatches is expected not to be provided, ` + - `or to be a positive integer, ` + - `but got ${args.validationBatches}`); - } - else { - const validationData = standardizeTensorValidationData(args.validationData); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let callbackMetrics; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const verbose = args.verbose == null ? 1 : args.verbose; - const { callbackList, history } = configureCallbacks(callbacks, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - let epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - let dataIterator = await dataset.iterator(); - while (epoch < args.epochs) { - const epochLogs = {}; - await callbackList.onEpochBegin(epoch); - let stepsDone = 0; - let batchIndex = 0; - if (!hasBatchesPerEpoch) { - dataIterator = await dataset.iterator(); - } - while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) { - const iteratorOut = await dataIterator.next(); - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn('You provided `batchesPerEpoch` as ' + - `${args.batchesPerEpoch}, ` + - 'but your dataset iterator ran out of data after ' + - `${stepsDone} batches; ` + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - `${args.batchesPerEpoch * args.epochs} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - break; - } - if (iteratorOut.value != null) { - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const batchLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - await callbackList.onBatchBegin(batchIndex, batchLogs); - const sampleWeights = []; - if (args.classWeight != null) { - const standardClassWeights = standardizeClassWeights(args.classWeight, model.outputNames); - for (let i = 0; i < standardClassWeights.length; ++i) { - sampleWeights.push(await standardizeWeights(ys[i], null, standardClassWeights[i])); - } - } - // Train on batch. - const ins = xs.concat(ys).concat(sampleWeights); - const outs = trainFunction(ins); - dispose(ins); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - keep(out); - } - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - batchIndex++; - stepsDone++; - } - if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done) { - // Epoch finished. Perform validation. - if (doValidation) { - let valOuts; - if (isDatasetObject(args.validationData)) { - valOuts = toList(await model.evaluateDataset(args.validationData, { batches: args.validationBatches })); - } - else { - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - } - for (let i = 0; i < model.metricsNames.length; ++i) { - epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i]; - } - } - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - break; - } - if (model.stopTraining_) { - break; - } - } - await callbackList.onEpochEnd(epoch, epochLogs); - epoch++; - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; - } - finally { - model.isTraining = false; - } -} -/** Helper function that determines number of steps (batches) per epoch. */ -function getStepsPerEpoch(dataset, args) { - // Attempt to determine # of batches in an epoch. - let stepsPerEpoch = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } - else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; -} -// Check if provided object is a Dataset object by checking its .iterator -// element. -function isDatasetObject(dataset) { - return (typeof dataset.iterator === 'function'); -} -// Check if provided object is a LazyIterator object by checking it's .next -// element. -function isLazyIteratorObject(iterator) { - return (typeof iterator.next === 'function'); -} -async function evaluateDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - args = args || {}; - const hasBatches = args.batches != null; - const f = model.testFunction; - let outs = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - util.assert(!hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), () => 'Test loop expects `batches` to be a positive integer, but ' + - `received ${JSON.stringify(args.batches)}`); - const dataIterator = isLazyIteratorObject(dataset) ? - dataset : - await dataset.iterator(); - // Keeps track of number of examples used in this evaluation. - let numExamples = 0; - let batch = 0; - while (hasBatches ? batch < args.batches : true) { - const iteratorOut = await dataIterator.next(); - outs = tidy(() => { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - const { xs, ys } = standardizeDataIteratorOutput(model, iteratorOut.value); - const xsAndYs = xs.concat(ys); - const batchOuts = tidy(() => f(xsAndYs)); - dispose(xsAndYs); - if (batch === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar$1(0)); - } - } - const batchSize = xsAndYs[0].shape[0]; - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - const oldScalar = outs[i]; - outs[i] = - tidy(() => add$3(outs[i], mul$1(batchSize, batchOut))); - if (batch > 0) { - dispose(oldScalar); - } - } - dispose(batchOuts); - numExamples += batchSize; - ++batch; - } - return outs; - }); - if (iteratorOut.done) { - if (hasBatches) { - console.warn('Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - `batches (in this case, ${args.batches} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - break; - } - } - for (let i = 0; i < outs.length; ++i) { - const oldScalar = outs[i]; - outs[i] = div$1(outs[i], numExamples); - dispose(oldScalar); - } - return singletonOrArray(outs); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function checkBatchSize(batchSize) { - util.assert(batchSize > 0 && Number.isInteger(batchSize), () => `batchSize is required to be a positive integer, but got ${batchSize}`); -} -/** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ -function sliceArrays(arrays, start, stop) { - if (arrays == null) { - return [null]; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start)); - } - else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } -} -/** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ -function sliceArraysByIndices(arrays, indices) { - return tidy(() => { - if (arrays == null) { - return null; - } - else if (Array.isArray(arrays)) { - return arrays.map(array => sliceArraysByIndices(array, indices)); - } - else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather$1(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); -} -/** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ -function makeBatches(size, batchSize) { - const output = []; - let batchStart = 0; - let batchEnd = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; -} -/** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ -async function fitLoop( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - // TODO(cais): Change const to let below when implementing validation. - let doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - const numTrainSamples = model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - let indexArray; - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - if (verbose == null) { - verbose = 1; - } - const { callbackList, history } = configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - // TODO(cais): Take care of callbacks.validation_data as in PyKeras. - // TODO(cais): Pre-convert feeds for performance as in PyKeras. - for (let epoch = initialEpoch; epoch < epochs; ++epoch) { - await callbackList.onEpochBegin(epoch); - const epochLogs = {}; - if (stepsPerEpoch != null) { - throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); - } - else { - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } - else if (shuffle) { - util.shuffle(indexArray); - } - // Convert the potentially shuffled indices to Tensor1D, to avoid the - // cost of repeated creation of Array1Ds later on. - const epochIndexArray1D = tensor1d(indexArray); - const batches = makeBatches(numTrainSamples, batchSize); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchLogs = {}; - await callbackList.onBatchBegin(batchIndex, batchLogs); - tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis(epochIndexArray1D, batchStart, batchEnd - batchStart); - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const outs = f(insBatch); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - if (batchIndex === batches.length - 1) { // Last batch. - if (doValidation) { - const valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = valOuts[i]; - keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - if (model.stopTraining_) { - break; - } - // TODO(cais): return outs as list of Tensor. - } - epochIndexArray1D.dispose(); - } - // TODO(cais): Run validation at the end of the epoch. - await callbackList.onEpochEnd(epoch, epochLogs); - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; -} -async function fitTensors( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, x, y, args = {}) { - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - let inputs; - let targets; - let inputValX; - let inputValY; - let valX; - let valY; - let sampleWeights; - try { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // Validate user data. - // TODO(cais): Support sampleWeight. - const checkBatchAxis = false; - const standardizedOuts = await model.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize); - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - // Prepare validation data. - let doValidation = false; - let valIns; - if (args.validationData != null && args.validationData.length > 0) { - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } - else if (args.validationData.length === 3) { - throw new NotImplementedError('validationData including sample weights is not supported yet.'); - } - else { - throw new ValueError(`When passing validation data, it must contain 2 (valX, valY) ` + - `or 3 (valX, valY, valSampleWeight) items; ` + - `${args.validationData} is invalid.`); - } - const checkBatchAxis = true; - const valStandardized = await model.standardizeUserData(inputValX, inputValY, null, /** Unused sample weights. */ null, /** Unused class weights. */ checkBatchAxis, batchSize); - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - // Porting Note: In tfjs-layers, inputs[0] is always a Tensor. - const splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - const originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize); - inputs = sliceArrays(inputs, 0, splitAt); - valY = sliceArrays(targets, splitAt, originalBatchSize); - targets = sliceArrays(targets, 0, splitAt); - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - const ins = inputs.concat(targets).concat(sampleWeights); - model.checkTrainableWeightsConsistency(); - // TODO(cais): Handle use_learning_phase and learning_phase? - // Porting Note: Here we see a key deviation of tfjs-layers from - // Keras. - // Due to the imperative nature of tfjs-layers' backend (tfjs-core), - // we do not construct symbolic computation graphs to embody the - // training process. Instead, we define a function that performs the - // training action. In PyKeras, the data (inputs and targets) are fed - // through graph placeholders. In tfjs-layers, the data are fed as - // function arguments. Since the function are defined below in the - // scope, we don't have equivalents of PyKeras's - // `_make_train_funciton`. - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames(); - let valFunction; - let callbackMetrics; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } - else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const out = await fitLoop(model, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); - return out; - } - finally { - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX, inputValX); - disposeNewTensors(valY, inputValY); - if (sampleWeights != null) { - dispose(sampleWeights); - } - } - // TODO(cais): Add value to outLabels. -} -/** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ -function ensureTensorsRank2OrHigher(tensors) { - const outs = []; - if (tensors instanceof Tensor$1) { - tensors = [tensors]; - } - // Make Tensors at least 2D. - for (let i = 0; i < tensors.length; ++i) { - const tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims$1(tensor, 1)); - } - else if (tensor.rank === 0) { - throw new Error('Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } - else { - outs.push(tensor); - } - } - return outs; -} -/** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ -// TODO(cais, kangyizhang): Deduplicate with tfjs-data. -function disposeNewTensors(tensors, refTensors) { - if (tensors == null) { - return; - } - const oldTensorIds = []; - if (refTensors instanceof Tensor$1) { - oldTensorIds.push(refTensors.id); - } - else if (Array.isArray(refTensors)) { - refTensors.forEach(t => oldTensorIds.push(t.id)); - } - else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in refTensors) { - const oldTensor = refTensors[name]; - oldTensorIds.push(oldTensor.id); - } - } - const tensorsToDispose = []; - if (tensors instanceof Tensor$1) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } - else if (Array.isArray(tensors)) { - tensors.forEach(t => { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } - else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in tensors) { - const tensor = tensors[name]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - tensorsToDispose.forEach(t => { - if (!t.isDisposed) { - t.dispose(); - } - }); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ -function isDataTensor(x) { - return x instanceof Tensor$1; -} -/** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ -function isDataArray(x) { - return Array.isArray(x); -} -/** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ -function isDataDict(x) { - return !isDataTensor(x) && !isDataArray(x); -} -/** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ -function standardizeInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - let gotUnexpectedData = false; - if (isDataArray(data) && data.length > 0) { - gotUnexpectedData = true; - } - else if (isDataDict(data)) { - for (const key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } - else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError(`Error when checking model ${exceptionPrefix} expected no data, ` + - `but got ${data}`); - } - } - return []; - } - if (data == null) { - return names.map(name => null); - } - let arrays; - if (isDataDict(data)) { - data = data; - arrays = []; - for (const name of names) { - if (data[name] == null) { - throw new ValueError(`No data provided for "${name}". Need data for each key in: ` + - `${names}`); - } - arrays.push(data[name]); - } - } - else if (isDataArray(data)) { - data = data; - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `model expected. Expected to see ${names.length} Tensor(s), but ` + - `instead got the following list of Tensor(s): ${data}`); - } - arrays = data; - } - else { - data = data; - if (names.length > 1) { - throw new ValueError(`The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` + - `but only received one Tensor. Found: Tensor with shape ${data.shape}`); - } - arrays = [data]; - } - arrays = ensureTensorsRank2OrHigher(arrays); - // Check shape compatibility. - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s). but got array with ` + - `shape ${array.shape}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have shape [${shapes[i]}], but got array with shape ` + - `[${array.shape}].`); - } - } - } - } - return arrays; -} -/** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ -function checkArrayLengths(inputs, targets, weights) { - const setX = unique$1(inputs.map(input => input.shape[0])); - setX.sort(); - const setY = unique$1(targets.map(target => target.shape[0])); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError(`All input Tensors (x) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(inputs.map(input => input.shape))}`); - } - if (setY.length > 1) { - throw new ValueError(`All target Tensors (y) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(targets.map(target => target.shape))}`); - } - if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) { - throw new ValueError(`Input Tensors should have the same number of samples as target ` + - `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` + - `sample(s).`); - } -} -/** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ -function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { - // TODO(cais): Dedicated test coverage? - const keyLosses = [ - meanSquaredError, binaryCrossentropy, - categoricalCrossentropy - ]; - for (let i = 0; i < targets.length; ++i) { - const y = targets[i]; - const loss = lossFns[i]; - const shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError(`You are passing a target array of shape ${y.shape} while using ` + - `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` + - `expects targets to be binary matrices (1s and 0s) of shape ` + - `[samples, classes].`); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - const slicedYShape = y.shape.slice(1); - const slicedShape = shape.slice(1); - for (let j = 0; j < slicedYShape.length; ++j) { - const targetDim = slicedYShape[j]; - const outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError(`A target Tensor with shape ${y.shape} was passed for an ` + - `output of shape ${shape}, while using a loss function that ` + - `expects targets to have the same shape as the output.`); - } - } - } - } -} -/** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ -function checkInputData(data, names, shapes, checkBatchAxis = true, exceptionPrefix = '') { - let arrays; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError(`Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `the model expected. Expected to see ${names.length} Tensor(s),` + - ` but instead got ${data.length} Tensors(s).`); - } - arrays = data; - } - else { - if (names.length > 1) { - throw new ValueError(`The model expects ${names.length} ${exceptionPrefix} Tensors, ` + - `but only received one Tensor. Found: array with shape ` + - `${JSON.stringify(data.shape)}.`); - } - arrays = [data]; - } - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s), but got array with ` + - `shape ${JSON.stringify(array.shape)}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ` + - `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` + - `got array with shape ${JSON.stringify(array.shape)}.`); - } - } - } - } - } -} -/** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ -function collectMetrics(metrics, outputNames) { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(name => []); - } - let wrappedMetrics; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } - else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics; - } - else { - throw new TypeError('Type of metrics argument not understood. Expected an string,' + - `function, Array, or Object, found: ${metrics}`); - } - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map(name => wrappedMetrics); - } - else { - // In this case, metrics is a dict. - const nestedMetrics = []; - for (const name of outputNames) { - let outputMetrics = wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } -} -const LAYERS_MODEL_FORMAT_NAME = 'layers-model'; -/** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -class LayersModel extends Container { - constructor(args) { - super(args); - this.isTraining = false; - } - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - throw new ValueError(`This model has never been called, thus its weights have not been ` + - `created yet. So no summary can be displayed. Build the model ` + - `first (e.g., by calling it on some test data).`); - } - printSummary(this, lineLength, positions, printFn); - } - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - compile(args) { - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - if (typeof args.optimizer === 'string') { - this.optimizer_ = getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } - else { - if (!(args.optimizer instanceof Optimizer)) { - throw new ValueError(`User-defined optimizer must be an instance of tf.Optimizer.`); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - // Prepare loss functions. - let lossFunctions = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss; - for (const name in args.loss) { - if (this.outputNames.indexOf(name) === -1) { - throw new ValueError(`Unknown entry in loss dictionary: "${name}". ` + - `Only expected the following keys: ${this.outputNames}`); - } - } - for (const name of this.outputNames) { - if (args.loss[name] == null) { - console.warn(`Output "${name}" is missing from loss dictionary. We assume ` + - `this was done on purpose, and we will not be expecting data ` + - `to be passed to ${name} during training`); - } - lossFunctions.push(get(args.loss[name])); - } - } - else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError(`When passing an Array as loss, it should have one entry per ` + - `model output. The model has ${this.outputs.length} output(s), ` + - `but you passed loss=${args.loss}.`); - } - const theLosses = args.loss; - lossFunctions = theLosses.map(l => get(l)); - } - else { - const lossFunction = get(args.loss); - this.outputs.forEach(_ => { - lossFunctions.push(lossFunction); - }); - } - this.lossFunctions = lossFunctions; - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (let i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - const shape = this.internalOutputShapes[i]; - const name = this.outputNames[i]; - this.feedOutputNames.push(name); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - const skipTargetIndices = []; - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - const weightedLoss = this.lossFunctions[i]; - if (this.outputs.length > 1) { - this.metricsTensors.push([weightedLoss, i]); - this.metricsNames.push(this.outputNames[i] + '_loss'); - } - } - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - const nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - /** - * Helper function used in loop below. - */ - const appendMetric = (outputIndex, metricName, metricTensor) => { - if (this.outputNames.length > 1) { - metricName = this.outputNames[outputIndex] + '_' + metricName; - } - this.metricsNames.push(metricName); - this.metricsTensors.push([metricTensor, outputIndex]); - }; - nameScope('metric', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - const outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - // TODO(cais): Add optional arg `weights` to the following function. - const handleMetrics = (metrics) => { - const metricNamePrefix = ''; - let metricName; - let accFn; - let weightedMetricFn; - // TODO(cais): Use 'weights_' for weighted metrics. - for (const metric of metrics) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - const outputShape = this.internalOutputShapes[i]; - if (outputShape[outputShape.length - 1] === 1 || - this.lossFunctions[i] === binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = binaryAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = binaryCrossentropy$1; - } - } - else if (this.lossFunctions[i] === - sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = sparseCategoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = sparseCategoricalCrossentropy$1; - } - } - else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = categoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = categoricalCrossentropy$1; - } - } - let suffix; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } - else { - const metricFn = get$1(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + getLossOrMetricName(metric); - } - // TODO(cais): Add weighting and masking to metricResult. - let metricResult; - nameScope(metricName, () => { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - } - }; - handleMetrics(outputMetrics); - // TODO(cais): Call handleMetrics with weights. - } - }); - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - } - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - checkTrainableWeightsConsistency() { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn('Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - const checkBatchAxis = true; - const standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - const ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - const f = this.testFunction; - const testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } - finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - this.makeTestFunction(); - return evaluateDataset(this, dataset, args); - } - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - checkNumSamples(ins, batchSize, steps, stepsName = 'steps') { - let numSamples; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError(`If ${stepsName} is set, batchSize must be null or undefined.` + - `Got batchSize = ${batchSize}`); - } - } - else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } - else { - numSamples = ins.shape[0]; - } - } - else { - throw new ValueError(`Either the input data should have a defined shape, or ` + - `${stepsName} shoud be specified.`); - } - return numSamples; - } - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - execute(inputs, outputs) { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError('`outputs` is an empty Array, which is not allowed.'); - } - const outputsIsArray = Array.isArray(outputs); - const outputNames = (outputsIsArray ? outputs : [outputs]); - const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - // Format the input into a FeedDict. - const feedDict = new FeedDict(); - if (inputs instanceof Tensor$1) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError(`The number of inputs provided (${inputs.length}) ` + - `does not match the number of inputs of this model ` + - `(${this.inputs.length}).`); - } - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } - else { - for (const input of this.inputs) { - const tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError(`No value is provided for the model's input ${input.name}`); - } - feedDict.add(input, tensorValue); - } - } - // Run execution. - const executeOutputs = execute(outputSymbolicTensors, feedDict); - return outputsIsArray ? executeOutputs : executeOutputs[0]; - } - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - retrieveSymbolicTensors(symbolicTensorNames) { - const outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); - let outputsRemaining = symbolicTensorNames.length; - for (const layer of this.layers) { - const layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; - const layerOutputNames = layerOutputs.map(output => output.name); - for (let i = 0; i < symbolicTensorNames.length; ++i) { - const index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining > 0) { - const remainingNames = []; - outputSymbolicTensors.forEach((tensor, i) => { - if (tensor == null) { - remainingNames.push(symbolicTensorNames[i]); - } - }); - throw new ValueError(`Cannot find SymbolicTensors for output name(s): ` + - `${JSON.stringify(remainingNames)}`); - } - return outputSymbolicTensors; - } - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - predictLoop(ins, batchSize = 32, verbose = false) { - return tidy(() => { - const numSamples = this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); - } - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - const batches = makeBatches(numSamples, batchSize); - const outsBatches = this.outputs.map(output => []); - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchOuts = tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - const insBatch = sliceArrays(ins, batchStart, batchEnd); - // Construct the feeds for execute(); - const feeds = []; - if (Array.isArray(insBatch)) { - for (let i = 0; i < insBatch.length; ++i) { - feeds.push({ key: this.inputs[i], value: insBatch[i] }); - } - } - else { - feeds.push({ key: this.inputs[0], value: insBatch }); - } - const feedDict = new FeedDict(feeds); - return execute(this.outputs, feedDict); - }); - batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut)); - } - return singletonOrArray(outsBatches.map(batches => concat$1(batches, 0))); - }); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - const xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } - finally { - disposeNewTensors(xsRank2OrHigher, x); - } - } - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predictOnBatch(x) { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - } - standardizeUserDataXY(x, y, checkBatchAxis = true, batchSize) { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError('You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - const outputShapes = []; - for (let i = 0; i < this.feedOutputShapes.length; ++i) { - const outputShape = this.feedOutputShapes[i]; - const lossFn = this.feedLossFns[i]; - if (lossFn === sparseCategoricalCrossentropy) { - outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); - } - else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError(`In a stateful network, you should only pass inputs with a ` + - `number of samples that is divisible by the batch size ` + - `${batchSize}. Found: ${x[0].shape[0]} sample(s).`); - } - } - return [x, y]; - } - async standardizeUserData(x, y, sampleWeight, classWeight, checkBatchAxis = true, batchSize) { - const [standardXs, standardYs] = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - let standardSampleWeights = null; - if (classWeight != null) { - const classWeights = standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - for (let i = 0; i < classWeights.length; ++i) { - standardSampleWeights.push(await standardizeWeights(standardYs[i], null, classWeights[i])); - } - } - // TODO(cais): Deal with the case of model.stateful == true. - return [standardXs, standardYs, standardSampleWeights]; - } - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - testLoop(f, ins, batchSize, verbose = 0, steps) { - return tidy(() => { - const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps'); - const outs = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); - } - else { - const batches = makeBatches(numSamples, batchSize); - const indexArray = tensor1d(range(0, numSamples)); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds); - const batchOuts = f(insBatch); - if (batchIndex === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar$1(0)); - } - } - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - outs[i] = - add$3(outs[i], mul$1(batchEnd - batchStart, batchOut)); - } - } - for (let i = 0; i < outs.length; ++i) { - outs[i] = div$1(outs[i], numSamples); - } - } - return outs; - }); - } - getDedupedMetricsNames() { - const outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - const dedupedOutLabels = []; - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - let newLabel = label; - if (count(outLabels, label) > 1) { - const dupIndex = count(outLabels.slice(0, i), label); - newLabel += `_${dupIndex}`; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - } - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - makeTrainFunction() { - return (data) => { - const lossValues = []; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const sampleWeights = data.slice(this.inputs.length + this.outputs.length, this.inputs.length + this.outputs.length * 2); - const metricsValues = []; - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - const totalLossFunction = () => { - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict, { 'training': true }); - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - let totalLoss; - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - let loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - // TODO(cais): push Scalar instead. - const meanLoss = mean$1(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = add$3(totalLoss, loss); - } - } - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (let i = 0; i < this.metricsTensors.length; ++i) { - let weightedMetric; - if (this.outputs.length > 1 && i < this.outputs.length) { - weightedMetric = lossValues[i]; - } - else { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - weightedMetric = - mean$1(metric(targets[outputIndex], outputs[outputIndex])); - } - keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - totalLoss = mean$1(totalLoss); - // Add regularizer penalties. - this.calculateLosses().forEach(regularizerLoss => { - totalLoss = add$3(totalLoss, regularizerLoss); - }); - return totalLoss; - }; - const variables = this.collectedTrainableWeights.map(param => param.read()); - const returnCost = true; - const totalLossValue = this.optimizer_.minimize(totalLossFunction, returnCost, variables); - return [totalLossValue].concat(metricsValues); - }; - } - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - makeTestFunction() { - this.testFunction = (data) => { - return tidy(() => { - const valOutputs = []; - let totalLoss; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({ key: this.inputs[i], value: inputs[i] }); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict); - // Compute total loss. - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - const loss = mean$1(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = add$3(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (let i = 0; i < this.metricsTensors.length; ++i) { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - const meanMetric = mean$1(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric); - } - return valOutputs; - }); - }; - } - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - return fitTensors(this, x, y, args); - } - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fitDataset(dataset, args) { - return fitDataset(this, dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - // TODO(cais): Support sampleWeight and classWeight. - // TODO(cais): Support Dataset objects. - const standardizeOut = await this.standardizeUserData(x, y); - const inputs = standardizeOut[0]; - const targets = standardizeOut[1]; - const trainFunction = this.makeTrainFunction(); - const losses = trainFunction(inputs.concat(targets)); - const lossValues = []; - for (const loss of losses) { - const v = await loss.data(); - lossValues.push(v[0]); - } - dispose(losses); - return singletonOrArray(lossValues); - } - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - getNamedWeights(config) { - const namedWeights = []; - const trainableOnly = config != null && config.trainableOnly; - const weights = trainableOnly ? this.trainableWeights : this.weights; - const weightValues = this.getWeights(trainableOnly); - for (let i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); - } - return namedWeights; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - this.stopTraining_ = stop; - } - get stopTraining() { - return this.stopTraining_; - } - get optimizer() { - return this.optimizer_; - } - set optimizer(optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - } - dispose() { - const result = super.dispose(); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - const numTensorsBeforeOptmizerDisposal = memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - memory().numTensors; - } - return result; - } - getLossIdentifiers() { - let lossNames; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss); - } - else if (Array.isArray(this.loss)) { - for (const loss of this.loss) { - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = this.loss.map(name => toSnakeCase(name)); - } - else { - const outputNames = Object.keys(this.loss); - lossNames = {}; - const losses = this.loss; - for (const outputName of outputNames) { - if (typeof losses[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses[outputName]); - } - else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - } - getMetricIdentifiers() { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(getLossOrMetricName(this.metrics))]; - } - else if (Array.isArray(this.metrics)) { - return this.metrics.map(metric => toSnakeCase(getLossOrMetricName(metric))); - } - else { - const metricsIdentifiers = {}; - for (const key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - } - getTrainingConfig() { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - } - loadTrainingConfig(trainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config); - const optimizer = deserialize(tsConfig); - let loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } - else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry)); - } - else if (trainingConfig.loss != null) { - loss = {}; - for (const key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]); - } - } - let metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(metric => toCamelCase(metric)); - } - else if (trainingConfig.metrics != null) { - metrics = {}; - for (const key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - this.compile({ loss, metrics, optimizer }); - } - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async save(handlerOrURL, config) { - if (typeof handlerOrURL === 'string') { - const handlers = io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError(`Cannot find any save handlers for URL '${handlerOrURL}'`); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) save handlers for ` + - `URL '${handlerOrURL}'`); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError('LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - const weightDataAndSpecs = await io.encodeWeights(this.getNamedWeights(config)); - const returnString = false; - const unusedArg = null; - const modelConfig = this.toJSON(unusedArg, returnString); - const modelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: `TensorFlow.js tfjs-layers v${version}`, - convertedBy: null, - }; - const includeOptimizer = config == null ? false : config.includeOptimizer; - if (includeOptimizer && this.optimizer != null) { - modelArtifacts.trainingConfig = this.getTrainingConfig(); - const weightType = 'optimizer'; - const { data: optimizerWeightData, specs: optimizerWeightSpecs } = await io.encodeWeights(await this.optimizer.getWeights(), weightType); - weightDataAndSpecs.specs.push(...optimizerWeightSpecs); - weightDataAndSpecs.data = io.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); - } - if (this.userDefinedMetadata != null) { - // Check serialized size of user-defined metadata. - const checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return handlerOrURL.save(modelArtifacts); - } - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - setUserDefinedMetadata(userDefinedMetadata) { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - } - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - getUserDefinedMetadata() { - return this.userDefinedMetadata; - } -} -// The class name is 'Model' rather than 'LayersModel' for backwards -// compatibility since this class name shows up in the serialization format. -/** @nocollapse */ -LayersModel.className = 'Model'; -serialization.registerClass(LayersModel); -/** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ -/** @doc {heading: 'Models', subheading: 'Classes'} */ -class Functional extends LayersModel { -} -Functional.className = 'Functional'; -serialization.registerClass(Functional); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ -async function modelFromJSON(modelAndWeightsConfig, customObjects) { - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = { modelTopology: modelAndWeightsConfig }; - } - modelAndWeightsConfig = modelAndWeightsConfig; - let modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config']; - } - const tsConfig = convertPythonicToTs(modelTopology); - const model = deserialize(tsConfig, customObjects); - if (modelAndWeightsConfig.weightsManifest != null) { - // Load the weight values keyed by the original tensor names in the model - // file that was loaded. These should match the keys of the weight - // manifest. - const weightValues = await io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(weight => weight.originalName)); - // Map the weights to the unique tensor names generated during model loading - const uniqueWeightValues = {}; - for (const weight of model.weights) { - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - dispose(weightValues); - } - return model; -} -/** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ -async function loadLayersModelInternal(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - const handlers = io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(io.browserHTTPRequest(pathOrIOHandler, options)); - } - else if (handlers.length > 1) { - throw new ValueError(`Found more than one (${handlers.length}) load handlers for ` + - `URL '${pathOrIOHandler}'`); - } - pathOrIOHandler = handlers[0]; - } - return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options); -} -/** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ -async function loadLayersModelFromIOHandler(handler, customObjects, options) { - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - const artifacts = await handler.load(); - let modelTopology = artifacts.modelTopology; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config']; - } - const strict = options.strict == null ? true : options.strict; - // If weights are provided and the weight-loading mode is strict, use - // fast weight initialization. This skips costly initializers such as - // 'orthogonal' and saves unnecessary computation in cases where - // the initialized weight values will immediately be overwritten by - // loaded weight values. - const fastWeightInit = artifacts.weightData != null && artifacts.weightSpecs != null && strict; - const model = deserialize(convertPythonicToTs(modelTopology), customObjects, fastWeightInit); - const trainingConfig = artifacts.trainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - // If weightData is present, load the weights into the model. - if (artifacts.weightData != null) { - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError('LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - const { modelWeights, optimizerWeights } = decodeModelAndOptimizerWeights(artifacts.weightData, artifacts.weightSpecs); - model.loadWeights(modelWeights, strict); - if (model.optimizer != null && optimizerWeights.length > 0) { - await model.optimizer.setWeights(optimizerWeights); - } - // Dispose temporary weight values. - dispose(modelWeights); - dispose(optimizerWeights.map(w => w.tensor)); - } - return model; -} -function decodeModelAndOptimizerWeights(buffer, specs) { - const name2Tensor = io.decodeWeights(buffer, specs); - const modelWeights = {}; - const optimizerWeights = []; - specs.forEach(spec => { - if (spec.group === 'optimizer') { - optimizerWeights.push({ name: spec.name, tensor: name2Tensor[spec.name] }); - } - else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return { modelWeights, optimizerWeights }; -} -/** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -class Sequential extends LayersModel { - constructor(args) { - super({ inputs: [], outputs: [] }); - args = args || {}; - this.trainable = true; - this.built = false; - // Set model name. - this.name = (args.name != null) ? args.name : getUid('sequential_'); - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (const layer of args.layers) { - this.add(layer); - } - } - } - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - checkShape(layer) { - const shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(x => x < 0)) { - throw new ValueError('Negative dimension size caused by adding layer ' + - `${layer.name} with input shape [` + - `${layer.inboundNodes[0].inputTensors[0].shape}]`); - } - } - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - add(layer) { - const isLayerModelInstance = layer instanceof Sequential || layer instanceof LayersModel; - let modelLayer; - if (isLayerModelInstance) { - modelLayer = layer; - if (modelLayer.outputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError('The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - const x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } - else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError('A layer added to a Sequential model must not already be ' + - `connected somewhere else. LayersModel received layer ${layer.name} ` + - `which has ${layer.inboundNodes.length} pre-existing inbound ` + - 'connections.'); - } - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs[0].shape - }); - } - else { - const outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - this.layers.push(layer); - this.built = false; - } - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - pop() { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } - else { - const lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - } - call(inputs, kwargs) { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - } - build(inputShape) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError('Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - } - countParams() { - if (!this.built) { - this.build(); - } - return super.countParams(); - } - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary(lineLength, positions, printFn = console.log) { - if (!this.built) { - this.build(); - } - super.summary(lineLength, positions, printFn); - } - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - setWeights(weights) { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - } - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - } - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluateDataset(dataset, args); - } - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x, args = {}) { - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - } - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - predictOnBatch(x) { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - } - /** - * See `LayersModel.compile`. - * - * @param args - */ - compile(args) { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = this.model.isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - } - get optimizer() { - return this.model == null ? undefined : this.model.optimizer; - } - set optimizer(optimizer) { - this.model.optimizer = optimizer; - } - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit(x, y, args = {}) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fit(x, y, args); - } - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async fitDataset(dataset, args) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fitDataset(dataset, args); - } - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch(x, y) { - return this.model.trainOnBatch(x, y); - } - /* See parent class for JsDoc */ - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}, fastWeightInit = false) { - let configArray; - let extraModelConfig = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } - else { - util.assert(config['layers'] != null, () => `When the config data for a Sequential model is not an Array, ` + - `it must be an Object that contains the 'layers' field.`); - configArray = config['layers']; - delete config['layers']; - extraModelConfig = config; - } - const model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError(`Sequential.fromConfig called on non-Sequential input: ${model}`); - } - for (const conf of configArray) { - const customObjects = undefined; - const layer = deserialize(conf, customObjects, fastWeightInit); - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - } - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError('Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - } - get stopTraining() { - if (this.model == null) { - throw new ValueError('Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - } - // TODO(cais): Override get trainableWeights() here - // tslint:disable-next-line:no-any - getConfig() { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - const layers = []; - for (const layer of this.layers) { - const dict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return { name: this.name, layers }; - } -} -/** @nocollapse */ -Sequential.className = 'Sequential'; -serialization.registerClass(Sequential); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// LayersModel and related factory methods. -/** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -function model(args) { - return new LayersModel(args); -} -/** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -function sequential(config) { - return new Sequential(config); -} -/** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ -function loadLayersModel(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); -} -/** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ -function input(config) { - return Input(config); -} -function registerCallbackConstructor(verbosityLevel, callbackConstructor) { - CallbackConstructorRegistry.registerCallbackConstructor(verbosityLevel, callbackConstructor); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ -class Activation extends serialization.Serializable { - getConfig() { - return {}; - } -} -/** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ -class Elu$1 extends Activation { - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - apply(x, alpha = 1) { - return elu$1(x, alpha); - } -} -/** @nocollapse */ -Elu$1.className = 'elu'; -serialization.registerClass(Elu$1); -/** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ -class Selu$1 extends Activation { - apply(x) { - return selu$1(x); - } -} -/** @nocollapse */ -Selu$1.className = 'selu'; -serialization.registerClass(Selu$1); -/** - * Rectified linear unit - */ -class Relu$1 extends Activation { - apply(x) { - return relu$1(x); - } -} -/** @nocollapse */ -Relu$1.className = 'relu'; -serialization.registerClass(Relu$1); -/** - * Rectified linear unit activation maxing out at 6.0. - */ -class Relu6$1 extends Activation { - apply(x) { - return tidy(() => minimum$2(6.0, relu$1(x))); - } -} -/** @nocollapse */ -Relu6$1.className = 'relu6'; -serialization.registerClass(Relu6$1); -//* Linear activation (no-op) */ -class Linear extends Activation { - apply(x) { - return x; - } -} -/** @nocollapse */ -Linear.className = 'linear'; -serialization.registerClass(Linear); -/** - * Sigmoid activation function. - */ -class Sigmoid$1 extends Activation { - apply(x) { - return sigmoid$1(x); - } -} -/** @nocollapse */ -Sigmoid$1.className = 'sigmoid'; -serialization.registerClass(Sigmoid$1); -/** - * Segment-wise linear approximation of sigmoid. - */ -class HardSigmoid extends Activation { - apply(x) { - return hardSigmoid(x); - } -} -/** @nocollapse */ -HardSigmoid.className = 'hardSigmoid'; -serialization.registerClass(HardSigmoid); -/** - * Softplus activation function. - */ -class Softplus$1 extends Activation { - apply(x) { - return softplus$1(x); - } -} -/** @nocollapse */ -Softplus$1.className = 'softplus'; -serialization.registerClass(Softplus$1); -/** - * Softsign activation function. - */ -class Softsign extends Activation { - apply(x) { - return softsign(x); - } -} -/** @nocollapse */ -Softsign.className = 'softsign'; -serialization.registerClass(Softsign); -/** - * Hyperbolic tangent function. - */ -class Tanh$1 extends Activation { - apply(x) { - return tanh$1(x); - } -} -/** @nocollapse */ -Tanh$1.className = 'tanh'; -serialization.registerClass(Tanh$1); -/** - * Softmax activation function - */ -class Softmax$1 extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return softmax$2(x, axis); - } -} -/** @nocollapse */ -Softmax$1.className = 'softmax'; -serialization.registerClass(Softmax$1); -/** - * Log softmax activation function - */ -class LogSoftmax$1 extends Activation { - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x, axis = (-1)) { - return logSoftmax$1(x, axis); - } -} -/** @nocollapse */ -LogSoftmax$1.className = 'logSoftmax'; -serialization.registerClass(LogSoftmax$1); -/** - * Swish activation function - */ -class Swish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - apply(x, alpha = 1) { - return tidy(() => sigmoid$1(x.mul(alpha)).mul(x)); - } -} -/** @nocollapse */ -Swish.className = 'swish'; -serialization.registerClass(Swish); -/** - * Mish activation function - */ -class Mish extends Activation { - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - apply(x) { - return tidy(() => mul$1(x, tanh$1(softplus$1(x)))); - } -} -/** @nocollapse */ -Mish.className = 'mish'; -serialization.registerClass(Mish); -function serializeActivation(activation) { - return activation.getClassName(); -} -function deserializeActivation(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); -} -function getActivation(identifier) { - if (identifier == null) { - const config = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - const config = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } - else if (identifier instanceof Activation) { - return identifier; - } - else { - return deserializeActivation(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function assertObjectArgs(args) { - if (args != null && typeof args !== 'object') { - throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an ` + - `object, but received: ${args}`); - } -} -/** - * Regularizer base class. - */ -class Regularizer extends serialization.Serializable { -} -class L1L2 extends Regularizer { - constructor(args) { - super(); - assertObjectArgs(args); - this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - this.hasL1 = this.l1 !== 0; - this.hasL2 = this.l2 !== 0; - } - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - apply(x) { - return tidy(() => { - let regularization = zeros$2([1]); - if (this.hasL1) { - regularization = add$3(regularization, sum$1(mul$1(this.l1, abs$1(x)))); - } - if (this.hasL2) { - regularization = - add$3(regularization, sum$1(mul$1(this.l2, square$1(x)))); - } - return regularization.asScalar(); - }); - } - getConfig() { - return { 'l1': this.l1, 'l2': this.l2 }; - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls({ l1: config['l1'], l2: config['l2'] }); - } -} -/** @nocollapse */ -L1L2.className = 'L1L2'; -serialization.registerClass(L1L2); -function l1(args) { - assertObjectArgs(args); - return new L1L2({ l1: args != null ? args.l1 : null, l2: 0 }); -} -function l2(args) { - assertObjectArgs(args); - return new L1L2({ l2: args != null ? args.l2 : null, l1: 0 }); -} -// Maps the JavaScript-like identifier keys to the corresponding keras symbols. -const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'l1l2': 'L1L2' -}; -function serializeRegularizer(constraint) { - return serializeKerasObject(constraint); -} -function deserializeRegularizer(config, customObjects = {}) { - return deserializeKerasObject(config, serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); -} -function getRegularizer(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = { className, config: {} }; - return deserializeRegularizer(config); - } - else if (identifier instanceof Regularizer) { - return identifier; - } - else { - return deserializeRegularizer(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class ReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maxValue = args.maxValue; - } - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - let output = relu$1(inputs); - if (this.maxValue != null) { - output = clipByValue$1(output, 0, this.maxValue); - } - return output; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { maxValue: this.maxValue }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ReLU.className = 'ReLU'; -serialization.registerClass(ReLU); -class LeakyReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 0.3; - if (args == null) { - args = {}; - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return leakyRelu$1(x, this.alpha); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -LeakyReLU.className = 'LeakyReLU'; -serialization.registerClass(LeakyReLU); -class PReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA_INITIALIZER = 'zeros'; - if (args == null) { - args = {}; - } - this.supportsMasking = true; - this.alphaInitializer = - getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); - this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - this.sharedAxes = null; - } - else if (Array.isArray(args.sharedAxes)) { - this.sharedAxes = args.sharedAxes; - } - else if (typeof args.sharedAxes === 'number') { - this.sharedAxes = [args.sharedAxes]; - } - else { - throw new ValueError(`Expected sharedAxes to be a number or an array of numbers, ` + - `but got ${args.sharedAxes}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const paramShape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (const i of this.sharedAxes) { - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight('alpha', paramShape, 'float32', this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - const axes = {}; - if (this.sharedAxes != null) { - for (let i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes, - })]; - this.built = true; - } - call(inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - return prelu$2(inputs, this.alpha.read()); - } - getConfig() { - const config = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -PReLU.className = 'PReLU'; -serialization.registerClass(PReLU); -class ELU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_ALPHA = 1.0; - if (args == null) { - args = {}; - } - if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) { - throw new NotImplementedError(`Non-default alpha value (${args.alpha}) is not supported by the ` + - `ELU layer yet.`); - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return elu$3(x); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { alpha: this.alpha }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ELU.className = 'ELU'; -serialization.registerClass(ELU); -class ThresholdedReLU extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_THETA = 1.0; - if (args == null) { - args = {}; - } - this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return x.mul(cast$1(x.greater(this.theta), 'float32')); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { theta: this.theta }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ThresholdedReLU.className = 'ThresholdedReLU'; -serialization.registerClass(ThresholdedReLU); -class Softmax$2 extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.DEFAULT_AXIS = 1.0; - if (args == null) { - args = {}; - } - this.softmax = new Softmax$1().apply; - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - } - call(inputs, kwargs) { - const x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const config = { axis: this.axis }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Softmax$2.className = 'Softmax'; -serialization.registerClass(Softmax$2); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ -function normalizeArray(value, n, name) { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } - else { - if (value.length !== n) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n} integers.` + - ` Received: ${value.length} elements.`); - } - for (let i = 0; i < n; ++i) { - const singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n}` + - ` integers. Received: ${JSON.stringify(value)} including a` + - ` non-integer number ${singleValue}`); - } - } - return value; - } -} -/** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ -function convOutputLength(inputLength, filterSize, padding, stride, dilation = 1) { - if (inputLength == null) { - return inputLength; - } - const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - let outputLength; - if (padding === 'same') { - outputLength = inputLength; - } - else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); -} -function deconvLength(dimSize, strideSize, kernelSize, padding) { - if (dimSize == null) { - return null; - } - if (padding === 'valid') { - dimSize = dimSize * strideSize + max$1([kernelSize - strideSize, 0]); - } - else if (padding === 'same') { - dimSize = dimSize * strideSize; - } - else { - throw new ValueError(`Unsupport padding mode: ${padding}.`); - } - return dimSize; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ -function preprocessConv2DInput(x, dataFormat) { - // TODO(cais): Cast type to float32 if not. - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return transpose$1(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } - else { - return x; - } - }); -} -/** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ -function preprocessConv3DInput(x, dataFormat) { - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return transpose$1(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } - else { - return x; - } - }); -} -/** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -function conv1dWithBias(x, kernel, bias, strides = 1, padding = 'valid', dataFormat, dilationRate = 1) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError(`The input of a conv1dWithBias operation should be 3, but is ` + - `${x.shape.length} instead.`); - } - if (kernel.shape.length !== 3) { - throw new ValueError(`The kernel for a conv1dWithBias operation should be 3, but is ` + - `${kernel.shape.length} instead`); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError(`The bias for a conv1dWithBias operation should be 1, but is ` + - `${kernel.shape.length} instead`); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = transpose$1(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - let y = conv1d$2(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - return y; - }); -} -/** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ -function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = 'valid', dataFormat, dilationRate, activation = null) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects input to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - let y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = fused.conv2d({ - x: y, - filter: kernel, - strides: strides, - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias, - activation - }); - if (dataFormat === 'channelsFirst') { - y = transpose$1(y, [0, 3, 1, 2]); - } - return y; - }); -} -/** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ -function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError(`conv3dWithBias expects input to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - let y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = conv3d$1(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - if (dataFormat === 'channelsFirst') { - y = transpose$1(y, [0, 4, 1, 2, 3]); - } - return y; - }); -} -/** - * Abstract convolution layer. - */ -class BaseConv extends Layer { - constructor(rank, args) { - super(args); - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - BaseConv.verifyArgs(args); - this.rank = rank; - assertPositiveInteger(this.rank, 'rank'); - if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) { - throw new NotImplementedError(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is ` + - `not implemented yet.`); - } - this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - this.strides = normalizeArray(args.strides == null ? 1 : args.strides, rank, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.activation = getActivation(args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.biasConstraint = getConstraint(args.biasConstraint); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.dilationRate = normalizeArray(args.dilationRate == null ? 1 : args.dilationRate, rank, 'dilationRate'); - if (this.rank === 1 && - (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) { - throw new ValueError(`dilationRate must be a number or an array of a single number ` + - `for 1D convolution, but received ` + - `${JSON.stringify(this.dilationRate)}`); - } - else if (this.rank === 2) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = [this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 2) { - throw new ValueError(`dilationRate must be a number or array of two numbers for 2D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - else if (this.rank === 3) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = - [this.dilationRate, this.dilationRate, this.dilationRate]; - } - else if (this.dilationRate.length !== 3) { - throw new ValueError(`dilationRate must be a number or array of three numbers for 3D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - } - static verifyArgs(args) { - // Check config.kernelSize type and shape. - assert$1('kernelSize' in args, `required key 'kernelSize' not in config`); - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 3)) { - throw new ValueError(`BaseConv expects config.kernelSize to be number or number[] with ` + - `length 1, 2, or 3, but received ${JSON.stringify(args.kernelSize)}.`); - } - } - getConfig() { - const config = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ -class Conv extends BaseConv { - constructor(rank, args) { - super(rank, args); - this.kernel = null; - Conv.verifyArgs(args); - this.filters = args.filters; - assertPositiveInteger(this.filters, 'filters'); - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([inputDim, this.filters]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.inputSpec = [{ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } }]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs; - const biasValue = this.bias == null ? null : this.bias.read(); - const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); - if (fusedActivationName != null && this.rank === 2) { - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate, fusedActivationName); - } - else { - if (this.rank === 1) { - outputs = conv1dWithBias(inputs, this.kernel.read(), biasValue, this.strides[0], this.padding, this.dataFormat, this.dilationRate[0]); - } - else if (this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else if (this.rank === 3) { - outputs = conv3dWithBias(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); - } - else { - throw new NotImplementedError('convolutions greater than 3D are not implemented yet.'); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const newSpace = []; - const space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (let i = 0; i < space.length; ++i) { - const newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - let outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } - else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - } - getConfig() { - const config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - static verifyArgs(args) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError(`Convolution layer expected config.filters to be a 'number' > 0 ` + - `but got ${JSON.stringify(args.filters)}`); - } - } -} -class Conv2D$1 extends Conv { - constructor(args) { - super(2, args); - Conv2D$1.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 2)) { - throw new ValueError(`Conv2D expects config.kernelSize to be number or number[] with ` + - `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -/** @nocollapse */ -Conv2D$1.className = 'Conv2D'; -serialization.registerClass(Conv2D$1); -class Conv3D$1 extends Conv { - constructor(args) { - super(3, args); - Conv3D$1.verifyArgs(args); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError(`Conv3D expects config.kernelSize to be number or` + - ` [number, number, number], but received ${JSON.stringify(args.kernelSize)}.`); - } - } - } -} -/** @nocollapse */ -Conv3D$1.className = 'Conv3D'; -serialization.registerClass(Conv3D$1); -class Conv2DTranspose extends Conv2D$1 { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv2DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 4) { - throw new ValueError('Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 4, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - if (this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } - else { - hAxis = 1; - wAxis = 2; - } - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - // Infer the dynamic output shape. - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - const outputShape = [batchSize, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = transpose$1(input, [0, 2, 3, 1]); - } - let outputs = conv2dTranspose$2(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = transpose$1(outputs, [0, 3, 1, 2]); - } - if (this.bias != null) { - outputs = - biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -/** @nocollapse */ -Conv2DTranspose.className = 'Conv2DTranspose'; -serialization.registerClass(Conv2DTranspose); -class Conv3DTranspose extends Conv3D$1 { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError(`Conv3DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 5) { - throw new ValueError('Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 5, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - const inputShape = input.shape; - const batchSize = inputShape[0]; - let hAxis; - let wAxis; - let dAxis; - if (this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } - else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - const depth = inputShape[dAxis]; - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - // Infer the dynamic output shape. - const outDepth = deconvLength(depth, strideD, kernelD, this.padding); - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - // Same as `conv2dTranspose`. We always assumes channelsLast. - const outputShape = [batchSize, outDepth, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = transpose$1(input, [0, 2, 3, 4, 1]); - } - let outputs = conv3dTranspose$1(input, this.kernel.read(), outputShape, this.strides, this.padding); - if (this.dataFormat !== 'channelsLast') { - outputs = transpose$1(outputs, [0, 4, 1, 2, 3]); - } - if (this.bias !== null) { - outputs = - biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation !== null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - let channelAxis; - let depthAxis; - let heightAxis; - let widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } - else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - getConfig() { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -/** @nocollapse */ -Conv3DTranspose.className = 'Conv3DTranspose'; -serialization.registerClass(Conv3DTranspose); -class SeparableConv extends Conv { - constructor(rank, config) { - super(rank, config); - this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; - this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; - this.depthwiseKernel = null; - this.pointwiseKernel = null; - if (config.filters == null) { - throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError(`SeparableConv${this.rank}D supports only padding modes: ` + - `'same' and 'valid', but received ${JSON.stringify(config.padding)}`); - } - this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); - this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); - this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError(`Inputs to SeparableConv${this.rank}D should have rank ` + - `${this.rank + 2}, but received input shape: ` + - `${JSON.stringify(inputShape)}`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError(`The channel dimension of the inputs should be defined, ` + - `but found ${JSON.stringify(inputShape[channelAxis])}`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); - const pointwiseKernelShape = []; - for (let i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - const trainable = true; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); - } - else { - this.bias = null; - } - this.inputSpec = - [new InputSpec({ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } })]; - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let output; - if (this.rank === 1) { - throw new NotImplementedError('1D separable convolution is not implemented yet.'); - } - else if (this.rank === 2) { - if (this.dataFormat === 'channelsFirst') { - inputs = transpose$1(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - output = separableConv2d$2(inputs, this.depthwiseKernel.read(), this.pointwiseKernel.read(), this.strides, this.padding, this.dilationRate, 'NHWC'); - } - if (this.useBias) { - output = biasAdd(output, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - if (this.dataFormat === 'channelsFirst') { - output = transpose$1(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - } -} -/** @nocollapse */ -SeparableConv.className = 'SeparableConv'; -class SeparableConv2D extends SeparableConv { - constructor(args) { - super(2, args); - } -} -/** @nocollapse */ -SeparableConv2D.className = 'SeparableConv2D'; -serialization.registerClass(SeparableConv2D); -class Conv1D extends Conv { - constructor(args) { - super(1, args); - Conv1D.verifyArgs(args); - this.inputSpec = [{ ndim: 3 }]; - } - getConfig() { - const config = super.getConfig(); - delete config['rank']; - delete config['dataFormat']; - return config; - } - static verifyArgs(args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 1)) { - throw new ValueError(`Conv1D expects config.kernelSize to be number or number[] with ` + - `length 1, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -/** @nocollapse */ -Conv1D.className = 'Conv1D'; -serialization.registerClass(Conv1D); -class Cropping2D extends Layer { - constructor(args) { - super(args); - if (typeof args.cropping === 'number') { - this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } - else if (typeof args.cropping[0] === 'number') { - this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1], args.cropping[1]] - ]; - } - else { - this.cropping = args.cropping; - } - this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - this.inputSpec = [{ ndim: 4 }]; - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } - else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - const hSliced = sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2); - return sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3); - } - else { - const hSliced = sliceAlongAxis(inputs, this.cropping[0][0], inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3); - return sliceAlongAxis(hSliced, this.cropping[1][0], inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4); - } - }); - } - getConfig() { - const config = { cropping: this.cropping, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Cropping2D.className = 'Cropping2D'; -serialization.registerClass(Cropping2D); -class UpSampling2D extends Layer { - constructor(args) { - super(args); - this.DEFAULT_SIZE = [2, 2]; - this.inputSpec = [{ ndim: 4 }]; - this.size = args.size == null ? this.DEFAULT_SIZE : args.size; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(this.interpolation); - } - computeOutputShape(inputShape) { - if (this.dataFormat === 'channelsFirst') { - const height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; - const width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } - else { - const height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; - const width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tidy(() => { - let input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - if (this.dataFormat === 'channelsFirst') { - input = transpose$1(input, [0, 2, 3, 1]); - const height = this.size[0] * inputShape[2]; - const width = this.size[1] * inputShape[3]; - const resized = this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return transpose$1(resized, [0, 3, 1, 2]); - } - else { - const height = this.size[0] * inputShape[1]; - const width = this.size[1] * inputShape[2]; - return this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - } - getConfig() { - const config = { size: this.size, dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -UpSampling2D.className = 'UpSampling2D'; -serialization.registerClass(UpSampling2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ -function depthwiseConv2d$1(x, depthwiseKernel, strides = [1, 1], padding = 'valid', dataFormat, dilationRate) { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - let y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError(`Input for depthwiseConv2d is required to be 4-D, but is instead ` + - `${x.rank}-D`); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError(`depthwiseKernel is required to be 4-D, but is instead ` + - `${depthwiseKernel.rank}-D`); - } - y = depthwiseConv2d$3(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = transpose$1(y, [0, 3, 1, 2]); - } - return y; - }); -} -class DepthwiseConv2D extends BaseConv { - constructor(args) { - super(2, args); - this.depthwiseKernel = null; - this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - this.depthwiseInitializer = getInitializer(args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError(`Inputs to DepthwiseConv2D should have rank 4. ` + - `Received input shape: ${JSON.stringify(inputShape)}.`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + - `be defined, but is not (${inputShape[channelAxis]}).`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs = depthwiseConv2d$1(inputs, this.depthwiseKernel.read(), this.strides, this.padding, this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (this.useBias) { - outputs = biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - const cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - const outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - const outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); - const outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } - else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - } - getConfig() { - const config = super.getConfig(); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - } -} -/** @nocollapse */ -DepthwiseConv2D.className = 'DepthwiseConv2D'; -serialization.registerClass(DepthwiseConv2D); - -/*! ***************************************************************************** -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. -***************************************************************************** */ - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ -function standardizeArgs(inputs, initialState, constants, numConstants) { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError('When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - function toListOrNull(x) { - if (x == null || Array.isArray(x)) { - return x; - } - else { - return [x]; - } - } - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - return { inputs, initialState, constants }; -} -/** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ -function rnn(stepFunction, inputs, initialStates, goBackwards = false, mask, constants, unroll = false, needPerStepOutputs = false) { - return tidy(() => { - const ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`); - } - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - const axes = [1, 0].concat(range(2, ndim)); - inputs = transpose$1(inputs, axes); - if (constants != null) { - throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = expandDims$2(mask, -1); - } - mask = transpose$1(mask, axes); - } - if (goBackwards) { - inputs = reverse$1(inputs, 0); - if (mask != null) { - mask = reverse$1(mask, 0); - } - } - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - const perStepOutputs = []; - let lastOutput; - let states = initialStates; - const timeSteps = inputs.shape[0]; - const perStepInputs = unstack$1(inputs); - let perStepMasks; - if (mask != null) { - perStepMasks = unstack$1(mask); - } - for (let t = 0; t < timeSteps; ++t) { - const currentInput = perStepInputs[t]; - const stepOutputs = tidy(() => stepFunction(currentInput, states)); - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } - else { - const maskedOutputs = tidy(() => { - const stepMask = perStepMasks[t]; - const negStepMask = onesLike$1(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - const output = stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - const newStates = states.map((state, i) => { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return { output, newStates }; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - } - let outputs; - if (needPerStepOutputs) { - const axis = 1; - outputs = stack$1(perStepOutputs, axis); - } - return [lastOutput, outputs, states]; - }); -} -class RNN extends Layer { - constructor(args) { - super(args); - let cell; - if (args.cell == null) { - throw new ValueError('cell property is missing for the constructor of RNN.'); - } - else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({ cells: args.cell }); - } - else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - this.cell = cell; - this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - this.returnState = args.returnState == null ? false : args.returnState; - this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - this._stateful = args.stateful == null ? false : args.stateful; - this.unroll = args.unroll == null ? false : args.unroll; - this.supportsMasking = true; - this.inputSpec = [new InputSpec({ ndim: 3 })]; - this.stateSpec = null; - this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - this.keptStates = []; - } - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - getStates() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return range(0, numStates).map(x => null); - } - else { - return this.states_; - } - } - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - setStates(states) { - this.states_ = states; - } - computeOutputShape(inputShape) { - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - // TODO(cais): Remove the casting once stacked RNN cells become supported. - let stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - const outputDim = stateSize[0]; - let outputShape; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } - else { - outputShape = [inputShape[0], outputDim]; - } - if (this.returnState) { - const stateShape = []; - for (const dim of stateSize) { - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } - else { - return outputShape; - } - } - computeMask(inputs, mask) { - return tidy(() => { - if (Array.isArray(mask)) { - mask = mask[0]; - } - const outputMask = this.returnSequences ? mask : null; - if (this.returnState) { - const stateMask = this.states.map(s => null); - return [outputMask].concat(stateMask); - } - else { - return outputMask; - } - }); - } - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get states() { - if (this.states_ == null) { - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - const output = []; - for (let i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } - else { - return this.states_; - } - } - set states(s) { - this.states_ = s; - } - build(inputShape) { - if (this.numConstants != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - const batchSize = this.stateful ? inputShape[0] : null; - const inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({ shape: [batchSize, null, ...inputDim] }); - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - const stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - { - this.cell.build(stepInputShape); - } - // Set or validate stateSpec. - let stateSize; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } - else { - stateSize = [this.cell.stateSize]; - } - if (this.stateSpec != null) { - if (!util.arraysEqual(this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]), stateSize)) { - throw new ValueError(`An initialState was passed that is not compatible with ` + - `cell.stateSize. Received stateSpec=${this.stateSpec}; ` + - `However cell.stateSize is ${this.cell.stateSize}`); - } - } - else { - this.stateSpec = - stateSize.map(dim => new InputSpec({ shape: [null, dim] })); - } - if (this.stateful) { - this.resetStates(); - } - } - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - resetStates(states, training = false) { - tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const batchSize = this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.states_ == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => zeros$2([batchSize, dim])); - } - else { - this.states_ = [zeros$2([batchSize, this.cell.stateSize])]; - } - } - else if (states == null) { - // Dispose old state tensors. - dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => zeros$2([batchSize, dim])); - } - else { - this.states_[0] = zeros$2([batchSize, this.cell.stateSize]); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const dim = Array.isArray(this.cell.stateSize) ? - this.cell.stateSize[index] : - this.cell.stateSize; - const expectedShape = [batchSize, dim]; - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => keep(state.clone())); - }); - } - apply(inputs, kwargs) { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - let additionalInputs = []; - let additionalSpecs = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (const state of initialState) { - this.stateSpec.push(new InputSpec({ shape: state.shape })); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - const isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - // tslint:disable-next-line:no-any - call(inputs, kwargs) { - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tidy(() => { - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - let initialState = kwargs == null ? null : kwargs['initialState']; - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (this.stateful) { - initialState = this.states_; - } - else { - initialState = this.getInitialState(inputs); - } - } - const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError(`RNN Layer has ${numStates} state(s) but was passed ` + - `${initialState.length} initial state(s).`); - } - if (this.unroll) { - console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - const cellCallKwargs = { training }; - // TODO(cais): Add support for constants. - const step = (inputs, states) => { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - const outputs = this.cell.call([inputs].concat(states), cellCallKwargs); - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)]; - }; - // TODO(cais): Add support for constants. - const rnnOutputs = rnn(step, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); - const lastOutput = rnnOutputs[0]; - const outputs = rnnOutputs[1]; - const states = rnnOutputs[2]; - if (this.stateful) { - this.resetStates(states, training); - } - const output = this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. - if (this.returnState) { - return [output].concat(states); - } - else { - return output; - } - }); - } - getInitialState(inputs) { - return tidy(() => { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - let initialState = zeros$2(inputs.shape); - // [Samples]. - initialState = sum$1(initialState, [1, 2]); - initialState = expandDims$1(initialState); // [Samples, 1]. - if (Array.isArray(this.cell.stateSize)) { - return this.cell.stateSize.map(dim => dim > 1 ? tile$1(initialState, [1, dim]) : initialState); - } - else { - return this.cell.stateSize > 1 ? - [tile$1(initialState, [1, this.cell.stateSize])] : - [initialState]; - } - }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - } - get nonTrainableWeights() { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - const cellConfig = this.cell.getConfig(); - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - }; - } - // this order is necessary, to prevent cell name from replacing layer name - return Object.assign({}, cellConfig, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cellConfig = config['cell']; - const cell = deserialize(cellConfig, customObjects); - return new cls(Object.assign(config, { cell })); - } -} -/** @nocollapse */ -RNN.className = 'RNN'; -serialization.registerClass(RNN); -// Porting Note: This is a common parent class for RNN cells. There is no -// equivalent of this in PyKeras. Having a common parent class forgoes the -// need for `has_attr(cell, ...)` checks or its TypeScript equivalent. -/** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ -class RNNCell extends Layer { -} -class SimpleRNNCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, `units`); - this.activation = getActivation(args.activation == null ? this.DEFAULT_ACTIVATION : args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - } - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`); - } - let prevOutput = inputs[1]; - inputs = inputs[0]; - const training = kwargs['training'] == null ? false : kwargs['training']; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => onesLike$1(inputs), - rate: this.dropout, - training - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => onesLike$1(prevOutput), - rate: this.recurrentDropout, - training - }); - } - let h; - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - if (dpMask != null) { - h = dot$1(mul$1(inputs, dpMask), this.kernel.read()); - } - else { - h = dot$1(inputs, this.kernel.read()); - } - if (this.bias != null) { - h = biasAdd(h, this.bias.read()); - } - if (recDpMask != null) { - prevOutput = mul$1(prevOutput, recDpMask); - } - let output = add$3(h, dot$1(prevOutput, this.recurrentKernel.read())); - if (this.activation != null) { - output = this.activation.apply(output); - } - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -SimpleRNNCell.className = 'SimpleRNNCell'; -serialization.registerClass(SimpleRNNCell); -class SimpleRNN extends RNN { - constructor(args) { - args.cell = new SimpleRNNCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } -} -/** @nocollapse */ -SimpleRNN.className = 'SimpleRNN'; -serialization.registerClass(SimpleRNN); -class GRUCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.resetAfter) { - throw new ValueError(`GRUCell does not support reset_after parameter set to true.`); - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError(`GRUCell expects 2 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] == null ? false : kwargs['training']; - let hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => onesLike$1(inputs), - rate: this.dropout, - training, - count: 3 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => onesLike$1(hTMinus1), - rate: this.recurrentDropout, - training, - count: 3 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - let z; - let r; - let hh; - if (0 < this.dropout && this.dropout < 1) { - inputs = mul$1(inputs, dpMask[0]); - } - let matrixX = dot$1(inputs, this.kernel.read()); - if (this.useBias) { - matrixX = biasAdd(matrixX, this.bias.read()); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = mul$1(hTMinus1, recDpMask[0]); - } - const recurrentKernelValue = this.recurrentKernel.read(); - const [rk1, rk2] = split$1(recurrentKernelValue, [2 * this.units, this.units], recurrentKernelValue.rank - 1); - const matrixInner = dot$1(hTMinus1, rk1); - const [xZ, xR, xH] = split$1(matrixX, 3, matrixX.rank - 1); - const [recurrentZ, recurrentR] = split$1(matrixInner, 2, matrixInner.rank - 1); - z = this.recurrentActivation.apply(add$3(xZ, recurrentZ)); - r = this.recurrentActivation.apply(add$3(xR, recurrentR)); - const recurrentH = dot$1(mul$1(r, hTMinus1), rk2); - hh = this.activation.apply(add$3(xH, recurrentH)); - const h = add$3(mul$1(z, hTMinus1), mul$1(add$3(1, neg$1(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -GRUCell.className = 'GRUCell'; -serialization.registerClass(GRUCell); -class GRU extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -/** @nocollapse */ -GRU.className = 'GRU'; -serialization.registerClass(GRU); -class LSTMCell extends RNNCell { - constructor(args) { - super(args); - this.DEFAULT_ACTIVATION = 'tanh'; - this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.unitForgetBias = args.unitForgetBias; - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = [this.units, this.units]; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - let biasInitializer; - if (this.useBias) { - if (this.unitForgetBias) { - const capturedBiasInit = this.biasInitializer; - const capturedUnits = this.units; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - // TODO(cais): More informative variable names? - const bI = capturedBiasInit.apply([capturedUnits]); - const bF = (new Ones()).apply([capturedUnits]); - const bCAndH = capturedBiasInit.apply([capturedUnits * 2]); - return concatAlongFirstAxis(concatAlongFirstAxis(bI, bF), bCAndH); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs; - if (inputs.length !== 3) { - throw new ValueError(`LSTMCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - let hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => onesLike$1(inputs), - rate: this.dropout, - training, - count: 4 - }); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => onesLike$1(hTMinus1), - rate: this.recurrentDropout, - training, - count: 4 - }); - } - const dpMask = this.dropoutMask; - const recDpMask = this.recurrentDropoutMask; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - let i; - let f; - let c; - let o; - if (0 < this.dropout && this.dropout < 1) { - inputs = mul$1(inputs, dpMask[0]); - } - let z = dot$1(inputs, this.kernel.read()); - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = mul$1(hTMinus1, recDpMask[0]); - } - z = add$3(z, dot$1(hTMinus1, this.recurrentKernel.read())); - if (this.useBias) { - z = biasAdd(z, this.bias.read()); - } - const [z0, z1, z2, z3] = split$1(z, 4, z.rank - 1); - i = this.recurrentActivation.apply(z0); - f = this.recurrentActivation.apply(z1); - c = add$3(mul$1(f, cTMinus1), mul$1(i, this.activation.apply(z2))); - o = this.recurrentActivation.apply(z3); - const h = mul$1(o, this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - return Object.assign({}, baseConfig, config); - } -} -/** @nocollapse */ -LSTMCell.className = 'LSTMCell'; -serialization.registerClass(LSTMCell); -class LSTM extends RNN { - constructor(args) { - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - super(args); - // TODO(cais): Add activityRegularizer. - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - /** @nocollapse */ - static fromConfig(cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -/** @nocollapse */ -LSTM.className = 'LSTM'; -serialization.registerClass(LSTM); -class StackedRNNCells extends RNNCell { - constructor(args) { - super(args); - this.cells = args.cells; - } - get stateSize() { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - const stateSize = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - stateSize.push(...cell.stateSize); - } - else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - let states = inputs.slice(1); - // Recover per-cell states. - const nestedStates = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } - else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - // Call the cells in order and store the returned states. - const newNestedStates = []; - let callInputs; - for (let i = 0; i < this.cells.length; ++i) { - const cell = this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } - else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs); - newNestedStates.push(callInputs.slice(1)); - } - // Format the new states as a flat list in reverse cell order. - states = []; - for (const cellStates of newNestedStates.slice().reverse()) { - states.push(...cellStates); - } - return [callInputs[0]].concat(states); - }); - } - build(inputShape) { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = inputShape[0]; - } - inputShape = inputShape; - let outputDim; - this.cells.forEach((cell, i) => { - nameScope(`RNNCell_${i}`, () => { - // TODO(cais): Take care of input constants. - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } - else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim]; - }); - }); - this.built = true; - } - getConfig() { - const baseConfig = super.getConfig(); - const getCellConfig = (cell) => { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - const cellConfigs = this.cells.map(getCellConfig); - const config = { 'cells': cellConfigs }; - return Object.assign({}, baseConfig, config); - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const cells = []; - for (const cellConfig of config['cells']) { - cells.push(deserialize(cellConfig, customObjects)); - } - return new cls({ cells }); - } - get trainableWeights() { - if (!this.trainable) { - return []; - } - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.trainableWeights); - } - return weights; - } - get nonTrainableWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights = []; - for (const cell of this.cells) { - trainableWeights.push(...cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - getWeights() { - const weights = []; - for (const cell of this.cells) { - weights.push(...cell.weights); - } - return batchGetValue(weights); - } - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - setWeights(weights) { - const tuples = []; - for (const cell of this.cells) { - const numParams = cell.weights.length; - const inputWeights = weights.splice(numParams); - for (let i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - } -} -/** @nocollapse */ -StackedRNNCells.className = 'StackedRNNCells'; -serialization.registerClass(StackedRNNCells); -function generateDropoutMask(args) { - const { ones, rate, training = false, count = 1 } = args; - const droppedInputs = () => dropout(ones(), rate); - const createMask = () => inTrainPhase(droppedInputs, ones, training); - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return keep(createMask().clone()); - } - const masks = Array(count).fill(undefined).map(createMask); - return masks.map(m => keep(m.clone())); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Base class for convolutional-recurrent layers. - */ -class ConvRNN2D extends RNN { - constructor(args) { - if (args.unroll) { - throw new NotImplementedError('Unrolling is not possible with convolutional RNNs.'); - } - if (Array.isArray(args.cell)) { - throw new NotImplementedError('It is not possible at the moment to stack convolutional cells.'); - } - super(args); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - call(inputs, kwargs) { - return tidy(() => { - if (this.cell.dropoutMask != null) { - dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState = kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, { mask, training, initialState }); - }); - } - computeOutputShape(inputShape) { - let outShape = this.computeSingleOutputShape(inputShape); - if (!this.returnSequences) { - outShape = [outShape[0], ...outShape.slice(2)]; - } - if (this.returnState) { - outShape = - [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])]; - } - return outShape; - } - getInitialState(inputs) { - return tidy(() => { - const { stateSize } = this.cell; - const inputShape = inputs.shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const initialState = zeros$2(stateShape); - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - return [initialState]; - }); - } - resetStates(states, training = false) { - tidy(() => { - if (!this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const inputShape = this.inputSpec[0].shape; - const outputShape = this.computeSingleOutputShape(inputShape); - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - const batchSize = inputShape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.getStates() == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => zeros$2(stateShape)); - } - else { - this.states_ = [zeros$2(stateShape)]; - } - } - else if (states == null) { - // Dispose old state tensors. - dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - dispose(this.keptStates); - this.keptStates = []; - } - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => zeros$2(stateShape)); - } - else { - this.states_[0] = zeros$2(stateShape); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } - else { - dispose(this.states_); - } - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const expectedShape = stateShape; - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError(`State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => keep(state.clone())); - }); - } - computeSingleOutputShape(inputShape) { - const { dataFormat, filters, kernelSize, padding, strides, dilationRate } = this.cell; - const isChannelsFirst = dataFormat === 'channelsFirst'; - const h = inputShape[isChannelsFirst ? 3 : 2]; - const w = inputShape[isChannelsFirst ? 4 : 3]; - const hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - const wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); - const outShape = [ - ...inputShape.slice(0, 2), - ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters]) - ]; - return outShape; - } -} -/** @nocollapse */ -ConvRNN2D.className = 'ConvRNN2D'; -class ConvLSTM2DCell extends LSTMCell { - constructor(args) { - const { filters, kernelSize, strides, padding, dataFormat, dilationRate, } = args; - super(Object.assign({}, args, { units: filters })); - this.filters = filters; - assertPositiveInteger(this.filters, 'filters'); - this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize')); - this.strides = normalizeArray(strides || 1, 2, 'strides'); - this.strides.forEach(stride => assertPositiveInteger(stride, 'strides')); - this.padding = padding || 'valid'; - checkPaddingMode(this.padding); - this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(this.dataFormat); - this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - this.dilationRate.forEach(rate => assertPositiveInteger(rate, 'dilationRate')); - } - build(inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError(`The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - const numOfKernels = 4; - const kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - const recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - this.recurrentKernel = this.addWeight('recurrent_kernel', recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - let biasInitializer; - if (this.unitForgetBias) { - const init = this.biasInitializer; - const filters = this.filters; - biasInitializer = new (_a = class CustomInit extends Initializer { - apply(shape, dtype) { - const biasI = init.apply([filters]); - const biasF = ones$3([filters]); - const biasCAndO = init.apply([filters * 2]); - return concatenate([biasI, biasF, biasCAndO]); - } - }, - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - if (inputs.length !== 3) { - throw new ValueError(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - const training = kwargs['training'] || false; - const x = inputs[0]; // Current input - const hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - const numOfKernels = 4; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => onesLike$1(x), - rate: this.dropout, - training, - count: numOfKernels - }); - } - const dropoutMask = this.dropoutMask; - const applyDropout = (x, mask, index) => { - if (!mask || !mask[index]) { - return x; - } - return mul$1(mask[index], x); - }; - let xI = applyDropout(x, dropoutMask, 0); - let xF = applyDropout(x, dropoutMask, 1); - let xC = applyDropout(x, dropoutMask, 2); - let xO = applyDropout(x, dropoutMask, 3); - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => onesLike$1(hTMinus1), - rate: this.recurrentDropout, - training, - count: numOfKernels - }); - } - const recDropoutMask = this.recurrentDropoutMask; - let hI = applyDropout(hTMinus1, recDropoutMask, 0); - let hF = applyDropout(hTMinus1, recDropoutMask, 1); - let hC = applyDropout(hTMinus1, recDropoutMask, 2); - let hO = applyDropout(hTMinus1, recDropoutMask, 3); - const kernelChannelAxis = 3; - const [kernelI, kernelF, kernelC, kernelO] = split$1(this.kernel.read(), numOfKernels, kernelChannelAxis); - const [biasI, biasF, biasC, biasO] = this.useBias ? - split$1(this.bias.read(), numOfKernels) : - [null, null, null, null]; - xI = this.inputConv(xI, kernelI, biasI, this.padding); - xF = this.inputConv(xF, kernelF, biasF, this.padding); - xC = this.inputConv(xC, kernelC, biasC, this.padding); - xO = this.inputConv(xO, kernelO, biasO, this.padding); - const [recKernelI, recKernelF, recKernelC, recKernelO] = split$1(this.recurrentKernel.read(), numOfKernels, kernelChannelAxis); - hI = this.recurrentConv(hI, recKernelI); - hF = this.recurrentConv(hF, recKernelF); - hC = this.recurrentConv(hC, recKernelC); - hO = this.recurrentConv(hO, recKernelO); - const i = this.recurrentActivation.apply(add$3(xI, hI)); - const f = this.recurrentActivation.apply(add$3(xF, hF)); - const c = add$3(mul$1(f, cTMinus1), mul$1(i, this.activation.apply(add$3(xC, hC)))); - const h = mul$1(this.recurrentActivation.apply(add$3(xO, hO)), this.activation.apply(c)); - return [h, h, c]; - }); - } - getConfig() { - const _a = super.getConfig(), baseConfig = __rest(_a, ['units']); - const config = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - return Object.assign({}, baseConfig, config); - } - inputConv(x, w, b, padding) { - const out = conv2d$2(x, w, this.strides, (padding || 'valid'), this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', this.dilationRate); - if (b) { - return biasAdd(out, b, this.dataFormat); - } - return out; - } - recurrentConv(x, w) { - const strides = 1; - return conv2d$2(x, w, strides, 'same', this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - } -} -/** @nocollapse */ -ConvLSTM2DCell.className = 'ConvLSTM2DCell'; -serialization.registerClass(ConvLSTM2DCell); -class ConvLSTM2D extends ConvRNN2D { - constructor(args) { - const cell = new ConvLSTM2DCell(args); - super(Object.assign({}, args, { cell })); - } - /** @nocollapse */ - static fromConfig(cls, config) { - return new cls(config); - } -} -/** @nocollapse */ -ConvLSTM2D.className = 'ConvLSTM2D'; -serialization.registerClass(ConvLSTM2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class Dropout extends Layer { - constructor(args) { - super(args); - this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - this.noiseShape = args.noiseShape; - this.seed = args.seed; - this.supportsMasking = true; - } - getNoiseShape(input) { - if (this.noiseShape == null) { - return this.noiseShape; - } - const inputShape = input.shape; - const noiseShape = []; - for (let i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (0 < this.rate && this.rate < 1) { - const training = kwargs['training'] == null ? false : kwargs['training']; - const noiseShape = this.getNoiseShape(input); - const output = inTrainPhase(() => dropout(input, this.rate, noiseShape, this.seed), () => input, training); - return output; - } - return inputs; - }); - } - getConfig() { - const config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - dispose() { - return super.dispose(); - } -} -/** @nocollapse */ -Dropout.className = 'Dropout'; -serialization.registerClass(Dropout); -class SpatialDropout1D extends Dropout { - constructor(args) { - super(args); - this.inputSpec = [{ ndim: 3 }]; - } - getNoiseShape(input) { - const inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - } -} -/** @nocollapse */ -SpatialDropout1D.className = 'SpatialDropout1D'; -serialization.registerClass(SpatialDropout1D); -class Dense extends Layer { - constructor(args) { - super(args); - // Default activation: Linear (none). - this.activation = null; - this.useBias = true; - this.kernel = null; - this.bias = null; - this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - this.batchInputShape = [batchSize, args.inputDim]; - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation); - if (args.useBias != null) { - this.useBias = args.useBias; - } - this.kernelInitializer = getInitializer(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.supportsMasking = true; - this.inputSpec = [{ minNDim: 2 }]; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - } - this.inputSpec = [{ minNDim: 2, axes: { [-1]: inputLastDim } }]; - this.built = true; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - const input = getExactlyOneTensor(inputs); - const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); - let output; - if (fusedActivationName != null) { - output = dot$1(input, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); - } - else { - output = dot$1(input, this.kernel.read()); - if (this.bias != null) { - output = biasAdd(output, this.bias.read()); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - } - return output; - }); - } - getConfig() { - const config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Dense.className = 'Dense'; -serialization.registerClass(Dense); -class Flatten extends Layer { - constructor(args) { - args = args || {}; - super(args); - this.inputSpec = [{ minNDim: 3 }]; - this.dataFormat = args.dataFormat; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - for (const dim of inputShape.slice(1)) { - if (dim == null) { - throw new ValueError(`The shape of the input to "Flatten" is not fully defined ` + - `(got ${inputShape.slice(1)}). Make sure to pass a complete ` + - `"input_shape" or "batch_input_shape" argument to the first ` + - `layer in your model.`); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - let input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsFirst' && input.rank > 1) { - const permutation = [0]; - for (let i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - return batchFlatten(input); - }); - } - getConfig() { - const config = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Flatten.className = 'Flatten'; -serialization.registerClass(Flatten); -class Activation$1 extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.activation = getActivation(args.activation); - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - return this.activation.apply(input); - }); - } - getConfig() { - const config = { activation: serializeActivation(this.activation) }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Activation$1.className = 'Activation'; -serialization.registerClass(Activation$1); -class RepeatVector extends Layer { - constructor(args) { - super(args); - this.n = args.n; - this.inputSpec = [{ ndim: 2 }]; - } - computeOutputShape(inputShape) { - return [inputShape[0], this.n, inputShape[1]]; - } - call(inputs, kwargs) { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - return repeat(inputs, this.n); - }); - } - getConfig() { - const config = { - n: this.n, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -RepeatVector.className = 'RepeatVector'; -serialization.registerClass(RepeatVector); -class Reshape$1 extends Layer { - constructor(args) { - super(args); - this.targetShape = args.targetShape; - // Make sure that all unknown dimensions are represented as `null`. - for (let i = 0; i < this.targetShape.length; ++i) { - if (this.isUnknown(this.targetShape[i])) { - this.targetShape[i] = null; - } - } - } - isUnknown(dim) { - return dim < 0 || dim == null; - } - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - fixUnknownDimension(inputShape, outputShape) { - const errorMsg = 'Total size of new array must be unchanged.'; - const finalShape = outputShape.slice(); - let known = 1; - let unknown = null; - for (let i = 0; i < finalShape.length; ++i) { - const dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } - else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } - else { - known *= dim; - } - } - const originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } - else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - return finalShape; - } - computeOutputShape(inputShape) { - let anyUnknownDims = false; - for (let i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } - else { - return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const outputShape = inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - return input.reshape(outputShape); - }); - } - getConfig() { - const config = { - targetShape: this.targetShape, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Reshape$1.className = 'Reshape'; -serialization.registerClass(Reshape$1); -class Permute extends Layer { - constructor(args) { - super(args); - if (args.dims == null) { - throw new Error('Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error('Permute constructor requires `dims` to be an Array, but received ' + - `${args.dims} instead.`); - } - // Check the validity of the permutation indices. - const expectedSortedIndices = range(1, args.dims.length + 1); - if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error('Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - this.dims = args.dims; - this.dimsIncludingBatch = [0].concat(this.dims); - this.inputSpec = [new InputSpec({ ndim: this.dims.length + 1 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - this.dims.forEach((dim, i) => { - outputShape[i + 1] = inputShape[dim]; - }); - return outputShape; - } - call(inputs, kwargs) { - return transpose$1(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - } - getConfig() { - const config = { - dims: this.dims, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Permute.className = 'Permute'; -serialization.registerClass(Permute); -class Masking extends Layer { - constructor(args) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } - else { - this.maskValue = 0; - } - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { maskValue: this.maskValue }; - Object.assign(config, baseConfig); - return config; - } - computeMask(inputs, mask) { - const input = getExactlyOneTensor(inputs); - const axis = -1; - return any$1(notEqual$1(input, this.maskValue), axis); - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const axis = -1; - const keepDims = true; - const booleanMask = any$1(notEqual$1(input, this.maskValue), axis, keepDims); - const output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - } -} -/** @nocollapse */ -Masking.className = 'Masking'; -serialization.registerClass(Masking); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class Embedding extends Layer { - constructor(args) { - super(args); - this.embeddings = null; - this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - let batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - this.batchInputShape = [batchSize, null]; - } - else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - this.batchInputShape = - [batchSize].concat(toList(args.inputLength)); - } - } - this.inputDim = args.inputDim; - assertPositiveInteger(this.inputDim, 'inputDim'); - this.outputDim = args.outputDim; - assertPositiveInteger(this.outputDim, 'outputDim'); - this.embeddingsInitializer = getInitializer(args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER); - this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - this.maskZero = args.maskZero; - this.supportsMasking = args.maskZero; - this.inputLength = args.inputLength; - } - build(inputShape) { - this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); - this.built = true; - } - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - warnOnIncompatibleInputShape(inputShape) { } - computeMask(inputs, mask) { - return tidy(() => { - if (!this.maskZero) { - return null; - } - else { - inputs = getExactlyOneTensor(inputs); - return notEqual$1(inputs, zerosLike$1(inputs)); - } - }); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return [...inputShape, this.outputDim]; - } - // inputLength can be an array if input is 3D or higher. - const inLens = toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else { - let i = 0; - for (let k = 0; k < inLens.length; ++k) { - const s1 = inLens[k]; - const s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError(`"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } - else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0], ...inLens, this.outputDim]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - let input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = cast$1(input, 'int32'); - } - const output = gather$1(this.embeddings.read(), input.as1D()); - return output.reshape(getExactlyOneShape(this.computeOutputShape(input.shape))); - }); - } - getConfig() { - const config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Embedding.className = 'Embedding'; -serialization.registerClass(Embedding); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ -class Merge extends Layer { - constructor(args) { - super(args || {}); - this.supportsMasking = true; - } - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - mergeFunction(inputs) { - throw new NotImplementedError(); - } - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - computeElementwiseOpOutputShape(shape1, shape2) { - if (shape1 == null || shape2 == null) { - return null; - } - else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } - else if (shape2.length === 0) { - return shape1; - } - const outputShape = shape1.slice(0, shape1.length - shape2.length); - for (let k = 0; k < shape2.length; ++k) { - const i = shape1[shape1.length - shape2.length + k]; - const j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } - else if (i === 1) { - outputShape.push(j); - } - else if (j === 1) { - outputShape.push(i); - } - else { - if (i !== j) { - throw new ValueError('Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - } - build(inputShape) { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape; - if (inputShape.length < 2) { - throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + - ` Got ${inputShape.length} input(s).`); - } - // Make sure that there is at most one unique batch size among the input - // shapes. - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError(`Can not merge tensors with different batch sizes. ` + - `Got tensors with shapes: ${JSON.stringify(inputShape)}.`); - } - let outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - const allRanks = inputShape.map(shape => shape.length); - if (inputShape.indexOf(null) === -1 && - unique$1(allRanks).length === 1) { - this.reshapeRequired = false; - } - else { - this.reshapeRequired = true; - } - } - call(inputs, kwargs) { - return tidy(() => { - inputs = inputs; - if (this.reshapeRequired) { - const reshapedInputs = []; - const inputDims = inputs.map(input => input.rank); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - const maxNDim = max$1(inputDims); - for (let x of inputs) { - const xNDim = x.rank; - for (let k = 0; k < maxNDim - xNDim; ++k) { - x = expandDims$1(x, 1); - } - reshapedInputs.push(x); - } - return this.mergeFunction(reshapedInputs); - } - else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - let transposed = false; - for (const x of inputs) { - const xNDim = x.rank; - if (xNDim == null) { - const xShape = x.shape; - const batchSize = xShape[0]; - const newShape = xShape.slice(1).concat([batchSize]); - let xTransposed = x.reshape([batchSize].concat(arrayProd(xShape.slice(1)))); - xTransposed = transpose$1(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } - else if (xNDim > 1) { - const dims = range(1, xNDim).concat([0]); - reshapedInputs.push(transpose$1(x, dims)); - transposed = true; - } - else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - let y = this.mergeFunction(reshapedInputs); - const yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - const yShape = y.shape; - const yNDim = yShape.length; - const batchSize = yShape[yNDim - 1]; - const newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = transpose$1(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } - else if (yNDim > 1) { - const dims = [yNDim - 1].concat(range(0, yNDim - 1)); - y = transpose$1(y, dims); - } - } - return y; - } - } - else { - return this.mergeFunction(inputs); - } - }); - } - computeOutputShape(inputShape) { - inputShape = inputShape; - let outputShape; - if (inputShape[0] == null) { - outputShape = null; - } - else { - outputShape = inputShape[0].slice(1); - } - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - let batchSizes = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } - else { - outputShape = [null].concat(outputShape); - } - return outputShape; - } - computeMask(inputs, mask) { - return tidy(() => { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`The Array 'inputs' and 'mask' are expected to have the same ` + - `length, but have different lengths ` + - `(${inputs.length} vs ${mask.length})`); - } - if (mask.every(m => m == null)) { - return null; - } - mask = mask.map(m => m == null ? m : expandDims$2(m, 0)); - let output = mask[0]; - for (let i = 1; i < mask.length - 1; ++i) { - output = logicalAnd$1(output, mask[i]); - } - return output; - }); - } -} -class Add$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = add$3(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Add$1.className = 'Add'; -serialization.registerClass(Add$1); -class Multiply$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = mul$1(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Multiply$1.className = 'Multiply'; -serialization.registerClass(Multiply$1); -class Average extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = add$3(output, inputs[i]); - } - return mul$1(1 / inputs.length, output); - }); - } -} -/** @nocollapse */ -Average.className = 'Average'; -serialization.registerClass(Average); -class Maximum$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = maximum$2(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Maximum$1.className = 'Maximum'; -serialization.registerClass(Maximum$1); -class Minimum$1 extends Merge { - constructor(args) { - super(args); - } - mergeFunction(inputs) { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = minimum$2(output, inputs[i]); - } - return output; - }); - } -} -/** @nocollapse */ -Minimum$1.className = 'Minimum'; -serialization.registerClass(Minimum$1); -class Concatenate extends Merge { - constructor(args) { - super(args); - this.DEFAULT_AXIS = -1; - if (args == null) { - args = {}; - } - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape; - let allNoneShape = true; - for (const shape of inputShape) { - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - const shapeSet = []; - for (let i = 0; i < inputShape.length; ++i) { - const shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - let exists = false; - for (const shape of shapeSet) { - if (util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - } - mergeFunction(inputs) { - return tidy(() => { - return concatenate(inputs, this.axis); - }); - } - computeOutputShape(inputShape) { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); - } - const inputShapes = inputShape; - const outputShape = inputShapes[0].slice(); - const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (const shape of inputShapes.slice(1)) { - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - } - computeMask(inputs, mask) { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError(`Mismatch in the length of mask (${mask.length}) ` + - `and the legnth of inputs (${inputs.length})`); - } - return tidy(() => { - let allNullMasks = true; - mask.forEach(m => { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - const outputMasks = []; - for (let i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(onesLike$1(inputs[i]).asType('bool')); - } - else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(expandDims$2(mask[i], -1)); - } - else { - outputMasks.push(mask[i]); - } - } - const concatenatedMasks = concat$1(outputMasks, this.axis); - return all$1(concatenatedMasks, -1, false); - }); - } - getConfig() { - const config = { - 'axis': this.axis, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Concatenate.className = 'Concatenate'; -serialization.registerClass(Concatenate); -/** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ -function interpretAxis(axis, dim) { - while (axis < 0) { - axis += dim; - } - return axis; -} -function batchDot(x, y, axes) { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError('batchDot is not implemented for tensors of 4D or higher rank yet'); - } - util.assert(x.shape.length >= 2, () => `batchDot requires the rank of x to be >= 2, ` + - `but got ${x.shape.length}`); - util.assert(x.shape.length >= 2, () => `batchDot requires the rank of y to be >= 2, ` + - `but got ${y.shape.length}`); - if (typeof axes === 'number') { - axes = [axes, axes]; - } - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError('batchDot is not implemented for complex64-type Tensors yet.'); - } - const xNDim = x.shape.length; - const yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - const axesArray = axes; - return tidy(() => { - let diff; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } - else if (yNDim > xNDim) { - diff = yNDim - xNDim; - const diffShape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } - else { - diff = 0; - } - let out; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } - else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } - else { - const adjX = axesArray[0] !== x.shape.length - 1; - const adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - if (diff > 0) { - let idx; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } - else { - idx = xNDim - 1; - } - const squeezeAxes = []; - for (let i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); -} -class Dot extends Merge { - constructor(args) { - super(args); - this.axes = args.axes; - this.normalize = args.normalize == null ? false : args.normalize; - this.supportsMasking = true; - this.reshapeRequired = false; - } - build(inputShape) { - util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0]; - const shape2 = inputShape[1]; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError(`Dimension incompatibility: ` + - `${shape1[axes[0]]} !== ${shape2[axes[1]]}`); - } - } - mergeFunction(inputs) { - if (inputs.length !== 2) { - throw new ValueError('A `Dot` layer must be called on exactly 2 inputs, ' + - `but received ${inputs.length} input(s).`); - } - let x1 = inputs[0]; - let x2 = inputs[1]; - let axes; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } - else { - axes = this.axes.map((axis, i) => interpretAxis(axis, inputs[i].shape.length)); - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - } - interpretAxes(shape1, shape2) { - let axes; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } - else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - } - computeOutputShape(inputShape) { - util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0].slice(); - const shape2 = inputShape[1].slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - const axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - const outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - } - computeMask(inputs, mask) { - return null; - } - getConfig() { - const config = { - 'axes': this.axes, - 'normalize': this.normalize - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -Dot.className = 'Dot'; -serialization.registerClass(Dot); -// TODO(cais): Add functional interfaces for the merge layers. - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class GaussianNoise extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.stddev = args.stddev; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { stddev: this.stddev }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const noised = () => randomNormal(input.shape, 0, this.stddev).add(input); - const output = inTrainPhase(noised, () => input, kwargs['training'] || false); - return output; - }); - } -} -/** @nocollapse */ -GaussianNoise.className = 'GaussianNoise'; -serialization.registerClass(GaussianNoise); -class GaussianDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (this.rate > 0 && this.rate < 1) { - const noised = () => { - const stddev = Math.sqrt(this.rate / (1 - this.rate)); - return input.mul(randomNormal(input.shape, 1, stddev)); - }; - return inTrainPhase(noised, () => input, kwargs['training'] || false); - } - return input; - }); - } -} -/** @nocollapse */ -GaussianDropout.className = 'GaussianDropout'; -serialization.registerClass(GaussianDropout); -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ -class AlphaDropout extends Layer { - constructor(args) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - this.noiseShape = args.noiseShape; - } - _getNoiseShape(inputs) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - } - computeOutputShape(inputShape) { - return inputShape; - } - getConfig() { - const baseConfig = super.getConfig(); - const config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - } - call(inputs, kwargs) { - return tidy(() => { - if (this.rate < 1 && this.rate > 0) { - const noiseShape = this._getNoiseShape(inputs); - const droppedInputs = () => { - const input = getExactlyOneTensor(inputs); - const alpha = 1.6732632423543772848170429916717; - const scale = 1.0507009873554804934193349852946; - const alphaP = -alpha * scale; - let keptIdx = greaterEqual$1(randomUniform$1(noiseShape), this.rate); - keptIdx = cast$1(keptIdx, 'float32'); // get default dtype. - // Get affine transformation params. - const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; - const b = -a * alphaP * this.rate; - // Apply mask. - const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - return x.mul(a).add(b); - }; - return inTrainPhase(droppedInputs, () => getExactlyOneTensor(inputs), kwargs['training'] || false); - } - return inputs; - }); - } -} -/** @nocollapse */ -AlphaDropout.className = 'AlphaDropout'; -serialization.registerClass(AlphaDropout); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ -function batchNormalization(x, mean, variance, beta, gamma, epsilon = 1e-3) { - let out; - if (x.rank === 2) { - out = batchNorm2d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = batchNorm3d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 4) { - out = batchNorm4d(x, mean, variance, beta, gamma, epsilon); - } - else { - throw new NotImplementedError(`batchNormalization is not implemented for array of rank ${x.rank} ` + - `yet`); - } - return out; -} -/** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tidy(() => { - const meanAndVariance = moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - return tidy(() => { - const meanAndVariance = moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const targetShape = []; - for (const axis of range(0, x.rank)) { - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } - else { - targetShape.push(x.shape[axis]); - } - } - const broadcastMean = mean.reshape(targetShape); - const broadcastVariance = variance.reshape(targetShape); - const broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); - const broadcastBeta = beta == null ? null : beta.reshape(targetShape); - const normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon = 1e-3) { - if (util.arraysEqual(reductionAxes.slice().sort(), range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } -} -class BatchNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.supportsMasking = true; - this.axis = args.axis == null ? -1 : args.axis; - this.momentum = args.momentum == null ? 0.99 : args.momentum; - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - this.betaConstraint = getConstraint(args.betaConstraint); - this.gammaConstraint = getConstraint(args.gammaConstraint); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - const dim = inputShape[axis]; - if (dim == null) { - throw new ValueError(`Axis ${axis} of input tensor should have a defined dimension but ` + - `the layer received an input with shape ` + - `${JSON.stringify(inputShape)}.`); - } - this.inputSpec = - [new InputSpec({ ndim: inputShape.length, axes: { [axis]: dim } })]; - const shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); - } - this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); - this.built = true; - } - call(inputs, kwargs) { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const ndim = inputShape.length; - const reductionAxes = range(0, ndim); - const axis = this.axis >= 0 ? this.axis : (this.axis + ndim); - reductionAxes.splice(axis, 1); - const broadcastShape = pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - const sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - const needsBroadcasting = !util.arraysEqual(sortedReductionAxes, range(0, ndim).slice(0, ndim - 1)); - const normalizeInference = () => { - if (needsBroadcasting) { - const broadcastMovingMean = this.movingMean.read().reshape(broadcastShape); - const broadcastMovingVariance = this.movingVariance.read().reshape(broadcastShape); - const broadcastBeta = this.center ? this.beta.read().reshape(broadcastShape) : null; - const broadcastGamma = this.scale ? this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); - } - else { - return batchNormalization(input, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); - } - }; - if (!training) { - return normalizeInference(); - } - const [normedTraining, mean, variance] = normalizeBatchInTraining(input, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); - const doMovingAverage = (variable, value, momentum) => { - tidy(() => { - const decay = 1 - momentum; - const origValue = variable.read(); - const updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - const updateMovingMeanAndVariance = () => { - doMovingAverage(this.movingMean, mean, this.momentum); - doMovingAverage(this.movingVariance, variance, this.momentum); - }; - updateMovingMeanAndVariance(); - return normedTraining; - }); - } - getConfig() { - const config = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -BatchNormalization.className = 'BatchNormalization'; -serialization.registerClass(BatchNormalization); -class LayerNormalization extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.axis = args.axis == null ? -1 : args.axis; - if (typeof this.axis === 'number') { - if (!Number.isInteger(this.axis)) { - throw new Error(`Expected axis to be an integer, but received ${this.axis}`); - } - } - else if (Array.isArray(this.axis)) { - for (const axis of this.axis) { - if (!Number.isInteger(axis)) { - throw new Error(`Expected axis to be an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - } - } - else { - throw new Error(`Expected axis to be an integer or an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const nDims = inputShape.length; - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (let i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - // Further validate axes. - for (const axis of this.axis) { - if (axis < 0 || axis >= nDims) { - throw new Error(`Invalid axis: ${axis}`); - } - } - if (this.axis.length !== unique$1(this.axis).length) { - throw new Error(`Found duplicate axes in: ${this.axis}`); - } - const paramShape = this.axis.map(axis => inputShape[axis]); - const trainable = true; - if (this.scale) { - this.gamma = this.addWeight('gamma', paramShape, 'float32', this.gammaInitializer, this.gammaRegularizer, trainable); - } - else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight('beta', paramShape, 'float32', this.betaInitializer, this.betaRegularizer, trainable); - } - else { - this.beta = null; - } - this.built = true; - } - call(inputs, kwargs) { - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const nDims = inputShape.length; - return tidy(() => { - const keepDims = true; - let { mean, variance } = moments(input, this.axis, keepDims); - const broadcastShape = pyListRepeat(1, nDims); - for (const dim of this.axis) { - broadcastShape[dim] = inputShape[dim]; - } - const broadcast = (v) => { - if (v != null && v.shape.length !== nDims && - this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } - else { - return v; - } - }; - let scale = broadcast(this.gamma.read()); - let offset = broadcast(this.beta.read()); - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - const momentsTiling = []; - const scaleOffsetTiling = []; - for (let i = 0; i < nDims; ++i) { - if (this.axis.indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } - else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - return batchNormalization(input, mean, variance, offset, scale, this.epsilon); - }); - } - getConfig() { - const config = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -LayerNormalization.className = 'LayerNormalization'; -serialization.registerClass(LayerNormalization); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ -function spatial2dPadding(x, padding, dataFormat) { - return tidy(() => { - if (x.rank !== 4) { - throw new ValueError(`temporalPadding expects input tensor to be 4-D, but received a ` + - `${x.rank}-D tensor.`); - } - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError(`Unknown data format: ${dataFormat}. ` + - `Supported data formats are 'channelsLast' and 'channelsFirst.`); - } - let pattern; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } - else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - return pad$1(x, pattern); - }); -} -class ZeroPadding2D extends Layer { - constructor(args) { - if (args == null) { - args = {}; - } - super(args); - this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - this.padding = [[1, 1], [1, 1]]; - } - else if (typeof args.padding === 'number') { - this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } - else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError(`ZeroPadding2D expects padding to be a length-2 array, but ` + - `received a length-${args.padding.length} array.`); - } - let heightPadding; - let widthPadding; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1], args.padding[1]]; - } - else { - args.padding = args.padding; - if (args.padding[0].length !== 2) { - throw new ValueError(`ZeroPadding2D expects height padding to be a length-2 array, ` + - `but received a length-${args.padding[0].length} array.`); - } - heightPadding = args.padding[0]; - if (args.padding[1].length !== 2) { - throw new ValueError(`ZeroPadding2D expects width padding to be a length-2 array, ` + - `but received a length-${args.padding[1].length} array.`); - } - widthPadding = args.padding[1]; - } - this.padding = [heightPadding, widthPadding]; - } - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows; - let cols; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tidy(() => spatial2dPadding(getExactlyOneTensor(inputs), this.padding, this.dataFormat)); - } - getConfig() { - const config = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -/** @nocollapse */ -ZeroPadding2D.className = 'ZeroPadding2D'; -serialization.registerClass(ZeroPadding2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ -function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = maxPool$1(x, poolSize, strides, paddingString); - } - else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = avgPool$1( - // TODO(cais): Rank check? - x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = transpose$1(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); -} -/** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ -function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x, dataFormat); - let y; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = maxPool3d(x, poolSize, strides, paddingString); - } - else { // 'avg' - y = avgPool3d$1(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = transpose$1(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); -} -/** - * Abstract class for different pooling 1D layers. - */ -class Pooling1D extends Layer { - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - constructor(args) { - if (args.poolSize == null) { - args.poolSize = 2; - } - super(args); - if (typeof args.poolSize === 'number') { - this.poolSize = [args.poolSize]; - } - else if (Array.isArray(args.poolSize) && - args.poolSize.length === 1 && - typeof args.poolSize[0] === 'number') { - this.poolSize = args.poolSize; - } - else { - throw new ValueError(`poolSize for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.poolSize)}`); - } - assertPositiveInteger(this.poolSize, 'poolSize'); - if (args.strides == null) { - this.strides = this.poolSize; - } - else { - if (typeof args.strides === 'number') { - this.strides = [args.strides]; - } - else if (Array.isArray(args.strides) && - args.strides.length === 1 && - typeof args.strides[0] === 'number') { - this.strides = args.strides; - } - else { - throw new ValueError(`strides for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.strides)}`); - } - } - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = expandDims$1(getExactlyOneTensor(inputs), 2); - const output = this.poolingFunction(getExactlyOneTensor(inputs), [this.poolSize[0], 1], [this.strides[0], 1], this.padding, 'channelsLast'); - // Remove dummy last dimension. - return squeeze$1(output, [2]); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -class MaxPooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling1D.className = 'MaxPooling1D'; -serialization.registerClass(MaxPooling1D); -class AveragePooling1D extends Pooling1D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling1D.className = 'AveragePooling1D'; -serialization.registerClass(AveragePooling1D); -/** - * Abstract class for different pooling 2D layers. - */ -class Pooling2D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError(`If the strides property of a 2D pooling layer is an Array, ` + - `it is expected to have a length of 2, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -class MaxPooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling2D.className = 'MaxPooling2D'; -serialization.registerClass(MaxPooling2D); -class AveragePooling2D extends Pooling2D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling2D.className = 'AveragePooling2D'; -serialization.registerClass(AveragePooling2D); -/** - * Abstract class for different pooling 3D layers. - */ -class Pooling3D extends Layer { - constructor(args) { - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError(`If the strides property of a 3D pooling layer is an Array, ` + - `it is expected to have a length of 3, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } - else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ ndim: 5 })]; - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - let depths = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let rows = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - let cols = this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength(depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } - else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - } - call(inputs, kwargs) { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction(getExactlyOneTensor(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); - }); - } - getConfig() { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -class MaxPooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -/** @nocollapse */ -MaxPooling3D.className = 'MaxPooling3D'; -serialization.registerClass(MaxPooling3D); -class AveragePooling3D extends Pooling3D { - constructor(args) { - super(args); - } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -/** @nocollapse */ -AveragePooling3D.className = 'AveragePooling3D'; -serialization.registerClass(AveragePooling3D); -/** - * Abstract class for different global pooling 1D layers. - */ -class GlobalPooling1D extends Layer { - constructor(args) { - super(args); - this.inputSpec = [new InputSpec({ ndim: 3 })]; - } - computeOutputShape(inputShape) { - return [inputShape[0], inputShape[2]]; - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } -} -class GlobalAveragePooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return mean$1(input, 1); - }); - } -} -/** @nocollapse */ -GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; -serialization.registerClass(GlobalAveragePooling1D); -class GlobalMaxPooling1D extends GlobalPooling1D { - constructor(args) { - super(args || {}); - } - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return max$2(input, 1); - }); - } -} -/** @nocollapse */ -GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; -serialization.registerClass(GlobalMaxPooling1D); -/** - * Abstract class for different global pooling 2D layers. - */ -class GlobalPooling2D extends Layer { - constructor(args) { - super(args); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.inputSpec = [new InputSpec({ ndim: 4 })]; - } - computeOutputShape(inputShape) { - inputShape = inputShape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } - else { - return [inputShape[0], inputShape[1]]; - } - } - call(inputs, kwargs) { - throw new NotImplementedError(); - } - getConfig() { - const config = { dataFormat: this.dataFormat }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -class GlobalAveragePooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return mean$1(input, [1, 2]); - } - else { - return mean$1(input, [2, 3]); - } - }); - } -} -/** @nocollapse */ -GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; -serialization.registerClass(GlobalAveragePooling2D); -class GlobalMaxPooling2D extends GlobalPooling2D { - call(inputs, kwargs) { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return max$2(input, [1, 2]); - } - else { - return max$2(input, [2, 3]); - } - }); - } -} -/** @nocollapse */ -GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; -serialization.registerClass(GlobalMaxPooling2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ -class Wrapper extends Layer { - constructor(args) { - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - super(args); - this.layer = args.layer; - } - build(inputShape) { - this.built = true; - } - // TODO(cais): Implement activityRegularizer getter. - get trainable() { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } - else { - return false; - } - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - } - get trainableWeights() { - return this.layer.trainableWeights; - } - // TODO(cais): Implement setter for trainableWeights. - get nonTrainableWeights() { - return this.layer.nonTrainableWeights; - } - // TODO(cais): Implement setter for nonTrainableWeights. - get updates() { - // tslint:disable-next-line:no-any - return this.layer._updates; - } - // TODO(cais): Implement getUpdatesFor(). - get losses() { - return this.layer.losses; - } - // TODO(cais): Implement getLossesFor(). - getWeights() { - return this.layer.getWeights(); - } - setWeights(weights) { - this.layer.setWeights(weights); - } - getConfig() { - const config = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - } - /** @nocollapse */ - static fromConfig(cls, config, customObjects = {}) { - const layerConfig = config['layer']; - const layer = deserialize(layerConfig, customObjects); - delete config['layer']; - const newConfig = { layer }; - Object.assign(newConfig, config); - return new cls(newConfig); - } -} -class TimeDistributed extends Wrapper { - constructor(args) { - super(args); - this.supportsMasking = true; - } - build(inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError(`TimeDistributed layer expects an input shape >= 3D, but received ` + - `input shape ${JSON.stringify(inputShape)}`); - } - this.inputSpec = [{ shape: inputShape }]; - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - super.build(inputShape); - } - computeOutputShape(inputShape) { - inputShape = getExactlyOneShape(inputShape); - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - const childOutputShape = this.layer.computeOutputShape(childInputShape); - const timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - } - call(inputs, kwargs) { - return tidy(() => { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - const step = (inputs, states) => { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - const output = getExactlyOneTensor(this.layer.call(inputs, kwargs)); - return [output, []]; - }; - const rnnOutputs = rnn(step, inputs, [], false /* goBackwards */, null /* mask */, null /* constants */, false /* unroll */, true /* needPerStepOutputs */); - const y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - } -} -/** @nocollapse */ -TimeDistributed.className = 'TimeDistributed'; -serialization.registerClass(TimeDistributed); -function checkBidirectionalMergeMode(value) { - checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); -} -const DEFAULT_BIDIRECTIONAL_MERGE_MODE = 'concat'; -class Bidirectional extends Wrapper { - constructor(args) { - super(args); - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - const layerConfig = args.layer.getConfig(); - const forwDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - this.forwardLayer = deserialize(forwDict); - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - const backDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - this.backwardLayer = deserialize(backDict); - this.forwardLayer.name = 'forward_' + this.forwardLayer.name; - this.backwardLayer.name = 'backward_' + this.backwardLayer.name; - this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(this.mergeMode); - if (args.weights) { - throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); - } - this._stateful = args.layer.stateful; - this.returnSequences = args.layer.returnSequences; - this.returnState = args.layer.returnState; - this.supportsMasking = true; - this._trainable = true; - this.inputSpec = args.layer.inputSpec; - this.numConstants = null; - } - get trainable() { - return this._trainable; - } - set trainable(value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - } - getWeights() { - return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); - } - setWeights(weights) { - const numWeights = weights.length; - const numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - } - computeOutputShape(inputShape) { - let layerShapes = this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes]; - } - layerShapes = layerShapes; - let outputShape; - let outputShapes; - let stateShape; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } - else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } - else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } - else { - outputShapes = [outputShape]; - } - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return singletonOrArray(outputShapes); - } - apply(inputs, kwargs) { - let initialState = kwargs == null ? null : kwargs['initialState']; - let constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - if (Array.isArray(inputs)) { - initialState = inputs.slice(1); - inputs = inputs[0]; - } - if ((initialState == null || initialState.length === 0) && - constants == null) { - return super.apply(inputs, kwargs); - } - const additionalInputs = []; - const additionalSpecs = []; - if (initialState != null) { - const numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push(...initialState); - const stateSpecs = initialState - .map(state => new InputSpec({ shape: state.shape })); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push(...stateSpecs); - } - if (constants != null) { - throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (const tensor of additionalInputs) { - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError('The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return super.apply(inputs, kwargs); - } - } - call(inputs, kwargs) { - return tidy(() => { - const initialState = kwargs['initialState']; - let y; - let yRev; - if (initialState == null) { - y = this.forwardLayer.call(inputs, kwargs); - yRev = this.backwardLayer.call(inputs, kwargs); - } - else { - const forwardState = initialState.slice(0, initialState.length / 2); - const backwardState = initialState.slice(initialState.length / 2); - y = this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); - yRev = this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); - } - let states; - if (this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat(yRev.slice(1)); - } - y = y[0]; - yRev = yRev[0]; - } - if (this.returnSequences) { - yRev = reverse$1(yRev, 1); - } - let output; - if (this.mergeMode === 'concat') { - output = concatenate([y, yRev]); - } - else if (this.mergeMode === 'sum') { - output = add$3(y, yRev); - } - else if (this.mergeMode === 'ave') { - output = mul$1(.5, add$3(y, yRev)); - } - else if (this.mergeMode === 'mul') { - output = mul$1(y, yRev); - } - else if (this.mergeMode == null) { - output = [y, yRev]; - } - // TODO(cais): Properly set learning phase. - if (this.returnState) { - if (this.mergeMode == null) { - return output.concat(states); - } - return [output].concat(states); - } - return output; - }); - } - resetStates(states) { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - } - build(inputShape) { - nameScope(this.forwardLayer.name, () => { - this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, () => { - this.backwardLayer.build(inputShape); - }); - this.built = true; - } - computeMask(inputs, mask) { - if (Array.isArray(mask)) { - mask = mask[0]; - } - let outputMask; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } - else { - outputMask = mask; - } - } - else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } - else { - outputMask = null; - } - } - if (this.returnState) { - const states = this.forwardLayer.states; - const stateMask = states.map(state => null); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } - else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } - else { - return outputMask; - } - } - get trainableWeights() { - return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); - } - get nonTrainableWeights() { - return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); - } - // TODO(cais): Implement constraints(). - setFastWeightInitDuringBuild(value) { - super.setFastWeightInitDuringBuild(value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - } - getConfig() { - const config = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - /** @nocollapse */ - static fromConfig(cls, config) { - const rnnLayer = deserialize(config['layer']); - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError(`Deserialization of a Bidirectional layer with numConstants ` + - `present is not supported yet.`); - } - // tslint:disable-next-line:no-any - const newConfig = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - } -} -/** @nocollapse */ -Bidirectional.className = 'Bidirectional'; -serialization.registerClass(Bidirectional); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// Input Layer. -/** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ -function inputLayer(args) { - return new InputLayer(args); -} -// Advanced Activation Layers. -/** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function elu$2(args) { - return new ELU(args); -} -/** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function reLU(args) { - return new ReLU(args); -} -/** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function leakyReLU(args) { - return new LeakyReLU(args); -} -/** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function prelu$1(args) { - return new PReLU(args); -} -/** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function softmax$1(args) { - return new Softmax$2(args); -} -/** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function thresholdedReLU(args) { - return new ThresholdedReLU(args); -} -// Convolutional Layers. -/** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv1d$1(args) { - return new Conv1D(args); -} -/** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv2d$1(args) { - return new Conv2D$1(args); -} -/** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv2dTranspose$1(args) { - return new Conv2DTranspose(args); -} -/** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv3d(args) { - return new Conv3D$1(args); -} -function conv3dTranspose(args) { - return new Conv3DTranspose(args); -} -/** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function separableConv2d$1(args) { - return new SeparableConv2D(args); -} -/** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function cropping2D(args) { - return new Cropping2D(args); -} -/** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function upSampling2d(args) { - return new UpSampling2D(args); -} -// Convolutional(depthwise) Layers. -/** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function depthwiseConv2d$2(args) { - return new DepthwiseConv2D(args); -} -// Basic Layers. -/** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function activation(args) { - return new Activation$1(args); -} -/** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function dense(args) { - return new Dense(args); -} -/** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function dropout$1(args) { - return new Dropout(args); -} -/** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function spatialDropout1d(args) { - return new SpatialDropout1D(args); -} -/** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function flatten$2(args) { - return new Flatten(args); -} -/** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function repeatVector(args) { - return new RepeatVector(args); -} -/** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function reshape$1(args) { - return new Reshape$1(args); -} -/** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function permute(args) { - return new Permute(args); -} -/** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function embedding(args) { - return new Embedding(args); -} -// Merge Layers. -/** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function add$2(args) { - return new Add$1(args); -} -/** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function average(args) { - return new Average(args); -} -/** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function concatenate$1(args) { - return new Concatenate(args); -} -/** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function maximum$1(args) { - return new Maximum$1(args); -} -/** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function minimum$1(args) { - return new Minimum$1(args); -} -/** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function multiply(args) { - return new Multiply$1(args); -} -/** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function dot$2(args) { - return new Dot(args); -} -// Normalization Layers. -/** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -function batchNormalization$1(args) { - return new BatchNormalization(args); -} -/** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -function layerNormalization(args) { - return new LayerNormalization(args); -} -// Padding Layers. -/** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ -function zeroPadding2d(args) { - return new ZeroPadding2D(args); -} -// Pooling Layers. -/** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling1d(args) { - return new AveragePooling1D(args); -} -function avgPool1d(args) { - return averagePooling1d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling1d(args) { - return averagePooling1d(args); -} -/** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling2d(args) { - return new AveragePooling2D(args); -} -function avgPool2d(args) { - return averagePooling2d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling2d(args) { - return averagePooling2d(args); -} -/** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling3d(args) { - return new AveragePooling3D(args); -} -function avgPool3d(args) { - return averagePooling3d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling3d(args) { - return averagePooling3d(args); -} -/** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalAveragePooling1d(args) { - return new GlobalAveragePooling1D(args); -} -/** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalAveragePooling2d(args) { - return new GlobalAveragePooling2D(args); -} -/** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalMaxPooling1d(args) { - return new GlobalMaxPooling1D(args); -} -/** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalMaxPooling2d(args) { - return new GlobalMaxPooling2D(args); -} -/** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling1d(args) { - return new MaxPooling1D(args); -} -/** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling2d(args) { - return new MaxPooling2D(args); -} -/** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling3d(args) { - return new MaxPooling3D(args); -} -// Recurrent Layers. -/** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function gru(args) { - return new GRU(args); -} -/** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function gruCell(args) { - return new GRUCell(args); -} -/** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function lstm(args) { - return new LSTM(args); -} -/** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function lstmCell(args) { - return new LSTMCell(args); -} -/** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function simpleRNN(args) { - return new SimpleRNN(args); -} -/** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function simpleRNNCell(args) { - return new SimpleRNNCell(args); -} -/** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -function convLstm2d(args) { - return new ConvLSTM2D(args); -} -/** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -function convLstm2dCell(args) { - return new ConvLSTM2DCell(args); -} -/** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function rnn$1(args) { - return new RNN(args); -} -/** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function stackedRNNCells(args) { - return new StackedRNNCells(args); -} -// Wrapper Layers. -/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ -function bidirectional(args) { - return new Bidirectional(args); -} -/** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ -function timeDistributed(args) { - return new TimeDistributed(args); -} -// Aliases for pooling. -const globalMaxPool1d = globalMaxPooling1d; -const globalMaxPool2d = globalMaxPooling2d; -const maxPool1d = maxPooling1d; -const maxPool2d = maxPooling2d; -/** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function gaussianNoise(args) { - return new GaussianNoise(args); -} -/** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function gaussianDropout(args) { - return new GaussianDropout(args); -} -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function alphaDropout(args) { - return new AlphaDropout(args); -} -/** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ -function masking(args) { - return new Masking(args); -} - -var exports_layers = /*#__PURE__*/Object.freeze({ - __proto__: null, - inputLayer: inputLayer, - elu: elu$2, - reLU: reLU, - leakyReLU: leakyReLU, - prelu: prelu$1, - softmax: softmax$1, - thresholdedReLU: thresholdedReLU, - conv1d: conv1d$1, - conv2d: conv2d$1, - conv2dTranspose: conv2dTranspose$1, - conv3d: conv3d, - conv3dTranspose: conv3dTranspose, - separableConv2d: separableConv2d$1, - cropping2D: cropping2D, - upSampling2d: upSampling2d, - depthwiseConv2d: depthwiseConv2d$2, - activation: activation, - dense: dense, - dropout: dropout$1, - spatialDropout1d: spatialDropout1d, - flatten: flatten$2, - repeatVector: repeatVector, - reshape: reshape$1, - permute: permute, - embedding: embedding, - add: add$2, - average: average, - concatenate: concatenate$1, - maximum: maximum$1, - minimum: minimum$1, - multiply: multiply, - dot: dot$2, - batchNormalization: batchNormalization$1, - layerNormalization: layerNormalization, - zeroPadding2d: zeroPadding2d, - averagePooling1d: averagePooling1d, - avgPool1d: avgPool1d, - avgPooling1d: avgPooling1d, - averagePooling2d: averagePooling2d, - avgPool2d: avgPool2d, - avgPooling2d: avgPooling2d, - averagePooling3d: averagePooling3d, - avgPool3d: avgPool3d, - avgPooling3d: avgPooling3d, - globalAveragePooling1d: globalAveragePooling1d, - globalAveragePooling2d: globalAveragePooling2d, - globalMaxPooling1d: globalMaxPooling1d, - globalMaxPooling2d: globalMaxPooling2d, - maxPooling1d: maxPooling1d, - maxPooling2d: maxPooling2d, - maxPooling3d: maxPooling3d, - gru: gru, - gruCell: gruCell, - lstm: lstm, - lstmCell: lstmCell, - simpleRNN: simpleRNN, - simpleRNNCell: simpleRNNCell, - convLstm2d: convLstm2d, - convLstm2dCell: convLstm2dCell, - rnn: rnn$1, - stackedRNNCells: stackedRNNCells, - bidirectional: bidirectional, - timeDistributed: timeDistributed, - globalMaxPool1d: globalMaxPool1d, - globalMaxPool2d: globalMaxPool2d, - maxPool1d: maxPool1d, - maxPool2d: maxPool2d, - Layer: Layer, - RNN: RNN, - RNNCell: RNNCell, - input: input, - gaussianNoise: gaussianNoise, - gaussianDropout: gaussianDropout, - alphaDropout: alphaDropout, - masking: masking -}); - -/** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function binaryAccuracy$1(yTrue, yPred) { - return binaryAccuracy(yTrue, yPred); -} -/** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function binaryCrossentropy$2(yTrue, yPred) { - return binaryCrossentropy$1(yTrue, yPred); -} -/** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function sparseCategoricalAccuracy$1(yTrue, yPred) { - return sparseCategoricalAccuracy(yTrue, yPred); -} -/** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function categoricalAccuracy$1(yTrue, yPred) { - return categoricalAccuracy(yTrue, yPred); -} -/** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function categoricalCrossentropy$2(yTrue, yPred) { - return categoricalCrossentropy$1(yTrue, yPred); -} -/** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function precision$1(yTrue, yPred) { - return precision(yTrue, yPred); -} -/** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function recall$1(yTrue, yPred) { - return recall(yTrue, yPred); -} -/** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function cosineProximity$1(yTrue, yPred) { - return cosineProximity(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanAbsoluteError$1(yTrue, yPred) { - return meanAbsoluteError(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanAbsolutePercentageError$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -function MAPE$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -function mape$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -/** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanSquaredError$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} -function MSE$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} -function mse$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} - -var exports_metrics = /*#__PURE__*/Object.freeze({ - __proto__: null, - binaryAccuracy: binaryAccuracy$1, - binaryCrossentropy: binaryCrossentropy$2, - sparseCategoricalAccuracy: sparseCategoricalAccuracy$1, - categoricalAccuracy: categoricalAccuracy$1, - categoricalCrossentropy: categoricalCrossentropy$2, - precision: precision$1, - recall: recall$1, - cosineProximity: cosineProximity$1, - meanAbsoluteError: meanAbsoluteError$1, - meanAbsolutePercentageError: meanAbsolutePercentageError$1, - MAPE: MAPE$1, - mape: mape$1, - meanSquaredError: meanSquaredError$1, - MSE: MSE$1, - mse: mse$1 -}); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -var exports_models = /*#__PURE__*/Object.freeze({ - __proto__: null, - modelFromJSON: modelFromJSON -}); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l1l2(config) { - return new L1L2(config); -} -/** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l1$1(config) { - return l1(config); -} -/** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l2$1(config) { - return l2(config); -} - -var exports_regularizers = /*#__PURE__*/Object.freeze({ - __proto__: null, - l1l2: l1l2, - l1: l1$1, - l2: l2$1 -}); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -class Callback extends BaseCallback { - constructor() { - super(...arguments); - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - this.model = null; - } - setModel(model) { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - } -} -function less$1(currVal, prevVal) { - return currVal < prevVal; -} -function greater$1(currVal, prevVal) { - return currVal > prevVal; -} -/** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ -class EarlyStopping extends Callback { - constructor(args) { - super(); - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError('restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - this.monitor = args.monitor || 'val_loss'; - this.minDelta = Math.abs(args.minDelta || 0); - this.patience = args.patience || 0; - this.verbose = args.verbose || 0; - this.mode = args.mode || 'auto'; - this.baseline = args.baseline; - if (['auto', 'min', 'max'].indexOf(this.mode) === -1) { - console.warn(`EarlyStopping mode '${this.mode}' is invalid. ` + - `Falling back to mode 'auto'.`); - this.mode = 'auto'; - } - if (this.mode === 'min') { - this.monitorFunc = less$1; - } - else if (this.mode === 'max') { - this.monitorFunc = greater$1; - } - else { - // For mode === 'auto'. - if (this.monitor.indexOf('acc') !== -1) { - this.monitorFunc = greater$1; - } - else { - this.monitorFunc = less$1; - } - } - if (this.monitorFunc === less$1) { - this.minDelta *= -1; - } - } - async onTrainBegin(logs) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } - else { - this.best = this.monitorFunc === less$1 ? Infinity : -Infinity; - } - } - async onEpochEnd(epoch, logs) { - await resolveScalarsInLogs(logs); - const current = this.getMonitorValue(logs); - if (current == null) { - return; - } - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } - else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - } - async onTrainEnd(logs) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log(`Epoch ${this.stoppedEpoch}: early stopping.`); - } - } - getMonitorValue(logs) { - if (logs == null) { - logs = {}; - } - const monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn(`Metric for EarlyStopping ${this.monitor} is not available. ` + - `Available metrics are: ${Object.keys(logs)}`); - } - return monitorValue; - } -} -/** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ -function earlyStopping(args) { - return new EarlyStopping(args); -} -const callbacks = { earlyStopping }; - -export { Callback, CallbackList, CustomCallback, EarlyStopping, History, InputSpec, LayerVariable, LayersModel, RNN, Sequential, SymbolicTensor, callbacks, exports_constraints as constraints, exports_initializers as initializers, input, exports_layers as layers, loadLayersModel, exports_metrics as metrics, model, exports_models as models, registerCallbackConstructor, exports_regularizers as regularizers, sequential, version as version_layers }; -//# sourceMappingURL=tf-layers.fesm.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js.map deleted file mode 100644 index 51462c6e0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.fesm.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/optimizers.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_models.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nexport {modelFromJSON} from './models';\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["base.flatten","base.checkConversionForErrors","util.now","util.rightPad","util.arraysEqual","util.sizeFromShape","util.decodeString","util.assert","util.isString","util.encodeString","util.bytesPerElement","util.makeZerosTypedArray","util.isFunction","add","util.isValidDtype","conv_util.eitherStridesOrDilationsAreOne","util.isInt","util.assertShapesMatch","isFinite","isNaN","ones","conv_util.computePool2DInfo","round","axis_util.expandShapeToKeepDim","broadcast_util.assertAndGetBroadcastShape","broadcast_util.getReductionAxes","conv_util.tupleValuesAreOne","util.parseAxisParam","axis_util.getUndoAxesPermutation","assert","unique","tfc.sqrt","tfc.sum","tfc.mul","tfc.clipByValue","tfc.div","tfc.add","tfc.relu","min","tfc.min","max","tfc.max","cast","expandDims","tile","flatten","math_utils.arrayProd","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","tfc.randomNormal","dot","tfc.fused","gather","tfc.gather","square","elu","tfc.elu","tfc.abs","tfc.dropout","zeros","mul","scalar","randomUniform","K.randomNormal","truncatedNormal","Identity","randomNormal","tfc.variable","generic_utils.toSnakeCase","generic_utils.singletonOrArray","generic_utils.toList","variable_utils.countParamsInWeights","types_utils.normalizeShapeList","div","generic_utils.debounce","K.square","tfc.fill","tfc.maximum","tfc.mean","tfc.sub","tfc.log","tfc.softplus","tfc.softmax","tfc.neg","tfc.floor","K.flatten","tfc.oneHot","tfc.onesLike","K.cast","tfc.greater","tfc.equal","tfc.argMax","tfc.logicalAnd","tfc.where","binaryCrossentropy","lossBinaryCrossentropy","categoricalCrossentropy","categoricalCrossentropyLoss","sparseCategoricalCrossentropy","sparseCategoricalCrossentropyLoss","get","generic_utils.toCamelCase","generic_utils.unique","generic_utils.assert","generic_utils.reverseNumberCompare","layersVersion","generic_utils.pyListRepeat","deserializeLayer","generic_utils.isObjectEmpty","tfc.util","tfc.Tensor","tfc.dispose","tfc.keep","tfc.tidy","Tensor","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","optimizers.getOptimizer","losses.get","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","Metrics.get","Metrics.getLossOrMetricName","K.sliceAlongFirstAxis","tfc.memory","Elu","K.elu","Selu","tfc.selu","Relu","Relu6","tfc.minimum","Sigmoid","tfc.sigmoid","K.hardSigmoid","Softplus","K.softsign","Tanh","tfc.tanh","Softmax","LogSoftmax","tfc.logSoftmax","sum","abs","relu","clipByValue","leakyRelu","prelu","softmaxActivation","tfc.transpose","tfc.conv1d","K.biasAdd","tfc.conv3d","generic_utils.assertPositiveInteger","generic_utils.checkArrayTypeAndLength","generic_utils.mapActivationToFusedKernel","Conv2D","Conv3D","tfc.conv2dTranspose","tfc.conv3dTranspose","tfc.separableConv2d","K.sliceAlongAxis","depthwiseConv2d","tfc.depthwiseConv2d","math_utils.range","tfc.expandDims","tfc.reverse","tfc.unstack","tfc.stack","tfc.zeros","K.expandDims","K.tile","math_utils.min","math_utils.max","K.dot","tfc.split","K.concatAlongFirstAxis","K.dropout","K.inTrainPhase","tfc.ones","K.concatenate","tfc.conv2d","tfc.serialization","K.batchFlatten","Activation","K.repeat","Reshape","transpose","any","notEqual","zerosLike","K.gather","mathUtils.max","mathUtils.arrayProd","mathUtils.range","Add","Multiply","Maximum","Minimum","tfc.all","greaterEqual","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","tfc.moments","tfc.pad","tfc.maxPool","tfc.avgPool","tfc.maxPool3d","tfc.avgPool3d","tfc.squeeze","generic_utils.checkStringTypeUnionValue","softmax","conv1d","conv2d","conv2dTranspose","separableConv2d","dropout","reshape","concatenate","maximum","minimum","batchNormalization","rnn","binaryAccuracy","metrics.binaryAccuracy","metrics.binaryCrossentropy","sparseCategoricalAccuracy","metrics.sparseCategoricalAccuracy","categoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","precision","metrics.precision","recall","metrics.recall","cosineProximity","losses.cosineProximity","meanAbsoluteError","losses.meanAbsoluteError","meanAbsolutePercentageError","losses.meanAbsolutePercentageError","MAPE","mape","meanSquaredError","MSE","mse","l1","regularizers.l1","l2","regularizers.l2","less","greater"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAC,EAAE,IAAI,EAAE,CAAC;;ACrC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,CAAC,EAAE;AACnB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AACM,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;;ACtCnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA+PA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,CAAC,EAAE;AACvB,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC;;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,CAAC,EAAE;AACjB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAC9C,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO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CAAC,IAAI,GAAG,CAAC,CAAC;;SAEf;aAAM;YACL,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;aAChC;;SAEF;KACF;IAED,MAAM,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;YACzC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC;SAC5D;KACF;IAEO,eAAe,CAAC,IAAU;QAChC,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,GAAG,EAAE,CAAC;SACX;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,OAAO,CAAC,IAAI,CACR,4BAA4B,IAAI,CAAC,OAAO,qBAAqB;gBAC7D,0BAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,YAAY,CAAC;KACrB;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2CgB,aAAa,CAAC,IAAgC;IAC5D,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;MAEY,SAAS,GAAG,EAAC,aAAa;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js deleted file mode 100644 index 0bc164100..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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{backend as t,util as e,serialization as n,tidy as s,sqrt as i,sum as r,mul as a,clipByValue as o,div as l,add as u,relu as h,max as c,tensor1d as p,min as d,slice as f,slice4d as g,slice3d as m,slice2d as y,slice1d as b,gather as w,tile as k,randomNormal as x,elu as v,abs as S,dropout as I,concat as N,fused as A,concat4d as C,concat3d as z,concat2d as D,concat1d as $,zeros as T,ones as E,scalar as F,randomUniform as L,truncatedNormal as _,eye as R,linalg as M,variable as O,dispose as B,nextFrame as P,keep as W,log as U,sub as K,mean as j,softmax as V,neg as q,fill as G,maximum as H,floor as J,oneHot as Z,softplus as X,onesLike as Y,greater as Q,equal as tt,argMax as et,logicalAnd as nt,where as st,train as it,memory as rt,cast as at,Tensor as ot,Optimizer as lt,io as ut,selu as ht,minimum as ct,sigmoid as pt,tanh as dt,logSoftmax as ft,leakyRelu as gt,prelu as mt,transpose as yt,conv2dTranspose as bt,conv3dTranspose as wt,conv1d as kt,conv3d as xt,separableConv2d as vt,depthwiseConv2d as St,expandDims as It,reverse as Nt,unstack as At,stack as Ct,split as zt,conv2d as Dt,any as $t,notEqual as Tt,zerosLike as Et,all as Ft,greaterEqual as Lt,moments as _t,batchNorm2d as Rt,batchNorm3d as Mt,batchNorm4d as Ot,pad as Bt,maxPool as Pt,avgPool as Wt,maxPool3d as Ut,avgPool3d as Kt,squeeze as jt}from"@tensorflow/tfjs-core";function Vt(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function qt(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function Gt(t,e=[],n=!1){if(null==e&&(e=[]),Array.isArray(t)||Qt(t)&&!n)for(let s=0;se)):[].concat(t)).every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),qt(t.every((t=>Zt(t))),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function Qt(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function te(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error(`Unknown dtype ${t}`)}function ee(t){return"string"==typeof t||t instanceof String}function ne(t){return Array.isArray(t)?ne(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":"number"==typeof t?"float32":ee(t)?"string":function(t){return"boolean"==typeof t}(t)?"bool":"float32"}function se(t){return!!(t&&t.constructor&&t.call&&t.apply)}function ie(t){const e=t.length;if(e<2)return[];const n=new Array(e-1);n[e-2]=t[e-1];for(let s=e-3;s>=0;--s)n[s]=n[s+1]*t[s+1];return n}function re(t,e,n,s=!1){const i=new Array;if(1===e.length){const r=e[0]*(s?2:1);for(let e=0;et*e))*(s?2:1);for(let e=0;et*e))*(n?2:1);if(0===s)return[];if(s!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return re(0,t,e,n)}function oe(t,e){const n=le(t,e);for(let t=0;t{const[e,n]=t.split(":");this.urlFlags[e]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}(e,n)}))}}}function ce(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((t,...n)=>(function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(e,n[0],n[1]),n.join("=")))),e}function pe(){return fe}let de,fe=null;function ge(){if(null==de){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof global)t=global;else if("undefined"!=typeof process)t=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}de=t}return de}function me(t,e){const n=function(){const t=ge();return null==t._tfGlobals&&(t._tfGlobals=new Map),t._tfGlobals}();if(n.has(t))return n.get(t);{const s=e();return n.set(t,s),n.get(t)}}const ye=me("kernelRegistry",(()=>new Map)),be=me("gradRegistry",(()=>new Map));function we(t,e){const n=function(t,e){return`${e}_${t}`}(t,e);return ye.get(n)}function ke(t){return be.get(t)}function xe(t){const e=ye.entries(),n=[];for(;;){const{done:s,value:i}=e.next();if(s)break;const[r,a]=i,[o]=r.split("_");o===t&&n.push(a)}return n}function ve(t){const{kernelName:e}=t;be.has(e)&&pe().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${e}'`),be.set(e,t)}function Se(t,e){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=Gt(t)),pe().getBool("DEBUG")&&function(t,e){for(let n=0;n{s=n()};let r;const a=Ie();if(this.backendTimer.timerAvailable())r=this.backendTimer.time(i);else{i();for(const t of s)t.dataSync();r=Promise.resolve({kernelMs:Ie()-a})}if(pe().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let e=0;e{Ce(e,n.dtype,t)}))}return{kernelName:t,outputs:s,inputs:e,timeMs:r.then((t=>t.kernelMs)),extraInfo:r.then((t=>null!=t.getExtraProfileInfo?t.getExtraProfileInfo():""))}}logKernelProfile(t){const{kernelName:e,outputs:n,timeMs:s,inputs:i,extraInfo:r}=t;n.forEach((t=>{Promise.all([t.data(),s,r]).then((n=>{this.logger.logKernelProfile(e,t,n[0],n[1],i,n[2])}))}))}}function Ce(t,e,n){if("float32"!==e)return!1;for(let e=0;e0?s:""} `}}console.log(`%c${o}\t%c${a}\t%c${l}D ${h}\t%c${u}\t%c${c}\t%c${r}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function De(t,e,n,s){const i=ie(e),r=function(t,e,n,s){const i=Ht(e),r=s[s.length-1],a=new Array(r).fill(0),o=e.length,l="complex64"===n?Fe(t):t;if(o>1)for(let t=0;t" "+t)).join("\n")),l.join("\n")}function $e(t,e,n){let s;return s=Array.isArray(t)?`${parseFloat(t[0].toFixed(7))} + ${parseFloat(t[1].toFixed(7))}j`:ee(t)?`'${t}'`:"bool"===n?Te(t):parseFloat(t.toFixed(7)).toString(),Xt(s,e)}function Te(t){return 0===t?"false":"true"}function Ee(t,e,n,s,i,r=!0){const a="complex64"===n?2:1,o=e[0],l=e.length;if(0===l){if("complex64"===n){return[$e(Fe(t)[0],0,n)]}return"bool"===n?[Te(t[0])]:[t[0].toString()]}if(1===l){if(o>20){const e=3*a;let s=Array.from(t.slice(0,e)),r=Array.from(t.slice((o-3)*a,o*a));return"complex64"===n&&(s=Fe(s),r=Fe(r)),["["+s.map(((t,e)=>$e(t,i[e],n))).join(", ")+", ..., "+r.map(((t,e)=>$e(t,i[o-3+e],n))).join(", ")+"]"]}return["["+("complex64"===n?Fe(t):Array.from(t)).map(((t,e)=>$e(t,i[e],n))).join(", ")+"]"]}const u=e.slice(1),h=s.slice(1),c=s[0]*a,p=[];if(o>20){for(let e=0;e<3;e++){const s=e*c,r=s+c;p.push(...Ee(t.slice(s,r),u,n,h,i,!1))}p.push("...");for(let e=o-3;eNe(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataSync(){this.throwIfDisposed();const t=Le().readSync(this.dataId);if("string"===this.dtype)try{return t.map((t=>Ne(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();const t=await Le().read(this.dataId);return"string"===this.dtype?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(Le().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return null.print(this,t)}clone(){return this.throwIfDisposed(),null.clone(this)}toString(t=!1){return De(this.dataSync(),this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),null.cast(this,t)}variable(t=!0,e,n){return this.throwIfDisposed(),Le().makeVariable(this,t,e,n)}}function Re(){return me("Tensor",(()=>_e))}Object.defineProperty(_e,Symbol.hasInstance,{value:t=>!!t&&null!=t.data&&null!=t.dataSync&&null!=t.throwIfDisposed}),Re();class Me extends _e{constructor(t,e,n,s){super(t.shape,t.dtype,t.dataId,s),this.trainable=e,this.name=n}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!Jt(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);Le().disposeTensor(this),this.dataId=t.dataId,Le().incRef(this,null)}dispose(){Le().disposeVariable(this),this.isDisposedInternal=!0}}var Oe,Be,Pe,We,Ue;Object.defineProperty(Me,Symbol.hasInstance,{value:t=>t instanceof _e&&null!=t.assign&&t.assign instanceof Function}),function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(Oe||(Oe={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(Be||(Be={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(Pe||(Pe={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(We||(We={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(Ue||(Ue={}));const Ke={float32:We,int32:Be,bool:Pe,complex64:Ue};function je(t,e){if(t.dtype===e.dtype)return[t,e];const n=function(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return Ke[t][e]}(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function Ve(t){const e=[];return qe(t,e,new Set),e}function qe(t,e,n){if(null==t)return;if(t instanceof _e)return void e.push(t);if(s=t,!Array.isArray(s)&&"object"!=typeof s)return;var s;const i=t;for(const t in i){const s=i[t];n.has(s)||(n.add(s),qe(s,e,n))}}function Ge(t){return null!=t.kernelName}class He{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((t=>t.name))))}}}dispose(){for(const t in this.registeredVariables)this.registeredVariables[t].dispose()}}class Je{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new He}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const t=this.getSortedBackends();for(let e=0;e{null!=t.setupFunc&&t.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(t){xe(t).forEach((e=>{null!=e.disposeFunc&&e.disposeFunc(this.registry[t])}))}initializeBackend(t){const e=this.registryFactory[t];if(null==e)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{const n=e.factory();if(!n||n instanceof class{refCount(t){return Vt("refCount")}incRef(t){return Vt("incRef")}timerAvailable(){return!0}time(t){return Vt("time")}read(t){return Vt("read")}readSync(t){return Vt("readSync")}numDataIds(){return Vt("numDataIds")}disposeData(t,e){return Vt("disposeData")}write(t,e,n){return Vt("write")}move(t,e,n,s,i){return Vt("move")}memory(){return Vt("memory")}floatPrecision(){return Vt("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return Vt("dispose")}}||"function"!=typeof n.then)return this.registry[t]=n,{success:!0,asyncInit:!1};{const e=++this.pendingBackendInitId,s=n.then((n=>!(e(ethis.registryFactory[e].priority-this.registryFactory[t].priority))}initializeBackendsAndReturnBest(){const t=this.getSortedBackends();for(let e=0;ethis.startScope(s)),(()=>this.endScope(n)),(()=>(n=e(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(t,e,n){t();try{const t=n();return e(),t}catch(t){throw e(),t}}nextTensorId(){return Je.nextTensorId++}nextVariableId(){return Je.nextVariableId++}clone(t){const e=Ze.runKernel("Identity",{x:t}),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],(t=>({x:()=>{const e={x:t},n={dtype:"float32"};return Ze.runKernel("Cast",e,n)}})),[],{}),e}runKernel(t,e,n){if(!(null!=we(t,this.backendName)))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,n){const s=this.backend.numDataIds();let i=0;n.forEach((t=>{i+="complex64"===t.dtype?3:1}));const r=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-e-i-r;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${t}'`)}runKernelFunc(t){let e,n=[];const s=this.isTapeOn(),i=this.state.numBytes,r=this.state.numTensors;let a,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=Ge(t)?t.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(Ge(t)){const{kernelName:e,inputs:i,attrs:r}=t;null==this.backendName&&this.backend;const l=we(e,this.backendName);qt(null!=l,(()=>`Cannot find registered kernel '${e}' for backend '${this.backendName}'`)),a=()=>{const t=this.backend.numDataIds();o=l.kernelFunc({inputs:i,attrs:r,backend:this.backend});const a=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(e,t,a);const u=a.map((t=>{if(null!=t.rank)return t;const{dataId:e,shape:n,dtype:s}=t;return this.makeTensorFromDataId(e,n,s)}));if(s){const t=this.getTensorsForGradient(e,i,u);n=this.saveTensorsForBackwardMode(t)}return u}}else{const{forwardFunc:e}=t,i=t=>{s&&(n=t.map((t=>this.keep(this.clone(t)))))};a=()=>{const t=this.backend.numDataIds();o=this.tidy((()=>e(this.backend,i)));const n=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,t,n),n}}const{inputs:u,attrs:h}=t,c=Ge(t)?null:t.backwardsFunc;let p;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(p=this.profiler.profileKernel(l,u,(()=>a())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(p),e=p.outputs):e=a()})),s&&this.addTapeNode(l,u,e,c,n,h),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-i,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-r,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map((t=>null!=u[t]?u[t].shape:null)),outputShapes:e.map((t=>t.shape)),kernelTimeMs:p.timeMs,extraInfo:p.extraInfo}),Array.isArray(o)?e:e[0]}saveTensorsForBackwardMode(t){return t.map((t=>this.keep(this.clone(t))))}getTensorsForGradient(t,e,n){const s=ke(t);if(null!=s){const t=s.inputsToSave||[],i=s.outputsToSave||[];let r;s.saveAllInputs?(qt(Array.isArray(e),(()=>"saveAllInputs is true, expected inputs to be an array.")),r=Object.keys(e).map((t=>e[t]))):r=t.map((t=>e[t]));const a=n.filter(((t,e)=>i[e]));return r.concat(a)}return[]}makeTensor(t,e,n,s){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let i=t;"string"===n&&ee(t[0])&&(i=t.map((t=>function(t,e="utf-8"){return e=e||"utf-8",pe().platform.encode(t,e)}(t))));const r=s.write(i,e,n),a=new _e(e,n,r,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const t=this.state.tensorInfo.get(r),e=function(t){if(null==t)return 0;let e=0;return t.forEach((t=>e+=t.length)),e}(i);this.state.numBytes+=e-t.bytes,t.bytes=e}return a}makeTensorFromDataId(t,e,n,s){const i=new _e(e,n=n||"float32",t,this.nextTensorId());return this.trackTensor(i,s),i}makeVariable(t,e=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==t.dtype&&(t=t.cast(s));const i=new Me(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(t,e){this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(n=t.size*te(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof Me||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;const e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,"string"===t.dtype&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),"complex64"!==t.dtype&&"string"!==t.dtype){const e=t.size*te(t.dtype);this.state.numBytes-=e}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(const t in this.state.registeredVariables){const e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]}memory(){const t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;const e=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((t=>t.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const t of this.state.activeProfile.kernels)t.kernelTimeMs=await t.kernelTimeMs,t.extraInfo=await t.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(t,e,n,s,i,r){const a={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},o=ke(t);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=t=>(t=t.map(((t,e)=>{if(null==t){const t=n[e],s=le(t.size,t.dtype);return this.makeTensor(s,t.shape,t.dtype)}return t})),s(t.length>1?t:t[0],i,r))),this.state.activeTape.push(a)}keep(t){return t.kept=!0,t}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){const e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){const e=Ve(t),n=new Set(e.map((t=>t.id)));for(let t=0;t{t.kept||t.scopeId!==s.id||this.track(t)}))}gradients(t,e,n,s=!1){if(qt(e.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const i=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",t)));qt(i instanceof _e,(()=>"The result y returned by f() must be a tensor."));const r=function(t,e,n){const s={},i={};for(let t=0;ts[t.id]=!0)),o=!0,i[r.id]=!0;break}if(o)break}}const r={};r[n.id]=!0;const a={};for(let e=t.length-1;e>=0;e--){const n=t[e],s=n.inputs;for(let t=0;t0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const t={};t[i.id]=null==n?function(t){const e=oe(Ht(t),"float32");return Ze.makeTensor(e,t,"float32")}(i.shape):n,function(t,e,n,s){for(let i=e.length-1;i>=0;i--){const r=e[i],a=[];if(r.outputs.forEach((e=>{const n=t[e.id];null!=n?a.push(n):a.push(null)})),null==r.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${r.kernelName}.`);const o=r.gradient(a);for(const e in r.inputs){if(!(e in o))throw new Error(`Cannot backprop through input ${e}. Available gradients found: ${Object.keys(o)}.`);const i=n((()=>o[e]()));if("float32"!==i.dtype)throw new Error(`Error in gradient for op ${r.kernelName}. The gradient of input ${e} must have 'float32' dtype, but has '${i.dtype}'`);const a=r.inputs[e];if(!Jt(i.shape,a.shape))throw new Error(`Error in gradient for op ${r.kernelName}. The gradient of input '${e}' has shape '${i.shape}', which does not match the shape of the input '${a.shape}'`);if(null==t[a.id])t[a.id]=i;else{const e=t[a.id];t[a.id]=s(e,i),e.dispose()}}}}(t,r,(t=>this.tidy(t)),Xe);const s=e.map((e=>t[e.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((t=>{for(const e of t.saved)e.dispose()})),this.state.activeTape=null),{value:i,grads:s}}))}customGrad(t){return qt(se(t),(()=>"The f passed in customGrad(f) must be a function.")),(...e)=>{let n;qt(e.every((t=>t instanceof _e)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const s={};e.forEach(((t,e)=>{s[e]=t}));return this.runKernelFunc({forwardFunc:(s,i)=>(n=t(...e,i),qt(n.value instanceof _e,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),qt(se(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(t,s)=>{const i=n.gradFunc(t,s),r=Array.isArray(i)?i:[i];qt(r.length===e.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),qt(r.every((t=>t instanceof _e)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const a={};return r.forEach(((t,e)=>{a[e]=()=>t})),a},inputs:s})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}async time(t){const e=Ie(),n=await this.backend.time(t);return n.wallMs=Ie()-e,n}track(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new He;for(const t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Je.nextTensorId=0,Je.nextVariableId=0;const Ze=function(){const t=ge();if(null==t._tfengine){const e=new he(t);t._tfengine=new Je(e)}var e;return e=t._tfengine.ENV,fe=e,Le=()=>t._tfengine,t._tfengine}();function Xe(t,e){const n={a:t,b:e};return Ze.runKernel("Add",n)}function Ye(t,e){let n=t;if(Qt(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];const s=[];for(;Array.isArray(n)||Qt(n)&&"string"!==e;)s.push(n.length),n=n[0];return Array.isArray(t)&&pe().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Qe(t,s,[]),s}function Qe(t,e,n){if(n=n||[],!Array.isArray(t)&&!Qt(t))return void qt(0===e.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`));qt(e.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`)),qt(t.length===e[0],(()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`));const s=e.slice(1);for(let e=0;e=0&&(i=s),tn(s,i,e,n),null==t||!Qt(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){const s=null==t?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const r=Ye(t,i);Qt(t)||Array.isArray(t)||(t=[t]);const a="string"!==i?Se(t,i):Gt(t,[],!0);return Ze.makeTensor(a,r,i)}function nn(t,e,n,s="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map(((t,i)=>en(t,`${e}[${i}]`,n,s)))}function sn(t){const e=Object.keys(t);if(1!==e.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const s=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const i=(...t)=>{Ze.startScope(n);try{const e=s(...t);return ue(e)&&console.error("Cannot return a Promise inside of tidy."),Ze.endScope(e),e}catch(t){throw Ze.endScope(null),t}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}const rn=sn({abs_:function(t){const e=en(t,"x","abs");if("complex64"===e.dtype){const t={x:e};return Ze.runKernel("ComplexAbs",t)}{const t={x:e};return Ze.runKernel("Abs",t)}}});const an=sn({acos_:function(t){const e={x:en(t,"x","acos")};return Ze.runKernel("Acos",e)}});const on=sn({acosh_:function(t){const e={x:en(t,"x","acosh")};return Ze.runKernel("Acosh",e)}});const ln=sn({add_:function(t,e){let n=en(t,"a","add"),s=en(e,"b","add");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Add",i)}});const un=sn({all_:function(t,e=null,n=!1){const s={x:en(t,"x","all","bool")},i={axis:e,keepDims:n};return Ze.runKernel("All",s,i)}});const hn=sn({any_:function(t,e=null,n=!1){const s={x:en(t,"x","any","bool")},i={axis:e,keepDims:n};return Ze.runKernel("Any",s,i)}});const cn=sn({argMax_:function(t,e=0){const n={x:en(t,"x","argMax")},s={axis:e};return Ze.runKernel("ArgMax",n,s)}});const pn=sn({argMin_:function(t,e=0){const n={x:en(t,"x","argMin")},s={axis:e};return Ze.runKernel("ArgMin",n,s)}});const dn=sn({asin_:function(t){const e={x:en(t,"x","asin")};return Ze.runKernel("Asin",e)}});const fn=sn({asinh_:function(t){const e={x:en(t,"x","asinh")};return Ze.runKernel("Asinh",e)}});const gn=sn({atan_:function(t){const e={x:en(t,"x","atan")};return Ze.runKernel("Atan",e)}});const mn=sn({atan2_:function(t,e){let n=en(t,"a","atan2"),s=en(e,"b","atan2");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Atan2",i)}});const yn=sn({atanh_:function(t){const e={x:en(t,"x","atanh")};return Ze.runKernel("Atanh",e)}});const bn=sn({cast_:function(t,e){const n=en(t,"x","cast");if(!function(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},i={dtype:e};return Ze.runKernel("Cast",s,i)}});function wn(t,e,n,s,i,r,a="channelsLast"){const[o,l]=kn(e);let u;if("channelsLast"===a)u=[o,l,t[3],t[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[o,l,t[1],t[1]]}return function(t,e,n,s,i,r,a=!1,o="channelsLast"){let[l,u,h,c]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,h,c]=t;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,c,u,h]=t}const[p,d,,f]=e,[g,m]=kn(n),[y,b]=kn(s),w=xn(p,y),k=xn(d,b),{padInfo:x,outHeight:v,outWidth:S}=function(t,e,n,s,i,r,a,o,l){let u,h,c;if("number"==typeof t){u={top:t,bottom:t,left:t,right:t,type:0===t?"VALID":"NUMBER"};const i=function(t,e,n,s,i){null==s&&(s=function(t,e,n,s=1){const i=xn(e,s);return Math.floor((t[0]*(n-1)-n+i)/2)}(t,e,n));const r=t[0],a=t[1],o=vn((r-e+2*s)/n+1,i),l=vn((a-e+2*s)/n+1,i);return[o,l]}([e,n],r,s,t,o);h=i[0],c=i[1]}else if("same"===t){h=Math.ceil(e/s),c=Math.ceil(n/i);const t=Math.max(0,(h-1)*s+r-e),o=Math.max(0,(c-1)*i+a-n),l=Math.floor(t/2),p=t-l,d=Math.floor(o/2);u={top:l,bottom:p,left:d,right:o-d,type:"SAME"}}else if("valid"===t)u={top:0,bottom:0,left:0,right:0,type:"VALID"},h=Math.ceil((e-r+1)/s),c=Math.ceil((n-a+1)/i);else{if("object"!=typeof t)throw Error(`Unknown padding parameter: ${t}`);{const p="channelsLast"===l?t[1][0]:t[2][0],d="channelsLast"===l?t[1][1]:t[2][1],f="channelsLast"===l?t[2][0]:t[3][0],g="channelsLast"===l?t[2][1]:t[3][1];u={top:p,bottom:d,left:f,right:g,type:0===p&&0===d&&0===f&&0===g?"VALID":"EXPLICIT"},h=vn((e-r+p+d)/s+1,o),c=vn((n-a+f+g)/i+1,o)}}return{padInfo:u,outHeight:h,outWidth:c}}(i,u,h,g,m,w,k,r,o),I=a?f*c:f;let N;"channelsFirst"===o?N=[l,I,v,S]:"channelsLast"===o&&(N=[l,v,S,I]);return{batchSize:l,dataFormat:o,inHeight:u,inWidth:h,inChannels:c,outHeight:v,outWidth:S,outChannels:I,padInfo:x,strideHeight:g,strideWidth:m,filterHeight:p,filterWidth:d,effectiveFilterHeight:w,effectiveFilterWidth:k,dilationHeight:y,dilationWidth:b,inShape:t,outShape:N,filterShape:e}}(t,u,n,s,i,r,!1,a)}function kn(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function xn(t,e){return e<=1?t:t+(t-1)*(e-1)}function vn(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function Sn(t){const[e,n,s]=kn(t);return 1===e&&1===n&&1===s}function In(t,e){return Sn(t)||Sn(e)}const Nn=sn({reshape_:function(t,e){const n={x:en(t,"x","reshape","string_or_numeric")},s={shape:e};return Ze.runKernel("Reshape",n,s)}});const An=sn({avgPool_:function(t,e,n,s,i){const r=en(t,"x","avgPool","float32");qt(In(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let a=r,o=!1;3===r.rank&&(o=!0,a=Nn(r,[1,r.shape[0],r.shape[1],r.shape[2]])),qt(4===a.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`)),null!=i&&qt(Zt(s),(()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`));const l={x:a},u={filterSize:e,strides:n,pad:s,dimRoundingMode:i};let h=Ze.runKernel("AvgPool",l,u);return h=bn(h,r.dtype),o?Nn(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const Cn=sn({clone_:function(t){const e={x:en(t,"x","clone","string_or_numeric")};return Ze.runKernel("Identity",e)}});const zn=sn({concat_:function(t,e=0){qt(t.length>=1,(()=>"Pass at least one tensor to concat"));const n=nn(t,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((t=>{if("complex64"!==t.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${t.dtype}. `)})),1===n.length)return Cn(n[0]);const s=n,i={axis:e};return Ze.runKernel("Concat",s,i)}});const Dn=sn({matMul_:function(t,e,n=!1,s=!1){let i=en(t,"a","matMul"),r=en(e,"b","matMul");[i,r]=je(i,r);const a={a:i,b:r},o={transposeA:n,transposeB:s};return Ze.runKernel("BatchMatMul",a,o)}});const $n=sn({mul_:function(t,e){let n=en(t,"a","mul"),s=en(e,"b","mul");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Multiply",i)}});const Tn=sn({sigmoid_:function(t){const e={x:en(t,"x","sigmoid")};return Ze.runKernel("Sigmoid",e)}});const En=sn({slice_:function(t,e,n){const s=en(t,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const i={x:s},r={begin:e,size:n};return Ze.runKernel("Slice",i,r)}});const Fn=sn({tanh_:function(t){const e={x:en(t,"x","tanh")};return Ze.runKernel("Tanh",e)}});const Ln=sn({batchToSpaceND_:function(t,e,n){const s=en(t,"x","batchToSpaceND"),i=e.reduce(((t,e)=>t*e));qt(s.rank>=1+e.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${e.length}`)),qt(n.length===e.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`)),qt(s.shape[0]%i==0,(()=>`input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${i}`));const r={x:s},a={blockShape:e,crops:n};return Ze.runKernel("BatchToSpaceND",r,a)}});const _n=sn({batchNorm_:function(t,e,n,s,i,r){null==r&&(r=.001);const a=en(t,"x","batchNorm"),o=en(e,"mean","batchNorm"),l=en(n,"variance","batchNorm");let u,h;null!=i&&(u=en(i,"scale","batchNorm")),null!=s&&(h=en(s,"offset","batchNorm")),qt(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==h||o.rank===h.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const c={x:function(t){let e;return e=0===t.rank||1===t.rank?Nn(t,[1,1,1,t.size]):2===t.rank?Nn(t,[1,1,t.shape[0],t.shape[1]]):3===t.rank?Nn(t,[1,t.shape[0],t.shape[1],t.shape[2]]):t,e}(a),scale:u,offset:h,mean:o,variance:l},p={varianceEpsilon:r},d=Ze.runKernel("FusedBatchNorm",c,p);return Nn(d,a.shape)}});const Rn=sn({broadcastTo_:function(t,e){let n=en(t,"broadcastTo","x");const s=n.shape;if(e.some((t=>!(t>0)||t%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const t=n.shape.slice();for(;t.length=0;t--)if(i[t]===e[t])r[t]=1;else if(1!==n.shape[t])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${e}].`);if(0===r.map(((t,e)=>t>1?e:-1)).filter((t=>t>=0)).length)return Cn(n);const a={x:n},o={reps:r};return Ze.runKernel("Tile",a,o)}});const Mn=sn({ceil_:function(t){const e={x:en(t,"x","ceil")};return Ze.runKernel("Ceil",e)}});const On=sn({clipByValue_:function(t,e,n){const s=en(t,"x","clipByValue");qt(e<=n,(()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`));const i={x:s},r={clipValueMin:e,clipValueMax:n};return Ze.runKernel("ClipByValue",i,r)}});const Bn=sn({complex_:function(t,e){const n=en(t,"real","complex"),s=en(e,"imag","complex");!function(t,e,n=""){qt(Jt(t,e),(()=>n+` Shapes ${t} and ${e} must match`))}(n.shape,s.shape,`real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`);const i={real:n,imag:s};return Ze.runKernel("Complex",i)}});const Pn=sn({conv2d_:function(t,e,n,s,i="NHWC",r=[1,1],a){const o=en(t,"x","conv2d"),l=en(e,"filter","conv2d");let u=o,h=!1;3===o.rank&&(h=!0,u=Nn(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),null!=a&&qt(Zt(s),(()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${s}.`));const c="NHWC"===i?u.shape[3]:u.shape[1];qt(c===l.shape[2],(()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${l.shape[2]}.`)),qt(In(n,r),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${r}'`));const p={x:u,filter:l},d={strides:n,pad:s,dataFormat:i,dilations:r,dimRoundingMode:a},f=Ze.runKernel("Conv2D",p,d);return h?Nn(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Wn=sn({conv1d_:function(t,e,n,s,i="NWC",r=1,a){const o=en(t,"x","conv1d"),l=en(e,"filter","conv1d");let u=o,h=!1;2===o.rank&&(h=!0,u=Nn(o,[1,o.shape[0],o.shape[1]])),qt(3===u.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`)),qt(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),null!=a&&qt(Zt(s),(()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${s}.`)),qt(u.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),qt(In(n,r),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${r}'`)),qt("NWC"===i,(()=>`Error in conv1d: got dataFormat of ${i} but only NWC is currently supported.`));const c=Nn(l,[1,l.shape[0],l.shape[1],l.shape[2]]),p=Nn(u,[u.shape[0],1,u.shape[1],u.shape[2]]),d=Pn(p,c,[1,n],s,"NHWC",[1,r],a);return Nn(d,h?[d.shape[2],d.shape[3]]:[d.shape[0],d.shape[2],d.shape[3]])}});const Un=sn({conv2DBackpropInput_:function(t,e,n,s,i,r="NHWC",a){qt(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let o=t,l=e,u=!1;3===e.rank&&(u=!0,l=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2]]),o=[1,t[0],t[1],t[2]]),qt(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),qt(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),qt(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const h="NHWC"===r?o[3]:o[1],c="NHWC"===r?l.shape[3]:l.shape[1];qt(h===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${h}) must match input depth for filter ${n.shape[2]}.`)),qt(c===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[3]}.`)),null!=a&&qt(Zt(i),(()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const p={dy:l,filter:n},d={strides:s,pad:i,dataFormat:r,dimRoundingMode:a,inputShape:o},f=Ze.runKernel("Conv2DBackpropInput",p,d);return u?Nn(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Kn=sn({conv2dTranspose_:function(t,e,n,s,i,r){const a=en(t,"x","conv2dTranspose"),o=en(e,"filter","conv2dTranspose");return Un(n,a,o,s,i,"NHWC",r)}});const jn=sn({conv3DBackpropInput_:function(t,e,n,s,i){qt(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let r=t,a=e,o=!1;4===e.rank&&(o=!0,a=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),r=[1,t[0],t[1],t[2],t[3]]);const l=r[4],u=a.shape[4];qt(5===r.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${r.length}.`)),qt(5===a.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`)),qt(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),qt(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),qt(u===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`));const h={dy:a,filter:n},c={pad:i,strides:s,inputShape:r},p=Ze.runKernel("Conv3DBackpropInputV2",h,c);return o?Nn(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}});const Vn=sn({cos_:function(t){const e={x:en(t,"x","cos")};return Ze.runKernel("Cos",e)}});const qn=sn({cosh_:function(t){const e={x:en(t,"x","cosh")};return Ze.runKernel("Cosh",e)}});const Gn=sn({cumsum_:function(t,e=0,n=!1,s=!1){const i={x:en(t,"x","cumsum")},r={axis:e,exclusive:n,reverse:s};return Ze.runKernel("Cumsum",i,r)}});const Hn=sn({depthToSpace_:function(t,e,n="NHWC"){const s=en(t,"x","depthToSpace"),i="NHWC"===n?s.shape[1]:s.shape[2],r="NHWC"===n?s.shape[2]:s.shape[3],a="NHWC"===n?s.shape[3]:s.shape[1];qt(i*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${e} for depthToSpace with input shape\n ${s.shape}`)),qt(r*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${e} for depthToSpace with input shape\n ${s.shape}`)),qt(a%(e*e)==0,(()=>`Dimension size must be evenly divisible by ${e*e} but is ${a} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:e,dataFormat:n};return Ze.runKernel("DepthToSpace",o,l)}});const Jn=sn({depthwiseConv2d_:function(t,e,n,s,i="NHWC",r=[1,1],a){const o=en(t,"x","depthwiseConv2d"),l=en(e,"filter","depthwiseConv2d");let u=o,h=!1;3===o.rank&&(h=!0,u=Nn(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`)),qt(u.shape[3]===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${u.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`)),null!=a&&qt(Zt(s),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${s}.`));const c={x:u,filter:l},p={strides:n,pad:s,dataFormat:i,dilations:r,dimRoundingMode:a},d=Ze.runKernel("DepthwiseConv2dNative",c,p);return h?Nn(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Zn=sn({dilation2d_:function(t,e,n,s,i=[1,1],r="NHWC"){const a=en(t,"x","dilation2d"),o=en(e,"filter","dilation2d");qt(3===a.rank||4===a.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`)),qt(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),qt("NHWC"===r,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${r}`));let l=a,u=!1;3===a.rank&&(l=Nn(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0);const h={x:l,filter:o},c={strides:n,pad:s,dilations:i},p=Ze.runKernel("Dilation2D",h,c);return u?Nn(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const Xn=sn({floorDiv_:function(t,e){let n=en(t,"a","floorDiv"),s=en(e,"b","floorDiv");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("FloorDiv",i)}});const Yn=sn({div_:function(t,e){let n=en(t,"a","div"),s=en(e,"b","div");if([n,s]=je(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Xn(n,s);const i={a:n,b:s};return Ze.runKernel("RealDiv",i,{})}});function Qn(t,e){const n=[];for(let s=0;s1)&&n.unshift(r)}return n}function ts(t,e){const n=[],s=Math.max(t.length,e.length);for(let i=0;i`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${s.rank}.`));const i=1===n.rank?n.size:n.shape[1],r=1===s.rank?s.size:s.shape[0];if(qt(i===r,(()=>`Error in dot: inner dimensions of inputs must match, but got ${i} and ${r}.`)),1===n.rank&&1===s.rank){const t=Nn(n,[1,-1]),e=Nn(s,[-1,1]),i=Dn(t,e);return Nn(i,[])}if(1===n.rank&&2===s.rank){const t=Nn(n,[1,-1]),e=Nn(s,[s.shape[0],s.shape[1]]),i=Dn(t,e);return Nn(i,[i.size])}if(2===n.rank&&1===s.rank){const t=Nn(s,[-1,1]),e=Dn(n,t);return Nn(e,[e.size])}{const t=Nn(s,[s.shape[0],s.shape[1]]);return Dn(n,t)}}});const as=sn({elu_:function(t){const e={x:en(t,"x","elu")};return Ze.runKernel("Elu",e)}});const os=sn({erf_:function(t){let e=en(t,"x","erf");qt("int32"===e.dtype||"float32"===e.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===e.dtype&&(e=bn(e,"float32"));const n={x:e};return Ze.runKernel("Erf",n)}});const ls=sn({exp_:function(t){const e={x:en(t,"x","exp")};return Ze.runKernel("Exp",e)}});const us=sn({expandDims_:function(t,e=0){const n=en(t,"x","expandDims","string_or_numeric");qt(e<=n.rank,(()=>"Axis must be <= rank of the tensor"));const s={input:n},i={dim:e};return Ze.runKernel("ExpandDims",s,i)}});const hs=sn({expm1_:function(t){const e={x:en(t,"x","expm1")};return Ze.runKernel("Expm1",e)}});const cs=sn({tile_:function(t,e){const n=en(t,"x","tile","string_or_numeric");qt(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`));const s={x:n},i={reps:e};return Ze.runKernel("Tile",s,i)}});const ps=sn({floor_:function(t){const e={x:en(t,"x","floor")};return Ze.runKernel("Floor",e)}});const ds=sn({gather_:function(t,e,n=0,s=0){const i={x:en(t,"x","gather"),indices:en(e,"indices","gather","int32")},r={axis:n,batchDims:s};return Ze.runKernel("GatherV2",i,r)}});const fs=sn({greater_:function(t,e){let n=en(t,"a","greater"),s=en(e,"b","greater");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("Greater",i)}});const gs=sn({greaterEqual_:function(t,e){let n=en(t,"a","greaterEqual"),s=en(e,"b","greaterEqual");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("GreaterEqual",i)}});const ms=sn({imag_:function(t){const e={input:en(t,"input","imag")};return Ze.runKernel("Imag",e)}});const ys=sn({isFinite_:function(t){const e={x:en(t,"x","isFinite")};return Ze.runKernel("IsFinite",e)}});const bs=sn({isInf_:function(t){const e={x:en(t,"x","isInf")};return Ze.runKernel("IsInf",e)}});const ws=sn({isNaN_:function(t){const e={x:en(t,"x","isNaN")};return Ze.runKernel("IsNan",e)}});const ks=sn({leakyRelu_:function(t,e=.2){const n={x:en(t,"x","leakyRelu")},s={alpha:e};return Ze.runKernel("LeakyRelu",n,s)}});const xs=sn({less_:function(t,e){let n=en(t,"a","less"),s=en(e,"b","less");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("Less",i)}});const vs=sn({lessEqual_:function(t,e){let n=en(t,"a","lessEqual"),s=en(e,"b","lessEqual");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("LessEqual",i)}});const Ss=sn({localResponseNormalization_:function(t,e=5,n=1,s=1,i=.5){const r=en(t,"x","localResponseNormalization");qt(4===r.rank||3===r.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${r.rank}.`)),qt(Zt(e),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`));let a=r,o=!1;3===r.rank&&(o=!0,a=Nn(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const l={x:a},u={depthRadius:e,bias:n,alpha:s,beta:i},h=Ze.runKernel("LRN",l,u);return o?Nn(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const Is=sn({log_:function(t){const e={x:en(t,"x","log")};return Ze.runKernel("Log",e)}});const Ns=sn({log1p_:function(t){const e={x:en(t,"x","log1p")};return Ze.runKernel("Log1p",e)}});function As(t){return Ze.customGrad(t)}const Cs=sn({neg_:function(t){const e={x:en(t,"x","neg")};return Ze.runKernel("Neg",e)}});const zs=sn({softplus_:function(t){const e={x:en(t,"x","softplus")};return Ze.runKernel("Softplus",e)}});const Ds=sn({logSigmoid_:function(t){const e=en(t,"x","logSigmoid");return As((t=>({value:Cs(zs(Cs(t))),gradFunc:e=>$n(e,Tn(Cs(t)))})))(e)}});const $s=sn({max_:function(t,e=null,n=!1){const s={x:en(t,"x","max")},i={reductionIndices:e,keepDims:n};return Ze.runKernel("Max",s,i)}});const Ts=sn({sub_:function(t,e){let n=en(t,"a","sub"),s=en(e,"b","sub");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Sub",i)}});const Es=sn({sum_:function(t,e=null,n=!1){let s=en(t,"x","sum");"bool"===s.dtype&&(s=bn(s,"int32"));const i={x:s},r={axis:e,keepDims:n};return Ze.runKernel("Sum",i,r)}});const Fs=sn({logSoftmax_:function(t,e=-1){const n=en(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return As(((t,n)=>{const s=$s(t,e,!0),i=Ts(t,s),r=Ts(bn(i,"float32"),Is(Es(ls(i),e,!0)));n([r]);return{value:r,gradFunc:(t,n)=>{const[s]=n,i=ls(s);return Ts(t,$n(Es(t,e,!0),i))}}}))(n)}});function Ls(t,e){return function(t,e,n){const s=t.length+e.length,i=[];let r=0,a=0;for(let o=0;o1)),e)}function _s(t){return t.map(((t,e)=>[e,t])).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}const Rs=sn({logSumExp_:function(t,e=null,n=!1){const s=en(t,"x","logSumExp"),i=Yt(e,s.shape),r=$s(s,i,!0),a=Ts(s,r),o=ls(a),l=Es(o,i),u=Is(l),h=ln(Nn(r,u.shape),u);if(n){const t=Ls(h.shape,i);return Nn(h,t)}return h}});const Ms=sn({logicalAnd_:function(t,e){const n=en(t,"a","logicalAnd","bool"),s=en(e,"b","logicalAnd","bool");ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("LogicalAnd",i)}});const Os=sn({logicalNot_:function(t){const e={x:en(t,"x","logicalNot","bool")};return Ze.runKernel("LogicalNot",e)}});const Bs=sn({logicalOr_:function(t,e){const n=en(t,"a","logicalOr","bool"),s=en(e,"b","logicalOr","bool");ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("LogicalOr",i)}});const Ps=sn({logicalXor_:function(t,e){const n=en(t,"a","logicalXor","bool"),s=en(e,"b","logicalXor","bool");return ts(n.shape,s.shape),Ms(Bs(t,e),Os(Ms(t,e)))}});const Ws=sn({maxPool_:function(t,e,n,s,i){const r=en(t,"x","maxPool");let a=r,o=!1;3===r.rank&&(o=!0,a=Nn(r,[1,r.shape[0],r.shape[1],r.shape[2]])),qt(4===a.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`)),qt(In(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=i&&qt(Zt(s),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`));const l={x:a},u={filterSize:e,strides:n,pad:s,dimRoundingMode:i},h=Ze.runKernel("MaxPool",l,u);return o?Nn(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const Us=sn({maximum_:function(t,e){let n=en(t,"a","maximum"),s=en(e,"b","maximum");[n,s]=je(n,s),"bool"===n.dtype&&(n=bn(n,"int32"),s=bn(s,"int32")),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("Maximum",i)}});const Ks=sn({mean_:function(t,e=null,n=!1){const s={x:en(t,"x","mean")},i={axis:e,keepDims:n};return Ze.runKernel("Mean",s,i)}});function js(t,e="float32"){if("complex64"===e){const e=js(t,"float32"),n=js(t,"float32");return Bn(e,n)}const n=le(Ht(t),e);return Ze.makeTensor(n,t,e)}function Vs(t,e="float32"){if("complex64"===e){const e=Vs(t,"float32"),n=js(t,"float32");return Bn(e,n)}const n=oe(Ht(t),e);return Ze.makeTensor(n,t,e)}const qs=sn({min_:function(t,e=null,n=!1){const s={x:en(t,"x","min")},i={axis:e,keepDims:n};return Ze.runKernel("Min",s,i)}});const Gs=sn({minimum_:function(t,e){let n=en(t,"a","minimum"),s=en(e,"b","minimum");[n,s]=je(n,s),"bool"===n.dtype&&(n=bn(n,"int32"),s=bn(s,"int32")),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("Minimum",i)}});const Hs=sn({mirrorPad_:function(t,e,n){qt("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=en(t,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");qt(e.length===s.rank,(()=>`Padding doesn't match input. Must be ${s.rank}. Got ${e.length}.`));const i="reflect"===n?1:0;for(let t=0;t"Invalid number of paddings. Must be length of 2 each.")),qt(e[t][0]>=0&&e[t][0]<=s.shape[t]-i&&e[t][1]>=0&&e[t][1]<=s.shape[t]-i,(()=>`Padding in dimension ${t} cannot be greater than or equal to ${s.shape[t]-i} or less than 0 for input of shape ${s.shape}`));const r={paddings:e,mode:n},a={x:s};return Ze.runKernel("MirrorPad",a,r)}});const Js=sn({mod_:function(t,e){let n=en(t,"a","mod"),s=en(e,"b","mod");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Mod",i)}});const Zs=sn({square_:function(t){const e=en(t,"x","square");return Ze.runKernel("Square",{x:e},{})}});const Xs=sn({notEqual_:function(t,e){let n=en(t,"a","notEqual"),s=en(e,"b","notEqual");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("NotEqual",i)}});const Ys=sn({oneHot_:function(t,e,n=1,s=0){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:en(t,"indices","oneHot","int32")},r={depth:e,onValue:n,offValue:s};return Ze.runKernel("OneHot",i,r)}});const Qs=sn({onesLike_:function(t){const e={x:en(t,"x","onesLike")};return Ze.runKernel("OnesLike",e)}});const ti=sn({pad_:function(t,e,n=0){const s=en(t,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:n},r={x:s};return Ze.runKernel("PadV2",r,i)}});const ei=sn({spaceToBatchND_:function(t,e,n){const s=en(t,"x","spaceToBatchND");qt(s.rank>=1+e.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${e.length}`)),qt(n.length===e.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`)),qt(s.shape.reduce(((t,s,i)=>i>0&&i<=e.length?t&&(s+n[i-1][0]+n[i-1][1])%e[i-1]==0:t),!0),(()=>`input spatial dimensions ${s.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`));const i={x:s},r={blockShape:e,paddings:n};return Ze.runKernel("SpaceToBatchND",i,r)}});const ni=sn({pool_:function(t,e,n,s,i,r){null==i&&(i=[1,1]),null==r&&(r=1),0===s&&(s="valid");const a=en(t,"x","maxPool");let o=a,l=!1;3===a.rank&&(l=!0,o=Nn(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(In(r,i),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${r} and dilations '${i}'`));const u=wn(o.shape,e,r,i,s),h=[u.dilationHeight,u.dilationWidth];let c;c="same"===s?function(t,e){const n=t.map(((t,n)=>t+(t-1)*(e[n]-1))).map((t=>t-1)),s=n.map((t=>Math.floor(t/2))),i=n.map(((t,e)=>t-s[e]));return n.map(((t,e)=>[s[e],i[e]]))}([u.filterHeight,u.filterWidth],h):[[0,0],[0,0]];const p=1===h[0]&&1===h[1],[d,f]=function(t,e,n){const s=n.map((t=>t[0])),i=n.map((t=>t[1])),r=t.concat(s,i),a=e.map(((t,e)=>(t-r[e]%t)%t)),o=i.map(((t,e)=>t+a[e])),l=e.map(((t,e)=>[s[e],o[e]])),u=e.map(((t,e)=>[0,a[e]]));return[l,u]}([u.inHeight,u.inWidth],h,c),g=p?s:"valid",m=p?o:ei(o,h,d),y=("avg"===n?()=>An(m,e,r,g):()=>Ws(m,e,r,g))(),b=p?y:Ln(y,h,f);return l?Nn(b,[b.shape[1],b.shape[2],b.shape[3]]):b}});const si=sn({pow_:function(t,e){let n=en(t,"base","pow"),s=en(e,"exp","pow");[n,s]=je(n,s);const i={a:n,b:s};return Ze.runKernel("Pow",i)}});const ii=sn({prelu_:function(t,e){const n={x:en(t,"x","prelu"),alpha:en(e,"alpha","prelu")};return Ze.runKernel("Prelu",n)}});const ri=sn({prod_:function(t,e=null,n=!1){let s=en(t,"x","prod");"bool"===s.dtype&&(s=bn(s,"int32"));const i={x:s},r={axis:e,keepDims:n};return Ze.runKernel("Prod",i,r)}});const ai=sn({real_:function(t){const e={input:en(t,"input","real")};return Ze.runKernel("Real",e)}});const oi=sn({reciprocal_:function(t){const e={x:en(t,"x","reciprocal")};return Ze.runKernel("Reciprocal",e)}});const li=sn({relu_:function(t){const e={x:en(t,"x","relu")};return Ze.runKernel("Relu",e)}});const ui=sn({relu6_:function(t){const e={x:en(t,"x","relu6")};return Ze.runKernel("Relu6",e)}});const hi=sn({reverse_:function(t,e){const n={x:en(t,"x","reverse")},s={dims:e};return Ze.runKernel("Reverse",n,s)}});const ci=sn({round_:function(t){const e={x:en(t,"x","round")};return Ze.runKernel("Round",e)}});const pi=sn({rsqrt_:function(t){const e={x:en(t,"x","rsqrt")};return Ze.runKernel("Rsqrt",e)}});function di(t,e,n,s){if(null==s&&(s=ne(t)),"complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Qt(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){!function(t){t.forEach((e=>{qt(Number.isInteger(e)&&e>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`))}))}(e);const t=Ht(e),s=Ht(n);qt(t===s,(()=>`Based on the provided shape, [${e}], the tensor should have ${t} values but has ${s}`));for(let t=0;t`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `))}}return Qt(t)||Array.isArray(t)||(t=[t]),e=e||n,t="string"!==s?Se(t,s):Gt(t,[],!0),Ze.makeTensor(t,e,s)}function fi(t,e){if((Qt(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&Qt(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return di(t,[],[],e)}const gi=sn({selu_:function(t){const e={x:en(t,"x","selu")};return Ze.runKernel("Selu",e)}});const mi=sn({separableConv2d_:function(t,e,n,s,i,r=[1,1],a="NHWC"){const o=en(t,"x","separableConv2d"),l=en(e,"depthwiseFilter","separableConv2d"),u=en(n,"pointwiseFilter","separableConv2d");let h=o,c=!1;if(3===o.rank&&(c=!0,h=Nn(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");qt(4===h.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${h.rank}.`)),qt(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),qt(1===u.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`)),qt(1===u.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`));const p=l.shape[2],d=l.shape[3];qt(u.shape[2]===p*d,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*d}, but got ${u.shape[2]}.`));const f=Jn(h,l,s,i,a,r),g=Pn(f,u,1,"valid",a);return c?Nn(g,[g.shape[1],g.shape[2],g.shape[3]]):g}});const yi=sn({sign_:function(t){const e={x:en(t,"x","sign")};return Ze.runKernel("Sign",e)}});const bi=sn({sin_:function(t){const e={x:en(t,"x","sin")};return Ze.runKernel("Sin",e)}});const wi=sn({sinh_:function(t){const e={x:en(t,"x","sinh")};return Ze.runKernel("Sinh",e)}});const ki=sn({softmax_:function(t,e=-1){const n=en(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const s={logits:n},i={dim:e};return Ze.runKernel("Softmax",s,i)}});const xi=sn({fft_:function(t){qt("complex64"===t.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Ze.runKernel("FFT",e)}});const vi=sn({ifft_:function(t){qt("complex64"===t.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Ze.runKernel("IFFT",e)}});const Si=sn({irfft_:function(t){const e=t.shape[t.shape.length-1],n=t.size/e;let s;if(e<=2){const i=Nn(t,[n,e]);s=vi(i)}else{const i=[n,2*(e-1)],r=Nn(ai(t),[n,e]),a=Nn(ms(t),[n,e]),o=hi(En(r,[0,1],[n,e-2]),1),l=$n(hi(En(a,[0,1],[n,e-2]),1),fi(-1)),u=zn([r,o],1),h=zn([a,l],1),c=Nn(Bn(u,h),[i[0],i[1]]);s=vi(c)}if(s=ai(s),3===t.rank&&0!==t.shape[0]){const e=s,n=t.shape[0];s=Nn(s,[n,s.shape[0]/n,s.shape[1]]),e.dispose()}return s}});const Ii=sn({split_:function(t,e,n=0){const s={x:en(t,"x","split")},i={numOrSizeSplits:e,axis:n};return Ze.runKernel("SplitV",s,i)}});const Ni=sn({rfft_:function(t,e){qt("float32"===t.dtype,(()=>`The dtype for rfft() must be real value but got ${t.dtype}`));let n=t.shape[t.shape.length-1];const s=t.size/n;let i;if(null!=e&&e0)),r=t.shape.map((t=>t));r[t.shape.length-1]=e,i=En(t,s,r),n=e}else if(null!=e&&e>n){const s=t.shape.map((t=>t));s[t.shape.length-1]=e-n,i=zn([t,js(s)],t.shape.length-1),n=e}else i=t;const r=ss(i),a=Nn(Bn(i,r),[s,n]),o=xi(a),l=Math.floor(n/2)+1,u=ai(o),h=ms(o),c=Ii(u,[l,n-l],u.shape.length-1),p=Ii(h,[l,n-l],h.shape.length-1),d=i.shape.slice();return d[i.shape.length-1]=l,Nn(Bn(c[0],p[0]),d)}});const Ai=sn({sqrt_:function(t){const e={x:en(t,"x","sqrt")};return Ze.runKernel("Sqrt",e)}});const Ci=sn({squaredDifference_:function(t,e){let n=en(t,"a","squaredDifference"),s=en(e,"b","squaredDifference");[n,s]=je(n,s),ts(n.shape,s.shape);const i={a:n,b:s};return Ze.runKernel("SquaredDifference",i,{})}});const zi=sn({squeeze_:function(t,e){const n=en(t,"x","squeeze");return Nn(n,function(t,e){const n=[],s=[],i=null!=e&&Array.isArray(e)&&0===e.length,r=null==e||i?null:Yt(e,t).sort();let a=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),s.push(e)),r[a]<=e&&a++}1!==t[e]&&(n.push(t[e]),s.push(e))}return{newShape:n,keptDims:s}}(n.shape,e).newShape)}});const Di=sn({stack_:function(t,e=0){const n=nn(t,"tensors","stack","string_or_numeric");qt(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&qt(e<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,i={axis:e};return Ze.runKernel("Pack",s,i)}});const $i=sn({step_:function(t,e=0){const n={x:en(t,"x","step")},s={alpha:e};return Ze.runKernel("Step",n,s)}});const Ti=sn({stridedSlice_:function(t,e,n,s,i=0,r=0,a=0,o=0,l=0){const u={x:en(t,"x","stridedSlice")},h={begin:e,end:n,strides:s,beginMask:i,endMask:r,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return Ze.runKernel("StridedSlice",u,h)}});const Ei=sn({tan_:function(t){const e={x:en(t,"x","tan")};return Ze.runKernel("Tan",e)}});const Fi=sn({topk_:function(t,e=1,n=!0){const s=en(t,"x","topk");if(0===s.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=s.shape[s.shape.length-1];if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${e}`);const r={x:s},a={k:e,sorted:n},[o,l]=Ze.runKernel("TopK",r,a);return{values:o,indices:l}}});const Li=sn({unique_:function(t,e=0){const n=en(t,"x","unique","string_or_numeric");qt(n.rank>0,(()=>"The input tensor must be at least 1D"));const s={x:n},i={axis:e},[r,a]=Ze.runKernel("Unique",s,i);return{values:r,indices:a}}});const _i=sn({unsortedSegmentSum_:function(t,e,n){const s=en(t,"x","unsortedSegmentSum"),i=en(e,"segmentIds","unsortedSegmentSum","int32");qt(Zt(n),(()=>"numSegments must be of dtype int"));const r={x:s,segmentIds:i},a={numSegments:n};return Ze.runKernel("UnsortedSegmentSum",r,a)}});const Ri=sn({unstack_:function(t,e=0){const n=en(t,"x","unstack","string_or_numeric");qt(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},i={axis:e};return Ze.runKernel("Unpack",s,i)}});const Mi=sn({transpose_:function(t,e){const n=en(t,"x","transpose");if(null==e&&(e=n.shape.map(((t,e)=>e)).reverse()),qt(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${e}.`)),e.forEach((t=>{qt(t>=0&&t"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${e}`))})),n.rank<=1)return n.clone();const s={x:n},i={perm:e};return Ze.runKernel("Transpose",s,i)}});function Oi(t,e,n=null){if(0===t.rank)return rn(t);if(1!==t.rank&&null===n)return Oi(Nn(t,[-1]),e,n);if(1===t.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===e)return Es(rn(t),n);if(e===1/0)return $s(rn(t),n);if(e===-1/0)return qs(rn(t),n);if("euclidean"===e||2===e)return Ai(Es(si(rn(t),fi(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}if(Array.isArray(n)&&2===n.length){if(1===e)return $s(Es(rn(t),n[0]),n[1]-1);if(e===1/0)return $s(Es(rn(t),n[1]),n[0]);if(e===-1/0)return qs(Es(rn(t),n[1]),n[0]);if("fro"===e||"euclidean"===e)return Ai(Es(Zs(t),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const Bi=sn({norm_:function(t,e="euclidean",n=null,s=!1){const i=Oi(t=en(t,"x","norm"),e,n);let r=i.shape;if(s){const e=Yt(n,t.shape);r=Ls(i.shape,e)}return Nn(i,r)}});const Pi=sn({conv2DBackpropFilter_:function(t,e,n,s,i,r="NHWC",a){let o=t;3===t.rank&&(o=Nn(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;3===l.rank&&(l=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2]])),qt(4===o.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),qt(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),qt(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const u="NHWC"===r?o.shape[3]:o.shape[1],h="NHWC"===r?l.shape[3]:l.shape[1];qt(u===n[2],(()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`)),qt(h===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${h}) must match output depth for filter (${n[3]}).`)),null!=a&&qt(Zt(i),(()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const c={x:o,dy:l},p={strides:s,pad:i,dataFormat:r,dimRoundingMode:a,filterShape:n};return Ze.runKernel("Conv2DBackpropFilter",c,p)}});const Wi=sn({depthwiseConv2dNativeBackpropFilter_:function(t,e,n,s,i,r=[1,1],a){let o=t;3===t.rank&&(o=Nn(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;3===l.rank&&(l=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={x:o,dy:l},h={strides:s,pad:i,dimRoundingMode:a,dilations:r,filterShape:n};return Ze.runKernel("DepthwiseConv2dNativeBackpropFilter",u,h)}});const Ui=sn({depthwiseConv2dNativeBackpropInput_:function(t,e,n,s,i,r=[1,1],a){let o=e,l=!1;3===e.rank&&(l=!0,o=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={dy:o,filter:n},h={strides:s,pad:i,dimRoundingMode:a,dilations:r,inputShape:t},c=Ze.runKernel("DepthwiseConv2dNativeBackpropInput",u,h);return l?Nn(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Ki=sn({resizeBilinear_:function(t,e,n=!1,s=!1){const i=en(t,"images","resizeBilinear");qt(3===i.rank||4===i.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${i.rank}.`)),qt(2===e.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`)),qt(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let r=i,a=!1;3===i.rank&&(a=!0,r=Nn(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const o={images:r},l={alignCorners:n,halfPixelCenters:s,size:e},u=Ze.runKernel("ResizeBilinear",o,l);return a?Nn(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const ji=sn({resizeNearestNeighbor_:function(t,e,n=!1,s=!1){const i=en(t,"images","resizeNearestNeighbor");qt(3===i.rank||4===i.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${i.rank}.`)),qt(2===e.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`)),qt("float32"===i.dtype||"int32"===i.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),qt(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let r=i,a=!1;3===i.rank&&(a=!0,r=Nn(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const o={images:r},l={alignCorners:n,halfPixelCenters:s,size:e},u=Ze.runKernel("ResizeNearestNeighbor",o,l);return a?Nn(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});Re().prototype.abs=function(){return this.throwIfDisposed(),rn(this)},Re().prototype.acos=function(){return this.throwIfDisposed(),an(this)},Re().prototype.acosh=function(){return this.throwIfDisposed(),on(this)},Re().prototype.add=function(t){return this.throwIfDisposed(),ln(this,t)},Re().prototype.all=function(t,e){return this.throwIfDisposed(),un(this,t,e)},Re().prototype.any=function(t,e){return this.throwIfDisposed(),hn(this,t,e)},Re().prototype.argMax=function(t){return this.throwIfDisposed(),cn(this,t)},Re().prototype.argMin=function(t){return this.throwIfDisposed(),pn(this,t)},Re().prototype.asScalar=function(){return this.throwIfDisposed(),qt(1===this.size,(()=>"The array must have only 1 element.")),Nn(this,[])},Re().prototype.asType=function(t){return this.throwIfDisposed(),bn(this,t)},Re().prototype.as1D=function(){return this.throwIfDisposed(),Nn(this,[this.size])},Re().prototype.as2D=function(t,e){return this.throwIfDisposed(),Nn(this,[t,e])},Re().prototype.as3D=function(t,e,n){return this.throwIfDisposed(),Nn(this,[t,e,n])},Re().prototype.as4D=function(t,e,n,s){return this.throwIfDisposed(),Nn(this,[t,e,n,s])},Re().prototype.as5D=function(t,e,n,s,i){return this.throwIfDisposed(),Nn(this,[t,e,n,s,i])},Re().prototype.asin=function(){return this.throwIfDisposed(),dn(this)},Re().prototype.asinh=function(){return this.throwIfDisposed(),fn(this)},Re().prototype.atan=function(){return this.throwIfDisposed(),gn(this)},Re().prototype.atan2=function(t){return this.throwIfDisposed(),mn(this,t)},Re().prototype.atanh=function(){return this.throwIfDisposed(),yn(this)},Re().prototype.avgPool=function(t,e,n,s){return this.throwIfDisposed(),An(this,t,e,n,s)},Re().prototype.batchToSpaceND=function(t,e){return this.throwIfDisposed(),Ln(this,t,e)},Re().prototype.batchNorm=function(t,e,n,s,i){return this.throwIfDisposed(),_n(this,t,e,n,s,i)},Re().prototype.broadcastTo=function(t){return this.throwIfDisposed(),Rn(this,t)},Re().prototype.cast=function(t){return this.throwIfDisposed(),bn(this,t)},Re().prototype.ceil=function(){return this.throwIfDisposed(),Mn(this)},Re().prototype.clipByValue=function(t,e){return this.throwIfDisposed(),On(this,t,e)},Re().prototype.concat=function(t,e){return this.throwIfDisposed(),t instanceof _e&&(t=[t]),zn([this,...t],e)},Re().prototype.conv1d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Wn(this,t,e,n,s,i,r)},Re().prototype.conv2dTranspose=function(t,e,n,s,i){return this.throwIfDisposed(),Kn(this,t,e,n,s,i)},Re().prototype.conv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Pn(this,t,e,n,s,i,r)},Re().prototype.cos=function(){return this.throwIfDisposed(),Vn(this)},Re().prototype.cosh=function(){return this.throwIfDisposed(),qn(this)},Re().prototype.cumsum=function(t,e,n){return this.throwIfDisposed(),Gn(this,t,e,n)},Re().prototype.depthToSpace=function(t,e){return this.throwIfDisposed(),Hn(this,t,e)},Re().prototype.depthwiseConv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),Jn(this,t,e,n,s,i,r)},Re().prototype.dilation2d=function(t,e,n,s,i){return this.throwIfDisposed(),Zn(this,t,e,n,s,i)},Re().prototype.divNoNan=function(t){return this.throwIfDisposed(),is(this,t)},Re().prototype.div=function(t){return this.throwIfDisposed(),Yn(this,t)},Re().prototype.dot=function(t){return this.throwIfDisposed(),rs(this,t)},Re().prototype.elu=function(){return this.throwIfDisposed(),as(this)},Re().prototype.equal=function(t){return this.throwIfDisposed(),es(this,t)},Re().prototype.erf=function(){return this.throwIfDisposed(),os(this)},Re().prototype.exp=function(){return this.throwIfDisposed(),ls(this)},Re().prototype.expandDims=function(t){return this.throwIfDisposed(),us(this,t)},Re().prototype.expm1=function(){return this.throwIfDisposed(),hs(this)},Re().prototype.fft=function(){return this.throwIfDisposed(),xi(this)},Re().prototype.flatten=function(){return this.throwIfDisposed(),Nn(this,[this.size])},Re().prototype.floor=function(){return this.throwIfDisposed(),ps(this)},Re().prototype.floorDiv=function(t){return this.throwIfDisposed(),Xn(this,t)},Re().prototype.gather=function(t,e){return this.throwIfDisposed(),ds(this,t,e)},Re().prototype.greaterEqual=function(t){return this.throwIfDisposed(),gs(this,t)},Re().prototype.greater=function(t){return this.throwIfDisposed(),fs(this,t)},Re().prototype.ifft=function(){return this.throwIfDisposed(),vi(this)},Re().prototype.irfft=function(){return this.throwIfDisposed(),Si(this)},Re().prototype.isFinite=function(){return this.throwIfDisposed(),ys(this)},Re().prototype.isInf=function(){return this.throwIfDisposed(),bs(this)},Re().prototype.isNaN=function(){return this.throwIfDisposed(),ws(this)},Re().prototype.leakyRelu=function(t){return this.throwIfDisposed(),ks(this,t)},Re().prototype.lessEqual=function(t){return this.throwIfDisposed(),vs(this,t)},Re().prototype.less=function(t){return this.throwIfDisposed(),xs(this,t)},Re().prototype.localResponseNormalization=function(t,e,n,s){return this.throwIfDisposed(),Ss(this,t,e,n,s)},Re().prototype.logSigmoid=function(){return this.throwIfDisposed(),Ds(this)},Re().prototype.logSoftmax=function(t){return this.throwIfDisposed(),Fs(this,t)},Re().prototype.logSumExp=function(t,e){return this.throwIfDisposed(),Rs(this,t,e)},Re().prototype.log=function(){return this.throwIfDisposed(),Is(this)},Re().prototype.log1p=function(){return this.throwIfDisposed(),Ns(this)},Re().prototype.logicalAnd=function(t){return this.throwIfDisposed(),Ms(this,t)},Re().prototype.logicalNot=function(){return this.throwIfDisposed(),Os(this)},Re().prototype.logicalOr=function(t){return this.throwIfDisposed(),Bs(this,t)},Re().prototype.logicalXor=function(t){return this.throwIfDisposed(),Ps(this,t)},Re().prototype.matMul=function(t,e,n){return this.throwIfDisposed(),Dn(this,t,e,n)},Re().prototype.maxPool=function(t,e,n,s){return this.throwIfDisposed(),Ws(this,t,e,n,s)},Re().prototype.max=function(t,e){return this.throwIfDisposed(),$s(this,t,e)},Re().prototype.maximum=function(t){return this.throwIfDisposed(),Us(this,t)},Re().prototype.mean=function(t,e){return this.throwIfDisposed(),Ks(this,t,e)},Re().prototype.min=function(t,e){return this.throwIfDisposed(),qs(this,t,e)},Re().prototype.minimum=function(t){return this.throwIfDisposed(),Gs(this,t)},Re().prototype.mirrorPad=function(t,e){return this.throwIfDisposed(),Hs(this,t,e)},Re().prototype.mod=function(t){return this.throwIfDisposed(),Js(this,t)},Re().prototype.mul=function(t){return this.throwIfDisposed(),$n(this,t)},Re().prototype.neg=function(){return this.throwIfDisposed(),Cs(this)},Re().prototype.norm=function(t,e,n){return this.throwIfDisposed(),Bi(this,t,e,n)},Re().prototype.notEqual=function(t){return this.throwIfDisposed(),Xs(this,t)},Re().prototype.oneHot=function(t,e=1,n=0){return this.throwIfDisposed(),Ys(this,t,e,n)},Re().prototype.onesLike=function(){return this.throwIfDisposed(),Qs(this)},Re().prototype.pad=function(t,e){return this.throwIfDisposed(),ti(this,t,e)},Re().prototype.pool=function(t,e,n,s,i){return this.throwIfDisposed(),ni(this,t,e,n,s,i)},Re().prototype.pow=function(t){return this.throwIfDisposed(),si(this,t)},Re().prototype.prelu=function(t){return this.throwIfDisposed(),ii(this,t)},Re().prototype.prod=function(t,e){return this.throwIfDisposed(),ri(this,t,e)},Re().prototype.reciprocal=function(){return this.throwIfDisposed(),oi(this)},Re().prototype.relu=function(){return this.throwIfDisposed(),li(this)},Re().prototype.relu6=function(){return this.throwIfDisposed(),ui(this)},Re().prototype.reshapeAs=function(t){return this.throwIfDisposed(),Nn(this,t.shape)},Re().prototype.reshape=function(t){return this.throwIfDisposed(),Nn(this,t)},Re().prototype.resizeBilinear=function(t,e,n){return this.throwIfDisposed(),Ki(this,t,e,n)},Re().prototype.resizeNearestNeighbor=function(t,e,n){return this.throwIfDisposed(),ji(this,t,e,n)},Re().prototype.reverse=function(t){return this.throwIfDisposed(),hi(this,t)},Re().prototype.rfft=function(){return this.throwIfDisposed(),Ni(this)},Re().prototype.round=function(){return this.throwIfDisposed(),ci(this)},Re().prototype.rsqrt=function(){return this.throwIfDisposed(),pi(this)},Re().prototype.selu=function(){return this.throwIfDisposed(),gi(this)},Re().prototype.separableConv2d=function(t,e,n,s,i,r){return this.throwIfDisposed(),mi(this,t,e,n,s,i,r)},Re().prototype.sigmoid=function(){return this.throwIfDisposed(),Tn(this)},Re().prototype.sign=function(){return this.throwIfDisposed(),yi(this)},Re().prototype.sin=function(){return this.throwIfDisposed(),bi(this)},Re().prototype.sinh=function(){return this.throwIfDisposed(),wi(this)},Re().prototype.slice=function(t,e){return this.throwIfDisposed(),En(this,t,e)},Re().prototype.softmax=function(t){return this.throwIfDisposed(),ki(this,t)},Re().prototype.softplus=function(){return this.throwIfDisposed(),zs(this)},Re().prototype.spaceToBatchND=function(t,e){return this.throwIfDisposed(),ei(this,t,e)},Re().prototype.split=function(t,e){return this.throwIfDisposed(),Ii(this,t,e)},Re().prototype.sqrt=function(){return this.throwIfDisposed(),Ai(this)},Re().prototype.square=function(){return this.throwIfDisposed(),Zs(this)},Re().prototype.squaredDifference=function(t){return this.throwIfDisposed(),Ci(this,t)},Re().prototype.squeeze=function(t){return this.throwIfDisposed(),zi(this,t)},Re().prototype.stack=function(t,e){this.throwIfDisposed();const n=t instanceof _e?[this,t]:[this,...t];return Di(n,e)},Re().prototype.step=function(t){return this.throwIfDisposed(),$i(this,t)},Re().prototype.stridedSlice=function(t,e,n,s,i,r,a,o){return this.throwIfDisposed(),Ti(this,t,e,n,s,i,r,a,o)},Re().prototype.sub=function(t){return this.throwIfDisposed(),Ts(this,t)},Re().prototype.sum=function(t,e){return this.throwIfDisposed(),Es(this,t,e)},Re().prototype.tan=function(){return this.throwIfDisposed(),Ei(this)},Re().prototype.tanh=function(){return this.throwIfDisposed(),Fn(this)},Re().prototype.tile=function(t){return this.throwIfDisposed(),cs(this,t)},Re().prototype.toBool=function(){return this.throwIfDisposed(),bn(this,"bool")},Re().prototype.toFloat=function(){return this.throwIfDisposed(),bn(this,"float32")},Re().prototype.toInt=function(){return this.throwIfDisposed(),bn(this,"int32")},Re().prototype.topk=function(t,e){return this.throwIfDisposed(),Fi(this,t,e)},Re().prototype.transpose=function(t){return this.throwIfDisposed(),Mi(this,t)},Re().prototype.unique=function(t){return this.throwIfDisposed(),Li(this,t)},Re().prototype.unsortedSegmentSum=function(t,e){return this.throwIfDisposed(),_i(this,t,e)},Re().prototype.unstack=function(t){return this.throwIfDisposed(),Ri(this,t)},Re().prototype.where=function(t,e){return this.throwIfDisposed(),ns(t,this,e)},Re().prototype.zerosLike=function(){return this.throwIfDisposed(),ss(this)};const Vi={kernelName:"Abs",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,$i(bn(n,"float32"),-1))}}},qi={kernelName:"Acos",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Zs(bn(n,"float32")),s=Ai(Ts(fi(1),e));return Cs(Yn(t,s))}}}},Gi={kernelName:"Acosh",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Ai(Ts(Zs(bn(n,"float32")),1));return Yn(t,e)}}}},Hi={kernelName:"Add",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{let e=t;const s=Qn(n.shape,i);return s.length>0&&(e=Es(e,s)),Nn(e,n.shape)},b:()=>{let e=t;const n=Qn(s.shape,i);return n.length>0&&(e=Es(e,n)),Nn(e,s.shape)}}}},Ji={kernelName:"AddN",saveAllInputs:!0,gradFunc:(t,e)=>{const n={};return e.forEach(((e,s)=>{n[s]=()=>t.clone()})),n}},Zi={kernelName:"ArgMax",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>ss(n)}}},Xi={kernelName:"ArgMin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>ss(n)}}},Yi={kernelName:"Asin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,Ai(Ts(fi(1),Zs(bn(n,"float32")))))}}},Qi={kernelName:"Asinh",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Ai(ln(fi(1),Zs(bn(n,"float32"))));return Yn(t,e)}}}},tr={kernelName:"Atan2",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{const e=ln(Zs(n),Zs(s));let r=$n(t,Yn(s,e));const a=Qn(n.shape,i);return a.length>0&&(r=Es(r,a)),Nn(r,n.shape)},b:()=>{const e=ln(Zs(n),Zs(s));let r=Cs($n(t,Yn(n,e)));const a=Qn(s.shape,i);return a.length>0&&(r=Es(r,a)),Nn(r,s.shape)}}}},er={kernelName:"Atan",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,ln(Zs(bn(n,"float32")),1))}}},nr={kernelName:"Atanh",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,Ts(fi(1),Zs(bn(n,"float32"))))}}};const sr=sn({avgPool3dGrad_:function(t,e,n,s,i,r){const a=en(t,"dy","avgPool3dGrad"),o=en(e,"input","avgPool3dGrad");let l=a,u=o,h=!1;4===o.rank&&(h=!0,l=Nn(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),u=Nn(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),qt(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),qt(5===u.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`)),null!=r&&qt(Zt(i),(()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${r} but got pad ${i}.`));const c={dy:l,input:u},p={filterSize:n,strides:s,pad:i,dimRoundingMode:r},d=Ze.runKernel("AvgPool3DGrad",c,p);return h?Nn(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}}),ir={kernelName:"AvgPool3D",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{filterSize:i,strides:r,pad:a,dimRoundingMode:o}=n;return{x:()=>sr(t,s,i,r,a,o)}}};const rr=sn({avgPoolGrad_:function(t,e,n,s,i){const r=en(t,"dy","avgPoolGrad"),a=en(e,"input","avgPoolGrad");qt(a.rank===r.rank,(()=>`Rank of input (${a.rank}) does not match rank of dy (${r.rank})`));let o=a,l=r,u=!1;3===a.rank&&(u=!0,o=Nn(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=Nn(r,[1,r.shape[0],r.shape[1],r.shape[2]])),qt(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),qt(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const h={dy:l,input:o},c={filterSize:n,strides:s,pad:i},p=Ze.runKernel("AvgPoolGrad",h,c);return u?Nn(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),ar={kernelName:"AvgPool",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{filterSize:i,strides:r,pad:a}=n;return{x:()=>rr(t,s,i,r,a)}}},or={kernelName:"BatchMatMul",inputsToSave:["a","b"],gradFunc:(t,e,n)=>{const[s,i]=e,{transposeA:r,transposeB:a}=n;return r||a?!r&&a?{a:()=>Dn(t,i,!1,!1),b:()=>Dn(t,s,!0,!1)}:r&&!a?{a:()=>Dn(i,t,!1,!0),b:()=>Dn(s,t,!1,!1)}:{a:()=>Dn(i,t,!0,!0),b:()=>Dn(t,s,!0,!0)}:{a:()=>Dn(t,i,!1,!0),b:()=>Dn(s,t,!0,!1)}}},lr={kernelName:"BatchToSpaceND",gradFunc:(t,e,n)=>{const{blockShape:s,crops:i}=n;return{x:()=>ei(t,s,i)}}},ur={kernelName:"BroadcastTo",gradFunc:(t,e,n)=>{const s=n,i=s.inputShape,r=s.shape,a=Array.from(r);for(let t=i.length-1;t>=0;t--)if(i[t]===r[t])a[t]=1;else if(1!==i[t])throw new Error(`broadcastTo(): [${i}] cannot be broadcast to [${r}].`);const o=[];for(let t=0;t1&&o.push(t);return{x:()=>Es(t,o,!0)}}},hr={kernelName:"Cast",gradFunc:t=>({x:()=>t.clone()})},cr={kernelName:"Ceil",gradFunc:t=>({x:()=>ss(t)})},pr={kernelName:"ClipByValue",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{clipValueMin:i,clipValueMax:r}=n;return{x:()=>ns(Ms(gs(s,i),vs(s,r)),t,ss(t))}}},dr={kernelName:"ComplexAbs",inputsToSave:["x"],gradFunc:Vi.gradFunc},fr={kernelName:"Concat",saveAllInputs:!0,gradFunc:(t,e,n)=>{const s=e.map((t=>t.shape)),{axis:i}=n,r=Yt(i,e[0].shape)[0],a=s.map((t=>t[r]));return Ii(t,a,r).map((t=>()=>t))}},gr={kernelName:"Conv2D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[s,i]=e,{dilations:r,strides:a,pad:o,dataFormat:l}=n;return qt(Sn(r),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${r}'`)),{x:()=>Un(s.shape,t,i,a,o,l),filter:()=>Pi(s,t,i.shape,a,o,l)}}},mr={kernelName:"Conv2DBackpropInput",inputsToSave:["dy","filter"],gradFunc:(t,e,n)=>{const[s,i]=e,{strides:r,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>Pn(t,i,r,a,o,1,l),filter:()=>Pi(t,s,i.shape,r,a,o,l)}}};const yr=sn({conv3DBackpropFilter_:function(t,e,n,s,i){let r=t;4===t.rank&&(r=Nn(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]));let a=e;4===a.rank&&(a=Nn(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]])),qt(5===r.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${r.shape}.`)),qt(5===a.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`)),qt(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),qt(r.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${r.shape[4]}) must match input depth in filter (${n[3]}.`)),qt(a.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:r,dy:a},l={strides:s,pad:i,filterShape:n};return Ze.runKernel("Conv3DBackpropFilterV2",o,l)}}),br={kernelName:"Conv3D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:s,strides:i,pad:r}=n;qt(Sn(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[a,o]=e;return{x:()=>jn(a.shape,t,o,i,r),filter:()=>yr(a,t,o.shape,i,r)}}},wr={kernelName:"Cos",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(Cs(bi(bn(n,"float32"))),t)}}},kr={kernelName:"Cosh",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(wi(bn(n,"float32")),t)}}},xr={kernelName:"Cumsum",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{axis:i,exclusive:r,reverse:a}=n;return{x:()=>{const e=function(t,e){if(function(t,e){for(let n=0;nn.push(t))),n}([i],s.rank);let n=Gn(t,i,r,!a);return null!=e&&(n=Mi(n,e)),n}}}},vr={kernelName:"DepthwiseConv2dNative",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:s,strides:i,pad:r,dimRoundingMode:a}=n,o=null==s?[1,1]:s;qt(Sn(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,u]=e;return qt(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`)),qt(l.shape[3]===u.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`)),qt(In(i,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${o}'.`)),null!=a&&qt(Zt(r),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`)),{x:()=>Ui(l.shape,t,u,i,r,s,a),filter:()=>Wi(l,t,u.shape,i,r,s,a)}}},Sr={kernelName:"Dilation2D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[s,i]=e,r={x:s,filter:i,dy:t},a={x:s,filter:i,dy:t};return{x:()=>Ze.runKernel("Dilation2DBackpropInput",r,n),filter:()=>Ze.runKernel("Dilation2DBackpropFilter",a,n)}}},Ir={kernelName:"Elu",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e,s={dy:t,y:n};return{x:()=>Ze.runKernel("EluGrad",s)}}},Nr={kernelName:"Erf",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,s=$n(ls(Cs(Zs(n))),2/Math.sqrt(Math.PI));return{x:()=>$n(t,s)}}},Ar={kernelName:"Exp",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,n)}}},Cr={kernelName:"ExpandDims",inputsToSave:["input"],gradFunc:(t,e)=>{const[n]=e;return{input:()=>Nn(t,n.shape)}}},zr={kernelName:"Expm1",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,ls(n))}}},Dr={kernelName:"Floor",gradFunc:t=>({x:()=>ss(t)})},$r={kernelName:"FloorDiv",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{const e=Yn(t,bn(s,"float32")),r=Qn(n.shape,i);return r.length>0?Nn(Es(e,r),n.shape):e},b:()=>{let e=$n(t,bn(n,"float32"));const r=Qn(s.shape,i);r.length>0&&(e=Nn(Es(e,r),s.shape));const a=Zs(s);return Cs(Yn(e,bn(a,"float32")))}}}},Tr={kernelName:"FusedBatchNorm",inputsToSave:["x","mean","variance","scale"],gradFunc:(t,e,n)=>{const{varianceEpsilon:s}=n,[i,r,a,o]=e,l=null==o?fi(1):o,u=Qn(r.shape,i.shape),h=[];if(1===r.rank){for(let t=0;t1===r.rank?Nn($n($n(t,cs(Nn(d,[1,1,1,r.shape[0]]),h)),l),i.shape):Nn($n($n(t,d),l),i.shape),mean:()=>{let t=$n($n(d,fi(-1)),p);return 1===r.rank&&(t=Es(t,u)),Nn(t,r.shape)},variance:()=>{let t=$n($n(f,c),p);return 1===r.rank&&(t=Es(t,u)),Nn(t,r.shape)},scale:()=>{const e=$n(c,d);let n=$n(t,e);return 1===r.rank&&(n=Es(n,u)),Nn(n,r.shape)},offset:()=>{let e=t;return 1===r.rank&&(e=Es(e,u)),Nn(e,r.shape)}}}},Er={kernelName:"GatherV2",inputsToSave:["x","indices"],gradFunc:(t,e,n)=>{const[s,i]=e,{axis:r}=n,a=Yt(r,s.shape)[0];return{x:()=>{const e=s.shape,n=i.size,o=e.slice(0,a),l=o.length,u=e.slice(r,e.length).slice(1),h=u.length,c=Fr(0,l),p=Fr(l+1,l+1+h),d=Lr([o,[n],u]),f=Nn(t,d),g=Nn(i,[n]),m=Lr([[l],c,p]),y=Mi(f,m);let b=_i(y,g,s.shape[a]);const w=_s(m);return b=Mi(b,w),b},indices:()=>i}}};function Fr(t,e){const n=[];for(let s=t;s{const[n,s]=e;return{a:()=>ss(n),b:()=>ss(s)}}},Rr={kernelName:"Identity",gradFunc:t=>({x:()=>bn(t,"float32")})},Mr={kernelName:"IsFinite",gradFunc:t=>({x:()=>ss(t)})},Or={kernelName:"IsInf",gradFunc:t=>({x:()=>ss(t)})},Br={kernelName:"IsNan",gradFunc:t=>({x:()=>ss(t)})},Pr={kernelName:"LeakyRelu",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{alpha:i}=n,r=fs(s,0);return{x:()=>ns(r,t,$n(t,i))}}},Wr={kernelName:"Log1p",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,ln(n,1))}}},Ur={kernelName:"Log",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,bn(n,"float32"))}}},Kr={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s]=e,{axis:i}=n;return{logits:()=>{const e=ls(s);return Ts(t,$n(Es(t,i,!0),e))}}}};const jr=sn({localResponseNormalizationBackprop_:function(t,e,n,s=5,i=1,r=1,a=.5){const o={x:t,y:e,dy:n},l={depthRadius:s,bias:i,alpha:r,beta:a};return Ze.runKernel("LRNGrad",o,l)}}),Vr={kernelName:"LRN",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{depthRadius:r,bias:a,alpha:o,beta:l}=n;return{x:()=>jr(s,i,t,r,a,o,l)}}};function qr(t,e,n,s){return e.rank$n(t,bn(es(n,e),t.dtype))}}const Gr={kernelName:"Max",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const s=n,{reductionIndices:i}=s,r=e[0],a=qr(t,e[1],r,Yt(i,r.shape));return{x:()=>a.x()}}},Hr={kernelName:"Maximum",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e;return{a:()=>$n(t,bn(gs(n,s),"float32")),b:()=>$n(t,bn(xs(n,s),"float32"))}}};const Jr=sn({maxPool3dGrad_:function(t,e,n,s,i,r,a){const o=en(t,"dy","maxPool3dGrad"),l=en(e,"input","maxPool3dGrad"),u=en(n,"output","maxPool3dGrad");let h=o,c=l,p=u,d=!1;4===l.rank&&(d=!0,h=Nn(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),c=Nn(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),p=Nn(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),qt(5===h.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${h.rank}.`)),qt(5===c.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),qt(5===p.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${p.rank}.`)),null!=a&&qt(Zt(r),(()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`));const f={dy:h,input:c,output:p},g={filterSize:s,strides:i,pad:r,dimRoundingMode:a},m=Ze.runKernel("MaxPool3DGrad",f,g);return d?Nn(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}}),Zr={kernelName:"MaxPool3D",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{filterSize:r,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>Jr(t,s,i,r,a,o,l)}}};const Xr=sn({maxPoolGrad_:function(t,e,n,s,i,r,a){const o=en(t,"dy","maxPoolGrad"),l=en(e,"input","maxPoolGrad"),u=en(n,"output","maxPoolGrad");qt(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),qt(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),qt(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),null!=a&&qt(Zt(r),(()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`));const h={dy:o,input:l,output:u},c={filterSize:s,strides:i,pad:r,dimRoundingMode:a};return Ze.runKernel("MaxPoolGrad",h,c)}}),Yr={kernelName:"PadV2",inputsToSave:["x"],gradFunc:(t,e,n)=>{const s=e[0],{paddings:i}=n,r=i.map((t=>t[0]));return{x:()=>En(t,r,s.shape)}}};const Qr={kernelName:"SpaceToBatchND",gradFunc:(t,e,n)=>{const{blockShape:s,paddings:i}=n;return{x:()=>Ln(t,s,i)}}},ta={kernelName:"SplitV",gradFunc:(t,e,n)=>{const{axis:s}=n;return{x:()=>zn(t,s)}}};const ea=[Vi,qi,Gi,Hi,Ji,Zi,Xi,Yi,Qi,tr,er,nr,ir,ar,or,lr,ur,hr,cr,pr,dr,fr,mr,gr,br,wr,kr,xr,vr,Sr,{kernelName:"RealDiv",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{const e=Yn(t,bn(s,"float32")),r=Qn(n.shape,i);return r.length>0?Nn(Es(e,r),n.shape):e},b:()=>{let e=$n(t,bn(n,"float32"));const r=Qn(s.shape,i);r.length>0&&(e=Nn(Es(e,r),s.shape));const a=Zs(s);return Cs(Yn(e,bn(a,"float32")))}}}},Ir,Nr,Ar,Cr,zr,$r,Dr,Tr,Er,_r,Rr,Mr,Or,Br,Pr,Wr,Ur,Kr,Vr,Gr,Gr,Hr,Zr,{kernelName:"MaxPool",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s,i]=e,{filterSize:r,strides:a,pad:o}=n;return{x:()=>Xr(t,s,i,r,a,o)}}},{kernelName:"Mean",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{axis:i}=n,r=Yt(i,s.shape),a=Ht(function(t,e){const n=[],s=t.length;for(let i=0;it[e]))]}(s.shape,r)[1]);return{x:()=>{const e=s.shape.slice();r.forEach((t=>{e[t]=1}));const n=Nn(t,e);return Yn($n(n,Vs(s.shape,"float32")),a)}}}},{kernelName:"Min",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const s=n,{axis:i}=s,[r,a]=e,o=qr(t,a,r,Yt(i,r.shape));return{x:()=>o.x()}}},{kernelName:"Minimum",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e;return{a:()=>$n(t,bn(vs(n,s),"float32")),b:()=>$n(t,bn(fs(n,s),"float32"))}}},{kernelName:"MirrorPad",inputsToSave:["x"],gradFunc:(t,e,n)=>{const s=e[0],{paddings:i}=n,r=i.map((t=>t[0]));return{x:()=>En(t,r,s.shape)}}},{kernelName:"Mod",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{const e=Qn(n.shape,i);return e.length>0?Nn(Es(t,e),n.shape):t},b:()=>{const e=$n(t,Cs(ps(Yn(n,s)))),r=Qn(s.shape,i);return r.length>0?Nn(Es(e,r),s.shape):e}}}},{kernelName:"Multiply",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{const e=$n(t,bn(s,"float32")),r=Qn(n.shape,i);return r.length>0?Nn(Es(e,r),n.shape):e},b:()=>{const e=$n(t,bn(n,"float32")),r=Qn(s.shape,i);return r.length>0?Nn(Es(e,r),s.shape):e}}}},{kernelName:"Neg",gradFunc:t=>({x:()=>Cs(t)})},{kernelName:"OneHot",inputsToSave:["indices"],gradFunc:(t,e)=>{const n=e[0];return{indices:()=>js(n.shape,"float32")}}},{kernelName:"OnesLike",gradFunc:t=>({x:()=>ss(t)})},{kernelName:"Pack",saveAllInputs:!0,gradFunc:(t,e,n)=>{const{axis:s}=n;return Ri(t,s).map((t=>()=>t))}},Yr,Yr,{kernelName:"Pow",inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(t,e)=>{const[n,s,i]=e,r=n,a=s,o=ts(r.shape,a.shape);return{a:()=>{const e=bn(a,"float32");let n=$n(t,$n(e,si(r,Ts(e,fi(1)))));const s=Qn(r.shape,o);return s.length>0&&(n=Es(n,s)),Nn(n,r.shape)},b:()=>{const e=fs(r,0),n=ns(e,Is(r),ss(r));let s=$n(t,$n(i,n));const l=Qn(a.shape,o);return l.length>0&&(s=Es(s,l)),Nn(s,a.shape)}}}},{kernelName:"Prelu",inputsToSave:["x","alpha"],gradFunc:(t,e)=>{const[n,s]=e,i=fs(n,0);return{x:()=>ns(i,t,$n(t,s)),alpha:()=>{let e=ns(i,ss(t),$n(t,n));const r=Qn(s.shape,t.shape);return r.length>0&&(e=Es(e,r)),Nn(e,s.shape)}}}},{kernelName:"Reciprocal",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,Cs(Zs(n)))}}},{kernelName:"Relu6",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,s=$n(vs(n,6),$i(n));return{x:()=>$n(t,bn(s,"float32"))}}},{kernelName:"Relu",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,bn($i(n),"float32"))}}},{kernelName:"Reshape",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Nn(t,n.shape)}}},{kernelName:"ResizeBilinear",inputsToSave:["images"],gradFunc:(t,e,n)=>{const[s]=e,i={dy:t,images:s};return{images:()=>Ze.runKernel("ResizeBilinearGrad",i,n)}}},{kernelName:"ResizeNearestNeighbor",inputsToSave:["images"],gradFunc:(t,e,n)=>{const[s]=e,i={dy:t,images:s};return{images:()=>Ze.runKernel("ResizeNearestNeighborGrad",i,n)}}},{kernelName:"Reverse",gradFunc:(t,e,n)=>{const{dims:s}=n,i=Yt(s,t.shape);return{x:()=>hi(t,i)}}},{kernelName:"Round",gradFunc:t=>({x:()=>ss(t)})},{kernelName:"Rsqrt",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Cs(Yn(t,$n(si(n,1.5),2)))}}},{kernelName:"Select",inputsToSave:["condition"],gradFunc:(t,e)=>{const[n]=e;return{condition:()=>bn(ss(n),"float32"),t:()=>$n(t,bn(n,t.dtype)),e:()=>$n(t,bn(Os(n),t.dtype))}}},{kernelName:"Selu",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=fs(n,fi(0)),s=fi(1.7580993408473768),i=fi(1.0507009873554805),r=$n(t,i),a=$n($n(t,s),ls(bn(n,"float32")));return ns(e,r,a)}}}},{kernelName:"Sigmoid",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,$n(n,Ts(fi(1),n)))}}},{kernelName:"Sign",gradFunc:t=>({x:()=>ss(t)})},{kernelName:"Sin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(Vn(bn(n,"float32")),t)}}},{kernelName:"Sinh",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(qn(bn(n,"float32")),t)}}},{kernelName:"Slice",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{begin:i,size:r}=n,a=s.shape,[o,l]=function(t,e,n){let s;const i=t.shape.length;let r;return s="number"==typeof e?[e,...new Array(i-1).fill(0)]:e.length{qt(-1!==t,(()=>"slice() does not support negative begin indexing."))})),r=null==n?new Array(i).fill(-1):"number"==typeof n?[n,...new Array(i-1).fill(-1)]:n.lengthe>=0?e:(qt(-1===e,(()=>`Negative size values should be exactly -1 but got ${e} for the slice() size at index ${n}.`)),t.shape[n]-s[n]))),[s,r]}(s,i,r),u=[];for(let e=0;eti(t,u)}}},{kernelName:"Softmax",outputsToSave:[!0],gradFunc:(t,e,n)=>{const[s]=e,{dim:i}=n,r=$n(t,s);return{logits:()=>Ts(r,$n(Es(r,[i],true),s))}}},{kernelName:"Softplus",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,Tn(n))}}},Qr,Qr,ta,ta,{kernelName:"Sqrt",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,$n(Ai(bn(n,"float32")),2))}}},{kernelName:"SquaredDifference",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=fi(2);return{a:()=>$n(t,$n(i,Ts(n,s))),b:()=>$n(t,$n(i,Ts(s,n)))}}},{kernelName:"Square",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(t,$n(bn(n,"float32"),2))}}},{kernelName:"Step",gradFunc:t=>({x:()=>ss(t)})},{kernelName:"Sub",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,s]=e,i=ts(n.shape,s.shape);return{a:()=>{let e=t;const s=Qn(n.shape,i);return s.length>0&&(e=Es(e,s)),Nn(e,n.shape)},b:()=>{let e=t;const n=Qn(s.shape,i);return n.length>0&&(e=Es(e,n)),Nn(Cs(e),s.shape)}}}},{kernelName:"Sum",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,i=s.shape.slice(),{axis:r}=n;Yt(r,s.shape).forEach((t=>{i[t]=1}));const a=Nn(t,i),o=$n(a,Vs(s.shape,"float32"));return{x:()=>o}}},{kernelName:"Tan",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>Yn(t,Zs(Vn(n)))}}},{kernelName:"Tanh",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(Ts(fi(1),Zs(n)),t)}}},{kernelName:"Tile",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[s]=e,{reps:i}=n;return{x:()=>{let e=ss(s);if(1===s.rank)for(let n=0;n{const s=n,{perm:i}=s,r=_s(i);return{x:()=>Mi(t,r)}}},{kernelName:"Unpack",gradFunc:(t,e,n)=>{const s=n,{axis:i}=s;return{value:()=>Di(t,i)}}},{kernelName:"UnsortedSegmentSum",inputsToSave:["segmentIds"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>function(t,e){const n=Us(e,ss(e)),s=ds(t,n);let i=gs(e,fi(0,"int32"));const r=s.rank-i.rank;for(let t=0;t({x:()=>ss(t)})}];for(const t of ea)ve(t);let na;function sa(){return null==na&&(na=t().epsilon()),na}class ia extends Error{constructor(t){super(t),Object.setPrototypeOf(this,ia.prototype)}}class ra extends Error{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}}class aa extends Error{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}}class oa extends Error{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}}class la extends Error{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}}function ua(t,e){if(Array.isArray(t)){let n=[];for(let s=0;se.toUpperCase()))}let ma={};function ya(t){if(null==t)return null;const e={};return e.className=t.getClassName(),e.config=t.getConfig(),e}function ba(t){if(null!=t&&"object"==typeof t)if(Array.isArray(t))t.forEach((t=>ba(t)));else{const e=Object.keys(t);for(const n of e){const e=t[n];null!=e&&"object"==typeof e&&(Array.isArray(e)||"ndarray"!==e.type||"number"!=typeof e.value?ba(e):t[n]=e.value)}}}function wa(t,e={},n={},s="object",i=!1){if("string"==typeof t){const i=t;let r;if(i in n)r=n[i];else if(i in ma)r=ma[i];else if(r=e[i],null==r)throw new aa(`Unknown ${s}: ${t}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return r}{const r=t;if(null==r.className||null==r.config)throw new aa(`${s}: Improper config format: ${JSON.stringify(r)}.\n'className' and 'config' must set.`);const a=r.className;let o,l;if(a in n?[o,l]=n[a]:a in ma?[o,l]=ma.className:a in e&&([o,l]=e[a]),null==o)throw new aa(`Unknown ${s}: ${a}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const t={};for(const e of Object.keys(ma))t[e]=ma[e];for(const e of Object.keys(n))t[e]=n[e];r.config.customObjects=t;const e=Object.assign({},ma);for(const t of Object.keys(n))ma[t]=n[t];ba(r.config);const s=l(o,r.config,n,i);return ma=Object.assign({},e),s}{const t=Object.assign({},ma);for(const t of Object.keys(n))ma[t]=n[t];const e=new o(r.config);return ma=Object.assign({},t),e}}}function ka(t,e){return-1*function(t,e){return te?1:0}(t,e)}function xa(t){if(null==t)return t;const e=[];for(const n of t)-1===e.indexOf(n)&&e.push(n);return e}function va(t){if(null==t)throw new aa(`Invalid value in obj: ${JSON.stringify(t)}`);for(const e in t)if(t.hasOwnProperty(e))return!1;return!0}function Sa(t,e,n){if(null!=n&&t.indexOf(n)<0)throw new aa(`${n} is not a valid ${e}. Valid values are ${t} or null/undefined.`)}function Ia(t,e,n=0,s=1/0){return ha(n>=0),ha(s>=n),Array.isArray(t)&&t.length>=n&&t.length<=s&&t.every((t=>typeof t===e))}function Na(t,n){Array.isArray(t)?(e.assert(t.length>0,(()=>`${n} is unexpectedly an empty array.`)),t.forEach(((t,e)=>Na(t,`element ${e+1} of ${n}`)))):e.assert(Number.isInteger(t)&&t>0,(()=>`Expected ${n} to be a positive integer, but got ${Aa(t)}.`))}function Aa(t){return null===t?"null":Array.isArray(t)?"["+t.map((t=>Aa(t))).join(",")+"]":"string"==typeof t?`"${t}"`:`${t}`}function Ca(t){return"relu"===t?"relu":"linear"===t?"linear":"elu"===t?"elu":null}function za(t,e){return s((()=>i(r(a(t,t),e,!0))))}class Da extends n.Serializable{getConfig(){return{}}}class $a extends Da{constructor(t){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=t.maxValue?t.maxValue:this.defaultMaxValue,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return s((()=>{const e=za(t,this.axis),n=o(e,0,this.maxValue);return a(t,l(n,u(sa(),e)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}$a.className="MaxNorm",n.registerClass($a);class Ta extends Da{constructor(t){super(),this.defaultAxis=0,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return s((()=>l(t,u(sa(),za(t,this.axis)))))}getConfig(){return{axis:this.axis}}}Ta.className="UnitNorm",n.registerClass(Ta);class Ea extends Da{apply(t){return h(t)}}Ea.className="NonNeg",n.registerClass(Ea);class Fa extends Da{constructor(t){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=t.minValue?t.minValue:this.defaultMinValue,this.maxValue=null!=t.maxValue?t.maxValue:this.defaultMaxValue,this.rate=null!=t.rate?t.rate:this.defaultRate,this.axis=null!=t.axis?t.axis:this.defaultAxis}apply(t){return s((()=>{const e=za(t,this.axis),n=u(a(this.rate,o(e,this.minValue,this.maxValue)),a(1-this.rate,e));return a(t,l(n,u(sa(),e)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}Fa.className="MinMaxNorm",n.registerClass(Fa);const La={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function _a(t){return ya(t)}function Ra(t,e={}){return wa(t,n.SerializationMap.getMap().classNameMap,e,"constraint")}function Ma(t){if(null==t)return null;if("string"==typeof t){return Ra({className:t in La?La[t]:t,config:{}})}return t instanceof Da?t:Ra(t)}var Oa=Object.freeze({__proto__:null,maxNorm:function(t){return new $a(t)},unitNorm:function(t){return new Ta(t)},nonNeg:function(){return new Ea},minMaxNorm:function(t){return new Fa(t)}});const Ba=["channelsFirst","channelsLast"],Pa=["nearest","bilinear"],Wa=["valid","same","causal"],Ua=["max","avg"],Ka=["sum","mul","concat","ave"],ja=new Map;function Va(t){Sa(Ba,"DataFormat",t)}function qa(t){Sa(Wa,"PaddingMode",t)}function Ga(t){Sa(Ua,"PoolMode",t)}const Ha=[];function Ja(t,e){Ha.push(t);try{const t=e();return Ha.pop(),t}catch(t){throw Ha.pop(),t}}function Za(t){if(!Qa(t))throw new Error("Not a valid tensor name: '"+t+"'");return(0===Ha.length?"":Ha.join("/")+"/")+t}function Xa(t){if(!Qa(t))throw new Error("Not a valid tensor name: '"+t+"'");ja.has(t)||ja.set(t,0);const e=ja.get(t);if(ja.set(t,ja.get(t)+1),e>0){const n=`${t}_${e}`;return ja.set(n,1),n}return t}const Ya=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Qa(t){return!!t.match(Ya)}function to(t,e,n){null==e&&(e=0),null==n&&(n=t.length);let s=1;for(let i=e;i{switch(t.rank){case 1:return b(t,e,n);case 2:return y(t,[e,0],[n,t.shape[1]]);case 3:return m(t,[e,0,0],[n,t.shape[1],t.shape[2]]);case 4:return g(t,[e,0,0,0],[n,t.shape[1],t.shape[2],t.shape[3]]);case 5:return f(t,[e,0,0,0,0],[n,t.shape[1],t.shape[2],t.shape[3],t.shape[4]]);case 6:return f(t,[e,0,0,0,0,0],[n,t.shape[1],t.shape[2],t.shape[3],t.shape[4],t.shape[5]]);default:throw new aa(`sliceAlongFirstAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function lo(t,e,n){return s((()=>{switch(t.rank){case 1:return b(t,e,n);case 2:return y(t,[0,e],[t.shape[0],n]);case 3:return m(t,[0,0,e],[t.shape[0],t.shape[1],n]);case 4:return g(t,[0,0,0,e],[t.shape[0],t.shape[1],t.shape[2],n]);default:throw new aa(`sliceAlongLastAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function uo(t,e,n,i){return s((()=>{switch(t.rank){case 1:return b(t,e,n);case 2:switch(i){case 1:return oo(t,e,n);case 2:return lo(t,e,n);default:throw new aa(`The axis is not within the rank of the tensor ${i}`)}case 3:switch(i){case 1:return oo(t,e,n);case 2:return m(t,[0,e,0],[t.shape[0],n,t.shape[2]]);case 3:return lo(t,e,n);default:throw new aa(`The axis is not within the rank of the tensor ${i}`)}case 4:switch(i){case 1:return oo(t,e,n);case 2:return g(t,[0,e,0,0],[t.shape[0],n,t.shape[2],t.shape[3]]);case 3:return g(t,[0,0,e,0],[t.shape[0],t.shape[1],n,t.shape[3]]);case 4:return lo(t,e,n);default:throw new aa(`The axis is not within the rank of the tensor ${i}`)}default:throw new aa(`sliceAlongLastAxis() received an unsupported tensor rank: ${t.rank}`)}}))}function ho(t,e=-1){let n;return e<0&&(n=t[0].rank,e=0!==n?n:0),e===t[0].rank&&(e=-1),N(t,e)}function co(t,e){switch(t.rank){case 1:return $([t,e]);case 2:return D([t,e],0);case 3:return z([t,e],0);case 4:return C([t,e],0);default:throw new aa(`concatAlongFirstAxis() received an unsupported tensor rank: ${t.rank}`)}}function po(t,e){if(Array.isArray(e)||(e=[e]),t.rank!==e.length)throw new aa(`The length of input n (${e.length}) does not match the number of dimensions in input x (${t.rank})`);return k(t,e)}function fo(t,e=0,n=1,s,i){return x(t,e,n,s,i)}function go(t,e,n,s){if(t.rank<2||e.rank<2)throw new oa(`dot requires both inputs to be rank >= 2 but got x shape = ${t.shape} and y shape = ${e.shape}`);if(e.rank>=3){if(t.shape.slice(-1)[0]!==e.shape.slice(-2)[0])throw new oa(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${t.shape} and y shape = ${e.shape}`)}if(2===t.rank&&2===e.rank){const i=!1,r=!1;return A.matMul({a:t,b:e,transposeA:i,transposeB:r,bias:s?bo(t.rank,s,"channelsLast"):null,activation:n})}{const i=t.shape.slice(),r=i.pop();t=t.reshape([-1,r]);const a=e.shape.slice(),o=a.pop(),l=a.pop(),u=[...a,o],h=Array.from({length:e.rank},((t,n)=>0===n?e.rank-2:n<=e.rank-2?n-1:n));e=e.transpose(h).reshape([l,-1]);const c=[...i,...u],p=!1,d=!1;return A.matMul({a:t,b:e,transposeA:p,transposeB:d,bias:s?bo(t.rank,s,"channelsLast"):null,activation:n}).reshape(c)}}function mo(t,e,n){return s((()=>(e=Array.isArray(e)?p(e,"int32"):e.toInt(),w(t,e,n))))}function yo(t){return a(t,t)}function bo(t,e,n){const s=e.shape;if(1!==e.rank&&e.rank!==t)throw new aa(`Unexpected bias dimensions: ${e.rank}; expected it to be 1 or ${t}`);if(5===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1,1,1]):e.reshape([1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,1,1,s[0]]):e.reshape([1].concat(s))}else if(4===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1,1]):e.reshape([1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,1,s[0]]):e.reshape([1].concat(s))}else if(3===t){if("channelsFirst"===n)return 1===s.length?e.reshape([1,s[0],1]):e.reshape([1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?e.reshape([1,1,s[0]]):e.reshape([1].concat(s))}else if(t<3)return e;throw new aa(`Unsupported input rank by biasAdd: ${e.rank}`)}function wo(t,e,n){return s((()=>(null==n&&(n="channelsLast"),Va(n),t.add(bo(t.rank,e,n)))))}function ko(t,e,n,i){return s((()=>I(t,e,n,i)))}function xo(t,e,n=!1){return n?t():e()}const vo=["fanIn","fanOut","fanAvg"],So=["normal","uniform","truncatedNormal"];class Io extends n.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class No extends Io{apply(t,e){return T(t,e)}}No.className="Zeros",n.registerClass(No);class Ao extends Io{apply(t,e){return E(t,e)}}Ao.className="Ones",n.registerClass(Ao);class Co extends Io{constructor(t){if(super(),"object"!=typeof t)throw new aa(`Expected argument of type ConstantConfig but got ${t}`);if(void 0===t.value)throw new aa(`config must have value set but got ${t}`);this.value=t.value}apply(t,e){return s((()=>a(F(this.value),E(t,e))))}getConfig(){return{value:this.value}}}Co.className="Constant",n.registerClass(Co);class zo extends Io{constructor(t){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=t.minval||this.DEFAULT_MINVAL,this.maxval=t.maxval||this.DEFAULT_MAXVAL,this.seed=t.seed}apply(t,e){return L(t,this.minval,this.maxval,e)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}zo.className="RandomUniform",n.registerClass(zo);class Do extends Io{constructor(t){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=t.mean||this.DEFAULT_MEAN,this.stddev=t.stddev||this.DEFAULT_STDDEV,this.seed=t.seed}apply(t,e){if("float32"!==(e=e||"float32")&&"int32"!==e)throw new oa(`randomNormal does not support dType ${e}.`);return fo(t,this.mean,this.stddev,e,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}Do.className="RandomNormal",n.registerClass(Do);class $o extends Io{constructor(t){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=t.mean||this.DEFAULT_MEAN,this.stddev=t.stddev||this.DEFAULT_STDDEV,this.seed=t.seed}apply(t,e){if("float32"!==(e=e||"float32")&&"int32"!==e)throw new oa(`truncatedNormal does not support dType ${e}.`);return _(t,this.mean,this.stddev,e,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}$o.className="TruncatedNormal",n.registerClass($o);class To extends Io{constructor(t){super(),this.gain=null!=t.gain?t.gain:1}apply(t,e){return s((()=>{if(2!==t.length||t[0]!==t[1])throw new aa("Identity matrix initializer can only be used for 2D square matrices.");return a(this.gain,R(t[0]))}))}getConfig(){return{gain:this.gain}}}To.className="Identity",n.registerClass(To);class Eo extends Io{constructor(t){if(super(),t.scale<0)throw new aa(`scale must be a positive float. Got: ${t.scale}`);var e;this.scale=null==t.scale?1:t.scale,this.mode=null==t.mode?"fanIn":t.mode,e=this.mode,Sa(vo,"FanMode",e),this.distribution=null==t.distribution?"normal":t.distribution,function(t){Sa(So,"Distribution",t)}(this.distribution),this.seed=t.seed}apply(t,e){const n=function(t,e="channelsLast"){let n,s;if(Va(e),2===t.length)n=t[0],s=t[1];else if(-1!==[3,4,5].indexOf(t.length)){if("channelsFirst"===e){const e=to(t,2);n=t[1]*e,s=t[0]*e}else if("channelsLast"===e){const e=to(t,0,t.length-2);n=t[t.length-2]*e,s=t[t.length-1]*e}}else{const e=to(t);n=Math.sqrt(e),s=Math.sqrt(e)}return[n,s]}(t),s=n[0],i=n[1];let r=this.scale;if("fanIn"===this.mode?r/=Math.max(1,s):"fanOut"===this.mode?r/=Math.max(1,i):r/=Math.max(1,(s+i)/2),"normal"===this.distribution){const n=Math.sqrt(r);if("float32"!==(e=e||"float32")&&"int32"!==e)throw new oa(`${this.getClassName()} does not support dType ${e}.`);return _(t,0,n,e,this.seed)}{const n=Math.sqrt(3*r);return L(t,-n,n,e)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}Eo.className="VarianceScaling",n.registerClass(Eo);class Fo extends Eo{constructor(t){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}Fo.className="GlorotUniform",n.registerClass(Fo);class Lo extends Eo{constructor(t){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}Lo.className="GlorotNormal",n.registerClass(Lo);class _o extends Eo{constructor(t){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}_o.className="HeNormal",n.registerClass(_o);class Ro extends Eo{constructor(t){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}Ro.className="HeUniform",n.registerClass(Ro);class Mo extends Eo{constructor(t){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}Mo.className="LeCunNormal",n.registerClass(Mo);class Oo extends Eo{constructor(t){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})}getClassName(){return Eo.className}}Oo.className="LeCunNormal",n.registerClass(Oo);class Bo extends Io{constructor(t){if(super(),this.DEFAULT_GAIN=1,this.gain=null==t.gain?this.DEFAULT_GAIN:t.gain,this.seed=t.seed,null!=this.seed)throw new oa("Random seed is not implemented for Orthogonal Initializer yet.")}apply(t,e){return s((()=>{if(t.length<2)throw new oa("Shape must be at least 2D.");t[0]*t[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${t[0]*t[1]}) elements: Slowness may result.`);const e=fo(t[0]>t[1]?[t[1],t[0]]:t,0,1,"float32");let n=M.gramSchmidt(e);return t[0]>t[1]&&(n=n.transpose()),a(this.gain,n)}))}getConfig(){return{gain:this.gain,seed:this.seed}}}Bo.className="Orthogonal",n.registerClass(Bo);const Po={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Wo(t,e={}){return wa(t,n.SerializationMap.getMap().classNameMap,e,"initializer")}function Uo(t){return ya(t)}function Ko(t){if("string"==typeof t){const e=t in Po?Po[t]:t;if("GlorotNormal"===e)return new Lo;if("GlorotUniform"===e)return new Fo;if("HeNormal"===e)return new _o;if("HeUniform"===e)return new Ro;if("LeCunNormal"===e)return new Mo;if("LeCunUniform"===e)return new Oo;{const t={};return t.className=e,t.config={},Wo(t)}}return t instanceof Io?t:Wo(t)}var jo=Object.freeze({__proto__:null,zeros:function(){return new No},ones:function(){return new Ao},constant:function(t){return new Co(t)},randomUniform:function(t){return new zo(t)},randomNormal:function(t){return new Do(t)},truncatedNormal:function(t){return new $o(t)},identity:function(t){return new To(t)},varianceScaling:function(t){return new Eo(t)},glorotUniform:function(t){return new Fo(t)},glorotNormal:function(t){return new Lo(t)},heNormal:function(t){return new _o(t)},heUniform:function(t){return new Ro(t)},leCunNormal:function(t){return new Mo(t)},leCunUniform:function(t){return new Oo(t)},orthogonal:function(t){return new Bo(t)}});let Vo=0;function qo(){return Vo++}const Go={};function Ho(t=""){return t in Go||(Go[t]=0),Go[t]+=1,t+Go[t].toString()}function Jo(t){return Array.isArray(t)&&Array.isArray(t[0])}function Zo(t){return 0===t.length?[]:Array.isArray(t[0])?t:[t]}function Xo(t){let e;if(Array.isArray(t)){if(1!==t.length)throw new aa(`Expected Tensor length to be 1; got ${t.length}`);e=t[0]}else e=t;return e}function Yo(t){if(Array.isArray(t)&&Array.isArray(t[0])){if(1===t.length)return(t=t)[0];throw new aa(`Expected exactly 1 Shape; got ${t.length}`)}return t}function Qo(t){let e=0;for(const n of t)0===n.shape.length?e+=1:e+=n.shape.reduce(((t,e)=>t*e));return e}class tl{constructor(t,e="float32",n="Variable",s=!0,i=null){this.dtype=null==e?"float32":e,this.shape=t.shape,this.id=qo(),n=null==n?"Variable":n,this.originalName=Za(n),this.name=Xa(this.originalName),this.trainable_=s,this.constraint=i,this.val=O(t,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(t){return this.assertNotDisposed(),function(t,e){if(t.shape.toString()!==e.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(t.shape)+" vs. "+JSON.stringify(e.shape))}(this.val,t),this.val.id!==t.id&&(this.val.assign(t),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(t){this.trainable_=t,this.val.trainable=t}}function el(t){return t.map((t=>t.read()))}function nl(t){t.forEach((t=>{t[0].write(t[1])}))}class sl{constructor(t){this.dtype=t.dtype,this.shape=t.shape,null!=t.shape?this.ndim=t.shape.length:this.ndim=t.ndim,this.maxNDim=t.maxNDim,this.minNDim=t.minNDim,this.axes=t.axes||{}}}class il{constructor(t,e,n,s,i,r,a){this.dtype=t,this.shape=e,this.sourceLayer=n,this.inputs=s,this.callArgs=i,this.outputTensorIndex=a,this.id=qo(),null!=r&&(this.originalName=Za(r),this.name=Xa(this.originalName)),this.rank=e.length}}let rl=0;class al{constructor(t,e){this.callArgs=e,this.id=rl++,this.outboundLayer=t.outboundLayer,this.inboundLayers=t.inboundLayers,this.nodeIndices=t.nodeIndices,this.tensorIndices=t.tensorIndices,this.inputTensors=t.inputTensors,this.outputTensors=t.outputTensors,this.inputMasks=t.inputMasks,this.outputMasks=t.outputMasks,this.inputShapes=t.inputShapes,this.outputShapes=t.outputShapes;for(const e of t.inboundLayers)null!=e&&e.outboundNodes.push(this);t.outboundLayer.inboundNodes.push(this)}getConfig(){const t=[];for(const e of this.inboundLayers)null!=e?t.push(e.name):t.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:t,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let ol=0;class ll extends n.Serializable{constructor(t={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=ol++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let e=t.name;if(!e){const t=this.getClassName();e=fa(t)+"_"+Ho(t)}if(this.name=e,this.trainable_=null==t.trainable||t.trainable,null!=t.inputShape||null!=t.batchInputShape){let e;if(null!=t.batchInputShape)e=t.batchInputShape;else if(null!=t.inputShape){let n=null;null!=t.batchSize&&(n=t.batchSize),e=[n].concat(t.inputShape)}this.batchInputShape=e;let n=t.dtype;null==n&&(n=t.inputDType),null==n&&(n="float32"),this.dtype=n}null!=t.weights?this.initialWeights=t.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(t,e){return t.name+"_ib-"+e.toString()}getNodeAtIndex(t,e){if(0===this.inboundNodes.length)throw new ra(`The layer has never been called and thus has no defined ${e}.`);if(this.inboundNodes.length<=t)throw new aa(`Asked to get ${e} at node ${t}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[t]}getInputAt(t){return pa(this.getNodeAtIndex(t,"input").inputTensors)}getOutputAt(t){return pa(this.getNodeAtIndex(t,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new ia(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new ia(`Layer ${this.name} is not connected, no input to return.`);return pa(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new ia(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new ia(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return pa(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((t=>t()))}get updates(){return this._updates}get built(){return this._built}set built(t){this._built=t}get trainable(){return this.trainable_}set trainable(t){this._trainableWeights.forEach((e=>e.trainable=t)),this.trainable_=t}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((t=>t.trainable)):[]}set trainableWeights(t){this._trainableWeights=t}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((t=>!t.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(t){this._nonTrainableWeights=t}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(t){if(t=da(t),null==this.inputSpec||0===this.inputSpec.length)return;const e=da(this.inputSpec);if(t.length!==e.length)throw new aa(`Layer ${this.name} expects ${e.length} inputs, but it received ${t.length} input tensors. Input received: ${t}`);for(let n=0;ni.maxNDim)throw new aa(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${i.maxNDim}, found ndim=${r}`);if(null!=i.minNDim&&r=0?t[s]:t[t.length+s];if(null!=r&&-1===[r,null].indexOf(a))throw new aa(`Input ${n} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${r} but got shape ${t}.`)}}if(null!=i.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(t);const e=[];for(const n of da(t))e.push(n.shape);this.build(pa(e)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&i&&(this._refCount=1)}if(this.assertInputCompatibility(t),i){let s=this.call(t,e);const i=da(s),r=[];for(let t of i)-1!==n.indexOf(t)&&(t=t.clone()),r.push(t);if(s=pa(r),null!=this.activityRegularizer)throw new oa("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(t){t=da(t);const e=[];for(const n of t)e.push(n.shape);return pa(e)}(t),s=this.computeOutputShape(n);let i;const r="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(t)?n[0]:n),i=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new il(r,n,this,da(t),e,this.name,s))):new il(r,s,this,da(t),e,this.name),this.addInboundNode(t,i,null,null,n,s,e),this._refCount++,null!=this.activityRegularizer)throw new oa("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return i}}))}warnOnIncompatibleInputShape(t){if(null!=this.batchInputShape)if(t.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(t)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let e=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=t[s]&&t[s]!==n&&(e=!0)})),e&&console.warn(`The shape of the input tensor (${JSON.stringify(t)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new ia(`The layer ${this.name} has never been called and thus has no defined output shape.`);const t=[];for(const e of this.inboundNodes){const n=JSON.stringify(e.outputShapes);-1===t.indexOf(n)&&t.push(n)}if(1===t.length){const t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&1===t.length?t[0]:t}throw new ia(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new ra(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Qo(this.weights)}build(t){this.built=!0}getWeights(t=!1){return el(t?this.trainableWeights:this.weights)}setWeights(t){s((()=>{const n=this.weights;if(n.length!==t.length)throw new aa(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${t.length}, but the layer was expecting ${n.length} weights. Provided weights: ${t}...`);if(0===n.length)return;const s=[],i=el(n);for(let r=0;ri.apply(l.read()))),null==r&&(r=!0),r?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(t){this.fastWeightInitDuringBuild=t}addLoss(t){null==t||Array.isArray(t)&&0===t.length||(t=da(t),void 0!==this._losses&&null!==this._losses&&this.losses.push(...t))}computeOutputShape(t){return t}computeMask(t,e){if(!this.supportsMasking){if(null!=e){if(!Array.isArray(e))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);e.forEach((t=>{if(null!=t)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return e}addInboundNode(t,e,n,s,i,r,a=null){const o=da(t);e=da(e),n=da(n),s=da(s),i=Zo(i),r=Zo(r);const l=[],u=[],h=[];for(const t of o)l.push(t.sourceLayer),u.push(t.nodeIndex),h.push(t.tensorIndex);new al({outboundLayer:this,inboundLayers:l,nodeIndices:u,tensorIndices:h,inputTensors:o,outputTensors:e,inputMasks:n,outputMasks:s,inputShapes:i,outputShapes:r},a);for(let t=0;tt.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let t=0;return 0==--this._refCount&&(t=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:t}}}function ul(t,e,n){if((null==e||null!=n&&n>0)&&(e=t.sourceLayer,n=t.nodeIndex),0===e.inboundNodes.length)return[t];{const t=e.inboundNodes[n];if(0===t.inboundLayers.length)return t.inputTensors;{const e=[];for(let n=0;n0){const i=await Promise.all(e);for(let e=0;eu(this.totals[t],a(i,n))));this.totals[t]=r,null!=e&&e.dispose()}}}async onEpochEnd(t,e){if(null!=e)for(const t of this.params.metrics)null!=this.totals[t]&&("number"==typeof this.totals[t]?e[t]=this.totals[t]/this.seen:s((()=>{const n=a(l(1,this.seen),this.totals[t]);e[t]=n,this.totals[t].dispose(),W(e[t])})))}}class bl extends gl{async onTrainBegin(t){this.epoch=[],this.history={}}async onEpochEnd(t,e){null==e&&(e={}),this.epoch.push(t);for(const t in e)null==this.history[t]&&(this.history[t]=[]),this.history[t].push(e[t])}async syncData(){const t=[],e=[],n=[];for(const s in this.history){const i=this.history[s];for(let r=0;r{const a=e.now();return a-inew wl(t,e)))}class xl{constructor(){}static registerCallbackConstructor(t,n){e.assert(t>=0&&Number.isInteger(t),(()=>`Verbosity level is expected to be an integer >= 0, but got ${t}`)),xl.checkForDuplicate(n),null==xl.constructors[t]&&(xl.constructors[t]=[]),xl.constructors[t].push(n)}static checkForDuplicate(t){for(const e in xl.constructors){xl.constructors[+e].forEach((e=>{if(e===t)throw new aa("Duplicate callback constructor.")}))}}static clear(){xl.constructors={}}static createCallbacks(t){const e=[];for(const n in xl.constructors){const s=+n;t>=s&&e.push(...xl.constructors[s])}return e.map((t=>new t))}}function vl(t,e,n,s,i,r,a,o,l){const u=new bl,h=[new yl,...xl.createCallbacks(e)];null!=t&&h.push(...t),h.push(u);const c=new ml(h);return c.setParams({epochs:n,initialEpoch:s,samples:i,steps:r,batchSize:a,verbose:e,doValidation:o,metrics:l}),{callbackList:c,history:u}}function Sl(t,e={},s=!1){return wa(t,n.SerializationMap.getMap().classNameMap,e,"layer",s)}function Il(t,e){return s((()=>{"float32"!==t.dtype&&(t=t.asType("float32"));const n=r(yo(t),e,!0),s=G(n.shape,sa()),a=i(H(n,s));return l(t,a)}))}function Nl(t,e){return s((()=>j(yo(K(e,t)),-1)))}function Al(t,e){return s((()=>j(S(K(e,t)),-1)))}function Cl(t,e){return s((()=>{const n=K(t,e),s=o(S(t),sa(),Number.MAX_VALUE),i=S(l(n,s));return a(100,j(i,-1))}))}function zl(t,e,n=!1){return s((()=>{if(n)e=V(e);else{const t=r(e,e.shape.length-1,!0);e=l(e,t)}return e=o(e,sa(),1-sa()),q(r(a(t.toFloat(),U(e)),e.shape.length-1))}))}function Dl(t,e,n=!1){return s((()=>{const s=J(function(t){const e=[to(t.shape)];return t.reshape(e)}(t)).toInt(),i=(e=o(e,sa(),1-sa())).shape;return zl(Z(s,i[i.length-1]).reshape(i),e,n)}))}function $l(t,n){return s((()=>{let i;return i=o(n,sa(),1-sa()),i=U(l(i,K(1,i))),j(function(t,n){if(!e.arraysEqual(t.shape,n.shape))throw new aa(`logits and labels must have the same shape, but got shapes ${JSON.stringify(t.shape)} and ${JSON.stringify(n.shape)}`);return s((()=>{const e=n.relu(),s=n.abs().neg();return e.sub(n.mul(t)).add(s.exp().log1p())}))}(t,i),-1)}))}function Tl(t,e){return s((()=>{const n=Il(t,-1),s=Il(e,-1),i=a(n,s);return q(r(i,-1))}))}xl.constructors={};const El={meanSquaredError:Nl,meanAbsoluteError:Al,meanAbsolutePercentageError:Cl,meanSquaredLogarithmicError:function(t,e){return s((()=>{const n=o(e,sa(),Number.MAX_VALUE),s=U(u(1,n)),i=o(t,sa(),Number.MAX_VALUE),r=U(u(1,i));return j(yo(K(s,r)),-1)}))},squaredHinge:function(t,e){return s((()=>{const n=H(0,K(1,a(t,e)));return j(yo(n),-1)}))},hinge:function(t,e){return s((()=>{const n=H(0,K(1,a(t,e)));return j(n,-1)}))},categoricalHinge:function(t,e){return s((()=>{const n=r(a(t,e),-1),s=c(a(K(1,t),e),-1);return H(0,u(1,K(s,n)))}))},logcosh:function(t,e){return s((()=>{const n=Math.log(2),s=K(e,t),i=K(u(s,X(a(-2,s))),n);return j(i,-1)}))},categoricalCrossentropy:zl,sparseCategoricalCrossentropy:Dl,binaryCrossentropy:$l,kullbackLeiblerDivergence:function(t,e){return s((()=>{const n=o(t,sa(),1),s=o(e,sa(),1);return r(a(t,U(l(n,s))),-1)}))},poisson:function(t,e){return s((()=>{const n=U(u(sa(),e));return j(K(e,a(t,n)),-1)}))},cosineProximity:Tl};function Fl(t){if("string"==typeof t){if(t in El)return El[t];let e=`Unknown loss ${t}`;throw t.toLowerCase().includes("softmaxcrossentropy")&&(e=`Unknown loss ${t}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new aa(e)}return t}function Ll(t,e){return s((()=>{const n=a(.5,Y(e)),s=ro(Q(e,n),t.dtype);return j(tt(t,s),-1)}))}function _l(t,e){return s((()=>ro(tt(et(t,-1),et(e,-1)),"float32")))}function Rl(t,e){return s((()=>nt(t.equal(1),e.equal(1)).sum().cast("float32")))}function Ml(t,e){return s((()=>{const n=Rl(t,e),i=function(t,e){return s((()=>nt(t.equal(0),e.equal(1)).sum().cast("float32")))}(t,e),r=n.add(i);return st(Q(r,0),n.div(r),0).cast("float32")}))}function Ol(t,e){return s((()=>{const n=Rl(t,e),i=function(t,e){return s((()=>nt(t.equal(1),e.equal(0)).sum().cast("float32")))}(t,e),r=n.add(i);return st(Q(r,0),n.div(r),0).cast("float32")}))}function Bl(t,e){return $l(t,e)}function Pl(t,e){return t.rank===e.rank&&(t=t.squeeze([t.rank-1])),(e=e.argMax(-1)).dtype!==t.dtype&&(e=e.asType(t.dtype)),tt(t,e).asType("float32")}const Wl=zl,Ul=Dl,Kl={binaryAccuracy:Ll,categoricalAccuracy:_l,precision:Ml,categoricalCrossentropy:Wl,sparseCategoricalCrossentropy:Ul,mse:Nl,MSE:Nl,mae:Al,MAE:Al,mape:Cl,MAPE:Cl,cosine:Tl};function jl(t){if("string"==typeof t&&t in Kl)return Kl[t];if("string"!=typeof t&&null!=t)return t;throw new aa(`Unknown metric ${t}`)}function Vl(t){if(ha(null!==t,`Unknown LossOrMetricFn ${t}`),"string"==typeof t)return t;{let e;for(const n of Object.keys(El))if(El[n]===t){e=n;break}if(void 0!==e)return e;for(const n of Object.keys(Kl))if(Kl[n]===t){e=n;break}return void 0!==e?e:t.name}}function ql(t,e,n=!1){if(null==t||"object"!=typeof t||Object.getPrototypeOf(t)!==Object.prototype||!Gl(t))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(t);n.length>1048576&&console.warn(`User-defined metadata of model "${e}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function Gl(t){if(null===t)return!0;if("object"==typeof t){if(Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);for(const n of e){if("string"!=typeof n)return!1;if(!Gl(t[n]))return!1}return!0}if(Array.isArray(t)){for(const e of t)if(!Gl(e))return!1;return!0}return!1}{const e=typeof t;return"string"===e||"number"===e||"boolean"===e}}function Hl(t,e,n,s=console.log){const i=function(t){let e=!0;const n=[],s=[];for(const e in t.nodesByDepth)n.push(t.nodesByDepth[e]);for(const t of n){if(t.length>1||1===t.length&&t[0].inboundLayers.length>1){e=!1;break}s.push(...t)}if(e)for(const n of t.layers){let t=!1;for(const i of n.inboundNodes)if(-1!==s.indexOf(i)){if(t){e=!1;break}t=!0}if(!e)break}return e}(t),r=["Layer (type)","Output shape","Param #"];let a;if(i?(e=e||65,n=n||[.45,.85,1]):(e=e||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map((t=>Math.floor(e*t)))),!i){r.push("Receives inputs"),a=[];for(const e in t.nodesByDepth)a.push(...t.nodesByDepth[e])}s("_".repeat(e)),Jl(r,n,s),s("=".repeat(e));const o=t.layers;for(let t=0;t0&&(s=s.slice(0,s.length-1)+" "),s+=t[n],s=s.slice(0,e[n]),s+=" ".repeat(e[n]-s.length);n(s)}function Zl(t,e,n){let s;try{s=JSON.stringify(t.outputShape)}catch(t){s="multiple"}Jl([`${t.name} (${t.getClassName()})`,s,t.countParams().toString()],e,n)}function Xl(t,e,n,s){let i;try{i=JSON.stringify(t.outputShape)}catch(t){i="multiple"}const r=[];for(const e of t.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(e)))for(let t=0;tt.name)),u=[],h=n.names();for(const t of l)-1!==h.indexOf(t)?u.push(n.getValue(t)):u.push(null);null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);const c=l.join(",")+"|"+n.names().join(",");let p,d;if(null==su[c]){const t=function(t,n){e.assert(null!=t&&t.length>0,(()=>"Expected at least one fetch, got none"));let s=[],i={};if(1===t.length){const e=ou(t[0],n);s=e.sorted,i=e.recipientMap}else{const e=new Set;for(const r of t){const{sorted:t,recipientMap:a}=ou(r,n);for(const n of t)e.has(n.name)||(s.push(n),e.add(n.name));for(const t in a)null==i[t]&&(i[t]=new Set),a[t].forEach((e=>i[t].add(e)))}}return{sorted:s,recipientCounts:au(i)}}(o,n);p=t.sorted,d=t.recipientCounts,su[c]=p,iu[c]=d}p=su[c],d={},r||Object.assign(d,iu[c]);const f=new nu(n);for(let t=0;ti.maxNumTensors&&(i.maxNumTensors=t),t0;){const t=r[r.length-1];if(n.has(t.name)){r.pop();continue}const e=a[a.length-1]===r.length-1;if(0===t.inputs.length||e)r.pop(),s.push(t),n.add(t.name),e&&a.pop();else{a.push(r.length-1);for(const e of t.inputs)null==i[e.name]&&(i[e.name]=new Set),i[e.name].add(t.name),n.has(e.name)||r.push(e)}}return{sorted:s,recipientMap:i}}function lu(t){let e;if(1===t.sourceLayer.inboundNodes.length)e=t.sourceLayer.output;else{let n=null;for(let e=0;et.name))}`);xa(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map((t=>t.name))}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const t of this.outputs){const e=t.sourceLayer,n=t.nodeIndex,s=t.tensorIndex;this.outputLayers.push(e),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const t of this.inputs){const e=t.sourceLayer,n=t.nodeIndex,s=t.tensorIndex;ha(0===n,"input layer has >1 nodes"),ha(0===s,"input layer has >1 tensors"),this.inputLayers.push(e),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let e=0;et.shape)),this.internalOutputShapes=this.outputs.map((t=>t.shape));const e={},n={},s={},i={},r={},a=[],o=(t,e,n,s,i,l)=>{null!=s&&null!=i&&null!=l||(s=t.sourceLayer,i=t.nodeIndex,l=t.tensorIndex);const u=s.inboundNodes[i];if(-1!==n.indexOf(u))throw new ra(`The tensor ${t.name} at layer "${s.name}" is part of a cycle.`);if(-1!==e.indexOf(u))return;this.containerNodes.add(uu.nodeKey(s,i)),s.id in r||(r[s.id]=Object.keys(r).length),-1===n.indexOf(u)&&n.push(u);const h=u.inboundLayers.length;for(let t=0;t=0;)n.splice(n.indexOf(u),1);a.push(u)},l=[],u=[];for(const t of this.outputs)o(t,l,u);const h=a.slice().reverse();for(const t of h){n[t.id]=t,t.id in e||(e[t.id]=0);let r=e[t.id];const a=null==s[t.outboundLayer.id]?0:s[t.outboundLayer.id];r=Math.max(r,a),s[t.outboundLayer.id]=r,i[t.outboundLayer.id]=t.outboundLayer,e[t.id]=r;for(let s=0;sparseInt(t,10))).sort(ka);this.layers=[];for(const t of d){const e=p[t];e.sort(((t,e)=>{const n=r[t.id],s=r[e.id];return ns?1:0}));for(const t of e)t instanceof uu&&this.internalContainerRefs.push(t),this.layers.push(t)}this.layersByDepth=p,d=Object.keys(c).map((t=>parseInt(t,10))).sort(ka);const f=this.inputs.slice(),g=[];for(const t of d)for(const e of c[t]){const t=e.outboundLayer;if(null!=t){for(const n of e.inputTensors)if(-1===f.indexOf(n))throw new ra(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${t.name}". The following previous layers were accessed without issue: ${g}`);for(const t of e.outputTensors)f.push(t);g.push(t.name)}}this.nodesByDepth=c;const m=this.layers.map((t=>t.name));for(const t of m){const e=m.filter((e=>e===t)).length;if(1!==e)throw new ra(`The name "${t}" is used ${e} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(m))}this.outboundNodes=[],this.inboundNodes=[],new al({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((t=>null)),outputMasks:this.outputs.map((t=>null)),inputShapes:this.inputs.map((t=>t.shape)),outputShapes:this.outputs.map((t=>t.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const t={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const e of this.layers)t.numDisposedVariables+=e.dispose().numDisposedVariables;for(const e of this.internalContainerRefs)t.numDisposedVariables+=e.dispose().numDisposedVariables}return t.refCountAfterDispose=this._refCount,t}get trainable(){return this.trainable_}set trainable(t){this.layers.forEach((e=>{e._trainableWeights.forEach((e=>e.trainable=t))})),this.trainable_=t}get trainableWeights(){if(this._trainableWeights.length>0)throw new aa("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let t=[];for(const e of this.layers)t=t.concat(e.trainableWeights);return t}get nonTrainableWeights(){const t=[];for(const e of this.layers)t.push(...e.nonTrainableWeights);if(!this.trainable){const e=[];for(const t of this.layers)e.push(...t.trainableWeights);return e.concat(t)}return t}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(t,e=!0){const n={};let s=0;for(const t of this.layers)for(const e of t.weights){if(null!=n[e.originalName])throw new aa(`Duplicate weight name: ${e.originalName}`);n[e.originalName]=e,s++}const i=[];for(const s in t){let r=s;if(null==n[s]){const t=s.split("/");r=t.slice(0,-2).concat([t[t.length-1]]).join("/")}if(null!=n[r])i.push([n[r],t[s]]);else if(e)throw new aa(`Provided weight data has no target variable: ${s}`);delete n[r]}if(e){const t=[];for(const e in n)t.push(e);if(t.length>0)throw new aa(`${t.length} of ${s} weights are not set: ${t}`)}nl(i)}updatedConfig(){const t=this.getConfig(),e={};return e.className=this.getClassName(),e.config=t,e.kerasVersion="tfjs-layers 3.6.0",e.backend="TensorFlow.js",e}toJSON(t,e=!0){const n=tu(this.updatedConfig());return e?JSON.stringify(n):n}call(t,e){return s((()=>{t=da(t);const n=new nu;for(let e=0;e{let n;return t=da(t),n=null==e?ua(null,t.length):da(e),this.runInternalGraph(t,n)[1]}))}computeOutputShape(t){const e=Zo(t);if(e.length!==this.inputLayers.length)throw new aa(`Invalid inputShape argument ${t}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let t=0;tparseInt(t,10))).sort(ka);if(s.length>1)for(const t of s){const e=this.nodesByDepth[t];for(const t of e){const e=t.outboundLayer;if(-1!==this.inputLayers.map((t=>t.id)).indexOf(e.id))continue;const s=[];for(let e=0;eparseInt(t,10))).sort(ka);for(const t of s){const e=this.nodesByDepth[t];for(const t of e){const e=t.outboundLayer,s=t.inputTensors,i=t.outputTensors,r=new Array;for(const t of s)t.id in n&&r.push(n[t.id]);if(r.length===s.length){let s,a,o,l,u={};if(null!=t.callArgs&&(u=t.callArgs),1===r.length){const[t,n]=r[0];null==u.mask&&(u.mask=n),o=da(e.call(t,u)),l=da(e.computeMask(t,n)),s=[t],a=[n]}else s=r.map((t=>t[0])),a=r.map((t=>t[1])),null==u.mask&&(u.mask=a),o=da(e.call(s,u)),l=da(e.computeMask(s,a));if(e.activityRegularizer)throw new oa("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let t=0;t{const t=[];for(const e of this.layers)for(let n=0;n0){const t=[];for(let n=0;n0&&t.apply(pa(n),s)}function l(t){const n=t.name,r=Sl(t,null!=e.customObjects?e.customObjects:{});r.setFastWeightInitDuringBuild(s),i[n]=r;t.inboundNodes.forEach((t=>{if(!(t instanceof Array))throw new aa(`Corrupted configuration, expected array for nodeData: ${t}`);a(r,t)}))}const u=e.name,h=e.layers;for(const t of h)l(t);for(;!va(r);)for(const t of h){const e=i[t.name];if(e.name in r){const t=r[e.name];delete r[e.name];for(const n of t)o(e,n)}}const c=[],p=[],d=e.inputLayers;for(const t of d){const e=t[0],n=t[1],s=t[2];ha(e in i);const r=i[e].inboundNodes[n].outputTensors;c.push(r[s])}const f=e.outputLayers;for(const t of f){const e=t[0],n=t[1],s=t[2];ha(e in i);const r=i[e].inboundNodes[n].outputTensors;p.push(r[s])}return new t({inputs:c,outputs:p,name:u})}get stateful(){if(this._stateful)throw new aa("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const t of this.layers)if(t.stateful)return!0;return!1}resetStates(){s((()=>{this.layers.forEach((t=>{t.stateful&&t.resetStates()}))}))}}function hu(t,e){return function(t,e,n){const s=e.length;if(null==t||Array.isArray(t)&&0===t.length)return e.map((t=>null));if(1===s)return Array.isArray(t)&&1===t.length?t:"object"==typeof t&&e[0]in t?[t[e[0]]]:[t];if(Array.isArray(t)){if(t.length!==s)throw new Error(`Provided ${n} is an array of ${t.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return t}if("object"==typeof t&&Object.keys(t).length>0&&"object"==typeof t[Object.keys(t)[0]]){const n=[];return e.forEach((e=>{e in t?n.push(t[e]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${e} keys. Provided ${n} not understood: ${JSON.stringify(t)}`)}(t,e,"classWeight")}async function cu(t,e,n,i){if(null!=e||null!=i)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const e=s((()=>{if(1===t.shape.length)return t.clone();if(2===t.shape.length){if(t.shape[1]>1){const e=1;return t.argMax(e)}if(1===t.shape[1])return t.reshape([t.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${t.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${t.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),i=Array.from(await e.data());B(e);const r=[];return i.forEach((t=>{if(null==n[t])throw new Error(`classWeight must contain all classes in the training data. The class ${t} exists in the data but not in classWeight`);r.push(n[t])})),p(r,"float32")}return null}function pu(t,e){return a(t,e)}function du(t,n){let s,i;const r=n;s=r.xs,i=r.ys,e.assert(null!=s&&null!=i,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${n}`));const a=fu("input",t.inputNames,s),o=fu("output",t.outputNames,i),l=a[0].shape[0];e.assert(a.length===t.inputs.length,(()=>`LayersModel has ${t.inputs.length} inputs, but the dataset provides ${a.length} inputs. (Expected input keys: ${JSON.stringify(t.inputNames)})`)),e.assert(o.length===t.outputs.length,(()=>`LayersModel has ${t.outputs.length} outputs, but the dataset provides ${o.length} outputs. (Expected output keys: ${JSON.stringify(t.outputNames)})`));for(let n=0;n`Batch size mismatch: input ${t.inputNames[n]} has ${a[n].shape[0]}; expected ${l} based on input ${t.inputNames[0]}.`));for(let n=0;n`Batch size mismatch: output ${t.outputNames[n]} has ${o[n].shape[0]}; expected ${l} based on input ${t.inputNames[0]}.`));return{xs:a,ys:o}}function fu(t,n,s){if(s instanceof ot)return[s];if(Array.isArray(s))return e.assert(s.length===n.length,(()=>`Received an array of ${s.length} Tensors, but expected ${n.length} to match the ${t} keys ${n}.`)),s;{const e=[];for(const i of n){if(null==s[i])throw new aa(`The feature data generated by the dataset lacks the required ${t} key '${i}'.`);e.push(s[i])}return e}}async function gu(t,n,s){const i=null!=s.batchesPerEpoch;if(e.assert(null!=t.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),e.assert(null!=s,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),e.assert(null!=s.epochs&&s.epochs>0&&Number.isInteger(s.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${s.epochs}`)),e.assert(!i||s.batchesPerEpoch>0&&Number.isInteger(s.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${s.batchesPerEpoch}`)),e.assert(null==s.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");t.isTraining=!0;try{const r=null!=s.validationData;let a,o;if(r)if(mu(s.validationData))e.assert(null==s.validationBatches||s.validationBatches>0&&Number.isInteger(s.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${s.validationBatches}`));else{const t=function(t){if(3===t.length)throw new oa("Validation with sample weights is not implemented yet.");return{xs:t[0],ys:t[1]}}(s.validationData);a=t.xs,o=t.ys}const l=t.makeTrainFunction(),u=t.getDedupedMetricsNames();let h;h=r?u.slice().concat(u.map((t=>"val_"+t))):u.slice();const c=kl(s.callbacks,s.yieldEvery),p=null==s.verbose?1:s.verbose,{callbackList:d,history:f}=vl(c,p,s.epochs,null,null,function(t,e){let n=null;null!=e.batchesPerEpoch?n=e.batchesPerEpoch:Number.isFinite(t.size)&&(n=t.size);return n}(n,s),null,r,h);d.setModel(t),t.history=f,await d.onTrainBegin(),t.stopTraining_=!1;let g=null==s.initialEpoch?0:s.initialEpoch,m=await n.iterator();for(;g=s.batchesPerEpoch:n.done){if(r){let n;n=mu(s.validationData)?da(await t.evaluateDataset(s.validationData,{batches:s.validationBatches})):da(t.evaluate(a,o,{batchSize:null==s.validationBatchSize?32:s.validationBatchSize,verbose:0}));for(let s=0;s0&&Number.isInteger(t),(()=>`batchSize is required to be a positive integer, but got ${t}`))}function bu(t,e,n){return null==t?[null]:Array.isArray(t)?t.map((t=>oo(t,e,n-e))):oo(t,e,n-e)}function wu(t,e){return s((()=>null==t?null:Array.isArray(t)?t.map((t=>wu(t,e))):mo(t,"int32"===e.dtype?e:e.toInt())))}function ku(t,e){const n=[];let s=0,i=null;for(;s=t&&(i=t),n.push([s,i]),s=i;return n}async function xu(t,n,i,r={}){if(t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");let a,o,l,u,h,c,d;t.isTraining=!0;try{const f=null==r.batchSize?32:r.batchSize;yu(f);const g=!1,m=await t.standardizeUserData(n,i,r.sampleWeight,r.classWeight,g,f);a=m[0],o=m[1],d=m[2];let y,b=!1;if(null!=r.validationData&&r.validationData.length>0){if(b=!0,2!==r.validationData.length)throw 3===r.validationData.length?new oa("validationData including sample weights is not supported yet."):new aa(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${r.validationData} is invalid.`);l=r.validationData[0],u=r.validationData[1];const e=!0,n=await t.standardizeUserData(l,u,null,null,e,f);h=n[0],c=n[1],y=h.concat(c)}else if(null!=r.validationSplit&&r.validationSplit>0&&r.validationSplit<1){b=!0;const t=Math.floor(a[0].shape[0]*(1-r.validationSplit)),e=a[0].shape[0];h=bu(a,t,e),a=bu(a,0,t),c=bu(o,t,e),o=bu(o,0,t),y=h.concat(c)}else null!=r.validationSteps&&(b=!0);const w=a.concat(o).concat(d);t.checkTrainableWeightsConsistency();const k=t.makeTrainFunction(),x=t.getDedupedMetricsNames();let v,S;b?(t.makeTestFunction(),v=t.testFunction,S=x.slice().concat(x.map((t=>"val_"+t)))):(v=null,y=[],S=x.slice());const I=kl(r.callbacks,r.yieldEvery);return await async function(t,n,i,r,a,o,l,u,h,c,d,f,g,m,y){null==a&&(a=32),null==o&&(o=1),null==d&&(d=!0),null==g&&(g=0);let b=!1;if(null!=h&&null!=c&&(b=!0),null!=y&&(b=!0,null==m))throw new aa("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const w=t.checkNumSamples(i,a,m,"steps_per_epoch");let k;null!=w&&(k=io(0,w)),null==l&&(l=1);const{callbackList:x,history:v}=vl(u,l,o,g,w,m,a,b,f);x.setModel(t),t.history=v,await x.onTrainBegin(),t.stopTraining_=!1;for(let l=g;l{const s=u[e][0],d=u[e][1],f=oo(l,s,d-s);p.batch=e,p.size=d-s;const g=wu(i,f),m=n(g);for(let t=0;tn.push(t.id)));else if(null!=e)for(const t in e){const s=e[t];n.push(s.id)}const s=[];if(t instanceof ot)-1===n.indexOf(t.id)&&s.push(t);else if(Array.isArray(t))t.forEach((t=>{-1===n.indexOf(t.id)&&s.push(t)}));else if(null!=t)for(const e in t){const i=t[e];-1===n.indexOf(i.id)&&s.push(i)}s.forEach((t=>{t.isDisposed||t.dispose()}))}function Iu(t){return Array.isArray(t)}function Nu(t){return!function(t){return t instanceof ot}(t)&&!Iu(t)}function Au(t,e,n,s=!0,i=""){if(null==e||0===e.length){if(null!=t){let e=!1;if(Iu(t)&&t.length>0)e=!0;else if(Nu(t)){for(const n in t)if(t.hasOwnProperty(n)){e=!0;break}}else e=!0;if(e)throw new aa(`Error when checking model ${i} expected no data, but got ${t}`)}return[]}if(null==t)return e.map((t=>null));let r;if(Nu(t)){t=t,r=[];for(const n of e){if(null==t[n])throw new aa(`No data provided for "${n}". Need data for each key in: ${e}`);r.push(t[n])}}else if(Iu(t)){if((t=t).length!==e.length)throw new aa(`Error when checking model ${i}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${e.length} Tensor(s), but instead got the following list of Tensor(s): ${t}`);r=t}else{if(t=t,e.length>1)throw new aa(`The model ${i} expects ${e.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${t.shape}`);r=[t]}if(r=vu(r),null!=n)for(let t=0;t=0&&o!==l)throw new aa(`Error when checking ${i}: expected ${e[t]} to have shape [${n[t]}], but got array with shape [${a.shape}].`)}}return r}function Cu(t,e,n,s=!0,i=""){let r;if(Array.isArray(t)){if(t.length!==e.length)throw new aa(`Error when checking model ${i}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${e.length} Tensor(s), but instead got ${t.length} Tensors(s).`);r=t}else{if(e.length>1)throw new aa(`The model expects ${e.length} ${i} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(t.shape)}.`);r=[t]}if(null!=n)for(let t=0;tit.adagrad(.01),Adadelta:()=>it.adadelta(1,.95,sa()),Adam:()=>it.adam(.001,.9,.999,sa()),Adamax:()=>it.adamax(.002,.9,.999,sa(),0),RMSProp:()=>it.rmsprop(.001,.9,0,sa()),SGD:()=>it.sgd(.01)};if(e.adagrad=e.Adagrad,e.adadelta=e.Adadelta,e.adam=e.Adam,e.adamax=e.Adamax,e.rmsprop=e.RMSProp,e.sgd=e.SGD,t in e)return e[t]();throw new aa(`Unknown Optimizer ${t}`)}(t.optimizer),this.isOptimizerOwned=!0;else{if(!(t.optimizer instanceof lt))throw new aa("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=t.optimizer,this.isOptimizerOwned=!1}let e=[];if(Array.isArray(t.loss)||"string"==typeof t.loss||"function"==typeof t.loss)if(Array.isArray(t.loss)){if(t.loss.length!==this.outputs.length)throw new aa(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${t.loss}.`);const n=t.loss;e=n.map((t=>Fl(t)))}else{const n=Fl(t.loss);this.outputs.forEach((t=>{e.push(n)}))}else{t.loss=t.loss;for(const e in t.loss)if(-1===this.outputNames.indexOf(e))throw new aa(`Unknown entry in loss dictionary: "${e}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)null==t.loss[n]&&console.warn(`Output "${n}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${n} during training`),e.push(Fl(t.loss[n]))}this.lossFunctions=e,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let t=0;t{for(let t=0;t1&&(this.metricsTensors.push([e,t]),this.metricsNames.push(this.outputNames[t]+"_loss"))}}));const s=function(t,e){if(null==t||Array.isArray(t)&&0===t.length)return e.map((t=>[]));let n;if("string"==typeof t||"function"==typeof t)n=[t];else{if(!Array.isArray(t)&&"object"!=typeof t)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${t}`);n=t}if(Array.isArray(n))return e.map((t=>n));{const t=[];for(const s of e){let e=n.hasOwnProperty(s)?n[s]:[];Array.isArray(e)||(e=[e]),t.push(e)}return t}}(t.metrics,this.outputNames),i=(t,e,n)=>{this.outputNames.length>1&&(e=this.outputNames[t]+"_"+e),this.metricsNames.push(e),this.metricsTensors.push([n,t])};Ja("metric",(()=>{for(let t=0;t{let n,s,r;for(const a of e){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const e=this.internalOutputShapes[t];let i;1===e[e.length-1]||this.lossFunctions[t]===$l?-1!==["accuracy","acc"].indexOf(a)?s=Ll:-1!==["crossentropy","ce"].indexOf(a)&&(s=Bl):this.lossFunctions[t]===Dl?-1!==["accuracy","acc"].indexOf(a)?s=Pl:-1!==["crossentropy","ce"].indexOf(a)&&(s=Ul):-1!==["accuracy","acc"].indexOf(a)?s=_l:-1!==["crossentropy","ce"].indexOf(a)&&(s=Wl),-1!==["accuracy","acc"].indexOf(a)?i="acc":-1!==["crossentropy","ce"].indexOf(a)&&(i="ce"),r=s,n=""+i}else{const t=jl(a);r=t,n=""+Vl(a)}let e;Ja(n,(()=>{e=r})),i(t,n,e)}})(s[t])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(t,e,n={}){const s=null==n.batchSize?32:n.batchSize;yu(s);const i=this.standardizeUserDataXY(t,e,!0,s);try{const r=i[0].concat(i[1]);this.makeTestFunction();const a=this.testFunction;return pa(this.testLoop(a,r,s,n.verbose,n.steps))}finally{Su(i[0],t),Su(i[1],e)}}async evaluateDataset(t,n){return this.makeTestFunction(),async function(t,n,i){const r=null!=(i=i||{}).batches,o=t.testFunction;let h=[];if(i.verbose>0)throw new oa("Verbose mode is not implemented yet.");e.assert(!r||i.batches>0&&Number.isInteger(i.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(i.batches)}`));const c="function"==typeof n.next?n:await n.iterator();let p=0,d=0;for(;!r||d{if(e.value){const{xs:n,ys:i}=du(t,e.value),r=n.concat(i),l=s((()=>o(r)));if(B(r),0===d)for(let t=0;tu(h[t],a(c,e)))),d>0&&B(n)}B(l),p+=c,++d}return h})),e.done){r&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${i.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let t=0;tt.name));for(let s=0;s0){const n=[];throw e.forEach(((e,s)=>{null==e&&n.push(t[s])})),new aa(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return e}predictLoop(t,e=32,n=!1){return s((()=>{const i=this.checkNumSamples(t);if(n)throw new oa("Verbose predictLoop() is not implemented yet.");const r=ku(i,e),a=this.outputs.map((t=>[]));for(let e=0;e{const n=r[e][0],s=r[e][1],i=bu(t,n,s),a=[];if(Array.isArray(i))for(let t=0;ta[e].push(t)))}return pa(a.map((t=>N(t,0))))}))}predict(t,e={}){const n=vu(t);Cu(n,this.inputNames,this.feedInputShapes,!1);try{const s=null==e.batchSize?32:e.batchSize;return yu(s),this.predictLoop(n,s)}finally{Su(n,t)}}predictOnBatch(t){Cu(t,this.inputNames,this.feedInputShapes,!0);const e=(Array.isArray(t)?t[0]:t).shape[0];return this.predictLoop(t,e)}standardizeUserDataXY(t,n,s=!0,i){if(null==this.optimizer_)throw new ra("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let t=0;tt.shape[0])));i.sort();const r=xa(n.map((t=>t.shape[0])));if(r.sort(),i.length>1)throw new aa(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((t=>t.shape)))}`);if(r.length>1)throw new aa(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(n.map((t=>t.shape)))}`);if(i.length>0&&r.length>0&&!e.arraysEqual(i,r))throw new aa(`Input Tensors should have the same number of samples as target Tensors. Found ${i[0]} input sample(s) and ${r[0]} target sample(s).`)}(t=Au(t,this.feedInputNames,this.feedInputShapes,!1,"input"),n=Au(n,this.feedOutputNames,r,!1,"target")),function(t,e,n){const s=[Nl,$l,zl];for(let i=0;i0&&t[0].shape[0]%i!=0)throw new aa(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${i}. Found: ${t[0].shape[0]} sample(s).`);return[t,n]}async standardizeUserData(t,e,n,s,i=!0,r){const[a,o]=this.standardizeUserDataXY(t,e,i,r);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const t=hu(s,this.outputNames);l=[];for(let e=0;e{const s=this.checkNumSamples(e,n,r,"steps"),o=[];if(i>0)throw new oa("Verbose mode is not implemented yet.");if(null!=r)throw new oa("steps mode in testLoop() is not implemented yet");{const i=ku(s,n),r=p(io(0,s));for(let n=0;n1){i+=`_${ca(t.slice(0,n),s)}`}e.push(i)}return e}makeTrainFunction(){return t=>{const e=[],n=t.slice(0,this.inputs.length),s=t.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=t.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),r=[],a=this.collectedTrainableWeights.map((t=>t.read()));return[this.optimizer_.minimize((()=>{const t=[];for(let e=0;e1&&t{l=u(l,t)})),l}),!0,a)].concat(r)}}makeTestFunction(){this.testFunction=t=>s((()=>{const e=[];let n;const s=t.slice(0,this.inputs.length),i=t.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=[];for(let t=0;tfa(t)))}else{const e=Object.keys(this.loss);t={};const n=this.loss;for(const s of e){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");t[s]=fa(n[s])}}return t}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[fa(Vl(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((t=>fa(Vl(t))));{const t={};for(const e in this.metrics)t[e]=fa(Vl(this.metrics[e]));return t}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(t){if(null!=t.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=t.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=t.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const e=Sl(Ql(t.optimizer_config));let n,s;if("string"==typeof t.loss)n=ga(t.loss);else if(Array.isArray(t.loss))n=t.loss.map((t=>ga(t)));else if(null!=t.loss){n={};for(const e in t.loss)n[e]=ga(t.loss[e])}if(Array.isArray(t.metrics))s=t.metrics.map((t=>ga(t)));else if(null!=t.metrics){s={};for(const e in t.metrics)s[e]=ga(t.metrics[e])}this.compile({loss:n,metrics:s,optimizer:e})}async save(t,e){if("string"==typeof t){const e=ut.getSaveHandlers(t);if(0===e.length)throw new aa(`Cannot find any save handlers for URL '${t}'`);if(e.length>1)throw new aa(`Found more than one (${e.length}) save handlers for URL '${t}'`);t=e[0]}if(null==t.save)throw new aa("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await ut.encodeWeights(this.getNamedWeights(e)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v3.6.0",convertedBy:null};if(null!=e&&e.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const t="optimizer",{data:e,specs:i}=await ut.encodeWeights(await this.optimizer.getWeights(),t);n.specs.push(...i),n.data=ut.concatenateArrayBuffers([n.data,e])}if(null!=this.userDefinedMetadata){const t=!0;ql(this.userDefinedMetadata,this.name,t),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,t.save(s)}setUserDefinedMetadata(t){ql(t,this.name),this.userDefinedMetadata=t}getUserDefinedMetadata(){return this.userDefinedMetadata}}zu.className="Model",n.registerClass(zu);class Du extends zu{}async function $u(t,e){if(null==e&&(e={}),"string"==typeof t){const n=ut.getLoadHandlers(t,e);if(0===n.length)n.push(ut.browserHTTPRequest(t,e));else if(n.length>1)throw new aa(`Found more than one (${n.length}) load handlers for URL '${t}'`);t=n[0]}return async function(t,e,n){null==n&&(n={});if(null==t.load)throw new aa("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const s=await t.load();let i=s.modelTopology;null!=i.model_config&&(i=i.model_config);const r=null==n.strict||n.strict,a=null!=s.weightData&&null!=s.weightSpecs&&r,o=Sl(Ql(i),e,a),l=s.trainingConfig;null!=l&&o.loadTrainingConfig(l);null!=s.userDefinedMetadata&&o.setUserDefinedMetadata(s.userDefinedMetadata);if(null!=s.weightData){if(null==s.weightSpecs)throw new aa("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:t,optimizerWeights:e}=function(t,e){const n=ut.decodeWeights(t,e),s={},i=[];return e.forEach((t=>{"optimizer"===t.group?i.push({name:t.name,tensor:n[t.name]}):s[t.name]=n[t.name]})),{modelWeights:s,optimizerWeights:i}}(s.weightData,s.weightSpecs);o.loadWeights(t,r),null!=o.optimizer&&e.length>0&&await o.optimizer.setWeights(e),B(t),B(e.map((t=>t.tensor)))}return o}(t,void 0,e)}Du.className="Functional",n.registerClass(Du);class Tu extends zu{constructor(t){if(super({inputs:[],outputs:[]}),t=t||{},this.trainable=!0,this.built=!1,this.name=null!=t.name?t.name:Ho("sequential_"),null!=t.layers)for(const e of t.layers)this.add(e)}checkShape(t){if(t.inboundNodes[0].outputTensors[0].shape.some((t=>t<0)))throw new aa(`Negative dimension size caused by adding layer ${t.name} with input shape [${t.inboundNodes[0].inputTensors[0].shape}]`)}add(t){const e=t instanceof Tu||t instanceof zu;let n;if(e){if(n=t,1!==n.outputs.length)throw new aa("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new aa("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===t.inboundNodes.length){if(null==t.batchInputShape)throw new aa("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const e=cl({batchShape:t.batchInputShape,dtype:t.dtype,name:t.name+"_input"});t.apply(e)}if(e)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==t.inboundNodes.length)throw new aa(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${t.name} which has ${t.inboundNodes.length} pre-existing inbound connections.`);if(1!==t.inboundNodes[0].outputTensors.length)throw new aa("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(t),this.outputs=[t.inboundNodes[0].outputTensors[0]],this.inputs=ul(this.outputs[0])}this.inboundNodes=[],new al({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:ua(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((t=>t.shape)),outputShapes:this.outputs[0].shape})}else{const e=t.apply(this.outputs[0]);if(Array.isArray(e))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(t),this.outputs=[e],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(t),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const t=this.layers.length-1;this.layers[t].outboundNodes=[],this.outputs=[this.layers[t].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(t,e){return null==this.model&&this.build(),this.model.call(t,e)}build(t){if(Yo(t),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new zu({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(t,e,n=console.log){this.built||this.build(),super.summary(t,e,n)}setWeights(t){null==this.model&&this.build(),this.model.setWeights(t)}evaluate(t,e,n={}){if(!this.built)throw new ra("The model needs to be compiled before being used.");return this.model.evaluate(t,e,n)}async evaluateDataset(t,e){if(!this.built)throw new ra("The model needs to be compiled before being used.");return this.model.evaluateDataset(t,e)}predict(t,e={}){return null==this.model&&this.build(),this.model.predict(t,e)}predictOnBatch(t){return null==this.model&&this.build(),this.model.predictOnBatch(t)}compile(t){this.build(),this.model.compile(t),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(t){this.model.optimizer=t}async fit(t,e,n={}){if(!this.built)throw new ra("The model needs to be compiled before being used.");return this.model.fit(t,e,n)}async fitDataset(t,e){if(!this.built)throw new ra("The model needs to be compiled before being used.");return this.model.fitDataset(t,e)}async trainOnBatch(t,e){return this.model.trainOnBatch(t,e)}static fromConfig(t,n,s={},i=!1){let r,a={};if(n instanceof Array){if(null==n[0].className||"Merge"===n[0].className)throw new aa("Legacy serialization format not supported yet.");r=n}else e.assert(null!=n.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=n.layers,delete n.layers,a=n;const o=new t(a);if(!(o instanceof Tu))throw new oa(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const t of r){const e=Sl(t,void 0,i);i&&e.setFastWeightInitDuringBuild(!0),o.add(e)}return o}set stopTraining(t){if(null==this.model)throw new aa("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=t}get stopTraining(){if(null==this.model)throw new aa("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const t=[];for(const e of this.layers){const n={};n.className=e.getClassName(),n.config=e.getConfig(),t.push(n)}return{name:this.name,layers:t}}}function Eu(t){return new zu(t)}function Fu(t){return new Tu(t)}function Lu(t,e){return null==e&&(e={}),$u(t,e)}function _u(t){return cl(t)}function Ru(t,e){xl.registerCallbackConstructor(t,e)}Tu.className="Sequential",n.registerClass(Tu);class Mu extends n.Serializable{getConfig(){return{}}}class Ou extends Mu{apply(t,e=1){return function(t,e=1){if(1!==e)throw new oa(`Support for alpha values other than 1 (${e}) is not implemented yet.`);return v(t)}(t,e)}}Ou.className="elu",n.registerClass(Ou);class Bu extends Mu{apply(t){return ht(t)}}Bu.className="selu",n.registerClass(Bu);class Pu extends Mu{apply(t){return h(t)}}Pu.className="relu",n.registerClass(Pu);class Wu extends Mu{apply(t){return s((()=>ct(6,h(t))))}}Wu.className="relu6",n.registerClass(Wu);class Uu extends Mu{apply(t){return t}}Uu.className="linear",n.registerClass(Uu);class Ku extends Mu{apply(t){return pt(t)}}Ku.className="sigmoid",n.registerClass(Ku);class ju extends Mu{apply(t){return function(t){return s((()=>{const e=u(.5,a(.2,t));return o(e,0,1)}))}(t)}}ju.className="hardSigmoid",n.registerClass(ju);class Vu extends Mu{apply(t){return X(t)}}Vu.className="softplus",n.registerClass(Vu);class qu extends Mu{apply(t){return function(t){return s((()=>l(t,S(t).add(1))))}(t)}}qu.className="softsign",n.registerClass(qu);class Gu extends Mu{apply(t){return dt(t)}}Gu.className="tanh",n.registerClass(Gu);class Hu extends Mu{apply(t,e=-1){return V(t,e)}}Hu.className="softmax",n.registerClass(Hu);class Ju extends Mu{apply(t,e=-1){return ft(t,e)}}Ju.className="logSoftmax",n.registerClass(Ju);class Zu extends Mu{apply(t,e=1){return s((()=>pt(t.mul(e)).mul(t)))}}Zu.className="swish",n.registerClass(Zu);class Xu extends Mu{apply(t){return s((()=>a(t,dt(X(t)))))}}function Yu(t){return t.getClassName()}function Qu(t,e={}){return wa(t,n.SerializationMap.getMap().classNameMap,e,"activation")}function th(t){if(null==t){const t={className:"linear",config:{}};return Qu(t)}if("string"==typeof t){const e={};return e.className=t,e.config={},Qu(e)}return t instanceof Mu?t:Qu(t)}function eh(t){if(null!=t&&"object"!=typeof t)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${t}`)}Xu.className="mish",n.registerClass(Xu);class nh extends n.Serializable{}class sh extends nh{constructor(t){super(),eh(t),this.l1=null==t||null==t.l1?.01:t.l1,this.l2=null==t||null==t.l2?.01:t.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(t){return s((()=>{let e=T([1]);return this.hasL1&&(e=u(e,r(a(this.l1,S(t))))),this.hasL2&&(e=u(e,r(a(this.l2,yo(t))))),e.asScalar()}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(t,e){return new t({l1:e.l1,l2:e.l2})}}sh.className="L1L2",n.registerClass(sh);const ih={l1l2:"L1L2"};function rh(t){return ya(t)}function ah(t,e={}){return wa(t,n.SerializationMap.getMap().classNameMap,e,"regularizer")}function oh(t){if(null==t)return null;if("string"==typeof t){return ah({className:t in ih?ih[t]:t,config:{}})}return t instanceof nh?t:ah(t)}class lh extends ll{constructor(t){super(null==t?{}:t),this.supportsMasking=!0,null!=t&&(this.maxValue=t.maxValue)}call(t,e){t=Xo(t);let n=h(t);return null!=this.maxValue&&(n=o(n,0,this.maxValue)),n}computeOutputShape(t){return t}getConfig(){const t={maxValue:this.maxValue},e=super.getConfig();return Object.assign(t,e),t}}lh.className="ReLU",n.registerClass(lh);class uh extends ll{constructor(t){super(null==t?{}:t),this.DEFAULT_ALPHA=.3,null==t&&(t={}),this.alpha=null==t.alpha?this.DEFAULT_ALPHA:t.alpha}call(t,e){const n=Xo(t);return gt(n,this.alpha)}computeOutputShape(t){return t}getConfig(){const t={alpha:this.alpha},e=super.getConfig();return Object.assign(t,e),t}}uh.className="LeakyReLU",n.registerClass(uh);class hh extends ll{constructor(t){if(super(null==t?{}:t),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==t&&(t={}),this.supportsMasking=!0,this.alphaInitializer=Ko(t.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=oh(t.alphaRegularizer),this.alphaConstraint=Ma(t.alphaConstraint),null==t.sharedAxes)this.sharedAxes=null;else if(Array.isArray(t.sharedAxes))this.sharedAxes=t.sharedAxes;else{if("number"!=typeof t.sharedAxes)throw new aa(`Expected sharedAxes to be a number or an array of numbers, but got ${t.sharedAxes}`);this.sharedAxes=[t.sharedAxes]}}build(t){const e=(t=Yo(t)).slice(1);if(null!=this.sharedAxes)for(const t of this.sharedAxes)e[t-1]=1;this.alpha=this.addWeight("alpha",e,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let e=1;e(Va(e),"channelsFirst"===e?yt(t,[0,2,3,1]):t)))}function bh(t,e){return s((()=>(Va(e),"channelsFirst"===e?yt(t,[0,2,3,4,1]):t)))}function wh(t,e,n,i=[1,1],r="valid",a,o,l=null){return s((()=>{if(null==a&&(a="channelsLast"),Va(a),3!==t.rank&&4!==t.rank)throw new aa(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${t.rank}.`);if(3!==e.rank&&4!==e.rank)throw new aa(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${t.rank}.`);let s=yh(t,a);if("causal"===r)throw new oa("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return s=A.conv2d({x:s,filter:e,strides:i,pad:"same"===r?"same":"valid",dilations:o,dataFormat:"NHWC",bias:n,activation:l}),"channelsFirst"===a&&(s=yt(s,[0,3,1,2])),s}))}dh.className="Softmax",n.registerClass(dh);class kh extends ll{constructor(t,e){if(super(e),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",kh.verifyArgs(e),this.rank=t,Na(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new oa(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=fh(e.kernelSize,t,"kernelSize"),this.strides=fh(null==e.strides?1:e.strides,t,"strides"),this.padding=null==e.padding?"valid":e.padding,qa(this.padding),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Va(this.dataFormat),this.activation=th(e.activation),this.useBias=null==e.useBias||e.useBias,this.biasInitializer=Ko(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Ma(e.biasConstraint),this.biasRegularizer=oh(e.biasRegularizer),this.activityRegularizer=oh(e.activityRegularizer),this.dilationRate=fh(null==e.dilationRate?1:e.dilationRate,t,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new aa(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new aa(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new aa(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(t){if(ha("kernelSize"in t,"required key 'kernelSize' not in config"),"number"!=typeof t.kernelSize&&!Ia(t.kernelSize,"number",1,3))throw new aa(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(t.kernelSize)}.`)}getConfig(){const t={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Yu(this.activation),useBias:this.useBias,biasInitializer:Uo(this.biasInitializer),biasRegularizer:rh(this.biasRegularizer),activityRegularizer:rh(this.activityRegularizer),biasConstraint:_a(this.biasConstraint)},e=super.getConfig();return Object.assign(t,e),t}}class xh extends kh{constructor(t,e){super(t,e),this.kernel=null,xh.verifyArgs(e),this.filters=e.filters,Na(this.filters,"filters"),this.kernelInitializer=Ko(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Ma(e.kernelConstraint),this.kernelRegularizer=oh(e.kernelRegularizer)}build(t){t=Yo(t);const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new aa(`The channel dimension of the input should be defined. Found ${t[e]}`);const n=t[e],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[e]:n}}],this.built=!0}call(t,e){return s((()=>{let e;t=Xo(t);const n=null==this.bias?null:this.bias.read(),i=Ca(this.activation.getClassName());if(null!=i&&2===this.rank)e=wh(t,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,i);else{if(1===this.rank)e=function(t,e,n,i=1,r="valid",a,o=1){return s((()=>{if(null==a&&(a="channelsLast"),Va(a),3!==t.shape.length)throw new aa(`The input of a conv1dWithBias operation should be 3, but is ${t.shape.length} instead.`);if(3!==e.shape.length)throw new aa(`The kernel for a conv1dWithBias operation should be 3, but is ${e.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new aa(`The bias for a conv1dWithBias operation should be 1, but is ${e.shape.length} instead`);if("channelsFirst"===a&&(t=yt(t,[0,2,1])),"causal"===r)throw new oa("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let s=kt(t,e,i,"same"===r?"same":"valid","NWC",o);return null!=n&&(s=wo(s,n)),s}))}(t,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)e=wh(t,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new oa("convolutions greater than 3D are not implemented yet.");e=function(t,e,n,i=[1,1,1],r="valid",a,o){return s((()=>{if(null==a&&(a="channelsLast"),Va(a),4!==t.rank&&5!==t.rank)throw new aa(`conv3dWithBias expects input to be of rank 4 or 5, but received ${t.rank}.`);if(4!==e.rank&&5!==e.rank)throw new aa(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${t.rank}.`);let s=bh(t,a);if("causal"===r)throw new oa("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return s=xt(s,e,i,"same"===r?"same":"valid","NDHWC",o),null!=n&&(s=wo(s,n)),"channelsFirst"===a&&(s=yt(s,[0,4,1,2,3])),s}))}(t,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(e=this.activation.apply(e))}return e}))}computeOutputShape(t){t=Yo(t);const e=[],n="channelsLast"===this.dataFormat?t.slice(1,t.length-1):t.slice(2);for(let t=0;t 0 but got ${JSON.stringify(t.filters)}`)}}class vh extends xh{constructor(t){super(2,t),vh.verifyArgs(t)}getConfig(){const t=super.getConfig();return delete t.rank,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&!Ia(t.kernelSize,"number",1,2))throw new aa(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(t.kernelSize)}.`)}}vh.className="Conv2D",n.registerClass(vh);class Sh extends xh{constructor(t){super(3,t),Sh.verifyArgs(t)}getConfig(){const t=super.getConfig();return delete t.rank,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&(!Array.isArray(t.kernelSize)||1!==t.kernelSize.length&&3!==t.kernelSize.length))throw new aa(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(t.kernelSize)}.`)}}Sh.className="Conv3D",n.registerClass(Sh);class Ih extends vh{constructor(t){if(super(t),this.inputSpec=[new sl({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new aa(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(t){if(4!==(t=Yo(t)).length)throw new aa("Input should have rank 4; Received input shape: "+JSON.stringify(t));const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new aa("The channel dimension of the inputs should be defined. Found `None`.");const n=t[e],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new sl({ndim:4,axes:{[e]:n}})],this.built=!0}call(t,e){return s((()=>{let e=Xo(t);if(4!==e.shape.length)throw new aa(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${e.shape.length}`);const n=e.shape,s=n[0];let i,r;"channelsFirst"===this.dataFormat?(i=2,r=3):(i=1,r=2);const a=n[i],o=n[r],l=this.kernelSize[0],u=this.kernelSize[1],h=this.strides[0],c=this.strides[1],p=[s,mh(a,h,l,this.padding),mh(o,c,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(e=yt(e,[0,2,3,1]));let d=bt(e,this.kernel.read(),p,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(d=yt(d,[0,3,1,2])),null!=this.bias&&(d=wo(d,this.bias.read(),this.dataFormat)),null!=this.activation&&(d=this.activation.apply(d)),d}))}computeOutputShape(t){const e=(t=Yo(t)).slice();let n,s,i;"channelsFirst"===this.dataFormat?(n=1,s=2,i=3):(n=3,s=1,i=2);const r=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return e[n]=this.filters,e[s]=mh(e[s],o,r,this.padding),e[i]=mh(e[i],l,a,this.padding),e}getConfig(){const t=super.getConfig();return delete t.dilationRate,t}}Ih.className="Conv2DTranspose",n.registerClass(Ih);class Nh extends Sh{constructor(t){if(super(t),this.inputSpec=[new sl({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new aa(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(t){if(5!==(t=Yo(t)).length)throw new aa("Input should have rank 5; Received input shape: "+JSON.stringify(t));const e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new aa("The channel dimension of the inputs should be defined. Found `None`.");const n=t[e],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new sl({ndim:5,axes:{[e]:n}})],this.built=!0}call(t,e){return s((()=>{let e=Xo(t);if(5!==e.shape.length)throw new aa(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${e.shape.length}`);const n=e.shape,s=n[0];let i,r,a;"channelsFirst"===this.dataFormat?(a=2,i=3,r=4):(a=1,i=2,r=3);const o=n[a],l=n[i],u=n[r],h=this.kernelSize[0],c=this.kernelSize[1],p=this.kernelSize[2],d=this.strides[0],f=this.strides[1],g=this.strides[2],m=[s,mh(o,d,h,this.padding),mh(l,f,c,this.padding),mh(u,g,p,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(e=yt(e,[0,2,3,4,1]));let y=wt(e,this.kernel.read(),m,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=yt(y,[0,4,1,2,3])),null!==this.bias&&(y=wo(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(t){const e=(t=Yo(t)).slice();let n,s,i,r;"channelsFirst"===this.dataFormat?(n=1,s=2,i=3,r=4):(n=4,s=1,i=2,r=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],h=this.strides[1],c=this.strides[2];return e[n]=this.filters,e[s]=mh(e[s],u,a,this.padding),e[i]=mh(e[i],h,o,this.padding),e[r]=mh(e[r],c,l,this.padding),e}getConfig(){const t=super.getConfig();return delete t.dilationRate,t}}Nh.className="Conv3DTranspose",n.registerClass(Nh);class Ah extends xh{constructor(t,e){if(super(t,e),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==e.filters)throw new aa("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=e.kernelInitializer||null!=e.kernelRegularizer||null!=e.kernelConstraint)throw new aa("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=e.padding&&"same"!==e.padding&&"valid"!==e.padding)throw new aa(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(e.padding)}`);this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Ko(e.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=oh(e.depthwiseRegularizer),this.depthwiseConstraint=Ma(e.depthwiseConstraint),this.pointwiseInitializer=Ko(e.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=oh(e.pointwiseRegularizer),this.pointwiseConstraint=Ma(e.pointwiseConstraint)}build(t){if((t=Yo(t)).length{let e;if(t=Xo(t),1===this.rank)throw new oa("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(t=yt(t,[0,2,3,1])),e=vt(t,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(e=wo(e,this.bias.read(),this.dataFormat)),null!=this.activation&&(e=this.activation.apply(e)),"channelsFirst"===this.dataFormat&&(e=yt(e,[0,3,1,2])),e}))}getConfig(){const t=super.getConfig();return delete t.rank,delete t.kernelInitializer,delete t.kernelRegularizer,delete t.kernelConstraint,t.depthwiseInitializer=Uo(this.depthwiseInitializer),t.pointwiseInitializer=Uo(this.pointwiseInitializer),t.depthwiseRegularizer=rh(this.depthwiseRegularizer),t.pointwiseRegularizer=rh(this.pointwiseRegularizer),t.depthwiseConstraint=_a(this.depthwiseConstraint),t.pointwiseConstraint=_a(this.pointwiseConstraint),t}}Ah.className="SeparableConv";class Ch extends Ah{constructor(t){super(2,t)}}Ch.className="SeparableConv2D",n.registerClass(Ch);class zh extends xh{constructor(t){super(1,t),zh.verifyArgs(t),this.inputSpec=[{ndim:3}]}getConfig(){const t=super.getConfig();return delete t.rank,delete t.dataFormat,t}static verifyArgs(t){if("number"!=typeof t.kernelSize&&!Ia(t.kernelSize,"number",1,1))throw new aa(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(t.kernelSize)}.`)}}zh.className="Conv1D",n.registerClass(zh);class Dh extends ll{constructor(t){super(t),"number"==typeof t.cropping?this.cropping=[[t.cropping,t.cropping],[t.cropping,t.cropping]]:"number"==typeof t.cropping[0]?this.cropping=[[t.cropping[0],t.cropping[0]],[t.cropping[1],t.cropping[1]]]:this.cropping=t.cropping,this.dataFormat=void 0===t.dataFormat?"channelsLast":t.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(t){return"channelsFirst"===this.dataFormat?[t[0],t[1],t[2]-this.cropping[0][0]-this.cropping[0][1],t[3]-this.cropping[1][0]-this.cropping[1][1]]:[t[0],t[1]-this.cropping[0][0]-this.cropping[0][1],t[2]-this.cropping[1][0]-this.cropping[1][1],t[3]]}call(t,e){return s((()=>{if(t=Xo(t),"channelsLast"===this.dataFormat){const e=uo(t,this.cropping[0][0],t.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return uo(e,this.cropping[1][0],t.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const e=uo(t,this.cropping[0][0],t.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return uo(e,this.cropping[1][0],t.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const t={cropping:this.cropping,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}Dh.className="Cropping2D",n.registerClass(Dh);class $h extends ll{constructor(t){var e;super(t),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==t.size?this.DEFAULT_SIZE:t.size,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Va(this.dataFormat),this.interpolation=null==t.interpolation?"nearest":t.interpolation,e=this.interpolation,Sa(Pa,"InterpolationFormat",e)}computeOutputShape(t){if("channelsFirst"===this.dataFormat){const e=null==t[2]?null:this.size[0]*t[2],n=null==t[3]?null:this.size[1]*t[3];return[t[0],t[1],e,n]}{const e=null==t[1]?null:this.size[0]*t[1],n=null==t[2]?null:this.size[1]*t[2];return[t[0],e,n,t[3]]}}call(t,e){return s((()=>{let e=Xo(t);const n=e.shape;if("channelsFirst"===this.dataFormat){e=yt(e,[0,2,3,1]);const t=this.size[0]*n[2],s=this.size[1]*n[3],i="nearest"===this.interpolation?e.resizeNearestNeighbor([t,s]):e.resizeBilinear([t,s]);return yt(i,[0,3,1,2])}{const t=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?e.resizeNearestNeighbor([t,s]):e.resizeBilinear([t,s])}}))}getConfig(){const t={size:this.size,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}$h.className="UpSampling2D",n.registerClass($h);class Th extends kh{constructor(t){super(2,t),this.depthwiseKernel=null,this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=Ko(t.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Ma(t.depthwiseConstraint),this.depthwiseRegularizer=oh(t.depthwiseRegularizer)}build(t){if((t=Yo(t)).length<4)throw new aa(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(t)}.`);const e="channelsFirst"===this.dataFormat?1:3;if(null==t[e]||t[e]<0)throw new aa(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${t[e]}).`);const n=t[e],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,e){return s((()=>{let e=function(t,e,n=[1,1],i="valid",r,a){return s((()=>{null==r&&(r="channelsLast"),Va(r);let s=yh(t,r);if(4!==t.rank)throw new aa(`Input for depthwiseConv2d is required to be 4-D, but is instead ${t.rank}-D`);if(4!==e.rank)throw new aa(`depthwiseKernel is required to be 4-D, but is instead ${e.rank}-D`);return s=St(s,e,n,"same"===i?"same":"valid","NHWC",a),"channelsFirst"===r&&(s=yt(s,[0,3,1,2])),s}))}(t=Xo(t),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(e=wo(e,this.bias.read(),this.dataFormat)),null!=this.activation&&(e=this.activation.apply(e)),e}))}computeOutputShape(t){t=Yo(t);const e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],s="channelsFirst"===this.dataFormat?t[1]*this.depthMultiplier:t[3]*this.depthMultiplier,i=gh(e,this.kernelSize[0],this.padding,this.strides[0]),r=gh(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[t[0],s,i,r]:[t[0],i,r,s]}getConfig(){const t=super.getConfig();return t.depthMultiplier=this.depthMultiplier,t.depthwiseInitializer=Uo(this.depthwiseInitializer),t.depthwiseRegularizer=rh(this.depthwiseRegularizer),t.depthwiseConstraint=_a(this.depthwiseRegularizer),t}}function Eh(t,e,n,s){if(Array.isArray(t)){if(null!=e||null!=n)throw new aa("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=t.slice(t.length-s,t.length),t=t.slice(0,t.length-s)),t.length>1&&(e=t.slice(1,t.length)),t=t[0]}function i(t){return null==t||Array.isArray(t)?t:[t]}return{inputs:t,initialState:e=i(e),constants:n=i(n)}}function Fh(t,e,n,i=!1,r,a,o=!1,l=!1){return s((()=>{const u=e.shape.length;if(u<3)throw new aa(`Input should be at least 3D, but is ${u}D.`);const h=[1,0].concat(io(2,u));if(e=yt(e,h),null!=a)throw new oa("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=r&&((r=r.asType("bool").asType("float32")).rank===u-1&&(r=It(r,-1)),r=yt(r,h)),i&&(e=Nt(e,0),null!=r&&(r=Nt(r,0)));const c=[];let p,d=n;const f=e.shape[0],g=At(e);let m,y;null!=r&&(m=At(r));for(let e=0;et(n,d)));if(null==r)p=i[0],d=i[1];else{const t=s((()=>{const t=m[e],n=Y(t).sub(t);return{output:i[0].mul(t).add(d[0].mul(n)),newStates:d.map(((e,s)=>i[1][s].mul(t).add(e.mul(n))))}}));p=t.output,d=t.newStates}l&&c.push(p)}if(l){y=Ct(c,1)}return[p,y,d]}))}Th.className="DepthwiseConv2D",n.registerClass(Th);class Lh extends ll{constructor(t){let e;if(super(t),null==t.cell)throw new aa("cell property is missing for the constructor of RNN.");if(e=Array.isArray(t.cell)?new Uh({cells:t.cell}):t.cell,null==e.stateSize)throw new aa("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=e,this.returnSequences=null!=t.returnSequences&&t.returnSequences,this.returnState=null!=t.returnState&&t.returnState,this.goBackwards=null!=t.goBackwards&&t.goBackwards,this._stateful=null!=t.stateful&&t.stateful,this.unroll=null!=t.unroll&&t.unroll,this.supportsMasking=!0,this.inputSpec=[new sl({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return io(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((t=>null))}return this.states_}setStates(t){this.states_=t}computeOutputShape(t){Jo(t)&&(t=t[0]),t=t;let e=this.cell.stateSize;Array.isArray(e)||(e=[e]);const n=e[0];let s;if(s=this.returnSequences?[t[0],t[1],n]:[t[0],n],this.returnState){const n=[];for(const s of e)n.push([t[0],s]);return[s].concat(n)}return s}computeMask(t,e){return s((()=>{Array.isArray(e)&&(e=e[0]);const t=this.returnSequences?e:null;if(this.returnState){const e=this.states.map((t=>null));return[t].concat(e)}return t}))}get states(){if(null==this.states_){const t=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,e=[];for(let n=0;nt.shape[t.shape.length-1])),r))throw new aa(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((t=>new sl({shape:[null,t]})));this.stateful&&this.resetStates()}resetStates(t,n=!1){s((()=>{if(!this.stateful)throw new ia("Cannot call resetStates() on an RNN Layer that is not stateful.");const s=this.inputSpec[0].shape[0];if(null==s)throw new aa("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((t=>T([s,t]))):this.states_=[T([s,this.cell.stateSize])];else if(null==t)B(this.states_),null!=this.keptStates&&(B(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((t=>T([s,t]))):this.states_[0]=T([s,this.cell.stateSize]);else{if(Array.isArray(t)||(t=[t]),t.length!==this.states_.length)throw new aa(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${t.length} state value(s). Input received: ${t}`);!0===n?this.keptStates.push(this.states_.slice()):B(this.states_);for(let n=0;nW(t.clone())))}))}apply(t,e){let n=null==e?null:e.initialState,s=null==e?null:e.constants;null==e&&(e={});const i=Eh(t,n,s,this.numConstants);t=i.inputs,n=i.initialState,s=i.constants;let r=[],a=[];if(null!=n){e.initialState=n,r=r.concat(n),this.stateSpec=[];for(const t of n)this.stateSpec.push(new sl({shape:t.shape}));a=a.concat(this.stateSpec)}null!=s&&(e.constants=s,r=r.concat(s),this.numConstants=s.length);if(r[0]instanceof il){const n=[t].concat(r),s=this.inputSpec.concat(a),i=this.inputSpec;this.inputSpec=s;const o=super.apply(n,e);return this.inputSpec=i,o}return super.apply(t,e)}call(t,e){return s((()=>{const n=null==e?null:e.mask,s=null==e?null:e.training;let i=null==e?null:e.initialState;t=Xo(t),null==i&&(i=this.stateful?this.states_:this.getInitialState(t));const r=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(i.length!==r)throw new aa(`RNN Layer has ${r} state(s) but was passed ${i.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const a={training:s},o=Fh(((t,e)=>{const n=this.cell.call([t].concat(e),a);return[n[0],n.slice(1)]}),t,i,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],h=o[2];this.stateful&&this.resetStates(h,s);const c=this.returnSequences?u:l;return this.returnState?[c].concat(h):c}))}getInitialState(t){return s((()=>{let e=T(t.shape);return e=r(e,[1,2]),e=ao(e),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((t=>t>1?po(e,[1,t]):e)):this.cell.stateSize>1?[po(e,[1,this.cell.stateSize])]:[e]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(t)}getConfig(){const t=super.getConfig(),e={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(e.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===Lh.className&&(e.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,t,e)}static fromConfig(t,e,n={}){const s=Sl(e.cell,n);return new t(Object.assign(e,{cell:s}))}}Lh.className="RNN",n.registerClass(Lh);class _h extends ll{}class Rh extends _h{constructor(t){super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=t.units,Na(this.units,"units"),this.activation=th(null==t.activation?this.DEFAULT_ACTIVATION:t.activation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=Ko(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ko(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ko(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=oh(t.kernelRegularizer),this.recurrentRegularizer=oh(t.recurrentRegularizer),this.biasRegularizer=oh(t.biasRegularizer),this.kernelConstraint=Ma(t.kernelConstraint),this.recurrentConstraint=Ma(t.recurrentConstraint),this.biasConstraint=Ma(t.biasConstraint),this.dropout=no([1,so([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=no([1,so([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){t=Yo(t),this.kernel=this.addWeight("kernel",[t[t.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,e){return s((()=>{if(2!==(t=t).length)throw new aa(`SimpleRNNCell expects 2 input Tensors, got ${t.length}.`);let n=t[1];t=t[0];const s=null!=e.training&&e.training;let i;0Y(t),rate:this.dropout,training:s})),0Y(n),rate:this.recurrentDropout,training:s}));const r=this.dropoutMask,o=this.recurrentDropoutMask;i=go(null!=r?a(t,r):t,this.kernel.read()),null!=this.bias&&(i=wo(i,this.bias.read())),null!=o&&(n=a(n,o));let l=u(i,go(n,this.recurrentKernel.read()));return null!=this.activation&&(l=this.activation.apply(l)),[l,l]}))}getConfig(){const t=super.getConfig(),e={units:this.units,activation:Yu(this.activation),useBias:this.useBias,kernelInitializer:Uo(this.kernelInitializer),recurrentInitializer:Uo(this.recurrentInitializer),biasInitializer:Uo(this.biasInitializer),kernelRegularizer:rh(this.kernelRegularizer),recurrentRegularizer:rh(this.recurrentRegularizer),biasRegularizer:rh(this.biasRegularizer),activityRegularizer:rh(this.activityRegularizer),kernelConstraint:_a(this.kernelConstraint),recurrentConstraint:_a(this.recurrentConstraint),biasConstraint:_a(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},t,e)}}Rh.className="SimpleRNNCell",n.registerClass(Rh);class Mh extends Lh{constructor(t){t.cell=new Rh(t),super(t)}call(t,e){return s((()=>{null!=this.cell.dropoutMask&&(B(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(B(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==e?null:e.mask,s=null==e?null:e.training,i=null==e?null:e.initialState;return super.call(t,{mask:n,training:s,initialState:i})}))}static fromConfig(t,e){return new t(e)}}Mh.className="SimpleRNN",n.registerClass(Mh);class Oh extends _h{constructor(t){if(super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",t.resetAfter)throw new aa("GRUCell does not support reset_after parameter set to true.");this.units=t.units,Na(this.units,"units"),this.activation=th(void 0===t.activation?this.DEFAULT_ACTIVATION:t.activation),this.recurrentActivation=th(void 0===t.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=Ko(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ko(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ko(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=oh(t.kernelRegularizer),this.recurrentRegularizer=oh(t.recurrentRegularizer),this.biasRegularizer=oh(t.biasRegularizer),this.kernelConstraint=Ma(t.kernelConstraint),this.recurrentConstraint=Ma(t.recurrentConstraint),this.biasConstraint=Ma(t.biasConstraint),this.dropout=no([1,so([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=no([1,so([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.implementation=t.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){const e=(t=Yo(t))[t.length-1];this.kernel=this.addWeight("kernel",[e,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(t,e){return s((()=>{if(2!==(t=t).length)throw new aa(`GRUCell expects 2 input Tensors (inputs, h, c), got ${t.length}.`);const n=null!=e.training&&e.training;let s=t[1];t=t[0],0Y(t),rate:this.dropout,training:n,count:3})),0Y(s),rate:this.recurrentDropout,training:n,count:3}));const i=this.dropoutMask,r=this.recurrentDropoutMask;let o,l,h;0{null!=this.cell.dropoutMask&&(B(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(B(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==e?null:e.mask,s=null==e?null:e.training,i=null==e?null:e.initialState;return super.call(t,{mask:n,training:s,initialState:i})}))}static fromConfig(t,e){return 0===e.implmentation&&(e.implementation=1),new t(e)}}Bh.className="GRU",n.registerClass(Bh);class Ph extends _h{constructor(t){super(t),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=t.units,Na(this.units,"units"),this.activation=th(void 0===t.activation?this.DEFAULT_ACTIVATION:t.activation),this.recurrentActivation=th(void 0===t.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),this.useBias=null==t.useBias||t.useBias,this.kernelInitializer=Ko(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Ko(t.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Ko(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=t.unitForgetBias,this.kernelRegularizer=oh(t.kernelRegularizer),this.recurrentRegularizer=oh(t.recurrentRegularizer),this.biasRegularizer=oh(t.biasRegularizer),this.kernelConstraint=Ma(t.kernelConstraint),this.recurrentConstraint=Ma(t.recurrentConstraint),this.biasConstraint=Ma(t.biasConstraint),this.dropout=no([1,so([0,null==t.dropout?0:t.dropout])]),this.recurrentDropout=no([1,so([0,null==t.recurrentDropout?0:t.recurrentDropout])]),this.implementation=t.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(t){var e;const n=(t=Yo(t))[t.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const t=this.biasInitializer,n=this.units;s=new((e=class extends Io{apply(e,s){const i=t.apply([n]),r=(new Ao).apply([n]),a=t.apply([2*n]);return co(co(i,r),a)}}).className="CustomInit",e)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(t,e){return s((()=>{const n=null!=e.training&&e.training;if(3!==(t=t).length)throw new aa(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${t.length}.`);let s=t[1];const i=t[2];t=t[0],0Y(t),rate:this.dropout,training:n,count:4})),0Y(s),rate:this.recurrentDropout,training:n,count:4}));const r=this.dropoutMask,o=this.recurrentDropoutMask;let l,h,c,p;0{null!=this.cell.dropoutMask&&(B(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(B(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==e?null:e.mask,s=null==e?null:e.training,i=null==e?null:e.initialState;return super.call(t,{mask:n,training:s,initialState:i})}))}static fromConfig(t,e){return 0===e.implmentation&&(e.implementation=1),new t(e)}}Wh.className="LSTM",n.registerClass(Wh);class Uh extends _h{constructor(t){super(t),this.cells=t.cells}get stateSize(){const t=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?t.push(...e.stateSize):t.push(e.stateSize);return t}call(t,e){return s((()=>{let n=(t=t).slice(1);const s=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?s.push(n.splice(0,t.stateSize.length)):s.push(n.splice(0,1));s.reverse();const i=[];let r;for(let a=0;a{Ja(`RNNCell_${s}`,(()=>{n.build(t),e=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,t=[t[0],e]}))})),this.built=!0}getConfig(){const t=super.getConfig(),e={cells:this.cells.map((t=>({className:t.getClassName(),config:t.getConfig()})))};return Object.assign({},t,e)}static fromConfig(t,e,n={}){const s=[];for(const t of e.cells)s.push(Sl(t,n));return new t({cells:s})}get trainableWeights(){if(!this.trainable)return[];const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t}get nonTrainableWeights(){const t=[];for(const e of this.cells)t.push(...e.nonTrainableWeights);if(!this.trainable){const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e.concat(t)}return t}getWeights(){const t=[];for(const e of this.cells)t.push(...e.weights);return el(t)}setWeights(t){const e=[];for(const n of this.cells){const s=n.weights.length,i=t.splice(s);for(let t=0;tko(e(),n),a=()=>xo(r,e,s);if(!i||i<=1)return W(a().clone());return Array(i).fill(void 0).map(a).map((t=>W(t.clone())))}Uh.className="StackedRNNCells",n.registerClass(Uh);class jh extends Lh{constructor(t){if(t.unroll)throw new oa("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(t.cell))throw new oa("It is not possible at the moment to stack convolutional cells.");super(t),this.inputSpec=[new sl({ndim:5})]}call(t,e){return s((()=>{if(null!=this.cell.dropoutMask&&(B(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(B(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),e&&e.constants)throw new aa("ConvRNN2D cell does not support constants");const n=null==e?null:e.mask,s=null==e?null:e.training,i=null==e?null:e.initialState;return super.call(t,{mask:n,training:s,initialState:i})}))}computeOutputShape(t){let e=this.computeSingleOutputShape(t);return this.returnSequences||(e=[e[0],...e.slice(2)]),this.returnState&&(e=[e,...Array(2).fill([t[0],...e.slice(-3)])]),e}getInitialState(t){return s((()=>{const{stateSize:e}=this.cell,n=t.shape,s=this.computeSingleOutputShape(n),i=[s[0],...s.slice(2)],r=T(i);return Array.isArray(e)?Array(e.length).fill(r):[r]}))}resetStates(t,n=!1){s((()=>{if(!this.stateful)throw new ia("Cannot call resetStates() on an RNN Layer that is not stateful.");const s=this.inputSpec[0].shape,i=this.computeSingleOutputShape(s),r=[i[0],...i.slice(2)];if(null==s[0])throw new aa("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>T(r))):this.states_=[T(r)];else if(null==t)B(this.states_),null!=this.keptStates&&(B(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>T(r))):this.states_[0]=T(r);else{if(Array.isArray(t)||(t=[t]),t.length!==this.states_.length)throw new aa(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${t.length} state value(s). Input received: ${t}`);n?this.keptStates.push(this.states_.slice()):B(this.states_);for(let n=0;nW(t.clone())))}))}computeSingleOutputShape(t){const{dataFormat:e,filters:n,kernelSize:s,padding:i,strides:r,dilationRate:a}=this.cell,o="channelsFirst"===e,l=t[o?3:2],u=t[o?4:3],h=gh(l,s[0],i,r[0],a[0]),c=gh(u,s[1],i,r[1],a[1]);return[...t.slice(0,2),...o?[n,h,c]:[h,c,n]]}}jh.className="ConvRNN2D";class Vh extends Ph{constructor(t){const{filters:e,kernelSize:n,strides:s,padding:i,dataFormat:r,dilationRate:a}=t;super(Object.assign({},t,{units:e})),this.filters=e,Na(this.filters,"filters"),this.kernelSize=fh(n,2,"kernelSize"),this.kernelSize.forEach((t=>Na(t,"kernelSize"))),this.strides=fh(s||1,2,"strides"),this.strides.forEach((t=>Na(t,"strides"))),this.padding=i||"valid",qa(this.padding),this.dataFormat=r||"channelsLast",Va(this.dataFormat),this.dilationRate=fh(a||1,2,"dilationRate"),this.dilationRate.forEach((t=>Na(t,"dilationRate")))}build(t){var e;t=Yo(t);const n="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[n])throw new aa(`The channel dimension of the input should be defined. Found ${t[n]}`);const s=t[n],i=this.kernelSize.concat([s,4*this.filters]);this.kernel=this.addWeight("kernel",i,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const r=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",r,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let t;if(this.unitForgetBias){const n=this.biasInitializer,s=this.filters;t=new((e=class extends Io{apply(t,e){return ho([n.apply([s]),E([s]),n.apply([2*s])])}}).className="CustomInit",e)}else t=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,t,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(t,e){return s((()=>{if(3!==t.length)throw new aa(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${t.length}.`);const n=e.training||!1,s=t[0],i=t[1],r=t[2];0Y(s),rate:this.dropout,training:n,count:4}));const o=this.dropoutMask,l=(t,e,n)=>e&&e[n]?a(e[n],t):t;let h=l(s,o,0),c=l(s,o,1),p=l(s,o,2),d=l(s,o,3);0Y(i),rate:this.recurrentDropout,training:n,count:4}));const f=this.recurrentDropoutMask;let g=l(i,f,0),m=l(i,f,1),y=l(i,f,2),b=l(i,f,3);const[w,k,x,v]=zt(this.kernel.read(),4,3),[S,I,N,A]=this.useBias?zt(this.bias.read(),4):[null,null,null,null];h=this.inputConv(h,w,S,this.padding),c=this.inputConv(c,k,I,this.padding),p=this.inputConv(p,x,N,this.padding),d=this.inputConv(d,v,A,this.padding);const[C,z,D,$]=zt(this.recurrentKernel.read(),4,3);g=this.recurrentConv(g,C),m=this.recurrentConv(m,z),y=this.recurrentConv(y,D),b=this.recurrentConv(b,$);const T=this.recurrentActivation.apply(u(h,g)),E=this.recurrentActivation.apply(u(c,m)),F=u(a(E,r),a(T,this.activation.apply(u(p,y)))),L=a(this.recurrentActivation.apply(u(d,b)),this.activation.apply(F));return[L,L,F]}))}getConfig(){const t=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(t);i{this.invokeCallHook(t,e);const n=Xo(t);if(0ko(n,this.rate,s,this.seed)),(()=>n),t)}return t}))}getConfig(){const t={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},e=super.getConfig();return Object.assign(t,e),t}dispose(){return super.dispose()}}Gh.className="Dropout",n.registerClass(Gh);class Hh extends Gh{constructor(t){super(t),this.inputSpec=[{ndim:3}]}getNoiseShape(t){const e=t.shape;return[e[0],1,e[2]]}}Hh.className="SpatialDropout1D",n.registerClass(Hh);class Jh extends ll{constructor(t){if(super(t),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==t.batchInputShape&&null==t.inputShape&&null!=t.inputDim){let e=null;null!=t.batchSize&&(e=t.batchSize),this.batchInputShape=[e,t.inputDim]}this.units=t.units,Na(this.units,"units"),this.activation=th(t.activation),null!=t.useBias&&(this.useBias=t.useBias),this.kernelInitializer=Ko(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Ko(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Ma(t.kernelConstraint),this.biasConstraint=Ma(t.biasConstraint),this.kernelRegularizer=oh(t.kernelRegularizer),this.biasRegularizer=oh(t.biasRegularizer),this.activityRegularizer=oh(t.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(t){const e=(t=Yo(t))[t.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[e,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:e}}],this.built=!0}computeOutputShape(t){const e=(t=Yo(t)).slice();return e[e.length-1]=this.units,e}call(t,e){return s((()=>{this.invokeCallHook(t,e);const n=Xo(t),s=Ca(this.activation.getClassName());let i;return null!=s?i=go(n,this.kernel.read(),s,this.bias?this.bias.read():null):(i=go(n,this.kernel.read()),null!=this.bias&&(i=wo(i,this.bias.read())),null!=this.activation&&(i=this.activation.apply(i))),i}))}getConfig(){const t={units:this.units,activation:Yu(this.activation),useBias:this.useBias,kernelInitializer:Uo(this.kernelInitializer),biasInitializer:Uo(this.biasInitializer),kernelRegularizer:rh(this.kernelRegularizer),biasRegularizer:rh(this.biasRegularizer),activityRegularizer:rh(this.activityRegularizer),kernelConstraint:_a(this.kernelConstraint),biasConstraint:_a(this.biasConstraint)},e=super.getConfig();return Object.assign(t,e),t}}Jh.className="Dense",n.registerClass(Jh);class Zh extends ll{constructor(t){super(t=t||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=t.dataFormat}computeOutputShape(t){t=Yo(t);for(const e of t.slice(1))if(null==e)throw new aa(`The shape of the input to "Flatten" is not fully defined (got ${t.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[t[0],to(t,1)]}call(t,e){return s((()=>{this.invokeCallHook(t,e);let n=Xo(t);if("channelsFirst"===this.dataFormat&&n.rank>1){const t=[0];for(let e=2;e{this.invokeCallHook(t,e);const n=Xo(t);return this.activation.apply(n)}))}getConfig(){const t={activation:Yu(this.activation)},e=super.getConfig();return Object.assign(t,e),t}}Xh.className="Activation",n.registerClass(Xh);class Yh extends ll{constructor(t){super(t),this.n=t.n,this.inputSpec=[{ndim:2}]}computeOutputShape(t){return[t[0],this.n,t[1]]}call(t,e){return s((()=>{return t=Xo(t),e=t,n=this.n,s((()=>{if(2!==e.shape.length)throw new aa(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);return po(ao(e,1),[1,n,1])}));var e,n}))}getConfig(){const t={n:this.n},e=super.getConfig();return Object.assign(t,e),t}}Yh.className="RepeatVector",n.registerClass(Yh);class Qh extends ll{constructor(t){super(t),this.targetShape=t.targetShape;for(let t=0;t{this.invokeCallHook(t,e);const n=Xo(t),s=n.shape,i=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return n.reshape(i)}))}getConfig(){const t={targetShape:this.targetShape},e=super.getConfig();return Object.assign(t,e),t}}Qh.className="Reshape",n.registerClass(Qh);class tc extends ll{constructor(t){if(super(t),null==t.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(t.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${t.dims} instead.`);const n=io(1,t.dims.length+1);if(!e.arraysEqual(t.dims.slice().sort(),n))throw new Error("Invalid permutation `dims`: "+JSON.stringify(t.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=t.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new sl({ndim:this.dims.length+1})]}computeOutputShape(t){const e=(t=Yo(t)).slice();return this.dims.forEach(((n,s)=>{e[s+1]=t[n]})),e}call(t,e){return yt(Xo(t),this.dimsIncludingBatch)}getConfig(){const t={dims:this.dims},e=super.getConfig();return Object.assign(t,e),t}}tc.className="Permute",n.registerClass(tc);class ec extends ll{constructor(t){super(null==t?{}:t),this.supportsMasking=!0,this.maskValue=null!=t?null==t.maskValue?0:t.maskValue:0}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={maskValue:this.maskValue};return Object.assign(e,t),e}computeMask(t,e){const n=Xo(t);return $t(Tt(n,this.maskValue),-1)}call(t,e){return s((()=>{this.invokeCallHook(t,e);const n=Xo(t),s=$t(Tt(n,this.maskValue),-1,!0);return n.mul(s.asType(n.dtype))}))}}ec.className="Masking",n.registerClass(ec);class nc extends ll{constructor(t){if(super(t),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==t.batchInputShape&&null==t.inputShape){let e=null;null!=t.batchSize&&(e=t.batchSize),null==t.inputLength?this.batchInputShape=[e,null]:this.batchInputShape=[e].concat(da(t.inputLength))}this.inputDim=t.inputDim,Na(this.inputDim,"inputDim"),this.outputDim=t.outputDim,Na(this.outputDim,"outputDim"),this.embeddingsInitializer=Ko(t.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=oh(t.embeddingsRegularizer),this.activityRegularizer=oh(t.activityRegularizer),this.embeddingsConstraint=Ma(t.embeddingsConstraint),this.maskZero=t.maskZero,this.supportsMasking=t.maskZero,this.inputLength=t.inputLength}build(t){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(t){}computeMask(t,e){return s((()=>this.maskZero?(t=Xo(t),Tt(t,Et(t))):null))}computeOutputShape(t){if(t=Yo(t),null==this.inputLength)return[...t,this.outputDim];const e=da(this.inputLength);if(e.length!==t.length-1)throw new aa(`"inputLength" is ${this.inputLength}, but received input shape has shape ${t}`);{let n=0;for(let s=0;s{this.invokeCallHook(t,e);let n=Xo(t);"int32"!==n.dtype&&(n=ro(n,"int32"));return mo(this.embeddings.read(),n.as1D()).reshape(Yo(this.computeOutputShape(n.shape)))}))}getConfig(){const t={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Uo(this.embeddingsInitializer),embeddingsRegularizer:rh(this.embeddingsRegularizer),activityRegularizer:rh(this.activityRegularizer),embeddingsConstraint:_a(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},e=super.getConfig();return Object.assign(t,e),t}}nc.className="Embedding",n.registerClass(nc);class sc extends ll{constructor(t){super(t||{}),this.supportsMasking=!0}mergeFunction(t){throw new oa}computeElementwiseOpOutputShape(t,e){if(null==t||null==e)return null;if(t.length1)throw new aa(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(t)}.`);let n=null==t[0]?null:t[0].slice(1);for(let e=1;et.length));-1===t.indexOf(null)&&1===xa(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(t,e){return s((()=>{if(t=t,this.reshapeRequired){const e=[],n=t.map((t=>t.rank));if(-1===n.indexOf(null)){const s=so(n);for(let n of t){const t=n.rank;for(let e=0;e1){const i=io(1,t).concat([0]);e.push(yt(s,i)),n=!0}else e.push(s)}let s=this.mergeFunction(e);const i=s.rank;if(n)if(null==i){const t=s.shape,e=t[t.length-1],n=[e].concat(t.slice(0,t.length-1));s=yt(s.reshape([-1,e]),[1,0]).reshape(n)}else if(i>1){const t=[i-1].concat(io(0,i-1));s=yt(s,t)}return s}}return this.mergeFunction(t)}))}computeOutputShape(t){let e;e=null==(t=t)[0]?null:t[0].slice(1);for(let n=1;n{if(null==e)return null;if(!Array.isArray(e))throw new aa("`mask` should be an Array");if(!Array.isArray(t))throw new aa("`inputs` should be an Array");if(e.length!==t.length)throw new aa(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${t.length} vs ${e.length})`);if(e.every((t=>null==t)))return null;let n=(e=e.map((t=>null==t?t:It(t,0))))[0];for(let t=1;t{let e=t[0].clone();for(let n=1;n{let e=t[0].clone();for(let n=1;n{let e=t[0].clone();for(let n=1;n{let e=t[0];for(let n=1;n{let e=t[0];for(let n=1;n1)throw new aa("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(t))}mergeFunction(t){return s((()=>ho(t,this.axis)))}computeOutputShape(t){if(!Array.isArray(t)||!Array.isArray(t[0]))throw new aa("A `Concatenate` layer should be called on a list of inputs.");const e=t,n=e[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const t of e.slice(1)){if(null==n[s]||null==t[s]){n[s]=null;break}n[s]+=t[s]}return n}computeMask(t,e){if(null==e)return null;if(!Array.isArray(e))throw new aa("`mask` should be an array for Concatenate");if(!Array.isArray(t))throw new aa("`inputs` should be an array for Concatenate");if(e.length!==t.length)throw new aa(`Mismatch in the length of mask (${e.length}) and the legnth of inputs (${t.length})`);return s((()=>{let n=!0;if(e.forEach((t=>{null==t||(n=!1)})),n)return null;const s=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs."));const n=t[0],s=t[1];if(n.length>3||s.length>3)throw new oa("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(n,s);if(n[i[0]]!==s[i[1]])throw new aa(`Dimension incompatibility: ${n[i[0]]} !== ${s[i[1]]}`)}mergeFunction(t){if(2!==t.length)throw new aa(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${t.length} input(s).`);let n,i=t[0],r=t[1];return n=Array.isArray(this.axes)?this.axes.map(((e,n)=>hc(e,t[n].shape.length))):[hc(this.axes,i.shape.length),hc(this.axes,r.shape.length)],this.normalize&&(i=Il(i,n[0]),r=Il(r,n[1])),function(t,n,i){if(t.shape.length>3||n.shape.length>3)throw new oa("batchDot is not implemented for tensors of 4D or higher rank yet");if(e.assert(t.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${t.shape.length}`)),e.assert(t.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${n.shape.length}`)),"number"==typeof i&&(i=[i,i]),"complex64"===t.dtype||"complex64"===n.dtype)throw new oa("batchDot is not implemented for complex64-type Tensors yet.");const r=t.shape.length,a=n.shape.length;null==i&&(i=[r-1,a-2]);const o=i;return s((()=>{let e,s;if(r>a){e=r-a;const t=[];for(let n=0;nr){e=a-r;const n=[];for(let t=0;t0){let t;t=r>a?r+a-3:r-1;const n=[];for(let s=t;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const n=t[0].slice(),s=t[1].slice();if(n.length>3||s.length>3)throw new oa("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(n,s);n.splice(i[0],1),s.splice(i[1],1),s.splice(0,1);const r=n.concat(s);return 1===r.length&&r.push(1),r}computeMask(t,e){return null}getConfig(){const t={axes:this.axes,normalize:this.normalize},e=super.getConfig();return Object.assign(t,e),t}}cc.className="Dot",n.registerClass(cc);class pc extends ll{constructor(t){super(t),this.supportsMasking=!0,this.stddev=t.stddev}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={stddev:this.stddev};return Object.assign(e,t),e}call(t,e){return s((()=>{this.invokeCallHook(t,e);const n=Xo(t);return xo((()=>fo(n.shape,0,this.stddev).add(n)),(()=>n),e.training||!1)}))}}pc.className="GaussianNoise",n.registerClass(pc);class dc extends ll{constructor(t){super(t),this.supportsMasking=!0,this.rate=t.rate}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={rate:this.rate};return Object.assign(e,t),e}call(t,e){return s((()=>{this.invokeCallHook(t,e);const n=Xo(t);if(this.rate>0&&this.rate<1){return xo((()=>{const t=Math.sqrt(this.rate/(1-this.rate));return n.mul(fo(n.shape,1,t))}),(()=>n),e.training||!1)}return n}))}}dc.className="GaussianDropout",n.registerClass(dc);class fc extends ll{constructor(t){super(t),this.supportsMasking=!0,this.rate=t.rate,this.noiseShape=t.noiseShape}_getNoiseShape(t){return this.noiseShape||Xo(t).shape}computeOutputShape(t){return t}getConfig(){const t=super.getConfig(),e={rate:this.rate};return Object.assign(e,t),e}call(t,e){return s((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(t);return xo((()=>{const e=Xo(t),s=-1.7580993408473766;let i=Lt(L(n),this.rate);i=ro(i,"float32");const r=((1-this.rate)*(1+this.rate*s**2))**-.5,a=-r*s*this.rate;return e.mul(i).add(i.add(-1).mul(s)).mul(r).add(a)}),(()=>Xo(t)),e.training||!1)}return t}))}}function gc(t,e,n,s,i,r=.001){let a;if(2===t.rank)a=Rt(t,e,n,s,i,r);else if(3===t.rank)a=Mt(t,e,n,s,i,r);else{if(4!==t.rank)throw new oa(`batchNormalization is not implemented for array of rank ${t.rank} yet`);a=Ot(t,e,n,s,i,r)}return a}function mc(t,n,i,r,a=.001){return e.arraysEqual(r.slice().sort(),io(0,t.rank-1))?function(t,e,n,i,r=.001){return s((()=>{const s=_t(t,i),a=s.mean,o=s.variance;return[gc(t,a,o,n,e,r),a,o]}))}(t,n,i,r,a):function(t,e,n,i,r=.001){return s((()=>{const s=_t(t,i),a=s.mean,o=s.variance,l=[];for(const e of io(0,t.rank))-1!==i.indexOf(e)?l.push(1):l.push(t.shape[e]);const u=a.reshape(l),h=o.reshape(l),c=null==e?null:e.reshape(l),p=null==n?null:n.reshape(l);return[gc(t,u,h,p,c,r),a,o]}))}(t,n,i,r,a)}fc.className="AlphaDropout",n.registerClass(fc);class yc extends ll{constructor(t){null==t&&(t={}),super(t),this.supportsMasking=!0,this.axis=null==t.axis?-1:t.axis,this.momentum=null==t.momentum?.99:t.momentum,this.epsilon=null==t.epsilon?.001:t.epsilon,this.center=null==t.center||t.center,this.scale=null==t.scale||t.scale,this.betaInitializer=Ko(t.betaInitializer||"zeros"),this.gammaInitializer=Ko(t.gammaInitializer||"ones"),this.movingMeanInitializer=Ko(t.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Ko(t.movingVarianceInitializer||"ones"),this.betaConstraint=Ma(t.betaConstraint),this.gammaConstraint=Ma(t.gammaConstraint),this.betaRegularizer=oh(t.betaRegularizer),this.gammaRegularizer=oh(t.gammaRegularizer)}build(t){t=Yo(t);const e=this.axis>=0?this.axis:this.axis+t.length,n=t[e];if(null==n)throw new aa(`Axis ${e} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(t)}.`);this.inputSpec=[new sl({ndim:t.length,axes:{[e]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(t,n){return s((()=>{const i=null!=n.training&&n.training,r=Xo(t),a=r.shape,o=a.length,l=io(0,o),u=this.axis>=0?this.axis:this.axis+o;l.splice(u,1);const h=ua(1,o);h[u]=a[u];const c=l.slice();c.sort();const p=!e.arraysEqual(c,io(0,o).slice(0,o-1));if(!i)return(()=>{if(p){const t=this.movingMean.read().reshape(h),e=this.movingVariance.read().reshape(h),n=this.center?this.beta.read().reshape(h):null,s=this.scale?this.gamma.read().reshape(h):null;return gc(r,t,e,n,s,this.epsilon)}return gc(r,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[d,f,g]=mc(r,this.gamma.read(),this.beta.read(),l,this.epsilon),m=(t,e,n)=>{s((()=>{const s=1-n,i=t.read(),r=i.sub(e).mul(s);t.write(i.sub(r))}))};return(()=>{m(this.movingMean,f,this.momentum),m(this.movingVariance,g,this.momentum)})(),d}))}getConfig(){const t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Uo(this.betaInitializer),gammaInitializer:Uo(this.gammaInitializer),movingMeanInitializer:Uo(this.movingMeanInitializer),movingVarianceInitializer:Uo(this.movingVarianceInitializer),betaRegularizer:rh(this.betaRegularizer),gammaRegularizer:rh(this.gammaRegularizer),betaConstraint:_a(this.betaConstraint),gammaConstraint:_a(this.gammaConstraint)},e=super.getConfig();return Object.assign(t,e),t}}yc.className="BatchNormalization",n.registerClass(yc);class bc extends ll{constructor(t){if(null==t&&(t={}),super(t),this.axis=null==t.axis?-1:t.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==t.epsilon?.001:t.epsilon,this.center=null==t.center||t.center,this.scale=null==t.scale||t.scale,this.betaInitializer=Ko(t.betaInitializer||"zeros"),this.gammaInitializer=Ko(t.gammaInitializer||"ones"),this.betaRegularizer=oh(t.betaRegularizer),this.gammaRegularizer=oh(t.gammaRegularizer),this.supportsMasking=!0}build(t){const e=(t=Yo(t)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let t=0;t=e)throw new Error(`Invalid axis: ${t}`);if(this.axis.length!==xa(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((e=>t[e]));this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,true):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,true):this.beta=null,this.built=!0}call(t,e){const n=Xo(t),i=n.shape,r=i.length;return s((()=>{let{mean:t,variance:e}=_t(n,this.axis,!0);const s=ua(1,r);for(const t of this.axis)s[t]=i[t];const a=t=>null!=t&&t.shape.length!==r&&this.axis!==[r-1]?t.reshape(s):t;let o=a(this.gamma.read()),l=a(this.beta.read());const u=[],h=[];for(let t=0;t=0?t[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[3]&&t[3]>=0?t[3]+this.padding[1][0]+this.padding[1][1]:null,[t[0],t[1],e,n]):(e=null!=t[1]&&t[1]>=0?t[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[2]&&t[2]>=0?t[2]+this.padding[1][0]+this.padding[1][1]:null,[t[0],e,n,t[3]])}call(t,e){return s((()=>{return e=Xo(t),n=this.padding,i=this.dataFormat,s((()=>{if(4!==e.rank)throw new aa(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new aa("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new aa(`Unknown data format: ${i}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let t;return t="channelsFirst"===i?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],Bt(e,t)}));var e,n,i}))}getConfig(){const t={padding:this.padding,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}function kc(t,e,n,i,r,a){return s((()=>{let s;Va(r),Ga(a),qa(i),null==n&&(n=[1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),t=yh(t,r);const o="same"===i?"same":"valid";return s="max"===a?Pt(t,e,n,o):Wt(t,e,n,o),"channelsFirst"===r&&(s=yt(s,[0,3,1,2])),s}))}function xc(t,e,n,i,r,a){return s((()=>{let s;Va(r),Ga(a),qa(i),null==n&&(n=[1,1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),t=bh(t,r);const o="same"===i?"same":"valid";return s="max"===a?Ut(t,e,n,o):Kt(t,e,n,o),"channelsFirst"===r&&(s=yt(s,[0,4,1,2,3])),s}))}wc.className="ZeroPadding2D",n.registerClass(wc);class vc extends ll{constructor(t){if(null==t.poolSize&&(t.poolSize=2),super(t),"number"==typeof t.poolSize)this.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new aa(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(t.poolSize)}`);this.poolSize=t.poolSize}if(Na(this.poolSize,"poolSize"),null==t.strides)this.strides=this.poolSize;else if("number"==typeof t.strides)this.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new aa(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(t.strides)}`);this.strides=t.strides}Na(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,qa(this.padding),this.inputSpec=[new sl({ndim:3})]}computeOutputShape(t){const e=gh((t=Yo(t))[1],this.poolSize[0],this.padding,this.strides[0]);return[t[0],e,t[2]]}call(t,e){return s((()=>{this.invokeCallHook(t,e),t=ao(Xo(t),2);const n=this.poolingFunction(Xo(t),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return jt(n,[2])}))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},e=super.getConfig();return Object.assign(t,e),t}}class Sc extends vc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),kc(t,e,n,s,i,"max")}}Sc.className="MaxPooling1D",n.registerClass(Sc);class Ic extends vc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),kc(t,e,n,s,i,"avg")}}Ic.className="AveragePooling1D",n.registerClass(Ic);class Nc extends ll{constructor(t){if(null==t.poolSize&&(t.poolSize=[2,2]),super(t),this.poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)this.strides=this.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new aa(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${t.strides.length}.`);this.strides=t.strides}else this.strides=[t.strides,t.strides];Na(this.poolSize,"poolSize"),Na(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Va(this.dataFormat),qa(this.padding),this.inputSpec=[new sl({ndim:4})]}computeOutputShape(t){t=Yo(t);let e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2];return e=gh(e,this.poolSize[0],this.padding,this.strides[0]),n=gh(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n]:[t[0],e,n,t[3]]}call(t,e){return s((()=>(this.invokeCallHook(t,e),this.poolingFunction(Xo(t),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class Ac extends Nc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),kc(t,e,n,s,i,"max")}}Ac.className="MaxPooling2D",n.registerClass(Ac);class Cc extends Nc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),kc(t,e,n,s,i,"avg")}}Cc.className="AveragePooling2D",n.registerClass(Cc);class zc extends ll{constructor(t){if(null==t.poolSize&&(t.poolSize=[2,2,2]),super(t),this.poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize,t.poolSize],null==t.strides)this.strides=this.poolSize;else if(Array.isArray(t.strides)){if(3!==t.strides.length)throw new aa(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${t.strides.length}.`);this.strides=t.strides}else this.strides=[t.strides,t.strides,t.strides];Na(this.poolSize,"poolSize"),Na(this.strides,"strides"),this.padding=null==t.padding?"valid":t.padding,this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Va(this.dataFormat),qa(this.padding),this.inputSpec=[new sl({ndim:5})]}computeOutputShape(t){t=Yo(t);let e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],s="channelsFirst"===this.dataFormat?t[4]:t[3];return e=gh(e,this.poolSize[0],this.padding,this.strides[0]),n=gh(n,this.poolSize[1],this.padding,this.strides[1]),s=gh(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n,s]:[t[0],e,n,s,t[4]]}call(t,e){return s((()=>(this.invokeCallHook(t,e),this.poolingFunction(Xo(t),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class Dc extends zc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),xc(t,e,n,s,i,"max")}}Dc.className="MaxPooling3D",n.registerClass(Dc);class $c extends zc{constructor(t){super(t)}poolingFunction(t,e,n,s,i){return Va(i),qa(s),xc(t,e,n,s,i,"avg")}}$c.className="AveragePooling3D",n.registerClass($c);class Tc extends ll{constructor(t){super(t),this.inputSpec=[new sl({ndim:3})]}computeOutputShape(t){return[t[0],t[2]]}call(t,e){throw new oa}}class Ec extends Tc{constructor(t){super(t||{})}call(t,e){return s((()=>{const e=Xo(t);return j(e,1)}))}}Ec.className="GlobalAveragePooling1D",n.registerClass(Ec);class Fc extends Tc{constructor(t){super(t||{})}call(t,e){return s((()=>{const e=Xo(t);return c(e,1)}))}}Fc.className="GlobalMaxPooling1D",n.registerClass(Fc);class Lc extends ll{constructor(t){super(t),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Va(this.dataFormat),this.inputSpec=[new sl({ndim:4})]}computeOutputShape(t){return t=t,"channelsLast"===this.dataFormat?[t[0],t[3]]:[t[0],t[1]]}call(t,e){throw new oa}getConfig(){const t={dataFormat:this.dataFormat},e=super.getConfig();return Object.assign(t,e),t}}class _c extends Lc{call(t,e){return s((()=>{const e=Xo(t);return"channelsLast"===this.dataFormat?j(e,[1,2]):j(e,[2,3])}))}}_c.className="GlobalAveragePooling2D",n.registerClass(_c);class Rc extends Lc{call(t,e){return s((()=>{const e=Xo(t);return"channelsLast"===this.dataFormat?c(e,[1,2]):c(e,[2,3])}))}}Rc.className="GlobalMaxPooling2D",n.registerClass(Rc);class Mc extends ll{constructor(t){super(t),this.layer=t.layer}build(t){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(t){null!=this.layer&&(this.layer.trainable=t)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(t){this.layer.setWeights(t)}getConfig(){const t={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},e=super.getConfig();return Object.assign(t,e),t}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(t)}static fromConfig(t,e,n={}){const s=Sl(e.layer,n);delete e.layer;const i={layer:s};return Object.assign(i,e),new t(i)}}class Oc extends Mc{constructor(t){super(t),this.supportsMasking=!0}build(t){if((t=Yo(t)).length<3)throw new aa(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(t)}`);this.inputSpec=[{shape:t}];const e=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(e),this.layer.built=!0),super.build(t)}computeOutputShape(t){const e=[(t=Yo(t))[0]].concat(t.slice(2)),n=this.layer.computeOutputShape(e),s=t[1];return[n[0],s].concat(n.slice(1))}call(t,e){return s((()=>Fh(((t,n)=>[Xo(this.layer.call(t,e)),[]]),t=Xo(t),[],!1,null,null,!1,!0)[1]))}}Oc.className="TimeDistributed",n.registerClass(Oc);class Bc extends Mc{constructor(t){super(t);const e=t.layer.getConfig(),n={};n.className=t.layer.getClassName(),n.config=e,this.forwardLayer=Sl(n),e.goBackwards=!0!==e.goBackwards;const s={};var i;if(s.className=t.layer.getClassName(),s.config=e,this.backwardLayer=Sl(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===t.mergeMode?"concat":t.mergeMode,i=this.mergeMode,Sa(Ka,"BidirectionalMergeMode",i),t.weights)throw new oa("weights support is not implemented for Bidirectional layer yet.");this._stateful=t.layer.stateful,this.returnSequences=t.layer.returnSequences,this.returnState=t.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=t.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(t){this._trainable=t,null!=this.forwardLayer&&(this.forwardLayer.trainable=t),null!=this.backwardLayer&&(this.backwardLayer.trainable=t)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(t){const e=t.length,n=Math.floor(e/2);this.forwardLayer.setWeights(t.slice(0,n)),this.backwardLayer.setWeights(t.slice(n))}computeOutputShape(t){let e,n,s,i=this.forwardLayer.computeOutputShape(t);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(s=i.slice(1),e=i[0]):e=i[0],e=e,"concat"===this.mergeMode?(e[e.length-1]*=2,n=[e]):n=null==this.mergeMode?[e,e.slice()]:[e],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[e].concat(s).concat(s.slice()):pa(n)}apply(t,e){let n=null==e?null:e.initialState,s=null==e?null:e.constants;null==e&&(e={});const i=Eh(t,n,s,this.numConstants);if(t=i.inputs,n=i.initialState,s=i.constants,Array.isArray(t)&&(n=t.slice(1),t=t[0]),(null==n||0===n.length)&&null==s)return super.apply(t,e);const r=[],a=[];if(null!=n){const t=n.length;if(t%2>0)throw new aa("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");e.initialState=n,r.push(...n);const s=n.map((t=>new sl({shape:t.shape})));this.forwardLayer.stateSpec=s.slice(0,t/2),this.backwardLayer.stateSpec=s.slice(t/2),a.push(...s)}if(null!=s)throw new oa("Support for constants in Bidirectional layers is not implemented yet.");const o=r[0]instanceof il;for(const t of r)if(t instanceof il!==o)throw new aa("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[t].concat(r),s=this.inputSpec.concat(a),i=this.inputSpec;this.inputSpec=s;const o=super.apply(n,e);return this.inputSpec=i,o}return super.apply(t,e)}call(t,e){return s((()=>{const n=e.initialState;let s,i,r,o;if(null==n)s=this.forwardLayer.call(t,e),i=this.backwardLayer.call(t,e);else{const r=n.slice(0,n.length/2),a=n.slice(n.length/2);s=this.forwardLayer.call(t,Object.assign(e,{initialState:r})),i=this.backwardLayer.call(t,Object.assign(e,{initialState:a}))}return this.returnState&&(Array.isArray(s)&&(r=s.slice(1).concat(i.slice(1))),s=s[0],i=i[0]),this.returnSequences&&(i=Nt(i,1)),"concat"===this.mergeMode?o=ho([s,i]):"sum"===this.mergeMode?o=u(s,i):"ave"===this.mergeMode?o=a(.5,u(s,i)):"mul"===this.mergeMode?o=a(s,i):null==this.mergeMode&&(o=[s,i]),this.returnState?null==this.mergeMode?o.concat(r):[o].concat(r):o}))}resetStates(t){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(t){Ja(this.forwardLayer.name,(()=>{this.forwardLayer.build(t)})),Ja(this.backwardLayer.name,(()=>{this.backwardLayer.build(t)})),this.built=!0}computeMask(t,e){let n;if(Array.isArray(e)&&(e=e[0]),n=this.returnSequences?null==this.mergeMode?[e,e]:e:null==this.mergeMode?[null,null]:null,this.returnState){const t=this.forwardLayer.states.map((t=>null));return Array.isArray(n)?n.concat(t).concat(t):[n].concat(t).concat(t)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(t){super.setFastWeightInitDuringBuild(t),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(t),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(t)}getConfig(){const t={mergeMode:this.mergeMode},e=super.getConfig();return Object.assign(t,e),t}static fromConfig(t,e){const n=Sl(e.layer);if(delete e.layer,null!=e.numConstants)throw new oa("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=e;return s.layer=n,new t(s)}}function Pc(t){return new Ic(t)}function Wc(t){return new Cc(t)}function Uc(t){return new $c(t)}function Kc(t){return new Fc(t)}function jc(t){return new Rc(t)}function Vc(t){return new Sc(t)}function qc(t){return new Ac(t)}Bc.className="Bidirectional",n.registerClass(Bc);const Gc=Kc,Hc=jc,Jc=Vc,Zc=qc;var Xc=Object.freeze({__proto__:null,inputLayer:function(t){return new hl(t)},elu:function(t){return new ch(t)},reLU:function(t){return new lh(t)},leakyReLU:function(t){return new uh(t)},prelu:function(t){return new hh(t)},softmax:function(t){return new dh(t)},thresholdedReLU:function(t){return new ph(t)},conv1d:function(t){return new zh(t)},conv2d:function(t){return new vh(t)},conv2dTranspose:function(t){return new Ih(t)},conv3d:function(t){return new Sh(t)},conv3dTranspose:function(t){return new Nh(t)},separableConv2d:function(t){return new Ch(t)},cropping2D:function(t){return new Dh(t)},upSampling2d:function(t){return new $h(t)},depthwiseConv2d:function(t){return new Th(t)},activation:function(t){return new Xh(t)},dense:function(t){return new Jh(t)},dropout:function(t){return new Gh(t)},spatialDropout1d:function(t){return new Hh(t)},flatten:function(t){return new Zh(t)},repeatVector:function(t){return new Yh(t)},reshape:function(t){return new Qh(t)},permute:function(t){return new tc(t)},embedding:function(t){return new nc(t)},add:function(t){return new ic(t)},average:function(t){return new ac(t)},concatenate:function(t){return new uc(t)},maximum:function(t){return new oc(t)},minimum:function(t){return new lc(t)},multiply:function(t){return new rc(t)},dot:function(t){return new cc(t)},batchNormalization:function(t){return new yc(t)},layerNormalization:function(t){return new bc(t)},zeroPadding2d:function(t){return new wc(t)},averagePooling1d:Pc,avgPool1d:function(t){return Pc(t)},avgPooling1d:function(t){return Pc(t)},averagePooling2d:Wc,avgPool2d:function(t){return Wc(t)},avgPooling2d:function(t){return Wc(t)},averagePooling3d:Uc,avgPool3d:function(t){return Uc(t)},avgPooling3d:function(t){return Uc(t)},globalAveragePooling1d:function(t){return new Ec(t)},globalAveragePooling2d:function(t){return new _c(t)},globalMaxPooling1d:Kc,globalMaxPooling2d:jc,maxPooling1d:Vc,maxPooling2d:qc,maxPooling3d:function(t){return new Dc(t)},gru:function(t){return new Bh(t)},gruCell:function(t){return new Oh(t)},lstm:function(t){return new Wh(t)},lstmCell:function(t){return new Ph(t)},simpleRNN:function(t){return new Mh(t)},simpleRNNCell:function(t){return new Rh(t)},convLstm2d:function(t){return new qh(t)},convLstm2dCell:function(t){return new Vh(t)},rnn:function(t){return new Lh(t)},stackedRNNCells:function(t){return new Uh(t)},bidirectional:function(t){return new Bc(t)},timeDistributed:function(t){return new Oc(t)},globalMaxPool1d:Gc,globalMaxPool2d:Hc,maxPool1d:Jc,maxPool2d:Zc,Layer:ll,RNN:Lh,RNNCell:_h,input:_u,gaussianNoise:function(t){return new pc(t)},gaussianDropout:function(t){return new dc(t)},alphaDropout:function(t){return new fc(t)},masking:function(t){return new ec(t)}});var Yc=Object.freeze({__proto__:null,binaryAccuracy:function(t,e){return Ll(t,e)},binaryCrossentropy:function(t,e){return Bl(t,e)},sparseCategoricalAccuracy:function(t,e){return Pl(t,e)},categoricalAccuracy:function(t,e){return _l(t,e)},categoricalCrossentropy:function(t,e){return Wl(t,e)},precision:function(t,e){return Ml(t,e)},recall:function(t,e){return Ol(t,e)},cosineProximity:function(t,e){return Tl(t,e)},meanAbsoluteError:function(t,e){return Al(t,e)},meanAbsolutePercentageError:function(t,e){return Cl(t,e)},MAPE:function(t,e){return Cl(t,e)},mape:function(t,e){return Cl(t,e)},meanSquaredError:function(t,e){return Nl(t,e)},MSE:function(t,e){return Nl(t,e)},mse:function(t,e){return Nl(t,e)}}),Qc=Object.freeze({__proto__:null,modelFromJSON:async function(t,e){"modelTopology"in t||(t={modelTopology:t});let n=(t=t).modelTopology;null!=n.model_config&&(n=n.model_config);const s=Sl(Ql(n),e);if(null!=t.weightsManifest){const e=await ut.loadWeights(t.weightsManifest,t.pathPrefix,s.weights.map((t=>t.originalName))),n={};for(const t of s.weights)n[t.originalName]=e[t.originalName];s.loadWeights(n),B(e)}return s}});var tp=Object.freeze({__proto__:null,l1l2:function(t){return new sh(t)},l1:function(t){return eh(e=t),new sh({l1:null!=e?e.l1:null,l2:0});var e},l2:function(t){return eh(e=t),new sh({l2:null!=e?e.l2:null,l1:0});var e}});class ep extends gl{constructor(){super(...arguments),this.model=null}setModel(t){if(!(t instanceof zu))throw new Error("model must be a LayersModel, not some other Container");this.model=t}}function np(t,e){return te}class ip extends ep{constructor(t){if(super(),null==t&&(t={}),t.restoreBestWeights)throw new oa("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=t.monitor||"val_loss",this.minDelta=Math.abs(t.minDelta||0),this.patience=t.patience||0,this.verbose=t.verbose||0,this.mode=t.mode||"auto",this.baseline=t.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=np:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=sp:this.monitorFunc=np,this.monitorFunc===np&&(this.minDelta*=-1)}async onTrainBegin(t){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===np?1/0:-1/0}async onEpochEnd(t,e){await pl(e);const n=this.getMonitorValue(e);null!=n&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=t,this.model.stopTraining=!0)))}async onTrainEnd(t){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(t){null==t&&(t={});const e=t[this.monitor];return null==e&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(t)}`),e}}const rp={earlyStopping:function(t){return new ip(t)}};export{ep as Callback,ml as CallbackList,wl as CustomCallback,ip as EarlyStopping,bl as History,sl as InputSpec,tl as LayerVariable,zu as LayersModel,Lh as RNN,Tu as Sequential,il as SymbolicTensor,rp as callbacks,Oa as constraints,jo as initializers,_u as input,Xc as layers,Lu as loadLayersModel,Yc as metrics,Eu as model,Qc as models,Ru as registerCallbackConstructor,tp as regularizers,Fu as sequential,eu as version_layers}; -//# sourceMappingURL=tf-layers.fesm.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.html b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.html deleted file mode 100644 index 08687121b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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-layers/dist/tf-layers.fesm.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.map deleted file mode 100644 index 219bf2153..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.fesm.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.fesm.min.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/optimizers.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["notYetImplemented","kernelName","Error","assert","expr","msg","flatten","arr","result","skipTypedArray","Array","isArray","isTypedArray","i","length","push","sizeFromShape","shape","size","arraysEqual","n1","n2","isInt","a","rightPad","repeat","parseAxisParam","axis","rank","map","s","concat","every","ax","Float32Array","Int32Array","Uint8Array","bytesPerElement","dtype","isString","value","String","inferDtype","values","isBoolean","isFunction","f","constructor","call","apply","computeStrides","strides","createNestedArray","offset","isComplex","ret","d","rest","slice","len","reduce","acc","c","toNestedArray","makeOnesTypedArray","array","makeZerosTypedArray","isPromise","object","then","Environment","[object Object]","global","this","flags","flagRegistry","urlFlags","getQueryParams","populateURLFlags","platformName","platform","console","warn","flagName","evaluationFn","setHook","flagValue","set","evaluateFlag","get","features","Object","assign","location","search","urlParams","split","forEach","keyValue","key","toLowerCase","parseValue","queryString","params","replace","t","name","decodeURIComponent","decodeParam","join","env","ENV","globalNameSpace","getGlobalNamespace","ns","window","process","self","getGlobal","init","globalMap","_tfGlobals","Map","getGlobalMap","has","singleton","kernelRegistry","gradRegistry","getKernel","backendName","makeKey","getGradient","getKernelsForBackend","it","entries","done","next","config","backend","registerGradient","getBool","toTypedArray","base.flatten","vals","num","isNaN","isFinite","base.checkConversionForErrors","noConversionNeeded","bool","Math","round","now","decodeString","bytes","encoding","decode","Profiler","backendTimer","logger","Logger","inputs","outputs","holdResultWrapperFn","timer","start","util.now","timerAvailable","time","output","dataSync","Promise","resolve","kernelMs","data","tensorVals","checkComputationForErrors","timeMs","timing","extraInfo","getExtraProfileInfo","kernelProfile","all","valueContainer","logKernelProfile","util.rightPad","paddedName","toString","inputShapesDescription","input","inputShape","inputRank","log","tensorToString","verbose","padPerCol","n","numCols","fill","valuesOrTuples","createComplexTuples","row","j","max","valToString","computeMaxSizePerColumn","valsLines","subTensorToString","lines","l","val","pad","valStr","parseFloat","toFixed","boolNumToString","v","isLast","storagePerElement","firstValsSize","firstVals","from","lastVals","x","subshape","substrides","stride","end","sep","newLineSep","complexTuples","trackerFn","Tensor","dataId","id","kept","isDisposedInternal","util.sizeFromShape","rankType","buffer","throwIfDisposed","read","b","util.decodeString","_a","readSync","isDisposed","disposeTensor","print","clone","cast","trainable","makeVariable","getGlobalTensorClass","defineProperty","Symbol","hasInstance","instance","Variable","initialValue","tensorId","super","newValue","util.arraysEqual","incRef","disposeVariable","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","UpcastComplex64AndMap","Function","upcastTypeMap","float32","int32","complex64","makeTypesMatch","typeA","typeB","upcastType","getTensorsInContainer","list","walkTensorContainer","Set","container","seen","obj","iterable","k","add","isRegisteredKernelInvocation","kernelInvocation","EngineState","registeredVariables","nextTapeNodeId","numBytes","numTensors","numStringTensors","numDataBuffers","gradientDepth","kernelDepth","scopeStack","numDataMovesStack","nextScopeId","tensorInfo","WeakMap","profiling","activeProfile","newBytes","newTensors","peakBytes","kernels","kernelNames","variableName","dispose","Engine","registry","registryFactory","pendingBackendInitId","state","pendingBackendInit","backendInstance","sortedBackends","getSortedBackends","initializeBackend","success","setBackend","asyncInit","initializeBackendsAndReturnBest","keys","factory","priority","setupRegisteredKernels","profiler","kernel","setupFunc","disposeFunc","registryFactoryEntry","force","refCount","floatPrecision","promiseId","catch","err","stack","message","disposeRegisteredKernels","sort","info","srcBackend","disposeData","move","shouldCheckForMemLeaks","nameOrFn","fn","scopedRun","startScope","endScope","error","res","ex","nextTensorId","nextVariableId","y","ENGINE","runKernel","addTapeNode","activeScope","dy","gradInputs","attrs","runKernelFunc","numDataIdsBefore","outInfos","numDataIdsAfter","numDataIds","numOutputDataIds","numMoves","dataIdsLeaked","kernelParams","saved","isTapeOn","startingBytecount","startingNumTensors","kernelFunc","out","kernelOrScopeName","util.assert","checkKernelForMemLeak","outTensors","outInfo","makeTensorFromDataId","tensorsToSave","getTensorsForGradient","saveTensorsForBackwardMode","forwardFunc","saveFunc","tensors","tensor","keep","tidy","outs","backwardsFunc","profileKernel","bytesAdded","totalBytesSnapshot","tensorsAdded","totalTensorsSnapshot","inputShapes","outputShapes","item","kernelTimeMs","gradConfig","inputsToSave","outputsToSave","inputTensorsToSave","saveAllInputs","inputName","outputTensorsToSave","filter","_","backendVals","util.isString","encode","util.encodeString","write","trackTensor","bytesFromStringArray","util.bytesPerElement","track","delete","removeDataId","varName","memory","unreliable","reasons","query","startBytes","startNumTensors","gradientsFunc","tapeNode","gradFunc","gradient","dys","util.makeZerosTypedArray","makeTensor","activeTape","scopeInfo","tensorsToTrackInParent","tensorsToTrackInParentSet","oldScope","pop","scopeId","xs","allowNoGradients","startTape","endTape","filteredTape","tape","tensorsFromX","nodesFromX","node","nodeInputs","anyInputFromX","tensorsLeadToY","nodesToY","prunedInputs","nodeInput","prunedNode","getFilteredNodesXToY","accumulatedGradientMap","ones","tensorAccumulatedGradientMap","o","gradTensor","inputGradients","dx","curGradient","backpropagateGradients","grads","util.isFunction","inputMap","save","gradRes","gradMap","grad","timingInfo","wallMs","reset","_tfengine","environment","getOrMakeEngine","inferShape","firstElem","deepAssertShapeConsistency","indices","subShape","assertDtype","expectedDtype","actualDType","argName","functionName","convertToTensor","parseAsDtype","inferredDtype","indexOf","type","inferredShape","convertToTensorArray","arg","op","opName","endsWith","substring","f2","args","configurable","abs","abs_","$x","acos","acos_","acosh","acosh_","add_","$a","$b","all_","keepDims","any","any_","argMax","argMax_","argMin","argMin_","asin","asin_","asinh","asinh_","atan","atan_","atan2","atan2_","atanh","atanh_","cast_","util.isValidDtype","computePool2DInfo","inShape","filterSize","dilations","roundingMode","dataFormat","filterHeight","filterWidth","parseTupleParam","filterShape","depthwise","batchSize","inHeight","inWidth","inChannels","filterChannels","strideHeight","strideWidth","dilationHeight","dilationWidth","effectiveFilterHeight","getEffectiveFilterSize","effectiveFilterWidth","padInfo","outHeight","outWidth","top","bottom","left","right","outShape","fieldSize","zeroPad","dilation","effectiveFieldSize","floor","computeDefaultPad","inputRows","inputCols","outputRows","outputCols","computeOutputShape2D","ceil","padAlongHeight","padAlongWidth","getPadAndOutInfo","outChannels","computeConv2DInfo","param","trunc","tupleValuesAreOne","dimA","dimB","dimC","eitherStridesOrDilationsAreOne","reshape","reshape_","avgPool","avgPool_","dimRoundingMode","conv_util.eitherStridesOrDilationsAreOne","x4D","reshapedTo4D","util.isInt","clone_","concat_","$tensors","attr","matMul","matMul_","transposeA","transposeB","mul","mul_","sigmoid","sigmoid_","slice_","begin","tanh","tanh_","batchToSpaceND","batchToSpaceND_","blockShape","crops","prod","batchNorm","batchNorm_","mean","variance","scale","varianceEpsilon","$mean","$variance","$scale","$offset","xAs4D","broadcastTo","broadcastTo_","xShape","some","newShape","unshift","reps","ceil_","clipByValue","clipByValue_","clipValueMin","clipValueMax","complex","complex_","real","imag","$real","$imag","shapeA","shapeB","errorMessagePrefix","util.assertShapesMatch","conv2d","conv2d_","$filter","inDepth","conv1d","conv1d_","x3D","reshapedTo3D","filter4D","input4D","conv2DBackpropInput","conv2DBackpropInput_","xShape4D","dy4D","outDepth","conv2dTranspose","conv2dTranspose_","outputShape","conv3DBackpropInput","conv3DBackpropInput_","xShape5D","dy5D","reshapedTo5D","cos","cos_","cosh","cosh_","cumsum","cumsum_","exclusive","reverse","depthToSpace","depthToSpace_","blockSize","inputHeight","inputWidth","inputDepth","depthwiseConv2d","depthwiseConv2d_","dilation2d","dilation2d_","floorDiv","floorDiv_","div","div_","getReductionAxes","inDim","outAxis","outDim","assertAndGetBroadcastShape","equal","equal_","where","where_","condition","$condition","broadcastShape","e","zerosLike","zerosLike_","divNoNan","divNoNan_","divResult","zeros","bEqualsZero","dot","dot_","t1","t2","$t1","$t2","t1Inner","t2Inner","t12D","t22D","t1t2","elu","elu_","erf","erf_","exp","exp_","expandDims","expandDims_","dim","expm1","expm1_","tile","tile_","floor_","gather","gather_","batchDims","greater","greater_","greaterEqual","greaterEqual_","imag_","isFinite_","isInf","isInf_","isNaN_","leakyRelu","leakyRelu_","alpha","less","less_","lessEqual","lessEqual_","localResponseNormalization","localResponseNormalization_","depthRadius","bias","beta","log_","log1p","log1p_","customGrad","neg","neg_","softplus","softplus_","logSigmoid","logSigmoid_","customOp","max_","reductionIndices","sub","sub_","sum","sum_","logSoftmax","logSoftmax_","logits","$logits","xMax","shifted","softmax","expandShapeToKeepDim","axes","outputLoc","reduceLoc","loc","outIdx","reduceIdx","combineLocations","getUndoAxesPermutation","logSumExp","logSumExp_","logicalAnd","logicalAnd_","logicalNot","logicalNot_","logicalOr","logicalOr_","logicalXor","logicalXor_","maxPool","maxPool_","maximum","maximum_","mean_","min","min_","minimum","minimum_","mirrorPad","mirrorPad_","paddings","mode","shapeOffset","mod","mod_","square","square_","notEqual","notEqual_","oneHot","oneHot_","depth","onValue","offValue","onesLike","onesLike_","pad_","constantValue","spaceToBatchND","spaceToBatchND_","pool","pool_","windowShape","poolingType","convInfo","conv_util.computePool2DInfo","basePadding","padExtraShape","padExtraStart","padExtraEnd","withSpaceToBatchBasePaddings","isDilationOne","adjustedPadding","adjustedCrops","padStart","origPadEnd","fullInputShape","padEndExtra","padEnd","requiredSpaceToBatchPaddings","convertedPad","convertedX","pow","pow_","base","$base","$exp","prelu","prelu_","prod_","real_","reciprocal","reciprocal_","relu","relu_","relu6","relu6_","reverse_","dims","round_","rsqrt","rsqrt_","dimSize","Number","isInteger","assertNonNegativeIntegerDimensions","providedSize","inferredSize","inferred","flatDimsDontMatch","scalar","selu","selu_","separableConv2d","separableConv2d_","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","sign","sign_","sin","sin_","sinh","sinh_","softmax_","fft","fft_","ifft","ifft_","irfft","irfft_","innerDimensionSize","batch","complexInput","realInput","imagInput","realConjugate","imagConjugate","r","temp","split_","numOrSizeSplits","rfft","rfft_","fftLength","adjustedInput","zerosShape","zerosInput","half","realValues","imagValues","realComplexConjugate","imagComplexConjugate","sqrt","sqrt_","squaredDifference","squaredDifference_","squeeze","squeeze_","keptDims","isEmptyArray","squeezeShape","stack_","step","step_","stridedSlice","stridedSlice_","beginMask","endMask","ellipsisMask","newAxisMask","shrinkAxisMask","tan","tan_","topk","topk_","sorted","lastDim","unique","unique_","unsortedSegmentSum","unsortedSegmentSum_","segmentIds","numSegments","$segmentIds","unstack","unstack_","transpose","transpose_","perm","normImpl","p","Infinity","norm","norm_","ord","keepDimsShape","axis_util.expandShapeToKeepDim","conv2DBackpropFilter","conv2DBackpropFilter_","depthwiseConv2dNativeBackpropFilter","depthwiseConv2dNativeBackpropFilter_","depthwiseConv2dNativeBackpropInput","depthwiseConv2dNativeBackpropInput_","resizeBilinear","resizeBilinear_","images","alignCorners","halfPixelCenters","$images","batchImages","resizeNearestNeighbor","resizeNearestNeighbor_","prototype","asScalar","asType","as1D","as2D","rows","columns","as3D","as4D","depth2","as5D","depth3","padding","dilationRate","reshapeAs","newShape2D","halfFloatCenters","tensorsToBeStacked","toBool","toFloat","toInt","absGradConfig","acosGradConfig","acoshGradConfig","addGradConfig","broadcast_util.assertAndGetBroadcastShape","reduceAxes","broadcast_util.getReductionAxes","addNGradConfig","ders","argMaxGradConfig","argMinGradConfig","asinGradConfig","asinhGradConfig","atan2GradConfig","atanGradConfig","atanhGradConfig","avgPool3dGrad","avgPool3dGrad_","$dy","$input","input5D","avgPool3DGradConfig","avgPoolGrad","avgPoolGrad_","avgPoolGradConfig","batchMatMulGradConfig","batchToSpaceNDGradConfig","broadcastToGradConfig","broadCastToAttrs","castGradConfig","ceilGradConfig","clipByValueGradConfig","complexAbsGradConfig","concatGradConfig","shapes","$axis","sizeSplits","conv2DGradConfig","conv_util.tupleValuesAreOne","conv2DBackpropInputGradConfig","ddx","conv3DBackpropFilter","conv3DBackpropFilter_","x5D","conv3DGradConfig","cosGradConfig","coshGradConfig","cumsumGradConfig","permutation","axesAreInnerMostDims","getAxesPermutation","depthwiseConv2dNativeGradConfig","$dilations","dilation2dGradConfig","inputInputs","filterInputs","eluGradConfig","erfGradConfig","PI","expGradConfig","expandDimsGradConfig","expm1GradConfig","floorGradConfig","floorDivGradConfig","tmp","fusedBatchNormGradConfig","scaleValue","reductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","gatherGradConfig","parsedAxis","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","stop","arrays","greaterEqualGradConfig","identityGradConfig","isFiniteGradConfig","isInfGradConfig","isNanGradConfig","leakyReluGradConfig","mask","log1pGradConfig","logGradConfig","logSoftmaxGradConfig","localResponseNormalizationBackprop","localResponseNormalizationBackprop_","lrnGradConfig","gradForMinAndMax","xOrig","origAxes","maxGradConfig","maxAttrs","maxGrad","util.parseAxisParam","maximumGradConfig","maxPool3dGrad","maxPool3dGrad_","$output","output5D","maxPool3DGradConfig","maxPoolGrad","maxPoolGrad_","padV2GradConfig","spaceToBatchNDGradConfig","splitVGradConfig","gradConfigs","reduceSize","aShape","computeOutAndReduceShapes","expandedDyShape","expandedDy","minAttrs","minGrad","expFloat","logBase","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","begin_","size_","xRank","parseSliceParams","dyTimesY","two","derX","xGrad","transposeAttrs","undoPerm","axis_util.getUndoAxesPermutation","unpackAttrs","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gatherDropNegatives","gradientConfig","_epsilon","epsilon","AttributeError","setPrototypeOf","RuntimeError","ValueError","NotImplementedError","AssertionError","pyListRepeat","numValues","newArray","count","refernce","counter","singletonOrArray","toList","toSnakeCase","insecure","toCamelCase","identifier","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","dict","getClassName","getConfig","convertNDArrayScalarsInConfig","configItem","fields","field","deserializeKerasObject","moduleObjects","customObjects","printableModuleName","fastWeightInit","JSON","stringify","className","cls","fromConfig","customObjectsCombined","backupCustomObjects","returnObj","reverseNumberCompare","numberCompare","isObjectEmpty","hasOwnProperty","checkStringTypeUnionValue","label","checkArrayTypeAndLength","expectedType","minLength","maxLength","assertPositiveInteger","util","formatAsFriendlyString","mapActivationToFusedKernel","activationName","calcL2Norms","w","tfc.sqrt","tfc.sum","tfc.mul","Constraint","serialization","Serializable","MaxNorm","maxValue","defaultMaxValue","defaultAxis","norms","desired","tfc.clipByValue","tfc.div","tfc.add","registerClass","UnitNorm","NonNeg","tfc.relu","MinMaxNorm","minValue","defaultMinValue","rate","defaultRate","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","constraint","deserializeConstraint","SerializationMap","getMap","classNameMap","getConstraint","VALID_DATA_FORMAT_VALUES","VALID_INTERPOLATION_FORMAT_VALUES","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","VALID_BIDIRECTIONAL_MERGE_MODES","nameMap","checkDataFormat","checkPaddingMode","checkPoolMode","_nameScopeStack","nameScope","getScopedTensorName","tensorName","isValidTensorName","getUniqueTensorName","scopedName","index","tensorNameRegex","RegExp","match","arrayProd","toArray1D","tensor1d","tfc.min","tfc.max","range","splice","sliceAlongFirstAxis","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","sliceAlongLastAxis","sliceAlongAxis","concatenate","tfc.concat","concatAlongFirstAxis","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","randomNormal","stddev","seed","tfc.randomNormal","activation","tfc.fused","reshapeBias","aFirstDims","aLastDim","bShape","bLastDim","ySecondLastDim","yOtherDims","reference","tfc.gather","biasShape","biasAdd","dropout","level","noiseShape","tfc.dropout","inTrainPhase","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","Ones","Constant","undefined","RandomUniform","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","randomUniform","RandomNormal","DEFAULT_MEAN","DEFAULT_STDDEV","K.randomNormal","TruncatedNormal","truncatedNormal","Identity","gain","eye","VarianceScaling","distribution","checkDistribution","fans","fanIn","fanOut","receptiveFieldSize","shapeProd","computeFans","limit","GlorotUniform","GlorotNormal","HeNormal","HeUniform","LeCunNormal","LeCunUniform","Orthogonal","DEFAULT_GAIN","q","linalg","gramSchmidt","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","heUniform","identity","leCunNormal","leCunUniform","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","initializer","getInitializer","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","prefix","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","weights","weight","LayerVariable","originalName","trainable_","tfc.variable","assertNotDisposed","newVal","checkShapesMatch","batchGetValue","batchSetValue","variablesAndValues","variableAndValue","InputSpec","ndim","maxNDim","minNDim","SymbolicTensor","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","Node","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","layer","outboundNodes","inboundNodes","inboundNames","_nextLayerID","Layer","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","batchInputShape","inputDType","initialWeights","_refCount","fastWeightInitDuringBuild","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","updates","built","trainableWeights","nonTrainableWeights","stateful","_stateful","generic_utils.toList","inputIndex","spec","xShapeAtAxis","specDim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","noneAreSymbolic","assertInputCompatibility","xElem","build","setWeights","outputList","outputListCopy","collectInputShape","computeOutputShape","outputDType","warnOnIncompatibleInputShape","addInboundNode","dimMismatch","dimension","allOutputShapes","shapeString","variable_utils.countParamsInWeights","trainableOnly","weightValueTuples","paramValues","pv","regularizer","_addedWeightNames","initValue","addLoss","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","tensorIndex","numDisposedVariables","disposeWeights","refCountAfterDispose","getSourceInputs","sourceTensors","previousSources","InputLayer","sparse","inputTensor","Input","batchShape","async","resolveScalarsInLogs","logs","promises","scalarsToDispose","valueScalar","disposeTensorsInLogs","ModelLoggingVerbosity","BaseCallback","epoch","model","CallbackList","callbacks","queueLength","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","totals","oldTotalsToDispose","total","History","history","valueArray","CustomCallback","yieldEvery","onYield","isNumber","maybeWait","waitMs","lastResult","lastTime","generic_utils.debounce","bind","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","yield","ps","nextFrame","currentEpoch","standardizeCallbacks","callbackConfig","CallbackConstructorRegistry","verbosityLevel","callbackConstructor","checkForDuplicate","constructors","levelName","ctor","configureCallbacks","epochs","initialEpoch","numTrainSamples","stepsPerEpoch","doValidation","callbackMetrics","actualCallbacks","createCallbacks","callbackList","samples","steps","metrics","deserialize","l2Normalize","squareSum","K.square","epsilonTensor","tfc.fill","tfc.maximum","meanSquaredError","yTrue","yPred","tfc.mean","tfc.sub","meanAbsoluteError","tfc.abs","meanAbsolutePercentageError","diff","clippedTrue","MAX_VALUE","absResult","categoricalCrossentropy","target","fromLogits","tfc.softmax","outputSum","tfc.neg","tfc.log","sparseCategoricalCrossentropy","flatTarget","tfc.floor","math_utils.arrayProd","K.flatten","tfc.oneHot","binaryCrossentropy","labels","reluLogits","negAbsLogits","sigmoidCrossEntropyWithLogits","cosineProximity","trueNormalized","predNormalized","trueXPred","lossesMap","meanSquaredLogarithmicError","clippedPred","firstLog","secondLog","squaredHinge","maxResult","hinge","categoricalHinge","pos","logcosh","log2","predictionDiff","logcoshResult","tfc.softplus","kullbackLeiblerDivergence","poisson","logPred","identifierOrFn","errMsg","includes","binaryAccuracy","threshold","tfc.onesLike","yPredThresholded","K.cast","tfc.greater","tfc.equal","categoricalAccuracy","tfc.argMax","truePositives","tfc.logicalAnd","precision","tp","fp","falsePositives","denominator","tfc.where","recall","falseNegatives","lossBinaryCrossentropy","sparseCategoricalAccuracy","categoricalCrossentropyLoss","sparseCategoricalCrossentropyLoss","metricsMap","mse","MSE","mae","MAE","mape","MAPE","cosine","getLossOrMetricName","fnName","checkUserDefinedMetadata","userDefinedMetadata","modelName","checkSize","getPrototypeOf","plainObjectCheck","xType","printSummary","lineLength","positions","printFn","sequentialLike","nodesByDepth","nodes","depthNodes","layers","flag","isModelSequentialLike","toDisplay","relevantNodes","printRow","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","trainableCount","collectedTrainableWeights","countTrainableParams","nonTrainableCount","line","countParams","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","isArrayItemInputOrOutputName","convertPythonicToTs","pythonicConfig","generic_utils.toCamelCase","tsArray","arrayLength","tsDict","pythonicKey","pythonicValue","tsKey","convertTsToPythonic","tsConfig","pyArray","pyDict","tsValue","pyKey","version","FeedDict","feeds","id2Value","id2Mask","feed","assertFeedCompatibility","name2Id","cachedSorted","cachedRecipientCounts","execute","fetches","feedDict","probe","arrayFetches","fetchArray","outputNames","finalOutputs","feedNames","names","outputName","getValue","maxNumTensors","minNumTensors","fetchAndFeedKey","recipientCounts","finalSorted","finalRecipientMap","getTopologicalSortAndRecipientCountsForOneFetch","recipientMap","visited","fetch","symbolicTensor","recipient","recipientMap2Counts","getTopologicalSortAndRecipientCounts","internalFeedDict","symbolic","srcLayer","inputValues","tensorsToDispose","maskExists","getMask","hasKey","outputMask","computeMask","layerOutputs","getNodeOutputs","outputSymbolicTensors","disposeMasks","marks","topIsMarked","outputTensor","getOutputAt","Container","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","internalContainerRefs","generic_utils.assert","inputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","finishedNodes","nodesInProgress","containerNodes","nodeKey","numInboundLayers","reversedNodesInDecreasingDepth","previousDepth","inboundNode","nodeID","layersByDepth","layerID","depthKeys","parseInt","generic_utils.reverseNumberCompare","layersForDepth","aIndex","bIndex","computableTensors","layersWithCompleteInput","allNames","numOccurrences","strict","nameToWeight","totalWeightsCount","validatedName","tokens","unsetNames","theConfig","modelConfig","unused","returnString","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","outputShapeKeys","shapeKey","tensorMap","referenceInputTensors","referenceOutputTensors","computedData","computedTensors","computedMasks","computedTensor","computedMask","nodeConversionMap","keptNodes","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","addUnprocessedNode","processNode","inputData","inboundLayerName","inboundNodeIndex","processLayer","layerData","layerName","deserializeLayer","setFastWeightInitDuringBuild","layersFromConfig","generic_utils.isObjectEmpty","currentUnprocessedNodesForLayer","inputLayersFromConfig","layerOutputTensors","outputLayersFromConfig","resetStates","standardizeClassWeights","classWeight","xWeight","weightType","numOutputs","standardizeSampleOrClassWeights","standardizeWeights","sampleWeight","sampleWeightMode","yClasses","yClassIndices","classSampleWeight","classIndex","computeWeightedLoss","sampleWeights","standardizeDataIteratorOutput","iteratorOut","ys","iteratorOutObj","tfc.util","flattenedXs","flattenTensorOrArrayOrMap","flattenedYs","xIndex","yIndex","inputOrOutput","tfc.Tensor","fitDataset","dataset","hasBatchesPerEpoch","batchesPerEpoch","optimizer","isTraining","validationData","valXs","valYs","isDatasetObject","validationBatches","standardizeTensorValidationData","trainFunction","makeTrainFunction","outLabels","getDedupedMetricsNames","getStepsPerEpoch","stopTraining_","dataIterator","iterator","epochLogs","stepsDone","batchIndex","batchLogs","standardClassWeights","ins","tfc.dispose","tfc.keep","valOuts","evaluateDataset","batches","evaluate","validationBatchSize","metricsNames","syncData","checkBatchSize","sliceArrays","sliceArraysByIndices","tfc.tidy","makeBatches","batchStart","fitTensors","targets","inputValX","inputValY","valX","valY","checkBatchAxis","standardizedOuts","standardizeUserData","valIns","valStandardized","validationSplit","splitAt","originalBatchSize","validationSteps","valFunction","makeTestFunction","testFunction","valF","shuffle","checkNumSamples","indexArray","epochIndexArray1D","batchIds","insBatch","testLoop","fitLoop","disposeNewTensors","ensureTensorsRank2OrHigher","refTensors","oldTensorIds","oldTensor","isDataArray","isDataDict","isDataTensor","standardizeInputData","exceptionPrefix","gotUnexpectedData","refDim","checkInputData","LayersModel","loss","optimizer_","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","optimizers.getOptimizer","isOptimizerOwned","Optimizer","lossFunctions","theLosses","losses.get","lossFunction","feedOutputShapes","feedLossFns","skipTargetIndices","metricsTensors","weightedLoss","nestedMetrics","wrappedMetrics","outputMetrics","collectMetrics","appendMetric","outputIndex","metricName","metricTensor","accFn","weightedMetricFn","metric","suffix","losses.binaryCrossentropy","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","metricFn","Metrics.get","Metrics.getLossOrMetricName","metricResult","handleMetrics","standardizeUserDataXY","hasBatches","numExamples","xsAndYs","batchOuts","batchOut","oldScalar","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","tensorValue","executeOutputs","symbolicTensorNames","outputsRemaining","layerOutputNames","remainingNames","outsBatches","xsRank2OrHigher","predictLoop","setX","setY","checkArrayLengths","lossFns","keyLosses","losses.meanSquaredError","losses.categoricalCrossentropy","slicedYShape","slicedShape","targetDim","checkLossAndTargetCompatibility","standardXs","standardYs","standardSampleWeights","classWeights","K.sliceAlongFirstAxis","dedupedOutLabels","newLabel","lossValues","metricsValues","variables","minimize","totalLoss","meanLoss","weightedMetric","regularizerLoss","valOutputs","meanMetric","standardizeOut","namedWeights","weightValues","getWeights","stopTraining","numTensorsBeforeOptmizerDisposal","tfc.memory","lossNames","metricsIdentifiers","getLossIdentifiers","getMetricIdentifiers","optimizer_config","class_name","trainingConfig","weighted_metrics","loss_weights","sample_weight_mode","lossEntry","compile","handlerOrURL","handlers","io","getSaveHandlers","weightDataAndSpecs","encodeWeights","getNamedWeights","modelArtifacts","modelTopology","toJSON","format","generatedBy","convertedBy","includeOptimizer","getTrainingConfig","optimizerWeightData","specs","optimizerWeightSpecs","concatenateArrayBuffers","weightData","weightSpecs","Functional","loadLayersModelInternal","pathOrIOHandler","options","getLoadHandlers","browserHTTPRequest","handler","load","artifacts","loadTrainingConfig","setUserDefinedMetadata","modelWeights","optimizerWeights","name2Tensor","decodeWeights","group","decodeModelAndOptimizerWeights","loadWeights","loadLayersModelFromIOHandler","Sequential","isLayerModelInstance","modelLayer","checkShape","lastLayerIndex","summary","predict","predictOnBatch","fit","trainOnBatch","configArray","extraModelConfig","conf","sequential","loadLayersModel","registerCallbackConstructor","Activation","Elu","tfc.elu","K.elu","Selu","tfc.selu","Relu","Relu6","tfc.minimum","Linear","Sigmoid","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softplus","Softsign","K.softsign","Tanh","tfc.tanh","Softmax","LogSoftmax","tfc.logSoftmax","Swish","Mish","serializeActivation","deserializeActivation","getActivation","assertObjectArgs","Regularizer","L1L2","l1","l2","hasL1","hasL2","regularization","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","ReLU","baseConfig","LeakyReLU","DEFAULT_ALPHA","PReLU","alphaInitializer","DEFAULT_ALPHA_INITIALIZER","alphaRegularizer","alphaConstraint","sharedAxes","paramShape","addWeight","ELU","ThresholdedReLU","theta","DEFAULT_THETA","softmaxActivation","DEFAULT_AXIS","normalizeArray","singleValue","convOutputLength","inputLength","outputLength","deconvLength","strideSize","kernelSize","preprocessConv2DInput","tfc.transpose","preprocessConv3DInput","conv2dWithBiasActivation","BaseConv","verifyArgs","generic_utils.assertPositiveInteger","useBias","biasInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","biasRegularizer","generic_utils.checkArrayTypeAndLength","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","biasValue","fusedActivationName","generic_utils.mapActivationToFusedKernel","tfc.conv1d","K.biasAdd","conv1dWithBias","tfc.conv3d","conv3dWithBias","newSpace","space","newDim","Conv2D","Conv3D","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","tfc.conv2dTranspose","heightAxis","widthAxis","Conv3DTranspose","dAxis","kernelD","strideD","tfc.conv3dTranspose","depthAxis","SeparableConv","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","SeparableConv2D","Conv1D","Cropping2D","cropping","hSliced","K.sliceAlongAxis","UpSampling2D","DEFAULT_SIZE","interpolation","resized","DepthwiseConv2D","tfc.depthwiseConv2d","cols","outFilters","outRows","outCols","standardizeArgs","initialState","constants","numConstants","toListOrNull","rnn","stepFunction","initialStates","goBackwards","unroll","needPerStepOutputs","math_utils.range","tfc.expandDims","tfc.reverse","perStepOutputs","lastOutput","states","timeSteps","perStepInputs","tfc.unstack","perStepMasks","currentInput","stepOutputs","maskedOutputs","stepMask","negStepMask","newStates","tfc.stack","RNN","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","states_","keptStates","outputDim","stateShape","stateMask","numStates","stepInputShape","tfc.zeros","expectedShape","standardized","additionalInputs","additionalSpecs","fullInput","fullInputSpec","originalInputSpec","getInitialState","cellCallKwargs","rnnOutputs","K.expandDims","K.tile","cellConfig","RNNCell","SimpleRNNCell","units","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","K.dot","SimpleRNN","GRUCell","resetAfter","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","hTMinus1","z","hh","matrixX","recurrentKernelValue","rk1","rk2","tfc.split","matrixInner","xZ","xR","xH","recurrentZ","recurrentR","recurrentH","GRU","LSTMCell","unitForgetBias","capturedBiasInit","capturedUnits","bI","bF","bCAndH","K.concatAlongFirstAxis","cTMinus1","z0","z1","z2","z3","LSTM","nestedStates","newNestedStates","callInputs","cellStates","tuples","numParams","inputWeights","droppedInputs","K.dropout","createMask","K.inTrainPhase","ConvRNN2D","computeSingleOutputShape","getStates","isChannelsFirst","hOut","wOut","ConvLSTM2DCell","recurrentKernelShape","K.concatenate","tfc.ones","applyDropout","xI","xF","xC","xO","recDropoutMask","hI","hF","hC","hO","kernelI","kernelF","kernelC","kernelO","biasI","biasF","biasC","biasO","inputConv","recKernelI","recKernelF","recKernelC","recKernelO","recurrentConv","tfc.conv2d","tfc.serialization","ConvLSTM2D","Dropout","invokeCallHook","getNoiseShape","SpatialDropout1D","Dense","inputLastDim","Flatten","K.batchFlatten","RepeatVector","Reshape","targetShape","isUnknown","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","Permute","expectedSortedIndices","dimsIncludingBatch","Masking","maskValue","booleanMask","Embedding","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","embeddings","inLens","s1","s2","K.gather","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","xNDim","mergeFunction","transposed","xTransposed","mathUtils.arrayProd","mathUtils.range","yNDim","yShape","Add","Multiply","Average","Maximum","Minimum","Concatenate","allNoneShape","shapeSet","shapeWithoutConcatAxis","exists","allNullMasks","concatenatedMasks","tfc.all","interpretAxis","Dot","normalize","interpretAxes","x1","x2","axesArray","diffShape","adjX","adjY","idx","squeezeAxes","batchDot","GaussianNoise","GaussianDropout","AlphaDropout","_getNoiseShape","alphaP","keptIdx","batchNormalization","gamma","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","normalizeBatchInTraining","meanAndVariance","tfc.moments","regularNormalizeBatchInTraining","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","broadcastNormalizeBatchInTraining","BatchNormalization","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","movingMean","movingVariance","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","doMovingAverage","variable","decay","origValue","updateDelta","updateMovingMeanAndVariance","LayerNormalization","nDims","moments","broadcast","momentsTiling","scaleOffsetTiling","ZeroPadding2D","heightPadding","widthPadding","spatial2dPadding","pattern","tfc.pad","pool2d","poolSize","poolMode","paddingString","tfc.maxPool","tfc.avgPool","pool3d","tfc.maxPool3d","tfc.avgPool3d","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","Pooling3D","depths","MaxPooling3D","AveragePooling3D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","timesteps","Bidirectional","forwDict","forwardLayer","backDict","backwardLayer","mergeMode","generic_utils.checkStringTypeUnionValue","_trainable","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","yRev","forwardState","backwardState","rnnLayer","averagePooling1d","averagePooling2d","averagePooling3d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","globalMaxPool1d","globalMaxPool2d","maxPool1d","maxPool2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.sparseCategoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","metrics.precision","metrics.recall","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","modelAndWeightsConfig","weightsManifest","pathPrefix","uniqueWeightValues","Callback","currVal","prevVal","EarlyStopping","restoreBestWeights","monitor","minDelta","patience","baseline","monitorFunc","wait","stoppedEpoch","best","current","getMonitorValue","monitorValue","earlyStopping"],"mappings":";;;;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,KAAKgmF,iCAItBlmF,gBAAgB47C,GACV,MAARA,IACFA,EAAO,IAET,MAAM0qC,EAAe1qC,EAAK17C,KAAK0lF,SAM/B,OALoB,MAAhBU,GACF5lF,QAAQC,KACJ,4BAA4BT,KAAK0lF,oDACPxkF,OAAO8O,KAAK0rC,MAErC0qC,SAmDEhqC,GAAY,CAACiqC,uBAJI3qE,GAC5B,OAAO,IAAI8pE,GAAc9pE"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js deleted file mode 100644 index 738f237cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js +++ /dev/null @@ -1,36964 +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)); -}(this, (function (exports, tfc) { 'use strict'; - - /** - * @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. - * ============================================================================= - */ - const EPSILON_FLOAT32 = 1e-7; - const EPSILON_FLOAT16 = 1e-4; - /** - * The interface that defines the kernels that should be implemented when - * adding a new backend. New backends don't need to implement every one of the - * methods, this can be done gradually (throw an error for unimplemented - * methods). - */ - class KernelBackend { - refCount(dataId) { - return notYetImplemented('refCount'); - } - incRef(dataId) { - return notYetImplemented('incRef'); - } - timerAvailable() { - return true; - } - time(f) { - return notYetImplemented('time'); - } - read(dataId) { - return notYetImplemented('read'); - } - readSync(dataId) { - return notYetImplemented('readSync'); - } - numDataIds() { - return notYetImplemented('numDataIds'); - } - disposeData(dataId, force) { - return notYetImplemented('disposeData'); - } - write(values, shape, dtype) { - return notYetImplemented('write'); - } - move(dataId, values, shape, dtype, refCount) { - return notYetImplemented('move'); - } - memory() { - return notYetImplemented('memory'); - } - /** Returns the highest precision for floats in bits (e.g. 16 or 32) */ - floatPrecision() { - return notYetImplemented('floatPrecision'); - } - /** Returns the smallest representable number. */ - epsilon() { - return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16; - } - dispose() { - return notYetImplemented('dispose'); - } - } - function notYetImplemented(kernelName) { - throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` + - `This kernel may not be supported by the tfjs backend you have chosen`); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Asserts that the expression is true. Otherwise throws an error with the - * provided message. - * - * ```js - * const x = 2; - * tf.util.assert(x === 2, 'x is not 2'); - * ``` - * - * @param expr The expression to assert (as a boolean). - * @param msg A function that returns the message to report when throwing an - * error. We use a function for performance reasons. - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function assert(expr, msg) { - if (!expr) { - throw new Error(typeof msg === 'string' ? msg : msg()); - } - } - function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') { - assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); - } - // NOTE: We explicitly type out what T extends instead of any so that - // util.flatten on a nested array of number doesn't try to infer T as a - // number[][], causing us to explicitly type util.flatten(). - /** - * Flattens an arbitrarily nested array. - * - * ```js - * const a = [[1, 2], [3, 4], [5, [6, [7]]]]; - * const flat = tf.util.flatten(a); - * console.log(flat); - * ``` - * - * @param arr The nested array to flatten. - * @param result The destination array which holds the elements. - * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults - * to false. - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function flatten(arr, result = [], skipTypedArray = false) { - if (result == null) { - result = []; - } - if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) { - for (let i = 0; i < arr.length; ++i) { - flatten(arr[i], result, skipTypedArray); - } - } - else { - result.push(arr); - } - return result; - } - /** - * Returns the size (number of elements) of the tensor given its shape. - * - * ```js - * const shape = [3, 4, 2]; - * const size = tf.util.sizeFromShape(shape); - * console.log(size); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function sizeFromShape(shape) { - if (shape.length === 0) { - // Scalar. - return 1; - } - let size = shape[0]; - for (let i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; - } - function arraysEqual(n1, n2) { - if (n1 === n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - if (n1.length !== n2.length) { - return false; - } - for (let i = 0; i < n1.length; i++) { - if (n1[i] !== n2[i]) { - return false; - } - } - return true; - } - function isInt(a) { - return a % 1 === 0; - } - function rightPad(a, size) { - if (size <= a.length) { - return a; - } - return a + ' '.repeat(size - a.length); - } - function parseAxisParam(axis, shape) { - const rank = shape.length; - // Normalize input - axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); - // Check for valid range - assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + - `got axis ${axis}`); - // Check for only integers - assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` + - `got axis ${axis}`); - // Handle negative axis. - return axis.map(a => a < 0 ? rank + a : a); - } - /** Reduces the shape by removing all dimensions of shape 1. */ - function squeezeShape(shape, axis) { - const newShape = []; - const keptDims = []; - const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; - const axes = (axis == null || isEmptyArray) ? - null : - parseAxisParam(axis, shape).sort(); - let j = 0; - for (let i = 0; i < shape.length; ++i) { - if (axes != null) { - if (axes[j] === i && shape[i] !== 1) { - throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); - } - if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - if (axes[j] <= i) { - j++; - } - } - if (shape[i] !== 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - } - return { newShape, keptDims }; - } - function checkConversionForErrors(vals, dtype) { - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); - } - } - } - /** Returns true if the dtype is valid. */ - function isValidDtype(dtype) { - return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' || - dtype === 'int32' || dtype === 'string'; - } - function isTypedArray(a) { - return a instanceof Float32Array || a instanceof Int32Array || - a instanceof Uint8Array; - } - function bytesPerElement(dtype) { - if (dtype === 'float32' || dtype === 'int32') { - return 4; - } - else if (dtype === 'complex64') { - return 8; - } - else if (dtype === 'bool') { - return 1; - } - else { - throw new Error(`Unknown dtype ${dtype}`); - } - } - /** - * Returns the approximate number of bytes allocated in the string array - 2 - * bytes per character. Computing the exact bytes for a native string in JS is - * not possible since it depends on the encoding of the html page that serves - * the website. - */ - function bytesFromStringArray(arr) { - if (arr == null) { - return 0; - } - let bytes = 0; - arr.forEach(x => bytes += x.length); - return bytes; - } - /** Returns true if the value is a string. */ - function isString(value) { - return typeof value === 'string' || value instanceof String; - } - function isBoolean(value) { - return typeof value === 'boolean'; - } - function isNumber(value) { - return typeof value === 'number'; - } - function inferDtype(values) { - if (Array.isArray(values)) { - return inferDtype(values[0]); - } - if (values instanceof Float32Array) { - return 'float32'; - } - else if (values instanceof Int32Array || values instanceof Uint8Array) { - return 'int32'; - } - else if (isNumber(values)) { - return 'float32'; - } - else if (isString(values)) { - return 'string'; - } - else if (isBoolean(values)) { - return 'bool'; - } - return 'float32'; - } - function isFunction(f) { - return !!(f && f.constructor && f.call && f.apply); - } - function computeStrides(shape) { - const rank = shape.length; - if (rank < 2) { - return []; - } - // Last dimension has implicit stride of 1, thus having D-1 (instead of D) - // strides. - const strides = new Array(rank - 1); - strides[rank - 2] = shape[rank - 1]; - for (let i = rank - 3; i >= 0; --i) { - strides[i] = strides[i + 1] * shape[i + 1]; - } - return strides; - } - function createNestedArray(offset, shape, a, isComplex = false) { - const ret = new Array(); - if (shape.length === 1) { - const d = shape[0] * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = a[offset + i]; - } - } - else { - const d = shape[0]; - const rest = shape.slice(1); - const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = createNestedArray(offset + i * len, rest, a, isComplex); - } - } - return ret; - } - // Provide a nested array of TypedArray in given shape. - function toNestedArray(shape, a, isComplex = false) { - if (shape.length === 0) { - // Scalar type should return a single number. - return a[0]; - } - const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - if (size === 0) { - // A tensor with shape zero should be turned into empty list. - return []; - } - if (size !== a.length) { - throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`); - } - return createNestedArray(0, shape, a, isComplex); - } - function makeOnesTypedArray(size, dtype) { - const array = makeZerosTypedArray(size, dtype); - for (let i = 0; i < array.length; i++) { - array[i] = 1; - } - return array; - } - function makeZerosTypedArray(size, dtype) { - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(size); - } - else if (dtype === 'int32') { - return new Int32Array(size); - } - else if (dtype === 'bool') { - return new Uint8Array(size); - } - else { - throw new Error(`Unknown data type ${dtype}`); - } - } - function assertNonNegativeIntegerDimensions(shape) { - shape.forEach(dimSize => { - assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` + - `shape [${shape}].`); - }); - } - /** - * This method asserts whether an object is a Promise instance. - * @param object - */ - // tslint:disable-next-line: no-any - function isPromise(object) { - // We chose to not use 'obj instanceOf Promise' for two reasons: - // 1. It only reliably works for es6 Promise, not other Promise - // implementations. - // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch - // the async calls, so it is possible the obj (patched) is comparing to a - // pre-patched Promise. - return object && object.then && typeof object.then === 'function'; - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - // Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true. - const TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; - /** - * The environment contains evaluated flags as well as the registered platform. - * This is always used as a global singleton and can be retrieved with - * `tf.env()`. - * - * @doc {heading: 'Environment'} - */ - class Environment { - // tslint:disable-next-line: no-any - constructor(global) { - this.global = global; - this.flags = {}; - this.flagRegistry = {}; - this.urlFlags = {}; - // Jasmine spies on this in 'environment_test.ts' - this.getQueryParams = getQueryParams; - this.populateURLFlags(); - } - setPlatform(platformName, platform) { - if (this.platform != null) { - console.warn(`Platform ${this.platformName} has already been set. ` + - `Overwriting the platform with ${platform}.`); - } - this.platformName = platformName; - this.platform = platform; - } - registerFlag(flagName, evaluationFn, setHook) { - this.flagRegistry[flagName] = { evaluationFn, setHook }; - // Override the flag value from the URL. This has to happen here because the - // environment is initialized before flags get registered. - if (this.urlFlags[flagName] != null) { - const flagValue = this.urlFlags[flagName]; - console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`); - this.set(flagName, flagValue); - } - } - async getAsync(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - this.flags[flagName] = await this.evaluateFlag(flagName); - return this.flags[flagName]; - } - get(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - const flagValue = this.evaluateFlag(flagName); - if (isPromise(flagValue)) { - throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` + - `Please use getAsync() instead.`); - } - this.flags[flagName] = flagValue; - return this.flags[flagName]; - } - getNumber(flagName) { - return this.get(flagName); - } - getBool(flagName) { - return this.get(flagName); - } - getFlags() { - return this.flags; - } - // For backwards compatibility. - get features() { - return this.flags; - } - set(flagName, value) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); - } - this.flags[flagName] = value; - if (this.flagRegistry[flagName].setHook != null) { - this.flagRegistry[flagName].setHook(value); - } - } - evaluateFlag(flagName) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); - } - return this.flagRegistry[flagName].evaluationFn(); - } - setFlags(flags) { - this.flags = Object.assign({}, flags); - } - reset() { - this.flags = {}; - this.urlFlags = {}; - this.populateURLFlags(); - } - populateURLFlags() { - if (typeof this.global === 'undefined' || - typeof this.global.location === 'undefined' || - typeof this.global.location.search === 'undefined') { - return; - } - const urlParams = this.getQueryParams(this.global.location.search); - if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { - const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); - keyValues.forEach(keyValue => { - const [key, value] = keyValue.split(':'); - this.urlFlags[key] = parseValue(key, value); - }); - } - } - } - function getQueryParams(queryString) { - const params = {}; - queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { - decodeParam(params, t[0], t[1]); - return t.join('='); - }); - return params; - } - function decodeParam(params, name, value) { - params[decodeURIComponent(name)] = decodeURIComponent(value || ''); - } - function parseValue(flagName, value) { - value = value.toLowerCase(); - if (value === 'true' || value === 'false') { - return value === 'true'; - } - else if (`${+value}` === value) { - return +value; - } - throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); - } - /** - * Returns the current environment (a global singleton). - * - * The environment object contains the evaluated feature values as well as the - * active platform. - * - * @doc {heading: 'Environment'} - */ - function env() { - return ENV; - } - let ENV = null; - function setEnvironmentGlobal(environment) { - ENV = environment; - } - - /** - * @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. - * ============================================================================= - */ - // Note that the identifier globalNameSpace is scoped to this module, but will - // always resolve to the same global object regardless of how the module is - // resolved. - // tslint:disable-next-line:no-any - let globalNameSpace; - // tslint:disable-next-line:no-any - function getGlobalNamespace() { - if (globalNameSpace == null) { - // tslint:disable-next-line:no-any - let ns; - if (typeof (window) !== 'undefined') { - ns = window; - } - else if (typeof (global) !== 'undefined') { - ns = global; - } - else if (typeof (process) !== 'undefined') { - ns = process; - } - else if (typeof (self) !== 'undefined') { - ns = self; - } - else { - throw new Error('Could not find a global object'); - } - globalNameSpace = ns; - } - return globalNameSpace; - } - // tslint:disable-next-line:no-any - function getGlobalMap() { - const ns = getGlobalNamespace(); - if (ns._tfGlobals == null) { - ns._tfGlobals = new Map(); - } - return ns._tfGlobals; - } - /** - * Returns a globally accessible 'singleton' object. - * - * @param key the name of the object - * @param init a function to initialize to initialize this object - * the first time it is fetched. - */ - function getGlobal(key, init) { - const globalMap = getGlobalMap(); - if (globalMap.has(key)) { - return globalMap.get(key); - } - else { - const singleton = init(); - globalMap.set(key, singleton); - return globalMap.get(key); - } - } - - const Abs = 'Abs'; - const Acos = 'Acos'; - const Acosh = 'Acosh'; - const Add = 'Add'; - const AddN = 'AddN'; - const All = 'All'; - const Any = 'Any'; - const ArgMax = 'ArgMax'; - const ArgMin = 'ArgMin'; - const Asin = 'Asin'; - const Asinh = 'Asinh'; - const Atan = 'Atan'; - const Atanh = 'Atanh'; - const Atan2 = 'Atan2'; - const AvgPool = 'AvgPool'; - const AvgPoolGrad = 'AvgPoolGrad'; - const AvgPool3D = 'AvgPool3D'; - const AvgPool3DGrad = 'AvgPool3DGrad'; - const BatchMatMul = 'BatchMatMul'; - const BatchToSpaceND = 'BatchToSpaceND'; - const BroadcastTo = 'BroadcastTo'; - const Cast = 'Cast'; - const Ceil = 'Ceil'; - const ClipByValue = 'ClipByValue'; - const Complex = 'Complex'; - const ComplexAbs = 'ComplexAbs'; - const Concat = 'Concat'; - const Conv2D = 'Conv2D'; - const Conv2DBackpropFilter = 'Conv2DBackpropFilter'; - const Conv2DBackpropInput = 'Conv2DBackpropInput'; - const Conv3D = 'Conv3D'; - const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2'; - const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2'; - const Cos = 'Cos'; - const Cosh = 'Cosh'; - const Cumsum = 'Cumsum'; - const DepthToSpace = 'DepthToSpace'; - const DepthwiseConv2dNative = 'DepthwiseConv2dNative'; - const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter'; - const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput'; - const Dilation2D = 'Dilation2D'; - const Dilation2DBackpropInput = 'Dilation2DBackpropInput'; - const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter'; - const RealDiv = 'RealDiv'; - const Elu = 'Elu'; - const EluGrad = 'EluGrad'; - const Erf = 'Erf'; - const Equal = 'Equal'; - const Exp = 'Exp'; - const ExpandDims = 'ExpandDims'; - const Expm1 = 'Expm1'; - const FFT = 'FFT'; - const Floor = 'Floor'; - const FloorDiv = 'FloorDiv'; - const FusedBatchNorm = 'FusedBatchNorm'; - const GatherV2 = 'GatherV2'; - const Greater = 'Greater'; - const GreaterEqual = 'GreaterEqual'; - const Identity = 'Identity'; - const IFFT = 'IFFT'; - const Imag = 'Imag'; - const IsFinite = 'IsFinite'; - const IsInf = 'IsInf'; - const IsNan = 'IsNan'; - const LeakyRelu = 'LeakyRelu'; - const Less = 'Less'; - const LessEqual = 'LessEqual'; - const Log = 'Log'; - const Log1p = 'Log1p'; - const LogicalAnd = 'LogicalAnd'; - const LogicalNot = 'LogicalNot'; - const LogicalOr = 'LogicalOr'; - const LogSoftmax = 'LogSoftmax'; - const LRN = 'LRN'; - const LRNGrad = 'LRNGrad'; - const Max = 'Max'; - const Maximum = 'Maximum'; - const MaxPool = 'MaxPool'; - const MaxPoolGrad = 'MaxPoolGrad'; - const MaxPool3D = 'MaxPool3D'; - const MaxPool3DGrad = 'MaxPool3DGrad'; - const Mean = 'Mean'; - const Min = 'Min'; - const Minimum = 'Minimum'; - const MirrorPad = 'MirrorPad'; - const Mod = 'Mod'; - const Multiply = 'Multiply'; - const Neg = 'Neg'; - const NotEqual = 'NotEqual'; - const OnesLike = 'OnesLike'; - const OneHot = 'OneHot'; - const Pack = 'Pack'; - const PadV2 = 'PadV2'; - const Pow = 'Pow'; - const Prelu = 'Prelu'; - const Prod = 'Prod'; - const Real = 'Real'; - const Reciprocal = 'Reciprocal'; - const Relu = 'Relu'; - const Reshape = 'Reshape'; - const ResizeNearestNeighbor = 'ResizeNearestNeighbor'; - const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad'; - const ResizeBilinear = 'ResizeBilinear'; - const ResizeBilinearGrad = 'ResizeBilinearGrad'; - const Relu6 = 'Relu6'; - const Reverse = 'Reverse'; - const Round = 'Round'; - const Rsqrt = 'Rsqrt'; - const Select = 'Select'; - const Selu = 'Selu'; - const Slice = 'Slice'; - const Sin = 'Sin'; - const Sinh = 'Sinh'; - const Sign = 'Sign'; - const Sigmoid = 'Sigmoid'; - const Softplus = 'Softplus'; - const Sqrt = 'Sqrt'; - const Sum = 'Sum'; - const SpaceToBatchND = 'SpaceToBatchND'; - const SplitV = 'SplitV'; - const Softmax = 'Softmax'; - const SquaredDifference = 'SquaredDifference'; - const Square = 'Square'; - const StridedSlice = 'StridedSlice'; - const Sub = 'Sub'; - const Tan = 'Tan'; - const Tanh = 'Tanh'; - const Tile = 'Tile'; - const TopK = 'TopK'; - const Transpose = 'Transpose'; - const Unique = 'Unique'; - const Unpack = 'Unpack'; - const UnsortedSegmentSum = 'UnsortedSegmentSum'; - const ZerosLike = 'ZerosLike'; - /** - * TensorFlow.js-only kernels - */ - const Step = 'Step'; - - /** - * @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. - * ============================================================================= - */ - const kernelRegistry = getGlobal('kernelRegistry', () => new Map()); - const gradRegistry = getGlobal('gradRegistry', () => new Map()); - /** - * Returns the kernel function (code) associated with the provided names. - * - * @param kernelName The official name of the kernel. - * @param backendName The official name of the backend. - */ - function getKernel(kernelName, backendName) { - const key = makeKey(kernelName, backendName); - return kernelRegistry.get(key); - } - /** - * Returns the registered gradient info associated with the provided kernel. - * @param kernelName The official TF kernel name. - */ - function getGradient(kernelName) { - return gradRegistry.get(kernelName); - } - function getKernelsForBackend(backendName) { - const it = kernelRegistry.entries(); - const result = []; - while (true) { - const { done, value } = it.next(); - if (done) { - break; - } - const [key, config] = value; - const [backend,] = key.split('_'); - if (backend === backendName) { - result.push(config); - } - } - return result; - } - /** - * Registers a gradient function for a given kernel in the global registry, - * to be used during the back-propagation of that kernel. - * - * @param config An object with the following properties: - * - `kernelName` The name of the kernel that the gradient function is for. - * - `gradFunc` The function to run during back-propagation. - */ - function registerGradient(config) { - const { kernelName } = config; - if (gradRegistry.has(kernelName)) { - // TODO (yassogba) after 3.0 assess whether we need to keep this gated - // to debug mode. - if (env().getBool('DEBUG')) { - console.warn(`Overriding the gradient for '${kernelName}'`); - } - } - gradRegistry.set(kernelName, config); - } - function makeKey(kernelName, backendName) { - return `${backendName}_${kernelName}`; - } - - /** - * @license - * Copyright 2017 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 noConversionNeeded(a, dtype) { - return (a instanceof Float32Array && dtype === 'float32') || - (a instanceof Int32Array && dtype === 'int32') || - (a instanceof Uint8Array && dtype === 'bool'); - } - function toTypedArray(a, dtype) { - if (dtype === 'string') { - throw new Error('Cannot convert a string[] to a TypedArray'); - } - if (Array.isArray(a)) { - a = flatten(a); - } - if (env().getBool('DEBUG')) { - checkConversionForErrors(a, dtype); - } - if (noConversionNeeded(a, dtype)) { - return a; - } - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(a); - } - else if (dtype === 'int32') { - return new Int32Array(a); - } - else if (dtype === 'bool') { - const bool = new Uint8Array(a.length); - for (let i = 0; i < bool.length; ++i) { - if (Math.round(a[i]) !== 0) { - bool[i] = 1; - } - } - return bool; - } - else { - throw new Error(`Unknown data type ${dtype}`); - } - } - /** - * Returns the current high-resolution time in milliseconds relative to an - * arbitrary time in the past. It works across different platforms (node.js, - * browsers). - * - * ```js - * console.log(tf.util.now()); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ - function now() { - return env().platform.now(); - } - /** - * Encodes the provided string into bytes using the provided encoding scheme. - * - * @param s The string to encode. - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ - function encodeString(s, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.encode(s, encoding); - } - /** - * Decodes the provided bytes into a string using the provided encoding scheme. - * @param bytes The bytes to decode. - * - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ - function decodeString(bytes, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.decode(bytes, encoding); - } - - /** - * @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 Profiler { - constructor(backendTimer, logger) { - this.backendTimer = backendTimer; - this.logger = logger; - if (logger == null) { - this.logger = new Logger(); - } - } - profileKernel(kernelName, inputs, f) { - let outputs; - const holdResultWrapperFn = () => { - outputs = f(); - }; - let timer; - const start = now(); - if (this.backendTimer.timerAvailable()) { - timer = this.backendTimer.time(holdResultWrapperFn); - } - else { - holdResultWrapperFn(); - for (const output of outputs) { - output.dataSync(); - } - timer = Promise.resolve({ kernelMs: now() - start }); - } - if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) { - for (let i = 0; i < outputs.length; i++) { - const output = outputs[i]; - // Dangling promise here because we don't want to propagate up - // asynchronicity. - output.data().then(tensorVals => { - checkComputationForErrors(tensorVals, output.dtype, kernelName); - }); - } - } - const kernelProfile = { - kernelName, - outputs, - inputs, - timeMs: timer.then(timing => timing.kernelMs), - extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ? - timing.getExtraProfileInfo() : - '') - }; - return kernelProfile; - } - logKernelProfile(kernelProfile) { - const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile; - outputs.forEach(result => { - Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => { - this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]); - }); - }); - } - } - function checkComputationForErrors(vals, dtype, kernelName) { - if (dtype !== 'float32') { - // Only floating point computations will generate NaN values - return false; - } - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - // Throwing custom exception so behavior is testable. - console.warn(`Found ${num} in the result of '${kernelName}'`); - return true; - } - } - return false; - } - class Logger { - logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { - const time = typeof timeMs === 'number' ? rightPad(`${timeMs}ms`, 9) : - timeMs['error']; - const paddedName = rightPad(name, 25); - const rank = result.rank; - const size = result.size; - const shape = rightPad(result.shape.toString(), 14); - let inputShapesDescription = ''; - for (const name in inputs) { - const input = inputs[name]; - if (input != null) { - // The input might be a non-tensor (e.g HTMLImageElement), in which case - // we claim the output shape as input shape. - const inputShape = input.shape || result.shape; - const inputRank = inputShape.length; - inputShapesDescription += - `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `; - } - } - console.log(`%c${paddedName}\t%c${time}\t%c${rank}D ${shape}\t%c${size}\t%c${inputShapesDescription}\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue'); - } - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Computes a list of TapeNodes that connect x to y, filtering everything else - * out and preserving the order of the original tape elements. - * - * @param tape The tape elements to filter. - * @param xs The input Tensors. - * @param y The output Tensor. - */ - function getFilteredNodesXToY(tape, xs, y) { - // Forward pass to compute all the nodes and Tensors that are transitively a - // function of x. - const tensorsFromX = {}; - const nodesFromX = {}; - for (let i = 0; i < xs.length; i++) { - tensorsFromX[xs[i].id] = true; - } - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - const nodeInputs = node.inputs; - for (const inputName in nodeInputs) { - const input = nodeInputs[inputName]; - let anyInputFromX = false; - for (let j = 0; j < xs.length; j++) { - if (tensorsFromX[input.id]) { - node.outputs.forEach(output => tensorsFromX[output.id] = true); - anyInputFromX = true; - nodesFromX[node.id] = true; - break; - } - } - if (anyInputFromX) { - break; - } - } - } - // Backward pass to find all of the nodes and Tensors that lead to y. - const tensorsLeadToY = {}; - tensorsLeadToY[y.id] = true; - const nodesToY = {}; - for (let i = tape.length - 1; i >= 0; i--) { - const node = tape[i]; - const nodeInputs = node.inputs; - // If any of the outputs lead to y, mark all of the inputs as leading to y. - for (let j = 0; j < node.outputs.length; j++) { - if (tensorsLeadToY[node.outputs[j].id]) { - for (const inputName in nodeInputs) { - tensorsLeadToY[nodeInputs[inputName].id] = true; - nodesToY[node.id] = true; - } - break; - } - } - } - // Return the paths that come from x and lead to y. - const filteredTape = []; - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - if (nodesFromX[node.id] && nodesToY[node.id]) { - // Prune the inputs from the node that aren't a function of x. - const prunedInputs = {}; - for (const inputName in node.inputs) { - const nodeInput = node.inputs[inputName]; - if (tensorsFromX[nodeInput.id]) { - prunedInputs[inputName] = nodeInput; - } - } - // Copy the node and overwrite inputsAndArgs to the pruned version. - const prunedNode = Object.assign({}, node); - prunedNode.inputs = prunedInputs; - prunedNode.outputs = node.outputs; - filteredTape.push(prunedNode); - } - } - return filteredTape; - } - /** - * Backpropagate gradients through the filtered TapeNodes. - * - * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map - * is mutated by this method. - * @param filteredTape The filtered TapeNodes to backprop through. - */ - function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) { - // Walk the tape backward and keep a map of Tensor to its gradient. - for (let i = filteredTape.length - 1; i >= 0; i--) { - const node = filteredTape[i]; - const dys = []; - node.outputs.forEach(o => { - const gradTensor = tensorAccumulatedGradientMap[o.id]; - if (gradTensor != null) { - dys.push(gradTensor); - } - else { - // This particular output is not in the back-propagation subgraph, so it - // does not affect the final output, thus we put null for its dy. - dys.push(null); - } - }); - if (node.gradient == null) { - throw new Error(`Cannot compute gradient: gradient function not found ` + - `for ${node.kernelName}.`); - } - // Backprop dy through this node and accumulate gradients over the inputs. - const inputGradients = node.gradient(dys); - for (const inputName in node.inputs) { - if (!(inputName in inputGradients)) { - throw new Error(`Cannot backprop through input ${inputName}. ` + - `Available gradients found: ${Object.keys(inputGradients)}.`); - } - // Call the gradient function. - const dx = tidy(() => inputGradients[inputName]()); - if (dx.dtype !== 'float32') { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); - } - const x = node.inputs[inputName]; - if (!arraysEqual(dx.shape, x.shape)) { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `'${inputName}' has shape '${dx.shape}', which does not match ` + - `the shape of the input '${x.shape}'`); - } - if (tensorAccumulatedGradientMap[x.id] == null) { - tensorAccumulatedGradientMap[x.id] = dx; - } - else { - const curGradient = tensorAccumulatedGradientMap[x.id]; - tensorAccumulatedGradientMap[x.id] = add(curGradient, dx); - curGradient.dispose(); - } - } - } - } - - /** - * @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. - * ============================================================================= - */ - // Maximum number of values before we decide to show ellipsis. - const FORMAT_LIMIT_NUM_VALS = 20; - // Number of first and last values to show when displaying a, b,...,y, z. - const FORMAT_NUM_FIRST_LAST_VALS = 3; - // Number of significant digits to show. - const FORMAT_NUM_SIG_DIGITS = 7; - function tensorToString(vals, shape, dtype, verbose) { - const strides = computeStrides(shape); - const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides); - const rank = shape.length; - const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol); - const lines = ['Tensor']; - if (verbose) { - lines.push(` dtype: ${dtype}`); - lines.push(` rank: ${rank}`); - lines.push(` shape: [${shape}]`); - lines.push(` values:`); - } - lines.push(valsLines.map(l => ' ' + l).join('\n')); - return lines.join('\n'); - } - function computeMaxSizePerColumn(vals, shape, dtype, strides) { - const n = sizeFromShape(shape); - const numCols = strides[strides.length - 1]; - const padPerCol = new Array(numCols).fill(0); - const rank = shape.length; - const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals; - if (rank > 1) { - for (let row = 0; row < n / numCols; row++) { - const offset = row * numCols; - for (let j = 0; j < numCols; j++) { - padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length); - } - } - } - return padPerCol; - } - function valToString(val, pad, dtype) { - let valStr; - if (Array.isArray(val)) { - valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` + - `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; - } - else if (isString(val)) { - valStr = `'${val}'`; - } - else if (dtype === 'bool') { - valStr = boolNumToString(val); - } - else { - valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); - } - return rightPad(valStr, pad); - } - function boolNumToString(v) { - return v === 0 ? 'false' : 'true'; - } - function subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) { - const storagePerElement = dtype === 'complex64' ? 2 : 1; - const size = shape[0]; - const rank = shape.length; - if (rank === 0) { - if (dtype === 'complex64') { - const complexTuple = createComplexTuples(vals); - return [valToString(complexTuple[0], 0, dtype)]; - } - if (dtype === 'bool') { - return [boolNumToString(vals[0])]; - } - return [vals[0].toString()]; - } - if (rank === 1) { - if (size > FORMAT_LIMIT_NUM_VALS) { - const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement; - let firstVals = Array.from(vals.slice(0, firstValsSize)); - let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement)); - if (dtype === 'complex64') { - firstVals = createComplexTuples(firstVals); - lastVals = createComplexTuples(lastVals); - } - return [ - '[' + - firstVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ', ..., ' + - lastVals - .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype)) - .join(', ') + - ']' - ]; - } - const displayVals = dtype === 'complex64' ? createComplexTuples(vals) : - Array.from(vals); - return [ - '[' + - displayVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ']' - ]; - } - // The array is rank 2 or more. - const subshape = shape.slice(1); - const substrides = strides.slice(1); - const stride = strides[0] * storagePerElement; - const lines = []; - if (size > FORMAT_LIMIT_NUM_VALS) { - for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */)); - } - lines.push('...'); - for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - else { - for (let i = 0; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - const sep = rank === 2 ? ',' : ''; - lines[0] = '[' + lines[0] + sep; - for (let i = 1; i < lines.length - 1; i++) { - lines[i] = ' ' + lines[i] + sep; - } - let newLineSep = ',\n'; - for (let i = 2; i < rank; i++) { - newLineSep += '\n'; - } - lines[lines.length - 1] = - ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); - return lines; - } - function createComplexTuples(vals) { - const complexTuples = []; - for (let i = 0; i < vals.length; i += 2) { - complexTuples.push([vals[i], vals[i + 1]]); - } - return complexTuples; - } - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - // For tracking tensor creation and disposal. - let trackerFn = null; - // Used by chaining methods to call into ops. - let opHandler = null; - /** - * An external consumer can register itself as the tensor tracker. This way - * the Tensor class can notify the tracker for every tensor created and - * disposed. - */ - function setTensorTracker(fn) { - trackerFn = fn; - } - /** - * A `tf.Tensor` object represents an immutable, multidimensional array of - * numbers that has a shape and a data type. - * - * For performance reasons, functions that create tensors do not necessarily - * perform a copy of the data passed to them (e.g. if the data is passed as a - * `Float32Array`), and changes to the data will change the tensor. This is not - * a feature and is not supported. To avoid this behavior, use the tensor before - * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`. - * - * See `tf.tensor` for details on how to create a `tf.Tensor`. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - class Tensor { - constructor(shape, dtype, dataId, id) { - /** Whether this tensor has been globally kept. */ - this.kept = false; - this.isDisposedInternal = false; - this.shape = shape.slice(); - this.dtype = dtype || 'float32'; - this.size = sizeFromShape(shape); - this.strides = computeStrides(shape); - this.dataId = dataId; - this.id = id; - this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); - } - get rank() { - return this.shape.length; - } - /** - * Returns a promise of `tf.TensorBuffer` that holds the underlying data. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async buffer() { - const vals = await this.data(); - return opHandler.buffer(this.shape, this.dtype, vals); - } - /** - * Returns a `tf.TensorBuffer` that holds the underlying data. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - bufferSync() { - return opHandler.buffer(this.shape, this.dtype, this.dataSync()); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * asynchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async array() { - const vals = await this.data(); - return toNestedArray(this.shape, vals, this.dtype === 'complex64'); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * synchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - arraySync() { - return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64'); - } - /** - * Asynchronously downloads the values from the `tf.Tensor`. Returns a - * promise of `TypedArray` that resolves when the computation has finished. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async data() { - this.throwIfDisposed(); - const data = trackerFn().read(this.dataId); - if (this.dtype === 'string') { - const bytes = await data; - try { - return bytes.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** - * Synchronously downloads the values from the `tf.Tensor`. This blocks the - * UI thread until the values are ready, which can cause performance issues. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dataSync() { - this.throwIfDisposed(); - const data = trackerFn().readSync(this.dataId); - if (this.dtype === 'string') { - try { - return data.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** Returns the underlying bytes of the tensor's data. */ - async bytes() { - this.throwIfDisposed(); - const data = await trackerFn().read(this.dataId); - if (this.dtype === 'string') { - return data; - } - else { - return new Uint8Array(data.buffer); - } - } - /** - * Disposes `tf.Tensor` from memory. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dispose() { - if (this.isDisposed) { - return; - } - trackerFn().disposeTensor(this); - this.isDisposedInternal = true; - } - get isDisposed() { - return this.isDisposedInternal; - } - throwIfDisposed() { - if (this.isDisposed) { - throw new Error(`Tensor is disposed.`); - } - } - /** - * Prints the `tf.Tensor`. See `tf.print` for details. - * - * @param verbose Whether to print verbose information about the tensor, - * including dtype and size. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - print(verbose = false) { - return opHandler.print(this, verbose); - } - /** - * Returns a copy of the tensor. See `tf.clone` for details. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - clone() { - this.throwIfDisposed(); - return opHandler.clone(this); - } - /** - * Returns a human-readable description of the tensor. Useful for logging. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - toString(verbose = false) { - const vals = this.dataSync(); - return tensorToString(vals, this.shape, this.dtype, verbose); - } - cast(dtype) { - this.throwIfDisposed(); - return opHandler.cast(this, dtype); - } - variable(trainable = true, name, dtype) { - this.throwIfDisposed(); - return trackerFn().makeVariable(this, trainable, name, dtype); - } - } - Object.defineProperty(Tensor, Symbol.hasInstance, { - value: (instance) => { - // Implementation note: we should use properties of the object that will be - // defined before the constructor body has finished executing (methods). - // This is because when this code is transpiled by babel, babel will call - // classCallCheck before the constructor body is run. - // See https://github.com/tensorflow/tfjs/issues/3384 for backstory. - return !!instance && instance.data != null && instance.dataSync != null && - instance.throwIfDisposed != null; - } - }); - function getGlobalTensorClass() { - // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules - // being returned for this file depending on the path they are loaded from. - return getGlobal('Tensor', () => { - return Tensor; - }); - } - // Global side effect. Cache global reference to Tensor class - getGlobalTensorClass(); - /** - * A mutable `tf.Tensor`, useful for persisting state, e.g. for training. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - class Variable extends Tensor { - constructor(initialValue, trainable, name, tensorId) { - super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); - this.trainable = trainable; - this.name = name; - } - /** - * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have - * the same shape and dtype as the old `tf.Tensor`. - * - * @param newValue New tensor to be assigned to this variable. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - assign(newValue) { - if (newValue.dtype !== this.dtype) { - throw new Error(`dtype of the new value (${newValue.dtype}) and ` + - `previous value (${this.dtype}) must match`); - } - if (!arraysEqual(newValue.shape, this.shape)) { - throw new Error(`shape of the new value (${newValue.shape}) and ` + - `previous value (${this.shape}) must match`); - } - trackerFn().disposeTensor(this); - this.dataId = newValue.dataId; - trackerFn().incRef(this, null /* backend */); - } - dispose() { - trackerFn().disposeVariable(this); - this.isDisposedInternal = true; - } - } - Object.defineProperty(Variable, Symbol.hasInstance, { - value: (instance) => { - return instance instanceof Tensor && instance.assign != null && - instance.assign instanceof Function; - } - }); - - /** - * @license - * Copyright 2017 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 Rank; - (function (Rank) { - Rank["R0"] = "R0"; - Rank["R1"] = "R1"; - Rank["R2"] = "R2"; - Rank["R3"] = "R3"; - Rank["R4"] = "R4"; - Rank["R5"] = "R5"; - Rank["R6"] = "R6"; - })(Rank || (Rank = {})); - // Looks for upcasting types. Used, for example, in operations with mixed dtype - // inputs. - var UpcastInt32AndMap; - (function (UpcastInt32AndMap) { - UpcastInt32AndMap["float32"] = "float32"; - UpcastInt32AndMap["int32"] = "int32"; - UpcastInt32AndMap["bool"] = "int32"; - UpcastInt32AndMap["complex64"] = "complex64"; - })(UpcastInt32AndMap || (UpcastInt32AndMap = {})); - var UpcastBoolAndMap; - (function (UpcastBoolAndMap) { - UpcastBoolAndMap["float32"] = "float32"; - UpcastBoolAndMap["int32"] = "int32"; - UpcastBoolAndMap["bool"] = "bool"; - UpcastBoolAndMap["complex64"] = "complex64"; - })(UpcastBoolAndMap || (UpcastBoolAndMap = {})); - var UpcastFloat32AndMap; - (function (UpcastFloat32AndMap) { - UpcastFloat32AndMap["float32"] = "float32"; - UpcastFloat32AndMap["int32"] = "float32"; - UpcastFloat32AndMap["bool"] = "float32"; - UpcastFloat32AndMap["complex64"] = "complex64"; - })(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); - var UpcastComplex64AndMap; - (function (UpcastComplex64AndMap) { - UpcastComplex64AndMap["float32"] = "complex64"; - UpcastComplex64AndMap["int32"] = "complex64"; - UpcastComplex64AndMap["bool"] = "complex64"; - UpcastComplex64AndMap["complex64"] = "complex64"; - })(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); - const upcastTypeMap = { - 'float32': UpcastFloat32AndMap, - 'int32': UpcastInt32AndMap, - 'bool': UpcastBoolAndMap, - 'complex64': UpcastComplex64AndMap - }; - function upcastType(typeA, typeB) { - if (typeA === 'string' || typeB === 'string') { - if (typeA === 'string' && typeB === 'string') { - return 'string'; - } - throw new Error(`Can not upcast ${typeA} with ${typeB}`); - } - return upcastTypeMap[typeA][typeB]; - } - - /** - * @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 makeTypesMatch(a, b) { - if (a.dtype === b.dtype) { - return [a, b]; - } - const dtype = upcastType(a.dtype, b.dtype); - return [a.cast(dtype), b.cast(dtype)]; - } - /** - * Extracts any `Tensor`s found within the provided object. - * - * @param container an object that may be a `Tensor` or may directly contain - * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it - * is safe to pass any object here, except that `Promise`s are not - * supported. - * @returns An array of `Tensors` found within the passed object. If the - * argument is simply a `Tensor', a list containing that `Tensor` is - * returned. If the object is not a `Tensor` or does not - * contain `Tensors`, an empty list is returned. - */ - function getTensorsInContainer(result) { - const list = []; - const seen = new Set(); - walkTensorContainer(result, list, seen); - return list; - } - function walkTensorContainer(container, list, seen) { - if (container == null) { - return; - } - if (container instanceof Tensor) { - list.push(container); - return; - } - if (!isIterable(container)) { - return; - } - // Iteration over keys works also for arrays. - const iterable = container; - for (const k in iterable) { - const val = iterable[k]; - if (!seen.has(val)) { - seen.add(val); - walkTensorContainer(val, list, seen); - } - } - } - // tslint:disable-next-line:no-any - function isIterable(obj) { - return Array.isArray(obj) || typeof obj === 'object'; - } - - /** - * @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 isRegisteredKernelInvocation(kernelInvocation) { - return kernelInvocation.kernelName != null; - } - class EngineState { - constructor() { - // Public since optimizers will use it. - this.registeredVariables = {}; - this.nextTapeNodeId = 0; - this.numBytes = 0; - this.numTensors = 0; - this.numStringTensors = 0; - this.numDataBuffers = 0; - // Number of nested tf.grad() statements when computing higher-order - // gradients. E.g. `1` for first-order gradients and `2` for second-order - // gradients. Used to track if the tape should be removed after a backprop. - this.gradientDepth = 0; - // Number of nested kernel calls. When kernel depth is greater than 1, we turn - // off the tape. - this.kernelDepth = 0; - this.scopeStack = []; - /** - * Keeps track of the number of data moves during a kernel execution. We - * maintain a stack since kernels can call other kernels, recursively. - */ - this.numDataMovesStack = []; - this.nextScopeId = 0; - this.tensorInfo = new WeakMap(); - this.profiling = false; - this.activeProfile = { - newBytes: 0, - newTensors: 0, - peakBytes: 0, - kernels: [], - result: null, - get kernelNames() { - return Array.from(new Set(this.kernels.map(k => k.name))); - } - }; - } - dispose() { - for (const variableName in this.registeredVariables) { - this.registeredVariables[variableName].dispose(); - } - } - } - class Engine { - constructor(ENV) { - this.ENV = ENV; - this.registry = {}; - this.registryFactory = {}; - this.pendingBackendInitId = 0; - this.state = new EngineState(); - } - async ready() { - if (this.pendingBackendInit != null) { - return this.pendingBackendInit.then(() => { }); - } - if (this.backendInstance != null) { - return; - } - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const success = await this.initializeBackend(backendName).success; - if (success) { - await this.setBackend(backendName); - return; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - get backend() { - if (this.pendingBackendInit != null) { - throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` + - `sure to await tf.ready() or await tf.setBackend() before calling ` + - `other methods`); - } - if (this.backendInstance == null) { - const { name, asyncInit } = this.initializeBackendsAndReturnBest(); - if (asyncInit) { - throw new Error(`The highest priority backend '${name}' has not yet been ` + - `initialized. Make sure to await tf.ready() or ` + - `await tf.setBackend() before calling other methods`); - } - this.setBackend(name); - } - return this.backendInstance; - } - backendNames() { - return Object.keys(this.registryFactory); - } - findBackend(backendName) { - if (!(backendName in this.registry)) { - // If the backend hasn't been initialized but we have a registry entry for - // it, initialize it and return it. - if (backendName in this.registryFactory) { - const { asyncInit } = this.initializeBackend(backendName); - if (asyncInit) { - // Backend is not ready yet. - return null; - } - } - else { - return null; - } - } - return this.registry[backendName]; - } - findBackendFactory(backendName) { - if (!(backendName in this.registryFactory)) { - return null; - } - return this.registryFactory[backendName].factory; - } - registerBackend(backendName, factory, priority = 1) { - if (backendName in this.registryFactory) { - console.warn(`${backendName} backend was already registered. ` + - `Reusing existing backend factory.`); - return false; - } - this.registryFactory[backendName] = { factory, priority }; - return true; - } - async setBackend(backendName) { - if (this.registryFactory[backendName] == null) { - throw new Error(`Backend name '${backendName}' not found in registry`); - } - this.backendName = backendName; - if (this.registry[backendName] == null) { - this.backendInstance = null; - const { success, asyncInit } = this.initializeBackend(backendName); - const result = asyncInit ? await success : success; - if (!result) { - return false; - } - } - this.backendInstance = this.registry[backendName]; - this.setupRegisteredKernels(); - // Reset the profiler. - this.profiler = new Profiler(this.backendInstance); - return true; - } - setupRegisteredKernels() { - const kernels = getKernelsForBackend(this.backendName); - kernels.forEach(kernel => { - if (kernel.setupFunc != null) { - kernel.setupFunc(this.backendInstance); - } - }); - } - disposeRegisteredKernels(backendName) { - const kernels = getKernelsForBackend(backendName); - kernels.forEach(kernel => { - if (kernel.disposeFunc != null) { - kernel.disposeFunc(this.registry[backendName]); - } - }); - } - /** - * Initializes a backend by looking up the backend name in the factory - * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if - * there is no backend in the factory registry. - */ - initializeBackend(backendName) { - const registryFactoryEntry = this.registryFactory[backendName]; - if (registryFactoryEntry == null) { - throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); - } - try { - const backend = registryFactoryEntry.factory(); - /* Test if the factory returns a promise. - Done in a more liberal way than - previous 'Promise.resolve(backend)===backend' - as we needed to account for custom Promise - implementations (e.g. Angular) */ - if (backend && !(backend instanceof KernelBackend) && - typeof backend.then === 'function') { - const promiseId = ++this.pendingBackendInitId; - const success = backend - .then(backendInstance => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.registry[backendName] = backendInstance; - this.pendingBackendInit = null; - return true; - }) - .catch(err => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.pendingBackendInit = null; - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return false; - }); - this.pendingBackendInit = success; - return { success, asyncInit: true }; - } - else { - this.registry[backendName] = backend; - return { success: true, asyncInit: false }; - } - } - catch (err) { - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return { success: false, asyncInit: false }; - } - } - removeBackend(backendName) { - if (!(backendName in this.registryFactory)) { - throw new Error(`${backendName} backend not found in registry`); - } - if (this.backendName === backendName && this.pendingBackendInit != null) { - // There is a pending promise of the backend we want to remove. Make it - // obsolete. - this.pendingBackendInitId++; - } - if (backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - delete this.registryFactory[backendName]; - // Unset the backend if it is active. - if (this.backendName === backendName) { - this.pendingBackendInit = null; - this.backendName = null; - this.backendInstance = null; - } - } - getSortedBackends() { - if (Object.keys(this.registryFactory).length === 0) { - throw new Error('No backend found in registry.'); - } - return Object.keys(this.registryFactory).sort((a, b) => { - // Highest priority comes first. - return this.registryFactory[b].priority - - this.registryFactory[a].priority; - }); - } - initializeBackendsAndReturnBest() { - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const { success, asyncInit } = this.initializeBackend(backendName); - if (asyncInit || success) { - return { name: backendName, asyncInit }; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - moveData(backend, dataId) { - const info = this.state.tensorInfo.get(dataId); - const srcBackend = info.backend; - const values = this.readSync(dataId); - const refCount = srcBackend.refCount(dataId); - // Delete the tensor from the old backend and move it to the new - // backend. - srcBackend.disposeData(dataId, true); - info.backend = backend; - backend.move(dataId, values, info.shape, info.dtype, refCount); - if (this.shouldCheckForMemLeaks()) { - // Track the number of moves during a kernel execution to correctly - // detect memory leaks. - this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; - } - } - tidy(nameOrFn, fn) { - let name = null; - if (fn == null) { - // Called with only 1 argument. - if (typeof nameOrFn !== 'function') { - throw new Error('Please provide a function to tidy()'); - } - fn = nameOrFn; - } - else { - // Called with 2 arguments. - if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { - throw new Error('When calling with two arguments, the first argument ' + - 'to tidy() must be a string'); - } - if (typeof fn !== 'function') { - throw new Error('When calling with two arguments, the 2nd argument ' + - 'to tidy() must be a function'); - } - name = nameOrFn; - // TODO(nsthorat,smilkov): Do operation logging and performance - // profiling. - } - let result; - return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { - result = fn(); - if (result instanceof Promise) { - console.error('Cannot return a Promise inside of tidy.'); - } - return result; - }); - } - scopedRun(start, end, f) { - start(); - try { - const res = f(); - end(); - return res; - } - catch (ex) { - end(); - throw ex; - } - } - nextTensorId() { - return Engine.nextTensorId++; - } - nextVariableId() { - return Engine.nextVariableId++; - } - /** - * This method is called instead of the public-facing tensor.clone() when - * saving a tensor for backwards pass. It makes sure to add the clone - * operation to the tape regardless of being called inside a kernel - * execution. - */ - clone(x) { - const y = ENGINE.runKernel(Identity, { x }); - const inputs = { x }; - const grad = (dy) => ({ - x: () => { - const dtype = 'float32'; - const gradInputs = { x: dy }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, gradInputs, - // tslint:disable-next-line: no-unnecessary-type-assertion - attrs); - } - }); - const saved = []; - this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {}); - return y; - } - /** - * Execute a kernel with the given name and return the output tensor. - * - * @param kernelName The name of the kernel to execute. - * @param inputs A map of input names to tensors. - * @param attrs A map of attribute names to their values. An attribute is a - * primitive (non-tensor) input to the kernel. - * @param inputsToSave A list of tensors, inputs to save for the backprop - * computation. - * @param outputsToSave A list of booleans, specifying which output to save - * for the backprop computation. These are booleans since the output - * tensors are not visible to the user. - */ - runKernel(kernelName, inputs, attrs) { - const hasKernel = getKernel(kernelName, this.backendName) != null; - if (!hasKernel) { - throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`); - } - return this.runKernelFunc({ kernelName, inputs, attrs }); - } - shouldCheckForMemLeaks() { - return this.ENV.getBool('IS_TEST'); - } - checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { - const numDataIdsAfter = this.backend.numDataIds(); - // Count the number of data ids associated with the result of the kernel. - let numOutputDataIds = 0; - outInfos.forEach(info => { - // Complex numbers allocate 3 data ids, one for 'real', one for - // 'imaginary', and one for the container that holds the former two. - numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1); - }); - // Account for the number of moves during kernel execution. A "data move" - // can happen in the middle of a kernel execution, placing a new (key,value) - // pair in the data storage. Since data moves have net zero effect (we - // always remove the data from the old backend), we have to cancel them out - // when detecting memory leaks. - const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; - const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; - if (dataIdsLeaked > 0) { - throw new Error(`Backend '${this.backendName}' has an internal memory leak ` + - `(${dataIdsLeaked} data ids) after running '${kernelName}'`); - } - } - /** - * Internal helper method to execute a kernel Func - * - * Use `runKernel` to execute kernels from outside of engine. - */ - runKernelFunc(kernelParams) { - let outputs; - let saved = []; - const isTapeOn = this.isTapeOn(); - const startingBytecount = this.state.numBytes; - const startingNumTensors = this.state.numTensors; - if (this.shouldCheckForMemLeaks()) { - this.state.numDataMovesStack.push(0); - } - let kernelFunc; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - let out; - const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ? - kernelParams.kernelName : - this.state.activeScope != null ? this.state.activeScope.name : ''; - // Create the kernelFunc from either a registered kernel OR passed in - // forward/backward functions (used by custom grad). In this context a - // kernelFunc wraps a kernel implementation with some bookkeeping. - if (isRegisteredKernelInvocation(kernelParams)) { - const { kernelName, inputs, attrs } = kernelParams; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - const kernel = getKernel(kernelName, this.backendName); - assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`); - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = kernel.kernelFunc({ inputs, attrs, backend: this.backend }); - const outInfos = Array.isArray(out) ? out : [out]; - if (this.shouldCheckForMemLeaks()) { - this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); - } - const outTensors = outInfos.map((outInfo) => { - // todo (yassogba) remove this option (Tensor) when node backend - // methods have been modularized and they all return tensorInfo. - // TensorInfos do not have a rank attribute. - if (outInfo.rank != null) { - return outInfo; - } - const { dataId, shape, dtype } = outInfo; - return this.makeTensorFromDataId(dataId, shape, dtype); - }); - // Save any required inputs and outputs. - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since there would be no backprop for these tensors - // (which would otherwise dispose them). - if (isTapeOn) { - const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors); - saved = this.saveTensorsForBackwardMode(tensorsToSave); - } - return outTensors; - }; - } - else { - const { forwardFunc } = kernelParams; - // Running a customGrad op. - const saveFunc = (tensors) => { - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since we would never run backprop, which disposes - // the kept tensors. - if (!isTapeOn) { - return; - } - saved = tensors.map(tensor => this.keep(this.clone(tensor))); - }; - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = this.tidy(() => forwardFunc(this.backend, saveFunc)); - const outs = (Array.isArray(out) ? out : [out]); - if (this.shouldCheckForMemLeaks()) { - // Scope name is used to print a more helpful error message if needed. - this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs); - } - return outs; - }; - } - // - // Run the kernelFunc. Optionally profiling it. - // - const { inputs, attrs } = kernelParams; - const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ? - null : - kernelParams.backwardsFunc; - let kernelProfile; - this.scopedRun( - // Stop recording to a tape when running a kernel. - () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { - if (!this.ENV.getBool('DEBUG') && !this.state.profiling) { - outputs = kernelFunc(); - } - else { - kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc()); - if (this.ENV.getBool('DEBUG')) { - this.profiler.logKernelProfile(kernelProfile); - } - outputs = kernelProfile.outputs; - } - }); - if (isTapeOn) { - this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs); - } - if (this.state.profiling) { - this.state.activeProfile.kernels.push({ - name: kernelOrScopeName, - bytesAdded: this.state.numBytes - startingBytecount, - totalBytesSnapshot: this.state.numBytes, - tensorsAdded: this.state.numTensors - startingNumTensors, - totalTensorsSnapshot: this.state.numTensors, - inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null), - outputShapes: outputs.map(item => item.shape), - kernelTimeMs: kernelProfile.timeMs, - extraInfo: kernelProfile.extraInfo - }); - } - return (Array.isArray(out) ? outputs : outputs[0]); - } - /** - * Saves tensors used in forward mode for use in backward mode. - * - * @param tensors the list of tensors to save. - */ - saveTensorsForBackwardMode(tensors) { - const saved = tensors.map(tensor => this.keep(this.clone(tensor))); - return saved; - } - /** - * Returns a list of tensors to save for a given gradient calculation. - * - * @param kernelName name of kernel to look up gradient for. - * @param inputs a map of input tensors. - * @param outputs an array of output tensors from forward mode of kernel. - */ - getTensorsForGradient(kernelName, inputs, outputs) { - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - const inputsToSave = gradConfig.inputsToSave || []; - const outputsToSave = gradConfig.outputsToSave || []; - // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs - // specified in inputsToSave will be saved. - let inputTensorsToSave; - if (gradConfig.saveAllInputs) { - assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.'); - inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); - } - else { - inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); - } - const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); - return inputTensorsToSave.concat(outputTensorsToSave); - } - // We return an empty list rather than throw an error because the kernel we - // are looking up may not actually be relevant to backproping through the - // overall function - // - // See 'does not error if irrelevant (pruned) ops are missing grads' test - // in gradients_test.ts for an example. - return []; - } - /** - * Internal method used by public APIs for tensor creation. Makes a new - * tensor with the provided shape, dtype and values. It always - * creates a new data id and writes the values to the underlying backend. - */ - makeTensor(values, shape, dtype, backend) { - if (values == null) { - throw new Error('Values passed to engine.makeTensor() are null'); - } - dtype = dtype || 'float32'; - backend = backend || this.backend; - let backendVals = values; - if (dtype === 'string' && isString(values[0])) { - backendVals = values.map(d => encodeString(d)); - } - const dataId = backend.write(backendVals, shape, dtype); - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - // Count bytes for string tensors. - if (dtype === 'string') { - const info = this.state.tensorInfo.get(dataId); - const newBytes = bytesFromStringArray(backendVals); - this.state.numBytes += newBytes - info.bytes; - info.bytes = newBytes; - } - return t; - } - /** - * Internal method used by backends. Makes a new tensor - * that is a wrapper around an existing data id. It doesn't create - * a new data id, only increments the ref count used in memory tracking. - */ - makeTensorFromDataId(dataId, shape, dtype, backend) { - dtype = dtype || 'float32'; - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - return t; - } - makeVariable(initialValue, trainable = true, name, dtype) { - name = name || this.nextVariableId().toString(); - if (dtype != null && dtype !== initialValue.dtype) { - initialValue = initialValue.cast(dtype); - } - const v = new Variable(initialValue, trainable, name, this.nextTensorId()); - if (this.state.registeredVariables[v.name] != null) { - throw new Error(`Variable with name ${v.name} was already registered`); - } - this.state.registeredVariables[v.name] = v; - this.incRef(v, this.backend); - return v; - } - trackTensor(a, backend) { - this.state.numTensors++; - if (a.dtype === 'string') { - this.state.numStringTensors++; - } - // Bytes for complex numbers are counted by their components. Bytes for - // string tensors are counted when writing values. - let bytes = 0; - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - bytes = a.size * bytesPerElement(a.dtype); - } - this.state.numBytes += bytes; - if (!this.state.tensorInfo.has(a.dataId)) { - this.state.numDataBuffers++; - this.state.tensorInfo.set(a.dataId, { - backend: backend || this.backend, - dtype: a.dtype, - shape: a.shape, - bytes - }); - } - if (!(a instanceof Variable)) { - this.track(a); - } - } - // Track the tensor by dataId and increase the refCount for the dataId in the - // backend. - // TODO(pyu10055): This is currently used by makeVariable method, to increase - // refCount on the backend for the dataId. It can potentially be replaced with - // Identity op indead of calling backend directly. - incRef(a, backend) { - this.trackTensor(a, backend); - this.backend.incRef(a.dataId); - } - removeDataId(dataId, backend) { - if (this.state.tensorInfo.has(dataId) && - this.state.tensorInfo.get(dataId).backend === backend) { - this.state.tensorInfo.delete(dataId); - this.state.numDataBuffers--; - } - } - disposeTensor(a) { - if (!this.state.tensorInfo.has(a.dataId)) { - return; - } - const info = this.state.tensorInfo.get(a.dataId); - this.state.numTensors--; - if (a.dtype === 'string') { - this.state.numStringTensors--; - this.state.numBytes -= info.bytes; - } - // Don't count bytes for complex numbers as they are counted by their - // components. - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - const bytes = a.size * bytesPerElement(a.dtype); - this.state.numBytes -= bytes; - } - // Remove the reference to dataId if backend dispose the data successfully - if (info.backend.disposeData(a.dataId)) { - this.removeDataId(a.dataId, info.backend); - } - // TODO(nsthorat): Construct an error and save the stack trace for - // debugging when in debug mode. Creating a stack trace is too expensive - // to do unconditionally. - } - disposeVariables() { - for (const varName in this.state.registeredVariables) { - const v = this.state.registeredVariables[varName]; - this.disposeVariable(v); - } - } - disposeVariable(v) { - this.disposeTensor(v); - if (this.state.registeredVariables[v.name] != null) { - delete this.state.registeredVariables[v.name]; - } - } - memory() { - const info = this.backend.memory(); - info.numTensors = this.state.numTensors; - info.numDataBuffers = this.state.numDataBuffers; - info.numBytes = this.state.numBytes; - if (this.state.numStringTensors > 0) { - info.unreliable = true; - if (info.reasons == null) { - info.reasons = []; - } - info.reasons.push('Memory usage by string tensors is approximate ' + - '(2 bytes per character)'); - } - return info; - } - async profile(query) { - this.state.profiling = true; - const startBytes = this.state.numBytes; - const startNumTensors = this.state.numTensors; - this.state.activeProfile.kernels = []; - this.state.activeProfile.result = await query(); - this.state.profiling = false; - this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot)); - this.state.activeProfile.newBytes = this.state.numBytes - startBytes; - this.state.activeProfile.newTensors = - this.state.numTensors - startNumTensors; - for (const kernel of this.state.activeProfile.kernels) { - kernel.kernelTimeMs = await kernel.kernelTimeMs; - kernel.extraInfo = await kernel.extraInfo; - } - return this.state.activeProfile; - } - isTapeOn() { - return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; - } - addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { - const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - gradientsFunc = gradConfig.gradFunc; - } - if (gradientsFunc != null) { - tapeNode.gradient = (dys) => { - // TODO(smilkov): To optimize back-prop, pass dys that are not used in - // the backprop graph to the user as null instead of zeros - dys = dys.map((dy, i) => { - if (dy == null) { - const output = outputs[i]; - const vals = makeZerosTypedArray(output.size, output.dtype); - return this.makeTensor(vals, output.shape, output.dtype); - } - return dy; - }); - // Grad functions of ops with single outputs expect a dy, while ops - // with multiple outputs expect dys (array of dy). - return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); - }; - } - this.state.activeTape.push(tapeNode); - } - keep(result) { - result.kept = true; - return result; - } - startTape() { - if (this.state.gradientDepth === 0) { - this.state.activeTape = []; - } - this.state.gradientDepth++; - } - endTape() { - this.state.gradientDepth--; - } - /** - * Start a scope. Use this with endScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - startScope(name) { - const scopeInfo = { - track: [], - name: 'unnamed scope', - id: this.state.nextScopeId++ - }; - if (name) { - scopeInfo.name = name; - } - this.state.scopeStack.push(scopeInfo); - this.state.activeScope = scopeInfo; - } - /** - * End a scope. Use this with startScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - endScope(result) { - const tensorsToTrackInParent = getTensorsInContainer(result); - const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id)); - // Dispose the arrays tracked in this scope. - for (let i = 0; i < this.state.activeScope.track.length; i++) { - const tensor = this.state.activeScope.track[i]; - if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) { - tensor.dispose(); - } - } - const oldScope = this.state.scopeStack.pop(); - this.state.activeScope = this.state.scopeStack.length === 0 ? - null : - this.state.scopeStack[this.state.scopeStack.length - 1]; - // Track the current result in the parent scope. - tensorsToTrackInParent.forEach(tensor => { - // Only track the tensor if was allocated in the inner scope and is not - // globally kept. - if (!tensor.kept && tensor.scopeId === oldScope.id) { - this.track(tensor); - } - }); - } - /** - * Returns gradients of `f` with respect to each of the `xs`. The gradients - * returned are of the same length as `xs`, but some might be null if `f` - * was not a function of that `x`. It also takes optional dy to multiply the - * gradient, which defaults to `1`. - */ - gradients(f, xs, dy, allowNoGradients = false) { - assert(xs.length > 0, () => 'gradients() received an empty list of xs.'); - if (dy != null && dy.dtype !== 'float32') { - throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); - } - const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f)); - assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.'); - // Filter out the nodes that don't connect x => y. - const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y); - if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { - throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + - 'that the f you passed encloses all operations that lead from x ' + - 'to y.'); - } - return this.tidy('backward', () => { - const accumulatedGradientMap = {}; - accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; - // Backprop gradients through the filtered nodes. - backpropagateGradients(accumulatedGradientMap, filteredTape, - // Pass the tidy function to avoid circular dep with `tape.ts`. - f => this.tidy(f), - // Pass an add function to avoide a circular dep with `tape.ts`. - add); - const grads = xs.map(x => accumulatedGradientMap[x.id]); - if (this.state.gradientDepth === 0) { - // This means that we are not computing higher-order gradients - // and can clean up the tape. - this.state.activeTape.forEach(node => { - for (const tensor of node.saved) { - tensor.dispose(); - } - }); - this.state.activeTape = null; - } - return { value: y, grads }; - }); - } - customGrad(f) { - assert(isFunction(f), () => 'The f passed in customGrad(f) must be a function.'); - return (...inputs) => { - assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' + - 'tensors'); - let res; - const inputMap = {}; - inputs.forEach((input, i) => { - inputMap[i] = input; - }); - const forwardFunc = (_, save) => { - res = f(...[...inputs, save]); - assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.value` is a tensor'); - assert(isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function.'); - return res.value; - }; - const backwardsFunc = (dy, saved) => { - const gradRes = res.gradFunc(dy, saved); - const grads = Array.isArray(gradRes) ? gradRes : [gradRes]; - assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'the same number of tensors as inputs passed to f(...).'); - assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'a list of only tensors.'); - const gradMap = {}; - grads.forEach((grad, i) => { - gradMap[i] = () => grad; - }); - return gradMap; - }; - return this.runKernelFunc({ - forwardFunc, - backwardsFunc, - inputs: inputMap, - }); - }; - } - readSync(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.readSync(dataId); - } - read(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.read(dataId); - } - async time(query) { - const start = now(); - const timingInfo = await this.backend.time(query); - timingInfo.wallMs = now() - start; - return timingInfo; - } - /** - * Tracks a Tensor in the current scope to be automatically cleaned up - * when the current scope ends, and returns the value. - * - * @param result The Tensor to track in the current scope. - */ - track(result) { - if (this.state.activeScope != null) { - result.scopeId = this.state.activeScope.id; - this.state.activeScope.track.push(result); - } - return result; - } - get registeredVariables() { - return this.state.registeredVariables; - } - /** - * Resets the engine state. Removes all backends but does not remove - * registered backend factories. - */ - reset() { - // Make any pending promise obsolete. - this.pendingBackendInitId++; - this.state.dispose(); - this.ENV.reset(); - this.state = new EngineState(); - for (const backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - this.backendName = null; - this.backendInstance = null; - this.pendingBackendInit = null; - } - } - Engine.nextTensorId = 0; - Engine.nextVariableId = 0; - function ones(shape) { - const values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); - return ENGINE.makeTensor(values, shape, 'float32'); - } - function getOrMakeEngine() { - const ns = getGlobalNamespace(); - if (ns._tfengine == null) { - const environment = new Environment(ns); - ns._tfengine = new Engine(environment); - } - setEnvironmentGlobal(ns._tfengine.ENV); - // Tell the current tensor interface that the global engine is responsible - // for tracking. - setTensorTracker(() => ns._tfengine); - return ns._tfengine; - } - const ENGINE = getOrMakeEngine(); - /** - * A implementation of the add op for use within engine and tape. - * - * This allows us to avoid a circular dependency between add.ts and engine. - * It is exported to be available in tape tests. - */ - function add(a, b) { - // We duplicate Add here to avoid a circular dependency with add.ts. - const inputs = { a, b }; - return ENGINE.runKernel(Add, inputs); - } - - /** - * @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 inferShape(val, dtype) { - let firstElem = val; - if (isTypedArray(val)) { - return dtype === 'string' ? [] : [val.length]; - } - if (!Array.isArray(val)) { - return []; // Scalar. - } - const shape = []; - while (Array.isArray(firstElem) || - isTypedArray(firstElem) && dtype !== 'string') { - shape.push(firstElem.length); - firstElem = firstElem[0]; - } - if (Array.isArray(val) && - env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) { - deepAssertShapeConsistency(val, shape, []); - } - return shape; - } - function deepAssertShapeConsistency(val, shape, indices) { - indices = indices || []; - if (!(Array.isArray(val)) && !isTypedArray(val)) { - assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` + - `but should be an array/TypedArray of ${shape[0]} elements`); - return; - } - assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` + - `but is an array of ${val.length} elements`); - assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` + - `elements, but has ${val.length} elements`); - const subShape = shape.slice(1); - for (let i = 0; i < val.length; ++i) { - deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); - } - } - function assertDtype(expectedDtype, actualDType, argName, functionName) { - if (expectedDtype === 'string_or_numeric') { - return; - } - if (expectedDtype == null) { - throw new Error(`Expected dtype cannot be null.`); - } - if (expectedDtype !== 'numeric' && expectedDtype !== actualDType || - expectedDtype === 'numeric' && actualDType === 'string') { - throw new Error(`Argument '${argName}' passed to '${functionName}' must ` + - `be ${expectedDtype} tensor, but got ${actualDType} tensor`); - } - } - function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') { - if (x instanceof Tensor) { - assertDtype(parseAsDtype, x.dtype, argName, functionName); - return x; - } - let inferredDtype = inferDtype(x); - // If the user expects a bool/int/float, use that info to update the - // inferredDtype when it is not a string. - if (inferredDtype !== 'string' && - ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) { - inferredDtype = parseAsDtype; - } - assertDtype(parseAsDtype, inferredDtype, argName, functionName); - if ((x == null) || - (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && - typeof x !== 'boolean' && typeof x !== 'string')) { - const type = x == null ? 'null' : x.constructor.name; - throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` + - `Tensor or TensorLike, but got '${type}'`); - } - const inferredShape = inferShape(x, inferredDtype); - if (!isTypedArray(x) && !Array.isArray(x)) { - x = [x]; - } - const skipTypedArray = true; - const values = inferredDtype !== 'string' ? - toTypedArray(x, inferredDtype) : - flatten(x, [], skipTypedArray); - return ENGINE.makeTensor(values, inferredShape, inferredDtype); - } - function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') { - if (!Array.isArray(arg)) { - throw new Error(`Argument ${argName} passed to ${functionName} must be a ` + - '`Tensor[]` or `TensorLike[]`'); - } - const tensors = arg; - return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype)); - } - - /** - * @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 OP_SCOPE_SUFFIX = '__op'; - /** - * Used for wrapping functions that perform math operations on - * Tensors. The function will be wrapped in a named scope that cleans all - * memory usage after the function is done. - */ - function op(f) { - const keys = Object.keys(f); - if (keys.length !== 1) { - throw new Error(`Please provide an object with a single key ` + - `(operation name) mapping to a function. Got an object with ` + - `${keys.length} keys.`); - } - let opName = keys[0]; - const fn = f[opName]; - // Strip the underscore from the end of the function name. - if (opName.endsWith('_')) { - opName = opName.substring(0, opName.length - 1); - } - // add an __op suffix to distinguish ops from kernels in tf.profile - opName = opName + OP_SCOPE_SUFFIX; - // tslint:disable-next-line:no-any - const f2 = (...args) => { - ENGINE.startScope(opName); - try { - const result = fn(...args); - if (isPromise(result)) { - console.error('Cannot return a Promise inside of tidy.'); - } - ENGINE.endScope(result); - return result; - } - catch (ex) { - ENGINE.endScope(null); - throw ex; - } - }; - Object.defineProperty(f2, 'name', { value: opName, configurable: true }); - // tslint:disable-next-line:no-any - return f2; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes absolute value element-wise: `abs(x)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.abs().print(); // or tf.abs(x) - * ``` - * @param x The input `tf.Tensor`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function abs_(x) { - const $x = convertToTensor(x, 'x', 'abs'); - if ($x.dtype === 'complex64') { - const inputs = { x: $x }; - return ENGINE.runKernel(ComplexAbs, inputs); - } - else { - const inputs = { x: $x }; - return ENGINE.runKernel(Abs, inputs); - } - } - const abs = op({ abs_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes acos of the input `tf.Tensor` element-wise: `acos(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.acos().print(); // or tf.acos(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function acos_(x) { - const $x = convertToTensor(x, 'x', 'acos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acos, inputs); - } - const acos = op({ acos_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise: - * `acosh(x)` - * - * ```js - * const x = tf.tensor1d([10, 1, 3, 5.7]); - * - * x.acosh().print(); // or tf.acosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function acosh_(x) { - const $x = convertToTensor(x, 'x', 'acosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acosh, inputs); - } - const acosh = op({ acosh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting. - * - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * - * ```js - * // Broadcast add a with b. - * const a = tf.scalar(5); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * @param a The first `tf.Tensor` to add. - * @param b The second `tf.Tensor` to add. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function add_(a, b) { - let $a = convertToTensor(a, 'a', 'add'); - let $b = convertToTensor(b, 'b', 'add'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Add, inputs); - } - const add$1 = op({ add_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the logical and of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.all().print(); // or tf.all(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.all(axis).print(); // or tf.all(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function all_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'all', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(All, inputs, attrs); - } - const all = op({ all_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the logical or of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.any().print(); // or tf.any(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.any(axis).print(); // or tf.any(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function any_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'any', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Any, inputs, attrs); - } - // tslint:disable-next-line:variable-name - const any = op({ any_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Returns the indices of the maximum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMax().print(); // or tf.argMax(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMax(axis).print(); // or tf.argMax(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function argMax_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMax'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMax, inputs, attrs); - } - const argMax = op({ argMax_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Returns the indices of the minimum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMin().print(); // or tf.argMin(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMin(axis).print(); // or tf.argMin(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function argMin_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMin'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMin, inputs, attrs); - } - const argMin = op({ argMin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes asin of the input `tf.Tensor` element-wise: `asin(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asin().print(); // or tf.asin(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function asin_(x) { - const $x = convertToTensor(x, 'x', 'asin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asin, inputs); - } - const asin = op({ asin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise: - * `asinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asinh().print(); // or tf.asinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function asinh_(x) { - const $x = convertToTensor(x, 'x', 'asinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asinh, inputs); - } - const asinh = op({ asinh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes atan of the input `tf.Tensor` element-wise: `atan(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.atan().print(); // or tf.atan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atan_(x) { - const $x = convertToTensor(x, 'x', 'atan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atan, inputs); - } - const atan = op({ atan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]); - * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]); - * - * tf.atan2(a, b).print() - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atan2_(a, b) { - let $a = convertToTensor(a, 'a', 'atan2'); - let $b = convertToTensor(b, 'b', 'atan2'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Atan2, inputs); - } - const atan2 = op({ atan2_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise: - * `atanh(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.atanh().print(); // or tf.atanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function atanh_(x) { - const $x = convertToTensor(x, 'x', 'atanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atanh, inputs); - } - const atanh = op({ atanh_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Casts a `tf.Tensor` to a new dtype. - * - * ```js - * const x = tf.tensor1d([1.5, 2.5, 3]); - * tf.cast(x, 'int32').print(); - * ``` - * @param x The input tensor to be casted. - * @param dtype The dtype to cast the input tensor to. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function cast_(x, dtype) { - const $x = convertToTensor(x, 'x', 'cast'); - // Sanity checks. - if (!isValidDtype(dtype)) { - throw new Error(`Failed to cast to unknown dtype ${dtype}`); - } - if (dtype === 'string' && $x.dtype !== 'string' || - dtype !== 'string' && $x.dtype === 'string') { - throw new Error('Only strings can be casted to strings'); - } - const inputs = { x: $x }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, inputs, attrs); - } - const cast = op({ cast_ }); - - /** - * @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. - * ============================================================================= - */ - function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') { - const [filterHeight, filterWidth] = parseTupleParam(filterSize); - let filterShape; - if (dataFormat === 'channelsLast') { - filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; - } - else if (dataFormat === 'channelsFirst') { - filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); - } - /** - * Computes the information for a forward pass of a convolution/pooling - * operation. - */ - function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') { - let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; - if (dataFormat === 'channelsLast') { - [batchSize, inHeight, inWidth, inChannels] = inShape; - } - else if (dataFormat === 'channelsFirst') { - [batchSize, inChannels, inHeight, inWidth] = inShape; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - const [filterHeight, filterWidth, , filterChannels] = filterShape; - const [strideHeight, strideWidth] = parseTupleParam(strides); - const [dilationHeight, dilationWidth] = parseTupleParam(dilations); - const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); - const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); - const outChannels = depthwise ? filterChannels * inChannels : filterChannels; - let outShape; - if (dataFormat === 'channelsFirst') { - outShape = [batchSize, outChannels, outHeight, outWidth]; - } - else if (dataFormat === 'channelsLast') { - outShape = [batchSize, outHeight, outWidth, outChannels]; - } - return { - batchSize, - dataFormat, - inHeight, - inWidth, - inChannels, - outHeight, - outWidth, - outChannels, - padInfo, - strideHeight, - strideWidth, - filterHeight, - filterWidth, - effectiveFilterHeight, - effectiveFilterWidth, - dilationHeight, - dilationWidth, - inShape, - outShape, - filterShape - }; - } - function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) { - if (zeroPad == null) { - zeroPad = computeDefaultPad(inShape, fieldSize, stride); - } - const inputRows = inShape[0]; - const inputCols = inShape[1]; - const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - return [outputRows, outputCols]; - } - function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) { - const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); - return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); - } - function parseTupleParam(param) { - if (typeof param === 'number') { - return [param, param, param]; - } - if (param.length === 2) { - return [param[0], param[1], 1]; - } - return param; - } - /* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d - * Atrous convolution is equivalent to standard convolution with upsampled - * filters with effective_filter_height = - * filter_height + (filter_height - 1) * (dilation - 1) - * and effective_filter_width = - * filter_width + (filter_width - 1) * (dilation - 1), - * produced by inserting dilation - 1 zeros along consecutive elements across - * the filters' spatial dimensions. - * When there is a dilation, this converts a filter dimension to the - * effective filter dimension, so it can be used in a standard convolution. - */ - function getEffectiveFilterSize(filterSize, dilation) { - if (dilation <= 1) { - return filterSize; - } - return filterSize + (filterSize - 1) * (dilation - 1); - } - function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { - let padInfo; - let outHeight; - let outWidth; - if (typeof pad === 'number') { - const padType = (pad === 0) ? 'VALID' : 'NUMBER'; - padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; - const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode); - outHeight = outShape[0]; - outWidth = outShape[1]; - } - else if (pad === 'same') { - outHeight = Math.ceil(inHeight / strideHeight); - outWidth = Math.ceil(inWidth / strideWidth); - const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); - const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); - const top = Math.floor(padAlongHeight / 2); - const bottom = padAlongHeight - top; - const left = Math.floor(padAlongWidth / 2); - const right = padAlongWidth - left; - padInfo = { top, bottom, left, right, type: 'SAME' }; - } - else if (pad === 'valid') { - padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; - outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); - outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); - } - else if (typeof pad === 'object') { - const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0]; - const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1]; - const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0]; - const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1]; - const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ? - 'VALID' : - 'EXPLICIT'; - padInfo = { top, bottom, left, right, type: padType }; - outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); - outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); - } - else { - throw Error(`Unknown padding parameter: ${pad}`); - } - return { padInfo, outHeight, outWidth }; - } - /** - * Rounds a value depending on the rounding mode - * @param value - * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function round(value, roundingMode) { - if (!roundingMode) { - return Math.trunc(value); - } - switch (roundingMode) { - case 'round': - // used for Caffe Conv - return Math.round(value); - case 'ceil': - // used for Caffe Pool - return Math.ceil(value); - case 'floor': - return Math.floor(value); - default: - throw new Error(`Unknown roundingMode ${roundingMode}`); - } - } - function tupleValuesAreOne(param) { - const [dimA, dimB, dimC] = parseTupleParam(param); - return dimA === 1 && dimB === 1 && dimC === 1; - } - function eitherStridesOrDilationsAreOne(strides, dilations) { - return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Reshapes a `tf.Tensor` to a given shape. - * - * Given an input tensor, returns a new tensor with the same values as the - * input tensor with shape `shape`. - * - * If one component of shape is the special value -1, the size of that - * dimension is computed so that the total size remains constant. In - * particular, a shape of [-1] flattens into 1-D. At most one component of - * shape can be -1. - * - * If shape is 1-D or higher, then the operation returns a tensor with shape - * shape filled with the values of tensor. In this case, the number of - * elements implied by shape must be the same as the number of elements in - * tensor. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.reshape([2, 2]).print(); - * ``` - * - * @param x The input tensor to be reshaped. - * @param shape An array of integers defining the output tensor shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function reshape_(x, shape) { - const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric'); - const inputs = { x: $x }; - const attrs = { shape }; - return ENGINE.runKernel(Reshape, inputs, attrs); - } - const reshape = op({ reshape_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the 2D average pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'avgPool', 'float32'); - const dilations = 1; - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - let res = ENGINE.runKernel(AvgPool, inputs, attrs); - res = cast(res, $x.dtype); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const avgPool = op({ avgPool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a new tensor with the same values and shape as the specified - * tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * - * x.clone().print(); - * ``` - * - * @param x The tensor to clone. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function clone_(x) { - const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric'); - const inputs = { x: $x }; - // Note this op is called tf.identity in python. Hence the kernel name used - // here. - return ENGINE.runKernel(Identity, inputs); - } - const clone = op({ clone_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Concatenates a list of `tf.Tensor`s along a given axis. - * - * The tensors ranks and types must match, and their sizes must match in all - * dimensions except `axis`. - * - * Also available are stricter rank-specific methods that assert that - * `tensors` are of the given rank: - * - `tf.concat1d` - * - `tf.concat2d` - * - `tf.concat3d` - * - `tf.concat4d` - * - * Except `tf.concat1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * a.concat(b).print(); // or a.concat(b) - * ``` - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.concat([a, b, c]).print(); - * ``` - * - * ```js - * const a = tf.tensor2d([[1, 2], [10, 20]]); - * const b = tf.tensor2d([[3, 4], [30, 40]]); - * const axis = 1; - * tf.concat([a, b], axis).print(); - * ``` - * @param tensors A list of tensors to concatenate. - * @param axis The axis to concate along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function concat_(tensors, axis = 0) { - assert(tensors.length >= 1, () => 'Pass at least one tensor to concat'); - const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric'); - if ($tensors[0].dtype === 'complex64') { - $tensors.forEach(tensor => { - if (tensor.dtype !== 'complex64') { - throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${tensor.dtype}. `); - } - }); - } - if ($tensors.length === 1) { - return clone($tensors[0]); - } - const inputs = $tensors; - const attr = { axis }; - return ENGINE.runKernel(Concat, inputs, attr); - } - const concat = op({ concat_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the dot product of two matrices, A * B. These must be matrices. - * - * ```js - * const a = tf.tensor2d([1, 2], [1, 2]); - * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.matMul(b).print(); // or tf.matMul(a, b) - * ``` - * @param a First matrix in dot product operation. - * @param b Second matrix in dot product operation. - * @param transposeA If true, `a` is transposed before multiplication. - * @param transposeB If true, `b` is transposed before multiplication. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function matMul_(a, b, transposeA = false, transposeB = false) { - let $a = convertToTensor(a, 'a', 'matMul'); - let $b = convertToTensor(b, 'b', 'matMul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - const attrs = { transposeA, transposeB }; - return ENGINE.runKernel(BatchMatMul, inputs, attrs); - } - const matMul = op({ matMul_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting. - * - * We also expose `tf.mulStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([2, 3, 4, 5]); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * - * ```js - * // Broadcast mul a with b. - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.scalar(5); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * @param a The first tensor to multiply. - * @param b The second tensor to multiply. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function mul_(a, b) { - let $a = convertToTensor(a, 'a', 'mul'); - let $b = convertToTensor(b, 'b', 'mul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Multiply, inputs); - } - const mul = op({ mul_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes sigmoid element-wise, `1 / (1 + exp(-x))` - * - * ```js - * const x = tf.tensor1d([0, -1, 2, -3]); - * - * x.sigmoid().print(); // or tf.sigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sigmoid_(x) { - const $x = convertToTensor(x, 'x', 'sigmoid'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sigmoid, inputs); - } - const sigmoid = op({ sigmoid_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Extracts a slice from a `tf.Tensor` starting at coordinates `begin` - * and is of size `size`. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `x` is of the given rank: - * - `tf.slice1d` - * - `tf.slice2d` - * - `tf.slice3d` - * - `tf.slice4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.slice([1], [2]).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * x.slice([1, 0], [1, 2]).print(); - * ``` - * @param x The input `tf.Tensor` to slice from. - * @param begin The coordinates to start the slice from. The length can be - * less than the rank of x - the rest of the axes will have implicit 0 as - * start. Can also be a single number, in which case it specifies the - * first axis. - * @param size The size of the slice. The length can be less than the rank of - * x - the rest of the axes will have implicit -1. A value of -1 requests - * the rest of the dimensions in the axis. Can also be a single number, - * in which case it specifies the size of the first axis. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function slice_(x, begin, size) { - const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric'); - if ($x.rank === 0) { - throw new Error('Slicing scalar is not possible'); - } - const inputs = { x: $x }; - const attrs = { begin, size }; - return ENGINE.runKernel(Slice, inputs, attrs); - } - const slice = op({ slice_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, 70]); - * - * x.tanh().print(); // or tf.tanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function tanh_(x) { - const $x = convertToTensor(x, 'x', 'tanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tanh, inputs); - } - const tanh = op({ tanh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of - * shape `blockShape + [batch]`, interleaves these blocks back into the grid - * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with - * the same rank as the input. The spatial dimensions of this intermediate - * result are then optionally cropped according to `crops` to produce the - * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise - * description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); - * const blockShape = [2, 2]; - * const crops = [[0, 0], [0, 0]]; - * - * x.batchToSpaceND(blockShape, crops).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required - * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]` - * - * This operation is equivalent to the following steps: - * - * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ..., - * blockShape[M-1], batch / prod(blockShape), x.shape[1], ..., - * x.shape[N-1]]` - * - * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch / - * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M], - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch / - * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] * - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted` - * according to `crops` to produce the output of shape: `[batch / - * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1], - * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] - - * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function batchToSpaceND_(x, blockShape, crops) { - const $x = convertToTensor(x, 'x', 'batchToSpaceND'); - const prod = blockShape.reduce((a, b) => a * b); - assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); - assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); - assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` + - `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`); - const inputs = { x: $x }; - const attrs = { blockShape, crops }; - return ENGINE.runKernel(BatchToSpaceND, inputs, attrs); - } - const batchToSpaceND = op({ batchToSpaceND_ }); - - function xAs4D(x) { - let x4D; - if (x.rank === 0 || x.rank === 1) { - x4D = reshape(x, [1, 1, 1, x.size]); - } - else if (x.rank === 2) { - x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]); - } - else if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - else { - x4D = x; - } - return x4D; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Batch normalization. - * - * As described in - * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167). - * - * Mean, variance, scale, and offset can be of two shapes: - * - The same shape as the input. - * - In the common case, the depth dimension is the last dimension of x, so - * the values would be an `tf.Tensor1D` of shape [depth]. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that parameters passed are of given rank - * - `tf.batchNorm2d` - * - `tf.batchNorm3d` - * - `tf.batchNorm4d` - * - * @param x The input Tensor. - * @param mean A mean Tensor. - * @param variance A variance Tensor. - * @param offset An offset Tensor. - * @param scale A scale Tensor. - * @param varianceEpsilon A small float number to avoid dividing by 0. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) { - if (varianceEpsilon == null) { - varianceEpsilon = 0.001; - } - const $x = convertToTensor(x, 'x', 'batchNorm'); - const $mean = convertToTensor(mean, 'mean', 'batchNorm'); - const $variance = convertToTensor(variance, 'variance', 'batchNorm'); - let $scale; - if (scale != null) { - $scale = convertToTensor(scale, 'scale', 'batchNorm'); - } - let $offset; - if (offset != null) { - $offset = convertToTensor(offset, 'offset', 'batchNorm'); - } - assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' + - 'equal ranks.'); - assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' + - 'equal ranks.'); - assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' + - 'equal ranks.'); - const x4D = xAs4D($x); - const inputs = { - x: x4D, - scale: $scale, - offset: $offset, - mean: $mean, - variance: $variance - }; - const attrs = { varianceEpsilon }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs); - return reshape(res, $x.shape); - } - const batchNorm = op({ batchNorm_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Broadcast an array to a compatible shape NumPy-style. - * - * The tensor's shape is compared to the broadcast shape from end to beginning. - * Ones are prepended to the tensor's shape until is has the same length as - * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is - * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then - * the input tensor is tiled N times along that axis (using tf.tile). - * - * @param input The tensor that is to be broadcasted. - * @param shape The input is to be broadcast to this shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function broadcastTo_(x, shape) { - let input = convertToTensor(x, 'broadcastTo', 'x'); - const xShape = input.shape; - if (shape.some(d => !(d > 0) || d % 1 !== 0)) { - throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); - } - if (shape.length < input.rank) { - throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`); - } - if (shape.length > input.rank) { - const newShape = input.shape.slice(); - while (newShape.length < shape.length) { - newShape.unshift(1); - } - input = reshape(input, newShape); - } - const inputShape = input.shape; - const reps = Array.from(shape); - for (let i = shape.length - 1; i >= 0; i--) { - if (inputShape[i] === shape[i]) { - reps[i] = 1; - } - else if (input.shape[i] !== 1) { - throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); - } - } - const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0); - if (axes.length === 0) { - return clone(input); - } - // TODO call broadcastTo kernel directly once backends implement broadcstTo - const inputs = { x: input }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); - } - const broadcastTo = op({ broadcastTo_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)` - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.ceil().print(); // or tf.ceil(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function ceil_(x) { - const $x = convertToTensor(x, 'x', 'ceil'); - const inputs = { x: $x }; - return ENGINE.runKernel(Ceil, inputs); - } - const ceil = op({ ceil_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) - * ``` - * @param x The input tensor. - * @param clipValueMin Lower-bound of range to be clipped to. - * @param clipValueMax Upper-bound of range to be clipped to. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function clipByValue_(x, clipValueMin, clipValueMax) { - const $x = convertToTensor(x, 'x', 'clipByValue'); - assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` + - `less than or equal to max (${clipValueMax}).`); - const inputs = { x: $x }; - const attrs = { clipValueMin, clipValueMax }; - return ENGINE.runKernel(ClipByValue, inputs, attrs); - } - const clipByValue = op({ clipByValue_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Converts two real numbers to a complex number. - * - * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], - * where r represents the real part and i represents the imag part. - * - * The input tensors real and imag must have the same shape. - * - * ```js - * const real = tf.tensor1d([2.25, 3.25]); - * const imag = tf.tensor1d([4.75, 5.75]); - * const complex = tf.complex(real, imag); - * - * complex.print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function complex_(real, imag) { - const $real = convertToTensor(real, 'real', 'complex'); - const $imag = convertToTensor(imag, 'imag', 'complex'); - assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` + - `must match in call to tf.complex().`); - const inputs = { real: $real, imag: $imag }; - return ENGINE.runKernel(Complex, inputs); - } - const complex = op({ complex_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes a 2D convolution over the input x. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2d'); - const $filter = convertToTensor(filter, 'filter', 'conv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` + - `input depth for filter ${$filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const conv2d = op({ conv2d_ }); - - /** - * Computes a 1D convolution over the input x. - * - * @param x The input tensor, of rank 3 or rank 2, of shape - * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed. - * @param filter The filter, rank 3, of shape - * `[filterWidth, inDepth, outDepth]`. - * @param stride The number of entries by which the filter is moved right at - * each step. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat An optional string from "NWC", "NCW". Defaults to "NWC", - * the data is stored in the order of [batch, in_width, in_channels]. Only - * "NWC" is currently supported. - * @param dilation The dilation rate in which we sample input values in - * atrous convolution. Defaults to `1`. If it is greater than 1, then - * stride must be `1`. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv1d'); - const $filter = convertToTensor(filter, 'filter', 'conv1d'); - let x3D = $x; - let reshapedTo3D = false; - if ($x.rank === 2) { - reshapedTo3D = true; - x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]); - } - assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); - assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` + - `input depth for filter ${$filter.shape[1]}.`); - assert(eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' + - `Got stride ${stride} and dilation '${dilation}'`); - assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`); - const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]); - const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]); - const strides = [1, stride]; - const dilations = [1, dilation]; - const conv2dDataFormat = 'NHWC'; - const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); - if (reshapedTo3D) { - return reshape(res, [res.shape[2], res.shape[3]]); - } - return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]); - } - const conv1d = op({ conv1d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the input of a 2D convolution. - * - * @param xShape The shape of the input: [batch, height, width, inDepth]. - * If length of 3, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 4 or rank 3 of shape - * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape4D = xShape; - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - xShape4D = [1, xShape[0], xShape[1], xShape[2]]; - } - assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` + - `${xShape4D.length}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` + - `rank ${dy4D.rank}`); - assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` + - `rank ${filter.rank}`); - const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[2]}.`); - assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[3]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const conv2DBackpropInput = op({ conv2DBackpropInput_ }); - - /** - * Computes the transposed 2D convolution of an image, also known as a - * deconvolution. - * - * @param x The input image, of rank 4 or rank 3, of shape - * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, outDepth, inDepth]`. - * `inDepth` must match `inDepth` in `x`. - * @param outputShape Output shape, of rank 4 or rank 3: - * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed. - * @param strides The strides of the original convolution: - * `[strideHeight, strideWidth]`. - * @param pad The type of padding algorithm used in the non-transpose version - * of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2dTranspose'); - const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose'); - return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode); - } - const conv2dTranspose = op({ conv2dTranspose_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the input of a 3D convolution. - * - * @param xShape The shape of the input: [batch, depth, height, width, - * in_channels]. If length of 4, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 5 or rank 4 of shape - * `[batch, outDepth, outHeight, outWidth, in_channels]`. - * If rank 4, batch of 1 is assumed. - * @param filter The filter, rank 5, of shape - * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideDepth, strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - */ - function conv3DBackpropInput_(xShape, dy, filter, strides, pad) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape5D = xShape; - let dy5D = dy; - let reshapedTo5D = false; - if (dy.rank === 4) { - reshapedTo5D = true; - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; - } - const inDepth = xShape5D[4]; - const outDepth = dy5D.shape[4]; - assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` + - `${xShape5D.length}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` + - `rank ${dy5D.rank}`); - assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` + - `rank ${filter.rank}`); - assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[3]}.`); - assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[4]}.`); - const inputs = { dy: dy5D, filter }; - const attrs = { pad, strides, inputShape: xShape5D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const conv3DBackpropInput = op({ conv3DBackpropInput_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes cos of the input `tf.Tensor` element-wise: `cos(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.cos().print(); // or tf.cos(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function cos_(x) { - const $x = convertToTensor(x, 'x', 'cos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cos, inputs); - } - const cos = op({ cos_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.cosh().print(); // or tf.cosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function cosh_(x) { - const $x = convertToTensor(x, 'x', 'cosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cosh, inputs); - } - const cosh = op({ cosh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the cumulative sum of a `tf.Tensor` along `axis`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4]); - * x.cumsum().print(); - * ``` - * ```js - * const x = tf.tensor([[1, 2], [3, 4]]); - * x.cumsum().print(); - * ``` - * - * @param x The input tensor to be summed. - * @param axis The axis along which to sum. Optional. Defaults to 0. - * @param exclusive Whether to perform exclusive cumulative sum. Optional. - * Defaults to false. If set to true then the sum of each tensor entry - * does not include its own value, but only the values previous to it - * along the specified axis. - * @param reverse Whether to sum in the opposite direction. Optional. - * Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Scan'} - */ - function cumsum_(x, axis = 0, exclusive = false, reverse = false) { - const $x = convertToTensor(x, 'x', 'cumsum'); - const inputs = { x: $x }; - const attrs = { axis, exclusive, reverse }; - return ENGINE.runKernel(Cumsum, inputs, attrs); - } - const cumsum = op({ cumsum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Rearranges data from depth into blocks of spatial data. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `blockSize` indicates the input block size and how the data is - * moved. - * - * - Chunks of data of size `blockSize * blockSize` from depth are rearranged - * into non-overlapping blocks of size `blockSize x blockSize` - * - * - The width the output tensor is `inputWidth * blockSize`, whereas the - * height is `inputHeight * blockSize` - * - * - The Y, X coordinates within each block of the output image are determined - * by the high order component of the input channel index - * - * - The depth of the input tensor must be divisible by `blockSize * - * blockSize` - * - * The `dataFormat` attr specifies the layout of the input and output tensors - * with the following options: "NHWC": [ `batch, height, width, channels` ] - * "NCHW": [ `batch, channels, height, width` ] - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]); - * const blockSize = 2; - * const dataFormat = "NHWC"; - * - * tf.depthToSpace(x, blockSize, dataFormat).print(); - * ``` - * - * @param x The input tensor of rank 4 - * @param blockSIze An `int` that is `>= 2`. The size of the spatial block - * @param dataFormat An optional string from: "NHWC", "NCHW". Defaults to "NHWC" - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function depthToSpace_(x, blockSize, dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'depthToSpace'); - const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2]; - const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3]; - const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1]; - assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputHeight} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputWidth} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); - const inputs = { x: $x }; - const attrs = { blockSize, dataFormat }; - return ENGINE.runKernel(DepthToSpace, inputs, attrs); - } - const depthToSpace = op({ depthToSpace_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Depthwise 2D convolution. - * - * Given a 4D `input` array and a `filter` array of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing - * `inChannels` convolutional filters of depth 1, this op applies a - * different filter to each input channel (expanding from 1 channel to - * `channelMultiplier` channels for each), then concatenates the results - * together. The output has `inChannels * channelMultiplier` channels. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'depthwiseConv2d'); - const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` + - `(${x4D.shape[3]}) must match the inChannels dimension in ` + - `filter ${$filter.shape[2]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const depthwiseConv2d = op({ depthwiseConv2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the grayscale dilation over the input `x`. - * - * @param x The input tensor, rank 3 or rank 4 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filter The filter tensor, rank 3, of shape - * `[filterHeight, filterWidth, depth]`. - * @param strides The strides of the sliding window for each dimension of the - * input tensor: `[strideHeight, strideWidth]`. - * If `strides` is a single number, - * then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1*1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat Specify the data format of the input and output data. - * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations` - * is a single number, then `dilationHeight == dilationWidth`. If it is - * greater than 1, then all values of `strides` must be 1. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'dilation2d'); - const $filter = convertToTensor(filter, 'filter', 'dilation2d'); - assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` + - `${$x.rank}.`); - assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` + - `but got dataFormat of ${dataFormat}`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - reshapedTo4D = true; - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dilations }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Dilation2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const dilation2d = op({ dilation2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * The result is rounded with floor function. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.floorDiv(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.floorDiv(b).print(); // or tf.floorDiv(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function floorDiv_(a, b) { - let $a = convertToTensor(a, 'a', 'floorDiv'); - let $b = convertToTensor(b, 'b', 'floorDiv'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(FloorDiv, inputs); - } - const floorDiv = op({ floorDiv_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function div_(a, b) { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'int32' && $b.dtype === 'int32') { - return floorDiv($a, $b); - } - const inputs = { a: $a, b: $b }; - const attrs = {}; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(RealDiv, inputs, attrs); - } - const div = op({ div_ }); - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Returns the axes in the output space that should be reduced to produce - * the input space. - */ - function getReductionAxes(inShape, outShape) { - const result = []; - for (let i = 0; i < outShape.length; i++) { - const inDim = inShape[inShape.length - i - 1]; - const outAxis = outShape.length - i - 1; - const outDim = outShape[outAxis]; - if (inDim == null || (inDim === 1 && outDim > 1)) { - result.unshift(outAxis); - } - } - return result; - } - function assertAndGetBroadcastShape(shapeA, shapeB) { - const result = []; - const l = Math.max(shapeA.length, shapeB.length); - for (let i = 0; i < l; i++) { - let a = shapeA[shapeA.length - i - 1]; - if (a == null) { - a = 1; - } - let b = shapeB[shapeB.length - i - 1]; - if (b == null) { - b = 1; - } - if (a === 1) { - result.unshift(b); - } - else if (b === 1) { - result.unshift(a); - } - else if (a !== b) { - const errMsg = `Operands could not be broadcast together with shapes ` + - `${shapeA} and ${shapeB}.`; - throw Error(errMsg); - } - else { - result.unshift(a); - } - } - return result; - } - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a == b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.equal(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function equal_(a, b) { - let $a = convertToTensor(a, 'a', 'equal'); - let $b = convertToTensor(b, 'b', 'equal'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Equal, inputs); - } - const equal = op({ equal_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the elements, either `a` or `b` depending on the `condition`. - * - * If the condition is true, select from `a`, otherwise select from `b`. - * - * ```js - * const cond = tf.tensor1d([false, false, true], 'bool'); - * const a = tf.tensor1d([1 , 2, 3]); - * const b = tf.tensor1d([-1, -2, -3]); - * - * a.where(cond, b).print(); - * ``` - * - * @param condition The input condition. Must be of dtype bool. - * @param a If `condition` is rank 1, `a` may have a higher rank but - * its first dimension must match the size of `condition`. - * @param b A tensor with the same dtype as `a` and with shape that is - * compatible with `a`. - * @return A tensor with same dtype as `a` and `b`, and shape that is - * broadcastable from `a` and `b`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function where_(condition, a, b) { - const $a = convertToTensor(a, 'a', 'where'); - const $b = convertToTensor(b, 'b', '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); - const $broadcastedA = broadcastTo($a, broadcastShape); - const $broadcastedB = broadcastTo($b, broadcastShape); - const inputs = { - condition: $broadcastedCondition, - t: $broadcastedA, - e: $broadcastedB - }; - return ENGINE.runKernel(Select, inputs); - } - const where = op({ where_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.zerosLike(x).print(); - * ``` - * - * @param x The tensor of required shape. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function zerosLike_(x) { - const $x = convertToTensor(x, 'x', 'zerosLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(ZerosLike, inputs); - } - const zerosLike = op({ zerosLike_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 - * if denominator is 0. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * const c = tf.tensor1d([0, 0, 0, 0]); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * const c = tf.scalar(0); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function divNoNan_(a, b) { - // TODO: Make this into its own kernel. - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - const divResult = div($a, $b); - const zeros = zerosLike(divResult); - const bEqualsZero = equal($b, zeros); - return where(bEqualsZero, zeros, divResult); - } - const divNoNan = op({ divNoNan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the dot product of two matrices and/or vectors, `t1` and `t2`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor2d([[1, 2], [3, 4]]); - * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * - * a.dot(b).print(); // or tf.dot(a, b) - * b.dot(a).print(); - * b.dot(c).print(); - * ``` - * @param t1 The first tensor in the dot operation. - * @param t2 The second tensor in the dot operation. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function dot_(t1, t2) { - const $t1 = convertToTensor(t1, 't1', 'dot'); - const $t2 = convertToTensor(t2, 't2', 'dot'); - assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` + - `${$t1.rank} and ${$t2.rank}.`); - const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); - const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); - assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` + - `${t1Inner} and ${t2Inner}.`); - if ($t1.rank === 1 && $t2.rank === 1) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, []); - } - else if ($t1.rank === 1 && $t2.rank === 2) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, [t1t2.size]); - } - else if ($t1.rank === 2 && $t2.rank === 1) { - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul($t1, t22D); - return reshape(t1t2, [t1t2.size]); - } - else { - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul($t1, t22D); - return t1t2; - } - } - const dot = op({ dot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`. - * - * ```js - * const x = tf.tensor1d([-1, 1, -3, 2]); - * - * x.elu().print(); // or tf.elu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function elu_(x) { - const $x = convertToTensor(x, 'x', 'elu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Elu, inputs); - } - const elu = op({ elu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes gause error function of the input `tf.Tensor` element-wise: - * `erf(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.erf().print(); // or tf.erf(x); - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function erf_(x) { - let $x = convertToTensor(x, 'x', 'erf'); - assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.'); - if ($x.dtype === 'int32') { - $x = cast($x, 'float32'); - } - const inputs = { x: $x }; - return ENGINE.runKernel(Erf, inputs); - } - const erf = op({ erf_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.exp().print(); // or tf.exp(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function exp_(x) { - const $x = convertToTensor(x, 'x', 'exp'); - const inputs = { x: $x }; - return ENGINE.runKernel(Exp, inputs); - } - const exp = op({ exp_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension - * into the tensor's shape. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const axis = 1; - * x.expandDims(axis).print(); - * ``` - * - * @param x The input tensor whose dimensions to be expanded. - * @param axis The dimension index at which to insert shape of `1`. Defaults - * to 0 (the first dimension). - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function expandDims_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric'); - assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor'); - const inputs = { input: $x }; - const attrs = { dim: axis }; - return ENGINE.runKernel(ExpandDims, inputs, attrs); - } - const expandDims = op({ expandDims_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes exponential of the input `tf.Tensor` minus one element-wise. - * `e ^ x - 1` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.expm1().print(); // or tf.expm1(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function expm1_(x) { - const $x = convertToTensor(x, 'x', 'expm1'); - const inputs = { x: $x }; - return ENGINE.runKernel(Expm1, inputs); - } - const expm1 = op({ expm1_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Construct a tensor by repeating it the number of times given by reps. - * - * This operation creates a new tensor by replicating `input` `reps` - * times. The output tensor's i'th dimension has `input.shape[i] * - * reps[i]` elements, and the values of `input` are replicated - * `reps[i]` times along the i'th dimension. For example, tiling - * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * - * a.tile([2]).print(); // or a.tile([2]) - * ``` - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.tile([1, 2]).print(); // or a.tile([1, 2]) - * ``` - * @param x The tensor to tile. - * @param reps Determines the number of replications per dimension. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function tile_(x, reps) { - const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric'); - assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of reps ${reps}.`); - const inputs = { x: $x }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); - } - const tile = op({ tile_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes floor of input `tf.Tensor` element-wise: `floor(x)`. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.floor().print(); // or tf.floor(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function floor_(x) { - const $x = convertToTensor(x, 'x', 'floor'); - const inputs = { x: $x }; - return ENGINE.runKernel(Floor, inputs); - } - const floor = op({ floor_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Gather slices from tensor `x`'s axis `axis` according to `indices`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const indices = tf.tensor1d([1, 3, 3], 'int32'); - * - * x.gather(indices).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const indices = tf.tensor1d([1, 1, 0], 'int32'); - * - * x.gather(indices).print(); - * ``` - * @param x The input tensor whose slices to be gathered. - * @param indices The indices of the values to extract. - * @param axis The axis over which to select values. Defaults to 0. - * @param batchDims Optional. The number of batch dimensions. It must be less - * than or equal to rank(indices). Defaults to 0. - * The output tensor will have shape of - * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]` - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function gather_(x, indices, axis = 0, batchDims = 0) { - const $x = convertToTensor(x, 'x', 'gather'); - const $indices = convertToTensor(indices, 'indices', 'gather', 'int32'); - const inputs = { x: $x, indices: $indices }; - const attrs = { axis, batchDims }; - return ENGINE.runKernel(GatherV2, inputs, attrs); - } - const gather = op({ gather_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a > b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greater(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function greater_(a, b) { - let $a = convertToTensor(a, 'a', 'greater'); - let $b = convertToTensor(b, 'b', 'greater'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Greater, inputs); - } - const greater = op({ greater_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a >= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greaterEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function greaterEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'greaterEqual'); - let $b = convertToTensor(b, 'b', 'greaterEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(GreaterEqual, inputs); - } - const greaterEqual = op({ greaterEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the imaginary part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the imaginary part of each element in input considered as a complex number. - * If input is real, a tensor of all zeros is returned. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.imag(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function imag_(input) { - const $input = convertToTensor(input, 'input', 'imag'); - const inputs = { input: $input }; - return ENGINE.runKernel(Imag, inputs); - } - const imag = op({ imag_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns which elements of x are finite. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isFinite().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isFinite_(x) { - const $x = convertToTensor(x, 'x', 'isFinite'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsFinite, inputs); - } - const isFinite$1 = op({ isFinite_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns which elements of x are Infinity or -Infinity. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isInf().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isInf_(x) { - const $x = convertToTensor(x, 'x', 'isInf'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsInf, inputs); - } - const isInf = op({ isInf_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * RReturns which elements of x are NaN. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isNaN().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function isNaN_(x) { - const $x = convertToTensor(x, 'x', 'isNaN'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsNan, inputs); - } - const isNaN$1 = op({ isNaN_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes leaky rectified linear element-wise. - * - * See - * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf]( - * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf) - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1) - * ``` - * @param x The input tensor. - * @param alpha The scaling factor for negative values, defaults to 0.2. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function leakyRelu_(x, alpha = 0.2) { - const $x = convertToTensor(x, 'x', 'leakyRelu'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(LeakyRelu, inputs, attrs); - } - const leakyRelu = op({ leakyRelu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a < b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.less(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function less_(a, b) { - let $a = convertToTensor(a, 'a', 'less'); - let $b = convertToTensor(b, 'b', 'less'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Less, inputs); - } - const less = op({ less_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a <= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.lessEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function lessEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'lessEqual'); - let $b = convertToTensor(b, 'b', 'lessEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LessEqual, inputs); - } - const lessEqual = op({ lessEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Normalizes the activation of a local neighborhood across or within - * channels. - * - * @param x The input tensor. The 4-D input tensor is treated as a 3-D array - * of 1D vectors (along the last dimension), and each vector is - * normalized independently. - * @param depthRadius The number of adjacent channels in the 1D normalization - * window. - * @param bias A constant bias term for the basis. - * @param alpha A scale factor, usually positive. - * @param beta An exponent. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const $x = convertToTensor(x, 'x', 'localResponseNormalization'); - assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${$x.rank}.`); - assert(isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` + - `integer but got depthRadius ${depthRadius}.`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - const inputs = { x: x4D }; - const attrs = { depthRadius, bias, alpha, beta }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(LRN, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - else { - return res; - } - } - const localResponseNormalization = op({ localResponseNormalization_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E]); - * - * x.log().print(); // or tf.log(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function log_(x) { - const $x = convertToTensor(x, 'x', 'log'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log, inputs); - } - const log = op({ log_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes natural logarithm of the input `tf.Tensor` plus one - * element-wise: `ln(1 + x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E - 1]); - * - * x.log1p().print(); // or tf.log1p(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function log1p_(x) { - const $x = convertToTensor(x, 'x', 'log1p'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log1p, inputs); - } - const log1p = op({ log1p_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Overrides the gradient computation of a function `f`. - * - * Takes a function - * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}` - * and returns another function `g(...inputs)` which takes the same inputs as - * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients - * with respect to each input of `f` are computed using `f().gradFunc`. - * - * The `save` function passsed to `f` should be used for saving tensors needed - * in the gradient. And the `saved` passed to the `gradFunc` is a - * `NamedTensorMap`, which contains those saved tensor. - * - * ```js - * const customOp = tf.customGrad((x, save) => { - * // Save x to make sure it's available later for the gradient. - * save([x]); - * // Override gradient of our custom x ^ 2 op to be dy * abs(x); - * return { - * value: x.square(), - * // Note `saved.x` which points to the `x` we saved earlier. - * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())] - * }; - * }); - * - * const x = tf.tensor1d([-1, -2, 3]); - * const dx = tf.grad(x => customOp(x)); - * - * console.log(`f(x):`); - * customOp(x).print(); - * console.log(`f'(x):`); - * dx(x).print(); - * ``` - * - * @param f The function to evaluate in forward mode, which should return - * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc` - * returns the custom gradients of `f` with respect to its inputs. - * - * @doc {heading: 'Training', subheading: 'Gradients'} - */ - function customGrad(f) { - return ENGINE.customGrad(f); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes `-1 * x` element-wise. - * - * ```js - * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]); - * - * x.neg().print(); // or tf.neg(x) - * ``` - * - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function neg_(x) { - const $x = convertToTensor(x, 'x', 'neg'); - const inputs = { x: $x }; - return ENGINE.runKernel(Neg, inputs); - } - const neg = op({ neg_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.softplus().print(); // or tf.softplus(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function softplus_(x) { - const $x = convertToTensor(x, 'x', 'softplus'); - const inputs = { x: $x }; - return ENGINE.runKernel(Softplus, inputs); - } - const softplus = op({ softplus_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes log sigmoid of the input `tf.Tensor` element-wise: - * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`. - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.logSigmoid().print(); // or tf.logSigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function logSigmoid_(x) { - const $x = convertToTensor(x, 'x', 'logSigmoid'); - // Use a custom gradient to maintain previous implementation. - // There is no LogSigmoid kernel in TF so we can't use engine.runKernel - // directly - const customOp = customGrad((x) => { - // TODO(yassogba) we can remove the chained softplus call here only - // after backends have modualrized softplus at which point we can call - // engine runKernel(..., Sotfplus, ...) directly. - const value = neg(softplus(neg(x))); - const gradFunc = (dy) => { - const derX = mul(dy, sigmoid(neg(x))); - return derX; - }; - return { value, gradFunc }; - }); - return customOp($x); - } - const logSigmoid = op({ logSigmoid_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the maximum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.max().print(); // or tf.max(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.max(axis).print(); // or tf.max(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function max_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'max'); - const inputs = { x: $x }; - const attrs = { reductionIndices: axis, keepDims }; - return ENGINE.runKernel(Max, inputs, attrs); - } - const max = op({ max_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * - * ```js - * // Broadcast subtract a with b. - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.scalar(5); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * @param a The first `tf.Tensor` to subtract from. - * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function sub_(a, b) { - let $a = convertToTensor(a, 'a', 'sub'); - let $b = convertToTensor(b, 'b', 'sub'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Sub, inputs); - } - const sub = op({ sub_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the sum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If axes has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.sum().print(); // or tf.sum(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.sum(axis).print(); // or tf.sum(x, axis) - * ``` - * - * @param x The input tensor to compute the sum over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function sum_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'sum'); - if ($x.dtype === 'bool') { - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Sum, inputs, attrs); - } - const sum = op({ sum_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the log softmax. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * @param logits The logits array. - * @param axis The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function logSoftmax_(logits, axis = -1) { - const $logits = convertToTensor(logits, 'logits', 'logSoftmax'); - if (axis === -1) { - axis = $logits.rank - 1; - } - if (axis !== $logits.rank - 1) { - throw Error('Log Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and axis was ${axis}`); - } - // const forward: ForwardFunc = (backend, save) => { - // const keepDims = true; - // const xMax = max(logits, axis, true); - // const shifted = sub(logits, xMax); - // const value = - // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, - // keepDims))); - // save([value]); - // return value; - // }; - // Use a custom gradient for numerical stability. - const customOp = customGrad((logits, save) => { - const keepDims = true; - const xMax = max(logits, axis, true); - const shifted = sub(logits, xMax); - const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims))); - save([value]); - const gradFunc = (dy, saved) => { - const [value] = saved; - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - }; - return { value, gradFunc }; - }); - return customOp($logits); - // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this. - // const inputs: LogSoftmaxInputs = {logits: $logits}; - // const attrs: LogSoftmaxAttrs = {axis}; - // return ENGINE.runKernel( - // LogSoftmax, inputs as {} as NamedTensorMap, - // attrs as {} as NamedAttrMap); - } - const logSoftmax = op({ logSoftmax_ }); - - /** - * @license - * Copyright 2017 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. - * ============================================================================= - */ - /** - * Returns true if the axis specifies the inner most dimensions of the - * array. - */ - function axesAreInnerMostDims(axes, rank) { - for (let i = 0; i < axes.length; ++i) { - if (axes[axes.length - i - 1] !== rank - 1 - i) { - return false; - } - } - return true; - } - function combineLocations(outputLoc, reduceLoc, axes) { - const rank = outputLoc.length + reduceLoc.length; - const loc = []; - let outIdx = 0; - let reduceIdx = 0; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - loc.push(outputLoc[outIdx++]); - } - else { - loc.push(reduceLoc[reduceIdx++]); - } - } - return loc; - } - function computeOutAndReduceShapes(aShape, axes) { - const outShape = []; - const rank = aShape.length; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - outShape.push(aShape[dim]); - } - } - const reduceShape = axes.map(dim => aShape[dim]); - return [outShape, reduceShape]; - } - function expandShapeToKeepDim(shape, axes) { - const reduceSubShape = axes.map(x => 1); - return combineLocations(shape, reduceSubShape, axes); - } - /** - * Returns the axes permutation to be used with `tf.transpose`, if such - * permutation is necessary. Otherwise it returns null. This method is used by - * operations that operate only on inner-most axes. - */ - function getAxesPermutation(axes, rank) { - if (axesAreInnerMostDims(axes, rank)) { - return null; - } - const result = []; - for (let i = 0; i < rank; ++i) { - if (axes.indexOf(i) === -1) { - result.push(i); - } - } - axes.forEach(axis => result.push(axis)); - return result; - } - /** Returns the axes permutation that undoes the original permutation. */ - function getUndoAxesPermutation(axes) { - return axes.map((axis, i) => [i, axis]) - .sort((a, b) => a[1] - b[1]) - .map(x => x[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. - * ============================================================================= - */ - /** - * Computes the log(sum(exp(elements across the reduction dimensions)). - * - * Reduces the input along the dimensions given in `axis`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.logSumExp().print(); // or tf.logSumExp(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis) - * ``` - * @param x The input tensor. - * @param axis The dimension(s) to reduce. If null (the default), - * reduces all dimensions. - * @param keepDims If true, retains reduced dimensions with length - * of 1. Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function logSumExp_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'logSumExp'); - const axes = parseAxisParam(axis, $x.shape); - const xMax = max($x, axes, true /* keepDims */); - const a = sub($x, xMax); - const b = exp(a); - const c = sum(b, axes); - const d = log(c); - const res = add$1(reshape(xMax, d.shape), d); - if (keepDims) { - const newShape = expandShapeToKeepDim(res.shape, axes); - return reshape(res, newShape); - } - return res; - } - const logSumExp = op({ logSumExp_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a AND b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalAnd(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalAnd_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalAnd, inputs); - } - const logicalAnd = op({ logicalAnd_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `NOT x` element-wise. - * - * ```js - * const a = tf.tensor1d([false, true], 'bool'); - * - * a.logicalNot().print(); - * ``` - * - * @param x The input tensor. Must be of dtype 'bool'. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalNot_(x) { - const $x = convertToTensor(x, 'x', 'logicalNot', 'bool'); - const inputs = { x: $x }; - return ENGINE.runKernel(LogicalNot, inputs); - } - const logicalNot = op({ logicalNot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a OR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalOr(b).print(); - * ``` - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalOr_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalOr', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalOr', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalOr, inputs); - } - const logicalOr = op({ logicalOr_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of `a XOR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalXor(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function logicalXor_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalXor', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalXor', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - // x ^ y = (x | y) & ~(x & y) - return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b))); - } - const logicalXor = op({ logicalXor_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the 2D max pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'maxPool'); - const dilations = 1; - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const maxPool = op({ maxPool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the max of a and b (`a > b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `tf.maximumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * ```js - * // Broadcast maximum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function maximum_(a, b) { - let $a = convertToTensor(a, 'a', 'maximum'); - let $b = convertToTensor(b, 'b', 'maximum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Maximum, inputs); - } - const maximum = op({ maximum_ }); - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the mean of elements across dimensions of a `tf.Tensor`. - * - * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is - * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with - * a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.mean().print(); // or tf.mean(a) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.mean(axis).print(); // or tf.mean(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function mean_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'mean'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Mean, inputs, attrs); - } - const mean = op({ mean_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 0. - * - * ```js - * tf.zeros([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Can - * be 'float32', 'int32' or 'bool'. Defaults to 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function zeros(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = zeros(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeZerosTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 1. - * - * ```js - * tf.ones([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Defaults to - * 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function ones$1(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = ones$1(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeOnesTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ - /** - * Computes the minimum value from the input. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axes`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axes` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.min().print(); // or tf.min(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.min(axis).print(); // or tf.min(x, axis) - * ``` - * - * @param x The input Tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function min_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'min'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Min, inputs, attrs); - } - const min = op({ min_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the min of a and b (`a < b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `minimumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * ```js - * // Broadcast minimum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function minimum_(a, b) { - let $a = convertToTensor(a, 'a', 'minimum'); - let $b = convertToTensor(b, 'b', 'minimum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Minimum, inputs); - } - const minimum = op({ minimum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Pads a `tf.Tensor` using mirror padding. - * - * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad. - * - * ```js - * const x = tf.range(0, 9).reshape([1, 1, 3, 3]); - * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * In "reflect" mode, the padded regions do not include the borders, - * while in "symmetric" mode the padded regions do include the borders. - * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`, - * then the output is `[1, 2, 3, 2, 1]` in "reflect" mode, and - * `[1, 2, 3, 3, 2]` in "symmetric" mode. - * If `mode` is "reflect" then both `paddings[D, 0]` and `paddings[D, 1]` - * must be no greater than `x.shape[D] - 1`. If mode is "symmetric" - * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than - * `x.shape[D]` - * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'` - */ - /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ - function mirrorPad_(x, paddings, mode) { - assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` + - `Got ${mode}.`); - const $x = convertToTensor(x, 'x', 'mirrorPad'); - if ($x.rank === 0) { - throw new Error('mirrorPad(scalar) is not defined. ' + - 'Pass non-scalar to mirrorPad'); - } - assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` + - `Got ${paddings.length}.`); - const shapeOffset = mode === 'reflect' ? 1 : 0; - for (let i = 0; i < $x.rank; i++) { - assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`); - assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset && - paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` + - `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` + - `shape ${$x.shape}`); - } - const attrs = { paddings, mode }; - const inputs = { x: $x }; - return ENGINE.runKernel(MirrorPad, inputs, attrs); - } - const mirrorPad = op({ mirrorPad_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the mod of a and b element-wise. - * `floor(x / y) * y + mod(x, y) = x` - * Supports broadcasting. - * - * We also expose `tf.modStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * ```js - * // Broadcast a mod b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function mod_(a, b) { - let $a = convertToTensor(a, 'a', 'mod'); - let $b = convertToTensor(b, 'b', 'mod'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Mod, inputs); - } - const mod = op({ mod_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes square of `x` element-wise: `x ^ 2` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]); - * - * x.square().print(); // or tf.square(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function square_(x) { - const $x = convertToTensor(x, 'x', 'square'); - const attrs = {}; - return ENGINE.runKernel('Square', { x: $x }, attrs); - } - const square = op({ square_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the truth value of (a != b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([0, 2, 3]); - * - * a.notEqual(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ - function notEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'notEqual'); - let $b = convertToTensor(b, 'b', 'notEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(NotEqual, inputs); - } - const notEqual = op({ notEqual_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take - * value `onValue` (defaults to 1), while all other locations take value - * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank - * `R+1` with the last axis of size `depth`. - * - * ```js - * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print(); - * ``` - * - * @param indices `tf.Tensor` of indices with dtype `int32`. - * @param depth The depth of the one hot dimension. - * @param onValue A number used to fill in the output when the index matches - * the location. - * @param offValue A number used to fill in the output when the index does - * not match the location. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function oneHot_(indices, depth, onValue = 1, offValue = 0) { - if (depth < 2) { - throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); - } - const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); - const inputs = { indices: $indices }; - const attrs = { depth, onValue, offValue }; - return ENGINE.runKernel(OneHot, inputs, attrs); - } - const oneHot = op({ oneHot_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.onesLike(x).print(); - * ``` - * @param x A tensor. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function onesLike_(x) { - const $x = convertToTensor(x, 'x', 'onesLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(OnesLike, inputs); - } - const onesLike = op({ onesLike_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Pads a `tf.Tensor` with a given value and paddings. - * - * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`, - * refer to `tf.mirrorPad` - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `paddings` is of given length. - * - `tf.pad1d` - * - `tf.pad2d` - * - `tf.pad3d` - * - `tf.pad4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.pad([[1, 2]]).print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * @param constantValue The pad value to use. Defaults to 0. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function pad_(x, paddings, constantValue = 0) { - const $x = convertToTensor(x, 'x', 'pad'); - if ($x.rank === 0) { - throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); - } - const attrs = { paddings, constantValue }; - const inputs = { x: $x }; - return ENGINE.runKernel(PadV2, inputs, attrs); - } - const pad = op({ pad_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * This operation divides "spatial" dimensions `[1, ..., M]` of the input into - * a grid of blocks of shape `blockShape`, and interleaves these blocks with - * the "batch" dimension (0) such that in the output, the spatial - * dimensions `[1, ..., M]` correspond to the position within the grid, - * and the batch dimension combines both the position within a spatial block - * and the original batch position. Prior to division into blocks, - * the spatial dimensions of the input are optionally zero padded - * according to `paddings`. See below for a precise description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); - * const blockShape = [2, 2]; - * const paddings = [[0, 0], [0, 0]]; - * - * x.spaceToBatchND(blockShape, paddings).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >= - * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad - * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It - * is required that - * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0` - * - * This operation is equivalent to the following steps: - * - * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input - * according to `paddings` to produce `padded` of shape paddedShape. - * - * 2. Reshape `padded` to `reshapedPadded` of shape: - * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., - * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape` - * - * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded` - * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the - * batch dimension, producing an output tensor of shape: - * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function spaceToBatchND_(x, blockShape, paddings) { - const $x = convertToTensor(x, 'x', 'spaceToBatchND'); - assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); - assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); - assert($x.shape.reduce((a, b, i) => { - if (i > 0 && i <= blockShape.length) { - return a && - ((b + paddings[i - 1][0] + paddings[i - 1][1]) % - blockShape[i - 1] === - 0); - } - return a; - }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); - const inputs = { x: $x }; - const attrs = { blockShape, paddings }; - return ENGINE.runKernel(SpaceToBatchND, inputs, attrs); - } - const spaceToBatchND = op({ spaceToBatchND_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Performs an N-D pooling operation - * - * @param input The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param windowShape The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param poolingType The type of pooling, either 'max' or 'avg'. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function pool_(input, windowShape, poolingType, pad, dilations, strides) { - if (dilations == null) { - dilations = [1, 1]; - } - if (strides == null) { - strides = 1; - } - if (pad === 0) { - pad = 'valid'; - } - const $x = convertToTensor(input, 'x', 'maxPool'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad); - const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; - // The following implementation does batchToSpace(pool(spaceToBatch(x))) - // whenever dilation > 1 since the TF kernels do not support dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037 - let basePadding; - if (pad === 'same') { - basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation); - } - else { - basePadding = [[0, 0], [0, 0]]; - } - const isDilationOne = dilation[0] === 1 && dilation[1] === 1; - const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); - const convertedPad = isDilationOne ? pad : 'valid'; - const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding); - const forwardOp = poolingType === 'avg' ? - () => avgPool(convertedX, windowShape, strides, convertedPad) : - () => maxPool(convertedX, windowShape, strides, convertedPad); - const y = forwardOp(); - const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - // Helper function to compute crops and paddings for pool with dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184 - function requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) { - const padStart = basePadding.map(b => b[0]); - const origPadEnd = basePadding.map(b => b[1]); - const fullInputShape = inputShape.concat(padStart, origPadEnd); - const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b); - const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]); - const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]); - const crops = blockShape.map((_, i) => [0, padEndExtra[i]]); - return [paddings, crops]; - } - // Helper function to compute base paddings for pool with dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524 - function withSpaceToBatchBasePaddings(filterShape, dilation) { - // Spatial dimensions of the filters and the upsampled filters in which we - // introduce (rate - 1) zeros between consecutive filter values. - const dilatedFilterShape = filterShape.map((s, i) => { - return s + (s - 1) * (dilation[i] - 1); - }); - const padExtraShape = dilatedFilterShape.map(s => s - 1); - // When padding is odd, we pad more at end, following the same - // convention as conv2d. - const padExtraStart = padExtraShape.map(s => Math.floor(s / 2)); - const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]); - return padExtraShape.map((_, i) => { - return [padExtraStart[i], padExtraEnd[i]]; - }); - } - const pool = op({ pool_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the power of one `tf.Tensor` to another. Supports broadcasting. - * - * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for - * corresponding elements in x and y. The result's dtype will be the upcasted - * type of the `base` and `exp` dtypes. - * - * ```js - * const a = tf.tensor([[2, 3], [4, 5]]) - * const b = tf.tensor([[1, 2], [3, 0]]).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * - * ```js - * const a = tf.tensor([[1, 2], [3, 4]]) - * const b = tf.tensor(2).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * We also expose `powStrict` which has the same signature as this op and - * asserts that `base` and `exp` are the same shape (does not broadcast). - * - * @param base The base `tf.Tensor` to pow element-wise. - * @param exp The exponent `tf.Tensor` to pow element-wise. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function pow_(base, exp) { - let $base = convertToTensor(base, 'base', 'pow'); - let $exp = convertToTensor(exp, 'exp', 'pow'); - [$base, $exp] = makeTypesMatch($base, $exp); - const inputs = { a: $base, b: $exp }; - return ENGINE.runKernel(Pow, inputs); - } - const pow = op({ pow_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes leaky rectified linear element-wise with parametric alphas. - * - * `x < 0 ? alpha * x : f(x) = x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * const alpha = tf.scalar(0.1); - * - * x.prelu(alpha).print(); // or tf.prelu(x, alpha) - * ``` - * @param x The input tensor. - * @param alpha Scaling factor for negative values. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function prelu_(x, alpha) { - const $x = convertToTensor(x, 'x', 'prelu'); - const $alpha = convertToTensor(alpha, 'alpha', 'prelu'); - const inputs = { x: $x, alpha: $alpha }; - return ENGINE.runKernel(Prelu, inputs); - } - const prelu = op({ prelu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the product of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.prod().print(); // or tf.prod(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.prod(axis).print(); // or tf.prod(x, axis) - * ``` - * - * @param x The input tensor to compute the product over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ - function prod_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'prod'); - if ($x.dtype === 'bool') { - // bool is not an allowed type for the underlying kernel. - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Prod, inputs, attrs); - } - const prod = op({ prod_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns the real part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the real part of each element in input considered as a complex number. - * - * If the input is real, it simply makes a clone. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.real(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function real_(input) { - const $input = convertToTensor(input, 'input', 'real'); - const inputs = { input: $input }; - return ENGINE.runKernel(Real, inputs); - } - const real = op({ real_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes reciprocal of x element-wise: `1 / x` - * - * ```js - * const x = tf.tensor1d([0, 1, 2]); - * - * x.reciprocal().print(); // or tf.reciprocal(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function reciprocal_(x) { - const $x = convertToTensor(x, 'x', 'reciprocal'); - const inputs = { x: $x }; - return ENGINE.runKernel(Reciprocal, inputs); - } - const reciprocal = op({ reciprocal_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes rectified linear element-wise: `max(x, 0)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.relu().print(); // or tf.relu(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function relu_(x) { - const $x = convertToTensor(x, 'x', 'relu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu, inputs); - } - const relu = op({ relu_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 8]); - * - * x.relu6().print(); // or tf.relu6(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function relu6_(x) { - const $x = convertToTensor(x, 'x', 'relu6'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu6, inputs); - } - const relu6 = op({ relu6_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Reverses a `tf.Tensor` along a specified axis. - * - * Also available are stricter rank-specific methods that assert that `x` is - * of the given rank: - * - `tf.reverse1d` - * - `tf.reverse2d` - * - `tf.reverse3d` - * - `tf.reverse4d` - * - * Except `tf.reverse1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.reverse().print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.reverse(axis).print(); - * ``` - * @param x The input tensor to be reversed. - * @param axis The set of dimensions to reverse. Must be in the - * range [-rank(x), rank(x)). Defaults to all axes. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function reverse_(x, axis) { - const $x = convertToTensor(x, 'x', 'reverse'); - const inputs = { x: $x }; - const attrs = { dims: axis }; - return ENGINE.runKernel(Reverse, inputs, attrs); - } - const reverse = op({ reverse_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes round of input `tf.Tensor` element-wise: `round(x)`. - * It implements banker's rounding. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.round().print(); // or tf.round(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function round_(x) { - const $x = convertToTensor(x, 'x', 'round'); - const inputs = { x: $x }; - return ENGINE.runKernel(Round, inputs); - } - const round$1 = op({ round_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes reciprocal of square root of the input `tf.Tensor` element-wise: - * `y = 1 / sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.rsqrt().print(); // or tf.rsqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function rsqrt_(x) { - const $x = convertToTensor(x, 'x', 'rsqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Rsqrt, inputs); - } - const rsqrt = op({ rsqrt_ }); - - /** - * @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. - * ============================================================================= - */ - /** This is shared code across all tensor creation methods. */ - function makeTensor(values, shape, inferredShape, dtype) { - if (dtype == null) { - dtype = inferDtype(values); - } - if (dtype === 'complex64') { - throw new Error(`Cannot construct a complex64 tensor directly. ` + - `Please use tf.complex(real, imag).`); - } - if (!isTypedArray(values) && !Array.isArray(values) && - typeof values !== 'number' && typeof values !== 'boolean' && - typeof values !== 'string') { - throw new Error('values passed to tensor(values) must be a number/boolean/string or ' + - 'an array of numbers/booleans/strings, or a TypedArray'); - } - if (shape != null) { - assertNonNegativeIntegerDimensions(shape); - const providedSize = sizeFromShape(shape); - const inferredSize = sizeFromShape(inferredShape); - assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` + - `${providedSize} values but has ${inferredSize}`); - for (let i = 0; i < inferredShape.length; ++i) { - const inferred = inferredShape[i]; - const flatDimsDontMatch = i === inferredShape.length - 1 ? - inferred !== sizeFromShape(shape.slice(i)) : - true; - assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` + - `(${inferredShape}) does not match the provided ` + - `shape (${shape}). `); - } - } - if (!isTypedArray(values) && !Array.isArray(values)) { - values = [values]; - } - shape = shape || inferredShape; - values = dtype !== 'string' ? - toTypedArray(values, dtype) : - flatten(values, [], true); - return ENGINE.makeTensor(values, shape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype. - * - * The same functionality can be achieved with `tf.tensor`, but in general - * we recommend using `tf.scalar` as it makes the code more readable. - * - * ```js - * tf.scalar(3.14).print(); - * ``` - * - * @param value The value of the scalar. - * @param dtype The data type. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ - function scalar(value, dtype) { - if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) && - dtype !== 'complex64') { - throw new Error('Error creating a new Scalar: value must be a primitive ' + - '(number|boolean|string)'); - } - if (dtype === 'string' && isTypedArray(value) && - !(value instanceof Uint8Array)) { - throw new Error('When making a scalar from encoded string, ' + - 'the value must be `Uint8Array`.'); - } - const shape = []; - const inferredShape = []; - return makeTensor(value, shape, inferredShape, dtype); - } - - /** - * @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. - * ============================================================================= - */ - /** - * Computes scaled exponential linear element-wise. - * - * `x < 0 ? scale * alpha * (exp(x) - 1) : x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.selu().print(); // or tf.selu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function selu_(x) { - const $x = convertToTensor(x, 'x', 'selu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Selu, inputs); - } - const selu = op({ selu_ }); - - /** - * 2-D convolution with separable filters. - * - * Performs a depthwise convolution that acts separately on channels followed - * by a pointwise convolution that mixes channels. Note that this is - * separability between dimensions [1, 2] and 3, not spatial separability - * between dimensions 1 and 2. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is - * the filter used in the first step. - * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape - * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is - * the filter used in the second step. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ - function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'separableConv2d'); - const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); - const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - if (dataFormat === 'NCHW') { - throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + - 'NHWC is supported'); - } - assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` + - ` must be 1, but got ${$pointwiseFilter.shape[0]}.`); - assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` + - `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`); - const inChannels = $depthwiseFilter.shape[2]; - const channelMultiplier = $depthwiseFilter.shape[3]; - assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` + - `must be ${inChannels * channelMultiplier}, ` + - `but got ${$pointwiseFilter.shape[2]}.`); - const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); - const pointwiseStride = 1; - const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const separableConv2d = op({ separableConv2d_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns an element-wise indication of the sign of a number. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]); - * - * x.sign().print(); // or tf.sign(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sign_(x) { - const $x = convertToTensor(x, 'x', 'sign'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sign, inputs); - } - const sign = op({ sign_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes sin of the input Tensor element-wise: `sin(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.sin().print(); // or tf.sin(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sin_(x) { - const $x = convertToTensor(x, 'x', 'sin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sin, inputs); - } - const sin = op({ sin_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.sinh().print(); // or tf.sinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sinh_(x) { - const $x = convertToTensor(x, 'x', 'sinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sinh, inputs); - } - const sinh = op({ sinh_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the softmax normalized vector given the logits. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * @param logits The logits array. - * @param dim The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ - function softmax_(logits, dim = -1) { - const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32'); - if (dim === -1) { - dim = $logits.rank - 1; - } - if (dim !== $logits.rank - 1) { - throw Error('Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and dim was ${dim}`); - } - const inputs = { logits: $logits }; - const attrs = { dim }; - return ENGINE.runKernel(Softmax, inputs, attrs); - } - const softmax = op({ softmax_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.fft().print(); // tf.spectral.fft(x).print(); - * ``` - * @param input The complex input to compute an fft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function fft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(FFT, inputs); - } - const fft = op({ fft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Inverse fast Fourier transform. - * - * Computes the inverse 1-dimensional discrete Fourier transform over the - * inner-most dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.ifft().print(); // tf.spectral.ifft(x).print(); - * ``` - * @param input The complex input to compute an ifft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function ifft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(IFFT, inputs); - } - const ifft = op({ ifft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Inversed real value input fast Fourier transform. - * - * Computes the 1-dimensional inversed discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([0, 0, 0]); - * const x = tf.complex(real, imag); - * - * x.irfft().print(); - * ``` - * @param input The real value input to compute an irfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function irfft_(input) { - const innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let ret; - if (innerDimensionSize <= 2) { - const complexInput = reshape(input, [batch, innerDimensionSize]); - ret = ifft(complexInput); - } - else { - // The length of unique components of the DFT of a real-valued signal - // is 2 * (input_len - 1) - const outputShape = [batch, 2 * (innerDimensionSize - 1)]; - const realInput = reshape(real(input), [batch, innerDimensionSize]); - const imagInput = reshape(imag(input), [batch, innerDimensionSize]); - const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); - const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1)); - const r = concat([realInput, realConjugate], 1); - const i = concat([imagInput, imagConjugate], 1); - const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]); - ret = ifft(complexInput); - } - ret = real(ret); - // reshape the result if the input is 3D tensor. - if (input.rank === 3 && input.shape[0] !== 0) { - const temp = ret; - const batch = input.shape[0]; - ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]); - temp.dispose(); - } - return ret; - } - const irfft = op({ irfft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Splits a `tf.Tensor` into sub tensors. - * - * If `numOrSizeSplits` is a number, splits `x` along dimension `axis` - * into `numOrSizeSplits` smaller tensors. - * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`. - * - * If `numOrSizeSplits` is a number array, splits `x` into - * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the - * same size as `x` except along dimension `axis` where the size is - * `numOrSizeSplits[i]`. - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - * const [a, b] = tf.split(x, 2, 1); - * a.print(); - * b.print(); - * - * const [c, d, e] = tf.split(x, [1, 2, 1], 1); - * c.print(); - * d.print(); - * e.print(); - * ``` - * - * @param x The input tensor to split. - * @param numOrSizeSplits Either an integer indicating the number of - * splits along the axis or an array of integers containing the sizes of - * each output tensor along the axis. If a number then it must evenly divide - * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`. - * Can contain one -1 indicating that dimension is to be inferred. - * @param axis The dimension along which to split. Defaults to 0 (the first - * dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function split_(x, numOrSizeSplits, axis = 0) { - const $x = convertToTensor(x, 'x', 'split'); - const inputs = { x: $x }; - const attr = { numOrSizeSplits, axis }; - return ENGINE.runKernel(SplitV, inputs, attr); - } - const split = op({ split_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Real value input fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * - * real.rfft().print(); - * ``` - * @param input The real value input to compute an rfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ - function rfft_(input, fftLength) { - assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`); - let innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let adjustedInput; - if (fftLength != null && fftLength < innerDimensionSize) { - // Need to crop - const begin = input.shape.map(v => 0); - const size = input.shape.map(v => v); - size[input.shape.length - 1] = fftLength; - adjustedInput = slice(input, begin, size); - innerDimensionSize = fftLength; - } - else if (fftLength != null && fftLength > innerDimensionSize) { - // Need to pad with zeros - const zerosShape = input.shape.map(v => v); - zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize; - adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1); - innerDimensionSize = fftLength; - } - else { - adjustedInput = input; - } - // Complement the input with zero imaginary numbers. - const zerosInput = zerosLike(adjustedInput); - const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]); - const ret = fft(complexInput); - // Exclude complex conjugations. These conjugations are put symmetrically. - const half = Math.floor(innerDimensionSize / 2) + 1; - const realValues = real(ret); - const imagValues = imag(ret); - const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1); - const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1); - const outputShape = adjustedInput.shape.slice(); - outputShape[adjustedInput.shape.length - 1] = half; - return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape); - } - const rfft = op({ rfft_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.sqrt().print(); // or tf.sqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function sqrt_(x) { - const $x = convertToTensor(x, 'x', 'sqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sqrt, inputs); - } - const sqrt = op({ sqrt_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Returns (a - b) * (a - b) element-wise. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * ```js - * // Broadcast squared difference a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ - function squaredDifference_(a, b) { - let $a = convertToTensor(a, 'a', 'squaredDifference'); - let $b = convertToTensor(b, 'b', 'squaredDifference'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - const attrs = {}; - return ENGINE.runKernel(SquaredDifference, inputs, attrs); - } - const squaredDifference = op({ squaredDifference_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Removes dimensions of size 1 from the shape of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]); - * x.squeeze().print(); - * ``` - * - * @param x The input tensor to be squeezed. - * @param axis An optional list of numbers. If specified, only - * squeezes the dimensions listed. The dimension index starts at 0. It - * is an error to squeeze a dimension that is not 1. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ - function squeeze_(x, axis) { - const $x = convertToTensor(x, 'x', 'squeeze'); - return reshape($x, squeezeShape($x.shape, axis).newShape); - } - const squeeze = op({ squeeze_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.stack([a, b, c]).print(); - * ``` - * - * @param tensors A list of tensor objects with the same shape and dtype. - * @param axis The axis to stack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function stack_(tensors, axis = 0) { - const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric'); - assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack'); - if ($tensors.length > 0) { - assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor'); - } - const inputs = $tensors; - const attrs = { axis }; - return ENGINE.runKernel(Pack, inputs, attrs); - } - const stack = op({ stack_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x` - * - * ```js - * const x = tf.tensor1d([0, 2, -1, -3]); - * - * x.step(.5).print(); // or tf.step(x, .5) - * ``` - * @param x The input tensor. - * @param alpha The gradient when input is negative. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function step_(x, alpha = 0.0) { - const $x = convertToTensor(x, 'x', 'step'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(Step, inputs, attrs); - } - const step = op({ step_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Extracts a strided slice of a tensor. - * - * Roughly speaking, this op extracts a slice of size (end-begin)/stride from - * the given input tensor (x). Starting at the location specified by begin the - * slice continues by adding stride to the index until all dimensions are not - * less than end. Note that a stride can be negative, which causes a reverse - * slice. - * - * ```js - * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6], - * [3, 2, 3]); - * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]] - * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3], - * // [4, 4, 4]]] - * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4], - * // [3, 3, 3]]] - * ``` - * - * @param x The tensor to stride slice. - * @param begin The coordinates to start the slice from. - * @param end: The coordinates to end the slice at. - * @param strides: The size of the slice. - * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param endMask: If the ith bit of endMask is set, end[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param shrinkAxisMask: a bitmask where bit i implies that - * the ith specification should shrink the dimensionality. begin and end must - * imply a slice of size 1 in the dimension. - * - * @doc {heading: 'Operations', subheading: 'Slicing and Joining'} - */ - function stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { - const $x = convertToTensor(x, 'x', 'stridedSlice'); - const inputs = { x: $x }; - const attrs = { - begin, - end, - strides, - beginMask, - endMask, - ellipsisMask, - newAxisMask, - shrinkAxisMask - }; - return ENGINE.runKernel(StridedSlice, inputs, attrs); - } - const stridedSlice = op({ stridedSlice_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes tan of the input `tf.Tensor` element-wise, `tan(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.tan().print(); // or tf.tan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ - function tan_(x) { - const $x = convertToTensor(x, 'x', 'tan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tan, inputs); - } - const tan = op({ tan_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Finds the values and indices of the `k` largest entries along the last - * dimension. - * - * If the input is a vector (rank=1), finds the k largest entries in the vector - * and outputs their values and indices as vectors. Thus values[j] is the j-th - * largest entry in input, and its index is indices[j]. - * For higher rank inputs, computes the top k entries along the last dimension. - * - * If two elements are equal, the lower-index element appears first. - * - * ```js - * const a = tf.tensor2d([[1, 5], [4, 3]]); - * const {values, indices} = tf.topk(a); - * values.print(); - * indices.print(); - * ``` - * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`. - * @param k Number of top elements to look for along the last dimension. - * @param sorted If true, the resulting `k` elements will be sorted by the - * values in descending order. - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ - function topk_(x, k = 1, sorted = true) { - const $x = convertToTensor(x, 'x', 'topk'); - if ($x.rank === 0) { - throw new Error('topk() expects the input to be of rank 1 or higher'); - } - const lastDim = $x.shape[$x.shape.length - 1]; - if (k > lastDim) { - throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` + - `but got ${k}`); - } - const inputs = { x: $x }; - const attrs = { k, sorted }; - const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs); - return { values, indices }; - } - const topk = op({ topk_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Finds unique elements along an axis of a tensor. - * - * It returns a tensor `values` containing all of the unique elements along the - * `axis` of the given tensor `x` in the same order that they occur along the - * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor - * `indices` the same size as the number of the elements in `x` along the `axis` - * dimension. It contains the index in the unique output `values`. - * - * ```js - * // A 1-D tensor - * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]); - * const {values, indices} = tf.unique(a); - * values.print(); // [1, 2, 4, 7, 8,] - * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4] - * ``` - * - * ```js - * // A 2-D tensor with axis=0 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 0) - * values.print(); // [[1, 0, 0], - * // [2, 0, 0]] - * indices.print(); // [0, 0, 1] - * ``` - * - * ```js - * // A 2-D tensor with axis=1 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 1) - * values.print(); // [[1, 0], - * // [1, 0], - * // [2, 0]] - * indices.print(); // [0, 1, 1] - * ``` - * @param x A tensor (int32, string, bool). - * @param axis The axis of the tensor to find the unique elements. - * @returns [uniqueElements, indices] (see above for details) - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ - function unique_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric'); - assert($x.rank > 0, () => 'The input tensor must be at least 1D'); - const inputs = { x: $x }; - const attrs = { axis }; - const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs); - return { values, indices }; - } - const unique = op({ unique_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the sum along segments of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32'); - * const numSegments = 3; - * - * x.unsortedSegmentSum(segmentIds, numSegments).print() - * //or tf.unsortedSegmentSum(x, segmentIds, numSegments) - * ``` - * @param x The `tf.Tensor` that will be summed along its segments. - * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s - * dimension along the `axis`. Maps each element of `x` to a segment. - * @param numSegments The number of distinct `segmentIds`. - * - * @doc {heading: 'Operations', subheading: 'Segment'} - */ - function unsortedSegmentSum_(x, segmentIds, numSegments) { - const $x = convertToTensor(x, 'x', 'unsortedSegmentSum'); - const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); - assert(isInt(numSegments), () => 'numSegments must be of dtype int'); - const inputs = { x: $x, segmentIds: $segmentIds }; - const attrs = { numSegments }; - return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs); - } - const unsortedSegmentSum = op({ unsortedSegmentSum_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * tf.unstack(a).forEach(tensor => tensor.print()); - * ``` - * - * @param x A tensor object. - * @param axis The axis to unstack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ - function unstack_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric'); - assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); - const inputs = { value: $x }; - const attrs = { axis }; - return ENGINE.runKernel(Unpack, inputs, attrs); - } - const unstack = op({ unstack_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`. - * - * The returned `tf.Tensor`'s dimension `i` will correspond to the input - * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`, - * where `n` is the rank of the input `tf.Tensor`. Hence by default, this - * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); - * - * a.transpose().print(); // or tf.transpose(a) - * ``` - * - * @param x The tensor to transpose. - * @param perm The permutation of the dimensions of a. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function transpose_(x, perm) { - const $x = convertToTensor(x, 'x', 'transpose'); - if (perm == null) { - perm = $x.shape.map((s, i) => i).reverse(); - } - assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of perm ${perm}.`); - perm.forEach(axis => { - assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` + - ` but got ${perm}`); - }); - if ($x.rank <= 1) { - return $x.clone(); - } - const inputs = { x: $x }; - const attrs = { perm }; - return ENGINE.runKernel(Transpose, inputs, attrs); - } - const transpose = op({ transpose_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the norm of scalar, vectors, and matrices. - * This function can compute several different vector norms (the 1-norm, the - * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) - * and matrix norms (Frobenius, 1-norm, and inf-norm). - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.norm().print(); // or tf.norm(x) - * ``` - * - * @param x The input array. - * @param ord Optional. Order of the norm. Supported norm types are - * following: - * - * | ord | norm for matrices | norm for vectors - * |------------|---------------------------|--------------------- - * |'euclidean' |Frobenius norm |2-norm - * |'fro' |Frobenius norm | - * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x)) - * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x)) - * |1 |max(sum(abs(x), axis=0)) |sum(abs(x)) - * |2 | |sum(abs(x)^2)^1/2* - * - * @param axis Optional. If axis is null (the default), the input is - * considered a vector and a single vector norm is computed over the entire - * set of values in the Tensor, i.e. norm(x, ord) is equivalent - * to norm(x.reshape([-1]), ord). If axis is a integer, the input - * is considered a batch of vectors, and axis determines the axis in x - * over which to compute vector norms. If axis is a 2-tuple of integer it is - * considered a batch of matrices and axis determines the axes in NDArray - * over which to compute a matrix norm. - * @param keepDims Optional. If true, the norm have the same dimensionality - * as the input. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ - function norm_(x, ord = 'euclidean', axis = null, keepDims = false) { - x = convertToTensor(x, 'x', 'norm'); - const norm = normImpl(x, ord, axis); - let keepDimsShape = norm.shape; - if (keepDims) { - const axes = parseAxisParam(axis, x.shape); - keepDimsShape = expandShapeToKeepDim(norm.shape, axes); - } - return reshape(norm, keepDimsShape); - } - function normImpl(x, p, axis = null) { - if (x.rank === 0) { - return abs(x); - } - // consider vector when no axis is specified - if (x.rank !== 1 && axis === null) { - return normImpl(reshape(x, [-1]), p, axis); - } - // vector - if (x.rank === 1 || typeof axis === 'number' || - Array.isArray(axis) && axis.length === 1) { - if (p === 1) { - return sum(abs(x), axis); - } - if (p === Infinity) { - return max(abs(x), axis); - } - if (p === -Infinity) { - return min(abs(x), axis); - } - if (p === 'euclidean' || p === 2) { - // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2 - return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - // matrix (assumption axis[0] < axis[1]) - if (Array.isArray(axis) && axis.length === 2) { - if (p === 1) { - return max(sum(abs(x), axis[0]), axis[1] - 1); - } - if (p === Infinity) { - return max(sum(abs(x), axis[1]), axis[0]); - } - if (p === -Infinity) { - return min(sum(abs(x), axis[1]), axis[0]); - } - if (p === 'fro' || p === 'euclidean') { - // norm(x) = sqrt(sum(pow(x, 2))) - return sqrt(sum(square(x), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - throw new Error(`Error in norm: invalid axis: ${axis}`); - } - const norm = op({ norm_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the filter of a 2D convolution. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed. - * @param dy The dy image, of rank 4 or rank 3, of shape - * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed. - * @param filterShape The shape of the filter, length 4, - * [filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` + - `${x4D.shape}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` + - `${dy4D.shape}.`); - assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` + - `${filterShape}.`); - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` + - `match input depth in filter (${filterShape[2]}.`); - assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` + - `match output depth for filter (${filterShape[3]}).`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs); - } - const conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dimRoundingMode, dilations, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs); - } - const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) { - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape }; - const res = - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * Bilinear resize a single 3D image or a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to `false`. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers - * are at 0.5, which would make the floating point coordinates of the top - * left pixel 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ - function resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeBilinear'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` + - `${size}.`); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const resizeBilinear = op({ resizeBilinear_ }); - - /** - * @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. - * ============================================================================= - */ - /** - * NearestNeighbor resize a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to False. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of - * half the actual dimensions, and yields more accurate resizes. This flag - * would also make the floating point coordinates of the top left pixel - * 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ - function resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` + - `${size}.`); - assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype'); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const resizeNearestNeighbor = op({ resizeNearestNeighbor_ }); - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.abs = function () { - this.throwIfDisposed(); - return abs(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.acos = function () { - this.throwIfDisposed(); - return acos(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.acosh = function () { - this.throwIfDisposed(); - return acosh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.add = function (b) { - this.throwIfDisposed(); - return add$1(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.all = function (axis, keepDims) { - this.throwIfDisposed(); - return all(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.any = function (axis, keepDims) { - this.throwIfDisposed(); - return any(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.argMax = function (axis) { - this.throwIfDisposed(); - return argMax(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.argMin = function (axis) { - this.throwIfDisposed(); - return argMin(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Converts a size-1 `tf.Tensor` to a `tf.Scalar`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.asScalar = function () { - this.throwIfDisposed(); - assert(this.size === 1, () => 'The array must have only 1 element.'); - return reshape(this, []); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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 (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Converts a `tf.Tensor` to a `tf.Tensor1D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.as1D = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns) { - this.throwIfDisposed(); - return reshape(this, [rows, columns]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth, depth2) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2]); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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, columns, depth, depth2, depth3) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2, depth3]); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.asin = function () { - this.throwIfDisposed(); - return asin(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.asinh = function () { - this.throwIfDisposed(); - return asinh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atan = function () { - this.throwIfDisposed(); - return atan(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atan2 = function (b) { - this.throwIfDisposed(); - return atan2(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.atanh = function () { - this.throwIfDisposed(); - return atanh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.avgPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) { - this.throwIfDisposed(); - return batchToSpaceND(this, blockShape, crops); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) { - this.throwIfDisposed(); - return batchNorm(this, mean, variance, offset, scale, varianceEpsilon); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.broadcastTo = function (shape) { - this.throwIfDisposed(); - return broadcastTo(this, shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cast = function (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.ceil = function () { - this.throwIfDisposed(); - return ceil(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.clipByValue = function (min, max) { - this.throwIfDisposed(); - return clipByValue(this, min, max); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.concat = function (x, axis) { - this.throwIfDisposed(); - if (x instanceof Tensor) { - x = [x]; - } - return concat([this, ...x], axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { - this.throwIfDisposed(); - return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv2dTranspose = - function (filter, outputShape, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cos = function () { - this.throwIfDisposed(); - return cos(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cosh = function () { - this.throwIfDisposed(); - return cosh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) { - this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) { - this.throwIfDisposed(); - return depthToSpace(this, blockSize, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.depthwiseConv2d = - function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.dilation2d = - function (filter, strides, pad, dilations, dataFormat) { - this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad, dilations, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.divNoNan = function (b) { - this.throwIfDisposed(); - return divNoNan(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.div = function (b) { - this.throwIfDisposed(); - return div(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.dot = function (b) { - this.throwIfDisposed(); - return dot(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.elu = function () { - this.throwIfDisposed(); - return elu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.equal = function (b) { - this.throwIfDisposed(); - return equal(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.erf = function () { - this.throwIfDisposed(); - return erf(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.exp = function () { - this.throwIfDisposed(); - return exp(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.expandDims = function (axis) { - this.throwIfDisposed(); - return expandDims(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.expm1 = function () { - this.throwIfDisposed(); - return expm1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.fft = function () { - this.throwIfDisposed(); - return fft(this); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Flatten a Tensor to a 1D array. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.flatten = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.floor = function () { - this.throwIfDisposed(); - return floor(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.floorDiv = function (b) { - this.throwIfDisposed(); - return floorDiv(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.gather = function (indices, axis) { - this.throwIfDisposed(); - return gather(this, indices, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.greaterEqual = function (b) { - this.throwIfDisposed(); - return greaterEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.greater = function (b) { - this.throwIfDisposed(); - return greater(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.ifft = function () { - this.throwIfDisposed(); - return ifft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.irfft = function () { - this.throwIfDisposed(); - return irfft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isFinite = function () { - this.throwIfDisposed(); - return isFinite$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isInf = function () { - this.throwIfDisposed(); - return isInf(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.isNaN = function () { - this.throwIfDisposed(); - return isNaN$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.leakyRelu = function (alpha) { - this.throwIfDisposed(); - return leakyRelu(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.lessEqual = function (b) { - this.throwIfDisposed(); - return lessEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.less = function (b) { - this.throwIfDisposed(); - return less(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.localResponseNormalization = - function (depthRadius, bias, alpha, beta) { - this.throwIfDisposed(); - return localResponseNormalization(this, depthRadius, bias, alpha, beta); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSigmoid = function () { - this.throwIfDisposed(); - return logSigmoid(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSoftmax = function (axis) { - this.throwIfDisposed(); - return logSoftmax(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) { - this.throwIfDisposed(); - return logSumExp(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.log = function () { - this.throwIfDisposed(); - return log(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.log1p = function () { - this.throwIfDisposed(); - return log1p(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalAnd = function (b) { - this.throwIfDisposed(); - return logicalAnd(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalNot = function () { - this.throwIfDisposed(); - return logicalNot(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalOr = function (b) { - this.throwIfDisposed(); - return logicalOr(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.logicalXor = function (b) { - this.throwIfDisposed(); - return logicalXor(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) { - this.throwIfDisposed(); - return matMul(this, b, transposeA, transposeB); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.maxPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad, dimRoundingMode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.max = function (axis, keepDims) { - this.throwIfDisposed(); - return max(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.maximum = function (b) { - this.throwIfDisposed(); - return maximum(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mean = function (axis, keepDims) { - this.throwIfDisposed(); - return mean(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.min = function (axis, keepDims) { - this.throwIfDisposed(); - return min(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.minimum = function (b) { - this.throwIfDisposed(); - return minimum(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) { - this.throwIfDisposed(); - return mirrorPad(this, paddings, mode); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mod = function (b) { - this.throwIfDisposed(); - return mod(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.mul = function (b) { - this.throwIfDisposed(); - return mul(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.neg = function () { - this.throwIfDisposed(); - return neg(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) { - this.throwIfDisposed(); - return norm(this, ord, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.notEqual = function (b) { - this.throwIfDisposed(); - return notEqual(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) { - this.throwIfDisposed(); - return oneHot(this, depth, onValue, offValue); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.onesLike = function () { - this.throwIfDisposed(); - return onesLike(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pad = function (paddings, constantValue) { - this.throwIfDisposed(); - return pad(this, paddings, constantValue); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) { - this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.pow = function (exp) { - this.throwIfDisposed(); - return pow(this, exp); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.prelu = function (alpha) { - this.throwIfDisposed(); - return prelu(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.prod = function (axis, keepDims) { - this.throwIfDisposed(); - return prod(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reciprocal = function () { - this.throwIfDisposed(); - return reciprocal(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.relu = function () { - this.throwIfDisposed(); - return relu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.relu6 = function () { - this.throwIfDisposed(); - return relu6(this); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * 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) { - this.throwIfDisposed(); - return reshape(this, x.shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reshape = function (shape) { - this.throwIfDisposed(); - return reshape(this, shape); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.resizeBilinear = - function (newShape2D, alignCorners, halfPixelCenters) { - this.throwIfDisposed(); - return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.resizeNearestNeighbor = - function (newShape2D, alignCorners, halfFloatCenters) { - this.throwIfDisposed(); - return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.reverse = function (axis) { - this.throwIfDisposed(); - return reverse(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.rfft = function () { - this.throwIfDisposed(); - return rfft(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.round = function () { - this.throwIfDisposed(); - return round$1(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.rsqrt = function () { - this.throwIfDisposed(); - return rsqrt(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.selu = function () { - this.throwIfDisposed(); - return selu(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.separableConv2d = - function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { - this.throwIfDisposed(); - return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sigmoid = function () { - this.throwIfDisposed(); - return sigmoid(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sign = function () { - this.throwIfDisposed(); - return sign(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sin = function () { - this.throwIfDisposed(); - return sin(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sinh = function () { - this.throwIfDisposed(); - return sinh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.slice = function (begin, size) { - this.throwIfDisposed(); - return slice(this, begin, size); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.softmax = function (dim) { - this.throwIfDisposed(); - return softmax(this, dim); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.softplus = function () { - this.throwIfDisposed(); - return softplus(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) { - this.throwIfDisposed(); - return spaceToBatchND(this, blockShape, paddings); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) { - this.throwIfDisposed(); - return split(this, numOrSizeSplits, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sqrt = function () { - this.throwIfDisposed(); - return sqrt(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.square = function () { - this.throwIfDisposed(); - return square(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.squaredDifference = function (b) { - this.throwIfDisposed(); - return squaredDifference(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.squeeze = function (axis) { - this.throwIfDisposed(); - return squeeze(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.stack = function (x, axis) { - this.throwIfDisposed(); - const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x]; - return stack(tensorsToBeStacked, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.step = function (alpha) { - this.throwIfDisposed(); - return step(this, alpha); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { - this.throwIfDisposed(); - return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sub = function (b) { - this.throwIfDisposed(); - return sub(this, b); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.sum = function (axis, keepDims) { - this.throwIfDisposed(); - return sum(this, axis, keepDims); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tan = function () { - this.throwIfDisposed(); - return tan(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tanh = function () { - this.throwIfDisposed(); - return tanh(this); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.tile = function (reps) { - this.throwIfDisposed(); - return tile(this, reps); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `bool` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toBool = function () { - this.throwIfDisposed(); - return cast(this, 'bool'); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `float32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toFloat = function () { - this.throwIfDisposed(); - return cast(this, 'float32'); - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Casts the array to type `int32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - getGlobalTensorClass().prototype.toInt = function () { - this.throwIfDisposed(); - return cast(this, 'int32'); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.topk = function (k, sorted) { - this.throwIfDisposed(); - return topk(this, k, sorted); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.transpose = function (perm) { - this.throwIfDisposed(); - return transpose(this, perm); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unique = function (axis) { - this.throwIfDisposed(); - return unique(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unsortedSegmentSum = - function (segmentIds, numSegments) { - this.throwIfDisposed(); - return unsortedSegmentSum(this, segmentIds, numSegments); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.unstack = function (axis) { - this.throwIfDisposed(); - return unstack(this, axis); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.where = function (condition, x) { - this.throwIfDisposed(); - return where(condition, this, x); - }; - - /** - * @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. - * ============================================================================= - */ - getGlobalTensorClass().prototype.zerosLike = function () { - this.throwIfDisposed(); - return zerosLike(this); - }; - - /** - * @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. - * ============================================================================= - */ - const absGradConfig = { - kernelName: Abs, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, step(cast(x, 'float32'), -1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const acosGradConfig = { - kernelName: Acos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = square(cast(x, 'float32')); - const b = sqrt(sub(scalar(1), a)); - return neg(div(dy, b)); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const acoshGradConfig = { - kernelName: Acosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(sub(square(cast(x, 'float32')), 1)); - return div(dy, a); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const addGradConfig = { - kernelName: Add, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const addNGradConfig = { - kernelName: AddN, - saveAllInputs: true, - gradFunc: (dy, saved) => { - const ders = {}; - saved.forEach((_, i) => { - ders[i] = () => dy.clone(); - }); - return ders; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 argMaxGradConfig = { - kernelName: ArgMax, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 argMinGradConfig = { - kernelName: ArgMin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const asinGradConfig = { - kernelName: Asin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const asinhGradConfig = { - kernelName: Asinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(add$1(scalar(1), square(cast(x, 'float32')))); - return div(dy, a); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atan2GradConfig = { - kernelName: Atan2, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const d = add$1(square(a), square(b)); - let res = mul(dy, div(b, d)); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - const d = add$1(square(a), square(b)); - let res = neg(mul(dy, div(a, d))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atanGradConfig = { - kernelName: Atan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(square(cast(x, 'float32')), 1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const atanhGradConfig = { - kernelName: Atanh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 3d avg pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank4 of shape - * [batchSize, depth, height, width, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad'); - const $input = convertToTensor(input, 'input', 'avgPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const avgPool3dGrad = op({ avgPool3dGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const avgPool3DGradConfig = { - kernelName: AvgPool3D, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of an 2D avg pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The input image, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ - function avgPoolGrad_(dy, input, filterSize, strides, pad) { - const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad'); - const $input = convertToTensor(input, 'input', 'avgPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); - let input4D = $input; - let dy4D = $dy; - let reshapedTo4D = false; - if ($input.rank === 3) { - reshapedTo4D = true; - input4D = - reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]); - dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]); - } - assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` + - `${dy4D.rank}.`); - assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` + - `${input4D.rank}.`); - const inputs = { dy: dy4D, input: input4D }; - const attrs = { filterSize, strides, pad }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; - } - const avgPoolGrad = op({ avgPoolGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const avgPoolGradConfig = { - kernelName: AvgPool, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad } = attrs; - return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const batchMatMulGradConfig = { - kernelName: BatchMatMul, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved, attrs) => { - const [a, b] = saved; - const { transposeA, transposeB } = attrs; - if (!transposeA && !transposeB) { - return { - a: () => matMul(dy, b, false, true), - b: () => matMul(a, dy, true, false) - }; - } - else if (!transposeA && transposeB) { - return { - a: () => matMul(dy, b, false, false), - b: () => matMul(dy, a, true, false) - }; - } - else if (transposeA && !transposeB) { - return { - a: () => matMul(b, dy, false, true), - b: () => matMul(a, dy, false, false) - }; - } - else { - return { - a: () => matMul(b, dy, true, true), - b: () => matMul(dy, a, true, true) - }; - } - } - }; - - /** - * @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. - * ============================================================================= - */ - const batchToSpaceNDGradConfig = { - kernelName: BatchToSpaceND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, crops } = attrs; - return { x: () => spaceToBatchND(dy, blockShape, crops) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const broadcastToGradConfig = { - kernelName: BroadcastTo, - gradFunc: (dy, saved, attrs) => { - const broadCastToAttrs = attrs; - const inputShape = broadCastToAttrs.inputShape; - const outputShape = broadCastToAttrs.shape; - const reps = Array.from(outputShape); - for (let i = inputShape.length - 1; i >= 0; i--) { - if (inputShape[i] === outputShape[i]) { - reps[i] = 1; - } - else if (inputShape[i] !== 1) { - throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); - } - } - const axes = []; - for (let i = 0; i < reps.length; i++) { - if (reps[i] > 1) { - axes.push(i); - } - } - return { x: () => sum(dy, axes, true /* keepDims */) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const castGradConfig = { - kernelName: Cast, - gradFunc: (dy) => { - return { x: () => dy.clone() }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const ceilGradConfig = { - kernelName: Ceil, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports it. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const clipByValueGradConfig = { - kernelName: ClipByValue, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { clipValueMin, clipValueMax } = attrs; - return { - x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)), - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const complexAbsGradConfig = { - kernelName: ComplexAbs, - inputsToSave: ['x'], - gradFunc: absGradConfig.gradFunc, - }; - - /** - * @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. - * ============================================================================= - */ - const concatGradConfig = { - kernelName: Concat, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const shapes = saved.map(t => t.shape); - const { axis } = attrs; - const $axis = parseAxisParam(axis, saved[0].shape)[0]; - const sizeSplits = shapes.map(s => s[$axis]); - const derTensors = split(dy, sizeSplits, $axis); - return derTensors.map(t => () => t); - } - }; - - /** - * @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. - * ============================================================================= - */ - const conv2DGradConfig = { - kernelName: Conv2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x4D, $filter] = saved; - const { dilations, strides, pad, dataFormat } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' + - `are not yet supported in gradients. Got dilations '${dilations}'`); - return { - x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat), - filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const conv2DBackpropInputGradConfig = { - kernelName: Conv2DBackpropInput, - inputsToSave: ['dy', 'filter'], - gradFunc: (ddx, saved, attrs) => { - const [dy, filter] = saved; - const { strides, pad, dataFormat, dimRoundingMode } = attrs; - return { - dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode), - filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the derivative of the filter of a 3D convolution. - * - * @param x The input tensor, of rank 5 or rank 4 of shape - * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is - * assumed. - * @param dy The dy image, of rank 5 or rank 4, of shape - * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is - * assumed. - * @param filterShape The shape of the filter, length 5, - * [filterDepth, filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideDepth, strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ - function conv3DBackpropFilter_(x, dy, filterShape, strides, pad) { - let x5D = x; - if (x.rank === 4) { - x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); - } - let dy5D = dy; - if (dy5D.rank === 4) { - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - } - assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` + - `${x5D.shape}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` + - `${dy5D.shape}.`); - assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` + - `${filterShape}.`); - assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` + - `match input depth in filter (${filterShape[3]}.`); - assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` + - `match output depth for filter (${filterShape[4]}).`); - const inputs = { x: x5D, dy: dy5D }; - const attrs = { strides, pad, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs); - } - const conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); - - /** - * @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. - * ============================================================================= - */ - const conv3DGradConfig = { - kernelName: Conv3D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' + - `not yet supported in gradients. Got dilations '${dilations}'`); - const [x5D, $filter] = saved; - return { - x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad), - filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const cosGradConfig = { - kernelName: Cos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const coshGradConfig = { - kernelName: Cosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(sinh(cast(x, 'float32')), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const cumsumGradConfig = { - kernelName: Cumsum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis, exclusive, reverse } = attrs; - return { - x: () => { - const permutation = getAxesPermutation([axis], x.rank); - let out = cumsum(dy, axis, exclusive, !reverse); - if (permutation != null) { - out = transpose(out, permutation); - } - return out; - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const depthwiseConv2dNativeGradConfig = { - kernelName: DepthwiseConv2dNative, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad, dimRoundingMode } = attrs; - const $dilations = dilations == null ? [1, 1] : dilations; - assert(tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' + - `greater than 1 are not yet supported. Got dilations ` + - `'${$dilations}'`); - const [x, filter] = saved; - assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` + - `rank 4, but got rank ${x.rank}.`); - assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` + - `rank 4, but got rank ${filter.rank}.`); - assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` + - `channels (${x.shape[3]}) must match the inChannels dimension ` + - `in filter ${filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' + - `dilations must be 1. Got strides ${strides} and dilations ` + - `'${$dilations}'.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - return { - x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode), - filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode), - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const dilation2dGradConfig = { - kernelName: Dilation2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x, filter] = saved; - const inputInputs = { x, filter, dy }; - const filterInputs = { x, filter, dy }; - return { - x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs), - filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const eluGradConfig = { - kernelName: Elu, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - const inputs = { dy, y }; - return { x: () => ENGINE.runKernel(EluGrad, inputs) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const erfGradConfig = { - kernelName: Erf, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI)); - return { x: () => mul(dy, a) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expGradConfig = { - kernelName: Exp, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, y) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expandDimsGradConfig = { - kernelName: ExpandDims, - inputsToSave: ['input'], - gradFunc: (dy, saved) => { - const [input] = saved; - return { input: () => reshape(dy, input.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const expm1GradConfig = { - kernelName: Expm1, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, exp(x)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const floorGradConfig = { - kernelName: Floor, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const floorDivGradConfig = { - kernelName: FloorDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const fusedBatchNormGradConfig = { - kernelName: FusedBatchNorm, - inputsToSave: ['x', 'mean', 'variance', 'scale'], - gradFunc: (dy, saved, attrs) => { - const { varianceEpsilon } = attrs; - const [x, mean, variance, scale] = saved; - const scaleValue = scale == null ? scalar(1) : scale; - const reductionAxes = getReductionAxes(mean.shape, x.shape); - const tileShape = []; - if (mean.rank === 1) { - for (let i = 0; i < x.shape.length - 1; ++i) { - tileShape.push(x.shape[i]); - } - tileShape.push(1); - } - const xMinusMean = sub(x, mean); - const dyTimesScaleValue = mul(dy, scaleValue); - const oneOverSqrtVariance = rsqrt(add$1(variance, scalar(varianceEpsilon))); - const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); - const derX = () => { - if (mean.rank === 1) { - return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape); - } - else { - return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); - } - }; - const derMean = () => { - let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); - if (mean.rank === 1) { - meanDer = sum(meanDer, reductionAxes); - } - return reshape(meanDer, mean.shape); - }; - const derVariance = () => { - let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); - if (mean.rank === 1) { - varianceDer = sum(varianceDer, reductionAxes); - } - return reshape(varianceDer, mean.shape); - }; - const derScale = () => { - const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); - let scaleDer = mul(dy, xMinusMean2TimesRsqrt); - if (mean.rank === 1) { - scaleDer = sum(scaleDer, reductionAxes); - } - return reshape(scaleDer, mean.shape); - }; - const derOffset = () => { - let offsetDer = dy; - if (mean.rank === 1) { - offsetDer = sum(offsetDer, reductionAxes); - } - return reshape(offsetDer, mean.shape); - }; - return { - x: derX, - mean: derMean, - variance: derVariance, - scale: derScale, - offset: derOffset - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const gatherGradConfig = { - kernelName: GatherV2, - inputsToSave: ['x', 'indices'], - gradFunc: (dy, saved, attrs) => { - const [x, indices] = saved; - const { axis } = attrs; - const parsedAxis = parseAxisParam(axis, x.shape)[0]; - const derX = () => { - const paramsShape = x.shape; - const indicesSize = indices.size; - const outerShape = paramsShape.slice(0, parsedAxis); - const outerDims = outerShape.length; - const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); - const innerDims = innerShape.length; - const outerAxesIndices = arrayRange(0, outerDims); - const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); - const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); - const values = reshape(dy, valuesShape); - const reshapedIndices = reshape(indices, [indicesSize]); - const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); - const valuesTranspose = transpose(values, transposeDims); - let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]); - const invertTransposeDims = getUndoAxesPermutation(transposeDims); - paramsGrad = transpose(paramsGrad, invertTransposeDims); - return paramsGrad; - }; - return { x: derX, indices: () => indices }; - } - }; - function arrayRange(start, stop) { - const result = []; - for (let i = start; i < stop; ++i) { - result.push(i); - } - return result; - } - function arrayConcat(arrays) { - const result = []; - for (let i = 0; i < arrays.length; ++i) { - for (let j = 0; j < arrays[i].length; ++j) { - result.push(arrays[i][j]); - } - } - return result; - } - - /** - * @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. - * ============================================================================= - */ - const greaterEqualGradConfig = { - kernelName: GreaterEqual, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - return { a: () => zerosLike(a), b: () => zerosLike(b) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const identityGradConfig = { - kernelName: Identity, - gradFunc: (dy) => { - return { x: () => cast(dy, 'float32') }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isFiniteGradConfig = { - kernelName: IsFinite, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isInfGradConfig = { - kernelName: IsInf, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const isNanGradConfig = { - kernelName: IsNan, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const leakyReluGradConfig = { - kernelName: LeakyRelu, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { alpha } = attrs; - const mask = greater(x, 0); - // Returns `gradients * (features > 0) + alpha * gradients * (features <= - // 0)`. - return { x: () => where(mask, dy, mul(dy, alpha)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const log1pGradConfig = { - kernelName: Log1p, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(x, 1)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const logGradConfig = { - kernelName: Log, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, cast(x, 'float32')) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const logSoftmaxGradConfig = { - kernelName: LogSoftmax, - inputsToSave: [], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [value] = saved; - const { axis } = attrs; - return { - logits: () => { - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - function localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const inputs = { x, y, dy }; - const attrs = { depthRadius, bias, alpha, beta }; - return ENGINE.runKernel(LRNGrad, inputs, attrs); - } - const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ }); - - /** - * @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. - * ============================================================================= - */ - const lrnGradConfig = { - kernelName: LRN, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { depthRadius, bias, alpha, beta } = attrs; - return { - x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Gradient helper function for the min and max operations. - */ - function gradForMinAndMax(dy, y, xOrig, origAxes) { - if (y.rank < xOrig.rank) { - y = reshape(y, expandShapeToKeepDim(y.shape, origAxes)); - } - if (dy.rank < xOrig.rank) { - dy = reshape(dy, expandShapeToKeepDim(dy.shape, origAxes)); - } - return { - x: () => { - const dx = mul(dy, cast(equal(xOrig, y), dy.dtype)); - return dx; - } - }; - } - - /** - * @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. - * ============================================================================= - */ - const maxGradConfig = { - kernelName: Max, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const maxAttrs = attrs; - const { reductionIndices } = maxAttrs; - const x = saved[0]; - const y = saved[1]; - const origAxes = parseAxisParam(reductionIndices, x.shape); - const maxGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return maxGrad['x'](); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const maximumGradConfig = { - kernelName: Maximum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(less(a, b), 'float32')); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 3d max pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank 4 of shape - * [batchSize, depth, height, width, channels]. - * @param output The original output image, of rank 5 of shape - * [batchSize, outDepth, outHeight, outWidth, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad'); - const $input = convertToTensor(input, 'input', 'maxPool3dGrad'); - const $output = convertToTensor(output, 'output', 'maxPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let output5D = $output; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - output5D = reshape($output, [ - 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` + - `${output5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D, output: output5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; - } - const maxPool3dGrad = op({ maxPool3dGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const maxPool3DGradConfig = { - kernelName: MaxPool3D, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - /** - * Computes the backprop of a 2D max pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The original input image, of rank 4, of shape - * [batchSize, height, width, channels]. - * @param output The original output image, of rank 4, of shape - * [batchSize, outHeight, outWidth, channels]. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ - function maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad'); - const $input = convertToTensor(input, 'input', 'maxPoolGrad'); - const $output = convertToTensor(output, 'output', 'maxPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` + - `(${$dy.rank})`); - assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` + - `${$dy.rank}.`); - assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` + - `${$input.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: $dy, input: $input, output: $output }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(MaxPoolGrad, inputs, attrs); - } - const maxPoolGrad = op({ maxPoolGrad_ }); - - /** - * @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. - * ============================================================================= - */ - const maxPoolGradConfig = { - kernelName: MaxPool, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad } = attrs; - return { - x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const meanGradConfig = { - kernelName: Mean, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - const shapes = computeOutAndReduceShapes(x.shape, axes); - const reduceShape = shapes[1]; - const reduceSize = sizeFromShape(reduceShape); - const derX = () => { - const expandedDyShape = x.shape.slice(); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const res = div(mul(expandedDy, ones$1(x.shape, 'float32')), reduceSize); - return res; - }; - return { x: derX }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const minGradConfig = { - kernelName: Min, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const minAttrs = attrs; - const { axis } = minAttrs; - const [x, y] = saved; - const origAxes = parseAxisParam(axis, x.shape); - const minGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return minGrad['x'](); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const minimumGradConfig = { - kernelName: Minimum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(lessEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(greater(a, b), 'float32')); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const mirrorPadGradConfig = { - kernelName: MirrorPad, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const modGradConfig = { - kernelName: Mod, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(dy, reduceAxes), a.shape); - } - return dy; - }; - const derB = () => { - const res = mul(dy, neg(floor(div(a, b)))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const multiplyGradConfig = { - kernelName: Multiply, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = mul(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - const res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const negGradConfig = { - kernelName: Neg, - gradFunc: (dy) => { - return { x: () => neg(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const oneHotGradConfig = { - kernelName: OneHot, - inputsToSave: ['indices'], - gradFunc: (dy, saved) => { - const indices = saved[0]; - return { indices: () => zeros(indices.shape, 'float32') }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const onesLikeGradConfig = { - kernelName: OnesLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const packGradConfig = { - kernelName: Pack, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - const derTensors = unstack(dy, axis); - return derTensors.map(t => () => t); - } - }; - - /** - * @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. - * ============================================================================= - */ - const padV2GradConfig = { - kernelName: PadV2, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const powGradConfig = { - kernelName: Pow, - inputsToSave: ['a', 'b'], - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [a, b, y] = saved; - const base = a; - const exp = b; - const outShape = assertAndGetBroadcastShape(base.shape, exp.shape); - const derBase = () => { - const expFloat = cast(exp, 'float32'); - let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1))))); - const reduceAxes = getReductionAxes(base.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, base.shape); - }; - const derExp = () => { - const condition = greater(base, 0); - const logBase = where(condition, log(base), zerosLike(base)); - let res = mul(dy, mul(y, logBase)); - const reduceAxes = getReductionAxes(exp.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, exp.shape); - }; - return { a: derBase, b: derExp }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const preluGradConfig = { - kernelName: Prelu, - inputsToSave: ['x', 'alpha'], - gradFunc: (dy, saved) => { - const [x, alpha] = saved; - const mask = greater(x, 0); - return { - x: () => where(mask, dy, mul(dy, alpha)), - alpha: () => { - let res = where(mask, zerosLike(dy), mul(dy, x)); - const reduceAxes = getReductionAxes(alpha.shape, dy.shape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, alpha.shape); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const divGradConfig = { - kernelName: RealDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reciprocalGradConfig = { - kernelName: Reciprocal, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, neg(square(x))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const relu6GradConfig = { - kernelName: Relu6, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const mask = mul(lessEqual(x, 6), step(x)); - return { x: () => mul(dy, cast(mask, 'float32')) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reluGradConfig = { - kernelName: Relu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, cast(step(x), 'float32')) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 reshapeGradConfig = { - kernelName: Reshape, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => reshape(dy, x.shape) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const resizeBilinearGradConfig = { - kernelName: ResizeBilinear, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs); - return { images: imagesDer }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const resizeNearestNeighborGradConfig = { - kernelName: ResizeNearestNeighbor, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs); - return { images: imagesDer }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const reverseGradConfig = { - kernelName: Reverse, - gradFunc: (dy, saved, attrs) => { - const { dims } = attrs; - const axes = parseAxisParam(dims, dy.shape); - return { x: () => reverse(dy, axes) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const roundGradConfig = { - kernelName: Round, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const rsqrtGradConfig = { - kernelName: Rsqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const selectGradConfig = { - kernelName: Select, - inputsToSave: ['condition'], - gradFunc: (dy, saved) => { - const [condition] = saved; - return { - // TODO(julianoks): Return null for condition gradient - // when backprop supports it. - condition: () => cast(zerosLike(condition), 'float32'), - t: () => mul(dy, cast(condition, dy.dtype)), - e: () => mul(dy, cast(logicalNot(condition), dy.dtype)) - }; - } - }; - - /** - * @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 SELU_SCALEALPHA = 1.7580993408473768599402175208123; - const SELU_SCALE = 1.0507009873554804934193349852946; - - /** - * @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. - * ============================================================================= - */ - const seluGradConfig = { - kernelName: Selu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const mask = greater(x, scalar(0)); - const scaleAlpha = scalar(SELU_SCALEALPHA); - const scale = scalar(SELU_SCALE); - const greaterThanZeroDer = mul(dy, scale); - const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32'))); - return where(mask, greaterThanZeroDer, lessEqualZeroDer); - } - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sigmoidGradConfig = { - kernelName: Sigmoid, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, mul(y, sub(scalar(1), y))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const signGradConfig = { - kernelName: Sign, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sinGradConfig = { - kernelName: Sin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cos(cast(x, 'float32')), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sinhGradConfig = { - kernelName: Sinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cosh(cast(x, 'float32')), dy) }; - } - }; - - /** - * @license - * Copyright 2017 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 parseSliceParams(x, begin, size) { - // The following logic allows for more ergonomic calls. - let begin_; - const xRank = x.shape.length; - if (typeof begin === 'number') { - begin_ = [begin, ...new Array(xRank - 1).fill(0)]; - } - else if (begin.length < xRank) { - begin_ = begin.concat(new Array(xRank - begin.length).fill(0)); - } - else { - begin_ = begin.slice(); - } - begin_.forEach(d => { - assert(d !== -1, () => 'slice() does not support negative begin indexing.'); - }); - let size_; - if (size == null) { - size_ = new Array(xRank).fill(-1); - } - else if (typeof size === 'number') { - size_ = [size, ...new Array(xRank - 1).fill(-1)]; - } - else if (size.length < xRank) { - size_ = size.concat(new Array(xRank - size.length).fill(-1)); - } - else { - size_ = size; - } - size_ = size_.map((d, i) => { - if (d >= 0) { - return d; - } - else { - assert(d === -1, () => `Negative size values should be exactly -1 but got ` + - `${d} for the slice() size at index ${i}.`); - return x.shape[i] - begin_[i]; - } - }); - return [begin_, size_]; - } - - /** - * @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. - * ============================================================================= - */ - const sliceGradConfig = { - kernelName: Slice, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { begin, size } = attrs; - const inputShape = x.shape; - const [begin_, size_] = parseSliceParams(x, begin, size); - // Create an Nx2 padding where the first column represents how many - // zeros are prepended (at start) for each dimension, and the second - // column indicates how many zeros are appended (at end). - // The number of zeros to append is the shape of the input - // elementwise-subtracted by both the begin vector and sizes vector. - const paddings = []; - for (let i = 0; i < dy.rank; i++) { - paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); - } - return { x: () => pad(dy, paddings) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const softmaxGradConfig = { - kernelName: Softmax, - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [y] = saved; - const { dim } = attrs; - const keepDims = true; - const dyTimesY = mul(dy, y); - return { - logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y)) - }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const softplusGradConfig = { - kernelName: Softplus, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, sigmoid(x)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const spaceToBatchNDGradConfig = { - kernelName: SpaceToBatchND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, paddings } = attrs; - return { x: () => batchToSpaceND(dy, blockShape, paddings) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const splitVGradConfig = { - kernelName: SplitV, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - return { x: () => concat(dy, axis) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const sqrtGradConfig = { - kernelName: Sqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const squareGradConfig = { - kernelName: Square, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const squaredDifferenceGradConfig = { - kernelName: SquaredDifference, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const two = scalar(2); - const derA = () => mul(dy, mul(two, sub(a, b))); - const derB = () => mul(dy, mul(two, sub(b, a))); - return { a: derA, b: derB }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const stepGradConfig = { - kernelName: Step, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports - // it. - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const subGradConfig = { - kernelName: Sub, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(neg(res), b.shape); - }; - return { a: derA, b: derB }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 sumGradConfig = { - kernelName: Sum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const expandedDyShape = x.shape.slice(); - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const derX = mul(expandedDy, ones$1(x.shape, 'float32')); - return { x: () => derX }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tanGradConfig = { - kernelName: Tan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, square(cos(x))) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tanhGradConfig = { - kernelName: Tanh, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(sub(scalar(1), square(y)), dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const tileGradConfig = { - kernelName: Tile, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { reps } = attrs; - const derX = () => { - let xGrad = zerosLike(x); - // TODO(cais): Maybe reduce memory footprint by avoiding repeated - // slicing. - if (x.rank === 1) { - for (let i = 0; i < reps[0]; ++i) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]])); - } - } - else if (x.rank === 2) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [ - x.shape[0], x.shape[1] - ])); - } - } - } - else if (x.rank === 3) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - xGrad = - add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); - } - } - } - } - else if (x.rank === 4) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - for (let l = 0; l < reps[3]; ++l) { - xGrad = - add$1(xGrad, slice(dy, [ - i * x.shape[0], j * x.shape[1], k * x.shape[2], - l * x.shape[3] - ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); - } - } - } - } - } - else { - throw new Error(`Gradient for tile operation is not implemented for rank-` + - `${x.rank} tensors yet.`); - } - return xGrad; - }; - return { x: derX }; - }, - }; - - /** - * @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. - * ============================================================================= - */ - const transposeGradConfig = { - kernelName: Transpose, - gradFunc: (dy, saved, attrs) => { - const transposeAttrs = attrs; - const { perm } = transposeAttrs; - const undoPerm = getUndoAxesPermutation(perm); - return { x: () => transpose(dy, undoPerm) }; - } - }; - - /** - * @license - * Copyright 2020 Google Inc. 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 unpackGradConfig = { - kernelName: Unpack, - gradFunc: (dy, saved, attrs) => { - const unpackAttrs = attrs; - const { axis } = unpackAttrs; - return { value: () => stack(dy, axis) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - const unsortedSegmentSumGradConfig = { - kernelName: UnsortedSegmentSum, - inputsToSave: ['segmentIds'], - gradFunc: (dy, saved) => { - const [segmentIds] = saved; - const derX = () => { - return gatherDropNegatives(dy, segmentIds); - }; - return { x: derX }; - } - }; - function gatherDropNegatives(x, indices) { - // Helper function for unsorted segment ops. Gathers params for - // positive segment ids and gathers 0 for inputs with negative segment id. - // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py - const zeroClippedIndices = maximum(indices, zerosLike(indices)); - const gathered = gather(x, zeroClippedIndices); - let isPositive = greaterEqual(indices, scalar(0, 'int32')); - const numIters = gathered.rank - isPositive.rank; - for (let i = 0; i < numIters; ++i) { - isPositive = expandDims(isPositive, i + 1); - } - isPositive = logicalAnd(isPositive, ones$1(gathered.shape, 'bool')); - const zeroSlice = zerosLike(gathered); - return where(isPositive, gathered, zeroSlice); - } - - /** - * @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. - * ============================================================================= - */ - const zerosLikeGradConfig = { - kernelName: ZerosLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } - }; - - /** - * @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. - * ============================================================================= - */ - // Export all kernel configs here so that the package can auto register them - const gradConfigs = [ - absGradConfig, - acosGradConfig, - acoshGradConfig, - addGradConfig, - addNGradConfig, - argMaxGradConfig, - argMinGradConfig, - asinGradConfig, - asinhGradConfig, - atan2GradConfig, - atanGradConfig, - atanhGradConfig, - avgPool3DGradConfig, - avgPoolGradConfig, - batchMatMulGradConfig, - batchToSpaceNDGradConfig, - broadcastToGradConfig, - castGradConfig, - ceilGradConfig, - clipByValueGradConfig, - complexAbsGradConfig, - concatGradConfig, - conv2DBackpropInputGradConfig, - conv2DGradConfig, - conv3DGradConfig, - cosGradConfig, - coshGradConfig, - cumsumGradConfig, - depthwiseConv2dNativeGradConfig, - dilation2dGradConfig, - divGradConfig, - eluGradConfig, - erfGradConfig, - expGradConfig, - expandDimsGradConfig, - expm1GradConfig, - floorDivGradConfig, - floorGradConfig, - fusedBatchNormGradConfig, - gatherGradConfig, - greaterEqualGradConfig, - identityGradConfig, - isFiniteGradConfig, - isInfGradConfig, - isNanGradConfig, - leakyReluGradConfig, - log1pGradConfig, - logGradConfig, - logSoftmaxGradConfig, - lrnGradConfig, - maxGradConfig, - maxGradConfig, - maximumGradConfig, - maxPool3DGradConfig, - maxPoolGradConfig, - meanGradConfig, - minGradConfig, - minimumGradConfig, - mirrorPadGradConfig, - modGradConfig, - multiplyGradConfig, - negGradConfig, - oneHotGradConfig, - onesLikeGradConfig, - packGradConfig, - padV2GradConfig, - padV2GradConfig, - powGradConfig, - preluGradConfig, - reciprocalGradConfig, - relu6GradConfig, - reluGradConfig, - reshapeGradConfig, - resizeBilinearGradConfig, - resizeNearestNeighborGradConfig, - reverseGradConfig, - roundGradConfig, - rsqrtGradConfig, - selectGradConfig, - seluGradConfig, - sigmoidGradConfig, - signGradConfig, - sinGradConfig, - sinhGradConfig, - sliceGradConfig, - softmaxGradConfig, - softplusGradConfig, - spaceToBatchNDGradConfig, - spaceToBatchNDGradConfig, - splitVGradConfig, - splitVGradConfig, - sqrtGradConfig, - squaredDifferenceGradConfig, - squareGradConfig, - stepGradConfig, - subGradConfig, - sumGradConfig, - tanGradConfig, - tanhGradConfig, - tileGradConfig, - transposeGradConfig, - unpackGradConfig, - unsortedSegmentSumGradConfig, - zerosLikeGradConfig - ]; - for (const gradientConfig of gradConfigs) { - registerGradient(gradientConfig); - } - - /*! ***************************************************************************** - 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 __()); - } - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - } - - 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 }; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var _epsilon; - /** - * Returns the value of the fuzz factor used in numeric expressions. - */ - function epsilon() { - if (_epsilon == null) { - _epsilon = tfc.backend().epsilon(); - } - return _epsilon; - } - /** - * Returns the default image data format convention. - */ - function imageDataFormat() { - return 'channelsLast'; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ - // tslint:enable - /** - * Equivalent of Python's AttributeError. - */ - var AttributeError = /** @class */ (function (_super) { - __extends(AttributeError, _super); - function AttributeError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, AttributeError.prototype); - return _this; - } - return AttributeError; - }(Error)); - /** - * Equivalent of Python's RuntimeError. - */ - var RuntimeError = /** @class */ (function (_super) { - __extends(RuntimeError, _super); - function RuntimeError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, RuntimeError.prototype); - return _this; - } - return RuntimeError; - }(Error)); - /** - * Equivalent of Python's ValueError. - */ - var ValueError = /** @class */ (function (_super) { - __extends(ValueError, _super); - function ValueError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, ValueError.prototype); - return _this; - } - return ValueError; - }(Error)); - /** - * Equivalent of Python's NotImplementedError. - */ - var NotImplementedError = /** @class */ (function (_super) { - __extends(NotImplementedError, _super); - function NotImplementedError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, NotImplementedError.prototype); - return _this; - } - return NotImplementedError; - }(Error)); - /** - * Equivalent of Python's AssertionError. - */ - var AssertionError = /** @class */ (function (_super) { - __extends(AssertionError, _super); - function AssertionError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, AssertionError.prototype); - return _this; - } - return AssertionError; - }(Error)); - /** - * Equivalent of Python's IndexError. - */ - var IndexError = /** @class */ (function (_super) { - __extends(IndexError, _super); - function IndexError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, IndexError.prototype); - return _this; - } - return IndexError; - }(Error)); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ - // tslint:disable-next-line:no-any - function pyListRepeat(value, numValues) { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - var newArray = []; - for (var i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } - else { - var newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } - } - function assert$1(val, message) { - if (!val) { - throw new AssertionError(message); - } - } - /** - * Count the number of elements of the `array` that are equal to `reference`. - */ - function count(array, refernce) { - var counter = 0; - for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { - var item = array_1[_i]; - if (item === refernce) { - counter++; - } - } - return counter; - } - /** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ - function singletonOrArray(xs) { - if (xs.length === 1) { - return xs[0]; - } - return xs; - } - /** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ - // tslint:disable-next-line:no-any - function toList(x) { - if (Array.isArray(x)) { - return x; - } - return [x]; - } - /** - * Converts string to snake-case. - * @param name - */ - function toSnakeCase(name) { - var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; - } - function toCamelCase(identifier) { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); - } - // tslint:disable-next-line:no-any - var _GLOBAL_CUSTOM_OBJECTS = {}; - function serializeKerasObject(instance) { - if (instance === null || instance === undefined) { - return null; - } - var dict = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; - } - /** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ - function convertNDArrayScalarsInConfig(config) { - if (config == null || typeof config !== 'object') { - return; - } - else if (Array.isArray(config)) { - config.forEach(function (configItem) { return convertNDArrayScalarsInConfig(configItem); }); - } - else { - var fields = Object.keys(config); - for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) { - var field = fields_1[_i]; - var value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } - else { - convertNDArrayScalarsInConfig(value); - } - } - } - } - } - /** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ - // tslint:disable:no-any - function deserializeKerasObject(identifier, moduleObjects, customObjects, printableModuleName, fastWeightInit) { - var _a, _b, _c; - if (moduleObjects === void 0) { moduleObjects = {}; } - if (customObjects === void 0) { customObjects = {}; } - if (printableModuleName === void 0) { printableModuleName = 'object'; } - if (fastWeightInit === void 0) { fastWeightInit = false; } - // tslint:enable - if (typeof identifier === 'string') { - var functionName = identifier; - var fn = void 0; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } - else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } - else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError("Unknown " + printableModuleName + ": " + identifier + ". " + - "This may be due to one of the following reasons:\n" + - ("1. The " + printableModuleName + " is defined in Python, in which ") + - "case it needs to be ported to TensorFlow.js or your JavaScript " + - "code.\n" + - ("2. The custom " + printableModuleName + " is defined in JavaScript, ") + - "but is not registered properly with " + - "tf.serialization.registerClass()."); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } - else { - // In this case we are dealing with a Keras config dictionary. - var config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError(printableModuleName + ": Improper config format: " + - (JSON.stringify(config) + ".\n") + - "'className' and 'config' must set."); - } - var className = config['className']; - var cls = void 0, fromConfig = void 0; - if (className in customObjects) { - _a = customObjects[className], cls = _a[0], fromConfig = _a[1]; - } - else if (className in _GLOBAL_CUSTOM_OBJECTS) { - _b = _GLOBAL_CUSTOM_OBJECTS['className'], cls = _b[0], fromConfig = _b[1]; - } - else if (className in moduleObjects) { - _c = moduleObjects[className], cls = _c[0], fromConfig = _c[1]; - } - if (cls == null) { - throw new ValueError("Unknown " + printableModuleName + ": " + className + ". " + - "This may be due to one of the following reasons:\n" + - ("1. The " + printableModuleName + " is defined in Python, in which ") + - "case it needs to be ported to TensorFlow.js or your JavaScript " + - "code.\n" + - ("2. The custom " + printableModuleName + " is defined in JavaScript, ") + - "but is not registered properly with " + - "tf.serialization.registerClass()."); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - // tslint:disable-next-line:no-any - var customObjectsCombined = {}; - for (var _i = 0, _d = Object.keys(_GLOBAL_CUSTOM_OBJECTS); _i < _d.length; _i++) { - var key = _d[_i]; - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (var _e = 0, _f = Object.keys(customObjects); _e < _f.length; _e++) { - var key = _f[_e]; - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - var nestedConfig = config['config']; - nestedConfig['customObjects'] = customObjectsCombined; - var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (var _g = 0, _h = Object.keys(customObjects); _g < _h.length; _g++) { - var key = _h[_g]; - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - var returnObj = fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); - return returnObj; - } - else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (var _j = 0, _k = Object.keys(customObjects); _j < _k.length; _j++) { - var key = _k[_j]; - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - var returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); - return returnObj; - } - } - } - /** - * Compares two numbers for sorting. - * @param a - * @param b - */ - function numberCompare(a, b) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); - } - /** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ - function reverseNumberCompare(a, b) { - return -1 * numberCompare(a, b); - } - /** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ - function unique$1(xs) { - if (xs == null) { - return xs; - } - var out = []; - // TODO(cais): Maybe improve performance by sorting. - for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) { - var x = xs_1[_i]; - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; - } - /** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ - function isObjectEmpty(obj) { - if (obj == null) { - throw new ValueError("Invalid value in obj: " + JSON.stringify(obj)); - } - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; - } - /** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ - function checkStringTypeUnionValue(values, label, value) { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(value + " is not a valid " + label + ". Valid values are " + values + " or null/undefined."); - } - } - /** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ - // tslint:disable:no-any - function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) { - if (minLength === void 0) { minLength = 0; } - if (maxLength === void 0) { maxLength = Infinity; } - assert$1(minLength >= 0); - assert$1(maxLength >= minLength); - return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(function (e) { return typeof e === expectedType; })); - } - // tslint:enable:no-any - /** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ - function assertPositiveInteger(value, name) { - if (Array.isArray(value)) { - tfc.util.assert(value.length > 0, function () { return name + " is unexpectedly an empty array."; }); - value.forEach(function (v, i) { return assertPositiveInteger(v, "element " + (i + 1) + " of " + name); }); - } - else { - tfc.util.assert(Number.isInteger(value) && value > 0, function () { return "Expected " + name + " to be a positive integer, but got " + - (formatAsFriendlyString(value) + "."); }); - } - } - /** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ - // tslint:disable-next-line:no-any - function formatAsFriendlyString(value) { - if (value === null) { - return 'null'; - } - else if (Array.isArray(value)) { - return '[' + value.map(function (v) { return formatAsFriendlyString(v); }).join(',') + ']'; - } - else if (typeof value === 'string') { - return "\"" + value + "\""; - } - else { - return "" + value; - } - } - /** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ - function debounce(f, waitMs) { - var lastTime = tfc.util.now(); - var lastResult; - var f2 = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var now = tfc.util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f.apply(void 0, args); - return lastResult; - }; - return f2; - } - /** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ - function mapActivationToFusedKernel(activationName) { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function used by many of the Constraints to find the L2Norms. - */ - function calcL2Norms(w, axis) { - return tfc.tidy(function () { return tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)); }); - } - /** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ - var Constraint = /** @class */ (function (_super) { - __extends(Constraint, _super); - function Constraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - Constraint.prototype.getConfig = function () { - return {}; - }; - return Constraint; - }(tfc.serialization.Serializable)); - var MaxNorm = /** @class */ (function (_super) { - __extends(MaxNorm, _super); - function MaxNorm(args) { - var _this = _super.call(this) || this; - _this.defaultMaxValue = 2; - _this.defaultAxis = 0; - _this.maxValue = - args.maxValue != null ? args.maxValue : _this.defaultMaxValue; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - MaxNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { - var norms = calcL2Norms(w, _this.axis); - var desired = tfc.clipByValue(norms, 0, _this.maxValue); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - }; - MaxNorm.prototype.getConfig = function () { - return { maxValue: this.maxValue, axis: this.axis }; - }; - /** @nocollapse */ - MaxNorm.className = 'MaxNorm'; - return MaxNorm; - }(Constraint)); - tfc.serialization.registerClass(MaxNorm); - var UnitNorm = /** @class */ (function (_super) { - __extends(UnitNorm, _super); - function UnitNorm(args) { - var _this = _super.call(this) || this; - _this.defaultAxis = 0; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - UnitNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { return tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, _this.axis))); }); - }; - UnitNorm.prototype.getConfig = function () { - return { axis: this.axis }; - }; - /** @nocollapse */ - UnitNorm.className = 'UnitNorm'; - return UnitNorm; - }(Constraint)); - tfc.serialization.registerClass(UnitNorm); - var NonNeg = /** @class */ (function (_super) { - __extends(NonNeg, _super); - function NonNeg() { - return _super !== null && _super.apply(this, arguments) || this; - } - NonNeg.prototype.apply = function (w) { - return tfc.relu(w); - }; - /** @nocollapse */ - NonNeg.className = 'NonNeg'; - return NonNeg; - }(Constraint)); - tfc.serialization.registerClass(NonNeg); - var MinMaxNorm = /** @class */ (function (_super) { - __extends(MinMaxNorm, _super); - function MinMaxNorm(args) { - var _this = _super.call(this) || this; - _this.defaultMinValue = 0.0; - _this.defaultMaxValue = 1.0; - _this.defaultRate = 1.0; - _this.defaultAxis = 0; - _this.minValue = - args.minValue != null ? args.minValue : _this.defaultMinValue; - _this.maxValue = - args.maxValue != null ? args.maxValue : _this.defaultMaxValue; - _this.rate = args.rate != null ? args.rate : _this.defaultRate; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - MinMaxNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { - var norms = calcL2Norms(w, _this.axis); - var desired = tfc.add(tfc.mul(_this.rate, tfc.clipByValue(norms, _this.minValue, _this.maxValue)), tfc.mul(1.0 - _this.rate, norms)); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - }; - MinMaxNorm.prototype.getConfig = function () { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - }; - /** @nocollapse */ - MinMaxNorm.className = 'MinMaxNorm'; - return MinMaxNorm; - }(Constraint)); - tfc.serialization.registerClass(MinMaxNorm); - // Maps the JavaScript-like identifier keys to the corresponding registry - // symbols. - var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' - }; - function serializeConstraint(constraint) { - return serializeKerasObject(constraint); - } - function deserializeConstraint(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); - } - function getConstraint(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - var className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - var config = { className: className, config: {} }; - return deserializeConstraint(config); - } - else if (identifier instanceof Constraint) { - return identifier; - } - else { - return deserializeConstraint(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ - function maxNorm(args) { - return new MaxNorm(args); - } - /** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ - function unitNorm(args) { - return new UnitNorm(args); - } - /** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ - function nonNeg() { - return new NonNeg(); - } - /** @doc {heading: 'Constraints', namespace: 'constraints'} */ - function minMaxNorm(config) { - return new MinMaxNorm(config); - } - - var exports_constraints = { - __proto__: null, - maxNorm: maxNorm, - unitNorm: unitNorm, - nonNeg: nonNeg, - minMaxNorm: minMaxNorm - }; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; - var VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; - var VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; - var VALID_POOL_MODE_VALUES = ['max', 'avg']; - var VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // A map from the requested scoped name of a Tensor to the number of Tensors - // wanting that name so far. This allows enforcing name uniqueness by appending - // an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. - var nameMap = new Map(); - function checkDataFormat(value) { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); - } - function checkInterpolationFormat(value) { - checkStringTypeUnionValue(VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); - } - function checkPaddingMode(value) { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); - } - function checkPoolMode(value) { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); - } - var _nameScopeStack = []; - var _nameScopeDivider = '/'; - /** - * Enter namescope, which can be nested. - */ - function nameScope(name, fn) { - _nameScopeStack.push(name); - try { - var val = fn(); - _nameScopeStack.pop(); - return val; - } - catch (e) { - _nameScopeStack.pop(); - throw e; - } - } - /** - * Get the current namescope as a flat, concatenated string. - */ - function currentNameScopePrefix() { - if (_nameScopeStack.length === 0) { - return ''; - } - else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } - } - /** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ - function getScopedTensorName(tensorName) { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; - } - /** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ - function getUniqueTensorName(scopedName) { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - var index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - if (index > 0) { - var result = scopedName + "_" + index; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } - else { - return scopedName; - } - } - var tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); - /** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ - function isValidTensorName(name) { - return !!name.match(tensorNameRegex); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Determine if a number is an integer. - */ - function isInteger(x) { - return x === parseInt(x.toString(), 10); - } - /** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ - function arrayProd(array, begin, end) { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - var prod = 1; - for (var i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; - } - /** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ - function toArray1D(array) { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tfc.tensor1d(array); - } - /** - * Compute minimum value. - * @param array - * @return minimum value. - */ - function min$1(array) { - return tfc.min(toArray1D(array)).dataSync()[0]; - } - /** - * Compute maximum value. - * @param array - * @return maximum value - */ - function max$1(array) { - return tfc.max(toArray1D(array)).dataSync()[0]; - } - /** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ - function range(begin, end) { - if (end < begin) { - throw new ValueError("end (" + end + ") < begin (" + begin + ") is forbidden."); - } - var out = []; - for (var i = begin; i < end; ++i) { - out.push(i); - } - return out; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ - function cast$1(x, dtype) { - return x.asType(dtype); - } - /** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ - function expandDims$1(x, axis) { - if (axis === void 0) { axis = -1; } - var outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); - } - /** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ - function repeat(x, n) { - return tfc.tidy(function () { - if (x.shape.length !== 2) { - throw new ValueError("repeat() expects a rank-2 tensor, but received a " + - ("rank-" + x.shape.length + " tensor.")); - } - var y = expandDims$1(x, 1); - return tile$1(y, [1, n, 1]); - }); - } - /** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ - function flatten$1(x) { - var newShape = [arrayProd(x.shape)]; - return x.reshape(newShape); - } - /** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ - function batchFlatten(x) { - if (x.rank <= 1) { - throw new ValueError("batchFlatten requires a minimum rank of 2. Got rank: " + x.rank + "."); - } - var newShape = [x.shape[0], arrayProd(x.shape, 1)]; - return x.reshape(newShape); - } - /** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongFirstAxis(array, start, size) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); - case 3: - return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); - case 4: - return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return tfc.slice(array, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return tfc.slice(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError("sliceAlongFirstAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); - } - /** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongLastAxis(array, start, size) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [0, start], [array.shape[0], size]); - case 3: - return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); - case 4: - return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); - } - /** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ - function sliceAlongAxis(array, start, size, axis) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - default: - throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); - } - /** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ - function concatenate(tensors, axis) { - if (axis === void 0) { axis = -1; } - var rank; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } - else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return tfc.concat(tensors, axis); - } - /** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ - function concatAlongFirstAxis(a, b) { - switch (a.rank) { - case 1: - return tfc.concat1d([a, b]); - case 2: - return tfc.concat2d([a, b], 0); - case 3: - return tfc.concat3d([a, b], 0); - case 4: - return tfc.concat4d([a, b], 0); - default: - throw new ValueError("concatAlongFirstAxis() received an unsupported " + - ("tensor rank: " + a.rank)); - } - } - /** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ - function tile$1(x, n) { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError("The length of input n (" + n.length + ") does not match " + - ("the number of dimensions in input x (" + x.rank + ")")); - } - return tfc.tile(x, n); - } - /* Creation of random tensors. */ - /** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ - function randomNormal(shape, mean, stddev, dtype, seed) { - if (mean === void 0) { mean = 0.0; } - if (stddev === void 0) { stddev = 1.0; } - return tfc.randomNormal(shape, mean, stddev, dtype, seed); - } - /* Linear Algebra */ - /** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ - function dot$1(a, b, activation, bias) { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError("dot requires both inputs to be rank >= 2" + - (" but got x shape = " + a.shape + " and y shape = " + b.shape)); - } - if (b.rank >= 3) { - var xLastDim = a.shape.slice(-1)[0]; - var ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError("If rank y >= 3, then the second last dim" + - (" of y must equal the last dim of x but got x shape = " + a.shape + " and ") + - (" y shape = " + b.shape)); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - var transposeA = false; - var transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return tfc.fused.matMul({ - a: a, - b: b, - transposeA: transposeA, - transposeB: transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation: activation - }); - } - else { - // Reshape x into the analogous 2D Tensor. - var aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - var aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - var bShape = b.shape.slice(); - var bLastDim = bShape.pop(); - var ySecondLastDim = bShape.pop(); - var yOtherDims = bShape.concat([bLastDim]); - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - var perm = Array.from({ length: b.rank }, function (_, i) { - if (i === 0) { - return b.rank - 2; - } - else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - // Multiply x and y as 2D Tensors, and then reshape back to original. - var outputShape = aFirstDims.concat(yOtherDims); - var transposeA = false; - var transposeB = false; - return tfc.fused - .matMul({ - a: a, - b: b, - transposeA: transposeA, - transposeB: transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation: activation - }) - .reshape(outputShape); - } - } - /* Elementary math functions. */ - /** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ - function gather$1(reference, indices, axis) { - return tfc.tidy(function () { - if (Array.isArray(indices)) { - indices = tfc.tensor1d(indices, 'int32'); - } - else { - indices = indices.toInt(); - } - return tfc.gather(reference, indices, axis); - }); - } - /** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ - function square$1(x) { - return tfc.mul(x, x); - } - /** - * Reshapes bias tensor according to rank of x. - */ - function reshapeBias(xRank, bias, dataFormat) { - var biasShape = bias.shape; - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError("Unexpected bias dimensions: " + bias.rank + - ("; expected it to be 1 or " + xRank)); - } - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } - else { - return bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } - else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } - else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank < 3) { - return bias; - } - throw new ValueError("Unsupported input rank by biasAdd: " + bias.rank); - } - /* Neural-network operations. */ - /** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ - function biasAdd(x, bias, dataFormat) { - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); - } - /** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ - function elu$1(x, alpha) { - if (alpha === void 0) { alpha = 1; } - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError("Support for alpha values other than 1 (" + alpha + ") is not implemented " + - "yet."); - } - return tfc.elu(x); - } - /** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ - function softsign(x) { - return tfc.tidy(function () { return tfc.div(x, tfc.abs(x).add(1)); }); - } - /** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ - function dropout(x, level, noiseShape, seed) { - return tfc.tidy(function () { return tfc.dropout(x, level, noiseShape, seed); }); - } - /** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ - function hardSigmoid(x) { - return tfc.tidy(function () { - var y = tfc.add(.5, tfc.mul(.2, x)); - return tfc.clipByValue(y, 0, 1); - }); - } - /** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ - function inTrainPhase(x, alt, training) { - if (training === void 0) { training = false; } - return training ? x() : alt(); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; - var VALID_DISTRIBUTION_VALUES = ['normal', 'uniform', 'truncatedNormal']; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function checkFanMode(value) { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); - } - function checkDistribution(value) { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); - } - /** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ - var Initializer = /** @class */ (function (_super) { - __extends(Initializer, _super); - function Initializer() { - return _super !== null && _super.apply(this, arguments) || this; - } - Initializer.prototype.fromConfigUsesCustomObjects = function () { - return false; - }; - Initializer.prototype.getConfig = function () { - return {}; - }; - return Initializer; - }(tfc.serialization.Serializable)); - var Zeros = /** @class */ (function (_super) { - __extends(Zeros, _super); - function Zeros() { - return _super !== null && _super.apply(this, arguments) || this; - } - Zeros.prototype.apply = function (shape, dtype) { - return tfc.zeros(shape, dtype); - }; - /** @nocollapse */ - Zeros.className = 'Zeros'; - return Zeros; - }(Initializer)); - tfc.serialization.registerClass(Zeros); - var Ones = /** @class */ (function (_super) { - __extends(Ones, _super); - function Ones() { - return _super !== null && _super.apply(this, arguments) || this; - } - Ones.prototype.apply = function (shape, dtype) { - return tfc.ones(shape, dtype); - }; - /** @nocollapse */ - Ones.className = 'Ones'; - return Ones; - }(Initializer)); - tfc.serialization.registerClass(Ones); - var Constant = /** @class */ (function (_super) { - __extends(Constant, _super); - function Constant(args) { - var _this = _super.call(this) || this; - if (typeof args !== 'object') { - throw new ValueError("Expected argument of type ConstantConfig but got " + args); - } - if (args.value === undefined) { - throw new ValueError("config must have value set but got " + args); - } - _this.value = args.value; - return _this; - } - Constant.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { return tfc.mul(tfc.scalar(_this.value), tfc.ones(shape, dtype)); }); - }; - Constant.prototype.getConfig = function () { - return { - value: this.value, - }; - }; - /** @nocollapse */ - Constant.className = 'Constant'; - return Constant; - }(Initializer)); - tfc.serialization.registerClass(Constant); - var RandomUniform = /** @class */ (function (_super) { - __extends(RandomUniform, _super); - function RandomUniform(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MINVAL = -0.05; - _this.DEFAULT_MAXVAL = 0.05; - _this.minval = args.minval || _this.DEFAULT_MINVAL; - _this.maxval = args.maxval || _this.DEFAULT_MAXVAL; - _this.seed = args.seed; - return _this; - } - RandomUniform.prototype.apply = function (shape, dtype) { - return tfc.randomUniform(shape, this.minval, this.maxval, dtype); - }; - RandomUniform.prototype.getConfig = function () { - return { minval: this.minval, maxval: this.maxval, seed: this.seed }; - }; - /** @nocollapse */ - RandomUniform.className = 'RandomUniform'; - return RandomUniform; - }(Initializer)); - tfc.serialization.registerClass(RandomUniform); - var RandomNormal = /** @class */ (function (_super) { - __extends(RandomNormal, _super); - function RandomNormal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MEAN = 0.; - _this.DEFAULT_STDDEV = 0.05; - _this.mean = args.mean || _this.DEFAULT_MEAN; - _this.stddev = args.stddev || _this.DEFAULT_STDDEV; - _this.seed = args.seed; - return _this; - } - RandomNormal.prototype.apply = function (shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError("randomNormal does not support dType " + dtype + "."); - } - return randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - }; - RandomNormal.prototype.getConfig = function () { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - }; - /** @nocollapse */ - RandomNormal.className = 'RandomNormal'; - return RandomNormal; - }(Initializer)); - tfc.serialization.registerClass(RandomNormal); - var TruncatedNormal = /** @class */ (function (_super) { - __extends(TruncatedNormal, _super); - function TruncatedNormal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MEAN = 0.; - _this.DEFAULT_STDDEV = 0.05; - _this.mean = args.mean || _this.DEFAULT_MEAN; - _this.stddev = args.stddev || _this.DEFAULT_STDDEV; - _this.seed = args.seed; - return _this; - } - TruncatedNormal.prototype.apply = function (shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError("truncatedNormal does not support dType " + dtype + "."); - } - return tfc.truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); - }; - TruncatedNormal.prototype.getConfig = function () { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - }; - /** @nocollapse */ - TruncatedNormal.className = 'TruncatedNormal'; - return TruncatedNormal; - }(Initializer)); - tfc.serialization.registerClass(TruncatedNormal); - var Identity$1 = /** @class */ (function (_super) { - __extends(Identity, _super); - function Identity(args) { - var _this = _super.call(this) || this; - _this.gain = args.gain != null ? args.gain : 1.0; - return _this; - } - Identity.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError('Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } - else { - return tfc.mul(_this.gain, tfc.eye(shape[0])); - } - }); - }; - Identity.prototype.getConfig = function () { - return { gain: this.gain }; - }; - /** @nocollapse */ - Identity.className = 'Identity'; - return Identity; - }(Initializer)); - tfc.serialization.registerClass(Identity$1); - /** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ - function computeFans(shape, dataFormat) { - if (dataFormat === void 0) { dataFormat = 'channelsLast'; } - var fanIn; - var fanOut; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } - else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - var receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } - else if (dataFormat === 'channelsLast') { - var receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } - else { - var shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - return [fanIn, fanOut]; - } - var VarianceScaling = /** @class */ (function (_super) { - __extends(VarianceScaling, _super); - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - function VarianceScaling(args) { - var _this = _super.call(this) || this; - if (args.scale < 0.0) { - throw new ValueError("scale must be a positive float. Got: " + args.scale); - } - _this.scale = args.scale == null ? 1.0 : args.scale; - _this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(_this.mode); - _this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(_this.distribution); - _this.seed = args.seed; - return _this; - } - VarianceScaling.prototype.apply = function (shape, dtype) { - var fans = computeFans(shape); - var fanIn = fans[0]; - var fanOut = fans[1]; - var scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } - else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } - else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - if (this.distribution === 'normal') { - var stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(this.getClassName() + " does not support dType " + dtype + "."); - } - return tfc.truncatedNormal(shape, 0, stddev, dtype, this.seed); - } - else { - var limit = Math.sqrt(3 * scale); - return tfc.randomUniform(shape, -limit, limit, dtype); - } - }; - VarianceScaling.prototype.getConfig = function () { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - }; - /** @nocollapse */ - VarianceScaling.className = 'VarianceScaling'; - return VarianceScaling; - }(Initializer)); - tfc.serialization.registerClass(VarianceScaling); - var GlorotUniform = /** @class */ (function (_super) { - __extends(GlorotUniform, _super); - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - function GlorotUniform(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - GlorotUniform.prototype.getClassName = function () { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - GlorotUniform.className = 'GlorotUniform'; - return GlorotUniform; - }(VarianceScaling)); - tfc.serialization.registerClass(GlorotUniform); - var GlorotNormal = /** @class */ (function (_super) { - __extends(GlorotNormal, _super); - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - function GlorotNormal(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - GlorotNormal.prototype.getClassName = function () { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - GlorotNormal.className = 'GlorotNormal'; - return GlorotNormal; - }(VarianceScaling)); - tfc.serialization.registerClass(GlorotNormal); - var HeNormal = /** @class */ (function (_super) { - __extends(HeNormal, _super); - function HeNormal(args) { - return _super.call(this, { - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - HeNormal.prototype.getClassName = function () { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - HeNormal.className = 'HeNormal'; - return HeNormal; - }(VarianceScaling)); - tfc.serialization.registerClass(HeNormal); - var HeUniform = /** @class */ (function (_super) { - __extends(HeUniform, _super); - function HeUniform(args) { - return _super.call(this, { - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - HeUniform.prototype.getClassName = function () { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - HeUniform.className = 'HeUniform'; - return HeUniform; - }(VarianceScaling)); - tfc.serialization.registerClass(HeUniform); - var LeCunNormal = /** @class */ (function (_super) { - __extends(LeCunNormal, _super); - function LeCunNormal(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - LeCunNormal.prototype.getClassName = function () { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - LeCunNormal.className = 'LeCunNormal'; - return LeCunNormal; - }(VarianceScaling)); - tfc.serialization.registerClass(LeCunNormal); - var LeCunUniform = /** @class */ (function (_super) { - __extends(LeCunUniform, _super); - function LeCunUniform(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - LeCunUniform.prototype.getClassName = function () { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - LeCunUniform.className = 'LeCunNormal'; - return LeCunUniform; - }(VarianceScaling)); - tfc.serialization.registerClass(LeCunUniform); - var Orthogonal = /** @class */ (function (_super) { - __extends(Orthogonal, _super); - function Orthogonal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_GAIN = 1; - _this.gain = args.gain == null ? _this.DEFAULT_GAIN : args.gain; - _this.seed = args.seed; - if (_this.seed != null) { - throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); - } - return _this; - } - Orthogonal.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn("Orthogonal initializer is being called on a matrix with more " + - ("than 2000 (" + shape[0] * shape[1] + ") elements: ") + - "Slowness may result."); - } - // TODO(cais): Add seed support. - var normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - var a = randomNormal(normalizedShape, 0, 1, 'float32'); - var q = tfc.linalg.gramSchmidt(a); - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return tfc.mul(_this.gain, q); - }); - }; - Orthogonal.prototype.getConfig = function () { - return { - gain: this.gain, - seed: this.seed, - }; - }; - /** @nocollapse */ - Orthogonal.className = 'Orthogonal'; - return Orthogonal; - }(Initializer)); - tfc.serialization.registerClass(Orthogonal); - // Maps the JavaScript-like identifier keys to the corresponding registry - // symbols. - var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' - }; - function deserializeInitializer(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); - } - function serializeInitializer(initializer) { - return serializeKerasObject(initializer); - } - function getInitializer(identifier) { - if (typeof identifier === 'string') { - var className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } - else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } - else if (className === 'HeNormal') { - return new HeNormal(); - } - else if (className === 'HeUniform') { - return new HeUniform(); - } - else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } - else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } - else { - var config = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } - else if (identifier instanceof Initializer) { - return identifier; - } - else { - return deserializeInitializer(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function zeros$1() { - return new Zeros(); - } - /** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function ones$2() { - return new Ones(); - } - /** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function constant(args) { - return new Constant(args); - } - /** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function randomUniform(args) { - return new RandomUniform(args); - } - /** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function randomNormal$1(args) { - return new RandomNormal(args); - } - /** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function truncatedNormal(args) { - return new TruncatedNormal(args); - } - /** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function identity(args) { - return new Identity$1(args); - } - /** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ - function varianceScaling(config) { - return new VarianceScaling(config); - } - /** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function glorotUniform(args) { - return new GlorotUniform(args); - } - /** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function glorotNormal(args) { - return new GlorotNormal(args); - } - /** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function heNormal(args) { - return new HeNormal(args); - } - /** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ - function heUniform(args) { - return new HeUniform(args); - } - /** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function leCunNormal(args) { - return new LeCunNormal(args); - } - /** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function leCunUniform(args) { - return new LeCunUniform(args); - } - /** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ - function orthogonal(args) { - return new Orthogonal(args); - } - - var exports_initializers = { - __proto__: null, - zeros: zeros$1, - ones: ones$2, - constant: constant, - randomUniform: randomUniform, - randomNormal: randomNormal$1, - truncatedNormal: truncatedNormal, - identity: identity, - varianceScaling: varianceScaling, - glorotUniform: glorotUniform, - glorotNormal: glorotNormal, - heNormal: heNormal, - heUniform: heUniform, - leCunNormal: leCunNormal, - leCunUniform: leCunUniform, - orthogonal: orthogonal - }; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Utilities related to persistent state in the backend. - */ - /** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ - var _nextUniqueTensorId = 0; - function getNextUniqueTensorId() { - return _nextUniqueTensorId++; - } - var _uidPrefixes = {}; - /** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ - function getUid(prefix) { - if (prefix === void 0) { prefix = ''; } - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * Determine whether the input is an Array of Shapes. - */ - function isArrayOfShapes(x) { - return Array.isArray(x) && Array.isArray(x[0]); - } - /** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ - function normalizeShapeList(x) { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x]; - } - return x; - } - /** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ - function getExactlyOneTensor(xs) { - var x; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError("Expected Tensor length to be 1; got " + xs.length); - } - x = xs[0]; - } - else { - x = xs; - } - return x; - } - /** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ - function getExactlyOneShape(shapes) { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes; - return shapes[0]; - } - else { - throw new ValueError("Expected exactly 1 Shape; got " + shapes.length); - } - } - else { - return shapes; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ - function countParamsInWeights(weights) { - var count = 0; - for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) { - var weight = weights_1[_i]; - if (weight.shape.length === 0) { - count += 1; - } - else { - count += weight.shape.reduce(function (a, b) { return a * b; }); - } - } - return count; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; - /** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ - var LayerVariable = /** @class */ (function () { - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - function LayerVariable(val, dtype, name, trainable, constraint) { - if (dtype === void 0) { dtype = 'float32'; } - if (name === void 0) { name = DEFAULT_VARIABLE_NAME_PREFIX; } - if (trainable === void 0) { trainable = true; } - if (constraint === void 0) { constraint = null; } - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - this.trainable_ = trainable; - this.constraint = constraint; - this.val = tfc.variable(val, this.trainable_, this.name, this.dtype); - } - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - LayerVariable.prototype.read = function () { - this.assertNotDisposed(); - return this.val; - }; - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - LayerVariable.prototype.write = function (newVal) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - }; - /** - * Dispose this LayersVariable instance from memory. - */ - LayerVariable.prototype.dispose = function () { - this.assertNotDisposed(); - this.val.dispose(); - }; - LayerVariable.prototype.assertNotDisposed = function () { - if (this.val.isDisposed) { - throw new Error("LayersVariable " + this.name + " is already disposed."); - } - }; - Object.defineProperty(LayerVariable.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this.trainable_ = trainable; - this.val.trainable = trainable; - }, - enumerable: true, - configurable: true - }); - return LayerVariable; - }()); - function checkShapesMatch(x, y) { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } - } - /** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ - function batchGetValue(xs) { - return xs.map(function (x) { return x.read(); }); - } - /** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ - function batchSetValue(variablesAndValues) { - variablesAndValues.forEach(function (variableAndValue) { - var variable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ - var InputSpec = /** @class */ (function () { - function InputSpec(args) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } - else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } - return InputSpec; - }()); - /** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - var SymbolicTensor = /** @class */ (function () { - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - function SymbolicTensor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { - this.dtype = dtype; - this.shape = shape; - this.sourceLayer = sourceLayer; - this.inputs = inputs; - this.callArgs = callArgs; - this.outputTensorIndex = outputTensorIndex; - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } - return SymbolicTensor; - }()); - var _nextNodeID = 0; - /** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ - var Node = /** @class */ (function () { - function Node(args, - // TODO(michaelterry): Define actual type for this. - callArgs) { - this.callArgs = callArgs; - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - // Following 2 properties: input and output shapes. - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - // Add nodes to all layers involved. - for (var _i = 0, _a = args.inboundLayers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - Node.prototype.getConfig = function () { - var inboundNames = []; - for (var _i = 0, _a = this.inboundLayers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer != null) { - inboundNames.push(layer.name); - } - else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - }; - return Node; - }()); - var _nextLayerID = 0; - /** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ - var Layer = /** @class */ (function (_super) { - __extends(Layer, _super); - function Layer(args) { - if (args === void 0) { args = {}; } - var _this = _super.call(this) || this; - _this._callHook = null; - _this._addedWeightNames = []; - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - _this._stateful = false; - _this.id = _nextLayerID++; - _this.activityRegularizer = null; - _this.inputSpec = null; - _this.supportsMasking = false; - // These properties will be set upon call of this.build() - _this._trainableWeights = []; - _this._nonTrainableWeights = []; - _this._losses = []; - _this._updates = []; - _this._built = false; - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - _this.inboundNodes = []; - _this.outboundNodes = []; - var name = args.name; - if (!name) { - var prefix = _this.getClassName(); - name = toSnakeCase(prefix) + '_' + getUid(prefix); - } - _this.name = name; - _this.trainable_ = args.trainable == null ? true : args.trainable; - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - var batchInputShape = void 0; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } - else if (args.inputShape != null) { - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - _this.batchInputShape = batchInputShape; - // Set dtype. - var dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - _this.dtype = dtype; - } - if (args.weights != null) { - _this.initialWeights = args.weights; - } - else { - _this.initialWeights = null; - } - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - _this._refCount = null; - _this.fastWeightInitDuringBuild = false; - return _this; - } - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - Layer.nodeKey = function (layer, nodeIndex) { - return layer.name + '_ib-' + nodeIndex.toString(); - }; - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - Layer.prototype.getNodeAtIndex = function (nodeIndex, attrName) { - if (this.inboundNodes.length === 0) { - throw new RuntimeError('The layer has never been called ' + - ("and thus has no defined " + attrName + ".")); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError("Asked to get " + attrName + " at node " + nodeIndex + ", " + - ("but the layer has only " + this.inboundNodes.length + " inbound nodes.")); - } - return this.inboundNodes[nodeIndex]; - }; - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - Layer.prototype.getInputAt = function (nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - }; - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - Layer.prototype.getOutputAt = function (nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - }; - Object.defineProperty(Layer.prototype, "input", { - // Properties - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get: function () { - if (this.inboundNodes.length > 1) { - throw new AttributeError("Layer " + this.name + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } - else if (this.inboundNodes.length === 0) { - throw new AttributeError("Layer " + this.name + - ' is not connected, no input to return.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "output", { - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get: function () { - if (this.inboundNodes.length === 0) { - throw new AttributeError("Layer " + this.name + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError("Layer " + this.name + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "losses", { - get: function () { - return this._losses; - }, - enumerable: true, - configurable: true - }); - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - Layer.prototype.calculateLosses = function () { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(function (lossFn) { return lossFn(); }); - }; - Object.defineProperty(Layer.prototype, "updates", { - get: function () { - return this._updates; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "built", { - get: function () { - return this._built; - }, - set: function (built) { - this._built = built; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this._trainableWeights.forEach(function (w) { return w.trainable = trainable; }); - this.trainable_ = trainable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "trainableWeights", { - get: function () { - if (this.trainable_) { - return this._trainableWeights.filter(function (w) { return w.trainable; }); - } - else { - return []; - } - }, - set: function (weights) { - this._trainableWeights = weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "nonTrainableWeights", { - get: function () { - if (this.trainable) { - return this._trainableWeights.filter(function (w) { return !w.trainable; }) - .concat(this._nonTrainableWeights); - } - else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - }, - set: function (weights) { - this._nonTrainableWeights = weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "weights", { - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get: function () { - return this.trainableWeights.concat(this.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "stateful", { - get: function () { - return this._stateful; - }, - enumerable: true, - configurable: true - }); - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - Layer.prototype.resetStates = function () { - if (!this.stateful) { - throw new Error('Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - }; - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - Layer.prototype.assertInputCompatibility = function (inputs) { - inputs = toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - var inputSpec = toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError("Layer " + this.name + " expects " + inputSpec.length + " inputs, " + - ("but it received " + inputs.length + " input tensors. ") + - ("Input received: " + inputs)); - } - for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - var x = inputs[inputIndex]; - var spec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - // Check ndim. - var ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + ": " + - ("expected ndim=" + spec.ndim + ", found ndim=" + ndim)); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + - (": expected max_ndim=" + spec.maxNDim + ", found ndim=" + ndim)); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + - (": expected min_ndim=" + spec.minNDim + ", found ndim=" + ndim + ".")); - } - } - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + " " + - (": expected dtype=" + spec.dtype + ", found dtype=" + x.dtype + ".")); - } - } - // Check specific shape axes. - if (spec.axes) { - var xShape = x.shape; - for (var key in spec.axes) { - var axis = Number(key); - var value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - var xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + - (this.name + ": expected axis " + axis + " of input shape to ") + - ("have value " + value + " but got shape " + xShape + ".")); - } - } - } - // Check shape. - if (spec.shape != null) { - for (var i = 0; i < spec.shape.length; ++i) { - var specDim = spec.shape[i]; - var dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + - (this.name + ": expected shape=" + spec.shape + ", ") + - ("found shape=" + x.shape + ".")); - } - } - } - } - } - }; - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - Layer.prototype.call = function (inputs, kwargs) { - return inputs; - }; - Layer.prototype.invokeCallHook = function (inputs, kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - }; - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - Layer.prototype.setCallHook = function (callHook) { - this._callHook = callHook; - }; - /** - * Clear call hook. - * This is currently used for testing only. - */ - Layer.prototype.clearCallHook = function () { - this._callHook = null; - }; - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - Layer.prototype.apply = function (inputs, kwargs) { - var _this = this; - kwargs = kwargs || {}; - this.assertNotDisposed(); - // Ensure inputs are all the same type. - var inputsList = toList(inputs); - var allAreSymbolic = true; - for (var _i = 0, inputsList_1 = inputsList; _i < inputsList_1.length; _i++) { - var input = inputsList_1[_i]; - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - var noneAreSymbolic = true; - for (var _a = 0, inputsList_2 = inputsList; _a < inputsList_2.length; _a++) { - var input = inputsList_2[_a]; - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError('Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, function () { - // Handle laying building (weight creating, input spec locking). - if (!_this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - _this.assertInputCompatibility(inputs); - // Collect input shapes to build layer. - var inputShapes = []; - for (var _i = 0, _a = toList(inputs); _i < _a.length; _i++) { - var xElem = _a[_i]; - inputShapes.push(xElem.shape); - } - _this.build(singletonOrArray(inputShapes)); - _this.built = true; - // Load weights that were specified at layer instantiation. - if (_this.initialWeights) { - _this.setWeights(_this.initialWeights); - } - if (_this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - _this._refCount = 1; - } - } - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - _this.assertInputCompatibility(inputs); - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - var output = _this.call(inputs, kwargs); - // TODO(michaelterry): Compute the outputMask - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - var outputList = toList(output); - var outputListCopy = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (var _b = 0, outputList_1 = outputList; _b < outputList_1.length; _b++) { - var x = outputList_1[_b]; - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = singletonOrArray(outputListCopy); - if (_this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Call addInboundNode()? - return output; - } - else { - var inputShape = collectInputShape(inputs); - var outputShape = _this.computeOutputShape(inputShape); - var output = void 0; - var outputDType_1 = guessOutputDType(inputs); - _this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : - inputShape); - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = outputShape - .map(function (shape, index) { return new SymbolicTensor(outputDType_1, shape, _this, toList(inputs), kwargs, _this.name, index); }); - } - else { - output = new SymbolicTensor(outputDType_1, outputShape, _this, toList(inputs), kwargs, _this.name); - } - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - _this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); - _this._refCount++; - if (_this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - return output; - } - }); - }; - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - Layer.prototype.warnOnIncompatibleInputShape = function (inputShape) { - if (this.batchInputShape == null) { - return; - } - else if (inputShape.length !== this.batchInputShape.length) { - console.warn("The rank of the input tensor provided (shape: " + - (JSON.stringify(inputShape) + ") does not match that of the ") + - ("batchInputShape (" + JSON.stringify(this.batchInputShape) + ") ") + - ("of the layer " + this.name)); - } - else { - var dimMismatch_1 = false; - this.batchInputShape.forEach(function (dimension, i) { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch_1 = true; - } - }); - if (dimMismatch_1) { - console.warn("The shape of the input tensor " + - ("(" + JSON.stringify(inputShape) + ") does not ") + - ("match the expectation of layer " + this.name + ": ") + - ("" + JSON.stringify(this.batchInputShape))); - } - } - }; - Object.defineProperty(Layer.prototype, "outputShape", { - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get: function () { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError("The layer " + this.name + " has never been called and thus has no " + - "defined output shape."); - } - var allOutputShapes = []; - for (var _i = 0, _a = this.inboundNodes; _i < _a.length; _i++) { - var node = _a[_i]; - var shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - var outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return outputShapes[0]; - } - else { - return outputShapes; - } - } - else { - throw new AttributeError("The layer " + this.name + " has multiple inbound nodes with different " + - "output shapes. Hence the notion of \"output shape\" is ill-defined " + - "for the layer."); - // TODO(cais): Implement getOutputShapeAt(). - } - }, - enumerable: true, - configurable: true - }); - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.countParams = function () { - if (!this.built) { - throw new RuntimeError("You tried to call countParams() on " + this.name + ", " + - "but the layer is not built yet. Build it first by calling " + - "build(batchInputShape)."); - } - return countParamsInWeights(this.weights); - }; - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.build = function (inputShape) { - this.built = true; - }; - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.getWeights = function (trainableOnly) { - if (trainableOnly === void 0) { trainableOnly = false; } - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - }; - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.setWeights = function (weights) { - var _this = this; - tfc.tidy(function () { - var params = _this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError("You called setWeights(weights) on layer \"" + _this.name + "\" " + - ("with a weight list of length " + weights.length + ", ") + - ("but the layer was expecting " + params.length + " weights. ") + - ("Provided weights: " + weights + "...")); - } - if (params.length === 0) { - return; - } - var weightValueTuples = []; - var paramValues = batchGetValue(params); - for (var i = 0; i < paramValues.length; ++i) { - var pv = paramValues[i]; - var p = params[i]; - var w = weights[i]; - if (!tfc.util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError("Layer weight shape " + pv.shape + " " + - ("not compatible with provided weight shape " + w.shape)); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - }; - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.addWeight = function (name, shape, dtype, initializer, regularizer, trainable, constraint) { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError("Duplicate weight name " + name + " for layer " + this.name); - } - this._addedWeightNames.push(name); - if (dtype == null) { - dtype = 'float32'; - } - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - var initValue = initializer.apply(shape, dtype); - var weight = new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(function () { return regularizer.apply(weight.read()); }); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } - else { - this._nonTrainableWeights.push(weight); - } - return weight; - }; - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - Layer.prototype.setFastWeightInitDuringBuild = function (value) { - this.fastWeightInitDuringBuild = value; - }; - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.addLoss = function (losses) { - var _a; - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = toList(losses); - if (this._losses !== undefined && this._losses !== null) { - (_a = this.losses).push.apply(_a, losses); - } - }; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - Layer.prototype.computeMask = function (inputs, mask) { - var _this = this; - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(function (maskElement) { - if (maskElement != null) { - throw new TypeError("Layer " + _this.name + " does not support masking, " + - 'but was passed an inputMask.'); - } - }); - } - else { - throw new TypeError("Layer " + this.name + " does not support masking, " + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - }; - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - Layer.prototype.addInboundNode = function (inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs) { - if (kwargs === void 0) { kwargs = null; } - var inputTensorList = toList(inputTensors); - outputTensors = toList(outputTensors); - inputMasks = toList(inputMasks); - outputMasks = toList(outputMasks); - inputShapes = normalizeShapeList(inputShapes); - outputShapes = normalizeShapeList(outputShapes); - // Collect input tensor(s) coordinates. - var inboundLayers = []; - var nodeIndices = []; - var tensorIndices = []; - for (var _i = 0, inputTensorList_1 = inputTensorList; _i < inputTensorList_1.length; _i++) { - var x = inputTensorList_1[_i]; - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: inboundLayers, - nodeIndices: nodeIndices, - tensorIndices: tensorIndices, - inputTensors: inputTensorList, - outputTensors: outputTensors, - inputMasks: inputMasks, - outputMasks: outputMasks, - inputShapes: inputShapes, - outputShapes: outputShapes - }, kwargs); - // Update tensor history - for (var i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - }; - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.getConfig = function () { - var config = { name: this.name, trainable: this.trainable }; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - }; - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - Layer.prototype.disposeWeights = function () { - this.weights.forEach(function (weight) { return weight.dispose(); }); - return this.weights.length; - }; - Layer.prototype.assertNotDisposed = function () { - if (this._refCount === 0) { - throw new Error("Layer '" + this.name + "' is already disposed."); - } - }; - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.dispose = function () { - if (!this.built) { - throw new Error("Cannot dispose Layer " + this.name + " because it has not been " + - "built yet."); - } - if (this._refCount === null) { - throw new Error("Cannot dispose Layer " + this.name + " because it has not been used " + - "yet."); - } - this.assertNotDisposed(); - var numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - return { refCountAfterDispose: this._refCount, numDisposedVariables: numDisposedVariables }; - }; - return Layer; - }(tfc.serialization.Serializable)); - /** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ - function collectInputShape(inputTensors) { - inputTensors = - toList(inputTensors); - var shapes = []; - for (var _i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { - var x = inputTensors_1[_i]; - shapes.push(x.shape); - } - return singletonOrArray(shapes); - } - /** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ - function guessOutputDType(inputTensors) { - return 'float32'; - } - /** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ - function getSourceInputs(tensor, layer, nodeIndex) { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } - else { - var node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } - else { - var sourceTensors = []; - for (var i = 0; i < node.inboundLayers.length; i++) { - var x = node.inputTensors[i]; - var layer_1 = node.inboundLayers[i]; - var nodeIndex_1 = node.nodeIndices[i]; - var previousSources = getSourceInputs(x, layer_1, nodeIndex_1); - // Avoid input redundancy. - for (var _i = 0, previousSources_1 = previousSources; _i < previousSources_1.length; _i++) { - var x_1 = previousSources_1[_i]; - if (sourceTensors.indexOf(x_1) === -1) { - sourceTensors.push(x_1); - } - } - } - return sourceTensors; - } - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var InputLayer = /** @class */ (function (_super) { - __extends(InputLayer, _super); - function InputLayer(args) { - var _this = _super.call(this, { - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }) || this; - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - _this.trainable = false; - _this.built = true; - _this.sparse = args.sparse; - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError('Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - var batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError('An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } - else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } - else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError('Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - var dtype = args.dtype || 'float32'; - _this.batchInputShape = batchInputShape; - _this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - _this.inputSpec = [{ shape: batchInputShape }]; - var inputTensor = new SymbolicTensor(_this.dtype, _this.batchInputShape, _this, [], {}, _this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: _this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - return _this; - } - InputLayer.prototype.apply = function (inputs, kwargs) { - throw new ValueError('Cannot pass any input to an ' + - ("InputLayer's apply() method. InputLayer name: " + this.name)); - }; - InputLayer.prototype.dispose = function () { - // dispose() for InputLayer is overridden as no-op. - return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; - }; - InputLayer.prototype.getConfig = function () { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - }; - /** @nocollapse */ - InputLayer.className = 'InputLayer'; - return InputLayer; - }(Layer)); - tfc.serialization.registerClass(InputLayer); - function Input(config) { - if (config.batchShape == null && config.shape == null) { - throw new Error('Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError('Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - var batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - var dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - var inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype: dtype, - sparse: config.sparse - }); - var outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ - function resolveScalarsInLogs(logs) { - return __awaiter(this, void 0, void 0, function () { - var promises, keys, scalarsToDispose, key, value, valueScalar, values, i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (logs == null) { - return [2 /*return*/]; - } - promises = []; - keys = []; - scalarsToDispose = []; - for (key in logs) { - value = logs[key]; - if (typeof value !== 'number') { - valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (!(promises.length > 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, Promise.all(promises)]; - case 1: - values = _a.sent(); - for (i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - tfc.dispose(scalarsToDispose); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); - } - /** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ - function disposeTensorsInLogs(logs) { - if (logs == null) { - return; - } - for (var key in logs) { - var value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** Verbosity logging level when fitting a model. */ - var ModelLoggingVerbosity; - (function (ModelLoggingVerbosity) { - ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; - })(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); - /** How often to yield to the main thread when training (in ms). */ - var DEFAULT_YIELD_EVERY_MS = 125; - /** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ - var BaseCallback = /** @class */ (function () { - function BaseCallback() { - // TODO(michaelterry): This type is a best guess. - this.validationData = null; - } - BaseCallback.prototype.setParams = function (params) { - this.params = params; - }; - BaseCallback.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - BaseCallback.prototype.setModel = function (model) { - // Do nothing. Use Callback instead of BaseCallback to track the model. - }; - return BaseCallback; - }()); - /** - * Container abstracting a list of callbacks. - */ - var CallbackList = /** @class */ (function () { - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - function CallbackList(callbacks, queueLength) { - if (queueLength === void 0) { queueLength = 10; } - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - CallbackList.prototype.append = function (callback) { - this.callbacks.push(callback); - }; - CallbackList.prototype.setParams = function (params) { - for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { - var callback = _a[_i]; - callback.setParams(params); - } - }; - CallbackList.prototype.setModel = function (model) { - for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { - var callback = _a[_i]; - callback.setModel(model); - } - }; - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onEpochBegin(epoch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onEpochEnd(epoch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onBatchBegin(batch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onBatchEnd(batch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onTrainBegin(logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onTrainEnd(logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - return CallbackList; - }()); - /** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ - var BaseLogger = /** @class */ (function (_super) { - __extends(BaseLogger, _super); - function BaseLogger() { - return _super.call(this) || this; - } - BaseLogger.prototype.onEpochBegin = function (epoch) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.seen = 0; - this.totals = {}; - return [2 /*return*/]; - }); - }); - }; - BaseLogger.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var batchSize, _loop_1, this_1, key; - var _this = this; - return __generator(this, function (_a) { - if (logs == null) { - logs = {}; - } - batchSize = logs['size'] == null ? 0 : logs['size']; - this.seen += batchSize; - _loop_1 = function (key) { - var value = logs[key]; - if (typeof value === 'number') { - if (!this_1.totals.hasOwnProperty(key)) { - this_1.totals[key] = 0; - } - this_1.totals[key] = this_1.totals[key] + value * batchSize; - } - else { - var oldTotalsToDispose = void 0; - if (key in this_1.totals) { - oldTotalsToDispose = this_1.totals[key]; - } - else { - this_1.totals[key] = 0; - } - var total = tfc.tidy(function () { return tfc.add((_this.totals[key]), tfc.mul(value, batchSize)); }); - this_1.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - }; - this_1 = this; - for (key in logs) { - _loop_1(key); - } - return [2 /*return*/]; - }); - }); - }; - BaseLogger.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _loop_2, this_2, _i, _a, key; - var _this = this; - return __generator(this, function (_b) { - if (logs != null) { - _loop_2 = function (key) { - if (this_2.totals[key] == null) { - return "continue"; - } - if (typeof this_2.totals[key] === 'number') { - logs[key] = this_2.totals[key] / this_2.seen; - } - else { - tfc.tidy(function () { - var log = tfc.mul(tfc.div(1, _this.seen), _this.totals[key]); - logs[key] = log; - _this.totals[key].dispose(); - tfc.keep(logs[key]); - }); - } - }; - this_2 = this; - for (_i = 0, _a = this.params['metrics']; _i < _a.length; _i++) { - key = _a[_i]; - _loop_2(key); - } - } - return [2 /*return*/]; - }); - }); - }; - return BaseLogger; - }(BaseCallback)); - /** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ - var History = /** @class */ (function (_super) { - __extends(History, _super); - function History() { - return _super !== null && _super.apply(this, arguments) || this; - } - History.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.epoch = []; - this.history = {}; - return [2 /*return*/]; - }); - }); - }; - History.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var key; - return __generator(this, function (_a) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - return [2 /*return*/]; - }); - }); - }; - /** - * Await the values of all losses and metrics. - */ - History.prototype.syncData = function () { - return __awaiter(this, void 0, void 0, function () { - var promises, keys, indices, key, valueArray, i, valueScalar, values, n, tensorToDispose; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - promises = []; - keys = []; - indices = []; - for (key in this.history) { - valueArray = this.history[key]; - for (i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - valueScalar = valueArray[i]; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - return [4 /*yield*/, Promise.all(promises)]; - case 1: - values = _a.sent(); - for (n = 0; n < values.length; ++n) { - tensorToDispose = this.history[keys[n]][indices[n]]; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - return [2 /*return*/]; - } - }); - }); - }; - return History; - }(BaseCallback)); - /** - * Custom callback for training. - */ - var CustomCallback = /** @class */ (function (_super) { - __extends(CustomCallback, _super); - function CustomCallback(args, yieldEvery) { - var _this = _super.call(this) || this; - _this.currentEpoch = 0; - _this.yieldEvery = yieldEvery || 'auto'; - if (_this.yieldEvery === 'auto') { - _this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (_this.yieldEvery === 'never' && args.onYield != null) { - throw new Error('yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (tfc.util.isNumber(_this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - _this.maybeWait = debounce(_this.maybeWait.bind(_this), _this.yieldEvery); - } - _this.trainBegin = args.onTrainBegin; - _this.trainEnd = args.onTrainEnd; - _this.epochBegin = args.onEpochBegin; - _this.epochEnd = args.onEpochEnd; - _this.batchBegin = args.onBatchBegin; - _this.batchEnd = args.onBatchEnd; - _this.yield = args.onYield; - return _this; - } - CustomCallback.prototype.maybeWait = function (epoch, batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.yield != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.yield(epoch, batch, logs)); - _a.label = 2; - case 2: - ps.push(tfc.nextFrame()); - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.currentEpoch = epoch; - if (!(this.epochBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.epochBegin(epoch, logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.epochEnd != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.epochEnd(epoch, logs)); - _a.label = 2; - case 2: - if (this.yieldEvery === 'epoch') { - ps.push(tfc.nextFrame()); - } - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.batchBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.batchBegin(batch, logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.batchEnd != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.batchEnd(batch, logs)); - _a.label = 2; - case 2: - if (this.yieldEvery === 'batch') { - ps.push(tfc.nextFrame()); - } - else if (tfc.util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.trainBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.trainBegin(logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.trainEnd != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.trainEnd(logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - return CustomCallback; - }(BaseCallback)); - /** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ - function standardizeCallbacks(callbacks, yieldEvery) { - if (callbacks == null) { - callbacks = {}; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks; - } - // Convert custom callback configs to custom callback objects. - var callbackConfigs = toList(callbacks); - return callbackConfigs.map(function (callbackConfig) { return new CustomCallback(callbackConfig, yieldEvery); }); - } - /** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ - var CallbackConstructorRegistry = /** @class */ (function () { - /** - * Blocks public access to constructor. - */ - function CallbackConstructorRegistry() { - } - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - CallbackConstructorRegistry.registerCallbackConstructor = function (verbosityLevel, callbackConstructor) { - tfc.util.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), function () { return "Verbosity level is expected to be an integer >= 0, " + - ("but got " + verbosityLevel); }); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push(callbackConstructor); - }; - CallbackConstructorRegistry.checkForDuplicate = function (callbackConstructor) { - for (var levelName in CallbackConstructorRegistry.constructors) { - var constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(function (ctor) { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - }; - /** - * Clear all registered callback constructors. - */ - CallbackConstructorRegistry.clear = function () { - CallbackConstructorRegistry.constructors = {}; - }; - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - CallbackConstructorRegistry.createCallbacks = function (verbosityLevel) { - var constructors = []; - for (var levelName in CallbackConstructorRegistry.constructors) { - var level = +levelName; - if (verbosityLevel >= level) { - constructors.push.apply(constructors, CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(function (ctor) { return new ctor(); }); - }; - CallbackConstructorRegistry.constructors = {}; - return CallbackConstructorRegistry; - }()); - function configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { - var history = new History(); - var actualCallbacks = [ - new BaseLogger() - ].concat(CallbackConstructorRegistry.createCallbacks(verbose)); - if (callbacks != null) { - actualCallbacks.push.apply(actualCallbacks, callbacks); - } - actualCallbacks.push(history); - var callbackList = new CallbackList(actualCallbacks); - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - callbackList.setParams({ - epochs: epochs, - initialEpoch: initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize: batchSize, - verbose: verbose, - doValidation: doValidation, - metrics: callbackMetrics, - }); - return { callbackList: callbackList, history: history }; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ - function deserialize(config, customObjects, fastWeightInit) { - if (customObjects === void 0) { customObjects = {}; } - if (fastWeightInit === void 0) { fastWeightInit = false; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer', fastWeightInit); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ - function l2Normalize(x, axis) { - return tfc.tidy(function () { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - var squareSum = tfc.sum(square$1(x), axis, true); - var epsilonTensor = tfc.fill(squareSum.shape, epsilon()); - var norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); - return tfc.div(x, norm); - }); - } - function meanSquaredError(yTrue, yPred) { - return tfc.tidy(function () { return tfc.mean(square$1(tfc.sub(yPred, yTrue)), -1); }); - } - function meanAbsoluteError(yTrue, yPred) { - return tfc.tidy(function () { return tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1); }); - } - function meanAbsolutePercentageError(yTrue, yPred) { - return tfc.tidy(function () { - var diff = tfc.sub(yTrue, yPred); - var clippedTrue = tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); - var absResult = tfc.abs(tfc.div(diff, clippedTrue)); - return tfc.mul(100, tfc.mean(absResult, -1)); - }); - } - function meanSquaredLogarithmicError(yTrue, yPred) { - return tfc.tidy(function () { - var clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); - var firstLog = tfc.log(tfc.add(1, clippedPred)); - var clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); - var secondLog = tfc.log(tfc.add(1, clippedTrue)); - return tfc.mean(square$1(tfc.sub(firstLog, secondLog)), -1); - }); - } - function squaredHinge(yTrue, yPred) { - return tfc.tidy(function () { - var maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(square$1(maxResult), -1); - }); - } - function hinge(yTrue, yPred) { - return tfc.tidy(function () { - var maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(maxResult, -1); - }); - } - function categoricalHinge(yTrue, yPred) { - return tfc.tidy(function () { - var pos = tfc.sum(tfc.mul(yTrue, yPred), -1); - var neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1); - return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos))); - }); - } - /** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ - function logcosh(yTrue, yPred) { - return tfc.tidy(function () { - var log2 = Math.log(2); - var predictionDiff = tfc.sub(yPred, yTrue); - var logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))), log2); - return tfc.mean(logcoshResult, -1); - }); - } - function categoricalCrossentropy(target, output, fromLogits) { - if (fromLogits === void 0) { fromLogits = false; } - return tfc.tidy(function () { - if (fromLogits) { - output = tfc.softmax(output); - } - else { - // scale preds so that the class probabilities of each sample sum to 1. - var outputSum = tfc.sum(output, output.shape.length - 1, true); - output = tfc.div(output, outputSum); - } - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); - }); - } - /** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ - function sparseCategoricalCrossentropy(target, output, fromLogits) { - if (fromLogits === void 0) { fromLogits = false; } - return tfc.tidy(function () { - var flatTarget = tfc.floor(flatten$1(target)).toInt(); - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - var outputShape = output.shape; - var oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); - } - /** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ - function sigmoidCrossEntropyWithLogits(labels, logits) { - if (!tfc.util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError("logits and labels must have the same shape, but got shapes " + - (JSON.stringify(labels.shape) + " and " + JSON.stringify(logits.shape))); - } - return tfc.tidy(function () { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - var reluLogits = logits.relu(); - var negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); - } - function binaryCrossentropy(yTrue, yPred) { - return tfc.tidy(function () { - var y; - y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); - y = tfc.log(tfc.div(y, tfc.sub(1, y))); - return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); - } - function kullbackLeiblerDivergence(yTrue, yPred) { - return tfc.tidy(function () { - var clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); - var clippedPred = tfc.clipByValue(yPred, epsilon(), 1); - return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); - }); - } - function poisson(yTrue, yPred) { - return tfc.tidy(function () { - var logPred = tfc.log(tfc.add(epsilon(), yPred)); - return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); - }); - } - function cosineProximity(yTrue, yPred) { - return tfc.tidy(function () { - var trueNormalized = l2Normalize(yTrue, -1); - var predNormalized = l2Normalize(yPred, -1); - var trueXPred = tfc.mul(trueNormalized, predNormalized); - return tfc.neg(tfc.sum(trueXPred, -1)); - }); - } - // TODO(michaelterry): Add deserialize() function. - var lossesMap = { - meanSquaredError: meanSquaredError, - meanAbsoluteError: meanAbsoluteError, - meanAbsolutePercentageError: meanAbsolutePercentageError, - meanSquaredLogarithmicError: meanSquaredLogarithmicError, - squaredHinge: squaredHinge, - hinge: hinge, - categoricalHinge: categoricalHinge, - logcosh: logcosh, - categoricalCrossentropy: categoricalCrossentropy, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy, - binaryCrossentropy: binaryCrossentropy, - kullbackLeiblerDivergence: kullbackLeiblerDivergence, - poisson: poisson, - cosineProximity: cosineProximity - }; - // Porting note: This diverges from the PyKeras implementation and may need to - // change based on (de)serialization requirements. - function get(identifierOrFn) { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - var errMsg = "Unknown loss " + identifierOrFn; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = "Unknown loss " + identifierOrFn + ". " + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } - else { - return identifierOrFn; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function binaryAccuracy(yTrue, yPred) { - return tfc.tidy(function () { - var threshold = tfc.mul(.5, tfc.onesLike(yPred)); - var yPredThresholded = cast$1(tfc.greater(yPred, threshold), yTrue.dtype); - return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); - }); - } - function categoricalAccuracy(yTrue, yPred) { - return tfc.tidy(function () { return cast$1(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'); }); - } - function truePositives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); - } - function falseNegatives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); - } - function falsePositives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); - } - function precision(yTrue, yPred) { - return tfc.tidy(function () { - var tp = truePositives(yTrue, yPred); - var fp = falsePositives(yTrue, yPred); - var denominator = tp.add(fp); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); - } - function recall(yTrue, yPred) { - return tfc.tidy(function () { - var tp = truePositives(yTrue, yPred); - var fn = falseNegatives(yTrue, yPred); - var denominator = tp.add(fn); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); - } - function binaryCrossentropy$1(yTrue, yPred) { - return binaryCrossentropy(yTrue, yPred); - } - function sparseCategoricalAccuracy(yTrue, yPred) { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return tfc.equal(yTrue, yPred).asType('float32'); - } - // Aliases. - var mse = meanSquaredError; - var MSE = meanSquaredError; - var mae = meanAbsoluteError; - var MAE = meanAbsoluteError; - var mape = meanAbsolutePercentageError; - var MAPE = meanAbsolutePercentageError; - var categoricalCrossentropy$1 = categoricalCrossentropy; - var cosine = cosineProximity; - var sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy; - // TODO(cais, nielsene): Add serialize(). - var metricsMap = { - binaryAccuracy: binaryAccuracy, - categoricalAccuracy: categoricalAccuracy, - precision: precision, - categoricalCrossentropy: categoricalCrossentropy$1, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, - mse: mse, - MSE: MSE, - mae: mae, - MAE: MAE, - mape: mape, - MAPE: MAPE, - cosine: cosine - }; - function get$1(identifier) { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } - else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } - else { - throw new ValueError("Unknown metric " + identifier); - } - } - /** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ - function getLossOrMetricName(fn) { - assert$1(fn !== null, "Unknown LossOrMetricFn " + fn); - if (typeof fn === 'string') { - return fn; - } - else { - var fnName = void 0; - for (var _i = 0, _a = Object.keys(lossesMap); _i < _a.length; _i++) { - var key = _a[_i]; - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (var _b = 0, _c = Object.keys(metricsMap); _b < _c.length; _b++) { - var key = _c[_b]; - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return fn.name; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // Add (de)serialize() - // Porting note: This diverges from the PyKeras implementation and may need to - // change based on (de)serialization requirements. - function getOptimizer(identifier) { - var optimizerMap = { - 'Adagrad': function () { return tfc.train.adagrad(0.01); }, - 'Adadelta': function () { return tfc.train.adadelta(1, 0.95, epsilon()); }, - 'Adam': function () { return tfc.train.adam(0.001, 0.9, 0.999, epsilon()); }, - 'Adamax': function () { return tfc.train.adamax(0.002, 0.9, 0.999, epsilon(), 0); }, - 'RMSProp': function () { return tfc.train.rmsprop(0.001, 0.9, 0, epsilon()); }, - 'SGD': function () { return tfc.train.sgd(0.01); } - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError("Unknown Optimizer " + identifier); - } - - /** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** Utility functions related to user-defined metadata. */ - // Maximum recommended serialized size for user-defined metadata. - // Beyond this limit, a warning message will be printed during model loading and - // saving. - var MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; - /** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ - function checkUserDefinedMetadata(userDefinedMetadata, modelName, checkSize) { - if (checkSize === void 0) { checkSize = false; } - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error('User-defined metadata is expected to be a JSON object, but is not.'); - } - if (checkSize) { - var out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn("User-defined metadata of model \"" + modelName + "\" is too large in " + - ("size (length=" + out.length + " when serialized). It is not ") + - "recommended to store such large objects in user-defined metadata. " + - "Please make sure its serialized length is <= " + - (MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH + ".")); - } - } - } - /** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ - // tslint:disable-next-line:no-any - function plainObjectCheck(x) { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } - else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - var keys = Object.keys(x); - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (var _a = 0, x_1 = x; _a < x_1.length; _a++) { - var item = x_1[_a]; - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } - else { - // `x` is not a JavaScript object or `null`. - var xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ - function printSummary(model, lineLength, positions, - // tslint:disable-next-line:no-any - printFn) { - if (printFn === void 0) { printFn = console.log; } - var sequentialLike = isModelSequentialLike(model); - // Header names for different log elements. - var toDisplay = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } - else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(function (p) { return Math.floor(lineLength * p); }); - } - var relevantNodes; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (var depth in model.nodesByDepth) { - relevantNodes.push.apply(relevantNodes, model.nodesByDepth[depth]); - } - } - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - var layers = model.layers; - for (var i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } - else { - printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - // tslint:disable-next-line:no-any - model.checkTrainableWeightsConsistency(); - var trainableCount = countTrainableParams(model); - var nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - printFn("Total params: " + (trainableCount + nonTrainableCount)); - printFn("Trainable params: " + trainableCount); - printFn("Non-trainable params: " + nonTrainableCount); - printFn('_'.repeat(lineLength)); - } - function countTrainableParams(model) { - var trainableCount; - // tslint:disable:no-any - if (model.collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights(model.collectedTrainableWeights); - } - else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; - } - function isModelSequentialLike(model) { - var sequentialLike = true; - var nodesByDepth = []; - var nodes = []; - for (var depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (var _i = 0, nodesByDepth_1 = nodesByDepth; _i < nodesByDepth_1.length; _i++) { - var depthNodes = nodesByDepth_1[_i]; - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push.apply(nodes, depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (var _a = 0, _b = model.layers; _a < _b.length; _a++) { - var layer = _b[_a]; - var flag = false; - for (var _c = 0, _d = layer.inboundNodes; _c < _d.length; _c++) { - var node = _d[_c]; - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } - else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; - } - function printRow(fields, positions, - // tslint:disable-next-line:no-any - printFn) { - if (printFn === void 0) { printFn = console.log; } - var line = ''; - for (var i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); - } - /** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ - function printLayerSummary(layer, positions, - // tslint:disable-next-line:no-any - printFn) { - var outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - var name = layer.name; - var className = layer.getClassName(); - var fields = [name + " (" + className + ")", outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); - } - /** - * Prints a summary for a single Layer, with connectivity information. - */ - function printLayerSummaryWithConnections(layer, positions, relevantNodes, - // tslint:disable-next-line:no-any - printFn) { - var outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - var connections = []; - for (var _i = 0, _a = layer.inboundNodes; _i < _a.length; _i++) { - var node = _a[_i]; - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (var i = 0; i < node.inboundLayers.length; ++i) { - var inboundLayer = node.inboundLayers[i].name; - var inboundLayerIndex = node.nodeIndices[i]; - var inboundTensorIndex = node.tensorIndices[i]; - connections.push(inboundLayer + "[" + inboundLayerIndex + "][" + inboundTensorIndex + "]"); - } - } - var name = layer.name; - var className = layer.getClassName(); - var firstConnection = connections.length === 0 ? '' : connections[0]; - var fields = [ - name + " (" + className + ")", outputShape, layer.countParams().toString(), - firstConnection - ]; - printRow(fields, positions, printFn); - for (var i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // tslint:enable - /** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ - function isArrayItemInputOrOutputName(key, index, value) { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; - } - /** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ - function convertPythonicToTs(pythonicConfig, key) { - if (pythonicConfig === null) { - return null; - } - else if (typeof pythonicConfig === 'string') { - return toCamelCase(pythonicConfig); - } - else if ((typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } - else if (pythonicConfig instanceof Array) { - var tsArray = []; - var arrayLength = pythonicConfig.length; - for (var i = 0; i < arrayLength; ++i) { - var item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } - else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } - else { - var tsDict = {}; - for (var _i = 0, _a = Object.keys(pythonicConfig); _i < _a.length; _i++) { - var pythonicKey = _a[_i]; - var pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } - else { - var tsKey = toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } - } - /** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ - function convertTsToPythonic(tsConfig, key) { - if (tsConfig === null || tsConfig === undefined) { - return null; - } - else if (typeof tsConfig === 'string') { - return toSnakeCase(tsConfig); - } - else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } - else if (tsConfig instanceof Array) { - var pyArray = []; - var arrayLength = tsConfig.length; - for (var i = 0; i < arrayLength; ++i) { - var item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } - else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } - else { - var pyDict = {}; - for (var _i = 0, _a = Object.keys(tsConfig); _i < _a.length; _i++) { - var tsKey = _a[_i]; - var tsValue = tsConfig[tsKey]; - var pyKey = toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } - else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } - } - - /** @license See the LICENSE file. */ - // This code is auto-generated, do not modify this file! - var version = '3.6.0'; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function to check the dtype and shape compatibility of a feed value. - */ - function assertFeedCompatibility(key, val) { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return tfc.cast(val, key.dtype); - } - catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError("The dtype of the feed (" + val.dtype + ") can not be cast to the dtype " + - ("of the key '" + key.name + "' (" + key.dtype + ").")); - } - } - /** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ - var FeedDict = /** @class */ (function () { - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - function FeedDict(feeds) { - this.id2Value = {}; - this.id2Mask = {}; - this.name2Id = {}; - if (feeds instanceof FeedDict) { - for (var id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } - else { - if (feeds == null) { - return; - } - for (var _i = 0, feeds_1 = feeds; _i < feeds_1.length; _i++) { - var feed = feeds_1[_i]; - this.add(feed.key, feed.value); - } - } - } - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - FeedDict.prototype.add = function (key, value, mask) { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } - else { - throw new ValueError("Duplicate key: name=" + key.name + ", id=" + key.id); - } - return this; - }; - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - FeedDict.prototype.addFeed = function (feed) { - this.add(feed.key, feed.value); - }; - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - FeedDict.prototype.hasKey = function (key) { - return this.id2Value[key.id] != null; - }; - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - FeedDict.prototype.names = function () { - return Object.keys(this.name2Id); - }; - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - FeedDict.prototype.getValue = function (key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError("Nonexistent key: " + key.name); - } - else { - return this.id2Value[key.id]; - } - } - else { - var id = this.name2Id[key]; - if (id == null) { - throw new ValueError("Feed dict has no SymbolicTensor name: " + key); - } - return this.id2Value[id]; - } - }; - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - FeedDict.prototype.getMask = function (key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError("Nonexistent key: " + key.name); - } - else { - return this.id2Mask[key.id]; - } - } - else { - var id = this.name2Id[key]; - if (id == null) { - throw new ValueError("Feed dict has no SymbolicTensor name: " + key); - } - return this.id2Mask[id]; - } - }; - /** Dispose all mask Tensors held by this object. */ - FeedDict.prototype.disposeMasks = function () { - if (this.id2Mask != null) { - tfc.dispose(this.id2Mask); - } - }; - return FeedDict; - }()); - // Cache for topologically sorted SymbolicTensors for given execution - // targets (i.e., fetches). - var cachedSorted = {}; - // Cache for recipient count maps for given execution targets (i.e., fetches). - var cachedRecipientCounts = {}; - /** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ - function execute(fetches, feedDict, kwargs, probe) { - var training = kwargs == null ? false : kwargs['training']; - var arrayFetches = Array.isArray(fetches); - var fetchArray = arrayFetches ? fetches : [fetches]; - var outputNames = fetchArray.map(function (t) { return t.name; }); - var finalOutputs = []; - var feedNames = feedDict.names(); - for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { - var outputName = outputNames_1[_i]; - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } - else { - finalOutputs.push(null); - } - } - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - // Check cache. - var fetchAndFeedKey = outputNames.join(',') + '|' + feedDict.names().join(','); - var sorted; - var recipientCounts; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - var out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - var internalFeedDict = new FeedDict(feedDict); - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (var i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - var numTensors = tfc.memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - var symbolic = sorted[i]; - var srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - var inputValues = []; - var inputMasks = []; - var tensorsToDispose = []; - var maskExists = false; - for (var _a = 0, _b = symbolic.inputs; _a < _b.length; _a++) { - var input = _b[_a]; - var value = internalFeedDict.getValue(input); - var mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - var outputTensors = toList(srcLayer.apply(inputValues, kwargs)); - var outputMask = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - var layerOutputs = getNodeOutputs(symbolic); - var outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (var i_1 = 0; i_1 < outputSymbolicTensors.length; ++i_1) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i_1])) { - internalFeedDict.add(outputSymbolicTensors[i_1], outputTensors[i_1], Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - var index = outputNames.indexOf(outputSymbolicTensors[i_1].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i_1]; - } - } - if (!training) { - // Clean up Tensors that are no longer needed. - tfc.dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - return arrayFetches ? finalOutputs : finalOutputs[0]; - } - /** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ - function getTopologicalSortAndRecipientCounts(fetches, feedDict) { - tfc.util.assert(fetches != null && fetches.length > 0, function () { return "Expected at least one fetch, got none"; }); - var finalSorted = []; - var finalRecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - var out = getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } - else { - var visited = new Set(); - for (var _i = 0, fetches_1 = fetches; _i < fetches_1.length; _i++) { - var fetch_1 = fetches_1[_i]; - var _a = getTopologicalSortAndRecipientCountsForOneFetch(fetch_1, feedDict), sorted = _a.sorted, recipientMap = _a.recipientMap; - // Merge sorted SymbolicTensor Arrays. - for (var _b = 0, sorted_1 = sorted; _b < sorted_1.length; _b++) { - var symbolicTensor = sorted_1[_b]; - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - var _loop_1 = function (name_1) { - if (finalRecipientMap[name_1] == null) { - finalRecipientMap[name_1] = new Set(); - } - recipientMap[name_1].forEach(function (recipient) { return finalRecipientMap[name_1].add(recipient); }); - }; - // Merge recipient maps. - for (var name_1 in recipientMap) { - _loop_1(name_1); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; - } - function recipientMap2Counts(recipientMap) { - var recipientCounts = {}; - for (var name_2 in recipientMap) { - recipientCounts[name_2] = recipientMap[name_2].size; - } - return recipientCounts; - } - /** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ - function getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict) { - var visited = new Set(); - var sorted = []; - var recipientMap = {}; - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (var _i = 0, _a = feedDict.names(); _i < _a.length; _i++) { - var key = _a[_i]; - visited.add(key); - } - var stack = []; - var marks = []; - // Initial population of stack and marks. - stack.push(fetch); - while (stack.length > 0) { - var top_1 = stack[stack.length - 1]; - if (visited.has(top_1.name)) { - stack.pop(); - continue; - } - var topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top_1.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top_1); - visited.add(top_1.name); - if (topIsMarked) { - marks.pop(); - } - } - else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (var _b = 0, _c = top_1.inputs; _b < _c.length; _b++) { - var input = _c[_b]; - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top_1.name); - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return { sorted: sorted, recipientMap: recipientMap }; - } - /** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ - function getNodeOutputs(fetch) { - var layerOutputs; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } - else { - var nodeIndex = null; - for (var i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (var _i = 0, _a = fetch.sourceLayer.inboundNodes[i] - .outputTensors; _i < _a.length; _i++) { - var outputTensor = _a[_i]; - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ - var Container = /** @class */ (function (_super) { - __extends(Container, _super); - function Container(args) { - var _this = - // No args passed to super's constructor. - _super.call(this, {}) || this; - _this.containerNodes = new Set(); - _this.name = args.name; - if (_this.name == null) { - var prefix = _this.getClassName().toLowerCase(); - _this.name = getUid(prefix); - } - _this.supportsMasking = false; - _this.trainable_ = true; - // TODO(michaelterry): Initialize perInputLosses/Updates here. - // Container-specific properties. - if (Array.isArray(args.inputs)) { - _this.inputs = args.inputs.slice(); - } - else { - _this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - _this.outputs = args.outputs.slice(); - } - else { - _this.outputs = [args.outputs]; - } - // Check for redundancy in inputs. - if (unique$1(_this.inputs).length !== _this.inputs.length) { - throw new ValueError('The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - ("" + _this.inputs.map(function (x) { return x.name; }))); - } - // Check for redundancy in outputs. - if (unique$1(_this.outputs).length !== _this.outputs.length) { - console.warn('The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - ("" + _this.outputs.map(function (x) { return x.name; }))); - } - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - _this.inputLayers = []; - _this.inputLayersNodeIndices = []; - _this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - _this.outputLayers = []; - _this.outputLayersNodeIndices = []; - _this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - _this.layers = []; - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - _this.internalContainerRefs = []; - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - // Build this.outputLayers: - for (var _i = 0, _a = _this.outputs; _i < _a.length; _i++) { - var x = _a[_i]; - var layer = x.sourceLayer; - var nodeIndex = x.nodeIndex; - var tensorIndex = x.tensorIndex; - _this.outputLayers.push(layer); - _this.outputLayersNodeIndices.push(nodeIndex); - _this.outputLayersTensorIndices.push(tensorIndex); - } - // TODO(michaelterry): Add output mask cache code. - // Build this.inputLayers: - for (var _b = 0, _c = _this.inputs; _b < _c.length; _b++) { - var x = _c[_b]; - var layer = x.sourceLayer; - var nodeIndex = x.nodeIndex; - var tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - assert$1(nodeIndex === 0, 'input layer has >1 nodes'); - assert$1(tensorIndex === 0, 'input layer has >1 tensors'); - _this.inputLayers.push(layer); - _this.inputLayersNodeIndices.push(nodeIndex); - _this.inputLayersTensorIndices.push(tensorIndex); - } - // Build this.inputNames and this.outputNames. - _this.inputNames = []; - _this.outputNames = []; - _this.feedInputShapes = []; - _this.feedInputNames = []; - _this.feedOutputNames = []; - for (var i = 0; i < _this.inputLayers.length; i++) { - var layer = _this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError('Input layers to a LayersModel must be InputLayer objects. ' + - ("Received inputs: " + args.inputs + ". ") + - ("Input " + i + " (0-based) originates ") + - ("from layer type " + layer.getClassName() + ".")); - } - _this.inputNames.push(layer.name); - _this.feedInputShapes.push(layer.batchInputShape); - _this.feedInputNames.push(layer.name); - } - for (var _d = 0, _e = _this.outputLayers; _d < _e.length; _d++) { - var layer = _e[_d]; - _this.outputNames.push(layer.name); - } - _this.internalInputShapes = _this.inputs.map(function (x) { return x.shape; }); - _this.internalOutputShapes = _this.outputs.map(function (x) { return x.shape; }); - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - var nodesDepths = {}; - // To recover nodes from their ID. - var nodeIDToNode = {}; - var layersDepths = {}; - // To layers from their ID. - var layerIDToLayer = {}; - var layerIndices = {}; - var nodesInDecreasingDepth = []; - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - var buildMapOfGraph = function (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - var node = layer.inboundNodes[nodeIndex]; - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError("The tensor " + tensor.name + " at layer \"" + layer.name + "\" " + - 'is part of a cycle.'); - } - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - // Update containerNodes. - _this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - // Propagate to all previous tensors connected to this node. - var numInboundLayers = node.inboundLayers.length; - for (var i = 0; i < numInboundLayers; i++) { - var x = node.inputTensors[i]; - var layer_1 = node.inboundLayers[i]; - var nodeIndex_1 = node.nodeIndices[i]; - var tensorIndex_1 = node.tensorIndices[i]; - buildMapOfGraph(x, finishedNodes, nodesInProgress, layer_1, nodeIndex_1, tensorIndex_1); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - var finishedNodes = []; - var nodesInProgress = []; - for (var _f = 0, _g = _this.outputs; _f < _g.length; _f++) { - var x = _g[_f]; - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - var reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); - for (var _h = 0, reversedNodesInDecreasingDepth_1 = reversedNodesInDecreasingDepth; _h < reversedNodesInDecreasingDepth_1.length; _h++) { - var node = reversedNodesInDecreasingDepth_1[_h]; - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - var depth = nodesDepths[node.id]; - // Update the depth of the corresponding layer - var previousDepth = (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - // Update the depth of inbound nodes. - for (var i = 0; i < node.inboundLayers.length; i++) { - var inboundLayer = node.inboundLayers[i]; - var nodeIndex = node.nodeIndices[i]; - var inboundNode = inboundLayer.inboundNodes[nodeIndex]; - var previousDepth_1 = (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth_1); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - // Build a dict {depth: list of nodes with this depth} - var nodesByDepth = {}; - for (var nodeID in nodesDepths) { - var depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - // Build a dict {depth: list of layers with this depth} - var layersByDepth = {}; - for (var layerID in layersDepths) { - var depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - // Get sorted list of layer depths. - var depthKeys = Object.keys(layersByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Set this.layers and this.layersByDepth. - _this.layers = []; - for (var _j = 0, depthKeys_1 = depthKeys; _j < depthKeys_1.length; _j++) { - var depth = depthKeys_1[_j]; - var layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort(function (a, b) { - var aIndex = layerIndices[a.id]; - var bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (var _k = 0, layersForDepth_1 = layersForDepth; _k < layersForDepth_1.length; _k++) { - var layer = layersForDepth_1[_k]; - if (layer instanceof Container) { - _this.internalContainerRefs.push(layer); - } - _this.layers.push(layer); - } - } - _this.layersByDepth = layersByDepth; - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - var computableTensors = _this.inputs.slice(); - // To provide a better error msg. - var layersWithCompleteInput = []; - for (var _l = 0, depthKeys_2 = depthKeys; _l < depthKeys_2.length; _l++) { - var depth = depthKeys_2[_l]; - for (var _m = 0, _o = nodesByDepth[depth]; _m < _o.length; _m++) { - var node = _o[_m]; - var layer = node.outboundLayer; - if (layer != null) { - for (var _p = 0, _q = node.inputTensors; _p < _q.length; _p++) { - var x = _q[_p]; - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError("Graph disconnected: cannot obtain value for tensor " + x + - (" at layer \"" + layer.name + "\". ") + - 'The following previous layers were accessed without ' + - ("issue: " + layersWithCompleteInput)); - } - } - for (var _r = 0, _s = node.outputTensors; _r < _s.length; _r++) { - var x = _s[_r]; - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - // Set this.containerNodes and this.nodesByDepth. - _this.nodesByDepth = nodesByDepth; - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - var allNames = _this.layers.map(function (x) { return x.name; }); - var _loop_1 = function (name_1) { - var numOccurrences = allNames.filter(function (x) { return x === name_1; }).length; - if (numOccurrences !== 1) { - throw new RuntimeError("The name \"" + name_1 + "\" is used " + numOccurrences + " times " + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - }; - for (var _t = 0, allNames_1 = allNames; _t < allNames_1.length; _t++) { - var name_1 = allNames_1[_t]; - _loop_1(name_1); - } - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - _this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - _this.inboundNodes = []; - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: _this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: _this.inputs, - outputTensors: _this.outputs, - inputMasks: _this.inputs.map(function (x) { return null; }), - outputMasks: _this.outputs.map(function (x) { return null; }), - inputShapes: _this.inputs.map(function (x) { return x.shape; }), - outputShapes: _this.outputs.map(function (x) { return x.shape; }) - }); - _this.built = true; - _this._refCount = 1; // The ref count of a container always start at 1. - return _this; - } - Container.prototype.assertNotDisposed = function () { - if (this._refCount === 0) { - throw new Error("Container '" + this.name + "' is already disposed."); - } - }; - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - Container.prototype.dispose = function () { - this.assertNotDisposed(); - var result = { refCountAfterDispose: null, numDisposedVariables: 0 }; - if (--this._refCount === 0) { - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (var _b = 0, _c = this.internalContainerRefs; _b < _c.length; _b++) { - var container = _c[_b]; - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - }; - Object.defineProperty(Container.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this.layers.forEach(function (layer) { - // tslint:disable-next-line:no-any - layer._trainableWeights - .forEach(function (w) { return w.trainable = trainable; }); - }); - this.trainable_ = trainable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "trainableWeights", { - get: function () { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - if (!this.trainable) { - return []; - } - var weights = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - weights = weights.concat(layer.trainableWeights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "nonTrainableWeights", { - get: function () { - var weights = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - weights.push.apply(weights, layer.nonTrainableWeights); - } - if (!this.trainable) { - var trainableWeights = []; - for (var _b = 0, _c = this.layers; _b < _c.length; _b++) { - var layer = _c[_b]; - trainableWeights.push.apply(trainableWeights, layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "weights", { - get: function () { - return this.trainableWeights.concat(this.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - Container.prototype.loadWeights = function (weights, strict) { - if (strict === void 0) { strict = true; } - var nameToWeight = {}; - var totalWeightsCount = 0; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - for (var _b = 0, _c = layer.weights; _b < _c.length; _b++) { - var weight = _c[_b]; - if (nameToWeight[weight.originalName] != null) { - throw new ValueError("Duplicate weight name: " + weight.originalName); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - var weightValueTuples = []; - for (var name_2 in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - var validatedName = name_2; - if (nameToWeight[name_2] == null) { - var tokens = name_2.split('/'); - var shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name_2]]); - } - else if (strict) { - throw new ValueError("Provided weight data has no target variable: " + name_2); - } - delete nameToWeight[validatedName]; - } - if (strict) { - // Check that all weights are set. - var unsetNames = []; - for (var name_3 in nameToWeight) { - unsetNames.push(name_3); - } - if (unsetNames.length > 0) { - throw new ValueError(unsetNames.length + " of " + totalWeightsCount + " weights are not set: " + - ("" + unsetNames)); - } - } - batchSetValue(weightValueTuples); - }; - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - Container.prototype.updatedConfig = function () { - var theConfig = this.getConfig(); - var modelConfig = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = "tfjs-layers " + version; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - }; - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - Container.prototype.toJSON = function (unused, returnString) { - if (returnString === void 0) { returnString = true; } - var modelConfig = convertTsToPythonic(this.updatedConfig()); - return returnString ? JSON.stringify(modelConfig) : modelConfig; - }; - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - Container.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = toList(inputs); - var feedDict = new FeedDict(); - for (var i = 0; i < _this.inputs.length; ++i) { - feedDict.add(_this.inputs[i], inputs[i]); - } - return execute(_this.outputs, feedDict, kwargs); - }); - }; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - Container.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - inputs = toList(inputs); - var masks; - if (mask == null) { - masks = pyListRepeat(null, inputs.length); - } - else { - masks = toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return _this.runInternalGraph(inputs, masks)[1]; - }); - }; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - Container.prototype.computeOutputShape = function (inputShape) { - var inputShapes = normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError("Invalid inputShape argument " + inputShape + ": " + - ("model has " + this.inputLayers.length + " tensor inputs.")); - } - // TODO(michaelterry): Add caching - var layersToOutputShapes = {}; - for (var i = 0; i < inputShapes.length; i++) { - var layer = this.inputLayers[i]; - var inputShape_1 = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - var shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape_1; - } - var depthKeys = Object.keys(this.nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (var _i = 0, depthKeys_3 = depthKeys; _i < depthKeys_3.length; _i++) { - var depth = depthKeys_3[_i]; - var nodes = this.nodesByDepth[depth]; - for (var _a = 0, nodes_1 = nodes; _a < nodes_1.length; _a++) { - var node = nodes_1[_a]; - // This is always a single layer, never a list. - var layer = node.outboundLayer; - if (this.inputLayers.map(function (x) { return x.id; }).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - var inputShapes_1 = []; - for (var j = 0; j < node.inboundLayers.length; j++) { - var inboundLayer = node.inboundLayers[j]; - var nodeIndex_2 = node.nodeIndices[j]; - var tensorIndex = node.tensorIndices[j]; - var shapeKey = inboundLayer.name + "_" + nodeIndex_2 + "_" + tensorIndex; - var inputShape_2 = layersToOutputShapes[shapeKey]; - inputShapes_1.push(inputShape_2); - } - var outputShape = layer.computeOutputShape(singletonOrArray(inputShapes_1)); - var outputShapes_1 = normalizeShapeList(outputShape); - var nodeIndex = layer.inboundNodes.indexOf(node); - for (var j = 0; j < outputShapes_1.length; j++) { - var shapeKey = layer.name + "_" + nodeIndex + "_" + j; - layersToOutputShapes[shapeKey] = outputShapes_1[j]; - } - } - } - } - // Read final output shapes from layersToOutputShapes. - var outputShapes = []; - var outputShapeKeys = []; - for (var i = 0; i < this.outputLayers.length; i++) { - var layer = this.outputLayers[i]; - var nodeIndex = this.outputLayersNodeIndices[i]; - var tensorIndex = this.outputLayersTensorIndices[i]; - var shapeKey = layer.name + "_" + nodeIndex + "_" + tensorIndex; - outputShapeKeys.push(shapeKey); - } - for (var i = 0; i < outputShapeKeys.length; i++) { - var key = outputShapeKeys[i]; - assert$1(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - // TODO(michaelterry): Update cache - return singletonOrArray(outputShapes); - }; - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - Container.prototype.runInternalGraph = function (inputs, masks) { - if (masks == null) { - masks = pyListRepeat(null, inputs.length); - } - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - var tensorMap = {}; - for (var i = 0; i < this.inputs.length; ++i) { - var x = this.inputs[i]; - var y = inputs[i]; - var mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - var depthKeys = Object.keys(this.nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - for (var _i = 0, depthKeys_4 = depthKeys; _i < depthKeys_4.length; _i++) { - var depth = depthKeys_4[_i]; - var nodes = this.nodesByDepth[depth]; - for (var _a = 0, nodes_2 = nodes; _a < nodes_2.length; _a++) { - var node = nodes_2[_a]; - // This is always a single layer, never a list. - var layer = node.outboundLayer; - var referenceInputTensors = node.inputTensors; - var referenceOutputTensors = node.outputTensors; - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - var computedData = new Array(); - for (var _b = 0, referenceInputTensors_1 = referenceInputTensors; _b < referenceInputTensors_1.length; _b++) { - var x = referenceInputTensors_1[_b]; - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - var kwargs = {}; - var computedTensors = void 0; - var computedMasks = void 0; - var outputTensors_1 = void 0; - var outputMasks_1 = void 0; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - var _c = computedData[0], computedTensor = _c[0], computedMask = _c[1]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors_1 = - toList(layer.call(computedTensor, kwargs)); - outputMasks_1 = toList(layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } - else { - computedTensors = computedData.map(function (x) { return x[0]; }); - computedMasks = computedData.map(function (x) { return x[1]; }); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors_1 = - toList(layer.call(computedTensors, kwargs)); - outputMasks_1 = toList(layer.computeMask(computedTensors, computedMasks)); - } - if (layer.activityRegularizer) { - throw new NotImplementedError('LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - // Update tensor map. - for (var i = 0; i < referenceOutputTensors.length; ++i) { - var x = referenceOutputTensors[i]; - var y = outputTensors_1[i]; - var mask = outputMasks_1[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - var outputTensors = []; - var outputMasks = []; - var outputShapes = []; - for (var _d = 0, _e = this.outputs; _d < _e.length; _d++) { - var x = _e[_d]; - assert$1(x.id in tensorMap, "Could not compute output " + x.name + " : " + x.id); - var _f = tensorMap[x.id], tensor = _f[0], mask = _f[1]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - }; - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - Container.prototype.buildNodeConversionMap = function (layers) { - var nodeConversionMap = {}; - var keptNodes; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - keptNodes = layer instanceof Container ? 1 : 0; - for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - var nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - }; - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - Container.prototype.getLayer = function (name, index) { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError("Was asked to retrieve layer at index " + index + ", but model only " + - ("has " + this.layers.length + " layer(s).")); - } - else { - return this.layers[index]; - } - } - else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer.name === name) { - return layer; - } - } - throw new ValueError("No such layer: " + name); - }; - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - Container.prototype.calculateLosses = function () { - var _this = this; - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tfc.tidy(function () { - var losses = []; - for (var _i = 0, _a = _this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - for (var nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (_this.containerNodes.has(nodeKey)) { - losses.push.apply(losses, layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - }; - Container.prototype.getConfig = function () { - var config = { name: this.name }; - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - var nodeConversionMap = this.buildNodeConversionMap(this.layers); - // Serialize and save the layers in layerConfigs - var layerConfigs = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var layerClassName = layer.getClassName(); - var layerConfig = layer.getConfig(); - var filteredInboundNodes = []; - for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - var node = layer.inboundNodes[originalNodeIndex]; - var nodeKey = Container.nodeKey(layer, originalNodeIndex); - var kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } - catch (err) { - console.warn("Layer " + layer.name + " was passed " + - "non-serializable keyword arguments: " + - (node.callArgs + ". They will not be included ") + - "in the serialized model (and thus will be " + - "missing at deserialization time)."); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - var nodeData = []; - for (var i = 0; i < node.inboundLayers.length; i++) { - var inboundLayer = node.inboundLayers[i]; - var nodeIndex = node.nodeIndices[i]; - var tensorIndex = node.tensorIndices[i]; - var nodeKey_1 = Container.nodeKey(inboundLayer, nodeIndex); - var newNodeIndex = nodeConversionMap[nodeKey_1]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - var dict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - var modelInputs = []; - for (var i = 0; i < this.inputLayers.length; i++) { - var layer = this.inputLayers[i]; - var nodeIndex = this.inputLayersNodeIndices[i]; - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - var newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - var tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - var modelOutputs = []; - for (var i = 0; i < this.outputLayers.length; i++) { - var layer = this.outputLayers[i]; - var nodeIndex = this.outputLayersNodeIndices[i]; - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - var newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - var tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - }; - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - Container.fromConfig = function (cls, config, customObjects, fastWeightInit) { - if (fastWeightInit === void 0) { fastWeightInit = false; } - // Layer instances created during - // the graph reconstruction process - var createdLayers = {}; - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - var unprocessedNodes = {}; - function addUnprocessedNode(layer, nodeData) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } - else { - unprocessedNodes[layer.name].push(nodeData); - } - } - function processNode(layer, nodeData) { - var inputTensors = []; - var kwargs; - for (var _i = 0, nodeData_1 = nodeData; _i < nodeData_1.length; _i++) { - var inputData = nodeData_1[_i]; - var inboundLayerName = inputData[0]; - var inboundNodeIndex = inputData[1]; - var inboundTensorIndex = inputData[2]; - kwargs = inputData[3] == null ? - {} : - inputData[3]; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - var inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - var inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply(singletonOrArray(inputTensors), kwargs); // was ** kwargs - } - } - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData) { - var layerName = layerData['name']; - // Instantiate layer. - var layer = deserialize(layerData, config['customObjects'] != null ? - config['customObjects'] : - {}); - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - var inboundNodesData = layerData['inboundNodes']; - inboundNodesData.forEach(function (nodeData) { - if (!(nodeData instanceof Array)) { - throw new ValueError("Corrupted configuration, expected array for nodeData: " + nodeData); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - // First, we create all layers and enqueue nodes to be processed. - var name = config['name']; - var layersFromConfig = config['layers']; - for (var _i = 0, layersFromConfig_1 = layersFromConfig; _i < layersFromConfig_1.length; _i++) { - var layerData = layersFromConfig_1[_i]; - processLayer(layerData); - } - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!isObjectEmpty(unprocessedNodes)) { - for (var _a = 0, layersFromConfig_2 = layersFromConfig; _a < layersFromConfig_2.length; _a++) { - var layerData = layersFromConfig_2[_a]; - var layer = createdLayers[layerData['name']]; - if (layer.name in unprocessedNodes) { - var currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (var _b = 0, currentUnprocessedNodesForLayer_1 = currentUnprocessedNodesForLayer; _b < currentUnprocessedNodesForLayer_1.length; _b++) { - var nodeData = currentUnprocessedNodesForLayer_1[_b]; - processNode(layer, nodeData); - } - } - } - } - var inputTensors = []; - var outputTensors = []; - var inputLayersFromConfig = config['inputLayers']; - for (var _c = 0, inputLayersFromConfig_1 = inputLayersFromConfig; _c < inputLayersFromConfig_1.length; _c++) { - var layerData = inputLayersFromConfig_1[_c]; - var layerName = layerData[0]; - var nodeIndex = layerData[1]; - var tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - var layer = createdLayers[layerName]; - var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - var outputLayersFromConfig = config['outputLayers']; - for (var _d = 0, outputLayersFromConfig_1 = outputLayersFromConfig; _d < outputLayersFromConfig_1.length; _d++) { - var layerData = outputLayersFromConfig_1[_d]; - var layerName = layerData[0]; - var nodeIndex = layerData[1]; - var tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - var layer = createdLayers[layerName]; - var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({ inputs: inputTensors, outputs: outputTensors, name: name }); - }; - Object.defineProperty(Container.prototype, "stateful", { - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get: function () { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer.stateful) { - return true; - } - } - return false; - }, - enumerable: true, - configurable: true - }); - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - Container.prototype.resetStates = function () { - var _this = this; - tfc.tidy(function () { - _this.layers.forEach(function (layer) { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - }; - return Container; - }(Layer)); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) { - var numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(function (name) { return null; }); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } - else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [xWeight[outputNames[0]]]; - } - else { - return [xWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error("Provided " + weightType + " is an array of " + xWeight.length + " " + - ("element(s), but the model has " + numOutputs + " outputs. ") + - "Make sure a set of weights is provided for each model output."); - } - return xWeight; - } - else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof xWeight[Object.keys(xWeight)[0]] === - 'object') { - var output_1 = []; - outputNames.forEach(function (outputName) { - if (outputName in xWeight) { - output_1.push(xWeight[outputName]); - } - else { - output_1.push(null); - } - }); - return output_1; - } - else { - throw new Error("The model has multiple (" + numOutputs + ") outputs, " + - ("so " + weightType + " must be either an array with ") + - (numOutputs + " elements or an object with " + outputNames + " keys. ") + - ("Provided " + weightType + " not understood: " + JSON.stringify(xWeight))); - } - } - /** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ - function standardizeClassWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight'); - } - /** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ - function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) { - return __awaiter(this, void 0, void 0, function () { - var yClasses, yClassIndices, _a, _b, classSampleWeight_1; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - if (!(classWeight != null)) return [3 /*break*/, 2]; - yClasses = tfc.tidy(function () { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone(); - } - else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - var axis = 1; - return y.argMax(axis); - } - else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } - else { - throw new Error("Encountered unexpected last-dimension size (" + y.shape[1] + ") " + - "during handling of class weights. The size is expected to be " + - ">= 1."); - } - } - else { - throw new Error("Unexpected rank of target (y) tensor (" + y.rank + ") during " + - "handling of class weights. The rank is expected to be 1 or 2."); - } - }); - _b = (_a = Array).from; - return [4 /*yield*/, yClasses.data()]; - case 1: - yClassIndices = _b.apply(_a, [_c.sent()]); - tfc.dispose(yClasses); - classSampleWeight_1 = []; - yClassIndices.forEach(function (classIndex) { - if (classWeight[classIndex] == null) { - throw new Error("classWeight must contain all classes in the training data. " + - ("The class " + classIndex + " exists in the data but not in ") + - "classWeight"); - } - else { - classSampleWeight_1.push(classWeight[classIndex]); - } - }); - return [2 /*return*/, tfc.tensor1d(classSampleWeight_1, 'float32')]; - case 2: return [2 /*return*/, null]; - } - }); - }); - } - /** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ - function computeWeightedLoss(losses, sampleWeights) { - return tfc.mul(losses, sampleWeights); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // Default batch size used during tensor-based validation. - var DEFAULT_VALIDATION_BATCH_SIZE = 32; - /** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ - function standardizeDataIteratorOutput( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, iteratorOut) { - var xs; - var ys; - var iteratorOutObj = iteratorOut; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - tfc.util.assert(xs != null && ys != null, function () { return 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - ("" + iteratorOut); }); - var flattenedXs = flattenTensorOrArrayOrMap('input', model.inputNames, xs); - var flattenedYs = flattenTensorOrArrayOrMap('output', model.outputNames, ys); - var batchSize = flattenedXs[0].shape[0]; - tfc.util.assert(flattenedXs.length === model.inputs.length, function () { return "LayersModel has " + model.inputs.length + " inputs, but the dataset " + - ("provides " + flattenedXs.length + " inputs. (Expected input keys: ") + - (JSON.stringify(model.inputNames) + ")"); }); - tfc.util.assert(flattenedYs.length === model.outputs.length, function () { - return "LayersModel has " + model.outputs.length + " outputs, but the dataset " + - ("provides " + flattenedYs.length + " outputs. (Expected output keys: ") + - (JSON.stringify(model.outputNames) + ")"); - }); - var _loop_1 = function (xIndex) { - tfc.util.assert(flattenedXs[xIndex].shape[0] === batchSize, function () { return "Batch size mismatch: input " + - (model.inputNames[xIndex] + " has " + flattenedXs[xIndex].shape[0] + "; ") + - ("expected " + batchSize + " based on input " + model.inputNames[0] + "."); }); - }; - for (var xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - _loop_1(xIndex); - } - var _loop_2 = function (yIndex) { - tfc.util.assert(flattenedYs[yIndex].shape[0] === batchSize, function () { return "Batch size mismatch: output " + - (model.outputNames[yIndex] + " has " + flattenedYs[yIndex].shape[0] + "; ") + - ("expected " + batchSize + " based on input " + model.inputNames[0] + "."); }); - }; - for (var yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - _loop_2(yIndex); - } - return { xs: flattenedXs, ys: flattenedYs }; - } - function flattenTensorOrArrayOrMap(inputOrOutput, names, values) { - if (values instanceof tfc.Tensor) { - return [values]; - } - else if (Array.isArray(values)) { - tfc.util.assert(values.length === names.length, function () { return "Received an array of " + values.length + " Tensors, but expected " + names.length + " to match the " + inputOrOutput + " keys " + names + "."; }); - return values; - } - else { - var result = []; - // Check that all the required keys are available. - for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_1 = names_1[_i]; - if (values[name_1] == null) { - throw new ValueError("The feature data generated by the dataset lacks the required " + - (inputOrOutput + " key '" + name_1 + "'.")); - } - result.push(values[name_1]); - } - return result; - } - } - function standardizeTensorValidationData(data) { - if (data.length === 3) { - throw new NotImplementedError('Validation with sample weights is not implemented yet.'); - } - return { xs: data[0], ys: data[1] }; - } - function fitDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, dataset, args) { - return __awaiter(this, void 0, void 0, function () { - var hasBatchesPerEpoch, doValidation, valXs, valYs, validationData, trainFunction, outLabels, callbackMetrics, callbacks, verbose, _a, callbackList, history_1, epoch, dataIterator, epochLogs, stepsDone, batchIndex, iteratorOut, _b, xs, ys, batchLogs, sampleWeights, standardClassWeights, i, _c, _d, ins, outs, i, label, out, valOuts, _e, i; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - hasBatchesPerEpoch = args.batchesPerEpoch != null; - tfc.util.assert(model.optimizer != null, function () { return 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'; }); - tfc.util.assert(args != null, function () { return "For fitDataset(), the 2nd argument (config) is required, " + - "but it is not provided in this call."; }); - tfc.util.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), function () { return "For fitDataset(), config.epochs is expected to be a positive " + - ("integer, but got " + args.epochs); }); - tfc.util.assert(!hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), function () { return "For fitDataset(), config.batchesPerEpoch is expected to be a " + - ("positive integer if specified, but got " + args.batchesPerEpoch); }); - tfc.util.assert( - // tslint:disable-next-line:no-any - args['validationSplit'] == null, function () { return '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'; }); - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - _f.label = 1; - case 1: - _f.trys.push([1, , 26, 27]); - doValidation = args.validationData != null; - valXs = void 0; - valYs = void 0; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - tfc.util.assert(args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), function () { return "For fitDataset() with dataset-based validation, " + - "config.validationBatches is expected not to be provided, " + - "or to be a positive integer, " + - ("but got " + args.validationBatches); }); - } - else { - validationData = standardizeTensorValidationData(args.validationData); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - trainFunction = model.makeTrainFunction(); - outLabels = model.getDedupedMetricsNames(); - callbackMetrics = void 0; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); - } - else { - callbackMetrics = outLabels.slice(); - } - callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - verbose = args.verbose == null ? 1 : args.verbose; - _a = configureCallbacks(callbacks, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics), callbackList = _a.callbackList, history_1 = _a.history; - callbackList.setModel(model); - model.history = history_1; - return [4 /*yield*/, callbackList.onTrainBegin()]; - case 2: - _f.sent(); - model.stopTraining_ = false; - epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - return [4 /*yield*/, dataset.iterator()]; - case 3: - dataIterator = _f.sent(); - _f.label = 4; - case 4: - if (!(epoch < args.epochs)) return [3 /*break*/, 23]; - epochLogs = {}; - return [4 /*yield*/, callbackList.onEpochBegin(epoch)]; - case 5: - _f.sent(); - stepsDone = 0; - batchIndex = 0; - if (!!hasBatchesPerEpoch) return [3 /*break*/, 7]; - return [4 /*yield*/, dataset.iterator()]; - case 6: - dataIterator = _f.sent(); - _f.label = 7; - case 7: - if (!(hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true)) return [3 /*break*/, 21]; - return [4 /*yield*/, dataIterator.next()]; - case 8: - iteratorOut = _f.sent(); - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn('You provided `batchesPerEpoch` as ' + - (args.batchesPerEpoch + ", ") + - 'but your dataset iterator ran out of data after ' + - (stepsDone + " batches; ") + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - (args.batchesPerEpoch * args.epochs + " batches). ") + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - return [3 /*break*/, 21]; - } - if (!(iteratorOut.value != null)) return [3 /*break*/, 15]; - _b = standardizeDataIteratorOutput(model, iteratorOut.value), xs = _b.xs, ys = _b.ys; - batchLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - return [4 /*yield*/, callbackList.onBatchBegin(batchIndex, batchLogs)]; - case 9: - _f.sent(); - sampleWeights = []; - if (!(args.classWeight != null)) return [3 /*break*/, 13]; - standardClassWeights = standardizeClassWeights(args.classWeight, model.outputNames); - i = 0; - _f.label = 10; - case 10: - if (!(i < standardClassWeights.length)) return [3 /*break*/, 13]; - _d = (_c = sampleWeights).push; - return [4 /*yield*/, standardizeWeights(ys[i], null, standardClassWeights[i])]; - case 11: - _d.apply(_c, [_f.sent()]); - _f.label = 12; - case 12: - ++i; - return [3 /*break*/, 10]; - case 13: - ins = xs.concat(ys).concat(sampleWeights); - outs = trainFunction(ins); - tfc.dispose(ins); - for (i = 0; i < outLabels.length; ++i) { - label = outLabels[i]; - out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - } - return [4 /*yield*/, callbackList.onBatchEnd(batchIndex, batchLogs)]; - case 14: - _f.sent(); - disposeTensorsInLogs(batchLogs); - batchIndex++; - stepsDone++; - _f.label = 15; - case 15: - if (!(hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done)) return [3 /*break*/, 20]; - if (!doValidation) return [3 /*break*/, 19]; - valOuts = void 0; - if (!isDatasetObject(args.validationData)) return [3 /*break*/, 17]; - _e = toList; - return [4 /*yield*/, model.evaluateDataset(args.validationData, { batches: args.validationBatches })]; - case 16: - valOuts = _e.apply(void 0, [_f.sent()]); - return [3 /*break*/, 18]; - case 17: - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - _f.label = 18; - case 18: - for (i = 0; i < model.metricsNames.length; ++i) { - epochLogs["val_" + model.metricsNames[i]] = valOuts[i]; - } - _f.label = 19; - case 19: - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - return [3 /*break*/, 21]; - case 20: - if (model.stopTraining_) { - return [3 /*break*/, 21]; - } - return [3 /*break*/, 7]; - case 21: return [4 /*yield*/, callbackList.onEpochEnd(epoch, epochLogs)]; - case 22: - _f.sent(); - epoch++; - if (model.stopTraining_) { - return [3 /*break*/, 23]; - } - return [3 /*break*/, 4]; - case 23: return [4 /*yield*/, callbackList.onTrainEnd()]; - case 24: - _f.sent(); - return [4 /*yield*/, model.history.syncData()]; - case 25: - _f.sent(); - return [2 /*return*/, model.history]; - case 26: - model.isTraining = false; - return [7 /*endfinally*/]; - case 27: return [2 /*return*/]; - } - }); - }); - } - /** Helper function that determines number of steps (batches) per epoch. */ - function getStepsPerEpoch(dataset, args) { - // Attempt to determine # of batches in an epoch. - var stepsPerEpoch = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } - else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; - } - // Check if provided object is a Dataset object by checking its .iterator - // element. - function isDatasetObject(dataset) { - return (typeof dataset.iterator === 'function'); - } - // Check if provided object is a LazyIterator object by checking it's .next - // element. - function isLazyIteratorObject(iterator) { - return (typeof iterator.next === 'function'); - } - function evaluateDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model, dataset, args) { - return __awaiter(this, void 0, void 0, function () { - var hasBatches, f, outs, dataIterator, _a, numExamples, batch, _loop_3, state_1, i, oldScalar; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - args = args || {}; - hasBatches = args.batches != null; - f = model.testFunction; - outs = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - tfc.util.assert(!hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), function () { return 'Test loop expects `batches` to be a positive integer, but ' + - ("received " + JSON.stringify(args.batches)); }); - if (!isLazyIteratorObject(dataset)) return [3 /*break*/, 1]; - _a = dataset; - return [3 /*break*/, 3]; - case 1: return [4 /*yield*/, dataset.iterator()]; - case 2: - _a = _b.sent(); - _b.label = 3; - case 3: - dataIterator = _a; - numExamples = 0; - batch = 0; - _loop_3 = function () { - var iteratorOut; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, dataIterator.next()]; - case 1: - iteratorOut = _a.sent(); - outs = tfc.tidy(function () { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - var _a = standardizeDataIteratorOutput(model, iteratorOut.value), xs = _a.xs, ys = _a.ys; - var xsAndYs_1 = xs.concat(ys); - var batchOuts = tfc.tidy(function () { return f(xsAndYs_1); }); - tfc.dispose(xsAndYs_1); - if (batch === 0) { - for (var i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - var batchSize_1 = xsAndYs_1[0].shape[0]; - var _loop_4 = function (i) { - var batchOut = batchOuts[i]; - var oldScalar = outs[i]; - outs[i] = - tfc.tidy(function () { return tfc.add(outs[i], tfc.mul(batchSize_1, batchOut)); }); - if (batch > 0) { - tfc.dispose(oldScalar); - } - }; - for (var i = 0; i < batchOuts.length; ++i) { - _loop_4(i); - } - tfc.dispose(batchOuts); - numExamples += batchSize_1; - ++batch; - } - return outs; - }); - if (iteratorOut.done) { - if (hasBatches) { - console.warn('Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - ("batches (in this case, " + args.batches + " batches). ") + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - _b.label = 4; - case 4: - if (!(hasBatches ? batch < args.batches : true)) return [3 /*break*/, 6]; - return [5 /*yield**/, _loop_3()]; - case 5: - state_1 = _b.sent(); - if (state_1 === "break") - return [3 /*break*/, 6]; - return [3 /*break*/, 4]; - case 6: - for (i = 0; i < outs.length; ++i) { - oldScalar = outs[i]; - outs[i] = tfc.div(outs[i], numExamples); - tfc.dispose(oldScalar); - } - return [2 /*return*/, singletonOrArray(outs)]; - } - }); - }); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function checkBatchSize(batchSize) { - tfc.util.assert(batchSize > 0 && Number.isInteger(batchSize), function () { return "batchSize is required to be a positive integer, but got " + batchSize; }); - } - /** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ - function sliceArrays(arrays, start, stop) { - if (arrays == null) { - return [null]; - } - else if (Array.isArray(arrays)) { - return arrays.map(function (array) { return sliceAlongFirstAxis(array, start, stop - start); }); - } - else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } - } - /** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ - function sliceArraysByIndices(arrays, indices) { - return tfc.tidy(function () { - if (arrays == null) { - return null; - } - else if (Array.isArray(arrays)) { - return arrays.map(function (array) { return sliceArraysByIndices(array, indices); }); - } - else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather$1(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); - } - /** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ - function makeBatches(size, batchSize) { - var output = []; - var batchStart = 0; - var batchEnd = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; - } - /** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ - function fitLoop( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model, f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { - return __awaiter(this, void 0, void 0, function () { - var doValidation, numTrainSamples, indexArray, _a, callbackList, history, _loop_1, epoch, state_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - numTrainSamples = model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - if (verbose == null) { - verbose = 1; - } - _a = configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics), callbackList = _a.callbackList, history = _a.history; - callbackList.setModel(model); - model.history = history; - return [4 /*yield*/, callbackList.onTrainBegin()]; - case 1: - _b.sent(); - model.stopTraining_ = false; - _loop_1 = function (epoch) { - var epochLogs, epochIndexArray1D_1, batches_1, _loop_2, batchIndex, state_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, callbackList.onEpochBegin(epoch)]; - case 1: - _a.sent(); - epochLogs = {}; - if (!(stepsPerEpoch != null)) return [3 /*break*/, 2]; - throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); - case 2: - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } - else if (shuffle) { - tfc.util.shuffle(indexArray); - } - epochIndexArray1D_1 = tfc.tensor1d(indexArray); - batches_1 = makeBatches(numTrainSamples, batchSize); - _loop_2 = function (batchIndex) { - var batchLogs; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - batchLogs = {}; - return [4 /*yield*/, callbackList.onBatchBegin(batchIndex, batchLogs)]; - case 1: - _a.sent(); - tfc.tidy(function () { - var batchStart = batches_1[batchIndex][0]; - var batchEnd = batches_1[batchIndex][1]; - var batchIds = sliceAlongFirstAxis(epochIndexArray1D_1, batchStart, batchEnd - batchStart); - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - var insBatch = sliceArraysByIndices(ins, batchIds); - var outs = f(insBatch); - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - if (batchIndex === batches_1.length - 1) { // Last batch. - if (doValidation) { - var valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var out = valOuts[i]; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - return [4 /*yield*/, callbackList.onBatchEnd(batchIndex, batchLogs)]; - case 2: - _a.sent(); - disposeTensorsInLogs(batchLogs); - if (model.stopTraining_) { - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - batchIndex = 0; - _a.label = 3; - case 3: - if (!(batchIndex < batches_1.length)) return [3 /*break*/, 6]; - return [5 /*yield**/, _loop_2(batchIndex)]; - case 4: - state_2 = _a.sent(); - if (state_2 === "break") - return [3 /*break*/, 6]; - _a.label = 5; - case 5: - ++batchIndex; - return [3 /*break*/, 3]; - case 6: - epochIndexArray1D_1.dispose(); - _a.label = 7; - case 7: - // TODO(cais): Run validation at the end of the epoch. - return [4 /*yield*/, callbackList.onEpochEnd(epoch, epochLogs)]; - case 8: - // TODO(cais): Run validation at the end of the epoch. - _a.sent(); - if (model.stopTraining_) { - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - epoch = initialEpoch; - _b.label = 2; - case 2: - if (!(epoch < epochs)) return [3 /*break*/, 5]; - return [5 /*yield**/, _loop_1(epoch)]; - case 3: - state_1 = _b.sent(); - if (state_1 === "break") - return [3 /*break*/, 5]; - _b.label = 4; - case 4: - ++epoch; - return [3 /*break*/, 2]; - case 5: return [4 /*yield*/, callbackList.onTrainEnd()]; - case 6: - _b.sent(); - return [4 /*yield*/, model.history.syncData()]; - case 7: - _b.sent(); - return [2 /*return*/, model.history]; - } - }); - }); - } - function fitTensors( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model, x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - var inputs, targets, inputValX, inputValY, valX, valY, sampleWeights, batchSize, checkBatchAxis, standardizedOuts, doValidation, valIns, checkBatchAxis_1, valStandardized, splitAt, originalBatchSize, ins, trainFunction, outLabels, valFunction, callbackMetrics, callbacks, out; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - _a.label = 1; - case 1: - _a.trys.push([1, , 7, 8]); - batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - checkBatchAxis = false; - return [4 /*yield*/, model.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize)]; - case 2: - standardizedOuts = _a.sent(); - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - doValidation = false; - valIns = void 0; - if (!(args.validationData != null && args.validationData.length > 0)) return [3 /*break*/, 4]; - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } - else if (args.validationData.length === 3) { - throw new NotImplementedError('validationData including sample weights is not supported yet.'); - } - else { - throw new ValueError("When passing validation data, it must contain 2 (valX, valY) " + - "or 3 (valX, valY, valSampleWeight) items; " + - (args.validationData + " is invalid.")); - } - checkBatchAxis_1 = true; - return [4 /*yield*/, model.standardizeUserData(inputValX, inputValY, null, /** Unused sample weights. */ null, /** Unused class weights. */ checkBatchAxis_1, batchSize)]; - case 3: - valStandardized = _a.sent(); - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - return [3 /*break*/, 5]; - case 4: - if (args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize); - inputs = sliceArrays(inputs, 0, splitAt); - valY = sliceArrays(targets, splitAt, originalBatchSize); - targets = sliceArrays(targets, 0, splitAt); - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - _a.label = 5; - case 5: - ins = inputs.concat(targets).concat(sampleWeights); - model.checkTrainableWeightsConsistency(); - trainFunction = model.makeTrainFunction(); - outLabels = model.getDedupedMetricsNames(); - valFunction = void 0; - callbackMetrics = void 0; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); - } - else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - return [4 /*yield*/, fitLoop(model, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null)]; - case 6: - out = _a.sent(); - return [2 /*return*/, out]; - case 7: - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX, inputValX); - disposeNewTensors(valY, inputValY); - if (sampleWeights != null) { - tfc.dispose(sampleWeights); - } - return [7 /*endfinally*/]; - case 8: return [2 /*return*/]; - } - }); - }); - } - /** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ - function ensureTensorsRank2OrHigher(tensors) { - var outs = []; - if (tensors instanceof tfc.Tensor) { - tensors = [tensors]; - } - // Make Tensors at least 2D. - for (var i = 0; i < tensors.length; ++i) { - var tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims$1(tensor, 1)); - } - else if (tensor.rank === 0) { - throw new Error('Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } - else { - outs.push(tensor); - } - } - return outs; - } - /** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ - // TODO(cais, kangyizhang): Deduplicate with tfjs-data. - function disposeNewTensors(tensors, refTensors) { - if (tensors == null) { - return; - } - var oldTensorIds = []; - if (refTensors instanceof tfc.Tensor) { - oldTensorIds.push(refTensors.id); - } - else if (Array.isArray(refTensors)) { - refTensors.forEach(function (t) { return oldTensorIds.push(t.id); }); - } - else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (var name_1 in refTensors) { - var oldTensor = refTensors[name_1]; - oldTensorIds.push(oldTensor.id); - } - } - var tensorsToDispose = []; - if (tensors instanceof tfc.Tensor) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } - else if (Array.isArray(tensors)) { - tensors.forEach(function (t) { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } - else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (var name_2 in tensors) { - var tensor = tensors[name_2]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - tensorsToDispose.forEach(function (t) { - if (!t.isDisposed) { - t.dispose(); - } - }); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ - function isDataTensor(x) { - return x instanceof tfc.Tensor; - } - /** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ - function isDataArray(x) { - return Array.isArray(x); - } - /** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ - function isDataDict(x) { - return !isDataTensor(x) && !isDataArray(x); - } - /** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ - function standardizeInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - if (exceptionPrefix === void 0) { exceptionPrefix = ''; } - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - var gotUnexpectedData = false; - if (isDataArray(data) && data.length > 0) { - gotUnexpectedData = true; - } - else if (isDataDict(data)) { - for (var key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } - else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError("Error when checking model " + exceptionPrefix + " expected no data, " + - ("but got " + data)); - } - } - return []; - } - if (data == null) { - return names.map(function (name) { return null; }); - } - var arrays; - if (isDataDict(data)) { - data = data; - arrays = []; - for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_1 = names_1[_i]; - if (data[name_1] == null) { - throw new ValueError("No data provided for \"" + name_1 + "\". Need data for each key in: " + - ("" + names)); - } - arrays.push(data[name_1]); - } - } - else if (isDataArray(data)) { - data = data; - if (data.length !== names.length) { - throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + - "Tensors that you are passing to your model is not the size the " + - ("model expected. Expected to see " + names.length + " Tensor(s), but ") + - ("instead got the following list of Tensor(s): " + data)); - } - arrays = data; - } - else { - data = data; - if (names.length > 1) { - throw new ValueError("The model " + exceptionPrefix + " expects " + names.length + " Tensor(s), " + - ("but only received one Tensor. Found: Tensor with shape " + data.shape)); - } - arrays = [data]; - } - arrays = ensureTensorsRank2OrHigher(arrays); - // Check shape compatibility. - if (shapes != null) { - for (var i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - var array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have " + shapes[i].length + " dimension(s). but got array with ") + - ("shape " + array.shape)); - } - for (var j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - var dim = array.shape[j]; - var refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have shape [" + shapes[i] + "], but got array with shape ") + - ("[" + array.shape + "].")); - } - } - } - } - return arrays; - } - /** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ - function checkArrayLengths(inputs, targets, weights) { - var setX = unique$1(inputs.map(function (input) { return input.shape[0]; })); - setX.sort(); - var setY = unique$1(targets.map(function (target) { return target.shape[0]; })); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError("All input Tensors (x) should have the same number of samples. " + - "Got array shapes: " + - ("" + JSON.stringify(inputs.map(function (input) { return input.shape; })))); - } - if (setY.length > 1) { - throw new ValueError("All target Tensors (y) should have the same number of samples. " + - "Got array shapes: " + - ("" + JSON.stringify(targets.map(function (target) { return target.shape; })))); - } - if (setX.length > 0 && setY.length > 0 && !tfc.util.arraysEqual(setX, setY)) { - throw new ValueError("Input Tensors should have the same number of samples as target " + - ("Tensors. Found " + setX[0] + " input sample(s) and " + setY[0] + " target ") + - "sample(s)."); - } - } - /** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ - function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { - // TODO(cais): Dedicated test coverage? - var keyLosses = [ - meanSquaredError, binaryCrossentropy, - categoricalCrossentropy - ]; - for (var i = 0; i < targets.length; ++i) { - var y = targets[i]; - var loss = lossFns[i]; - var shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError("You are passing a target array of shape " + y.shape + " while using " + - "a loss 'categorical_crossentropy'. 'categorical_crossentropy'" + - "expects targets to be binary matrices (1s and 0s) of shape " + - "[samples, classes]."); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - var slicedYShape = y.shape.slice(1); - var slicedShape = shape.slice(1); - for (var j = 0; j < slicedYShape.length; ++j) { - var targetDim = slicedYShape[j]; - var outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError("A target Tensor with shape " + y.shape + " was passed for an " + - ("output of shape " + shape + ", while using a loss function that ") + - "expects targets to have the same shape as the output."); - } - } - } - } - } - /** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ - function checkInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - if (exceptionPrefix === void 0) { exceptionPrefix = ''; } - var arrays; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + - "Tensors that you are passing to your model is not the size the " + - ("the model expected. Expected to see " + names.length + " Tensor(s),") + - (" but instead got " + data.length + " Tensors(s).")); - } - arrays = data; - } - else { - if (names.length > 1) { - throw new ValueError("The model expects " + names.length + " " + exceptionPrefix + " Tensors, " + - "but only received one Tensor. Found: array with shape " + - (JSON.stringify(data.shape) + ".")); - } - arrays = [data]; - } - if (shapes != null) { - for (var i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - var array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have " + shapes[i].length + " dimension(s), but got array with ") + - ("shape " + JSON.stringify(array.shape))); - } - for (var j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - var dim = array.shape[j]; - var refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + - (names[i] + " to have shape " + JSON.stringify(shapes[i]) + " but ") + - ("got array with shape " + JSON.stringify(array.shape) + ".")); - } - } - } - } - } - } - /** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ - function collectMetrics(metrics, outputNames) { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(function (name) { return []; }); - } - var wrappedMetrics; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } - else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics; - } - else { - throw new TypeError('Type of metrics argument not understood. Expected an string,' + - ("function, Array, or Object, found: " + metrics)); - } - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map(function (name) { return wrappedMetrics; }); - } - else { - // In this case, metrics is a dict. - var nestedMetrics = []; - for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { - var name_2 = outputNames_1[_i]; - var outputMetrics = wrappedMetrics.hasOwnProperty(name_2) ? wrappedMetrics[name_2] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } - } - var LAYERS_MODEL_FORMAT_NAME = 'layers-model'; - /** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - var LayersModel = /** @class */ (function (_super) { - __extends(LayersModel, _super); - function LayersModel(args) { - var _this = _super.call(this, args) || this; - _this.isTraining = false; - return _this; - } - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.summary = function (lineLength, positions, printFn) { - if (printFn === void 0) { printFn = console.log; } - if (!this.built) { - throw new ValueError("This model has never been called, thus its weights have not been " + - "created yet. So no summary can be displayed. Build the model " + - "first (e.g., by calling it on some test data)."); - } - printSummary(this, lineLength, positions, printFn); - }; - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.compile = function (args) { - var _this = this; - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - if (typeof args.optimizer === 'string') { - this.optimizer_ = getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } - else { - if (!(args.optimizer instanceof tfc.Optimizer)) { - throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer."); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - // Prepare loss functions. - var lossFunctions = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss; - for (var name_3 in args.loss) { - if (this.outputNames.indexOf(name_3) === -1) { - throw new ValueError("Unknown entry in loss dictionary: \"" + name_3 + "\". " + - ("Only expected the following keys: " + this.outputNames)); - } - } - for (var _i = 0, _a = this.outputNames; _i < _a.length; _i++) { - var name_4 = _a[_i]; - if (args.loss[name_4] == null) { - console.warn("Output \"" + name_4 + "\" is missing from loss dictionary. We assume " + - "this was done on purpose, and we will not be expecting data " + - ("to be passed to " + name_4 + " during training")); - } - lossFunctions.push(get(args.loss[name_4])); - } - } - else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError("When passing an Array as loss, it should have one entry per " + - ("model output. The model has " + this.outputs.length + " output(s), ") + - ("but you passed loss=" + args.loss + ".")); - } - var theLosses = args.loss; - lossFunctions = theLosses.map(function (l) { return get(l); }); - } - else { - var lossFunction_1 = get(args.loss); - this.outputs.forEach(function (_) { - lossFunctions.push(lossFunction_1); - }); - } - this.lossFunctions = lossFunctions; - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (var i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - var shape = this.internalOutputShapes[i]; - var name_5 = this.outputNames[i]; - this.feedOutputNames.push(name_5); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - var skipTargetIndices = []; - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', function () { - for (var i = 0; i < _this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - var weightedLoss = _this.lossFunctions[i]; - if (_this.outputs.length > 1) { - _this.metricsTensors.push([weightedLoss, i]); - _this.metricsNames.push(_this.outputNames[i] + '_loss'); - } - } - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - var nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - /** - * Helper function used in loop below. - */ - var appendMetric = function (outputIndex, metricName, metricTensor) { - if (_this.outputNames.length > 1) { - metricName = _this.outputNames[outputIndex] + '_' + metricName; - } - _this.metricsNames.push(metricName); - _this.metricsTensors.push([metricTensor, outputIndex]); - }; - nameScope('metric', function () { - var _loop_1 = function (i) { - if (skipTargetIndices.indexOf(i) !== -1) { - return "continue"; - } - var outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - // TODO(cais): Add optional arg `weights` to the following function. - var handleMetrics = function (metrics) { - var metricNamePrefix = ''; - var metricName; - var accFn; - var weightedMetricFn; - var _loop_2 = function (metric) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - var outputShape = _this.internalOutputShapes[i]; - if (outputShape[outputShape.length - 1] === 1 || - _this.lossFunctions[i] === binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = binaryAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = binaryCrossentropy$1; - } - } - else if (_this.lossFunctions[i] === - sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = sparseCategoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = sparseCategoricalCrossentropy$1; - } - } - else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = categoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = categoricalCrossentropy$1; - } - } - var suffix = void 0; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } - else { - var metricFn = get$1(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + getLossOrMetricName(metric); - } - // TODO(cais): Add weighting and masking to metricResult. - var metricResult; - nameScope(metricName, function () { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - }; - // TODO(cais): Use 'weights_' for weighted metrics. - for (var _i = 0, metrics_1 = metrics; _i < metrics_1.length; _i++) { - var metric = metrics_1[_i]; - _loop_2(metric); - } - }; - handleMetrics(outputMetrics); - }; - for (var i = 0; i < _this.outputs.length; ++i) { - _loop_1(i); - } - }); - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - }; - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - LayersModel.prototype.checkTrainableWeightsConsistency = function () { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn('Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - }; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.evaluate = function (x, y, args) { - if (args === void 0) { args = {}; } - var batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - var checkBatchAxis = true; - var standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - var ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - var f = this.testFunction; - var testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } - finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - }; - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.evaluateDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.makeTestFunction(); - return [2 /*return*/, evaluateDataset(this, dataset, args)]; - }); - }); - }; - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - LayersModel.prototype.checkNumSamples = function (ins, batchSize, steps, stepsName) { - if (stepsName === void 0) { stepsName = 'steps'; } - var numSamples; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError("If " + stepsName + " is set, batchSize must be null or undefined." + - ("Got batchSize = " + batchSize)); - } - } - else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } - else { - numSamples = ins.shape[0]; - } - } - else { - throw new ValueError("Either the input data should have a defined shape, or " + - (stepsName + " shoud be specified.")); - } - return numSamples; - }; - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - LayersModel.prototype.execute = function (inputs, outputs) { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError('`outputs` is an empty Array, which is not allowed.'); - } - var outputsIsArray = Array.isArray(outputs); - var outputNames = (outputsIsArray ? outputs : [outputs]); - var outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - // Format the input into a FeedDict. - var feedDict = new FeedDict(); - if (inputs instanceof tfc.Tensor) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError("The number of inputs provided (" + inputs.length + ") " + - "does not match the number of inputs of this model " + - ("(" + this.inputs.length + ").")); - } - for (var i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } - else { - for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) { - var input = _a[_i]; - var tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError("No value is provided for the model's input " + input.name); - } - feedDict.add(input, tensorValue); - } - } - // Run execution. - var executeOutputs = execute(outputSymbolicTensors, feedDict); - return outputsIsArray ? executeOutputs : executeOutputs[0]; - }; - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - LayersModel.prototype.retrieveSymbolicTensors = function (symbolicTensorNames) { - var outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); - var outputsRemaining = symbolicTensorNames.length; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; - var layerOutputNames = layerOutputs.map(function (output) { return output.name; }); - for (var i = 0; i < symbolicTensorNames.length; ++i) { - var index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining > 0) { - var remainingNames_1 = []; - outputSymbolicTensors.forEach(function (tensor, i) { - if (tensor == null) { - remainingNames_1.push(symbolicTensorNames[i]); - } - }); - throw new ValueError("Cannot find SymbolicTensors for output name(s): " + - ("" + JSON.stringify(remainingNames_1))); - } - return outputSymbolicTensors; - }; - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - LayersModel.prototype.predictLoop = function (ins, batchSize, verbose) { - var _this = this; - if (batchSize === void 0) { batchSize = 32; } - if (verbose === void 0) { verbose = false; } - return tfc.tidy(function () { - var numSamples = _this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); - } - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - var batches = makeBatches(numSamples, batchSize); - var outsBatches = _this.outputs.map(function (output) { return []; }); - var _loop_3 = function (batchIndex) { - var batchOuts = tfc.tidy(function () { - var batchStart = batches[batchIndex][0]; - var batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - var insBatch = sliceArrays(ins, batchStart, batchEnd); - // Construct the feeds for execute(); - var feeds = []; - if (Array.isArray(insBatch)) { - for (var i = 0; i < insBatch.length; ++i) { - feeds.push({ key: _this.inputs[i], value: insBatch[i] }); - } - } - else { - feeds.push({ key: _this.inputs[0], value: insBatch }); - } - var feedDict = new FeedDict(feeds); - return execute(_this.outputs, feedDict); - }); - batchOuts.forEach(function (batchOut, i) { return outsBatches[i].push(batchOut); }); - }; - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - _loop_3(batchIndex); - } - return singletonOrArray(outsBatches.map(function (batches) { return tfc.concat(batches, 0); })); - }); - }; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.predict = function (x, args) { - if (args === void 0) { args = {}; } - var xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - var batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } - finally { - disposeNewTensors(xsRank2OrHigher, x); - } - }; - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.predictOnBatch = function (x) { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - var batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - }; - LayersModel.prototype.standardizeUserDataXY = function (x, y, checkBatchAxis, batchSize) { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError('You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - var outputShapes = []; - for (var i = 0; i < this.feedOutputShapes.length; ++i) { - var outputShape = this.feedOutputShapes[i]; - var lossFn = this.feedLossFns[i]; - if (lossFn === sparseCategoricalCrossentropy) { - outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); - } - else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError("In a stateful network, you should only pass inputs with a " + - "number of samples that is divisible by the batch size " + - (batchSize + ". Found: " + x[0].shape[0] + " sample(s).")); - } - } - return [x, y]; - }; - LayersModel.prototype.standardizeUserData = function (x, y, sampleWeight, classWeight, checkBatchAxis, batchSize) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - return __awaiter(this, void 0, void 0, function () { - var _a, standardXs, standardYs, standardSampleWeights, classWeights, i, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - _a = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize), standardXs = _a[0], standardYs = _a[1]; - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - standardSampleWeights = null; - if (!(classWeight != null)) return [3 /*break*/, 4]; - classWeights = standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - i = 0; - _d.label = 1; - case 1: - if (!(i < classWeights.length)) return [3 /*break*/, 4]; - _c = (_b = standardSampleWeights).push; - return [4 /*yield*/, standardizeWeights(standardYs[i], null, classWeights[i])]; - case 2: - _c.apply(_b, [_d.sent()]); - _d.label = 3; - case 3: - ++i; - return [3 /*break*/, 1]; - case 4: - // TODO(cais): Deal with the case of model.stateful == true. - return [2 /*return*/, [standardXs, standardYs, standardSampleWeights]]; - } - }); - }); - }; - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - LayersModel.prototype.testLoop = function (f, ins, batchSize, verbose, steps) { - var _this = this; - if (verbose === void 0) { verbose = 0; } - return tfc.tidy(function () { - var numSamples = _this.checkNumSamples(ins, batchSize, steps, 'steps'); - var outs = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); - } - else { - var batches = makeBatches(numSamples, batchSize); - var indexArray = tfc.tensor1d(range(0, numSamples)); - for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - var batchStart = batches[batchIndex][0]; - var batchEnd = batches[batchIndex][1]; - var batchIds = sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - var insBatch = sliceArraysByIndices(ins, batchIds); - var batchOuts = f(insBatch); - if (batchIndex === 0) { - for (var i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - for (var i = 0; i < batchOuts.length; ++i) { - var batchOut = batchOuts[i]; - outs[i] = - tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut)); - } - } - for (var i = 0; i < outs.length; ++i) { - outs[i] = tfc.div(outs[i], numSamples); - } - } - return outs; - }); - }; - LayersModel.prototype.getDedupedMetricsNames = function () { - var outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - var dedupedOutLabels = []; - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var newLabel = label; - if (count(outLabels, label) > 1) { - var dupIndex = count(outLabels.slice(0, i), label); - newLabel += "_" + dupIndex; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - }; - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - LayersModel.prototype.makeTrainFunction = function () { - var _this = this; - return function (data) { - var lossValues = []; - var inputs = data.slice(0, _this.inputs.length); - var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); - var sampleWeights = data.slice(_this.inputs.length + _this.outputs.length, _this.inputs.length + _this.outputs.length * 2); - var metricsValues = []; - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - var totalLossFunction = function () { - var feeds = []; - for (var i = 0; i < _this.inputs.length; ++i) { - feeds.push({ key: _this.inputs[i], value: inputs[i] }); - } - var feedDict = new FeedDict(feeds); - var outputs = execute(_this.outputs, feedDict, { 'training': true }); - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - var totalLoss; - for (var i = 0; i < _this.lossFunctions.length; ++i) { - var lossFunction = _this.lossFunctions[i]; - var loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - // TODO(cais): push Scalar instead. - var meanLoss = tfc.mean(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - } - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (var i = 0; i < _this.metricsTensors.length; ++i) { - var weightedMetric = void 0; - if (_this.outputs.length > 1 && i < _this.outputs.length) { - weightedMetric = lossValues[i]; - } - else { - var metric = _this.metricsTensors[i][0]; - var outputIndex = _this.metricsTensors[i][1]; - weightedMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - } - tfc.keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - totalLoss = tfc.mean(totalLoss); - // Add regularizer penalties. - _this.calculateLosses().forEach(function (regularizerLoss) { - totalLoss = tfc.add(totalLoss, regularizerLoss); - }); - return totalLoss; - }; - var variables = _this.collectedTrainableWeights.map(function (param) { return param.read(); }); - var returnCost = true; - var totalLossValue = _this.optimizer_.minimize(totalLossFunction, returnCost, variables); - return [totalLossValue].concat(metricsValues); - }; - }; - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - LayersModel.prototype.makeTestFunction = function () { - var _this = this; - this.testFunction = function (data) { - return tfc.tidy(function () { - var valOutputs = []; - var totalLoss; - var inputs = data.slice(0, _this.inputs.length); - var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); - var feeds = []; - for (var i = 0; i < _this.inputs.length; ++i) { - feeds.push({ key: _this.inputs[i], value: inputs[i] }); - } - var feedDict = new FeedDict(feeds); - var outputs = execute(_this.outputs, feedDict); - // Compute total loss. - for (var i = 0; i < _this.lossFunctions.length; ++i) { - var lossFunction = _this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - var loss = tfc.mean(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (var i = 0; i < _this.metricsTensors.length; ++i) { - var metric = _this.metricsTensors[i][0]; - var outputIndex = _this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric); - } - return valOutputs; - }); - }; - }; - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.fit = function (x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, fitTensors(this, x, y, args)]; - }); - }); - }; - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.fitDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, fitDataset(this, dataset, args)]; - }); - }); - }; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.trainOnBatch = function (x, y) { - return __awaiter(this, void 0, void 0, function () { - var standardizeOut, inputs, targets, trainFunction, losses, lossValues, _i, losses_1, loss, v; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.standardizeUserData(x, y)]; - case 1: - standardizeOut = _a.sent(); - inputs = standardizeOut[0]; - targets = standardizeOut[1]; - trainFunction = this.makeTrainFunction(); - losses = trainFunction(inputs.concat(targets)); - lossValues = []; - _i = 0, losses_1 = losses; - _a.label = 2; - case 2: - if (!(_i < losses_1.length)) return [3 /*break*/, 5]; - loss = losses_1[_i]; - return [4 /*yield*/, loss.data()]; - case 3: - v = _a.sent(); - lossValues.push(v[0]); - _a.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: - tfc.dispose(losses); - return [2 /*return*/, singletonOrArray(lossValues)]; - } - }); - }); - }; - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - LayersModel.prototype.getNamedWeights = function (config) { - var namedWeights = []; - var trainableOnly = config != null && config.trainableOnly; - var weights = trainableOnly ? this.trainableWeights : this.weights; - var weightValues = this.getWeights(trainableOnly); - for (var i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); - } - return namedWeights; - }; - Object.defineProperty(LayersModel.prototype, "stopTraining", { - get: function () { - return this.stopTraining_; - }, - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set: function (stop) { - this.stopTraining_ = stop; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(LayersModel.prototype, "optimizer", { - get: function () { - return this.optimizer_; - }, - set: function (optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - }, - enumerable: true, - configurable: true - }); - LayersModel.prototype.dispose = function () { - var result = _super.prototype.dispose.call(this); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - var numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors; - } - return result; - }; - LayersModel.prototype.getLossIdentifiers = function () { - var lossNames; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss); - } - else if (Array.isArray(this.loss)) { - for (var _i = 0, _a = this.loss; _i < _a.length; _i++) { - var loss = _a[_i]; - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = this.loss.map(function (name) { return toSnakeCase(name); }); - } - else { - var outputNames = Object.keys(this.loss); - lossNames = {}; - var losses_2 = this.loss; - for (var _b = 0, outputNames_2 = outputNames; _b < outputNames_2.length; _b++) { - var outputName = outputNames_2[_b]; - if (typeof losses_2[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses_2[outputName]); - } - else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - }; - LayersModel.prototype.getMetricIdentifiers = function () { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(getLossOrMetricName(this.metrics))]; - } - else if (Array.isArray(this.metrics)) { - return this.metrics.map(function (metric) { return toSnakeCase(getLossOrMetricName(metric)); }); - } - else { - var metricsIdentifiers = {}; - for (var key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - }; - LayersModel.prototype.getTrainingConfig = function () { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - }; - LayersModel.prototype.loadTrainingConfig = function (trainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - var tsConfig = convertPythonicToTs(trainingConfig.optimizer_config); - var optimizer = deserialize(tsConfig); - var loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } - else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(function (lossEntry) { return toCamelCase(lossEntry); }); - } - else if (trainingConfig.loss != null) { - loss = {}; - for (var key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]); - } - } - var metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(function (metric) { return toCamelCase(metric); }); - } - else if (trainingConfig.metrics != null) { - metrics = {}; - for (var key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - this.compile({ loss: loss, metrics: metrics, optimizer: optimizer }); - }; - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - LayersModel.prototype.save = function (handlerOrURL, config) { - return __awaiter(this, void 0, void 0, function () { - var handlers, weightDataAndSpecs, returnString, unusedArg, modelConfig, modelArtifacts, includeOptimizer, weightType, _a, optimizerWeightData, optimizerWeightSpecs, _b, _c, checkSize; - var _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - if (typeof handlerOrURL === 'string') { - handlers = tfc.io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError("Cannot find any save handlers for URL '" + handlerOrURL + "'"); - } - else if (handlers.length > 1) { - throw new ValueError("Found more than one (" + handlers.length + ") save handlers for " + - ("URL '" + handlerOrURL + "'")); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError('LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - return [4 /*yield*/, tfc.io.encodeWeights(this.getNamedWeights(config))]; - case 1: - weightDataAndSpecs = _e.sent(); - returnString = false; - unusedArg = null; - modelConfig = this.toJSON(unusedArg, returnString); - modelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: "TensorFlow.js tfjs-layers v" + version, - convertedBy: null, - }; - includeOptimizer = config == null ? false : config.includeOptimizer; - if (!(includeOptimizer && this.optimizer != null)) return [3 /*break*/, 4]; - modelArtifacts.trainingConfig = this.getTrainingConfig(); - weightType = 'optimizer'; - _c = (_b = tfc.io).encodeWeights; - return [4 /*yield*/, this.optimizer.getWeights()]; - case 2: return [4 /*yield*/, _c.apply(_b, [_e.sent(), weightType])]; - case 3: - _a = _e.sent(), optimizerWeightData = _a.data, optimizerWeightSpecs = _a.specs; - (_d = weightDataAndSpecs.specs).push.apply(_d, optimizerWeightSpecs); - weightDataAndSpecs.data = tfc.io.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); - _e.label = 4; - case 4: - if (this.userDefinedMetadata != null) { - checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return [2 /*return*/, handlerOrURL.save(modelArtifacts)]; - } - }); - }); - }; - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - LayersModel.prototype.setUserDefinedMetadata = function (userDefinedMetadata) { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - }; - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - LayersModel.prototype.getUserDefinedMetadata = function () { - return this.userDefinedMetadata; - }; - // The class name is 'Model' rather than 'LayersModel' for backwards - // compatibility since this class name shows up in the serialization format. - /** @nocollapse */ - LayersModel.className = 'Model'; - return LayersModel; - }(Container)); - tfc.serialization.registerClass(LayersModel); - /** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ - /** @doc {heading: 'Models', subheading: 'Classes'} */ - var Functional = /** @class */ (function (_super) { - __extends(Functional, _super); - function Functional() { - return _super !== null && _super.apply(this, arguments) || this; - } - Functional.className = 'Functional'; - return Functional; - }(LayersModel)); - tfc.serialization.registerClass(Functional); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ - function modelFromJSON(modelAndWeightsConfig, customObjects) { - return __awaiter(this, void 0, void 0, function () { - var modelTopology, tsConfig, model, weightValues, uniqueWeightValues, _i, _a, weight; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = { modelTopology: modelAndWeightsConfig }; - } - modelAndWeightsConfig = modelAndWeightsConfig; - modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config']; - } - tsConfig = convertPythonicToTs(modelTopology); - model = deserialize(tsConfig, customObjects); - if (!(modelAndWeightsConfig.weightsManifest != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, tfc.io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(function (weight) { return weight.originalName; }))]; - case 1: - weightValues = _b.sent(); - uniqueWeightValues = {}; - for (_i = 0, _a = model.weights; _i < _a.length; _i++) { - weight = _a[_i]; - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - tfc.dispose(weightValues); - _b.label = 2; - case 2: return [2 /*return*/, model]; - } - }); - }); - } - /** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ - function loadLayersModelInternal(pathOrIOHandler, options) { - return __awaiter(this, void 0, void 0, function () { - var handlers; - return __generator(this, function (_a) { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - handlers = tfc.io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(tfc.io.browserHTTPRequest(pathOrIOHandler, options)); - } - else if (handlers.length > 1) { - throw new ValueError("Found more than one (" + handlers.length + ") load handlers for " + - ("URL '" + pathOrIOHandler + "'")); - } - pathOrIOHandler = handlers[0]; - } - return [2 /*return*/, loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options)]; - }); - }); - } - /** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ - function loadLayersModelFromIOHandler(handler, customObjects, options) { - return __awaiter(this, void 0, void 0, function () { - var artifacts, modelTopology, strict, fastWeightInit, model, trainingConfig, _a, modelWeights, optimizerWeights; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - return [4 /*yield*/, handler.load()]; - case 1: - artifacts = _b.sent(); - modelTopology = artifacts.modelTopology; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config']; - } - strict = options.strict == null ? true : options.strict; - fastWeightInit = artifacts.weightData != null && artifacts.weightSpecs != null && strict; - model = deserialize(convertPythonicToTs(modelTopology), customObjects, fastWeightInit); - trainingConfig = artifacts.trainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - if (!(artifacts.weightData != null)) return [3 /*break*/, 4]; - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError('LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - _a = decodeModelAndOptimizerWeights(artifacts.weightData, artifacts.weightSpecs), modelWeights = _a.modelWeights, optimizerWeights = _a.optimizerWeights; - model.loadWeights(modelWeights, strict); - if (!(model.optimizer != null && optimizerWeights.length > 0)) return [3 /*break*/, 3]; - return [4 /*yield*/, model.optimizer.setWeights(optimizerWeights)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - // Dispose temporary weight values. - tfc.dispose(modelWeights); - tfc.dispose(optimizerWeights.map(function (w) { return w.tensor; })); - _b.label = 4; - case 4: return [2 /*return*/, model]; - } - }); - }); - } - function decodeModelAndOptimizerWeights(buffer, specs) { - var name2Tensor = tfc.io.decodeWeights(buffer, specs); - var modelWeights = {}; - var optimizerWeights = []; - specs.forEach(function (spec) { - if (spec.group === 'optimizer') { - optimizerWeights.push({ name: spec.name, tensor: name2Tensor[spec.name] }); - } - else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return { modelWeights: modelWeights, optimizerWeights: optimizerWeights }; - } - /** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - var Sequential = /** @class */ (function (_super) { - __extends(Sequential, _super); - function Sequential(args) { - var _this = _super.call(this, { inputs: [], outputs: [] }) || this; - args = args || {}; - _this.trainable = true; - _this.built = false; - // Set model name. - _this.name = (args.name != null) ? args.name : getUid('sequential_'); - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (var _i = 0, _a = args.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - _this.add(layer); - } - } - return _this; - } - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - Sequential.prototype.checkShape = function (layer) { - var shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(function (x) { return x < 0; })) { - throw new ValueError('Negative dimension size caused by adding layer ' + - (layer.name + " with input shape [") + - (layer.inboundNodes[0].inputTensors[0].shape + "]")); - } - }; - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.add = function (layer) { - var isLayerModelInstance = layer instanceof Sequential || layer instanceof LayersModel; - var modelLayer; - if (isLayerModelInstance) { - modelLayer = layer; - if (modelLayer.outputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError('The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - var x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } - else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError('A layer added to a Sequential model must not already be ' + - ("connected somewhere else. LayersModel received layer " + layer.name + " ") + - ("which has " + layer.inboundNodes.length + " pre-existing inbound ") + - 'connections.'); - } - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(function (x) { return x.shape; }), - outputShapes: this.outputs[0].shape - }); - } - else { - var outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - this.layers.push(layer); - this.built = false; - }; - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - Sequential.prototype.pop = function () { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } - else { - var lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - }; - Sequential.prototype.call = function (inputs, kwargs) { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - }; - Sequential.prototype.build = function (inputShape) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError('Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - }; - Sequential.prototype.countParams = function () { - if (!this.built) { - this.build(); - } - return _super.prototype.countParams.call(this); - }; - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.summary = function (lineLength, positions, printFn) { - if (printFn === void 0) { printFn = console.log; } - if (!this.built) { - this.build(); - } - _super.prototype.summary.call(this, lineLength, positions, printFn); - }; - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - Sequential.prototype.setWeights = function (weights) { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - }; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.evaluate = function (x, y, args) { - if (args === void 0) { args = {}; } - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - }; - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.evaluateDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return [2 /*return*/, this.model.evaluateDataset(dataset, args)]; - }); - }); - }; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.predict = function (x, args) { - if (args === void 0) { args = {}; } - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - }; - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - Sequential.prototype.predictOnBatch = function (x) { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - }; - /** - * See `LayersModel.compile`. - * - * @param args - */ - Sequential.prototype.compile = function (args) { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = this.model.isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - }; - Object.defineProperty(Sequential.prototype, "optimizer", { - get: function () { - return this.model == null ? undefined : this.model.optimizer; - }, - set: function (optimizer) { - this.model.optimizer = optimizer; - }, - enumerable: true, - configurable: true - }); - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.fit = function (x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return [2 /*return*/, this.model.fit(x, y, args)]; - }); - }); - }; - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - Sequential.prototype.fitDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return [2 /*return*/, this.model.fitDataset(dataset, args)]; - }); - }); - }; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.trainOnBatch = function (x, y) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.model.trainOnBatch(x, y)]; - }); - }); - }; - /* See parent class for JsDoc */ - /** @nocollapse */ - Sequential.fromConfig = function (cls, config, customObjects, fastWeightInit) { - if (fastWeightInit === void 0) { fastWeightInit = false; } - var configArray; - var extraModelConfig = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } - else { - tfc.util.assert(config['layers'] != null, function () { - return "When the config data for a Sequential model is not an Array, " + - "it must be an Object that contains the 'layers' field."; - }); - configArray = config['layers']; - delete config['layers']; - extraModelConfig = config; - } - var model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError("Sequential.fromConfig called on non-Sequential input: " + model); - } - for (var _i = 0, configArray_1 = configArray; _i < configArray_1.length; _i++) { - var conf = configArray_1[_i]; - var customObjects_1 = undefined; - var layer = deserialize(conf, customObjects_1, fastWeightInit); - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - }; - Object.defineProperty(Sequential.prototype, "stopTraining", { - get: function () { - if (this.model == null) { - throw new ValueError('Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - }, - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set: function (stop) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError('Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Override get trainableWeights() here - // tslint:disable-next-line:no-any - Sequential.prototype.getConfig = function () { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - var layers = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var dict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return { name: this.name, layers: layers }; - }; - /** @nocollapse */ - Sequential.className = 'Sequential'; - return Sequential; - }(LayersModel)); - tfc.serialization.registerClass(Sequential); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // TODO(cais): Add doc string to all the public static functions in this - // class; include exectuable JavaScript code snippets where applicable - // (b/74074458). - // LayersModel and related factory methods. - /** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ - function model(args) { - return new LayersModel(args); - } - /** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ - function sequential(config) { - return new Sequential(config); - } - /** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ - function loadLayersModel(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); - } - /** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ - function input(config) { - return Input(config); - } - function registerCallbackConstructor(verbosityLevel, callbackConstructor) { - CallbackConstructorRegistry.registerCallbackConstructor(verbosityLevel, callbackConstructor); - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ - var Activation = /** @class */ (function (_super) { - __extends(Activation, _super); - function Activation() { - return _super !== null && _super.apply(this, arguments) || this; - } - Activation.prototype.getConfig = function () { - return {}; - }; - return Activation; - }(tfc.serialization.Serializable)); - /** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ - var Elu$1 = /** @class */ (function (_super) { - __extends(Elu, _super); - function Elu() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - Elu.prototype.apply = function (x, alpha) { - if (alpha === void 0) { alpha = 1; } - return elu$1(x, alpha); - }; - /** @nocollapse */ - Elu.className = 'elu'; - return Elu; - }(Activation)); - tfc.serialization.registerClass(Elu$1); - /** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ - var Selu$1 = /** @class */ (function (_super) { - __extends(Selu, _super); - function Selu() { - return _super !== null && _super.apply(this, arguments) || this; - } - Selu.prototype.apply = function (x) { - return tfc.selu(x); - }; - /** @nocollapse */ - Selu.className = 'selu'; - return Selu; - }(Activation)); - tfc.serialization.registerClass(Selu$1); - /** - * Rectified linear unit - */ - var Relu$1 = /** @class */ (function (_super) { - __extends(Relu, _super); - function Relu() { - return _super !== null && _super.apply(this, arguments) || this; - } - Relu.prototype.apply = function (x) { - return tfc.relu(x); - }; - /** @nocollapse */ - Relu.className = 'relu'; - return Relu; - }(Activation)); - tfc.serialization.registerClass(Relu$1); - /** - * Rectified linear unit activation maxing out at 6.0. - */ - var Relu6$1 = /** @class */ (function (_super) { - __extends(Relu6, _super); - function Relu6() { - return _super !== null && _super.apply(this, arguments) || this; - } - Relu6.prototype.apply = function (x) { - return tfc.tidy(function () { return tfc.minimum(6.0, tfc.relu(x)); }); - }; - /** @nocollapse */ - Relu6.className = 'relu6'; - return Relu6; - }(Activation)); - tfc.serialization.registerClass(Relu6$1); - //* Linear activation (no-op) */ - var Linear = /** @class */ (function (_super) { - __extends(Linear, _super); - function Linear() { - return _super !== null && _super.apply(this, arguments) || this; - } - Linear.prototype.apply = function (x) { - return x; - }; - /** @nocollapse */ - Linear.className = 'linear'; - return Linear; - }(Activation)); - tfc.serialization.registerClass(Linear); - /** - * Sigmoid activation function. - */ - var Sigmoid$1 = /** @class */ (function (_super) { - __extends(Sigmoid, _super); - function Sigmoid() { - return _super !== null && _super.apply(this, arguments) || this; - } - Sigmoid.prototype.apply = function (x) { - return tfc.sigmoid(x); - }; - /** @nocollapse */ - Sigmoid.className = 'sigmoid'; - return Sigmoid; - }(Activation)); - tfc.serialization.registerClass(Sigmoid$1); - /** - * Segment-wise linear approximation of sigmoid. - */ - var HardSigmoid = /** @class */ (function (_super) { - __extends(HardSigmoid, _super); - function HardSigmoid() { - return _super !== null && _super.apply(this, arguments) || this; - } - HardSigmoid.prototype.apply = function (x) { - return hardSigmoid(x); - }; - /** @nocollapse */ - HardSigmoid.className = 'hardSigmoid'; - return HardSigmoid; - }(Activation)); - tfc.serialization.registerClass(HardSigmoid); - /** - * Softplus activation function. - */ - var Softplus$1 = /** @class */ (function (_super) { - __extends(Softplus, _super); - function Softplus() { - return _super !== null && _super.apply(this, arguments) || this; - } - Softplus.prototype.apply = function (x) { - return tfc.softplus(x); - }; - /** @nocollapse */ - Softplus.className = 'softplus'; - return Softplus; - }(Activation)); - tfc.serialization.registerClass(Softplus$1); - /** - * Softsign activation function. - */ - var Softsign = /** @class */ (function (_super) { - __extends(Softsign, _super); - function Softsign() { - return _super !== null && _super.apply(this, arguments) || this; - } - Softsign.prototype.apply = function (x) { - return softsign(x); - }; - /** @nocollapse */ - Softsign.className = 'softsign'; - return Softsign; - }(Activation)); - tfc.serialization.registerClass(Softsign); - /** - * Hyperbolic tangent function. - */ - var Tanh$1 = /** @class */ (function (_super) { - __extends(Tanh, _super); - function Tanh() { - return _super !== null && _super.apply(this, arguments) || this; - } - Tanh.prototype.apply = function (x) { - return tfc.tanh(x); - }; - /** @nocollapse */ - Tanh.className = 'tanh'; - return Tanh; - }(Activation)); - tfc.serialization.registerClass(Tanh$1); - /** - * Softmax activation function - */ - var Softmax$1 = /** @class */ (function (_super) { - __extends(Softmax, _super); - function Softmax() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - Softmax.prototype.apply = function (x, axis) { - if (axis === void 0) { axis = (-1); } - return tfc.softmax(x, axis); - }; - /** @nocollapse */ - Softmax.className = 'softmax'; - return Softmax; - }(Activation)); - tfc.serialization.registerClass(Softmax$1); - /** - * Log softmax activation function - */ - var LogSoftmax$1 = /** @class */ (function (_super) { - __extends(LogSoftmax, _super); - function LogSoftmax() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - LogSoftmax.prototype.apply = function (x, axis) { - if (axis === void 0) { axis = (-1); } - return tfc.logSoftmax(x, axis); - }; - /** @nocollapse */ - LogSoftmax.className = 'logSoftmax'; - return LogSoftmax; - }(Activation)); - tfc.serialization.registerClass(LogSoftmax$1); - /** - * Swish activation function - */ - var Swish = /** @class */ (function (_super) { - __extends(Swish, _super); - function Swish() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - Swish.prototype.apply = function (x, alpha) { - if (alpha === void 0) { alpha = 1; } - return tfc.tidy(function () { return tfc.sigmoid(x.mul(alpha)).mul(x); }); - }; - /** @nocollapse */ - Swish.className = 'swish'; - return Swish; - }(Activation)); - tfc.serialization.registerClass(Swish); - /** - * Mish activation function - */ - var Mish = /** @class */ (function (_super) { - __extends(Mish, _super); - function Mish() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - Mish.prototype.apply = function (x) { - return tfc.tidy(function () { return tfc.mul(x, tfc.tanh(tfc.softplus(x))); }); - }; - /** @nocollapse */ - Mish.className = 'mish'; - return Mish; - }(Activation)); - tfc.serialization.registerClass(Mish); - function serializeActivation(activation) { - return activation.getClassName(); - } - function deserializeActivation(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); - } - function getActivation(identifier) { - if (identifier == null) { - var config = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - var config = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } - else if (identifier instanceof Activation) { - return identifier; - } - else { - return deserializeActivation(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - function assertObjectArgs(args) { - if (args != null && typeof args !== 'object') { - throw new Error("Argument to L1L2 regularizer's constructor is expected to be an " + - ("object, but received: " + args)); - } - } - /** - * Regularizer base class. - */ - var Regularizer = /** @class */ (function (_super) { - __extends(Regularizer, _super); - function Regularizer() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Regularizer; - }(tfc.serialization.Serializable)); - var L1L2 = /** @class */ (function (_super) { - __extends(L1L2, _super); - function L1L2(args) { - var _this = _super.call(this) || this; - assertObjectArgs(args); - _this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - _this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - _this.hasL1 = _this.l1 !== 0; - _this.hasL2 = _this.l2 !== 0; - return _this; - } - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - L1L2.prototype.apply = function (x) { - var _this = this; - return tfc.tidy(function () { - var regularization = tfc.zeros([1]); - if (_this.hasL1) { - regularization = tfc.add(regularization, tfc.sum(tfc.mul(_this.l1, tfc.abs(x)))); - } - if (_this.hasL2) { - regularization = - tfc.add(regularization, tfc.sum(tfc.mul(_this.l2, square$1(x)))); - } - return regularization.asScalar(); - }); - }; - L1L2.prototype.getConfig = function () { - return { 'l1': this.l1, 'l2': this.l2 }; - }; - /** @nocollapse */ - L1L2.fromConfig = function (cls, config) { - return new cls({ l1: config['l1'], l2: config['l2'] }); - }; - /** @nocollapse */ - L1L2.className = 'L1L2'; - return L1L2; - }(Regularizer)); - tfc.serialization.registerClass(L1L2); - function l1(args) { - assertObjectArgs(args); - return new L1L2({ l1: args != null ? args.l1 : null, l2: 0 }); - } - function l2(args) { - assertObjectArgs(args); - return new L1L2({ l2: args != null ? args.l2 : null, l1: 0 }); - } - // Maps the JavaScript-like identifier keys to the corresponding keras symbols. - var REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'l1l2': 'L1L2' - }; - function serializeRegularizer(constraint) { - return serializeKerasObject(constraint); - } - function deserializeRegularizer(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); - } - function getRegularizer(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - var className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - var config = { className: className, config: {} }; - return deserializeRegularizer(config); - } - else if (identifier instanceof Regularizer) { - return identifier; - } - else { - return deserializeRegularizer(identifier); - } - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var ReLU = /** @class */ (function (_super) { - __extends(ReLU, _super); - function ReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.supportsMasking = true; - if (args != null) { - _this.maxValue = args.maxValue; - } - return _this; - } - ReLU.prototype.call = function (inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - var output = tfc.relu(inputs); - if (this.maxValue != null) { - output = tfc.clipByValue(output, 0, this.maxValue); - } - return output; - }; - ReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ReLU.prototype.getConfig = function () { - var config = { maxValue: this.maxValue }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ReLU.className = 'ReLU'; - return ReLU; - }(Layer)); - tfc.serialization.registerClass(ReLU); - var LeakyReLU = /** @class */ (function (_super) { - __extends(LeakyReLU, _super); - function LeakyReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA = 0.3; - if (args == null) { - args = {}; - } - _this.alpha = args.alpha == null ? _this.DEFAULT_ALPHA : args.alpha; - return _this; - } - LeakyReLU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return tfc.leakyRelu(x, this.alpha); - }; - LeakyReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - LeakyReLU.prototype.getConfig = function () { - var config = { alpha: this.alpha }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - LeakyReLU.className = 'LeakyReLU'; - return LeakyReLU; - }(Layer)); - tfc.serialization.registerClass(LeakyReLU); - var PReLU = /** @class */ (function (_super) { - __extends(PReLU, _super); - function PReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA_INITIALIZER = 'zeros'; - if (args == null) { - args = {}; - } - _this.supportsMasking = true; - _this.alphaInitializer = - getInitializer(args.alphaInitializer || _this.DEFAULT_ALPHA_INITIALIZER); - _this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - _this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - _this.sharedAxes = null; - } - else if (Array.isArray(args.sharedAxes)) { - _this.sharedAxes = args.sharedAxes; - } - else if (typeof args.sharedAxes === 'number') { - _this.sharedAxes = [args.sharedAxes]; - } - else { - throw new ValueError("Expected sharedAxes to be a number or an array of numbers, " + - ("but got " + args.sharedAxes)); - } - return _this; - } - PReLU.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var paramShape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (var _i = 0, _a = this.sharedAxes; _i < _a.length; _i++) { - var i = _a[_i]; - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight('alpha', paramShape, 'float32', this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - var axes = {}; - if (this.sharedAxes != null) { - for (var i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes: axes, - })]; - this.built = true; - }; - PReLU.prototype.call = function (inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - return tfc.prelu(inputs, this.alpha.read()); - }; - PReLU.prototype.getConfig = function () { - var config = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - PReLU.className = 'PReLU'; - return PReLU; - }(Layer)); - tfc.serialization.registerClass(PReLU); - var ELU = /** @class */ (function (_super) { - __extends(ELU, _super); - function ELU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA = 1.0; - if (args == null) { - args = {}; - } - if (args.alpha != null && args.alpha !== _this.DEFAULT_ALPHA) { - throw new NotImplementedError("Non-default alpha value (" + args.alpha + ") is not supported by the " + - "ELU layer yet."); - } - _this.alpha = args.alpha == null ? _this.DEFAULT_ALPHA : args.alpha; - return _this; - } - ELU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return tfc.elu(x); - }; - ELU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ELU.prototype.getConfig = function () { - var config = { alpha: this.alpha }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ELU.className = 'ELU'; - return ELU; - }(Layer)); - tfc.serialization.registerClass(ELU); - var ThresholdedReLU = /** @class */ (function (_super) { - __extends(ThresholdedReLU, _super); - function ThresholdedReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_THETA = 1.0; - if (args == null) { - args = {}; - } - _this.theta = args.theta == null ? _this.DEFAULT_THETA : args.theta; - return _this; - } - ThresholdedReLU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return x.mul(cast$1(x.greater(this.theta), 'float32')); - }; - ThresholdedReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ThresholdedReLU.prototype.getConfig = function () { - var config = { theta: this.theta }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ThresholdedReLU.className = 'ThresholdedReLU'; - return ThresholdedReLU; - }(Layer)); - tfc.serialization.registerClass(ThresholdedReLU); - var Softmax$2 = /** @class */ (function (_super) { - __extends(Softmax, _super); - function Softmax(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_AXIS = 1.0; - if (args == null) { - args = {}; - } - _this.softmax = new Softmax$1().apply; - _this.axis = args.axis == null ? _this.DEFAULT_AXIS : args.axis; - return _this; - } - Softmax.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - }; - Softmax.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - Softmax.prototype.getConfig = function () { - var config = { axis: this.axis }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Softmax.className = 'Softmax'; - return Softmax; - }(Layer)); - tfc.serialization.registerClass(Softmax$2); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ - function normalizeArray(value, n, name) { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } - else { - if (value.length !== n) { - throw new ValueError("The " + name + " argument must be an integer or tuple of " + n + " integers." + - (" Received: " + value.length + " elements.")); - } - for (var i = 0; i < n; ++i) { - var singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError("The " + name + " argument must be an integer or tuple of " + n + - (" integers. Received: " + JSON.stringify(value) + " including a") + - (" non-integer number " + singleValue)); - } - } - return value; - } - } - /** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ - function convOutputLength(inputLength, filterSize, padding, stride, dilation) { - if (dilation === void 0) { dilation = 1; } - if (inputLength == null) { - return inputLength; - } - var dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - var outputLength; - if (padding === 'same') { - outputLength = inputLength; - } - else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); - } - function deconvLength(dimSize, strideSize, kernelSize, padding) { - if (dimSize == null) { - return null; - } - if (padding === 'valid') { - dimSize = dimSize * strideSize + max$1([kernelSize - strideSize, 0]); - } - else if (padding === 'same') { - dimSize = dimSize * strideSize; - } - else { - throw new ValueError("Unsupport padding mode: " + padding + "."); - } - return dimSize; - } - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ - function preprocessConv2DInput(x, dataFormat) { - // TODO(cais): Cast type to float32 if not. - return tfc.tidy(function () { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } - else { - return x; - } - }); - } - /** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ - function preprocessConv3DInput(x, dataFormat) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } - else { - return x; - } - }); - } - /** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ - function conv1dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = 1; } - if (padding === void 0) { padding = 'valid'; } - if (dilationRate === void 0) { dilationRate = 1; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError("The input of a conv1dWithBias operation should be 3, but is " + - (x.shape.length + " instead.")); - } - if (kernel.shape.length !== 3) { - throw new ValueError("The kernel for a conv1dWithBias operation should be 3, but is " + - (kernel.shape.length + " instead")); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError("The bias for a conv1dWithBias operation should be 1, but is " + - (kernel.shape.length + " instead")); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - var y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - return y; - }); - } - /** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ - function conv2dWithBiasActivation(x, kernel, bias, strides, padding, dataFormat, dilationRate, activation) { - if (strides === void 0) { strides = [1, 1]; } - if (padding === void 0) { padding = 'valid'; } - if (activation === void 0) { activation = null; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError("conv2dWithBiasActivation expects input to be of rank 3 or 4, " + - ("but received " + x.rank + ".")); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError("conv2dWithBiasActivation expects kernel to be of rank 3 or 4, " + - ("but received " + x.rank + ".")); - } - var y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.fused.conv2d({ - x: y, - filter: kernel, - strides: strides, - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias: bias, - activation: activation - }); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); - } - /** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ - function conv3dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = [1, 1, 1]; } - if (padding === void 0) { padding = 'valid'; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError("conv3dWithBias expects input to be of rank 4 or 5, but received " + - (x.rank + ".")); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError("conv3dWithBias expects kernel to be of rank 4 or 5, but received " + - (x.rank + ".")); - } - var y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.conv3d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); - } - return y; - }); - } - /** - * Abstract convolution layer. - */ - var BaseConv = /** @class */ (function (_super) { - __extends(BaseConv, _super); - function BaseConv(rank, args) { - var _this = _super.call(this, args) || this; - _this.bias = null; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - BaseConv.verifyArgs(args); - _this.rank = rank; - assertPositiveInteger(_this.rank, 'rank'); - if (_this.rank !== 1 && _this.rank !== 2 && _this.rank !== 3) { - throw new NotImplementedError("Convolution layer for rank other than 1, 2, or 3 (" + _this.rank + ") is " + - "not implemented yet."); - } - _this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - _this.strides = normalizeArray(args.strides == null ? 1 : args.strides, rank, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(_this.padding); - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.activation = getActivation(args.activation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.dilationRate = normalizeArray(args.dilationRate == null ? 1 : args.dilationRate, rank, 'dilationRate'); - if (_this.rank === 1 && - (Array.isArray(_this.dilationRate) && _this.dilationRate.length !== 1)) { - throw new ValueError("dilationRate must be a number or an array of a single number " + - "for 1D convolution, but received " + - ("" + JSON.stringify(_this.dilationRate))); - } - else if (_this.rank === 2) { - if (typeof _this.dilationRate === 'number') { - _this.dilationRate = [_this.dilationRate, _this.dilationRate]; - } - else if (_this.dilationRate.length !== 2) { - throw new ValueError("dilationRate must be a number or array of two numbers for 2D " + - ("convolution, but received " + JSON.stringify(_this.dilationRate))); - } - } - else if (_this.rank === 3) { - if (typeof _this.dilationRate === 'number') { - _this.dilationRate = - [_this.dilationRate, _this.dilationRate, _this.dilationRate]; - } - else if (_this.dilationRate.length !== 3) { - throw new ValueError("dilationRate must be a number or array of three numbers for 3D " + - ("convolution, but received " + JSON.stringify(_this.dilationRate))); - } - } - return _this; - } - BaseConv.verifyArgs = function (args) { - // Check config.kernelSize type and shape. - assert$1('kernelSize' in args, "required key 'kernelSize' not in config"); - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 3)) { - throw new ValueError("BaseConv expects config.kernelSize to be number or number[] with " + - ("length 1, 2, or 3, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - BaseConv.prototype.getConfig = function () { - var config = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return BaseConv; - }(Layer)); - /** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ - var Conv = /** @class */ (function (_super) { - __extends(Conv, _super); - function Conv(rank, args) { - var _this = _super.call(this, rank, args) || this; - _this.kernel = null; - Conv.verifyArgs(args); - _this.filters = args.filters; - assertPositiveInteger(_this.filters, 'filters'); - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - return _this; - } - Conv.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError("The channel dimension of the input should be defined. " + - ("Found " + inputShape[channelAxis])); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([inputDim, this.filters]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.inputSpec = [{ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) }]; - this.built = true; - }; - Conv.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var outputs; - var biasValue = _this.bias == null ? null : _this.bias.read(); - var fusedActivationName = mapActivationToFusedKernel(_this.activation.getClassName()); - if (fusedActivationName != null && _this.rank === 2) { - outputs = conv2dWithBiasActivation(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate, fusedActivationName); - } - else { - if (_this.rank === 1) { - outputs = conv1dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides[0], _this.padding, _this.dataFormat, _this.dilationRate[0]); - } - else if (_this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); - } - else if (_this.rank === 3) { - outputs = conv3dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); - } - else { - throw new NotImplementedError('convolutions greater than 3D are not implemented yet.'); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - } - return outputs; - }); - }; - Conv.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var newSpace = []; - var space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (var i = 0; i < space.length; ++i) { - var newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - var outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } - else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - }; - Conv.prototype.getConfig = function () { - var config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Conv.verifyArgs = function (args) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError("Convolution layer expected config.filters to be a 'number' > 0 " + - ("but got " + JSON.stringify(args.filters))); - } - }; - return Conv; - }(BaseConv)); - var Conv2D$1 = /** @class */ (function (_super) { - __extends(Conv2D, _super); - function Conv2D(args) { - var _this = _super.call(this, 2, args) || this; - Conv2D.verifyArgs(args); - return _this; - } - Conv2D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - return config; - }; - Conv2D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 2)) { - throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with " + - ("length 1 or 2, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - /** @nocollapse */ - Conv2D.className = 'Conv2D'; - return Conv2D; - }(Conv)); - tfc.serialization.registerClass(Conv2D$1); - var Conv3D$1 = /** @class */ (function (_super) { - __extends(Conv3D, _super); - function Conv3D(args) { - var _this = _super.call(this, 3, args) || this; - Conv3D.verifyArgs(args); - return _this; - } - Conv3D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - return config; - }; - Conv3D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError("Conv3D expects config.kernelSize to be number or" + - (" [number, number, number], but received " + JSON.stringify(args.kernelSize) + ".")); - } - } - }; - /** @nocollapse */ - Conv3D.className = 'Conv3D'; - return Conv3D; - }(Conv)); - tfc.serialization.registerClass(Conv3D$1); - var Conv2DTranspose = /** @class */ (function (_super) { - __extends(Conv2DTranspose, _super); - function Conv2DTranspose(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - if (_this.padding !== 'same' && _this.padding !== 'valid') { - throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' " + - ("and 'valid', but received padding mode " + _this.padding)); - } - return _this; - } - Conv2DTranspose.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 4) { - throw new ValueError('Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 4, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - Conv2DTranspose.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but " + - ("received a tensor of rank-" + input.shape.length)); - } - var inputShape = input.shape; - var batchSize = inputShape[0]; - var hAxis; - var wAxis; - if (_this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } - else { - hAxis = 1; - wAxis = 2; - } - var height = inputShape[hAxis]; - var width = inputShape[wAxis]; - var kernelH = _this.kernelSize[0]; - var kernelW = _this.kernelSize[1]; - var strideH = _this.strides[0]; - var strideW = _this.strides[1]; - // Infer the dynamic output shape. - var outHeight = deconvLength(height, strideH, kernelH, _this.padding); - var outWidth = deconvLength(width, strideW, kernelW, _this.padding); - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - var outputShape = [batchSize, outHeight, outWidth, _this.filters]; - if (_this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 1]); - } - var outputs = tfc.conv2dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); - if (_this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 3, 1, 2]); - } - if (_this.bias != null) { - outputs = - biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - Conv2DTranspose.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - var channelAxis; - var heightAxis; - var widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - var kernelH = this.kernelSize[0]; - var kernelW = this.kernelSize[1]; - var strideH = this.strides[0]; - var strideW = this.strides[1]; - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - }; - Conv2DTranspose.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['dilationRate']; - return config; - }; - /** @nocollapse */ - Conv2DTranspose.className = 'Conv2DTranspose'; - return Conv2DTranspose; - }(Conv2D$1)); - tfc.serialization.registerClass(Conv2DTranspose); - var Conv3DTranspose = /** @class */ (function (_super) { - __extends(Conv3DTranspose, _super); - function Conv3DTranspose(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - if (_this.padding !== 'same' && _this.padding !== 'valid') { - throw new ValueError("Conv3DTranspose currently supports only padding modes 'same' " + - ("and 'valid', but received padding mode " + _this.padding)); - } - return _this; - } - Conv3DTranspose.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 5) { - throw new ValueError('Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 5, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - Conv3DTranspose.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError("Conv3DTranspose.call() expects input tensor to be rank-4, but " + - ("received a tensor of rank-" + input.shape.length)); - } - var inputShape = input.shape; - var batchSize = inputShape[0]; - var hAxis; - var wAxis; - var dAxis; - if (_this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } - else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - var depth = inputShape[dAxis]; - var height = inputShape[hAxis]; - var width = inputShape[wAxis]; - var kernelD = _this.kernelSize[0]; - var kernelH = _this.kernelSize[1]; - var kernelW = _this.kernelSize[2]; - var strideD = _this.strides[0]; - var strideH = _this.strides[1]; - var strideW = _this.strides[2]; - // Infer the dynamic output shape. - var outDepth = deconvLength(depth, strideD, kernelD, _this.padding); - var outHeight = deconvLength(height, strideH, kernelH, _this.padding); - var outWidth = deconvLength(width, strideW, kernelW, _this.padding); - // Same as `conv2dTranspose`. We always assumes channelsLast. - var outputShape = [batchSize, outDepth, outHeight, outWidth, _this.filters]; - if (_this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 4, 1]); - } - var outputs = tfc.conv3dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); - if (_this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]); - } - if (_this.bias !== null) { - outputs = - biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation !== null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - Conv3DTranspose.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - var channelAxis; - var depthAxis; - var heightAxis; - var widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } - else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - var kernelD = this.kernelSize[0]; - var kernelH = this.kernelSize[1]; - var kernelW = this.kernelSize[2]; - var strideD = this.strides[0]; - var strideH = this.strides[1]; - var strideW = this.strides[2]; - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - }; - Conv3DTranspose.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['dilationRate']; - return config; - }; - /** @nocollapse */ - Conv3DTranspose.className = 'Conv3DTranspose'; - return Conv3DTranspose; - }(Conv3D$1)); - tfc.serialization.registerClass(Conv3DTranspose); - var SeparableConv = /** @class */ (function (_super) { - __extends(SeparableConv, _super); - function SeparableConv(rank, config) { - var _this = _super.call(this, rank, config) || this; - _this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; - _this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; - _this.depthwiseKernel = null; - _this.pointwiseKernel = null; - if (config.filters == null) { - throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError("SeparableConv" + _this.rank + "D supports only padding modes: " + - ("'same' and 'valid', but received " + JSON.stringify(config.padding))); - } - _this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - _this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_DEPTHWISE_INITIALIZER); - _this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - _this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - _this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_POINTWISE_INITIALIZER); - _this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - _this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - return _this; - } - SeparableConv.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError("Inputs to SeparableConv" + this.rank + "D should have rank " + - (this.rank + 2 + ", but received input shape: ") + - ("" + JSON.stringify(inputShape))); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError("The channel dimension of the inputs should be defined, " + - ("but found " + JSON.stringify(inputShape[channelAxis]))); - } - var inputDim = inputShape[channelAxis]; - var depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); - var pointwiseKernelShape = []; - for (var i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - var trainable = true; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); - } - else { - this.bias = null; - } - this.inputSpec = - [new InputSpec({ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - SeparableConv.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var output; - if (_this.rank === 1) { - throw new NotImplementedError('1D separable convolution is not implemented yet.'); - } - else if (_this.rank === 2) { - if (_this.dataFormat === 'channelsFirst') { - inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - output = tfc.separableConv2d(inputs, _this.depthwiseKernel.read(), _this.pointwiseKernel.read(), _this.strides, _this.padding, _this.dilationRate, 'NHWC'); - } - if (_this.useBias) { - output = biasAdd(output, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - output = _this.activation.apply(output); - } - if (_this.dataFormat === 'channelsFirst') { - output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - }; - SeparableConv.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - }; - /** @nocollapse */ - SeparableConv.className = 'SeparableConv'; - return SeparableConv; - }(Conv)); - var SeparableConv2D = /** @class */ (function (_super) { - __extends(SeparableConv2D, _super); - function SeparableConv2D(args) { - return _super.call(this, 2, args) || this; - } - /** @nocollapse */ - SeparableConv2D.className = 'SeparableConv2D'; - return SeparableConv2D; - }(SeparableConv)); - tfc.serialization.registerClass(SeparableConv2D); - var Conv1D = /** @class */ (function (_super) { - __extends(Conv1D, _super); - function Conv1D(args) { - var _this = _super.call(this, 1, args) || this; - Conv1D.verifyArgs(args); - _this.inputSpec = [{ ndim: 3 }]; - return _this; - } - Conv1D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - delete config['dataFormat']; - return config; - }; - Conv1D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 1)) { - throw new ValueError("Conv1D expects config.kernelSize to be number or number[] with " + - ("length 1, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - /** @nocollapse */ - Conv1D.className = 'Conv1D'; - return Conv1D; - }(Conv)); - tfc.serialization.registerClass(Conv1D); - var Cropping2D = /** @class */ (function (_super) { - __extends(Cropping2D, _super); - function Cropping2D(args) { - var _this = _super.call(this, args) || this; - if (typeof args.cropping === 'number') { - _this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } - else if (typeof args.cropping[0] === 'number') { - _this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1], args.cropping[1]] - ]; - } - else { - _this.cropping = args.cropping; - } - _this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - _this.inputSpec = [{ ndim: 4 }]; - return _this; - } - Cropping2D.prototype.computeOutputShape = function (inputShape) { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } - else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - }; - Cropping2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[1] - _this.cropping[0][0] - _this.cropping[0][1], 2); - return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[2] - _this.cropping[1][1] - _this.cropping[1][0], 3); - } - else { - var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[2] - _this.cropping[0][0] - _this.cropping[0][1], 3); - return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[3] - _this.cropping[1][1] - _this.cropping[1][0], 4); - } - }); - }; - Cropping2D.prototype.getConfig = function () { - var config = { cropping: this.cropping, dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Cropping2D.className = 'Cropping2D'; - return Cropping2D; - }(Layer)); - tfc.serialization.registerClass(Cropping2D); - var UpSampling2D = /** @class */ (function (_super) { - __extends(UpSampling2D, _super); - function UpSampling2D(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_SIZE = [2, 2]; - _this.inputSpec = [{ ndim: 4 }]; - _this.size = args.size == null ? _this.DEFAULT_SIZE : args.size; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(_this.interpolation); - return _this; - } - UpSampling2D.prototype.computeOutputShape = function (inputShape) { - if (this.dataFormat === 'channelsFirst') { - var height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; - var width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } - else { - var height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; - var width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - }; - UpSampling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - if (_this.dataFormat === 'channelsFirst') { - input = tfc.transpose(input, [0, 2, 3, 1]); - var height = _this.size[0] * inputShape[2]; - var width = _this.size[1] * inputShape[3]; - var resized = _this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return tfc.transpose(resized, [0, 3, 1, 2]); - } - else { - var height = _this.size[0] * inputShape[1]; - var width = _this.size[1] * inputShape[2]; - return _this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - }; - UpSampling2D.prototype.getConfig = function () { - var config = { size: this.size, dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - UpSampling2D.className = 'UpSampling2D'; - return UpSampling2D; - }(Layer)); - tfc.serialization.registerClass(UpSampling2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ - function depthwiseConv2d$1(x, depthwiseKernel, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = [1, 1]; } - if (padding === void 0) { padding = 'valid'; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - var y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError("Input for depthwiseConv2d is required to be 4-D, but is instead " + - (x.rank + "-D")); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError("depthwiseKernel is required to be 4-D, but is instead " + - (depthwiseKernel.rank + "-D")); - } - y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); - } - var DepthwiseConv2D = /** @class */ (function (_super) { - __extends(DepthwiseConv2D, _super); - function DepthwiseConv2D(args) { - var _this = _super.call(this, 2, args) || this; - _this.depthwiseKernel = null; - _this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - _this.depthwiseInitializer = getInitializer(args.depthwiseInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - _this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - return _this; - } - DepthwiseConv2D.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError("Inputs to DepthwiseConv2D should have rank 4. " + - ("Received input shape: " + JSON.stringify(inputShape) + ".")); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + - ("be defined, but is not (" + inputShape[channelAxis] + ").")); - } - var inputDim = inputShape[channelAxis]; - var depthwiseKernelShape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - }; - DepthwiseConv2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var outputs = depthwiseConv2d$1(inputs, _this.depthwiseKernel.read(), _this.strides, _this.padding, _this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (_this.useBias) { - outputs = biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - DepthwiseConv2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - var outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - var outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); - var outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } - else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - }; - DepthwiseConv2D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - }; - /** @nocollapse */ - DepthwiseConv2D.className = 'DepthwiseConv2D'; - return DepthwiseConv2D; - }(BaseConv)); - tfc.serialization.registerClass(DepthwiseConv2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ - function standardizeArgs(inputs, initialState, constants, numConstants) { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError('When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - function toListOrNull(x) { - if (x == null || Array.isArray(x)) { - return x; - } - else { - return [x]; - } - } - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - return { inputs: inputs, initialState: initialState, constants: constants }; - } - /** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ - function rnn(stepFunction, inputs, initialStates, goBackwards, mask, constants, unroll, needPerStepOutputs) { - if (goBackwards === void 0) { goBackwards = false; } - if (unroll === void 0) { unroll = false; } - if (needPerStepOutputs === void 0) { needPerStepOutputs = false; } - return tfc.tidy(function () { - var ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError("Input should be at least 3D, but is " + ndim + "D."); - } - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - var axes = [1, 0].concat(range(2, ndim)); - inputs = tfc.transpose(inputs, axes); - if (constants != null) { - throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = tfc.expandDims(mask, -1); - } - mask = tfc.transpose(mask, axes); - } - if (goBackwards) { - inputs = tfc.reverse(inputs, 0); - if (mask != null) { - mask = tfc.reverse(mask, 0); - } - } - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - var perStepOutputs = []; - var lastOutput; - var states = initialStates; - var timeSteps = inputs.shape[0]; - var perStepInputs = tfc.unstack(inputs); - var perStepMasks; - if (mask != null) { - perStepMasks = tfc.unstack(mask); - } - var _loop_1 = function (t) { - var currentInput = perStepInputs[t]; - var stepOutputs = tfc.tidy(function () { return stepFunction(currentInput, states); }); - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } - else { - var maskedOutputs = tfc.tidy(function () { - var stepMask = perStepMasks[t]; - var negStepMask = tfc.onesLike(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - var output = stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - var newStates = states.map(function (state, i) { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return { output: output, newStates: newStates }; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - }; - for (var t = 0; t < timeSteps; ++t) { - _loop_1(t); - } - var outputs; - if (needPerStepOutputs) { - var axis = 1; - outputs = tfc.stack(perStepOutputs, axis); - } - return [lastOutput, outputs, states]; - }); - } - var RNN = /** @class */ (function (_super) { - __extends(RNN, _super); - function RNN(args) { - var _this = _super.call(this, args) || this; - var cell; - if (args.cell == null) { - throw new ValueError('cell property is missing for the constructor of RNN.'); - } - else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({ cells: args.cell }); - } - else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - _this.cell = cell; - _this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - _this.returnState = args.returnState == null ? false : args.returnState; - _this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - _this._stateful = args.stateful == null ? false : args.stateful; - _this.unroll = args.unroll == null ? false : args.unroll; - _this.supportsMasking = true; - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - _this.stateSpec = null; - _this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - _this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - _this.keptStates = []; - return _this; - } - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - RNN.prototype.getStates = function () { - if (this.states_ == null) { - var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return range(0, numStates).map(function (x) { return null; }); - } - else { - return this.states_; - } - }; - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - RNN.prototype.setStates = function (states) { - this.states_ = states; - }; - RNN.prototype.computeOutputShape = function (inputShape) { - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - // TODO(cais): Remove the casting once stacked RNN cells become supported. - var stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - var outputDim = stateSize[0]; - var outputShape; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } - else { - outputShape = [inputShape[0], outputDim]; - } - if (this.returnState) { - var stateShape = []; - for (var _i = 0, stateSize_1 = stateSize; _i < stateSize_1.length; _i++) { - var dim = stateSize_1[_i]; - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } - else { - return outputShape; - } - }; - RNN.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - if (Array.isArray(mask)) { - mask = mask[0]; - } - var outputMask = _this.returnSequences ? mask : null; - if (_this.returnState) { - var stateMask = _this.states.map(function (s) { return null; }); - return [outputMask].concat(stateMask); - } - else { - return outputMask; - } - }); - }; - Object.defineProperty(RNN.prototype, "states", { - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get: function () { - if (this.states_ == null) { - var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - var output = []; - for (var i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } - else { - return this.states_; - } - }, - set: function (s) { - this.states_ = s; - }, - enumerable: true, - configurable: true - }); - RNN.prototype.build = function (inputShape) { - if (this.numConstants != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - var batchSize = this.stateful ? inputShape[0] : null; - var inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({ shape: [batchSize, null].concat(inputDim) }); - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - var stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - { - this.cell.build(stepInputShape); - } - // Set or validate stateSpec. - var stateSize; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } - else { - stateSize = [this.cell.stateSize]; - } - if (this.stateSpec != null) { - if (!tfc.util.arraysEqual(this.stateSpec.map(function (spec) { return spec.shape[spec.shape.length - 1]; }), stateSize)) { - throw new ValueError("An initialState was passed that is not compatible with " + - ("cell.stateSize. Received stateSpec=" + this.stateSpec + "; ") + - ("However cell.stateSize is " + this.cell.stateSize)); - } - } - else { - this.stateSpec = - stateSize.map(function (dim) { return new InputSpec({ shape: [null, dim] }); }); - } - if (this.stateful) { - this.resetStates(); - } - }; - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - RNN.prototype.resetStates = function (states, training) { - var _this = this; - if (training === void 0) { training = false; } - tfc.tidy(function () { - if (!_this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - var batchSize = _this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (_this.states_ == null) { - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = - _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); - } - else { - _this.states_ = [tfc.zeros([batchSize, _this.cell.stateSize])]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(_this.states_); - // For stateful RNNs, fully dispose kept old states. - if (_this.keptStates != null) { - tfc.dispose(_this.keptStates); - _this.keptStates = []; - } - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = - _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); - } - else { - _this.states_[0] = tfc.zeros([batchSize, _this.cell.stateSize]); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== _this.states_.length) { - throw new ValueError("Layer " + _this.name + " expects " + _this.states_.length + " state(s), " + - ("but it received " + states.length + " state value(s). Input ") + - ("received: " + states)); - } - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - _this.keptStates.push(_this.states_.slice()); - } - else { - tfc.dispose(_this.states_); - } - for (var index = 0; index < _this.states_.length; ++index) { - var value = states[index]; - var dim = Array.isArray(_this.cell.stateSize) ? - _this.cell.stateSize[index] : - _this.cell.stateSize; - var expectedShape = [batchSize, dim]; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + - ("expected shape=" + expectedShape + ", received shape=" + value.shape)); - } - _this.states_[index] = value; - } - } - _this.states_ = _this.states_.map(function (state) { return tfc.keep(state.clone()); }); - }); - }; - RNN.prototype.apply = function (inputs, kwargs) { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - var initialState = kwargs == null ? null : kwargs['initialState']; - var constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - var additionalInputs = []; - var additionalSpecs = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (var _i = 0, initialState_1 = initialState; _i < initialState_1.length; _i++) { - var state = initialState_1[_i]; - this.stateSpec.push(new InputSpec({ shape: state.shape })); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - var isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - var fullInput = [inputs].concat(additionalInputs); - var fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - var originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - var output = _super.prototype.apply.call(this, fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return _super.prototype.apply.call(this, inputs, kwargs); - } - }; - // tslint:disable-next-line:no-any - RNN.prototype.call = function (inputs, kwargs) { - var _this = this; - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tfc.tidy(function () { - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (_this.stateful) { - initialState = _this.states_; - } - else { - initialState = _this.getInitialState(inputs); - } - } - var numStates = Array.isArray(_this.cell.stateSize) ? _this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError("RNN Layer has " + numStates + " state(s) but was passed " + - (initialState.length + " initial state(s).")); - } - if (_this.unroll) { - console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - var cellCallKwargs = { training: training }; - // TODO(cais): Add support for constants. - var step = function (inputs, states) { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - var outputs = _this.cell.call([inputs].concat(states), cellCallKwargs); - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)]; - }; - // TODO(cais): Add support for constants. - var rnnOutputs = rnn(step, inputs, initialState, _this.goBackwards, mask, null, _this.unroll, _this.returnSequences); - var lastOutput = rnnOutputs[0]; - var outputs = rnnOutputs[1]; - var states = rnnOutputs[2]; - if (_this.stateful) { - _this.resetStates(states, training); - } - var output = _this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. - if (_this.returnState) { - return [output].concat(states); - } - else { - return output; - } - }); - }; - RNN.prototype.getInitialState = function (inputs) { - var _this = this; - return tfc.tidy(function () { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - var initialState = tfc.zeros(inputs.shape); - // [Samples]. - initialState = tfc.sum(initialState, [1, 2]); - initialState = expandDims$1(initialState); // [Samples, 1]. - if (Array.isArray(_this.cell.stateSize)) { - return _this.cell.stateSize.map(function (dim) { return dim > 1 ? tile$1(initialState, [1, dim]) : initialState; }); - } - else { - return _this.cell.stateSize > 1 ? - [tile$1(initialState, [1, _this.cell.stateSize])] : - [initialState]; - } - }); - }; - Object.defineProperty(RNN.prototype, "trainableWeights", { - get: function () { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(RNN.prototype, "nonTrainableWeights", { - get: function () { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - }, - enumerable: true, - configurable: true - }); - RNN.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - }; - RNN.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - var cellConfig = this.cell.getConfig(); - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - }; - } - // this order is necessary, to prevent cell name from replacing layer name - return __assign({}, cellConfig, baseConfig, config); - }; - /** @nocollapse */ - RNN.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var cellConfig = config['cell']; - var cell = deserialize(cellConfig, customObjects); - return new cls(Object.assign(config, { cell: cell })); - }; - /** @nocollapse */ - RNN.className = 'RNN'; - return RNN; - }(Layer)); - tfc.serialization.registerClass(RNN); - // Porting Note: This is a common parent class for RNN cells. There is no - // equivalent of this in PyKeras. Having a common parent class forgoes the - // need for `has_attr(cell, ...)` checks or its TypeScript equivalent. - /** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ - var RNNCell = /** @class */ (function (_super) { - __extends(RNNCell, _super); - function RNNCell() { - return _super !== null && _super.apply(this, arguments) || this; - } - return RNNCell; - }(Layer)); - var SimpleRNNCell = /** @class */ (function (_super) { - __extends(SimpleRNNCell, _super); - function SimpleRNNCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - _this.units = args.units; - assertPositiveInteger(_this.units, "units"); - _this.activation = getActivation(args.activation == null ? _this.DEFAULT_ACTIVATION : args.activation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.stateSize = _this.units; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - SimpleRNNCell.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - }; - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - SimpleRNNCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError("SimpleRNNCell expects 2 input Tensors, got " + inputs.length + "."); - } - var prevOutput = inputs[1]; - inputs = inputs[0]; - var training = kwargs['training'] == null ? false : kwargs['training']; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(prevOutput); }, - rate: _this.recurrentDropout, - training: training - }); - } - var h; - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - if (dpMask != null) { - h = dot$1(tfc.mul(inputs, dpMask), _this.kernel.read()); - } - else { - h = dot$1(inputs, _this.kernel.read()); - } - if (_this.bias != null) { - h = biasAdd(h, _this.bias.read()); - } - if (recDpMask != null) { - prevOutput = tfc.mul(prevOutput, recDpMask); - } - var output = tfc.add(h, dot$1(prevOutput, _this.recurrentKernel.read())); - if (_this.activation != null) { - output = _this.activation.apply(output); - } - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - }; - SimpleRNNCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - SimpleRNNCell.className = 'SimpleRNNCell'; - return SimpleRNNCell; - }(RNNCell)); - tfc.serialization.registerClass(SimpleRNNCell); - var SimpleRNN = /** @class */ (function (_super) { - __extends(SimpleRNN, _super); - function SimpleRNN(args) { - var _this = this; - args.cell = new SimpleRNNCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - SimpleRNN.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - SimpleRNN.fromConfig = function (cls, config) { - return new cls(config); - }; - /** @nocollapse */ - SimpleRNN.className = 'SimpleRNN'; - return SimpleRNN; - }(RNN)); - tfc.serialization.registerClass(SimpleRNN); - var GRUCell = /** @class */ (function (_super) { - __extends(GRUCell, _super); - function GRUCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.resetAfter) { - throw new ValueError("GRUCell does not support reset_after parameter set to true."); - } - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation === undefined ? _this.DEFAULT_ACTIVATION : - args.activation); - _this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - _this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.implementation = args.implementation; - _this.stateSize = _this.units; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - GRUCell.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - }; - GRUCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError("GRUCell expects 2 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var training = kwargs['training'] == null ? false : kwargs['training']; - var hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training, - count: 3 - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: 3 - }); - } - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - var z; - var r; - var hh; - if (0 < _this.dropout && _this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - var matrixX = dot$1(inputs, _this.kernel.read()); - if (_this.useBias) { - matrixX = biasAdd(matrixX, _this.bias.read()); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - var recurrentKernelValue = _this.recurrentKernel.read(); - var _a = tfc.split(recurrentKernelValue, [2 * _this.units, _this.units], recurrentKernelValue.rank - 1), rk1 = _a[0], rk2 = _a[1]; - var matrixInner = dot$1(hTMinus1, rk1); - var _b = tfc.split(matrixX, 3, matrixX.rank - 1), xZ = _b[0], xR = _b[1], xH = _b[2]; - var _c = tfc.split(matrixInner, 2, matrixInner.rank - 1), recurrentZ = _c[0], recurrentR = _c[1]; - z = _this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); - r = _this.recurrentActivation.apply(tfc.add(xR, recurrentR)); - var recurrentH = dot$1(tfc.mul(r, hTMinus1), rk2); - hh = _this.activation.apply(tfc.add(xH, recurrentH)); - var h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - }; - GRUCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - GRUCell.className = 'GRUCell'; - return GRUCell; - }(RNNCell)); - tfc.serialization.registerClass(GRUCell); - var GRU = /** @class */ (function (_super) { - __extends(GRU, _super); - function GRU(args) { - var _this = this; - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - GRU.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - GRU.fromConfig = function (cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - }; - /** @nocollapse */ - GRU.className = 'GRU'; - return GRU; - }(RNN)); - tfc.serialization.registerClass(GRU); - var LSTMCell = /** @class */ (function (_super) { - __extends(LSTMCell, _super); - function LSTMCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation === undefined ? _this.DEFAULT_ACTIVATION : - args.activation); - _this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - _this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.unitForgetBias = args.unitForgetBias; - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.implementation = args.implementation; - _this.stateSize = [_this.units, _this.units]; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - LSTMCell.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - var biasInitializer; - if (this.useBias) { - if (this.unitForgetBias) { - var capturedBiasInit_1 = this.biasInitializer; - var capturedUnits_1 = this.units; - biasInitializer = new (_a = /** @class */ (function (_super) { - __extends(CustomInit, _super); - function CustomInit() { - return _super !== null && _super.apply(this, arguments) || this; - } - CustomInit.prototype.apply = function (shape, dtype) { - // TODO(cais): More informative variable names? - var bI = capturedBiasInit_1.apply([capturedUnits_1]); - var bF = (new Ones()).apply([capturedUnits_1]); - var bCAndH = capturedBiasInit_1.apply([capturedUnits_1 * 2]); - return concatAlongFirstAxis(concatAlongFirstAxis(bI, bF), bCAndH); - }; - return CustomInit; - }(Initializer)), - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - }; - LSTMCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs; - if (inputs.length !== 3) { - throw new ValueError("LSTMCell expects 3 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var hTMinus1 = inputs[1]; // Previous memory state. - var cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training, - count: 4 - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: 4 - }); - } - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - var i; - var f; - var c; - var o; - if (0 < _this.dropout && _this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - var z = dot$1(inputs, _this.kernel.read()); - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - z = tfc.add(z, dot$1(hTMinus1, _this.recurrentKernel.read())); - if (_this.useBias) { - z = biasAdd(z, _this.bias.read()); - } - var _a = tfc.split(z, 4, z.rank - 1), z0 = _a[0], z1 = _a[1], z2 = _a[2], z3 = _a[3]; - i = _this.recurrentActivation.apply(z0); - f = _this.recurrentActivation.apply(z1); - c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(z2))); - o = _this.recurrentActivation.apply(z3); - var h = tfc.mul(o, _this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - }; - LSTMCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - LSTMCell.className = 'LSTMCell'; - return LSTMCell; - }(RNNCell)); - tfc.serialization.registerClass(LSTMCell); - var LSTM = /** @class */ (function (_super) { - __extends(LSTM, _super); - function LSTM(args) { - var _this = this; - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - LSTM.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - LSTM.fromConfig = function (cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - }; - /** @nocollapse */ - LSTM.className = 'LSTM'; - return LSTM; - }(RNN)); - tfc.serialization.registerClass(LSTM); - var StackedRNNCells = /** @class */ (function (_super) { - __extends(StackedRNNCells, _super); - function StackedRNNCells(args) { - var _this = _super.call(this, args) || this; - _this.cells = args.cells; - return _this; - } - Object.defineProperty(StackedRNNCells.prototype, "stateSize", { - get: function () { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - var stateSize = []; - for (var _i = 0, _a = this.cells.slice().reverse(); _i < _a.length; _i++) { - var cell = _a[_i]; - if (Array.isArray(cell.stateSize)) { - stateSize.push.apply(stateSize, cell.stateSize); - } - else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - }, - enumerable: true, - configurable: true - }); - StackedRNNCells.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - var states = inputs.slice(1); - // Recover per-cell states. - var nestedStates = []; - for (var _i = 0, _a = _this.cells.slice().reverse(); _i < _a.length; _i++) { - var cell = _a[_i]; - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } - else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - // Call the cells in order and store the returned states. - var newNestedStates = []; - var callInputs; - for (var i = 0; i < _this.cells.length; ++i) { - var cell = _this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } - else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs); - newNestedStates.push(callInputs.slice(1)); - } - // Format the new states as a flat list in reverse cell order. - states = []; - for (var _b = 0, _c = newNestedStates.slice().reverse(); _b < _c.length; _b++) { - var cellStates = _c[_b]; - states.push.apply(states, cellStates); - } - return [callInputs[0]].concat(states); - }); - }; - StackedRNNCells.prototype.build = function (inputShape) { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = inputShape[0]; - } - inputShape = inputShape; - var outputDim; - this.cells.forEach(function (cell, i) { - nameScope("RNNCell_" + i, function () { - // TODO(cais): Take care of input constants. - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } - else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim]; - }); - }); - this.built = true; - }; - StackedRNNCells.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var getCellConfig = function (cell) { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - var cellConfigs = this.cells.map(getCellConfig); - var config = { 'cells': cellConfigs }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - StackedRNNCells.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var cells = []; - for (var _i = 0, _a = config['cells']; _i < _a.length; _i++) { - var cellConfig = _a[_i]; - cells.push(deserialize(cellConfig, customObjects)); - } - return new cls({ cells: cells }); - }; - Object.defineProperty(StackedRNNCells.prototype, "trainableWeights", { - get: function () { - if (!this.trainable) { - return []; - } - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.trainableWeights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(StackedRNNCells.prototype, "nonTrainableWeights", { - get: function () { - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.nonTrainableWeights); - } - if (!this.trainable) { - var trainableWeights = []; - for (var _b = 0, _c = this.cells; _b < _c.length; _b++) { - var cell = _c[_b]; - trainableWeights.push.apply(trainableWeights, cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - StackedRNNCells.prototype.getWeights = function () { - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.weights); - } - return batchGetValue(weights); - }; - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - StackedRNNCells.prototype.setWeights = function (weights) { - var tuples = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - var numParams = cell.weights.length; - var inputWeights = weights.splice(numParams); - for (var i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - }; - /** @nocollapse */ - StackedRNNCells.className = 'StackedRNNCells'; - return StackedRNNCells; - }(RNNCell)); - tfc.serialization.registerClass(StackedRNNCells); - function generateDropoutMask(args) { - var ones = args.ones, rate = args.rate, _a = args.training, training = _a === void 0 ? false : _a, _b = args.count, count = _b === void 0 ? 1 : _b; - var droppedInputs = function () { return dropout(ones(), rate); }; - var createMask = function () { return inTrainPhase(droppedInputs, ones, training); }; - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return tfc.keep(createMask().clone()); - } - var masks = Array(count).fill(undefined).map(createMask); - return masks.map(function (m) { return tfc.keep(m.clone()); }); - } - - /** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var ConvRNN2DCell = /** @class */ (function (_super) { - __extends(ConvRNN2DCell, _super); - function ConvRNN2DCell() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ConvRNN2DCell; - }(RNNCell)); - /** - * Base class for convolutional-recurrent layers. - */ - var ConvRNN2D = /** @class */ (function (_super) { - __extends(ConvRNN2D, _super); - function ConvRNN2D(args) { - var _this = this; - if (args.unroll) { - throw new NotImplementedError('Unrolling is not possible with convolutional RNNs.'); - } - if (Array.isArray(args.cell)) { - throw new NotImplementedError('It is not possible at the moment to stack convolutional cells.'); - } - _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - return _this; - } - ConvRNN2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - ConvRNN2D.prototype.computeOutputShape = function (inputShape) { - var outShape = this.computeSingleOutputShape(inputShape); - if (!this.returnSequences) { - outShape = [outShape[0]].concat(outShape.slice(2)); - } - if (this.returnState) { - outShape = [outShape].concat(Array(2).fill([inputShape[0]].concat(outShape.slice(-3)))); - } - return outShape; - }; - ConvRNN2D.prototype.getInitialState = function (inputs) { - var _this = this; - return tfc.tidy(function () { - var stateSize = _this.cell.stateSize; - var inputShape = inputs.shape; - var outputShape = _this.computeSingleOutputShape(inputShape); - var stateShape = [outputShape[0]].concat(outputShape.slice(2)); - var initialState = tfc.zeros(stateShape); - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - return [initialState]; - }); - }; - ConvRNN2D.prototype.resetStates = function (states, training) { - var _this = this; - if (training === void 0) { training = false; } - tfc.tidy(function () { - if (!_this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - var inputShape = _this.inputSpec[0].shape; - var outputShape = _this.computeSingleOutputShape(inputShape); - var stateShape = [outputShape[0]].concat(outputShape.slice(2)); - var batchSize = inputShape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (_this.getStates() == null) { - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = _this.cell.stateSize.map(function () { return tfc.zeros(stateShape); }); - } - else { - _this.states_ = [tfc.zeros(stateShape)]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(_this.states_); - // For stateful RNNs, fully dispose kept old states. - if (_this.keptStates != null) { - tfc.dispose(_this.keptStates); - _this.keptStates = []; - } - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = _this.cell.stateSize.map(function () { return tfc.zeros(stateShape); }); - } - else { - _this.states_[0] = tfc.zeros(stateShape); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== _this.states_.length) { - throw new ValueError("Layer " + _this.name + " expects " + _this.states_.length + " state(s), " + - ("but it received " + states.length + " state value(s). Input ") + - ("received: " + states)); - } - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - _this.keptStates.push(_this.states_.slice()); - } - else { - tfc.dispose(_this.states_); - } - for (var index = 0; index < _this.states_.length; ++index) { - var value = states[index]; - var expectedShape = stateShape; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + - ("expected shape=" + expectedShape + ", received shape=" + value.shape)); - } - _this.states_[index] = value; - } - } - _this.states_ = _this.states_.map(function (state) { return tfc.keep(state.clone()); }); - }); - }; - ConvRNN2D.prototype.computeSingleOutputShape = function (inputShape) { - var _a = this.cell, dataFormat = _a.dataFormat, filters = _a.filters, kernelSize = _a.kernelSize, padding = _a.padding, strides = _a.strides, dilationRate = _a.dilationRate; - var isChannelsFirst = dataFormat === 'channelsFirst'; - var h = inputShape[isChannelsFirst ? 3 : 2]; - var w = inputShape[isChannelsFirst ? 4 : 3]; - var hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - var wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); - var outShape = inputShape.slice(0, 2).concat((isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])); - return outShape; - }; - /** @nocollapse */ - ConvRNN2D.className = 'ConvRNN2D'; - return ConvRNN2D; - }(RNN)); - var ConvLSTM2DCell = /** @class */ (function (_super) { - __extends(ConvLSTM2DCell, _super); - function ConvLSTM2DCell(args) { - var _this = this; - var filters = args.filters, kernelSize = args.kernelSize, strides = args.strides, padding = args.padding, dataFormat = args.dataFormat, dilationRate = args.dilationRate; - _this = _super.call(this, __assign({}, args, { units: filters })) || this; - _this.filters = filters; - assertPositiveInteger(_this.filters, 'filters'); - _this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - _this.kernelSize.forEach(function (size) { return assertPositiveInteger(size, 'kernelSize'); }); - _this.strides = normalizeArray(strides || 1, 2, 'strides'); - _this.strides.forEach(function (stride) { return assertPositiveInteger(stride, 'strides'); }); - _this.padding = padding || 'valid'; - checkPaddingMode(_this.padding); - _this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(_this.dataFormat); - _this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - _this.dilationRate.forEach(function (rate) { return assertPositiveInteger(rate, 'dilationRate'); }); - return _this; - } - ConvLSTM2DCell.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError("The channel dimension of the input should be defined. " + - ("Found " + inputShape[channelAxis])); - } - var inputDim = inputShape[channelAxis]; - var numOfKernels = 4; - var kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - var recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - this.recurrentKernel = this.addWeight('recurrent_kernel', recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - var biasInitializer = void 0; - if (this.unitForgetBias) { - var init_1 = this.biasInitializer; - var filters_1 = this.filters; - biasInitializer = new (_a = /** @class */ (function (_super) { - __extends(CustomInit, _super); - function CustomInit() { - return _super !== null && _super.apply(this, arguments) || this; - } - CustomInit.prototype.apply = function (shape, dtype) { - var biasI = init_1.apply([filters_1]); - var biasF = tfc.ones([filters_1]); - var biasCAndO = init_1.apply([filters_1 * 2]); - return concatenate([biasI, biasF, biasCAndO]); - }; - return CustomInit; - }(Initializer)), - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.built = true; - }; - ConvLSTM2DCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (inputs.length !== 3) { - throw new ValueError("ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var training = kwargs['training'] || false; - var x = inputs[0]; // Current input - var hTMinus1 = inputs[1]; // Previous memory state. - var cTMinus1 = inputs[2]; // Previous carry state. - var numOfKernels = 4; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(x); }, - rate: _this.dropout, - training: training, - count: numOfKernels - }); - } - var dropoutMask = _this.dropoutMask; - var applyDropout = function (x, mask, index) { - if (!mask || !mask[index]) { - return x; - } - return tfc.mul(mask[index], x); - }; - var xI = applyDropout(x, dropoutMask, 0); - var xF = applyDropout(x, dropoutMask, 1); - var xC = applyDropout(x, dropoutMask, 2); - var xO = applyDropout(x, dropoutMask, 3); - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: numOfKernels - }); - } - var recDropoutMask = _this.recurrentDropoutMask; - var hI = applyDropout(hTMinus1, recDropoutMask, 0); - var hF = applyDropout(hTMinus1, recDropoutMask, 1); - var hC = applyDropout(hTMinus1, recDropoutMask, 2); - var hO = applyDropout(hTMinus1, recDropoutMask, 3); - var kernelChannelAxis = 3; - var _a = tfc.split(_this.kernel.read(), numOfKernels, kernelChannelAxis), kernelI = _a[0], kernelF = _a[1], kernelC = _a[2], kernelO = _a[3]; - var _b = _this.useBias ? - tfc.split(_this.bias.read(), numOfKernels) : - [null, null, null, null], biasI = _b[0], biasF = _b[1], biasC = _b[2], biasO = _b[3]; - xI = _this.inputConv(xI, kernelI, biasI, _this.padding); - xF = _this.inputConv(xF, kernelF, biasF, _this.padding); - xC = _this.inputConv(xC, kernelC, biasC, _this.padding); - xO = _this.inputConv(xO, kernelO, biasO, _this.padding); - var _c = tfc.split(_this.recurrentKernel.read(), numOfKernels, kernelChannelAxis), recKernelI = _c[0], recKernelF = _c[1], recKernelC = _c[2], recKernelO = _c[3]; - hI = _this.recurrentConv(hI, recKernelI); - hF = _this.recurrentConv(hF, recKernelF); - hC = _this.recurrentConv(hC, recKernelC); - hO = _this.recurrentConv(hO, recKernelO); - var i = _this.recurrentActivation.apply(tfc.add(xI, hI)); - var f = _this.recurrentActivation.apply(tfc.add(xF, hF)); - var c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(tfc.add(xC, hC)))); - var h = tfc.mul(_this.recurrentActivation.apply(tfc.add(xO, hO)), _this.activation.apply(c)); - return [h, h, c]; - }); - }; - ConvLSTM2DCell.prototype.getConfig = function () { - var _a = _super.prototype.getConfig.call(this), _ = _a["units"], baseConfig = __rest(_a, ['units']); - var config = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - return __assign({}, baseConfig, config); - }; - ConvLSTM2DCell.prototype.inputConv = function (x, w, b, padding) { - var out = tfc.conv2d(x, w, this.strides, (padding || 'valid'), this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', this.dilationRate); - if (b) { - return biasAdd(out, b, this.dataFormat); - } - return out; - }; - ConvLSTM2DCell.prototype.recurrentConv = function (x, w) { - var strides = 1; - return tfc.conv2d(x, w, strides, 'same', this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - }; - /** @nocollapse */ - ConvLSTM2DCell.className = 'ConvLSTM2DCell'; - return ConvLSTM2DCell; - }(LSTMCell)); - tfc.serialization.registerClass(ConvLSTM2DCell); - var ConvLSTM2D = /** @class */ (function (_super) { - __extends(ConvLSTM2D, _super); - function ConvLSTM2D(args) { - var _this = this; - var cell = new ConvLSTM2DCell(args); - _this = _super.call(this, __assign({}, args, { cell: cell })) || this; - return _this; - } - /** @nocollapse */ - ConvLSTM2D.fromConfig = function (cls, config) { - return new cls(config); - }; - /** @nocollapse */ - ConvLSTM2D.className = 'ConvLSTM2D'; - return ConvLSTM2D; - }(ConvRNN2D)); - tfc.serialization.registerClass(ConvLSTM2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var Dropout = /** @class */ (function (_super) { - __extends(Dropout, _super); - function Dropout(args) { - var _this = _super.call(this, args) || this; - _this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - _this.noiseShape = args.noiseShape; - _this.seed = args.seed; - _this.supportsMasking = true; - return _this; - } - Dropout.prototype.getNoiseShape = function (input) { - if (this.noiseShape == null) { - return this.noiseShape; - } - var inputShape = input.shape; - var noiseShape = []; - for (var i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - }; - Dropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (0 < _this.rate && _this.rate < 1) { - var training = kwargs['training'] == null ? false : kwargs['training']; - var noiseShape_1 = _this.getNoiseShape(input); - var output = inTrainPhase(function () { return dropout(input, _this.rate, noiseShape_1, _this.seed); }, function () { return input; }, training); - return output; - } - return inputs; - }); - }; - Dropout.prototype.getConfig = function () { - var config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Dropout.prototype.dispose = function () { - return _super.prototype.dispose.call(this); - }; - /** @nocollapse */ - Dropout.className = 'Dropout'; - return Dropout; - }(Layer)); - tfc.serialization.registerClass(Dropout); - var SpatialDropout1D = /** @class */ (function (_super) { - __extends(SpatialDropout1D, _super); - function SpatialDropout1D(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [{ ndim: 3 }]; - return _this; - } - SpatialDropout1D.prototype.getNoiseShape = function (input) { - var inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - }; - /** @nocollapse */ - SpatialDropout1D.className = 'SpatialDropout1D'; - return SpatialDropout1D; - }(Dropout)); - tfc.serialization.registerClass(SpatialDropout1D); - var Dense = /** @class */ (function (_super) { - __extends(Dense, _super); - function Dense(args) { - var _this = _super.call(this, args) || this; - // Default activation: Linear (none). - _this.activation = null; - _this.useBias = true; - _this.kernel = null; - _this.bias = null; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - _this.batchInputShape = [batchSize, args.inputDim]; - } - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation); - if (args.useBias != null) { - _this.useBias = args.useBias; - } - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.supportsMasking = true; - _this.inputSpec = [{ minNDim: 2 }]; - return _this; - } - Dense.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - } - this.inputSpec = [{ minNDim: 2, axes: (_a = {}, _a[-1] = inputLastDim, _a) }]; - this.built = true; - }; - Dense.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - }; - Dense.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - var input = getExactlyOneTensor(inputs); - var fusedActivationName = mapActivationToFusedKernel(_this.activation.getClassName()); - var output; - if (fusedActivationName != null) { - output = dot$1(input, _this.kernel.read(), fusedActivationName, _this.bias ? _this.bias.read() : null); - } - else { - output = dot$1(input, _this.kernel.read()); - if (_this.bias != null) { - output = biasAdd(output, _this.bias.read()); - } - if (_this.activation != null) { - output = _this.activation.apply(output); - } - } - return output; - }); - }; - Dense.prototype.getConfig = function () { - var config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Dense.className = 'Dense'; - return Dense; - }(Layer)); - tfc.serialization.registerClass(Dense); - var Flatten = /** @class */ (function (_super) { - __extends(Flatten, _super); - function Flatten(args) { - var _this = this; - args = args || {}; - _this = _super.call(this, args) || this; - _this.inputSpec = [{ minNDim: 3 }]; - _this.dataFormat = args.dataFormat; - return _this; - } - Flatten.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - for (var _i = 0, _a = inputShape.slice(1); _i < _a.length; _i++) { - var dim = _a[_i]; - if (dim == null) { - throw new ValueError("The shape of the input to \"Flatten\" is not fully defined " + - ("(got " + inputShape.slice(1) + "). Make sure to pass a complete ") + - "\"input_shape\" or \"batch_input_shape\" argument to the first " + - "layer in your model."); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - }; - Flatten.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsFirst' && input.rank > 1) { - var permutation = [0]; - for (var i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - return batchFlatten(input); - }); - }; - Flatten.prototype.getConfig = function () { - var config = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Flatten.className = 'Flatten'; - return Flatten; - }(Layer)); - tfc.serialization.registerClass(Flatten); - var Activation$1 = /** @class */ (function (_super) { - __extends(Activation, _super); - function Activation(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.activation = getActivation(args.activation); - return _this; - } - Activation.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - return _this.activation.apply(input); - }); - }; - Activation.prototype.getConfig = function () { - var config = { activation: serializeActivation(this.activation) }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Activation.className = 'Activation'; - return Activation; - }(Layer)); - tfc.serialization.registerClass(Activation$1); - var RepeatVector = /** @class */ (function (_super) { - __extends(RepeatVector, _super); - function RepeatVector(args) { - var _this = _super.call(this, args) || this; - _this.n = args.n; - _this.inputSpec = [{ ndim: 2 }]; - return _this; - } - RepeatVector.prototype.computeOutputShape = function (inputShape) { - return [inputShape[0], this.n, inputShape[1]]; - }; - RepeatVector.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - return repeat(inputs, _this.n); - }); - }; - RepeatVector.prototype.getConfig = function () { - var config = { - n: this.n, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - RepeatVector.className = 'RepeatVector'; - return RepeatVector; - }(Layer)); - tfc.serialization.registerClass(RepeatVector); - var Reshape$1 = /** @class */ (function (_super) { - __extends(Reshape, _super); - function Reshape(args) { - var _this = _super.call(this, args) || this; - _this.targetShape = args.targetShape; - // Make sure that all unknown dimensions are represented as `null`. - for (var i = 0; i < _this.targetShape.length; ++i) { - if (_this.isUnknown(_this.targetShape[i])) { - _this.targetShape[i] = null; - } - } - return _this; - } - Reshape.prototype.isUnknown = function (dim) { - return dim < 0 || dim == null; - }; - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - Reshape.prototype.fixUnknownDimension = function (inputShape, outputShape) { - var errorMsg = 'Total size of new array must be unchanged.'; - var finalShape = outputShape.slice(); - var known = 1; - var unknown = null; - for (var i = 0; i < finalShape.length; ++i) { - var dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } - else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } - else { - known *= dim; - } - } - var originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } - else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - return finalShape; - }; - Reshape.prototype.computeOutputShape = function (inputShape) { - var anyUnknownDims = false; - for (var i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } - else { - return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - }; - Reshape.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var outputShape = inputShape.slice(0, 1).concat(_this.fixUnknownDimension(inputShape.slice(1), _this.targetShape)); - return input.reshape(outputShape); - }); - }; - Reshape.prototype.getConfig = function () { - var config = { - targetShape: this.targetShape, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Reshape.className = 'Reshape'; - return Reshape; - }(Layer)); - tfc.serialization.registerClass(Reshape$1); - var Permute = /** @class */ (function (_super) { - __extends(Permute, _super); - function Permute(args) { - var _this = _super.call(this, args) || this; - if (args.dims == null) { - throw new Error('Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error('Permute constructor requires `dims` to be an Array, but received ' + - (args.dims + " instead.")); - } - // Check the validity of the permutation indices. - var expectedSortedIndices = range(1, args.dims.length + 1); - if (!tfc.util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error('Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - _this.dims = args.dims; - _this.dimsIncludingBatch = [0].concat(_this.dims); - _this.inputSpec = [new InputSpec({ ndim: _this.dims.length + 1 })]; - return _this; - } - Permute.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - this.dims.forEach(function (dim, i) { - outputShape[i + 1] = inputShape[dim]; - }); - return outputShape; - }; - Permute.prototype.call = function (inputs, kwargs) { - return tfc.transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - }; - Permute.prototype.getConfig = function () { - var config = { - dims: this.dims, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Permute.className = 'Permute'; - return Permute; - }(Layer)); - tfc.serialization.registerClass(Permute); - var Masking = /** @class */ (function (_super) { - __extends(Masking, _super); - function Masking(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.supportsMasking = true; - if (args != null) { - _this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } - else { - _this.maskValue = 0; - } - return _this; - } - Masking.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - Masking.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { maskValue: this.maskValue }; - Object.assign(config, baseConfig); - return config; - }; - Masking.prototype.computeMask = function (inputs, mask) { - var input = getExactlyOneTensor(inputs); - var axis = -1; - return tfc.any(tfc.notEqual(input, this.maskValue), axis); - }; - Masking.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var axis = -1; - var keepDims = true; - var booleanMask = tfc.any(tfc.notEqual(input, _this.maskValue), axis, keepDims); - var output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - }; - /** @nocollapse */ - Masking.className = 'Masking'; - return Masking; - }(Layer)); - tfc.serialization.registerClass(Masking); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var Embedding = /** @class */ (function (_super) { - __extends(Embedding, _super); - function Embedding(args) { - var _this = _super.call(this, args) || this; - _this.embeddings = null; - _this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - _this.batchInputShape = [batchSize, null]; - } - else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - _this.batchInputShape = - [batchSize].concat(toList(args.inputLength)); - } - } - _this.inputDim = args.inputDim; - assertPositiveInteger(_this.inputDim, 'inputDim'); - _this.outputDim = args.outputDim; - assertPositiveInteger(_this.outputDim, 'outputDim'); - _this.embeddingsInitializer = getInitializer(args.embeddingsInitializer || _this.DEFAULT_EMBEDDINGS_INITIALIZER); - _this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - _this.maskZero = args.maskZero; - _this.supportsMasking = args.maskZero; - _this.inputLength = args.inputLength; - return _this; - } - Embedding.prototype.build = function (inputShape) { - this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); - this.built = true; - }; - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - Embedding.prototype.warnOnIncompatibleInputShape = function (inputShape) { }; - Embedding.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - if (!_this.maskZero) { - return null; - } - else { - inputs = getExactlyOneTensor(inputs); - return tfc.notEqual(inputs, tfc.zerosLike(inputs)); - } - }); - }; - Embedding.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return inputShape.concat([this.outputDim]); - } - // inputLength can be an array if input is 3D or higher. - var inLens = toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + - ("input shape has shape " + inputShape)); - } - else { - var i = 0; - for (var k = 0; k < inLens.length; ++k) { - var s1 = inLens[k]; - var s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + - ("input shape has shape " + inputShape)); - } - else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0]].concat(inLens, [this.outputDim]); - }; - Embedding.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - var input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = cast$1(input, 'int32'); - } - var output = gather$1(_this.embeddings.read(), input.as1D()); - return output.reshape(getExactlyOneShape(_this.computeOutputShape(input.shape))); - }); - }; - Embedding.prototype.getConfig = function () { - var config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Embedding.className = 'Embedding'; - return Embedding; - }(Layer)); - tfc.serialization.registerClass(Embedding); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ - var Merge = /** @class */ (function (_super) { - __extends(Merge, _super); - function Merge(args) { - var _this = _super.call(this, args || {}) || this; - _this.supportsMasking = true; - return _this; - } - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - Merge.prototype.mergeFunction = function (inputs) { - throw new NotImplementedError(); - }; - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - Merge.prototype.computeElementwiseOpOutputShape = function (shape1, shape2) { - if (shape1 == null || shape2 == null) { - return null; - } - else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } - else if (shape2.length === 0) { - return shape1; - } - var outputShape = shape1.slice(0, shape1.length - shape2.length); - for (var k = 0; k < shape2.length; ++k) { - var i = shape1[shape1.length - shape2.length + k]; - var j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } - else if (i === 1) { - outputShape.push(j); - } - else if (j === 1) { - outputShape.push(i); - } - else { - if (i !== j) { - throw new ValueError('Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - }; - Merge.prototype.build = function (inputShape) { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape; - if (inputShape.length < 2) { - throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + - (" Got " + inputShape.length + " input(s).")); - } - // Make sure that there is at most one unique batch size among the input - // shapes. - var batchSizes = []; - for (var _i = 0, inputShape_1 = inputShape; _i < inputShape_1.length; _i++) { - var shape = inputShape_1[_i]; - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError("Can not merge tensors with different batch sizes. " + - ("Got tensors with shapes: " + JSON.stringify(inputShape) + ".")); - } - var outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); - for (var i = 1; i < inputShape.length; ++i) { - var shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - var allRanks = inputShape.map(function (shape) { return shape.length; }); - if (inputShape.indexOf(null) === -1 && - unique$1(allRanks).length === 1) { - this.reshapeRequired = false; - } - else { - this.reshapeRequired = true; - } - }; - Merge.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (_this.reshapeRequired) { - var reshapedInputs = []; - var inputDims = inputs.map(function (input) { return input.rank; }); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - var maxNDim = max$1(inputDims); - for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { - var x = inputs_1[_i]; - var xNDim = x.rank; - for (var k = 0; k < maxNDim - xNDim; ++k) { - x = expandDims$1(x, 1); - } - reshapedInputs.push(x); - } - return _this.mergeFunction(reshapedInputs); - } - else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - var transposed = false; - for (var _a = 0, inputs_2 = inputs; _a < inputs_2.length; _a++) { - var x = inputs_2[_a]; - var xNDim = x.rank; - if (xNDim == null) { - var xShape = x.shape; - var batchSize = xShape[0]; - var newShape = xShape.slice(1).concat([batchSize]); - var xTransposed = x.reshape([batchSize].concat(arrayProd(xShape.slice(1)))); - xTransposed = tfc.transpose(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } - else if (xNDim > 1) { - var dims = range(1, xNDim).concat([0]); - reshapedInputs.push(tfc.transpose(x, dims)); - transposed = true; - } - else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - var y = _this.mergeFunction(reshapedInputs); - var yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - var yShape = y.shape; - var yNDim_1 = yShape.length; - var batchSize = yShape[yNDim_1 - 1]; - var newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } - else if (yNDim > 1) { - var dims = [yNDim - 1].concat(range(0, yNDim - 1)); - y = tfc.transpose(y, dims); - } - } - return y; - } - } - else { - return _this.mergeFunction(inputs); - } - }); - }; - Merge.prototype.computeOutputShape = function (inputShape) { - inputShape = inputShape; - var outputShape; - if (inputShape[0] == null) { - outputShape = null; - } - else { - outputShape = inputShape[0].slice(1); - } - for (var i = 1; i < inputShape.length; ++i) { - var shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - var batchSizes = []; - for (var _i = 0, inputShape_2 = inputShape; _i < inputShape_2.length; _i++) { - var shape = inputShape_2[_i]; - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } - else { - outputShape = [null].concat(outputShape); - } - return outputShape; - }; - Merge.prototype.computeMask = function (inputs, mask) { - return tfc.tidy(function () { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError("The Array 'inputs' and 'mask' are expected to have the same " + - "length, but have different lengths " + - ("(" + inputs.length + " vs " + mask.length + ")")); - } - if (mask.every(function (m) { return m == null; })) { - return null; - } - mask = mask.map(function (m) { return m == null ? m : tfc.expandDims(m, 0); }); - var output = mask[0]; - for (var i = 1; i < mask.length - 1; ++i) { - output = tfc.logicalAnd(output, mask[i]); - } - return output; - }); - }; - return Merge; - }(Layer)); - var Add$1 = /** @class */ (function (_super) { - __extends(Add, _super); - function Add(args) { - return _super.call(this, args) || this; - } - Add.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Add.className = 'Add'; - return Add; - }(Merge)); - tfc.serialization.registerClass(Add$1); - var Multiply$1 = /** @class */ (function (_super) { - __extends(Multiply, _super); - function Multiply(args) { - return _super.call(this, args) || this; - } - Multiply.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.mul(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Multiply.className = 'Multiply'; - return Multiply; - }(Merge)); - tfc.serialization.registerClass(Multiply$1); - var Average = /** @class */ (function (_super) { - __extends(Average, _super); - function Average(args) { - return _super.call(this, args) || this; - } - Average.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return tfc.mul(1 / inputs.length, output); - }); - }; - /** @nocollapse */ - Average.className = 'Average'; - return Average; - }(Merge)); - tfc.serialization.registerClass(Average); - var Maximum$1 = /** @class */ (function (_super) { - __extends(Maximum, _super); - function Maximum(args) { - return _super.call(this, args) || this; - } - Maximum.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0]; - for (var i = 1; i < inputs.length; ++i) { - output = tfc.maximum(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Maximum.className = 'Maximum'; - return Maximum; - }(Merge)); - tfc.serialization.registerClass(Maximum$1); - var Minimum$1 = /** @class */ (function (_super) { - __extends(Minimum, _super); - function Minimum(args) { - return _super.call(this, args) || this; - } - Minimum.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0]; - for (var i = 1; i < inputs.length; ++i) { - output = tfc.minimum(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Minimum.className = 'Minimum'; - return Minimum; - }(Merge)); - tfc.serialization.registerClass(Minimum$1); - var Concatenate = /** @class */ (function (_super) { - __extends(Concatenate, _super); - function Concatenate(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_AXIS = -1; - if (args == null) { - args = {}; - } - _this.axis = args.axis == null ? _this.DEFAULT_AXIS : args.axis; - _this.supportsMasking = true; - _this.reshapeRequired = false; - return _this; - } - Concatenate.prototype.build = function (inputShape) { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape; - var allNoneShape = true; - for (var _i = 0, inputShape_3 = inputShape; _i < inputShape_3.length; _i++) { - var shape = inputShape_3[_i]; - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - var shapeSet = []; - for (var i = 0; i < inputShape.length; ++i) { - var shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - var exists = false; - for (var _a = 0, shapeSet_1 = shapeSet; _a < shapeSet_1.length; _a++) { - var shape = shapeSet_1[_a]; - if (tfc.util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - }; - Concatenate.prototype.mergeFunction = function (inputs) { - var _this = this; - return tfc.tidy(function () { - return concatenate(inputs, _this.axis); - }); - }; - Concatenate.prototype.computeOutputShape = function (inputShape) { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); - } - var inputShapes = inputShape; - var outputShape = inputShapes[0].slice(); - var axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (var _i = 0, _a = inputShapes.slice(1); _i < _a.length; _i++) { - var shape = _a[_i]; - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - }; - Concatenate.prototype.computeMask = function (inputs, mask) { - var _this = this; - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError("Mismatch in the length of mask (" + mask.length + ") " + - ("and the legnth of inputs (" + inputs.length + ")")); - } - return tfc.tidy(function () { - var allNullMasks = true; - mask.forEach(function (m) { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - var outputMasks = []; - for (var i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(tfc.onesLike(inputs[i]).asType('bool')); - } - else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(tfc.expandDims(mask[i], -1)); - } - else { - outputMasks.push(mask[i]); - } - } - var concatenatedMasks = tfc.concat(outputMasks, _this.axis); - return tfc.all(concatenatedMasks, -1, false); - }); - }; - Concatenate.prototype.getConfig = function () { - var config = { - 'axis': this.axis, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Concatenate.className = 'Concatenate'; - return Concatenate; - }(Merge)); - tfc.serialization.registerClass(Concatenate); - /** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ - function interpretAxis(axis, dim) { - while (axis < 0) { - axis += dim; - } - return axis; - } - function batchDot(x, y, axes) { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError('batchDot is not implemented for tensors of 4D or higher rank yet'); - } - tfc.util.assert(x.shape.length >= 2, function () { return "batchDot requires the rank of x to be >= 2, " + - ("but got " + x.shape.length); }); - tfc.util.assert(x.shape.length >= 2, function () { return "batchDot requires the rank of y to be >= 2, " + - ("but got " + y.shape.length); }); - if (typeof axes === 'number') { - axes = [axes, axes]; - } - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError('batchDot is not implemented for complex64-type Tensors yet.'); - } - var xNDim = x.shape.length; - var yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - var axesArray = axes; - return tfc.tidy(function () { - var diff; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - var diffShape = []; - for (var i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } - else if (yNDim > xNDim) { - diff = yNDim - xNDim; - var diffShape = []; - for (var i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } - else { - diff = 0; - } - var out; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } - else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } - else { - var adjX = axesArray[0] !== x.shape.length - 1; - var adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - if (diff > 0) { - var idx = void 0; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } - else { - idx = xNDim - 1; - } - var squeezeAxes = []; - for (var i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); - } - var Dot = /** @class */ (function (_super) { - __extends(Dot, _super); - function Dot(args) { - var _this = _super.call(this, args) || this; - _this.axes = args.axes; - _this.normalize = args.normalize == null ? false : args.normalize; - _this.supportsMasking = true; - _this.reshapeRequired = false; - return _this; - } - Dot.prototype.build = function (inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), function () { return 'A `Dot` layer should be called on a list of exactly 2 inputs.'; }); - var shape1 = inputShape[0]; - var shape2 = inputShape[1]; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - var axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError("Dimension incompatibility: " + - (shape1[axes[0]] + " !== " + shape2[axes[1]])); - } - }; - Dot.prototype.mergeFunction = function (inputs) { - if (inputs.length !== 2) { - throw new ValueError('A `Dot` layer must be called on exactly 2 inputs, ' + - ("but received " + inputs.length + " input(s).")); - } - var x1 = inputs[0]; - var x2 = inputs[1]; - var axes; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } - else { - axes = this.axes.map(function (axis, i) { return interpretAxis(axis, inputs[i].shape.length); }); - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - }; - Dot.prototype.interpretAxes = function (shape1, shape2) { - var axes; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } - else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - }; - Dot.prototype.computeOutputShape = function (inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), function () { return 'A `Dot` layer should be called on a list of exactly 2 inputs.'; }); - var shape1 = inputShape[0].slice(); - var shape2 = inputShape[1].slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - var axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - var outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - }; - Dot.prototype.computeMask = function (inputs, mask) { - return null; - }; - Dot.prototype.getConfig = function () { - var config = { - 'axes': this.axes, - 'normalize': this.normalize - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Dot.className = 'Dot'; - return Dot; - }(Merge)); - tfc.serialization.registerClass(Dot); - // TODO(cais): Add functional interfaces for the merge layers. - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var GaussianNoise = /** @class */ (function (_super) { - __extends(GaussianNoise, _super); - function GaussianNoise(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.stddev = args.stddev; - return _this; - } - GaussianNoise.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - GaussianNoise.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { stddev: this.stddev }; - Object.assign(config, baseConfig); - return config; - }; - GaussianNoise.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var noised = function () { - return randomNormal(input.shape, 0, _this.stddev).add(input); - }; - var output = inTrainPhase(noised, function () { return input; }, kwargs['training'] || false); - return output; - }); - }; - /** @nocollapse */ - GaussianNoise.className = 'GaussianNoise'; - return GaussianNoise; - }(Layer)); - tfc.serialization.registerClass(GaussianNoise); - var GaussianDropout = /** @class */ (function (_super) { - __extends(GaussianDropout, _super); - function GaussianDropout(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.rate = args.rate; - return _this; - } - GaussianDropout.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - GaussianDropout.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - }; - GaussianDropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (_this.rate > 0 && _this.rate < 1) { - var noised = function () { - var stddev = Math.sqrt(_this.rate / (1 - _this.rate)); - return input.mul(randomNormal(input.shape, 1, stddev)); - }; - return inTrainPhase(noised, function () { return input; }, kwargs['training'] || false); - } - return input; - }); - }; - /** @nocollapse */ - GaussianDropout.className = 'GaussianDropout'; - return GaussianDropout; - }(Layer)); - tfc.serialization.registerClass(GaussianDropout); - /** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ - var AlphaDropout = /** @class */ (function (_super) { - __extends(AlphaDropout, _super); - function AlphaDropout(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.rate = args.rate; - _this.noiseShape = args.noiseShape; - return _this; - } - AlphaDropout.prototype._getNoiseShape = function (inputs) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - }; - AlphaDropout.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - AlphaDropout.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - }; - AlphaDropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.rate < 1 && _this.rate > 0) { - var noiseShape_1 = _this._getNoiseShape(inputs); - var droppedInputs = function () { - var input = getExactlyOneTensor(inputs); - var alpha = 1.6732632423543772848170429916717; - var scale = 1.0507009873554804934193349852946; - var alphaP = -alpha * scale; - var keptIdx = tfc.greaterEqual(tfc.randomUniform(noiseShape_1), _this.rate); - keptIdx = cast$1(keptIdx, 'float32'); // get default dtype. - // Get affine transformation params. - var a = Math.pow(((1 - _this.rate) * (1 + _this.rate * Math.pow(alphaP, 2))), -0.5); - var b = -a * alphaP * _this.rate; - // Apply mask. - var x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - return x.mul(a).add(b); - }; - return inTrainPhase(droppedInputs, function () { return getExactlyOneTensor(inputs); }, kwargs['training'] || false); - } - return inputs; - }); - }; - /** @nocollapse */ - AlphaDropout.className = 'AlphaDropout'; - return AlphaDropout; - }(Layer)); - tfc.serialization.registerClass(AlphaDropout); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ - function batchNormalization(x, mean, variance, beta, gamma, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - var out; - if (x.rank === 2) { - out = tfc.batchNorm2d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = tfc.batchNorm3d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 4) { - out = tfc.batchNorm4d(x, mean, variance, beta, gamma, epsilon); - } - else { - throw new NotImplementedError("batchNormalization is not implemented for array of rank " + x.rank + " " + - "yet"); - } - return out; - } - /** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - return tfc.tidy(function () { - var meanAndVariance = tfc.moments(x, reductionAxes); - var mean = meanAndVariance.mean; - var variance = meanAndVariance.variance; - var normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }); - } - /** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - return tfc.tidy(function () { - var meanAndVariance = tfc.moments(x, reductionAxes); - var mean = meanAndVariance.mean; - var variance = meanAndVariance.variance; - var targetShape = []; - for (var _i = 0, _a = range(0, x.rank); _i < _a.length; _i++) { - var axis = _a[_i]; - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } - else { - targetShape.push(x.shape[axis]); - } - } - var broadcastMean = mean.reshape(targetShape); - var broadcastVariance = variance.reshape(targetShape); - var broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); - var broadcastBeta = beta == null ? null : beta.reshape(targetShape); - var normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); - return [normed, mean, variance]; - }); - } - /** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ - function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - if (tfc.util.arraysEqual(reductionAxes.slice().sort(), range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - } - var BatchNormalization = /** @class */ (function (_super) { - __extends(BatchNormalization, _super); - function BatchNormalization(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.axis = args.axis == null ? -1 : args.axis; - _this.momentum = args.momentum == null ? 0.99 : args.momentum; - _this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - _this.center = args.center == null ? true : args.center; - _this.scale = args.scale == null ? true : args.scale; - _this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - _this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - _this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - _this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - _this.betaConstraint = getConstraint(args.betaConstraint); - _this.gammaConstraint = getConstraint(args.gammaConstraint); - _this.betaRegularizer = getRegularizer(args.betaRegularizer); - _this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - return _this; - } - BatchNormalization.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - var dim = inputShape[axis]; - if (dim == null) { - throw new ValueError("Axis " + axis + " of input tensor should have a defined dimension but " + - "the layer received an input with shape " + - (JSON.stringify(inputShape) + ".")); - } - this.inputSpec = - [new InputSpec({ ndim: inputShape.length, axes: (_a = {}, _a[axis] = dim, _a) })]; - var shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); - } - this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); - this.built = true; - }; - BatchNormalization.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var training = kwargs['training'] == null ? false : kwargs['training']; - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var ndim = inputShape.length; - var reductionAxes = range(0, ndim); - var axis = _this.axis >= 0 ? _this.axis : (_this.axis + ndim); - reductionAxes.splice(axis, 1); - var broadcastShape = pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - var sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - var needsBroadcasting = !tfc.util.arraysEqual(sortedReductionAxes, range(0, ndim).slice(0, ndim - 1)); - var normalizeInference = function () { - if (needsBroadcasting) { - var broadcastMovingMean = _this.movingMean.read().reshape(broadcastShape); - var broadcastMovingVariance = _this.movingVariance.read().reshape(broadcastShape); - var broadcastBeta = _this.center ? _this.beta.read().reshape(broadcastShape) : null; - var broadcastGamma = _this.scale ? _this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, _this.epsilon); - } - else { - return batchNormalization(input, _this.movingMean.read(), _this.movingVariance.read(), _this.beta == null ? null : _this.beta.read(), _this.gamma == null ? null : _this.gamma.read(), _this.epsilon); - } - }; - if (!training) { - return normalizeInference(); - } - var _a = normalizeBatchInTraining(input, _this.gamma.read(), _this.beta.read(), reductionAxes, _this.epsilon), normedTraining = _a[0], mean = _a[1], variance = _a[2]; - var doMovingAverage = function (variable, value, momentum) { - tfc.tidy(function () { - var decay = 1 - momentum; - var origValue = variable.read(); - var updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - var updateMovingMeanAndVariance = function () { - doMovingAverage(_this.movingMean, mean, _this.momentum); - doMovingAverage(_this.movingVariance, variance, _this.momentum); - }; - updateMovingMeanAndVariance(); - return normedTraining; - }); - }; - BatchNormalization.prototype.getConfig = function () { - var config = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - BatchNormalization.className = 'BatchNormalization'; - return BatchNormalization; - }(Layer)); - tfc.serialization.registerClass(BatchNormalization); - var LayerNormalization = /** @class */ (function (_super) { - __extends(LayerNormalization, _super); - function LayerNormalization(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.axis = args.axis == null ? -1 : args.axis; - if (typeof _this.axis === 'number') { - if (!Number.isInteger(_this.axis)) { - throw new Error("Expected axis to be an integer, but received " + _this.axis); - } - } - else if (Array.isArray(_this.axis)) { - for (var _i = 0, _a = _this.axis; _i < _a.length; _i++) { - var axis = _a[_i]; - if (!Number.isInteger(axis)) { - throw new Error("Expected axis to be an array of integers, " + - ("but received " + JSON.stringify(_this.axis))); - } - } - } - else { - throw new Error("Expected axis to be an integer or an array of integers, " + - ("but received " + JSON.stringify(_this.axis))); - } - _this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - _this.center = args.center == null ? true : args.center; - _this.scale = args.scale == null ? true : args.scale; - _this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - _this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - _this.betaRegularizer = getRegularizer(args.betaRegularizer); - _this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - _this.supportsMasking = true; - return _this; - } - LayerNormalization.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var nDims = inputShape.length; - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (var i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - // Further validate axes. - for (var _i = 0, _a = this.axis; _i < _a.length; _i++) { - var axis = _a[_i]; - if (axis < 0 || axis >= nDims) { - throw new Error("Invalid axis: " + axis); - } - } - if (this.axis.length !== unique$1(this.axis).length) { - throw new Error("Found duplicate axes in: " + this.axis); - } - var paramShape = this.axis.map(function (axis) { return inputShape[axis]; }); - var trainable = true; - if (this.scale) { - this.gamma = this.addWeight('gamma', paramShape, 'float32', this.gammaInitializer, this.gammaRegularizer, trainable); - } - else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight('beta', paramShape, 'float32', this.betaInitializer, this.betaRegularizer, trainable); - } - else { - this.beta = null; - } - this.built = true; - }; - LayerNormalization.prototype.call = function (inputs, kwargs) { - var _this = this; - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var nDims = inputShape.length; - return tfc.tidy(function () { - var keepDims = true; - var _a = tfc.moments(input, _this.axis, keepDims), mean = _a.mean, variance = _a.variance; - var broadcastShape = pyListRepeat(1, nDims); - for (var _i = 0, _b = _this.axis; _i < _b.length; _i++) { - var dim = _b[_i]; - broadcastShape[dim] = inputShape[dim]; - } - var broadcast = function (v) { - if (v != null && v.shape.length !== nDims && - _this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } - else { - return v; - } - }; - var scale = broadcast(_this.gamma.read()); - var offset = broadcast(_this.beta.read()); - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - var momentsTiling = []; - var scaleOffsetTiling = []; - for (var i = 0; i < nDims; ++i) { - if (_this.axis.indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } - else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - return batchNormalization(input, mean, variance, offset, scale, _this.epsilon); - }); - }; - LayerNormalization.prototype.getConfig = function () { - var config = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - LayerNormalization.className = 'LayerNormalization'; - return LayerNormalization; - }(Layer)); - tfc.serialization.registerClass(LayerNormalization); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ - function spatial2dPadding(x, padding, dataFormat) { - return tfc.tidy(function () { - if (x.rank !== 4) { - throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a " + - (x.rank + "-D tensor.")); - } - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError("Unknown data format: " + dataFormat + ". " + - "Supported data formats are 'channelsLast' and 'channelsFirst."); - } - var pattern; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } - else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - return tfc.pad(x, pattern); - }); - } - var ZeroPadding2D = /** @class */ (function (_super) { - __extends(ZeroPadding2D, _super); - function ZeroPadding2D(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - _this.padding = [[1, 1], [1, 1]]; - } - else if (typeof args.padding === 'number') { - _this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } - else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but " + - ("received a length-" + args.padding.length + " array.")); - } - var heightPadding = void 0; - var widthPadding = void 0; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1], args.padding[1]]; - } - else { - args.padding = args.padding; - if (args.padding[0].length !== 2) { - throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, " + - ("but received a length-" + args.padding[0].length + " array.")); - } - heightPadding = args.padding[0]; - if (args.padding[1].length !== 2) { - throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, " + - ("but received a length-" + args.padding[1].length + " array.")); - } - widthPadding = args.padding[1]; - } - _this.padding = [heightPadding, widthPadding]; - } - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - ZeroPadding2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows; - var cols; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - }; - ZeroPadding2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { return spatial2dPadding(getExactlyOneTensor(inputs), _this.padding, _this.dataFormat); }); - }; - ZeroPadding2D.prototype.getConfig = function () { - var config = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ZeroPadding2D.className = 'ZeroPadding2D'; - return ZeroPadding2D; - }(Layer)); - tfc.serialization.registerClass(ZeroPadding2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ - function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - var y; - var paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = tfc.maxPool(x, poolSize, strides, paddingString); - } - else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = tfc.avgPool( - // TODO(cais): Rank check? - x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); - } - /** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ - function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x, dataFormat); - var y; - var paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = tfc.maxPool3d(x, poolSize, strides, paddingString); - } - else { // 'avg' - y = tfc.avgPool3d(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); - } - /** - * Abstract class for different pooling 1D layers. - */ - var Pooling1D = /** @class */ (function (_super) { - __extends(Pooling1D, _super); - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - function Pooling1D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = 2; - } - _this = _super.call(this, args) || this; - if (typeof args.poolSize === 'number') { - _this.poolSize = [args.poolSize]; - } - else if (Array.isArray(args.poolSize) && - args.poolSize.length === 1 && - typeof args.poolSize[0] === 'number') { - _this.poolSize = args.poolSize; - } - else { - throw new ValueError("poolSize for 1D convolutional layer must be a number or an " + - "Array of a single number, but received " + - ("" + JSON.stringify(args.poolSize))); - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else { - if (typeof args.strides === 'number') { - _this.strides = [args.strides]; - } - else if (Array.isArray(args.strides) && - args.strides.length === 1 && - typeof args.strides[0] === 'number') { - _this.strides = args.strides; - } - else { - throw new ValueError("strides for 1D convolutional layer must be a number or an " + - "Array of a single number, but received " + - ("" + JSON.stringify(args.strides))); - } - } - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - return _this; - } - Pooling1D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - }; - Pooling1D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = expandDims$1(getExactlyOneTensor(inputs), 2); - var output = _this.poolingFunction(getExactlyOneTensor(inputs), [_this.poolSize[0], 1], [_this.strides[0], 1], _this.padding, 'channelsLast'); - // Remove dummy last dimension. - return tfc.squeeze(output, [2]); - }); - }; - Pooling1D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling1D; - }(Layer)); - var MaxPooling1D = /** @class */ (function (_super) { - __extends(MaxPooling1D, _super); - function MaxPooling1D(args) { - return _super.call(this, args) || this; - } - MaxPooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling1D.className = 'MaxPooling1D'; - return MaxPooling1D; - }(Pooling1D)); - tfc.serialization.registerClass(MaxPooling1D); - var AveragePooling1D = /** @class */ (function (_super) { - __extends(AveragePooling1D, _super); - function AveragePooling1D(args) { - return _super.call(this, args) || this; - } - AveragePooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling1D.className = 'AveragePooling1D'; - return AveragePooling1D; - }(Pooling1D)); - tfc.serialization.registerClass(AveragePooling1D); - /** - * Abstract class for different pooling 2D layers. - */ - var Pooling2D = /** @class */ (function (_super) { - __extends(Pooling2D, _super); - function Pooling2D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - _this = _super.call(this, args) || this; - _this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError("If the strides property of a 2D pooling layer is an Array, " + - "it is expected to have a length of 2, but received length " + - (args.strides.length + ".")); - } - _this.strides = args.strides; - } - else { - // `config.strides` is a number. - _this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - Pooling2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - }; - Pooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - return _this.poolingFunction(getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); - }); - }; - Pooling2D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling2D; - }(Layer)); - var MaxPooling2D = /** @class */ (function (_super) { - __extends(MaxPooling2D, _super); - function MaxPooling2D(args) { - return _super.call(this, args) || this; - } - MaxPooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling2D.className = 'MaxPooling2D'; - return MaxPooling2D; - }(Pooling2D)); - tfc.serialization.registerClass(MaxPooling2D); - var AveragePooling2D = /** @class */ (function (_super) { - __extends(AveragePooling2D, _super); - function AveragePooling2D(args) { - return _super.call(this, args) || this; - } - AveragePooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling2D.className = 'AveragePooling2D'; - return AveragePooling2D; - }(Pooling2D)); - tfc.serialization.registerClass(AveragePooling2D); - /** - * Abstract class for different pooling 3D layers. - */ - var Pooling3D = /** @class */ (function (_super) { - __extends(Pooling3D, _super); - function Pooling3D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - _this = _super.call(this, args) || this; - _this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError("If the strides property of a 3D pooling layer is an Array, " + - "it is expected to have a length of 3, but received length " + - (args.strides.length + ".")); - } - _this.strides = args.strides; - } - else { - // `config.strides` is a number. - _this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - return _this; - } - Pooling3D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var depths = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var rows = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength(depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } - else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - }; - Pooling3D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - return _this.poolingFunction(getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); - }); - }; - Pooling3D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling3D; - }(Layer)); - var MaxPooling3D = /** @class */ (function (_super) { - __extends(MaxPooling3D, _super); - function MaxPooling3D(args) { - return _super.call(this, args) || this; - } - MaxPooling3D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling3D.className = 'MaxPooling3D'; - return MaxPooling3D; - }(Pooling3D)); - tfc.serialization.registerClass(MaxPooling3D); - var AveragePooling3D = /** @class */ (function (_super) { - __extends(AveragePooling3D, _super); - function AveragePooling3D(args) { - return _super.call(this, args) || this; - } - AveragePooling3D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling3D.className = 'AveragePooling3D'; - return AveragePooling3D; - }(Pooling3D)); - tfc.serialization.registerClass(AveragePooling3D); - /** - * Abstract class for different global pooling 1D layers. - */ - var GlobalPooling1D = /** @class */ (function (_super) { - __extends(GlobalPooling1D, _super); - function GlobalPooling1D(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - return _this; - } - GlobalPooling1D.prototype.computeOutputShape = function (inputShape) { - return [inputShape[0], inputShape[2]]; - }; - GlobalPooling1D.prototype.call = function (inputs, kwargs) { - throw new NotImplementedError(); - }; - return GlobalPooling1D; - }(Layer)); - var GlobalAveragePooling1D = /** @class */ (function (_super) { - __extends(GlobalAveragePooling1D, _super); - function GlobalAveragePooling1D(args) { - return _super.call(this, args || {}) || this; - } - GlobalAveragePooling1D.prototype.call = function (inputs, kwargs) { - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - return tfc.mean(input, 1); - }); - }; - /** @nocollapse */ - GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; - return GlobalAveragePooling1D; - }(GlobalPooling1D)); - tfc.serialization.registerClass(GlobalAveragePooling1D); - var GlobalMaxPooling1D = /** @class */ (function (_super) { - __extends(GlobalMaxPooling1D, _super); - function GlobalMaxPooling1D(args) { - return _super.call(this, args || {}) || this; - } - GlobalMaxPooling1D.prototype.call = function (inputs, kwargs) { - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - return tfc.max(input, 1); - }); - }; - /** @nocollapse */ - GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; - return GlobalMaxPooling1D; - }(GlobalPooling1D)); - tfc.serialization.registerClass(GlobalMaxPooling1D); - /** - * Abstract class for different global pooling 2D layers. - */ - var GlobalPooling2D = /** @class */ (function (_super) { - __extends(GlobalPooling2D, _super); - function GlobalPooling2D(args) { - var _this = _super.call(this, args) || this; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - GlobalPooling2D.prototype.computeOutputShape = function (inputShape) { - inputShape = inputShape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } - else { - return [inputShape[0], inputShape[1]]; - } - }; - GlobalPooling2D.prototype.call = function (inputs, kwargs) { - throw new NotImplementedError(); - }; - GlobalPooling2D.prototype.getConfig = function () { - var config = { dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return GlobalPooling2D; - }(Layer)); - var GlobalAveragePooling2D = /** @class */ (function (_super) { - __extends(GlobalAveragePooling2D, _super); - function GlobalAveragePooling2D() { - return _super !== null && _super.apply(this, arguments) || this; - } - GlobalAveragePooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - return tfc.mean(input, [1, 2]); - } - else { - return tfc.mean(input, [2, 3]); - } - }); - }; - /** @nocollapse */ - GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; - return GlobalAveragePooling2D; - }(GlobalPooling2D)); - tfc.serialization.registerClass(GlobalAveragePooling2D); - var GlobalMaxPooling2D = /** @class */ (function (_super) { - __extends(GlobalMaxPooling2D, _super); - function GlobalMaxPooling2D() { - return _super !== null && _super.apply(this, arguments) || this; - } - GlobalMaxPooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - return tfc.max(input, [1, 2]); - } - else { - return tfc.max(input, [2, 3]); - } - }); - }; - /** @nocollapse */ - GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; - return GlobalMaxPooling2D; - }(GlobalPooling2D)); - tfc.serialization.registerClass(GlobalMaxPooling2D); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ - var Wrapper = /** @class */ (function (_super) { - __extends(Wrapper, _super); - function Wrapper(args) { - var _this = - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - _super.call(this, args) || this; - _this.layer = args.layer; - return _this; - } - Wrapper.prototype.build = function (inputShape) { - this.built = true; - }; - Object.defineProperty(Wrapper.prototype, "trainable", { - // TODO(cais): Implement activityRegularizer getter. - get: function () { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } - else { - return false; - } - }, - set: function (value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "trainableWeights", { - get: function () { - return this.layer.trainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "nonTrainableWeights", { - // TODO(cais): Implement setter for trainableWeights. - get: function () { - return this.layer.nonTrainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "updates", { - // TODO(cais): Implement setter for nonTrainableWeights. - get: function () { - // tslint:disable-next-line:no-any - return this.layer._updates; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "losses", { - // TODO(cais): Implement getUpdatesFor(). - get: function () { - return this.layer.losses; - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Implement getLossesFor(). - Wrapper.prototype.getWeights = function () { - return this.layer.getWeights(); - }; - Wrapper.prototype.setWeights = function (weights) { - this.layer.setWeights(weights); - }; - Wrapper.prototype.getConfig = function () { - var config = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Wrapper.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - }; - /** @nocollapse */ - Wrapper.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var layerConfig = config['layer']; - var layer = deserialize(layerConfig, customObjects); - delete config['layer']; - var newConfig = { layer: layer }; - Object.assign(newConfig, config); - return new cls(newConfig); - }; - return Wrapper; - }(Layer)); - var TimeDistributed = /** @class */ (function (_super) { - __extends(TimeDistributed, _super); - function TimeDistributed(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - return _this; - } - TimeDistributed.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError("TimeDistributed layer expects an input shape >= 3D, but received " + - ("input shape " + JSON.stringify(inputShape))); - } - this.inputSpec = [{ shape: inputShape }]; - var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - _super.prototype.build.call(this, inputShape); - }; - TimeDistributed.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - var childOutputShape = this.layer.computeOutputShape(childInputShape); - var timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - }; - TimeDistributed.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - var step = function (inputs, states) { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - var output = getExactlyOneTensor(_this.layer.call(inputs, kwargs)); - return [output, []]; - }; - var rnnOutputs = rnn(step, inputs, [], false /* goBackwards */, null /* mask */, null /* constants */, false /* unroll */, true /* needPerStepOutputs */); - var y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - }; - /** @nocollapse */ - TimeDistributed.className = 'TimeDistributed'; - return TimeDistributed; - }(Wrapper)); - tfc.serialization.registerClass(TimeDistributed); - function checkBidirectionalMergeMode(value) { - checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); - } - var DEFAULT_BIDIRECTIONAL_MERGE_MODE = 'concat'; - var Bidirectional = /** @class */ (function (_super) { - __extends(Bidirectional, _super); - function Bidirectional(args) { - var _this = _super.call(this, args) || this; - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - var layerConfig = args.layer.getConfig(); - var forwDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - _this.forwardLayer = deserialize(forwDict); - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - var backDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - _this.backwardLayer = deserialize(backDict); - _this.forwardLayer.name = 'forward_' + _this.forwardLayer.name; - _this.backwardLayer.name = 'backward_' + _this.backwardLayer.name; - _this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(_this.mergeMode); - if (args.weights) { - throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); - } - _this._stateful = args.layer.stateful; - _this.returnSequences = args.layer.returnSequences; - _this.returnState = args.layer.returnState; - _this.supportsMasking = true; - _this._trainable = true; - _this.inputSpec = args.layer.inputSpec; - _this.numConstants = null; - return _this; - } - Object.defineProperty(Bidirectional.prototype, "trainable", { - get: function () { - return this._trainable; - }, - set: function (value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - }, - enumerable: true, - configurable: true - }); - Bidirectional.prototype.getWeights = function () { - return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); - }; - Bidirectional.prototype.setWeights = function (weights) { - var numWeights = weights.length; - var numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - }; - Bidirectional.prototype.computeOutputShape = function (inputShape) { - var layerShapes = this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes]; - } - layerShapes = layerShapes; - var outputShape; - var outputShapes; - var stateShape; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } - else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } - else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } - else { - outputShapes = [outputShape]; - } - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return singletonOrArray(outputShapes); - }; - Bidirectional.prototype.apply = function (inputs, kwargs) { - var initialState = kwargs == null ? null : kwargs['initialState']; - var constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - if (Array.isArray(inputs)) { - initialState = inputs.slice(1); - inputs = inputs[0]; - } - if ((initialState == null || initialState.length === 0) && - constants == null) { - return _super.prototype.apply.call(this, inputs, kwargs); - } - var additionalInputs = []; - var additionalSpecs = []; - if (initialState != null) { - var numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push.apply(additionalInputs, initialState); - var stateSpecs = initialState - .map(function (state) { return new InputSpec({ shape: state.shape }); }); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push.apply(additionalSpecs, stateSpecs); - } - if (constants != null) { - throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - var isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (var _i = 0, additionalInputs_1 = additionalInputs; _i < additionalInputs_1.length; _i++) { - var tensor = additionalInputs_1[_i]; - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError('The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - var fullInput = [inputs].concat(additionalInputs); - var fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - var originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - var output = _super.prototype.apply.call(this, fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return _super.prototype.apply.call(this, inputs, kwargs); - } - }; - Bidirectional.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var initialState = kwargs['initialState']; - var y; - var yRev; - if (initialState == null) { - y = _this.forwardLayer.call(inputs, kwargs); - yRev = _this.backwardLayer.call(inputs, kwargs); - } - else { - var forwardState = initialState.slice(0, initialState.length / 2); - var backwardState = initialState.slice(initialState.length / 2); - y = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); - yRev = _this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); - } - var states; - if (_this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat(yRev.slice(1)); - } - y = y[0]; - yRev = yRev[0]; - } - if (_this.returnSequences) { - yRev = tfc.reverse(yRev, 1); - } - var output; - if (_this.mergeMode === 'concat') { - output = concatenate([y, yRev]); - } - else if (_this.mergeMode === 'sum') { - output = tfc.add(y, yRev); - } - else if (_this.mergeMode === 'ave') { - output = tfc.mul(.5, tfc.add(y, yRev)); - } - else if (_this.mergeMode === 'mul') { - output = tfc.mul(y, yRev); - } - else if (_this.mergeMode == null) { - output = [y, yRev]; - } - // TODO(cais): Properly set learning phase. - if (_this.returnState) { - if (_this.mergeMode == null) { - return output.concat(states); - } - return [output].concat(states); - } - return output; - }); - }; - Bidirectional.prototype.resetStates = function (states) { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - }; - Bidirectional.prototype.build = function (inputShape) { - var _this = this; - nameScope(this.forwardLayer.name, function () { - _this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, function () { - _this.backwardLayer.build(inputShape); - }); - this.built = true; - }; - Bidirectional.prototype.computeMask = function (inputs, mask) { - if (Array.isArray(mask)) { - mask = mask[0]; - } - var outputMask; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } - else { - outputMask = mask; - } - } - else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } - else { - outputMask = null; - } - } - if (this.returnState) { - var states = this.forwardLayer.states; - var stateMask = states.map(function (state) { return null; }); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } - else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } - else { - return outputMask; - } - }; - Object.defineProperty(Bidirectional.prototype, "trainableWeights", { - get: function () { - return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Bidirectional.prototype, "nonTrainableWeights", { - get: function () { - return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Implement constraints(). - Bidirectional.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - }; - Bidirectional.prototype.getConfig = function () { - var config = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Bidirectional.fromConfig = function (cls, config) { - var rnnLayer = deserialize(config['layer']); - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError("Deserialization of a Bidirectional layer with numConstants " + - "present is not supported yet."); - } - // tslint:disable-next-line:no-any - var newConfig = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - }; - /** @nocollapse */ - Bidirectional.className = 'Bidirectional'; - return Bidirectional; - }(Wrapper)); - tfc.serialization.registerClass(Bidirectional); - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - // TODO(cais): Add doc string to all the public static functions in this - // class; include exectuable JavaScript code snippets where applicable - // (b/74074458). - // Input Layer. - /** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ - function inputLayer(args) { - return new InputLayer(args); - } - // Advanced Activation Layers. - /** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function elu$2(args) { - return new ELU(args); - } - /** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function reLU(args) { - return new ReLU(args); - } - /** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function leakyReLU(args) { - return new LeakyReLU(args); - } - /** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function prelu$1(args) { - return new PReLU(args); - } - /** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function softmax$1(args) { - return new Softmax$2(args); - } - /** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ - function thresholdedReLU(args) { - return new ThresholdedReLU(args); - } - // Convolutional Layers. - /** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv1d$1(args) { - return new Conv1D(args); - } - /** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv2d$1(args) { - return new Conv2D$1(args); - } - /** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv2dTranspose$1(args) { - return new Conv2DTranspose(args); - } - /** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function conv3d(args) { - return new Conv3D$1(args); - } - function conv3dTranspose(args) { - return new Conv3DTranspose(args); - } - /** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function separableConv2d$1(args) { - return new SeparableConv2D(args); - } - /** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function cropping2D(args) { - return new Cropping2D(args); - } - /** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function upSampling2d(args) { - return new UpSampling2D(args); - } - // Convolutional(depthwise) Layers. - /** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ - function depthwiseConv2d$2(args) { - return new DepthwiseConv2D(args); - } - // Basic Layers. - /** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function activation(args) { - return new Activation$1(args); - } - /** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function dense(args) { - return new Dense(args); - } - /** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function dropout$1(args) { - return new Dropout(args); - } - /** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function spatialDropout1d(args) { - return new SpatialDropout1D(args); - } - /** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function flatten$2(args) { - return new Flatten(args); - } - /** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function repeatVector(args) { - return new RepeatVector(args); - } - /** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function reshape$1(args) { - return new Reshape$1(args); - } - /** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function permute(args) { - return new Permute(args); - } - /** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ - function embedding(args) { - return new Embedding(args); - } - // Merge Layers. - /** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function add$2(args) { - return new Add$1(args); - } - /** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function average(args) { - return new Average(args); - } - /** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function concatenate$1(args) { - return new Concatenate(args); - } - /** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function maximum$1(args) { - return new Maximum$1(args); - } - /** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function minimum$1(args) { - return new Minimum$1(args); - } - /** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function multiply(args) { - return new Multiply$1(args); - } - /** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ - function dot$2(args) { - return new Dot(args); - } - // Normalization Layers. - /** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ - function batchNormalization$1(args) { - return new BatchNormalization(args); - } - /** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ - function layerNormalization(args) { - return new LayerNormalization(args); - } - // Padding Layers. - /** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ - function zeroPadding2d(args) { - return new ZeroPadding2D(args); - } - // Pooling Layers. - /** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling1d(args) { - return new AveragePooling1D(args); - } - function avgPool1d(args) { - return averagePooling1d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling1d(args) { - return averagePooling1d(args); - } - /** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling2d(args) { - return new AveragePooling2D(args); - } - function avgPool2d(args) { - return averagePooling2d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling2d(args) { - return averagePooling2d(args); - } - /** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function averagePooling3d(args) { - return new AveragePooling3D(args); - } - function avgPool3d(args) { - return averagePooling3d(args); - } - // For backwards compatibility. - // See https://github.com/tensorflow/tfjs/issues/152 - function avgPooling3d(args) { - return averagePooling3d(args); - } - /** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalAveragePooling1d(args) { - return new GlobalAveragePooling1D(args); - } - /** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalAveragePooling2d(args) { - return new GlobalAveragePooling2D(args); - } - /** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalMaxPooling1d(args) { - return new GlobalMaxPooling1D(args); - } - /** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function globalMaxPooling2d(args) { - return new GlobalMaxPooling2D(args); - } - /** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling1d(args) { - return new MaxPooling1D(args); - } - /** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling2d(args) { - return new MaxPooling2D(args); - } - /** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ - function maxPooling3d(args) { - return new MaxPooling3D(args); - } - // Recurrent Layers. - /** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function gru(args) { - return new GRU(args); - } - /** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function gruCell(args) { - return new GRUCell(args); - } - /** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function lstm(args) { - return new LSTM(args); - } - /** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function lstmCell(args) { - return new LSTMCell(args); - } - /** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function simpleRNN(args) { - return new SimpleRNN(args); - } - /** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function simpleRNNCell(args) { - return new SimpleRNNCell(args); - } - /** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ - /** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ - function convLstm2d(args) { - return new ConvLSTM2D(args); - } - /** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ - /** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ - function convLstm2dCell(args) { - return new ConvLSTM2DCell(args); - } - /** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function rnn$1(args) { - return new RNN(args); - } - /** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ - function stackedRNNCells(args) { - return new StackedRNNCells(args); - } - // Wrapper Layers. - /** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ - function bidirectional(args) { - return new Bidirectional(args); - } - /** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ - function timeDistributed(args) { - return new TimeDistributed(args); - } - // Aliases for pooling. - var globalMaxPool1d = globalMaxPooling1d; - var globalMaxPool2d = globalMaxPooling2d; - var maxPool1d = maxPooling1d; - var maxPool2d = maxPooling2d; - /** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function gaussianNoise(args) { - return new GaussianNoise(args); - } - /** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function gaussianDropout(args) { - return new GaussianDropout(args); - } - /** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ - function alphaDropout(args) { - return new AlphaDropout(args); - } - /** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ - function masking(args) { - return new Masking(args); - } - - var exports_layers = { - __proto__: null, - inputLayer: inputLayer, - elu: elu$2, - reLU: reLU, - leakyReLU: leakyReLU, - prelu: prelu$1, - softmax: softmax$1, - thresholdedReLU: thresholdedReLU, - conv1d: conv1d$1, - conv2d: conv2d$1, - conv2dTranspose: conv2dTranspose$1, - conv3d: conv3d, - conv3dTranspose: conv3dTranspose, - separableConv2d: separableConv2d$1, - cropping2D: cropping2D, - upSampling2d: upSampling2d, - depthwiseConv2d: depthwiseConv2d$2, - activation: activation, - dense: dense, - dropout: dropout$1, - spatialDropout1d: spatialDropout1d, - flatten: flatten$2, - repeatVector: repeatVector, - reshape: reshape$1, - permute: permute, - embedding: embedding, - add: add$2, - average: average, - concatenate: concatenate$1, - maximum: maximum$1, - minimum: minimum$1, - multiply: multiply, - dot: dot$2, - batchNormalization: batchNormalization$1, - layerNormalization: layerNormalization, - zeroPadding2d: zeroPadding2d, - averagePooling1d: averagePooling1d, - avgPool1d: avgPool1d, - avgPooling1d: avgPooling1d, - averagePooling2d: averagePooling2d, - avgPool2d: avgPool2d, - avgPooling2d: avgPooling2d, - averagePooling3d: averagePooling3d, - avgPool3d: avgPool3d, - avgPooling3d: avgPooling3d, - globalAveragePooling1d: globalAveragePooling1d, - globalAveragePooling2d: globalAveragePooling2d, - globalMaxPooling1d: globalMaxPooling1d, - globalMaxPooling2d: globalMaxPooling2d, - maxPooling1d: maxPooling1d, - maxPooling2d: maxPooling2d, - maxPooling3d: maxPooling3d, - gru: gru, - gruCell: gruCell, - lstm: lstm, - lstmCell: lstmCell, - simpleRNN: simpleRNN, - simpleRNNCell: simpleRNNCell, - convLstm2d: convLstm2d, - convLstm2dCell: convLstm2dCell, - rnn: rnn$1, - stackedRNNCells: stackedRNNCells, - bidirectional: bidirectional, - timeDistributed: timeDistributed, - globalMaxPool1d: globalMaxPool1d, - globalMaxPool2d: globalMaxPool2d, - maxPool1d: maxPool1d, - maxPool2d: maxPool2d, - Layer: Layer, - RNN: RNN, - RNNCell: RNNCell, - input: input, - gaussianNoise: gaussianNoise, - gaussianDropout: gaussianDropout, - alphaDropout: alphaDropout, - masking: masking - }; - - /** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function binaryAccuracy$1(yTrue, yPred) { - return binaryAccuracy(yTrue, yPred); - } - /** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function binaryCrossentropy$2(yTrue, yPred) { - return binaryCrossentropy$1(yTrue, yPred); - } - /** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function sparseCategoricalAccuracy$1(yTrue, yPred) { - return sparseCategoricalAccuracy(yTrue, yPred); - } - /** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function categoricalAccuracy$1(yTrue, yPred) { - return categoricalAccuracy(yTrue, yPred); - } - /** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function categoricalCrossentropy$2(yTrue, yPred) { - return categoricalCrossentropy$1(yTrue, yPred); - } - /** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function precision$1(yTrue, yPred) { - return precision(yTrue, yPred); - } - /** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function recall$1(yTrue, yPred) { - return recall(yTrue, yPred); - } - /** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function cosineProximity$1(yTrue, yPred) { - return cosineProximity(yTrue, yPred); - } - /** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanAbsoluteError$1(yTrue, yPred) { - return meanAbsoluteError(yTrue, yPred); - } - /** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanAbsolutePercentageError$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - function MAPE$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - function mape$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); - } - /** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ - function meanSquaredError$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - function MSE$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - function mse$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); - } - - var exports_metrics = { - __proto__: null, - binaryAccuracy: binaryAccuracy$1, - binaryCrossentropy: binaryCrossentropy$2, - sparseCategoricalAccuracy: sparseCategoricalAccuracy$1, - categoricalAccuracy: categoricalAccuracy$1, - categoricalCrossentropy: categoricalCrossentropy$2, - precision: precision$1, - recall: recall$1, - cosineProximity: cosineProximity$1, - meanAbsoluteError: meanAbsoluteError$1, - meanAbsolutePercentageError: meanAbsolutePercentageError$1, - MAPE: MAPE$1, - mape: mape$1, - meanSquaredError: meanSquaredError$1, - MSE: MSE$1, - mse: mse$1 - }; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - - var exports_models = { - __proto__: null, - modelFromJSON: modelFromJSON - }; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - /** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l1l2(config) { - return new L1L2(config); - } - /** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l1$1(config) { - return l1(config); - } - /** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ - function l2$1(config) { - return l2(config); - } - - var exports_regularizers = { - __proto__: null, - l1l2: l1l2, - l1: l1$1, - l2: l2$1 - }; - - /** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - var Callback = /** @class */ (function (_super) { - __extends(Callback, _super); - function Callback() { - var _this = _super !== null && _super.apply(this, arguments) || this; - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - _this.model = null; - return _this; - } - Callback.prototype.setModel = function (model) { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - }; - return Callback; - }(BaseCallback)); - function less$1(currVal, prevVal) { - return currVal < prevVal; - } - function greater$1(currVal, prevVal) { - return currVal > prevVal; - } - /** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ - var EarlyStopping = /** @class */ (function (_super) { - __extends(EarlyStopping, _super); - function EarlyStopping(args) { - var _this = _super.call(this) || this; - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError('restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - _this.monitor = args.monitor || 'val_loss'; - _this.minDelta = Math.abs(args.minDelta || 0); - _this.patience = args.patience || 0; - _this.verbose = args.verbose || 0; - _this.mode = args.mode || 'auto'; - _this.baseline = args.baseline; - if (['auto', 'min', 'max'].indexOf(_this.mode) === -1) { - console.warn("EarlyStopping mode '" + _this.mode + "' is invalid. " + - "Falling back to mode 'auto'."); - _this.mode = 'auto'; - } - if (_this.mode === 'min') { - _this.monitorFunc = less$1; - } - else if (_this.mode === 'max') { - _this.monitorFunc = greater$1; - } - else { - // For mode === 'auto'. - if (_this.monitor.indexOf('acc') !== -1) { - _this.monitorFunc = greater$1; - } - else { - _this.monitorFunc = less$1; - } - } - if (_this.monitorFunc === less$1) { - _this.minDelta *= -1; - } - return _this; - } - EarlyStopping.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } - else { - this.best = this.monitorFunc === less$1 ? Infinity : -Infinity; - } - return [2 /*return*/]; - }); - }); - }; - EarlyStopping.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var current; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - current = this.getMonitorValue(logs); - if (current == null) { - return [2 /*return*/]; - } - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } - else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - return [2 /*return*/]; - } - }); - }); - }; - EarlyStopping.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log("Epoch " + this.stoppedEpoch + ": early stopping."); - } - return [2 /*return*/]; - }); - }); - }; - EarlyStopping.prototype.getMonitorValue = function (logs) { - if (logs == null) { - logs = {}; - } - var monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn("Metric for EarlyStopping " + this.monitor + " is not available. " + - ("Available metrics are: " + Object.keys(logs))); - } - return monitorValue; - }; - return EarlyStopping; - }(Callback)); - /** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ - function earlyStopping(args) { - return new EarlyStopping(args); - } - var callbacks = { earlyStopping: earlyStopping }; - - exports.Callback = Callback; - exports.CallbackList = CallbackList; - exports.CustomCallback = CustomCallback; - exports.EarlyStopping = EarlyStopping; - exports.History = History; - exports.InputSpec = InputSpec; - exports.LayerVariable = LayerVariable; - exports.LayersModel = LayersModel; - exports.RNN = RNN; - exports.Sequential = Sequential; - exports.SymbolicTensor = SymbolicTensor; - exports.callbacks = callbacks; - exports.constraints = exports_constraints; - exports.initializers = exports_initializers; - exports.input = input; - exports.layers = exports_layers; - exports.loadLayersModel = loadLayersModel; - exports.metrics = exports_metrics; - exports.model = model; - exports.models = exports_models; - exports.registerCallbackConstructor = registerCallbackConstructor; - exports.regularizers = exports_regularizers; - exports.sequential = sequential; - exports.version_layers = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-layers.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map deleted file mode 100644 index d2e59d81c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/optimizers.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_models.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nexport {modelFromJSON} from './models';\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["base.flatten","base.checkConversionForErrors","util.now","util.rightPad","util.arraysEqual","util.sizeFromShape","util.decodeString","util.assert","util.isString","util.encodeString","util.bytesPerElement","util.makeZerosTypedArray","util.isFunction","add","util.isValidDtype","conv_util.eitherStridesOrDilationsAreOne","util.isInt","util.assertShapesMatch","isFinite","isNaN","ones","conv_util.computePool2DInfo","round","axis_util.expandShapeToKeepDim","broadcast_util.assertAndGetBroadcastShape","broadcast_util.getReductionAxes","conv_util.tupleValuesAreOne","util.parseAxisParam","axis_util.getUndoAxesPermutation","backend","tslib_1.__extends","assert","unique","util","tidy","tfc.sqrt","tfc.sum","tfc.mul","serialization","tfc.clipByValue","tfc.div","tfc.add","tfc.relu","tensor1d","min","tfc.min","max","tfc.max","cast","expandDims","tile","flatten","math_utils.arrayProd","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","tfc.randomNormal","dot","tfc.fused","gather","tfc.gather","square","elu","tfc.elu","tfc.abs","tfc.dropout","zeros","mul","scalar","randomUniform","K.randomNormal","truncatedNormal","eye","Identity","linalg","randomNormal","tfc.variable","generic_utils.toSnakeCase","generic_utils.singletonOrArray","generic_utils.toList","variable_utils.countParamsInWeights","types_utils.normalizeShapeList","dispose","div","keep","generic_utils.debounce","nextFrame","K.square","tfc.fill","tfc.maximum","tfc.mean","tfc.sub","tfc.log","tfc.softplus","tfc.softmax","tfc.neg","tfc.floor","K.flatten","tfc.oneHot","tfc.onesLike","K.cast","tfc.greater","tfc.equal","tfc.argMax","tfc.logicalAnd","tfc.where","binaryCrossentropy","lossBinaryCrossentropy","categoricalCrossentropy","categoricalCrossentropyLoss","sparseCategoricalCrossentropy","sparseCategoricalCrossentropyLoss","get","train","generic_utils.toCamelCase","memory","generic_utils.unique","generic_utils.assert","generic_utils.reverseNumberCompare","layersVersion","generic_utils.pyListRepeat","deserializeLayer","generic_utils.isObjectEmpty","tfc.util","tfc.Tensor","tfc.dispose","tfc.keep","tfc.tidy","Tensor","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","optimizers.getOptimizer","Optimizer","losses.get","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","Metrics.get","Metrics.getLossOrMetricName","K.sliceAlongFirstAxis","tfc.memory","io","K.elu","Elu","tfc.selu","Selu","Relu","tfc.minimum","Relu6","tfc.sigmoid","Sigmoid","K.hardSigmoid","Softplus","K.softsign","tfc.tanh","Tanh","Softmax","tfc.logSoftmax","LogSoftmax","sum","abs","relu","clipByValue","leakyRelu","prelu","softmaxActivation","tfc.transpose","tfc.conv1d","K.biasAdd","tfc.conv3d","generic_utils.assertPositiveInteger","generic_utils.checkArrayTypeAndLength","generic_utils.mapActivationToFusedKernel","Conv2D","Conv3D","tfc.conv2dTranspose","tfc.conv3dTranspose","tfc.separableConv2d","K.sliceAlongAxis","depthwiseConv2d","tfc.depthwiseConv2d","math_utils.range","tfc.expandDims","tfc.reverse","tfc.unstack","tfc.stack","tfc.zeros","K.expandDims","K.tile","math_utils.min","math_utils.max","K.dot","K.concatAlongFirstAxis","K.dropout","K.inTrainPhase","tfc.ones","K.concatenate","tfc.conv2d","tfc.serialization","tslib_1.__assign","K.batchFlatten","Activation","K.repeat","Reshape","transpose","any","notEqual","zerosLike","K.gather","mathUtils.max","mathUtils.arrayProd","mathUtils.range","Add","Multiply","Maximum","Minimum","tfc.all","greaterEqual","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","tfc.moments","tfc.pad","tfc.maxPool","tfc.avgPool","tfc.maxPool3d","tfc.avgPool3d","tfc.squeeze","generic_utils.checkStringTypeUnionValue","softmax","conv1d","conv2d","conv2dTranspose","separableConv2d","dropout","reshape","concatenate","maximum","minimum","batchNormalization","rnn","binaryAccuracy","metrics.binaryAccuracy","metrics.binaryCrossentropy","sparseCategoricalAccuracy","metrics.sparseCategoricalAccuracy","categoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","precision","metrics.precision","recall","metrics.recall","cosineProximity","losses.cosineProximity","meanAbsoluteError","losses.meanAbsoluteError","meanAbsolutePercentageError","losses.meanAbsolutePercentageError","MAPE","mape","meanSquaredError","MSE","mse","l1","regularizers.l1","l2","regularizers.l2","less","greater"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAAA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,eAAe,GAAG,IAAI,CAAC;IAC7B,MAAM,eAAe,GAAG,IAAI,CAAC;IA8BpC;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,aAAa,CAAC;IAC3B,IAAI,QAAQ,CAAC,MAAM,EAAE;IACrB,QAAQ,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC7C,KAAK;IACL,IAAI,MAAM,CAAC,MAAM,EAAE;IACnB,QAAQ,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC3C,KAAK;IACL,IAAI,cAAc,GAAG;IACrB,QAAQ,OAAO,IAAI,CAAC;IACpB,KAAK;IACL,IAAI,IAAI,CAAC,CAAC,EAAE;IACZ,QAAQ,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK;IACL,IAAI,IAAI,CAAC,MAAM,EAAE;IACjB,QAAQ,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK;IACL,IAAI,QAAQ,CAAC,MAAM,EAAE;IACrB,QAAQ,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC7C,KAAK;IACL,IAAI,UAAU,GAAG;IACjB,QAAQ,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC/C,KAAK;IACL,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE;IAC/B,QAAQ,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAChD,KAAK;IACL,IAA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IACM,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC;;ICrCzC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAKA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAAS,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,aAAa,GAAG,CAAC,EAAE;IAC9C,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,IAAI,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE;IACvB,QAAQ,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC9E,KAAK;IACL,IAAI,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC9C,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IACM,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;ICtD/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAMA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAAS,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE;IAClD,IAAI,MAAM,EA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,IAAI,CAAC,QAAQ,EAAE;oCAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;oCAC1B,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;iCAChC;;6BAEF;;;;;SACF;QAEK,kCAAU,GAAhB,UAAiB,IAAW;;;oBAC1B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;wBACzC,OAAO,CAAC,GAAG,CAAC,WAAS,IAAI,CAAC,YAAY,sBAAmB,CAAC,CAAC;qBAC5D;;;;SACF;QAEO,uCAAe,GAAvB,UAAwB,IAAU;YAChC,IAAI,IAAI,IAAI,IAAI,EAAE;gBAChB,IAAI,GAAG,EAAE,CAAC;aACX;YACD,IAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxC,IAAI,YAAY,IAAI,IAAI,EAAE;gBACxB,OAAO,CAAC,IAAI,CACR,8BAA4B,IAAI,CAAC,OAAO,wBAAqB;qBAC7D,4BAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAG,CAAA,CAAC,CAAC;aACpD;YACD,OAAO,YAAY,CAAC;SACrB;QACH,oBAAC;IAAD,CAzGA,CAAmC,QAAQ,GAyG1C;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2CgB,aAAa,CAAC,IAAgC;QAC5D,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;QAEY,SAAS,GAAG,EAAC,aAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js deleted file mode 100644 index 0d664f5ca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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)}(this,(function(t,e){"use strict";function n(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function r(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function i(t,e=[],n=!1){if(null==e&&(e=[]),Array.isArray(t)||h(t)&&!n)for(let r=0;re)):[].concat(t)).every((t=>t>=-n&&t`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`)),r(t.every((t=>o(t))),(()=>`All values in axis param must be integers but got axis ${t}`)),t.map((t=>t<0?n+t:t))}function h(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function c(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error(`Unknown dtype ${t}`)}function p(t){return"string"==typeof t||t instanceof String}function d(t){return Array.isArray(t)?d(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":"number"==typeof t?"float32":p(t)?"string":function(t){return"boolean"==typeof t}(t)?"bool":"float32"}function f(t){return!!(t&&t.constructor&&t.call&&t.apply)}function g(t){const e=t.length;if(e<2)return[];const n=new Array(e-1);n[e-2]=t[e-1];for(let r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n}function m(t,e,n,r=!1){const i=new Array;if(1===e.length){const a=e[0]*(r?2:1);for(let e=0;et*e))*(r?2:1);for(let e=0;et*e))*(n?2:1);if(0===r)return[];if(r!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return m(0,t,e,n)}function v(t,e){const n=b(t,e);for(let t=0;t{const[e,n]=t.split(":");this.urlFlags[e]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}(e,n)}))}}}function x(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((t,...n)=>(function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(e,n[0],n[1]),n.join("=")))),e}function I(){return z}let N,z=null;function A(){if(null==N){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof global)t=global;else if("undefined"!=typeof process)t=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}N=t}return N}function C(t,e){const n=function(){const t=A();return null==t._tfGlobals&&(t._tfGlobals=new Map),t._tfGlobals}();if(n.has(t))return n.get(t);{const r=e();return n.set(t,r),n.get(t)}}const D="Acos",T="Acosh",E="Add",F="ArgMax",L="ArgMin",_="Asin",R="Asinh",M="Atan",O="Atanh",B="Atan2",$="AvgPool",P="BatchMatMul",W="BatchToSpaceND",U="Cast",K="Ceil",j="ClipByValue",V="ComplexAbs",q="Concat",G="Conv2D",H="Conv2DBackpropInput",J="Cosh",Z="Cumsum",X="DepthwiseConv2dNative",Y="Dilation2D",Q="RealDiv",tt="ExpandDims",et="Expm1",nt="Floor",rt="FloorDiv",it="FusedBatchNorm",at="GatherV2",st="GreaterEqual",ot="Identity",ut="IsFinite",lt="IsInf",ht="IsNan",ct="LeakyRelu",pt="Log1p",dt="Maximum",ft="MaxPool",gt="Mean",mt="Minimum",yt="MirrorPad",vt="Multiply",bt="OnesLike",wt="OneHot",kt="Pack",St="PadV2",xt="Prelu",It="Reciprocal",Nt="Relu",zt="Reshape",At="ResizeNearestNeighbor",Ct="ResizeBilinear",Dt="Relu6",Tt="Reverse",Et="Round",Ft="Rsqrt",Lt="Select",_t="Selu",Rt="Slice",Mt="Sinh",Ot="Sign",Bt="Sigmoid",$t="Softplus",Pt="Sqrt",Wt="SpaceToBatchND",Ut="SplitV",Kt="Softmax",jt="SquaredDifference",Vt="Tanh",qt="Tile",Gt="Transpose",Ht="Unpack",Jt="UnsortedSegmentSum",Zt="ZerosLike",Xt="Step",Yt=C("kernelRegistry",(()=>new Map)),Qt=C("gradRegistry",(()=>new Map));function te(t,e){const n=function(t,e){return`${e}_${t}`}(t,e);return Yt.get(n)}function ee(t){return Qt.get(t)}function ne(t){const e=Yt.entries(),n=[];for(;;){const{done:r,value:i}=e.next();if(r)break;const[a,s]=i,[o]=a.split("_");o===t&&n.push(s)}return n}function re(t){const{kernelName:e}=t;Qt.has(e)&&I().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${e}'`),Qt.set(e,t)}function ie(t,e){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=i(t)),I().getBool("DEBUG")&&function(t,e){for(let n=0;n{r=n()};let a;const s=ae();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(i);else{i();for(const t of r)t.dataSync();a=Promise.resolve({kernelMs:ae()-s})}if(I().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let e=0;e{ue(e,n.dtype,t)}))}return{kernelName:t,outputs:r,inputs:e,timeMs:a.then((t=>t.kernelMs)),extraInfo:a.then((t=>null!=t.getExtraProfileInfo?t.getExtraProfileInfo():""))}}logKernelProfile(t){const{kernelName:e,outputs:n,timeMs:r,inputs:i,extraInfo:a}=t;n.forEach((t=>{Promise.all([t.data(),r,a]).then((n=>{this.logger.logKernelProfile(e,t,n[0],n[1],i,n[2])}))}))}}function ue(t,e,n){if("float32"!==e)return!1;for(let e=0;e0?r:""} `}}console.log(`%c${o}\t%c${s}\t%c${l}D ${c}\t%c${h}\t%c${p}\t%c${a}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function he(t,e,n,r){const i=g(e),s=function(t,e,n,r){const i=a(e),s=r[r.length-1],o=new Array(s).fill(0),u=e.length,l="complex64"===n?fe(t):t;if(u>1)for(let t=0;t" "+t)).join("\n")),l.join("\n")}function ce(t,e,n){let r;return r=Array.isArray(t)?`${parseFloat(t[0].toFixed(7))} + ${parseFloat(t[1].toFixed(7))}j`:p(t)?`'${t}'`:"bool"===n?pe(t):parseFloat(t.toFixed(7)).toString(),u(r,e)}function pe(t){return 0===t?"false":"true"}function de(t,e,n,r,i,a=!0){const s="complex64"===n?2:1,o=e[0],u=e.length;if(0===u){if("complex64"===n){return[ce(fe(t)[0],0,n)]}return"bool"===n?[pe(t[0])]:[t[0].toString()]}if(1===u){if(o>20){const e=3*s;let r=Array.from(t.slice(0,e)),a=Array.from(t.slice((o-3)*s,o*s));return"complex64"===n&&(r=fe(r),a=fe(a)),["["+r.map(((t,e)=>ce(t,i[e],n))).join(", ")+", ..., "+a.map(((t,e)=>ce(t,i[o-3+e],n))).join(", ")+"]"]}return["["+("complex64"===n?fe(t):Array.from(t)).map(((t,e)=>ce(t,i[e],n))).join(", ")+"]"]}const l=e.slice(1),h=r.slice(1),c=r[0]*s,p=[];if(o>20){for(let e=0;e<3;e++){const r=e*c,a=r+c;p.push(...de(t.slice(r,a),l,n,h,i,!1))}p.push("...");for(let e=o-3;ese(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataSync(){this.throwIfDisposed();const t=ge().readSync(this.dataId);if("string"===this.dtype)try{return t.map((t=>se(t)))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();const t=await ge().read(this.dataId);return"string"===this.dtype?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(ge().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return me.print(this,t)}clone(){return this.throwIfDisposed(),me.clone(this)}toString(t=!1){return he(this.dataSync(),this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),me.cast(this,t)}variable(t=!0,e,n){return this.throwIfDisposed(),ge().makeVariable(this,t,e,n)}}function ve(){return C("Tensor",(()=>ye))}Object.defineProperty(ye,Symbol.hasInstance,{value:t=>!!t&&null!=t.data&&null!=t.dataSync&&null!=t.throwIfDisposed}),ve();class be extends ye{constructor(t,e,n,r){super(t.shape,t.dtype,t.dataId,r),this.trainable=e,this.name=n}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!s(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);ge().disposeTensor(this),this.dataId=t.dataId,ge().incRef(this,null)}dispose(){ge().disposeVariable(this),this.isDisposedInternal=!0}}var we,ke,Se,xe,Ie;Object.defineProperty(be,Symbol.hasInstance,{value:t=>t instanceof ye&&null!=t.assign&&t.assign instanceof Function}),function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(we||(we={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(ke||(ke={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(Se||(Se={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(xe||(xe={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(Ie||(Ie={}));const Ne={float32:xe,int32:ke,bool:Se,complex64:Ie};function ze(t,e){if(t.dtype===e.dtype)return[t,e];const n=function(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return Ne[t][e]}(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function Ae(t){const e=[];return Ce(t,e,new Set),e}function Ce(t,e,n){if(null==t)return;if(t instanceof ye)return void e.push(t);if(r=t,!Array.isArray(r)&&"object"!=typeof r)return;var r;const i=t;for(const t in i){const r=i[t];n.has(r)||(n.add(r),Ce(r,e,n))}}function De(t){return null!=t.kernelName}class Te{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((t=>t.name))))}}}dispose(){for(const t in this.registeredVariables)this.registeredVariables[t].dispose()}}class Ee{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Te}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const t=this.getSortedBackends();for(let e=0;e{null!=t.setupFunc&&t.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(t){ne(t).forEach((e=>{null!=e.disposeFunc&&e.disposeFunc(this.registry[t])}))}initializeBackend(t){const e=this.registryFactory[t];if(null==e)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{const r=e.factory();if(!r||r instanceof class{refCount(t){return n("refCount")}incRef(t){return n("incRef")}timerAvailable(){return!0}time(t){return n("time")}read(t){return n("read")}readSync(t){return n("readSync")}numDataIds(){return n("numDataIds")}disposeData(t,e){return n("disposeData")}write(t,e,r){return n("write")}move(t,e,r,i,a){return n("move")}memory(){return n("memory")}floatPrecision(){return n("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return n("dispose")}}||"function"!=typeof r.then)return this.registry[t]=r,{success:!0,asyncInit:!1};{const e=++this.pendingBackendInitId,n=r.then((n=>!(e(ethis.registryFactory[e].priority-this.registryFactory[t].priority))}initializeBackendsAndReturnBest(){const t=this.getSortedBackends();for(let e=0;ethis.startScope(r)),(()=>this.endScope(n)),(()=>(n=e(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(t,e,n){t();try{const t=n();return e(),t}catch(t){throw e(),t}}nextTensorId(){return Ee.nextTensorId++}nextVariableId(){return Ee.nextVariableId++}clone(t){const e=Fe.runKernel(ot,{x:t}),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],(t=>({x:()=>{const e={x:t},n={dtype:"float32"};return Fe.runKernel(U,e,n)}})),[],{}),e}runKernel(t,e,n){if(!(null!=te(t,this.backendName)))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,n){const r=this.backend.numDataIds();let i=0;n.forEach((t=>{i+="complex64"===t.dtype?3:1}));const a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=r-e-i-a;if(s>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${s} data ids) after running '${t}'`)}runKernelFunc(t){let e,n=[];const i=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;let o,u;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=De(t)?t.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(De(t)){const{kernelName:e,inputs:a,attrs:s}=t;null==this.backendName&&this.backend;const l=te(e,this.backendName);r(null!=l,(()=>`Cannot find registered kernel '${e}' for backend '${this.backendName}'`)),o=()=>{const t=this.backend.numDataIds();u=l.kernelFunc({inputs:a,attrs:s,backend:this.backend});const r=Array.isArray(u)?u:[u];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(e,t,r);const o=r.map((t=>{if(null!=t.rank)return t;const{dataId:e,shape:n,dtype:r}=t;return this.makeTensorFromDataId(e,n,r)}));if(i){const t=this.getTensorsForGradient(e,a,o);n=this.saveTensorsForBackwardMode(t)}return o}}else{const{forwardFunc:e}=t,r=t=>{i&&(n=t.map((t=>this.keep(this.clone(t)))))};o=()=>{const t=this.backend.numDataIds();u=this.tidy((()=>e(this.backend,r)));const n=Array.isArray(u)?u:[u];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,t,n),n}}const{inputs:h,attrs:c}=t,p=De(t)?null:t.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,h,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),e=d.outputs):e=o()})),i&&this.addTapeNode(l,h,e,p,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(h).map((t=>null!=h[t]?h[t].shape:null)),outputShapes:e.map((t=>t.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(u)?e:e[0]}saveTensorsForBackwardMode(t){return t.map((t=>this.keep(this.clone(t))))}getTensorsForGradient(t,e,n){const i=ee(t);if(null!=i){const t=i.inputsToSave||[],a=i.outputsToSave||[];let s;i.saveAllInputs?(r(Array.isArray(e),(()=>"saveAllInputs is true, expected inputs to be an array.")),s=Object.keys(e).map((t=>e[t]))):s=t.map((t=>e[t]));const o=n.filter(((t,e)=>a[e]));return s.concat(o)}return[]}makeTensor(t,e,n,r){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let i=t;"string"===n&&p(t[0])&&(i=t.map((t=>function(t,e="utf-8"){return e=e||"utf-8",I().platform.encode(t,e)}(t))));const a=r.write(i,e,n),s=new ye(e,n,a,this.nextTensorId());if(this.trackTensor(s,r),"string"===n){const t=this.state.tensorInfo.get(a),e=function(t){if(null==t)return 0;let e=0;return t.forEach((t=>e+=t.length)),e}(i);this.state.numBytes+=e-t.bytes,t.bytes=e}return s}makeTensorFromDataId(t,e,n,r){const i=new ye(e,n=n||"float32",t,this.nextTensorId());return this.trackTensor(i,r),i}makeVariable(t,e=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==t.dtype&&(t=t.cast(r));const i=new be(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(t,e){this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(n=t.size*c(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof be||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;const e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,"string"===t.dtype&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),"complex64"!==t.dtype&&"string"!==t.dtype){const e=t.size*c(t.dtype);this.state.numBytes-=e}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(const t in this.state.registeredVariables){const e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]}memory(){const t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;const e=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((t=>t.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const t of this.state.activeProfile.kernels)t.kernelTimeMs=await t.kernelTimeMs,t.extraInfo=await t.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(t,e,n,r,i,a){const s={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},o=ee(t);null!=o&&(r=o.gradFunc),null!=r&&(s.gradient=t=>(t=t.map(((t,e)=>{if(null==t){const t=n[e],r=b(t.size,t.dtype);return this.makeTensor(r,t.shape,t.dtype)}return t})),r(t.length>1?t:t[0],i,a))),this.state.activeTape.push(s)}keep(t){return t.kept=!0,t}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){const e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){const e=Ae(t),n=new Set(e.map((t=>t.id)));for(let t=0;t{t.kept||t.scopeId!==r.id||this.track(t)}))}gradients(t,e,n,i=!1){if(r(e.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const o=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",t)));r(o instanceof ye,(()=>"The result y returned by f() must be a tensor."));const u=function(t,e,n){const r={},i={};for(let t=0;tr[t.id]=!0)),o=!0,i[a.id]=!0;break}if(o)break}}const a={};a[n.id]=!0;const s={};for(let e=t.length-1;e>=0;e--){const n=t[e],r=n.inputs;for(let t=0;t0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const t={};t[o.id]=null==n?function(t){const e=v(a(t),"float32");return Fe.makeTensor(e,t,"float32")}(o.shape):n,function(t,e,n,r){for(let i=e.length-1;i>=0;i--){const a=e[i],o=[];if(a.outputs.forEach((e=>{const n=t[e.id];null!=n?o.push(n):o.push(null)})),null==a.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${a.kernelName}.`);const u=a.gradient(o);for(const e in a.inputs){if(!(e in u))throw new Error(`Cannot backprop through input ${e}. Available gradients found: ${Object.keys(u)}.`);const i=n((()=>u[e]()));if("float32"!==i.dtype)throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input ${e} must have 'float32' dtype, but has '${i.dtype}'`);const o=a.inputs[e];if(!s(i.shape,o.shape))throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input '${e}' has shape '${i.shape}', which does not match the shape of the input '${o.shape}'`);if(null==t[o.id])t[o.id]=i;else{const e=t[o.id];t[o.id]=r(e,i),e.dispose()}}}}(t,u,(t=>this.tidy(t)),Le);const r=e.map((e=>t[e.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((t=>{for(const e of t.saved)e.dispose()})),this.state.activeTape=null),{value:o,grads:r}}))}customGrad(t){return r(f(t),(()=>"The f passed in customGrad(f) must be a function.")),(...e)=>{let n;r(e.every((t=>t instanceof ye)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const i={};e.forEach(((t,e)=>{i[e]=t}));return this.runKernelFunc({forwardFunc:(i,a)=>(n=t(...e,a),r(n.value instanceof ye,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),r(f(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(t,i)=>{const a=n.gradFunc(t,i),s=Array.isArray(a)?a:[a];r(s.length===e.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),r(s.every((t=>t instanceof ye)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return s.forEach(((t,e)=>{o[e]=()=>t})),o},inputs:i})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}async time(t){const e=ae(),n=await this.backend.time(t);return n.wallMs=ae()-e,n}track(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Te;for(const t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Ee.nextTensorId=0,Ee.nextVariableId=0;const Fe=function(){const t=A();if(null==t._tfengine){const e=new S(t);t._tfengine=new Ee(e)}var e;return e=t._tfengine.ENV,z=e,ge=()=>t._tfengine,t._tfengine}();function Le(t,e){const n={a:t,b:e};return Fe.runKernel(E,n)}function _e(t,e){let n=t;if(h(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];const r=[];for(;Array.isArray(n)||h(n)&&"string"!==e;)r.push(n.length),n=n[0];return Array.isArray(t)&&I().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Re(t,r,[]),r}function Re(t,e,n){if(n=n||[],!Array.isArray(t)&&!h(t))return void r(0===e.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`));r(e.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`)),r(t.length===e[0],(()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`));const i=e.slice(1);for(let e=0;e=0&&(a=r),Me(r,a,e,n),null==t||!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){const r=null==t?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const s=_e(t,a);h(t)||Array.isArray(t)||(t=[t]);const o="string"!==a?ie(t,a):i(t,[],!0);return Fe.makeTensor(o,s,a)}function Be(t,e,n,r="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map(((t,i)=>Oe(t,`${e}[${i}]`,n,r)))}function $e(t){const e=Object.keys(t);if(1!==e.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+="__op";const i=(...t)=>{Fe.startScope(n);try{const e=r(...t);return w(e)&&console.error("Cannot return a Promise inside of tidy."),Fe.endScope(e),e}catch(t){throw Fe.endScope(null),t}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}const Pe=$e({abs_:function(t){const e=Oe(t,"x","abs");if("complex64"===e.dtype){const t={x:e};return Fe.runKernel(V,t)}{const t={x:e};return Fe.runKernel("Abs",t)}}});const We=$e({acos_:function(t){const e={x:Oe(t,"x","acos")};return Fe.runKernel(D,e)}});const Ue=$e({acosh_:function(t){const e={x:Oe(t,"x","acosh")};return Fe.runKernel(T,e)}});const Ke=$e({add_:function(t,e){let n=Oe(t,"a","add"),r=Oe(e,"b","add");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(E,i)}});const je=$e({all_:function(t,e=null,n=!1){const r={x:Oe(t,"x","all","bool")},i={axis:e,keepDims:n};return Fe.runKernel("All",r,i)}});const Ve=$e({any_:function(t,e=null,n=!1){const r={x:Oe(t,"x","any","bool")},i={axis:e,keepDims:n};return Fe.runKernel("Any",r,i)}});const qe=$e({argMax_:function(t,e=0){const n={x:Oe(t,"x","argMax")},r={axis:e};return Fe.runKernel(F,n,r)}});const Ge=$e({argMin_:function(t,e=0){const n={x:Oe(t,"x","argMin")},r={axis:e};return Fe.runKernel(L,n,r)}});const He=$e({asin_:function(t){const e={x:Oe(t,"x","asin")};return Fe.runKernel(_,e)}});const Je=$e({asinh_:function(t){const e={x:Oe(t,"x","asinh")};return Fe.runKernel(R,e)}});const Ze=$e({atan_:function(t){const e={x:Oe(t,"x","atan")};return Fe.runKernel(M,e)}});const Xe=$e({atan2_:function(t,e){let n=Oe(t,"a","atan2"),r=Oe(e,"b","atan2");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(B,i)}});const Ye=$e({atanh_:function(t){const e={x:Oe(t,"x","atanh")};return Fe.runKernel(O,e)}});const Qe=$e({cast_:function(t,e){const n=Oe(t,"x","cast");if(!function(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const r={x:n},i={dtype:e};return Fe.runKernel(U,r,i)}});function tn(t,e,n,r,i,a,s="channelsLast"){const[o,u]=en(e);let l;if("channelsLast"===s)l=[o,u,t[3],t[3]];else{if("channelsFirst"!==s)throw new Error(`Unknown dataFormat ${s}`);l=[o,u,t[1],t[1]]}return function(t,e,n,r,i,a,s=!1,o="channelsLast"){let[u,l,h,c]=[-1,-1,-1,-1];if("channelsLast"===o)[u,l,h,c]=t;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[u,c,l,h]=t}const[p,d,,f]=e,[g,m]=en(n),[y,v]=en(r),b=nn(p,y),w=nn(d,v),{padInfo:k,outHeight:S,outWidth:x}=function(t,e,n,r,i,a,s,o,u){let l,h,c;if("number"==typeof t){l={top:t,bottom:t,left:t,right:t,type:0===t?"VALID":"NUMBER"};const i=function(t,e,n,r,i){null==r&&(r=function(t,e,n,r=1){const i=nn(e,r);return Math.floor((t[0]*(n-1)-n+i)/2)}(t,e,n));const a=t[0],s=t[1],o=rn((a-e+2*r)/n+1,i),u=rn((s-e+2*r)/n+1,i);return[o,u]}([e,n],a,r,t,o);h=i[0],c=i[1]}else if("same"===t){h=Math.ceil(e/r),c=Math.ceil(n/i);const t=Math.max(0,(h-1)*r+a-e),o=Math.max(0,(c-1)*i+s-n),u=Math.floor(t/2),p=t-u,d=Math.floor(o/2);l={top:u,bottom:p,left:d,right:o-d,type:"SAME"}}else if("valid"===t)l={top:0,bottom:0,left:0,right:0,type:"VALID"},h=Math.ceil((e-a+1)/r),c=Math.ceil((n-s+1)/i);else{if("object"!=typeof t)throw Error(`Unknown padding parameter: ${t}`);{const p="channelsLast"===u?t[1][0]:t[2][0],d="channelsLast"===u?t[1][1]:t[2][1],f="channelsLast"===u?t[2][0]:t[3][0],g="channelsLast"===u?t[2][1]:t[3][1];l={top:p,bottom:d,left:f,right:g,type:0===p&&0===d&&0===f&&0===g?"VALID":"EXPLICIT"},h=rn((e-a+p+d)/r+1,o),c=rn((n-s+f+g)/i+1,o)}}return{padInfo:l,outHeight:h,outWidth:c}}(i,l,h,g,m,b,w,a,o),I=s?f*c:f;let N;"channelsFirst"===o?N=[u,I,S,x]:"channelsLast"===o&&(N=[u,S,x,I]);return{batchSize:u,dataFormat:o,inHeight:l,inWidth:h,inChannels:c,outHeight:S,outWidth:x,outChannels:I,padInfo:k,strideHeight:g,strideWidth:m,filterHeight:p,filterWidth:d,effectiveFilterHeight:b,effectiveFilterWidth:w,dilationHeight:y,dilationWidth:v,inShape:t,outShape:N,filterShape:e}}(t,l,n,r,i,a,!1,s)}function en(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function nn(t,e){return e<=1?t:t+(t-1)*(e-1)}function rn(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function an(t){const[e,n,r]=en(t);return 1===e&&1===n&&1===r}function sn(t,e){return an(t)||an(e)}const on=$e({reshape_:function(t,e){const n={x:Oe(t,"x","reshape","string_or_numeric")},r={shape:e};return Fe.runKernel(zt,n,r)}});const un=$e({avgPool_:function(t,e,n,i,a){const s=Oe(t,"x","avgPool","float32");r(sn(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===u.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${u.rank}.`)),null!=a&&r(o(i),(()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const h={x:u},c={filterSize:e,strides:n,pad:i,dimRoundingMode:a};let p=Fe.runKernel($,h,c);return p=Qe(p,s.dtype),l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const ln=$e({clone_:function(t){const e={x:Oe(t,"x","clone","string_or_numeric")};return Fe.runKernel(ot,e)}});const hn=$e({concat_:function(t,e=0){r(t.length>=1,(()=>"Pass at least one tensor to concat"));const n=Be(t,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((t=>{if("complex64"!==t.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${t.dtype}. `)})),1===n.length)return ln(n[0]);const i=n,a={axis:e};return Fe.runKernel(q,i,a)}});const cn=$e({matMul_:function(t,e,n=!1,r=!1){let i=Oe(t,"a","matMul"),a=Oe(e,"b","matMul");[i,a]=ze(i,a);const s={a:i,b:a},o={transposeA:n,transposeB:r};return Fe.runKernel(P,s,o)}});const pn=$e({mul_:function(t,e){let n=Oe(t,"a","mul"),r=Oe(e,"b","mul");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(vt,i)}});const dn=$e({sigmoid_:function(t){const e={x:Oe(t,"x","sigmoid")};return Fe.runKernel(Bt,e)}});const fn=$e({slice_:function(t,e,n){const r=Oe(t,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const i={x:r},a={begin:e,size:n};return Fe.runKernel(Rt,i,a)}});const gn=$e({tanh_:function(t){const e={x:Oe(t,"x","tanh")};return Fe.runKernel(Vt,e)}});const mn=$e({batchToSpaceND_:function(t,e,n){const i=Oe(t,"x","batchToSpaceND"),a=e.reduce(((t,e)=>t*e));r(i.rank>=1+e.length,(()=>`input rank is ${i.rank} but should be > than blockShape.length ${e.length}`)),r(n.length===e.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`)),r(i.shape[0]%a==0,(()=>`input tensor batch is ${i.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${a}`));const s={x:i},o={blockShape:e,crops:n};return Fe.runKernel(W,s,o)}});const yn=$e({batchNorm_:function(t,e,n,i,a,s){null==s&&(s=.001);const o=Oe(t,"x","batchNorm"),u=Oe(e,"mean","batchNorm"),l=Oe(n,"variance","batchNorm");let h,c;null!=a&&(h=Oe(a,"scale","batchNorm")),null!=i&&(c=Oe(i,"offset","batchNorm")),r(u.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),r(null==c||u.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),r(null==h||u.rank===h.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const p={x:function(t){let e;return e=0===t.rank||1===t.rank?on(t,[1,1,1,t.size]):2===t.rank?on(t,[1,1,t.shape[0],t.shape[1]]):3===t.rank?on(t,[1,t.shape[0],t.shape[1],t.shape[2]]):t,e}(o),scale:h,offset:c,mean:u,variance:l},d={varianceEpsilon:s},f=Fe.runKernel(it,p,d);return on(f,o.shape)}});const vn=$e({broadcastTo_:function(t,e){let n=Oe(t,"broadcastTo","x");const r=n.shape;if(e.some((t=>!(t>0)||t%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const t=n.shape.slice();for(;t.length=0;t--)if(i[t]===e[t])a[t]=1;else if(1!==n.shape[t])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(0===a.map(((t,e)=>t>1?e:-1)).filter((t=>t>=0)).length)return ln(n);const s={x:n},o={reps:a};return Fe.runKernel(qt,s,o)}});const bn=$e({ceil_:function(t){const e={x:Oe(t,"x","ceil")};return Fe.runKernel(K,e)}});const wn=$e({clipByValue_:function(t,e,n){const i=Oe(t,"x","clipByValue");r(e<=n,(()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`));const a={x:i},s={clipValueMin:e,clipValueMax:n};return Fe.runKernel(j,a,s)}});const kn=$e({complex_:function(t,e){const n=Oe(t,"real","complex"),i=Oe(e,"imag","complex");!function(t,e,n=""){r(s(t,e),(()=>n+` Shapes ${t} and ${e} must match`))}(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const a={real:n,imag:i};return Fe.runKernel("Complex",a)}});const Sn=$e({conv2d_:function(t,e,n,i,a="NHWC",s=[1,1],u){const l=Oe(t,"x","conv2d"),h=Oe(e,"filter","conv2d");let c=l,p=!1;3===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1],l.shape[2]])),r(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===h.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`)),null!=u&&r(o(i),(()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`));const d="NHWC"===a?c.shape[3]:c.shape[1];r(d===h.shape[2],(()=>`Error in conv2d: depth of input (${d}) must match input depth for filter ${h.shape[2]}.`)),r(sn(n,s),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`));const f={x:c,filter:h},g={strides:n,pad:i,dataFormat:a,dilations:s,dimRoundingMode:u},m=Fe.runKernel(G,f,g);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const xn=$e({conv1d_:function(t,e,n,i,a="NWC",s=1,u){const l=Oe(t,"x","conv1d"),h=Oe(e,"filter","conv1d");let c=l,p=!1;2===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1]])),r(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),r(3===h.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${h.rank}.`)),null!=u&&r(o(i),(()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`)),r(c.shape[2]===h.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${h.shape[1]}.`)),r(sn(n,s),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`)),r("NWC"===a,(()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`));const d=on(h,[1,h.shape[0],h.shape[1],h.shape[2]]),f=on(c,[c.shape[0],1,c.shape[1],c.shape[2]]),g=Sn(f,d,[1,n],i,"NHWC",[1,s],u);return on(g,p?[g.shape[2],g.shape[3]]:[g.shape[0],g.shape[2],g.shape[3]])}});const In=$e({conv2DBackpropInput_:function(t,e,n,i,a,s="NHWC",u){r(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let l=t,h=e,c=!1;3===e.rank&&(c=!0,h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]),l=[1,t[0],t[1],t[2]]),r(4===l.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${l.length}.`)),r(4===h.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${h.rank}`)),r(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const p="NHWC"===s?l[3]:l[1],d="NHWC"===s?h.shape[3]:h.shape[1];r(p===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${n.shape[2]}.`)),r(d===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[3]}.`)),null!=u&&r(o(a),(()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${u} but got pad ${a}.`));const f={dy:h,filter:n},g={strides:i,pad:a,dataFormat:s,dimRoundingMode:u,inputShape:l},m=Fe.runKernel(H,f,g);return c?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Nn=$e({conv2dTranspose_:function(t,e,n,r,i,a){const s=Oe(t,"x","conv2dTranspose"),o=Oe(e,"filter","conv2dTranspose");return In(n,s,o,r,i,"NHWC",a)}});const zn=$e({conv3DBackpropInput_:function(t,e,n,i,a){r(t.length===e.rank,(()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`));let s=t,o=e,u=!1;4===e.rank&&(u=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),s=[1,t[0],t[1],t[2],t[3]]);const l=s[4],h=o.shape[4];r(5===s.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`)),r(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),r(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),r(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),r(h===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[4]}.`));const c={dy:o,filter:n},p={pad:a,strides:i,inputShape:s},d=Fe.runKernel("Conv3DBackpropInputV2",c,p);return u?on(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const An=$e({cos_:function(t){const e={x:Oe(t,"x","cos")};return Fe.runKernel("Cos",e)}});const Cn=$e({cosh_:function(t){const e={x:Oe(t,"x","cosh")};return Fe.runKernel(J,e)}});const Dn=$e({cumsum_:function(t,e=0,n=!1,r=!1){const i={x:Oe(t,"x","cumsum")},a={axis:e,exclusive:n,reverse:r};return Fe.runKernel(Z,i,a)}});const Tn=$e({depthToSpace_:function(t,e,n="NHWC"){const i=Oe(t,"x","depthToSpace"),a="NHWC"===n?i.shape[1]:i.shape[2],s="NHWC"===n?i.shape[2]:i.shape[3],o="NHWC"===n?i.shape[3]:i.shape[1];r(a*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${e} for depthToSpace with input shape\n ${i.shape}`)),r(s*e>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${e} for depthToSpace with input shape\n ${i.shape}`)),r(o%(e*e)==0,(()=>`Dimension size must be evenly divisible by ${e*e} but is ${o} for depthToSpace with input shape ${i.shape}`));const u={x:i},l={blockSize:e,dataFormat:n};return Fe.runKernel("DepthToSpace",u,l)}});const En=$e({depthwiseConv2d_:function(t,e,n,i,a="NHWC",s=[1,1],u){const l=Oe(t,"x","depthwiseConv2d"),h=Oe(e,"filter","depthwiseConv2d");let c=l,p=!1;3===l.rank&&(p=!0,c=on(l,[1,l.shape[0],l.shape[1],l.shape[2]])),r(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`)),r(c.shape[3]===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${h.shape[2]}.`)),null!=u&&r(o(i),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${i}.`));const d={x:c,filter:h},f={strides:n,pad:i,dataFormat:a,dilations:s,dimRoundingMode:u},g=Fe.runKernel(X,d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3]]):g}});const Fn=$e({dilation2d_:function(t,e,n,i,a=[1,1],s="NHWC"){const o=Oe(t,"x","dilation2d"),u=Oe(e,"filter","dilation2d");r(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),r(3===u.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${u.rank}.`)),r("NHWC"===s,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`));let l=o,h=!1;3===o.rank&&(l=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),h=!0);const c={x:l,filter:u},p={strides:n,pad:i,dilations:a},d=Fe.runKernel(Y,c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Ln=$e({floorDiv_:function(t,e){let n=Oe(t,"a","floorDiv"),r=Oe(e,"b","floorDiv");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel(rt,i)}});const _n=$e({div_:function(t,e){let n=Oe(t,"a","div"),r=Oe(e,"b","div");if([n,r]=ze(n,r),"int32"===n.dtype&&"int32"===r.dtype)return Ln(n,r);const i={a:n,b:r};return Fe.runKernel(Q,i,{})}});function Rn(t,e){const n=[];for(let r=0;r1)&&n.unshift(a)}return n}function Mn(t,e){const n=[],r=Math.max(t.length,e.length);for(let i=0;i`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${i.rank}.`));const a=1===n.rank?n.size:n.shape[1],s=1===i.rank?i.size:i.shape[0];if(r(a===s,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`)),1===n.rank&&1===i.rank){const t=on(n,[1,-1]),e=on(i,[-1,1]),r=cn(t,e);return on(r,[])}if(1===n.rank&&2===i.rank){const t=on(n,[1,-1]),e=on(i,[i.shape[0],i.shape[1]]),r=cn(t,e);return on(r,[r.size])}if(2===n.rank&&1===i.rank){const t=on(i,[-1,1]),e=cn(n,t);return on(e,[e.size])}{const t=on(i,[i.shape[0],i.shape[1]]);return cn(n,t)}}});const Un=$e({elu_:function(t){const e={x:Oe(t,"x","elu")};return Fe.runKernel("Elu",e)}});const Kn=$e({erf_:function(t){let e=Oe(t,"x","erf");r("int32"===e.dtype||"float32"===e.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===e.dtype&&(e=Qe(e,"float32"));const n={x:e};return Fe.runKernel("Erf",n)}});const jn=$e({exp_:function(t){const e={x:Oe(t,"x","exp")};return Fe.runKernel("Exp",e)}});const Vn=$e({expandDims_:function(t,e=0){const n=Oe(t,"x","expandDims","string_or_numeric");r(e<=n.rank,(()=>"Axis must be <= rank of the tensor"));const i={input:n},a={dim:e};return Fe.runKernel(tt,i,a)}});const qn=$e({expm1_:function(t){const e={x:Oe(t,"x","expm1")};return Fe.runKernel(et,e)}});const Gn=$e({tile_:function(t,e){const n=Oe(t,"x","tile","string_or_numeric");r(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`));const i={x:n},a={reps:e};return Fe.runKernel(qt,i,a)}});const Hn=$e({floor_:function(t){const e={x:Oe(t,"x","floor")};return Fe.runKernel(nt,e)}});const Jn=$e({gather_:function(t,e,n=0,r=0){const i={x:Oe(t,"x","gather"),indices:Oe(e,"indices","gather","int32")},a={axis:n,batchDims:r};return Fe.runKernel(at,i,a)}});const Zn=$e({greater_:function(t,e){let n=Oe(t,"a","greater"),r=Oe(e,"b","greater");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("Greater",i)}});const Xn=$e({greaterEqual_:function(t,e){let n=Oe(t,"a","greaterEqual"),r=Oe(e,"b","greaterEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(st,i)}});const Yn=$e({imag_:function(t){const e={input:Oe(t,"input","imag")};return Fe.runKernel("Imag",e)}});const Qn=$e({isFinite_:function(t){const e={x:Oe(t,"x","isFinite")};return Fe.runKernel(ut,e)}});const tr=$e({isInf_:function(t){const e={x:Oe(t,"x","isInf")};return Fe.runKernel(lt,e)}});const er=$e({isNaN_:function(t){const e={x:Oe(t,"x","isNaN")};return Fe.runKernel(ht,e)}});const nr=$e({leakyRelu_:function(t,e=.2){const n={x:Oe(t,"x","leakyRelu")},r={alpha:e};return Fe.runKernel(ct,n,r)}});const rr=$e({less_:function(t,e){let n=Oe(t,"a","less"),r=Oe(e,"b","less");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("Less",i)}});const ir=$e({lessEqual_:function(t,e){let n=Oe(t,"a","lessEqual"),r=Oe(e,"b","lessEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LessEqual",i)}});const ar=$e({localResponseNormalization_:function(t,e=5,n=1,i=1,a=.5){const s=Oe(t,"x","localResponseNormalization");r(4===s.rank||3===s.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`)),r(o(e),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`));let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]]));const h={x:u},c={depthRadius:e,bias:n,alpha:i,beta:a},p=Fe.runKernel("LRN",h,c);return l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const sr=$e({log_:function(t){const e={x:Oe(t,"x","log")};return Fe.runKernel("Log",e)}});const or=$e({log1p_:function(t){const e={x:Oe(t,"x","log1p")};return Fe.runKernel(pt,e)}});function ur(t){return Fe.customGrad(t)}const lr=$e({neg_:function(t){const e={x:Oe(t,"x","neg")};return Fe.runKernel("Neg",e)}});const hr=$e({softplus_:function(t){const e={x:Oe(t,"x","softplus")};return Fe.runKernel($t,e)}});const cr=$e({logSigmoid_:function(t){const e=Oe(t,"x","logSigmoid");return ur((t=>({value:lr(hr(lr(t))),gradFunc:e=>pn(e,dn(lr(t)))})))(e)}});const pr=$e({max_:function(t,e=null,n=!1){const r={x:Oe(t,"x","max")},i={reductionIndices:e,keepDims:n};return Fe.runKernel("Max",r,i)}});const dr=$e({sub_:function(t,e){let n=Oe(t,"a","sub"),r=Oe(e,"b","sub");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Sub",i)}});const fr=$e({sum_:function(t,e=null,n=!1){let r=Oe(t,"x","sum");"bool"===r.dtype&&(r=Qe(r,"int32"));const i={x:r},a={axis:e,keepDims:n};return Fe.runKernel("Sum",i,a)}});const gr=$e({logSoftmax_:function(t,e=-1){const n=Oe(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return ur(((t,n)=>{const r=pr(t,e,!0),i=dr(t,r),a=dr(Qe(i,"float32"),sr(fr(jn(i),e,!0)));n([a]);return{value:a,gradFunc:(t,n)=>{const[r]=n,i=jn(r);return dr(t,pn(fr(t,e,!0),i))}}}))(n)}});function mr(t,e){return function(t,e,n){const r=t.length+e.length,i=[];let a=0,s=0;for(let o=0;o1)),e)}function yr(t){return t.map(((t,e)=>[e,t])).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}const vr=$e({logSumExp_:function(t,e=null,n=!1){const r=Oe(t,"x","logSumExp"),i=l(e,r.shape),a=pr(r,i,!0),s=dr(r,a),o=jn(s),u=fr(o,i),h=sr(u),c=Ke(on(a,h.shape),h);if(n){const t=mr(c.shape,i);return on(c,t)}return c}});const br=$e({logicalAnd_:function(t,e){const n=Oe(t,"a","logicalAnd","bool"),r=Oe(e,"b","logicalAnd","bool");Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LogicalAnd",i)}});const wr=$e({logicalNot_:function(t){const e={x:Oe(t,"x","logicalNot","bool")};return Fe.runKernel("LogicalNot",e)}});const kr=$e({logicalOr_:function(t,e){const n=Oe(t,"a","logicalOr","bool"),r=Oe(e,"b","logicalOr","bool");Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("LogicalOr",i)}});const Sr=$e({logicalXor_:function(t,e){const n=Oe(t,"a","logicalXor","bool"),r=Oe(e,"b","logicalXor","bool");return Mn(n.shape,r.shape),br(kr(t,e),wr(br(t,e)))}});const xr=$e({maxPool_:function(t,e,n,i,a){const s=Oe(t,"x","maxPool");let u=s,l=!1;3===s.rank&&(l=!0,u=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===u.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${u.rank}.`)),r(sn(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=a&&r(o(i),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${i}.`));const h={x:u},c={filterSize:e,strides:n,pad:i,dimRoundingMode:a},p=Fe.runKernel(ft,h,c);return l?on(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const Ir=$e({maximum_:function(t,e){let n=Oe(t,"a","maximum"),r=Oe(e,"b","maximum");[n,r]=ze(n,r),"bool"===n.dtype&&(n=Qe(n,"int32"),r=Qe(r,"int32")),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(dt,i)}});const Nr=$e({mean_:function(t,e=null,n=!1){const r={x:Oe(t,"x","mean")},i={axis:e,keepDims:n};return Fe.runKernel(gt,r,i)}});function zr(t,e="float32"){if("complex64"===e){const e=zr(t,"float32"),n=zr(t,"float32");return kn(e,n)}const n=b(a(t),e);return Fe.makeTensor(n,t,e)}function Ar(t,e="float32"){if("complex64"===e){const e=Ar(t,"float32"),n=zr(t,"float32");return kn(e,n)}const n=v(a(t),e);return Fe.makeTensor(n,t,e)}const Cr=$e({min_:function(t,e=null,n=!1){const r={x:Oe(t,"x","min")},i={axis:e,keepDims:n};return Fe.runKernel("Min",r,i)}});const Dr=$e({minimum_:function(t,e){let n=Oe(t,"a","minimum"),r=Oe(e,"b","minimum");[n,r]=ze(n,r),"bool"===n.dtype&&(n=Qe(n,"int32"),r=Qe(r,"int32")),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(mt,i)}});const Tr=$e({mirrorPad_:function(t,e,n){r("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const i=Oe(t,"x","mirrorPad");if(0===i.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");r(e.length===i.rank,(()=>`Padding doesn't match input. Must be ${i.rank}. Got ${e.length}.`));const a="reflect"===n?1:0;for(let t=0;t"Invalid number of paddings. Must be length of 2 each.")),r(e[t][0]>=0&&e[t][0]<=i.shape[t]-a&&e[t][1]>=0&&e[t][1]<=i.shape[t]-a,(()=>`Padding in dimension ${t} cannot be greater than or equal to ${i.shape[t]-a} or less than 0 for input of shape ${i.shape}`));const s={paddings:e,mode:n},o={x:i};return Fe.runKernel(yt,o,s)}});const Er=$e({mod_:function(t,e){let n=Oe(t,"a","mod"),r=Oe(e,"b","mod");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Mod",i)}});const Fr=$e({square_:function(t){const e=Oe(t,"x","square");return Fe.runKernel("Square",{x:e},{})}});const Lr=$e({notEqual_:function(t,e){let n=Oe(t,"a","notEqual"),r=Oe(e,"b","notEqual");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel("NotEqual",i)}});const _r=$e({oneHot_:function(t,e,n=1,r=0){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:Oe(t,"indices","oneHot","int32")},a={depth:e,onValue:n,offValue:r};return Fe.runKernel(wt,i,a)}});const Rr=$e({onesLike_:function(t){const e={x:Oe(t,"x","onesLike")};return Fe.runKernel(bt,e)}});const Mr=$e({pad_:function(t,e,n=0){const r=Oe(t,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:n},a={x:r};return Fe.runKernel(St,a,i)}});const Or=$e({spaceToBatchND_:function(t,e,n){const i=Oe(t,"x","spaceToBatchND");r(i.rank>=1+e.length,(()=>`input rank ${i.rank} should be > than [blockShape] ${e.length}`)),r(n.length===e.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`)),r(i.shape.reduce(((t,r,i)=>i>0&&i<=e.length?t&&(r+n[i-1][0]+n[i-1][1])%e[i-1]==0:t),!0),(()=>`input spatial dimensions ${i.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`));const a={x:i},s={blockShape:e,paddings:n};return Fe.runKernel(Wt,a,s)}});const Br=$e({pool_:function(t,e,n,i,a,s){null==a&&(a=[1,1]),null==s&&(s=1),0===i&&(i="valid");const o=Oe(t,"x","maxPool");let u=o,l=!1;3===o.rank&&(l=!0,u=on(o,[1,o.shape[0],o.shape[1],o.shape[2]])),r(sn(s,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`));const h=tn(u.shape,e,s,a,i),c=[h.dilationHeight,h.dilationWidth];let p;p="same"===i?function(t,e){const n=t.map(((t,n)=>t+(t-1)*(e[n]-1))).map((t=>t-1)),r=n.map((t=>Math.floor(t/2))),i=n.map(((t,e)=>t-r[e]));return n.map(((t,e)=>[r[e],i[e]]))}([h.filterHeight,h.filterWidth],c):[[0,0],[0,0]];const d=1===c[0]&&1===c[1],[f,g]=function(t,e,n){const r=n.map((t=>t[0])),i=n.map((t=>t[1])),a=t.concat(r,i),s=e.map(((t,e)=>(t-a[e]%t)%t)),o=i.map(((t,e)=>t+s[e])),u=e.map(((t,e)=>[r[e],o[e]])),l=e.map(((t,e)=>[0,s[e]]));return[u,l]}([h.inHeight,h.inWidth],c,p),m=d?i:"valid",y=d?u:Or(u,c,f),v=("avg"===n?()=>un(y,e,s,m):()=>xr(y,e,s,m))(),b=d?v:mn(v,c,g);return l?on(b,[b.shape[1],b.shape[2],b.shape[3]]):b}});const $r=$e({pow_:function(t,e){let n=Oe(t,"base","pow"),r=Oe(e,"exp","pow");[n,r]=ze(n,r);const i={a:n,b:r};return Fe.runKernel("Pow",i)}});const Pr=$e({prelu_:function(t,e){const n={x:Oe(t,"x","prelu"),alpha:Oe(e,"alpha","prelu")};return Fe.runKernel(xt,n)}});const Wr=$e({prod_:function(t,e=null,n=!1){let r=Oe(t,"x","prod");"bool"===r.dtype&&(r=Qe(r,"int32"));const i={x:r},a={axis:e,keepDims:n};return Fe.runKernel("Prod",i,a)}});const Ur=$e({real_:function(t){const e={input:Oe(t,"input","real")};return Fe.runKernel("Real",e)}});const Kr=$e({reciprocal_:function(t){const e={x:Oe(t,"x","reciprocal")};return Fe.runKernel(It,e)}});const jr=$e({relu_:function(t){const e={x:Oe(t,"x","relu")};return Fe.runKernel(Nt,e)}});const Vr=$e({relu6_:function(t){const e={x:Oe(t,"x","relu6")};return Fe.runKernel(Dt,e)}});const qr=$e({reverse_:function(t,e){const n={x:Oe(t,"x","reverse")},r={dims:e};return Fe.runKernel(Tt,n,r)}});const Gr=$e({round_:function(t){const e={x:Oe(t,"x","round")};return Fe.runKernel(Et,e)}});const Hr=$e({rsqrt_:function(t){const e={x:Oe(t,"x","rsqrt")};return Fe.runKernel(Ft,e)}});function Jr(t,e,n,s){if(null==s&&(s=d(t)),"complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!h(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){!function(t){t.forEach((e=>{r(Number.isInteger(e)&&e>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`))}))}(e);const t=a(e),i=a(n);r(t===i,(()=>`Based on the provided shape, [${e}], the tensor should have ${t} values but has ${i}`));for(let t=0;t`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `))}}return h(t)||Array.isArray(t)||(t=[t]),e=e||n,t="string"!==s?ie(t,s):i(t,[],!0),Fe.makeTensor(t,e,s)}function Zr(t,e){if((h(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&h(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Jr(t,[],[],e)}const Xr=$e({selu_:function(t){const e={x:Oe(t,"x","selu")};return Fe.runKernel(_t,e)}});const Yr=$e({separableConv2d_:function(t,e,n,i,a,s=[1,1],o="NHWC"){const u=Oe(t,"x","separableConv2d"),l=Oe(e,"depthwiseFilter","separableConv2d"),h=Oe(n,"pointwiseFilter","separableConv2d");let c=u,p=!1;if(3===u.rank&&(p=!0,c=on(u,[1,u.shape[0],u.shape[1],u.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");r(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),r(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),r(4===h.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),r(1===h.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${h.shape[0]}.`)),r(1===h.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${h.shape[1]}.`));const d=l.shape[2],f=l.shape[3];r(h.shape[2]===d*f,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*f}, but got ${h.shape[2]}.`));const g=En(c,l,i,a,o,s),m=Sn(g,h,1,"valid",o);return p?on(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const Qr=$e({sign_:function(t){const e={x:Oe(t,"x","sign")};return Fe.runKernel(Ot,e)}});const ti=$e({sin_:function(t){const e={x:Oe(t,"x","sin")};return Fe.runKernel("Sin",e)}});const ei=$e({sinh_:function(t){const e={x:Oe(t,"x","sinh")};return Fe.runKernel(Mt,e)}});const ni=$e({softmax_:function(t,e=-1){const n=Oe(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const r={logits:n},i={dim:e};return Fe.runKernel(Kt,r,i)}});const ri=$e({fft_:function(t){r("complex64"===t.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Fe.runKernel("FFT",e)}});const ii=$e({ifft_:function(t){r("complex64"===t.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`));const e={input:t};return Fe.runKernel("IFFT",e)}});const ai=$e({irfft_:function(t){const e=t.shape[t.shape.length-1],n=t.size/e;let r;if(e<=2){const i=on(t,[n,e]);r=ii(i)}else{const i=[n,2*(e-1)],a=on(Ur(t),[n,e]),s=on(Yn(t),[n,e]),o=qr(fn(a,[0,1],[n,e-2]),1),u=pn(qr(fn(s,[0,1],[n,e-2]),1),Zr(-1)),l=hn([a,o],1),h=hn([s,u],1),c=on(kn(l,h),[i[0],i[1]]);r=ii(c)}if(r=Ur(r),3===t.rank&&0!==t.shape[0]){const e=r,n=t.shape[0];r=on(r,[n,r.shape[0]/n,r.shape[1]]),e.dispose()}return r}});const si=$e({split_:function(t,e,n=0){const r={x:Oe(t,"x","split")},i={numOrSizeSplits:e,axis:n};return Fe.runKernel(Ut,r,i)}});const oi=$e({rfft_:function(t,e){r("float32"===t.dtype,(()=>`The dtype for rfft() must be real value but got ${t.dtype}`));let n=t.shape[t.shape.length-1];const i=t.size/n;let a;if(null!=e&&e0)),i=t.shape.map((t=>t));i[t.shape.length-1]=e,a=fn(t,r,i),n=e}else if(null!=e&&e>n){const r=t.shape.map((t=>t));r[t.shape.length-1]=e-n,a=hn([t,zr(r)],t.shape.length-1),n=e}else a=t;const s=$n(a),o=on(kn(a,s),[i,n]),u=ri(o),l=Math.floor(n/2)+1,h=Ur(u),c=Yn(u),p=si(h,[l,n-l],h.shape.length-1),d=si(c,[l,n-l],c.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=l,on(kn(p[0],d[0]),f)}});const ui=$e({sqrt_:function(t){const e={x:Oe(t,"x","sqrt")};return Fe.runKernel(Pt,e)}});const li=$e({squaredDifference_:function(t,e){let n=Oe(t,"a","squaredDifference"),r=Oe(e,"b","squaredDifference");[n,r]=ze(n,r),Mn(n.shape,r.shape);const i={a:n,b:r};return Fe.runKernel(jt,i,{})}});const hi=$e({squeeze_:function(t,e){const n=Oe(t,"x","squeeze");return on(n,function(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,a=null==e||i?null:l(e,t).sort();let s=0;for(let e=0;ee)&&1===t[e]&&(n.push(t[e]),r.push(e)),a[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}}(n.shape,e).newShape)}});const ci=$e({stack_:function(t,e=0){const n=Be(t,"tensors","stack","string_or_numeric");r(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&r(e<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,a={axis:e};return Fe.runKernel(kt,i,a)}});const pi=$e({step_:function(t,e=0){const n={x:Oe(t,"x","step")},r={alpha:e};return Fe.runKernel(Xt,n,r)}});const di=$e({stridedSlice_:function(t,e,n,r,i=0,a=0,s=0,o=0,u=0){const l={x:Oe(t,"x","stridedSlice")},h={begin:e,end:n,strides:r,beginMask:i,endMask:a,ellipsisMask:s,newAxisMask:o,shrinkAxisMask:u};return Fe.runKernel("StridedSlice",l,h)}});const fi=$e({tan_:function(t){const e={x:Oe(t,"x","tan")};return Fe.runKernel("Tan",e)}});const gi=$e({topk_:function(t,e=1,n=!0){const r=Oe(t,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=r.shape[r.shape.length-1];if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${e}`);const a={x:r},s={k:e,sorted:n},[o,u]=Fe.runKernel("TopK",a,s);return{values:o,indices:u}}});const mi=$e({unique_:function(t,e=0){const n=Oe(t,"x","unique","string_or_numeric");r(n.rank>0,(()=>"The input tensor must be at least 1D"));const i={x:n},a={axis:e},[s,o]=Fe.runKernel("Unique",i,a);return{values:s,indices:o}}});const yi=$e({unsortedSegmentSum_:function(t,e,n){const i=Oe(t,"x","unsortedSegmentSum"),a=Oe(e,"segmentIds","unsortedSegmentSum","int32");r(o(n),(()=>"numSegments must be of dtype int"));const s={x:i,segmentIds:a},u={numSegments:n};return Fe.runKernel(Jt,s,u)}});const vi=$e({unstack_:function(t,e=0){const n=Oe(t,"x","unstack","string_or_numeric");r(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`));const i={value:n},a={axis:e};return Fe.runKernel(Ht,i,a)}});const bi=$e({transpose_:function(t,e){const n=Oe(t,"x","transpose");if(null==e&&(e=n.shape.map(((t,e)=>e)).reverse()),r(n.rank===e.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${e}.`)),e.forEach((t=>{r(t>=0&&t"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${e}`))})),n.rank<=1)return n.clone();const i={x:n},a={perm:e};return Fe.runKernel(Gt,i,a)}});function wi(t,e,n=null){if(0===t.rank)return Pe(t);if(1!==t.rank&&null===n)return wi(on(t,[-1]),e,n);if(1===t.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===e)return fr(Pe(t),n);if(e===1/0)return pr(Pe(t),n);if(e===-1/0)return Cr(Pe(t),n);if("euclidean"===e||2===e)return ui(fr($r(Pe(t),Zr(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}if(Array.isArray(n)&&2===n.length){if(1===e)return pr(fr(Pe(t),n[0]),n[1]-1);if(e===1/0)return pr(fr(Pe(t),n[1]),n[0]);if(e===-1/0)return Cr(fr(Pe(t),n[1]),n[0]);if("fro"===e||"euclidean"===e)return ui(fr(Fr(t),n));throw new Error(`Error in norm: invalid ord value: ${e}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const ki=$e({norm_:function(t,e="euclidean",n=null,r=!1){const i=wi(t=Oe(t,"x","norm"),e,n);let a=i.shape;if(r){const e=l(n,t.shape);a=mr(i.shape,e)}return on(i,a)}});const Si=$e({conv2DBackpropFilter_:function(t,e,n,i,a,s="NHWC",u){let l=t;3===t.rank&&(l=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let h=e;3===h.rank&&(h=on(e,[1,e.shape[0],e.shape[1],e.shape[2]])),r(4===l.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${l.shape}.`)),r(4===h.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${h.shape}.`)),r(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const c="NHWC"===s?l.shape[3]:l.shape[1],p="NHWC"===s?h.shape[3]:h.shape[1];r(c===n[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`)),r(p===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${n[3]}).`)),null!=u&&r(o(a),(()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${u} but got pad ${a}.`));const d={x:l,dy:h},f={strides:i,pad:a,dataFormat:s,dimRoundingMode:u,filterShape:n};return Fe.runKernel("Conv2DBackpropFilter",d,f)}});const xi=$e({depthwiseConv2dNativeBackpropFilter_:function(t,e,n,r,i,a=[1,1],s){let o=t;3===t.rank&&(o=on(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u=e;3===u.rank&&(u=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={x:o,dy:u},h={strides:r,pad:i,dimRoundingMode:s,dilations:a,filterShape:n};return Fe.runKernel("DepthwiseConv2dNativeBackpropFilter",l,h)}});const Ii=$e({depthwiseConv2dNativeBackpropInput_:function(t,e,n,r,i,a=[1,1],s){let o=e,u=!1;3===e.rank&&(u=!0,o=on(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={dy:o,filter:n},h={strides:r,pad:i,dimRoundingMode:s,dilations:a,inputShape:t},c=Fe.runKernel("DepthwiseConv2dNativeBackpropInput",l,h);return u?on(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Ni=$e({resizeBilinear_:function(t,e,n=!1,i=!1){const a=Oe(t,"images","resizeBilinear");r(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),r(2===e.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`)),r(!1===i||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=on(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const u={images:s},l={alignCorners:n,halfPixelCenters:i,size:e},h=Fe.runKernel(Ct,u,l);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const zi=$e({resizeNearestNeighbor_:function(t,e,n=!1,i=!1){const a=Oe(t,"images","resizeNearestNeighbor");r(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),r(2===e.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`)),r("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),r(!1===i||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=on(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const u={images:s},l={alignCorners:n,halfPixelCenters:i,size:e},h=Fe.runKernel(At,u,l);return o?on(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});ve().prototype.abs=function(){return this.throwIfDisposed(),Pe(this)},ve().prototype.acos=function(){return this.throwIfDisposed(),We(this)},ve().prototype.acosh=function(){return this.throwIfDisposed(),Ue(this)},ve().prototype.add=function(t){return this.throwIfDisposed(),Ke(this,t)},ve().prototype.all=function(t,e){return this.throwIfDisposed(),je(this,t,e)},ve().prototype.any=function(t,e){return this.throwIfDisposed(),Ve(this,t,e)},ve().prototype.argMax=function(t){return this.throwIfDisposed(),qe(this,t)},ve().prototype.argMin=function(t){return this.throwIfDisposed(),Ge(this,t)},ve().prototype.asScalar=function(){return this.throwIfDisposed(),r(1===this.size,(()=>"The array must have only 1 element.")),on(this,[])},ve().prototype.asType=function(t){return this.throwIfDisposed(),Qe(this,t)},ve().prototype.as1D=function(){return this.throwIfDisposed(),on(this,[this.size])},ve().prototype.as2D=function(t,e){return this.throwIfDisposed(),on(this,[t,e])},ve().prototype.as3D=function(t,e,n){return this.throwIfDisposed(),on(this,[t,e,n])},ve().prototype.as4D=function(t,e,n,r){return this.throwIfDisposed(),on(this,[t,e,n,r])},ve().prototype.as5D=function(t,e,n,r,i){return this.throwIfDisposed(),on(this,[t,e,n,r,i])},ve().prototype.asin=function(){return this.throwIfDisposed(),He(this)},ve().prototype.asinh=function(){return this.throwIfDisposed(),Je(this)},ve().prototype.atan=function(){return this.throwIfDisposed(),Ze(this)},ve().prototype.atan2=function(t){return this.throwIfDisposed(),Xe(this,t)},ve().prototype.atanh=function(){return this.throwIfDisposed(),Ye(this)},ve().prototype.avgPool=function(t,e,n,r){return this.throwIfDisposed(),un(this,t,e,n,r)},ve().prototype.batchToSpaceND=function(t,e){return this.throwIfDisposed(),mn(this,t,e)},ve().prototype.batchNorm=function(t,e,n,r,i){return this.throwIfDisposed(),yn(this,t,e,n,r,i)},ve().prototype.broadcastTo=function(t){return this.throwIfDisposed(),vn(this,t)},ve().prototype.cast=function(t){return this.throwIfDisposed(),Qe(this,t)},ve().prototype.ceil=function(){return this.throwIfDisposed(),bn(this)},ve().prototype.clipByValue=function(t,e){return this.throwIfDisposed(),wn(this,t,e)},ve().prototype.concat=function(t,e){return this.throwIfDisposed(),t instanceof ye&&(t=[t]),hn([this,...t],e)},ve().prototype.conv1d=function(t,e,n,r,i,a){return this.throwIfDisposed(),xn(this,t,e,n,r,i,a)},ve().prototype.conv2dTranspose=function(t,e,n,r,i){return this.throwIfDisposed(),Nn(this,t,e,n,r,i)},ve().prototype.conv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),Sn(this,t,e,n,r,i,a)},ve().prototype.cos=function(){return this.throwIfDisposed(),An(this)},ve().prototype.cosh=function(){return this.throwIfDisposed(),Cn(this)},ve().prototype.cumsum=function(t,e,n){return this.throwIfDisposed(),Dn(this,t,e,n)},ve().prototype.depthToSpace=function(t,e){return this.throwIfDisposed(),Tn(this,t,e)},ve().prototype.depthwiseConv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),En(this,t,e,n,r,i,a)},ve().prototype.dilation2d=function(t,e,n,r,i){return this.throwIfDisposed(),Fn(this,t,e,n,r,i)},ve().prototype.divNoNan=function(t){return this.throwIfDisposed(),Pn(this,t)},ve().prototype.div=function(t){return this.throwIfDisposed(),_n(this,t)},ve().prototype.dot=function(t){return this.throwIfDisposed(),Wn(this,t)},ve().prototype.elu=function(){return this.throwIfDisposed(),Un(this)},ve().prototype.equal=function(t){return this.throwIfDisposed(),On(this,t)},ve().prototype.erf=function(){return this.throwIfDisposed(),Kn(this)},ve().prototype.exp=function(){return this.throwIfDisposed(),jn(this)},ve().prototype.expandDims=function(t){return this.throwIfDisposed(),Vn(this,t)},ve().prototype.expm1=function(){return this.throwIfDisposed(),qn(this)},ve().prototype.fft=function(){return this.throwIfDisposed(),ri(this)},ve().prototype.flatten=function(){return this.throwIfDisposed(),on(this,[this.size])},ve().prototype.floor=function(){return this.throwIfDisposed(),Hn(this)},ve().prototype.floorDiv=function(t){return this.throwIfDisposed(),Ln(this,t)},ve().prototype.gather=function(t,e){return this.throwIfDisposed(),Jn(this,t,e)},ve().prototype.greaterEqual=function(t){return this.throwIfDisposed(),Xn(this,t)},ve().prototype.greater=function(t){return this.throwIfDisposed(),Zn(this,t)},ve().prototype.ifft=function(){return this.throwIfDisposed(),ii(this)},ve().prototype.irfft=function(){return this.throwIfDisposed(),ai(this)},ve().prototype.isFinite=function(){return this.throwIfDisposed(),Qn(this)},ve().prototype.isInf=function(){return this.throwIfDisposed(),tr(this)},ve().prototype.isNaN=function(){return this.throwIfDisposed(),er(this)},ve().prototype.leakyRelu=function(t){return this.throwIfDisposed(),nr(this,t)},ve().prototype.lessEqual=function(t){return this.throwIfDisposed(),ir(this,t)},ve().prototype.less=function(t){return this.throwIfDisposed(),rr(this,t)},ve().prototype.localResponseNormalization=function(t,e,n,r){return this.throwIfDisposed(),ar(this,t,e,n,r)},ve().prototype.logSigmoid=function(){return this.throwIfDisposed(),cr(this)},ve().prototype.logSoftmax=function(t){return this.throwIfDisposed(),gr(this,t)},ve().prototype.logSumExp=function(t,e){return this.throwIfDisposed(),vr(this,t,e)},ve().prototype.log=function(){return this.throwIfDisposed(),sr(this)},ve().prototype.log1p=function(){return this.throwIfDisposed(),or(this)},ve().prototype.logicalAnd=function(t){return this.throwIfDisposed(),br(this,t)},ve().prototype.logicalNot=function(){return this.throwIfDisposed(),wr(this)},ve().prototype.logicalOr=function(t){return this.throwIfDisposed(),kr(this,t)},ve().prototype.logicalXor=function(t){return this.throwIfDisposed(),Sr(this,t)},ve().prototype.matMul=function(t,e,n){return this.throwIfDisposed(),cn(this,t,e,n)},ve().prototype.maxPool=function(t,e,n,r){return this.throwIfDisposed(),xr(this,t,e,n,r)},ve().prototype.max=function(t,e){return this.throwIfDisposed(),pr(this,t,e)},ve().prototype.maximum=function(t){return this.throwIfDisposed(),Ir(this,t)},ve().prototype.mean=function(t,e){return this.throwIfDisposed(),Nr(this,t,e)},ve().prototype.min=function(t,e){return this.throwIfDisposed(),Cr(this,t,e)},ve().prototype.minimum=function(t){return this.throwIfDisposed(),Dr(this,t)},ve().prototype.mirrorPad=function(t,e){return this.throwIfDisposed(),Tr(this,t,e)},ve().prototype.mod=function(t){return this.throwIfDisposed(),Er(this,t)},ve().prototype.mul=function(t){return this.throwIfDisposed(),pn(this,t)},ve().prototype.neg=function(){return this.throwIfDisposed(),lr(this)},ve().prototype.norm=function(t,e,n){return this.throwIfDisposed(),ki(this,t,e,n)},ve().prototype.notEqual=function(t){return this.throwIfDisposed(),Lr(this,t)},ve().prototype.oneHot=function(t,e=1,n=0){return this.throwIfDisposed(),_r(this,t,e,n)},ve().prototype.onesLike=function(){return this.throwIfDisposed(),Rr(this)},ve().prototype.pad=function(t,e){return this.throwIfDisposed(),Mr(this,t,e)},ve().prototype.pool=function(t,e,n,r,i){return this.throwIfDisposed(),Br(this,t,e,n,r,i)},ve().prototype.pow=function(t){return this.throwIfDisposed(),$r(this,t)},ve().prototype.prelu=function(t){return this.throwIfDisposed(),Pr(this,t)},ve().prototype.prod=function(t,e){return this.throwIfDisposed(),Wr(this,t,e)},ve().prototype.reciprocal=function(){return this.throwIfDisposed(),Kr(this)},ve().prototype.relu=function(){return this.throwIfDisposed(),jr(this)},ve().prototype.relu6=function(){return this.throwIfDisposed(),Vr(this)},ve().prototype.reshapeAs=function(t){return this.throwIfDisposed(),on(this,t.shape)},ve().prototype.reshape=function(t){return this.throwIfDisposed(),on(this,t)},ve().prototype.resizeBilinear=function(t,e,n){return this.throwIfDisposed(),Ni(this,t,e,n)},ve().prototype.resizeNearestNeighbor=function(t,e,n){return this.throwIfDisposed(),zi(this,t,e,n)},ve().prototype.reverse=function(t){return this.throwIfDisposed(),qr(this,t)},ve().prototype.rfft=function(){return this.throwIfDisposed(),oi(this)},ve().prototype.round=function(){return this.throwIfDisposed(),Gr(this)},ve().prototype.rsqrt=function(){return this.throwIfDisposed(),Hr(this)},ve().prototype.selu=function(){return this.throwIfDisposed(),Xr(this)},ve().prototype.separableConv2d=function(t,e,n,r,i,a){return this.throwIfDisposed(),Yr(this,t,e,n,r,i,a)},ve().prototype.sigmoid=function(){return this.throwIfDisposed(),dn(this)},ve().prototype.sign=function(){return this.throwIfDisposed(),Qr(this)},ve().prototype.sin=function(){return this.throwIfDisposed(),ti(this)},ve().prototype.sinh=function(){return this.throwIfDisposed(),ei(this)},ve().prototype.slice=function(t,e){return this.throwIfDisposed(),fn(this,t,e)},ve().prototype.softmax=function(t){return this.throwIfDisposed(),ni(this,t)},ve().prototype.softplus=function(){return this.throwIfDisposed(),hr(this)},ve().prototype.spaceToBatchND=function(t,e){return this.throwIfDisposed(),Or(this,t,e)},ve().prototype.split=function(t,e){return this.throwIfDisposed(),si(this,t,e)},ve().prototype.sqrt=function(){return this.throwIfDisposed(),ui(this)},ve().prototype.square=function(){return this.throwIfDisposed(),Fr(this)},ve().prototype.squaredDifference=function(t){return this.throwIfDisposed(),li(this,t)},ve().prototype.squeeze=function(t){return this.throwIfDisposed(),hi(this,t)},ve().prototype.stack=function(t,e){this.throwIfDisposed();const n=t instanceof ye?[this,t]:[this,...t];return ci(n,e)},ve().prototype.step=function(t){return this.throwIfDisposed(),pi(this,t)},ve().prototype.stridedSlice=function(t,e,n,r,i,a,s,o){return this.throwIfDisposed(),di(this,t,e,n,r,i,a,s,o)},ve().prototype.sub=function(t){return this.throwIfDisposed(),dr(this,t)},ve().prototype.sum=function(t,e){return this.throwIfDisposed(),fr(this,t,e)},ve().prototype.tan=function(){return this.throwIfDisposed(),fi(this)},ve().prototype.tanh=function(){return this.throwIfDisposed(),gn(this)},ve().prototype.tile=function(t){return this.throwIfDisposed(),Gn(this,t)},ve().prototype.toBool=function(){return this.throwIfDisposed(),Qe(this,"bool")},ve().prototype.toFloat=function(){return this.throwIfDisposed(),Qe(this,"float32")},ve().prototype.toInt=function(){return this.throwIfDisposed(),Qe(this,"int32")},ve().prototype.topk=function(t,e){return this.throwIfDisposed(),gi(this,t,e)},ve().prototype.transpose=function(t){return this.throwIfDisposed(),bi(this,t)},ve().prototype.unique=function(t){return this.throwIfDisposed(),mi(this,t)},ve().prototype.unsortedSegmentSum=function(t,e){return this.throwIfDisposed(),yi(this,t,e)},ve().prototype.unstack=function(t){return this.throwIfDisposed(),vi(this,t)},ve().prototype.where=function(t,e){return this.throwIfDisposed(),Bn(t,this,e)},ve().prototype.zerosLike=function(){return this.throwIfDisposed(),$n(this)};const Ai={kernelName:"Abs",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pi(Qe(n,"float32"),-1))}}},Ci={kernelName:D,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Fr(Qe(n,"float32")),r=ui(dr(Zr(1),e));return lr(_n(t,r))}}}},Di={kernelName:T,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=ui(dr(Fr(Qe(n,"float32")),1));return _n(t,e)}}}},Ti={kernelName:E,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{let e=t;const r=Rn(n.shape,i);return r.length>0&&(e=fr(e,r)),on(e,n.shape)},b:()=>{let e=t;const n=Rn(r.shape,i);return n.length>0&&(e=fr(e,n)),on(e,r.shape)}}}},Ei={kernelName:"AddN",saveAllInputs:!0,gradFunc:(t,e)=>{const n={};return e.forEach(((e,r)=>{n[r]=()=>t.clone()})),n}},Fi={kernelName:F,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(n)}}},Li={kernelName:L,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>$n(n)}}},_i={kernelName:_,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,ui(dr(Zr(1),Fr(Qe(n,"float32")))))}}},Ri={kernelName:R,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=ui(Ke(Zr(1),Fr(Qe(n,"float32"))));return _n(t,e)}}}},Mi={kernelName:B,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=Ke(Fr(n),Fr(r));let a=pn(t,_n(r,e));const s=Rn(n.shape,i);return s.length>0&&(a=fr(a,s)),on(a,n.shape)},b:()=>{const e=Ke(Fr(n),Fr(r));let a=lr(pn(t,_n(n,e)));const s=Rn(r.shape,i);return s.length>0&&(a=fr(a,s)),on(a,r.shape)}}}},Oi={kernelName:M,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Ke(Fr(Qe(n,"float32")),1))}}},Bi={kernelName:O,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,dr(Zr(1),Fr(Qe(n,"float32"))))}}};const $i=$e({avgPool3dGrad_:function(t,e,n,i,a,s){const u=Oe(t,"dy","avgPool3dGrad"),l=Oe(e,"input","avgPool3dGrad");let h=u,c=l,p=!1;4===l.rank&&(p=!0,h=on(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),c=on(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]])),r(5===h.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${h.rank}.`)),r(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),null!=s&&r(o(a),(()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${a}.`));const d={dy:h,input:c},f={filterSize:n,strides:i,pad:a,dimRoundingMode:s},g=Fe.runKernel("AvgPool3DGrad",d,f);return p?on(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),Pi={kernelName:"AvgPool3D",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{filterSize:i,strides:a,pad:s,dimRoundingMode:o}=n;return{x:()=>$i(t,r,i,a,s,o)}}};const Wi=$e({avgPoolGrad_:function(t,e,n,i,a){const s=Oe(t,"dy","avgPoolGrad"),o=Oe(e,"input","avgPoolGrad");r(o.rank===s.rank,(()=>`Rank of input (${o.rank}) does not match rank of dy (${s.rank})`));let u=o,l=s,h=!1;3===o.rank&&(h=!0,u=on(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=on(s,[1,s.shape[0],s.shape[1],s.shape[2]])),r(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),r(4===u.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${u.rank}.`));const c={dy:l,input:u},p={filterSize:n,strides:i,pad:a},d=Fe.runKernel("AvgPoolGrad",c,p);return h?on(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Ui={kernelName:$,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{filterSize:i,strides:a,pad:s}=n;return{x:()=>Wi(t,r,i,a,s)}}},Ki={kernelName:P,inputsToSave:["a","b"],gradFunc:(t,e,n)=>{const[r,i]=e,{transposeA:a,transposeB:s}=n;return a||s?!a&&s?{a:()=>cn(t,i,!1,!1),b:()=>cn(t,r,!0,!1)}:a&&!s?{a:()=>cn(i,t,!1,!0),b:()=>cn(r,t,!1,!1)}:{a:()=>cn(i,t,!0,!0),b:()=>cn(t,r,!0,!0)}:{a:()=>cn(t,i,!1,!0),b:()=>cn(r,t,!0,!1)}}},ji={kernelName:W,gradFunc:(t,e,n)=>{const{blockShape:r,crops:i}=n;return{x:()=>Or(t,r,i)}}},Vi={kernelName:"BroadcastTo",gradFunc:(t,e,n)=>{const r=n,i=r.inputShape,a=r.shape,s=Array.from(a);for(let t=i.length-1;t>=0;t--)if(i[t]===a[t])s[t]=1;else if(1!==i[t])throw new Error(`broadcastTo(): [${i}] cannot be broadcast to [${a}].`);const o=[];for(let t=0;t1&&o.push(t);return{x:()=>fr(t,o,!0)}}},qi={kernelName:U,gradFunc:t=>({x:()=>t.clone()})},Gi={kernelName:K,gradFunc:t=>({x:()=>$n(t)})},Hi={kernelName:j,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{clipValueMin:i,clipValueMax:a}=n;return{x:()=>Bn(br(Xn(r,i),ir(r,a)),t,$n(t))}}},Ji={kernelName:V,inputsToSave:["x"],gradFunc:Ai.gradFunc},Zi={kernelName:q,saveAllInputs:!0,gradFunc:(t,e,n)=>{const r=e.map((t=>t.shape)),{axis:i}=n,a=l(i,e[0].shape)[0],s=r.map((t=>t[a]));return si(t,s,a).map((t=>()=>t))}},Xi={kernelName:G,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[i,a]=e,{dilations:s,strides:o,pad:u,dataFormat:l}=n;return r(an(s),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`)),{x:()=>In(i.shape,t,a,o,u,l),filter:()=>Si(i,t,a.shape,o,u,l)}}},Yi={kernelName:H,inputsToSave:["dy","filter"],gradFunc:(t,e,n)=>{const[r,i]=e,{strides:a,pad:s,dataFormat:o,dimRoundingMode:u}=n;return{dy:()=>Sn(t,i,a,s,o,1,u),filter:()=>Si(t,r,i.shape,a,s,o,u)}}};const Qi=$e({conv3DBackpropFilter_:function(t,e,n,i,a){let s=t;4===t.rank&&(s=on(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]));let o=e;4===o.rank&&(o=on(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]])),r(5===s.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`)),r(5===o.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`)),r(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),r(s.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`)),r(o.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`));const u={x:s,dy:o},l={strides:i,pad:a,filterShape:n};return Fe.runKernel("Conv3DBackpropFilterV2",u,l)}}),ta={kernelName:"Conv3D",inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:a,pad:s}=n;r(an(i),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const[o,u]=e;return{x:()=>zn(o.shape,t,u,a,s),filter:()=>Qi(o,t,u.shape,a,s)}}},ea={kernelName:"Cos",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(lr(ti(Qe(n,"float32"))),t)}}},na={kernelName:J,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(ei(Qe(n,"float32")),t)}}},ra={kernelName:Z,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{axis:i,exclusive:a,reverse:s}=n;return{x:()=>{const e=function(t,e){if(function(t,e){for(let n=0;nn.push(t))),n}([i],r.rank);let n=Dn(t,i,a,!s);return null!=e&&(n=bi(n,e)),n}}}},ia={kernelName:X,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const{dilations:i,strides:a,pad:s,dimRoundingMode:u}=n,l=null==i?[1,1]:i;r(an(l),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${l}'`));const[h,c]=e;return r(4===h.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${h.rank}.`)),r(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),r(h.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),r(sn(a,l),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'.`)),null!=u&&r(o(s),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`)),{x:()=>Ii(h.shape,t,c,a,s,i,u),filter:()=>xi(h,t,c.shape,a,s,i,u)}}},aa={kernelName:Y,inputsToSave:["x","filter"],gradFunc:(t,e,n)=>{const[r,i]=e,a={x:r,filter:i,dy:t},s={x:r,filter:i,dy:t};return{x:()=>Fe.runKernel("Dilation2DBackpropInput",a,n),filter:()=>Fe.runKernel("Dilation2DBackpropFilter",s,n)}}},sa={kernelName:"Elu",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e,r={dy:t,y:n};return{x:()=>Fe.runKernel("EluGrad",r)}}},oa={kernelName:"Erf",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,r=pn(jn(lr(Fr(n))),2/Math.sqrt(Math.PI));return{x:()=>pn(t,r)}}},ua={kernelName:"Exp",outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,n)}}},la={kernelName:tt,inputsToSave:["input"],gradFunc:(t,e)=>{const[n]=e;return{input:()=>on(t,n.shape)}}},ha={kernelName:et,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,jn(n))}}},ca={kernelName:nt,gradFunc:t=>({x:()=>$n(t)})},pa={kernelName:rt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=_n(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const a=Rn(r.shape,i);a.length>0&&(e=on(fr(e,a),r.shape));const s=Fr(r);return lr(_n(e,Qe(s,"float32")))}}}},da={kernelName:it,inputsToSave:["x","mean","variance","scale"],gradFunc:(t,e,n)=>{const{varianceEpsilon:r}=n,[i,a,s,o]=e,u=null==o?Zr(1):o,l=Rn(a.shape,i.shape),h=[];if(1===a.rank){for(let t=0;t1===a.rank?on(pn(pn(t,Gn(on(d,[1,1,1,a.shape[0]]),h)),u),i.shape):on(pn(pn(t,d),u),i.shape),mean:()=>{let t=pn(pn(d,Zr(-1)),p);return 1===a.rank&&(t=fr(t,l)),on(t,a.shape)},variance:()=>{let t=pn(pn(f,c),p);return 1===a.rank&&(t=fr(t,l)),on(t,a.shape)},scale:()=>{const e=pn(c,d);let n=pn(t,e);return 1===a.rank&&(n=fr(n,l)),on(n,a.shape)},offset:()=>{let e=t;return 1===a.rank&&(e=fr(e,l)),on(e,a.shape)}}}},fa={kernelName:at,inputsToSave:["x","indices"],gradFunc:(t,e,n)=>{const[r,i]=e,{axis:a}=n,s=l(a,r.shape)[0];return{x:()=>{const e=r.shape,n=i.size,o=e.slice(0,s),u=o.length,l=e.slice(a,e.length).slice(1),h=l.length,c=ga(0,u),p=ga(u+1,u+1+h),d=ma([o,[n],l]),f=on(t,d),g=on(i,[n]),m=ma([[u],c,p]),y=bi(f,m);let v=yi(y,g,r.shape[s]);const b=yr(m);return v=bi(v,b),v},indices:()=>i}}};function ga(t,e){const n=[];for(let r=t;r{const[n,r]=e;return{a:()=>$n(n),b:()=>$n(r)}}},va={kernelName:ot,gradFunc:t=>({x:()=>Qe(t,"float32")})},ba={kernelName:ut,gradFunc:t=>({x:()=>$n(t)})},wa={kernelName:lt,gradFunc:t=>({x:()=>$n(t)})},ka={kernelName:ht,gradFunc:t=>({x:()=>$n(t)})},Sa={kernelName:ct,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{alpha:i}=n,a=Zn(r,0);return{x:()=>Bn(a,t,pn(t,i))}}},xa={kernelName:pt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Ke(n,1))}}},Ia={kernelName:"Log",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Qe(n,"float32"))}}},Na={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r]=e,{axis:i}=n;return{logits:()=>{const e=jn(r);return dr(t,pn(fr(t,i,!0),e))}}}};const za=$e({localResponseNormalizationBackprop_:function(t,e,n,r=5,i=1,a=1,s=.5){const o={x:t,y:e,dy:n},u={depthRadius:r,bias:i,alpha:a,beta:s};return Fe.runKernel("LRNGrad",o,u)}}),Aa={kernelName:"LRN",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{depthRadius:a,bias:s,alpha:o,beta:u}=n;return{x:()=>za(r,i,t,a,s,o,u)}}};function Ca(t,e,n,r){return e.rankpn(t,Qe(On(n,e),t.dtype))}}const Da={kernelName:"Max",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const r=n,{reductionIndices:i}=r,a=e[0],s=Ca(t,e[1],a,l(i,a.shape));return{x:()=>s.x()}}},Ta={kernelName:dt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e;return{a:()=>pn(t,Qe(Xn(n,r),"float32")),b:()=>pn(t,Qe(rr(n,r),"float32"))}}};const Ea=$e({maxPool3dGrad_:function(t,e,n,i,a,s,u){const l=Oe(t,"dy","maxPool3dGrad"),h=Oe(e,"input","maxPool3dGrad"),c=Oe(n,"output","maxPool3dGrad");let p=l,d=h,f=c,g=!1;4===h.rank&&(g=!0,p=on(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=on(h,[1,h.shape[0],h.shape[1],h.shape[2],h.shape[3]]),f=on(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),r(5===p.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${p.rank}.`)),r(5===d.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`)),r(5===f.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${f.rank}.`)),null!=u&&r(o(s),(()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`));const m={dy:p,input:d,output:f},y={filterSize:i,strides:a,pad:s,dimRoundingMode:u},v=Fe.runKernel("MaxPool3DGrad",m,y);return g?on(v,[v.shape[1],v.shape[2],v.shape[3],v.shape[4]]):v}}),Fa={kernelName:"MaxPool3D",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{filterSize:a,strides:s,pad:o,dimRoundingMode:u}=n;return{x:()=>Ea(t,r,i,a,s,o,u)}}};const La=$e({maxPoolGrad_:function(t,e,n,i,a,s,u){const l=Oe(t,"dy","maxPoolGrad"),h=Oe(e,"input","maxPoolGrad"),c=Oe(n,"output","maxPoolGrad");r(h.rank===l.rank,(()=>`Rank of input (${h.rank}) does not match rank of dy (${l.rank})`)),r(4===l.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),r(4===h.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${h.rank}.`)),null!=u&&r(o(s),(()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${u} but got pad ${s}.`));const p={dy:l,input:h,output:c},d={filterSize:i,strides:a,pad:s,dimRoundingMode:u};return Fe.runKernel("MaxPoolGrad",p,d)}}),_a={kernelName:St,inputsToSave:["x"],gradFunc:(t,e,n)=>{const r=e[0],{paddings:i}=n,a=i.map((t=>t[0]));return{x:()=>fn(t,a,r.shape)}}};const Ra={kernelName:Wt,gradFunc:(t,e,n)=>{const{blockShape:r,paddings:i}=n;return{x:()=>mn(t,r,i)}}},Ma={kernelName:Ut,gradFunc:(t,e,n)=>{const{axis:r}=n;return{x:()=>hn(t,r)}}};const Oa=[Ai,Ci,Di,Ti,Ei,Fi,Li,_i,Ri,Mi,Oi,Bi,Pi,Ui,Ki,ji,Vi,qi,Gi,Hi,Ji,Zi,Yi,Xi,ta,ea,na,ra,ia,aa,{kernelName:Q,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=_n(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{let e=pn(t,Qe(n,"float32"));const a=Rn(r.shape,i);a.length>0&&(e=on(fr(e,a),r.shape));const s=Fr(r);return lr(_n(e,Qe(s,"float32")))}}}},sa,oa,ua,la,ha,pa,ca,da,fa,ya,va,ba,wa,ka,Sa,xa,Ia,Na,Aa,Da,Da,Ta,Fa,{kernelName:ft,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r,i]=e,{filterSize:a,strides:s,pad:o}=n;return{x:()=>La(t,r,i,a,s,o)}}},{kernelName:gt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{axis:i}=n,s=l(i,r.shape),o=a(function(t,e){const n=[],r=t.length;for(let i=0;it[e]))]}(r.shape,s)[1]);return{x:()=>{const e=r.shape.slice();s.forEach((t=>{e[t]=1}));const n=on(t,e);return _n(pn(n,Ar(r.shape,"float32")),o)}}}},{kernelName:"Min",inputsToSave:["x"],outputsToSave:[!0],gradFunc:(t,e,n)=>{const r=n,{axis:i}=r,[a,s]=e,o=Ca(t,s,a,l(i,a.shape));return{x:()=>o.x()}}},{kernelName:mt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e;return{a:()=>pn(t,Qe(ir(n,r),"float32")),b:()=>pn(t,Qe(Zn(n,r),"float32"))}}},{kernelName:yt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const r=e[0],{paddings:i}=n,a=i.map((t=>t[0]));return{x:()=>fn(t,a,r.shape)}}},{kernelName:"Mod",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=Rn(n.shape,i);return e.length>0?on(fr(t,e),n.shape):t},b:()=>{const e=pn(t,lr(Hn(_n(n,r)))),a=Rn(r.shape,i);return a.length>0?on(fr(e,a),r.shape):e}}}},{kernelName:vt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{const e=pn(t,Qe(r,"float32")),a=Rn(n.shape,i);return a.length>0?on(fr(e,a),n.shape):e},b:()=>{const e=pn(t,Qe(n,"float32")),a=Rn(r.shape,i);return a.length>0?on(fr(e,a),r.shape):e}}}},{kernelName:"Neg",gradFunc:t=>({x:()=>lr(t)})},{kernelName:wt,inputsToSave:["indices"],gradFunc:(t,e)=>{const n=e[0];return{indices:()=>zr(n.shape,"float32")}}},{kernelName:bt,gradFunc:t=>({x:()=>$n(t)})},{kernelName:kt,saveAllInputs:!0,gradFunc:(t,e,n)=>{const{axis:r}=n;return vi(t,r).map((t=>()=>t))}},_a,_a,{kernelName:"Pow",inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(t,e)=>{const[n,r,i]=e,a=n,s=r,o=Mn(a.shape,s.shape);return{a:()=>{const e=Qe(s,"float32");let n=pn(t,pn(e,$r(a,dr(e,Zr(1)))));const r=Rn(a.shape,o);return r.length>0&&(n=fr(n,r)),on(n,a.shape)},b:()=>{const e=Zn(a,0),n=Bn(e,sr(a),$n(a));let r=pn(t,pn(i,n));const u=Rn(s.shape,o);return u.length>0&&(r=fr(r,u)),on(r,s.shape)}}}},{kernelName:xt,inputsToSave:["x","alpha"],gradFunc:(t,e)=>{const[n,r]=e,i=Zn(n,0);return{x:()=>Bn(i,t,pn(t,r)),alpha:()=>{let e=Bn(i,$n(t),pn(t,n));const a=Rn(r.shape,t.shape);return a.length>0&&(e=fr(e,a)),on(e,r.shape)}}}},{kernelName:It,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,lr(Fr(n)))}}},{kernelName:Dt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e,r=pn(ir(n,6),pi(n));return{x:()=>pn(t,Qe(r,"float32"))}}},{kernelName:Nt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,Qe(pi(n),"float32"))}}},{kernelName:zt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>on(t,n.shape)}}},{kernelName:Ct,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[r]=e,i={dy:t,images:r};return{images:()=>Fe.runKernel("ResizeBilinearGrad",i,n)}}},{kernelName:At,inputsToSave:["images"],gradFunc:(t,e,n)=>{const[r]=e,i={dy:t,images:r};return{images:()=>Fe.runKernel("ResizeNearestNeighborGrad",i,n)}}},{kernelName:Tt,gradFunc:(t,e,n)=>{const{dims:r}=n,i=l(r,t.shape);return{x:()=>qr(t,i)}}},{kernelName:Et,gradFunc:t=>({x:()=>$n(t)})},{kernelName:Ft,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>lr(_n(t,pn($r(n,1.5),2)))}}},{kernelName:Lt,inputsToSave:["condition"],gradFunc:(t,e)=>{const[n]=e;return{condition:()=>Qe($n(n),"float32"),t:()=>pn(t,Qe(n,t.dtype)),e:()=>pn(t,Qe(wr(n),t.dtype))}}},{kernelName:_t,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>{const e=Zn(n,Zr(0)),r=Zr(1.7580993408473768),i=Zr(1.0507009873554805),a=pn(t,i),s=pn(pn(t,r),jn(Qe(n,"float32")));return Bn(e,a,s)}}}},{kernelName:Bt,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(n,dr(Zr(1),n)))}}},{kernelName:Ot,gradFunc:t=>({x:()=>$n(t)})},{kernelName:"Sin",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(An(Qe(n,"float32")),t)}}},{kernelName:Mt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(Cn(Qe(n,"float32")),t)}}},{kernelName:Rt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[i]=e,{begin:a,size:s}=n,o=i.shape,[u,l]=function(t,e,n){let i;const a=t.shape.length;let s;return i="number"==typeof e?[e,...new Array(a-1).fill(0)]:e.length{r(-1!==t,(()=>"slice() does not support negative begin indexing."))})),s=null==n?new Array(a).fill(-1):"number"==typeof n?[n,...new Array(a-1).fill(-1)]:n.lengthe>=0?e:(r(-1===e,(()=>`Negative size values should be exactly -1 but got ${e} for the slice() size at index ${n}.`)),t.shape[n]-i[n]))),[i,s]}(i,a,s),h=[];for(let e=0;eMr(t,h)}}},{kernelName:Kt,outputsToSave:[!0],gradFunc:(t,e,n)=>{const[r]=e,{dim:i}=n,a=pn(t,r);return{logits:()=>dr(a,pn(fr(a,[i],true),r))}}},{kernelName:$t,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,dn(n))}}},Ra,Ra,Ma,Ma,{kernelName:Pt,inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,pn(ui(Qe(n,"float32")),2))}}},{kernelName:jt,inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Zr(2);return{a:()=>pn(t,pn(i,dr(n,r))),b:()=>pn(t,pn(i,dr(r,n)))}}},{kernelName:"Square",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(t,pn(Qe(n,"float32"),2))}}},{kernelName:Xt,gradFunc:t=>({x:()=>$n(t)})},{kernelName:"Sub",inputsToSave:["a","b"],gradFunc:(t,e)=>{const[n,r]=e,i=Mn(n.shape,r.shape);return{a:()=>{let e=t;const r=Rn(n.shape,i);return r.length>0&&(e=fr(e,r)),on(e,n.shape)},b:()=>{let e=t;const n=Rn(r.shape,i);return n.length>0&&(e=fr(e,n)),on(lr(e),r.shape)}}}},{kernelName:"Sum",inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,i=r.shape.slice(),{axis:a}=n;l(a,r.shape).forEach((t=>{i[t]=1}));const s=on(t,i),o=pn(s,Ar(r.shape,"float32"));return{x:()=>o}}},{kernelName:"Tan",inputsToSave:["x"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>_n(t,Fr(An(n)))}}},{kernelName:Vt,outputsToSave:[!0],gradFunc:(t,e)=>{const[n]=e;return{x:()=>pn(dr(Zr(1),Fr(n)),t)}}},{kernelName:qt,inputsToSave:["x"],gradFunc:(t,e,n)=>{const[r]=e,{reps:i}=n;return{x:()=>{let e=$n(r);if(1===r.rank)for(let n=0;n{const r=n,{perm:i}=r,a=yr(i);return{x:()=>bi(t,a)}}},{kernelName:Ht,gradFunc:(t,e,n)=>{const r=n,{axis:i}=r;return{value:()=>ci(t,i)}}},{kernelName:Jt,inputsToSave:["segmentIds"],gradFunc:(t,e)=>{const[n]=e;return{x:()=>function(t,e){const n=Ir(e,$n(e)),r=Jn(t,n);let i=Xn(e,Zr(0,"int32"));const a=r.rank-i.rank;for(let t=0;t({x:()=>$n(t)})}];for(const t of Oa)re(t);var Ba=function(t,e){return(Ba=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 $a(t,e){function n(){this.constructor=t}Ba(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Pa,Wa=function(){return(Wa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e?1:0}(t,e)}function us(t){if(null==t)return t;for(var e=[],n=0,r=t;n=0),Xa(r>=n),Array.isArray(t)&&t.length>=n&&t.length<=r&&t.every((function(t){return typeof t===e}))}function ps(t,n){Array.isArray(t)?(e.util.assert(t.length>0,(function(){return n+" is unexpectedly an empty array."})),t.forEach((function(t,e){return ps(t,"element "+(e+1)+" of "+n)}))):e.util.assert(Number.isInteger(t)&&t>0,(function(){return"Expected "+n+" to be a positive integer, but got "+ds(t)+"."}))}function ds(t){return null===t?"null":Array.isArray(t)?"["+t.map((function(t){return ds(t)})).join(",")+"]":"string"==typeof t?'"'+t+'"':""+t}function fs(t){return"relu"===t?"relu":"linear"===t?"linear":"elu"===t?"elu":null}function gs(t,n){return e.tidy((function(){return e.sqrt(e.sum(e.mul(t,t),n,!0))}))}var ms=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.prototype.getConfig=function(){return{}},e}(e.serialization.Serializable),ys=function(t){function n(e){var n=t.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){var r=gs(t,n.axis),i=e.clipByValue(r,0,n.maxValue);return e.mul(t,e.div(i,e.add(ja(),r)))}))},n.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},n.className="MaxNorm",n}(ms);e.serialization.registerClass(ys);var vs=function(t){function n(e){var n=t.call(this)||this;return n.defaultAxis=0,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){return e.div(t,e.add(ja(),gs(t,n.axis)))}))},n.prototype.getConfig=function(){return{axis:this.axis}},n.className="UnitNorm",n}(ms);e.serialization.registerClass(vs);var bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t){return e.relu(t)},n.className="NonNeg",n}(ms);e.serialization.registerClass(bs);var ws=function(t){function n(e){var n=t.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=e.minValue?e.minValue:n.defaultMinValue,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.rate=null!=e.rate?e.rate:n.defaultRate,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return $a(n,t),n.prototype.apply=function(t){var n=this;return e.tidy((function(){var r=gs(t,n.axis),i=e.add(e.mul(n.rate,e.clipByValue(r,n.minValue,n.maxValue)),e.mul(1-n.rate,r));return e.mul(t,e.div(i,e.add(ja(),r)))}))},n.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},n.className="MinMaxNorm",n}(ms);e.serialization.registerClass(ws);var ks={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Ss(t){return is(t)}function xs(t,n){return void 0===n&&(n={}),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"constraint")}function Is(t){return null==t?null:"string"==typeof t?xs({className:t in ks?ks[t]:t,config:{}}):t instanceof ms?t:xs(t)}var Ns={__proto__:null,maxNorm:function(t){return new ys(t)},unitNorm:function(t){return new vs(t)},nonNeg:function(){return new bs},minMaxNorm:function(t){return new ws(t)}},zs=["channelsFirst","channelsLast"],As=["nearest","bilinear"],Cs=["valid","same","causal"],Ds=["max","avg"],Ts=["sum","mul","concat","ave"],Es=new Map;function Fs(t){hs(zs,"DataFormat",t)}function Ls(t){hs(Cs,"PaddingMode",t)}function _s(t){hs(Ds,"PoolMode",t)}var Rs=[];function Ms(t,e){Rs.push(t);try{var n=e();return Rs.pop(),n}catch(t){throw Rs.pop(),t}}function Os(t){if(!Ps(t))throw new Error("Not a valid tensor name: '"+t+"'");return(0===Rs.length?"":Rs.join("/")+"/")+t}function Bs(t){if(!Ps(t))throw new Error("Not a valid tensor name: '"+t+"'");Es.has(t)||Es.set(t,0);var e=Es.get(t);if(Es.set(t,Es.get(t)+1),e>0){var n=t+"_"+e;return Es.set(n,1),n}return t}var $s=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Ps(t){return!!t.match($s)}function Ws(t,e,n){null==e&&(e=0),null==n&&(n=t.length);for(var r=1,i=e;i= 2 but got x shape = "+t.shape+" and y shape = "+n.shape);if(n.rank>=3&&t.shape.slice(-1)[0]!==(c=n.shape.slice(-2)[0]))throw new Ha("If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = "+t.shape+" and y shape = "+n.shape);if(2===t.rank&&2===n.rank){var a=!1,s=!1;return e.fused.matMul({a:t,b:n,transposeA:a,transposeB:s,bias:i?io(t.rank,i,"channelsLast"):null,activation:r})}var o=t.shape.slice(),u=o.pop();t=t.reshape([-1,u]);var l=n.shape.slice(),h=l.pop(),c=l.pop(),p=l.concat([h]),d=Array.from({length:n.rank},(function(t,e){return 0===e?n.rank-2:e<=n.rank-2?e-1:e}));n=n.transpose(d).reshape([c,-1]);var f=o.concat(p);a=!1,s=!1;return e.fused.matMul({a:t,b:n,transposeA:a,transposeB:s,bias:i?io(t.rank,i,"channelsLast"):null,activation:r}).reshape(f)}function no(t,n,r){return e.tidy((function(){return n=Array.isArray(n)?e.tensor1d(n,"int32"):n.toInt(),e.gather(t,n,r)}))}function ro(t){return e.mul(t,t)}function io(t,e,n){var r=e.shape;if(1!==e.rank&&e.rank!==t)throw new Ga("Unexpected bias dimensions: "+e.rank+"; expected it to be 1 or "+t);if(5===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1,1,1]):e.reshape([1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,1,1,r[0]]):e.reshape([1].concat(r))}else if(4===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1,1]):e.reshape([1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,1,r[0]]):e.reshape([1].concat(r))}else if(3===t){if("channelsFirst"===n)return 1===r.length?e.reshape([1,r[0],1]):e.reshape([1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?e.reshape([1,1,r[0]]):e.reshape([1].concat(r))}else if(t<3)return e;throw new Ga("Unsupported input rank by biasAdd: "+e.rank)}function ao(t,n,r){return e.tidy((function(){return null==r&&(r="channelsLast"),Fs(r),t.add(io(t.rank,n,r))}))}function so(t,n,r,i){return e.tidy((function(){return e.dropout(t,n,r,i)}))}function oo(t,e,n){return void 0===n&&(n=!1),n?t():e()}var uo=["fanIn","fanOut","fanAvg"],lo=["normal","uniform","truncatedNormal"];var ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.prototype.fromConfigUsesCustomObjects=function(){return!1},e.prototype.getConfig=function(){return{}},e}(e.serialization.Serializable),co=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t,n){return e.zeros(t,n)},n.className="Zeros",n}(ho);e.serialization.registerClass(co);var po=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.apply=function(t,n){return e.ones(t,n)},n.className="Ones",n}(ho);e.serialization.registerClass(po);var fo=function(t){function n(e){var n=t.call(this)||this;if("object"!=typeof e)throw new Ga("Expected argument of type ConstantConfig but got "+e);if(void 0===e.value)throw new Ga("config must have value set but got "+e);return n.value=e.value,n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){return e.mul(e.scalar(r.value),e.ones(t,n))}))},n.prototype.getConfig=function(){return{value:this.value}},n.className="Constant",n}(ho);e.serialization.registerClass(fo);var go=function(t){function n(e){var n=t.call(this)||this;return n.DEFAULT_MINVAL=-.05,n.DEFAULT_MAXVAL=.05,n.minval=e.minval||n.DEFAULT_MINVAL,n.maxval=e.maxval||n.DEFAULT_MAXVAL,n.seed=e.seed,n}return $a(n,t),n.prototype.apply=function(t,n){return e.randomUniform(t,this.minval,this.maxval,n)},n.prototype.getConfig=function(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}},n.className="RandomUniform",n}(ho);e.serialization.registerClass(go);var mo=function(t){function e(e){var n=t.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=e.mean||n.DEFAULT_MEAN,n.stddev=e.stddev||n.DEFAULT_STDDEV,n.seed=e.seed,n}return $a(e,t),e.prototype.apply=function(t,e){if("float32"!==(e=e||"float32")&&"int32"!==e)throw new Ha("randomNormal does not support dType "+e+".");return to(t,this.mean,this.stddev,e,this.seed)},e.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},e.className="RandomNormal",e}(ho);e.serialization.registerClass(mo);var yo=function(t){function n(e){var n=t.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=e.mean||n.DEFAULT_MEAN,n.stddev=e.stddev||n.DEFAULT_STDDEV,n.seed=e.seed,n}return $a(n,t),n.prototype.apply=function(t,n){if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Ha("truncatedNormal does not support dType "+n+".");return e.truncatedNormal(t,this.mean,this.stddev,n,this.seed)},n.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},n.className="TruncatedNormal",n}(ho);e.serialization.registerClass(yo);var vo=function(t){function n(e){var n=t.call(this)||this;return n.gain=null!=e.gain?e.gain:1,n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){if(2!==t.length||t[0]!==t[1])throw new Ga("Identity matrix initializer can only be used for 2D square matrices.");return e.mul(r.gain,e.eye(t[0]))}))},n.prototype.getConfig=function(){return{gain:this.gain}},n.className="Identity",n}(ho);e.serialization.registerClass(vo);var bo=function(t){function n(e){var n,r=t.call(this)||this;if(e.scale<0)throw new Ga("scale must be a positive float. Got: "+e.scale);return r.scale=null==e.scale?1:e.scale,r.mode=null==e.mode?"fanIn":e.mode,n=r.mode,hs(uo,"FanMode",n),r.distribution=null==e.distribution?"normal":e.distribution,function(t){hs(lo,"Distribution",t)}(r.distribution),r.seed=e.seed,r}return $a(n,t),n.prototype.apply=function(t,n){var r=function(t,e){var n,r;if(void 0===e&&(e="channelsLast"),Fs(e),2===t.length)n=t[0],r=t[1];else if(-1!==[3,4,5].indexOf(t.length))if("channelsFirst"===e){var i=Ws(t,2);n=t[1]*i,r=t[0]*i}else"channelsLast"===e&&(i=Ws(t,0,t.length-2),n=t[t.length-2]*i,r=t[t.length-1]*i);else{var a=Ws(t);n=Math.sqrt(a),r=Math.sqrt(a)}return[n,r]}(t),i=r[0],a=r[1],s=this.scale;if("fanIn"===this.mode?s/=Math.max(1,i):"fanOut"===this.mode?s/=Math.max(1,a):s/=Math.max(1,(i+a)/2),"normal"===this.distribution){var o=Math.sqrt(s);if("float32"!==(n=n||"float32")&&"int32"!==n)throw new Ha(this.getClassName()+" does not support dType "+n+".");return e.truncatedNormal(t,0,o,n,this.seed)}var u=Math.sqrt(3*s);return e.randomUniform(t,-u,u,n)},n.prototype.getConfig=function(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}},n.className="VarianceScaling",n}(ho);e.serialization.registerClass(bo);var wo=function(t){function e(e){return t.call(this,{scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="GlorotUniform",e}(bo);e.serialization.registerClass(wo);var ko=function(t){function e(e){return t.call(this,{scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="GlorotNormal",e}(bo);e.serialization.registerClass(ko);var So=function(t){function e(e){return t.call(this,{scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="HeNormal",e}(bo);e.serialization.registerClass(So);var xo=function(t){function e(e){return t.call(this,{scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="HeUniform",e}(bo);e.serialization.registerClass(xo);var Io=function(t){function e(e){return t.call(this,{scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="LeCunNormal",e}(bo);e.serialization.registerClass(Io);var No=function(t){function e(e){return t.call(this,{scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})||this}return $a(e,t),e.prototype.getClassName=function(){return bo.className},e.className="LeCunNormal",e}(bo);e.serialization.registerClass(No);var zo=function(t){function n(e){var n=t.call(this)||this;if(n.DEFAULT_GAIN=1,n.gain=null==e.gain?n.DEFAULT_GAIN:e.gain,n.seed=e.seed,null!=n.seed)throw new Ha("Random seed is not implemented for Orthogonal Initializer yet.");return n}return $a(n,t),n.prototype.apply=function(t,n){var r=this;return e.tidy((function(){if(t.length<2)throw new Ha("Shape must be at least 2D.");t[0]*t[1]>2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+t[0]*t[1]+") elements: Slowness may result.");var n=to(t[0]>t[1]?[t[1],t[0]]:t,0,1,"float32"),i=e.linalg.gramSchmidt(n);return t[0]>t[1]&&(i=i.transpose()),e.mul(r.gain,i)}))},n.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},n.className="Orthogonal",n}(ho);e.serialization.registerClass(zo);var Ao={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Co(t,n){return void 0===n&&(n={}),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"initializer")}function Do(t){return is(t)}function To(t){if("string"==typeof t){var e=t in Ao?Ao[t]:t;if("GlorotNormal"===e)return new ko;if("GlorotUniform"===e)return new wo;if("HeNormal"===e)return new So;if("HeUniform"===e)return new xo;if("LeCunNormal"===e)return new Io;if("LeCunUniform"===e)return new No;var n={};return n.className=e,n.config={},Co(n)}return t instanceof ho?t:Co(t)}var Eo={__proto__:null,zeros:function(){return new co},ones:function(){return new po},constant:function(t){return new fo(t)},randomUniform:function(t){return new go(t)},randomNormal:function(t){return new mo(t)},truncatedNormal:function(t){return new yo(t)},identity:function(t){return new vo(t)},varianceScaling:function(t){return new bo(t)},glorotUniform:function(t){return new wo(t)},glorotNormal:function(t){return new ko(t)},heNormal:function(t){return new So(t)},heUniform:function(t){return new xo(t)},leCunNormal:function(t){return new Io(t)},leCunUniform:function(t){return new No(t)},orthogonal:function(t){return new zo(t)}},Fo=0;function Lo(){return Fo++}var _o={};function Ro(t){return void 0===t&&(t=""),t in _o||(_o[t]=0),_o[t]+=1,t+_o[t].toString()}function Mo(t){return Array.isArray(t)&&Array.isArray(t[0])}function Oo(t){return 0===t.length?[]:Array.isArray(t[0])?t:[t]}function Bo(t){var e;if(Array.isArray(t)){if(1!==t.length)throw new Ga("Expected Tensor length to be 1; got "+t.length);e=t[0]}else e=t;return e}function $o(t){if(Array.isArray(t)&&Array.isArray(t[0])){if(1===t.length)return(t=t)[0];throw new Ga("Expected exactly 1 Shape; got "+t.length)}return t}function Po(t){for(var e=0,n=0,r=t;n1)throw new Va("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new Va("Layer "+this.name+" is not connected, no input to return.");return Qa(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new Va("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new Va("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return Qa(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),n.prototype.calculateLosses=function(){return this.losses.map((function(t){return t()}))},Object.defineProperty(n.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"built",{get:function(){return this._built},set:function(t){this._built=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trainable",{get:function(){return this.trainable_},set:function(t){this._trainableWeights.forEach((function(e){return e.trainable=t})),this.trainable_=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable_?this._trainableWeights.filter((function(t){return t.trainable})):[]},set:function(t){this._trainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._trainableWeights.filter((function(t){return!t.trainable})).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)},set:function(t){this._nonTrainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),n.prototype.resetStates=function(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")},n.prototype.assertInputCompatibility=function(t){if(t=ts(t),null!=this.inputSpec&&0!==this.inputSpec.length){var e=ts(this.inputSpec);if(t.length!==e.length)throw new Ga("Layer "+this.name+" expects "+e.length+" inputs, but it received "+t.length+" input tensors. Input received: "+t);for(var n=0;n=0?s[u]:s[s.length+u];if(null!=l&&-1===[l,null].indexOf(h))throw new Ga("Input "+n+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+l+" but got shape "+s+".")}}if(null!=i.shape)for(var c=0;c0&&Array.isArray(f[0])?f.map((function(r,i){return new qo(m,r,n,ts(t),e,n.name,i)})):new qo(m,f,n,ts(t),e,n.name),n.addInboundNode(t,g,null,null,d,f,e),n._refCount++,null!=n.activityRegularizer)throw new Ha("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return g}))},n.prototype.warnOnIncompatibleInputShape=function(t){if(null!=this.batchInputShape)if(t.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(t)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var e=!1;this.batchInputShape.forEach((function(n,r){null!=n&&null!=t[r]&&t[r]!==n&&(e=!0)})),e&&console.warn("The shape of the input tensor ("+JSON.stringify(t)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(n.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Va("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var t=[],e=0,n=this.inboundNodes;e0)&&(e=t.sourceLayer,n=t.nodeIndex),0===e.inboundNodes.length)return[t];var r=e.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var i=[],a=0;a0?[4,Promise.all(n)]:[3,2];case 1:for(u=h.sent(),l=0;l=0&&Number.isInteger(n),(function(){return"Verbosity level is expected to be an integer >= 0, but got "+n})),t.checkForDuplicate(r),null==t.constructors[n]&&(t.constructors[n]=[]),t.constructors[n].push(r)},t.checkForDuplicate=function(e){for(var n in t.constructors){t.constructors[+n].forEach((function(t){if(t===e)throw new Ga("Duplicate callback constructor.")}))}},t.clear=function(){t.constructors={}},t.createCallbacks=function(e){var n=[];for(var r in t.constructors){var i=+r;e>=i&&n.push.apply(n,t.constructors[i])}return n.map((function(t){return new t}))},t.constructors={},t}();function hu(t,e,n,r,i,a,s,o,u){var l=new su,h=[new au].concat(lu.createCallbacks(e));null!=t&&h.push.apply(h,t),h.push(l);var c=new iu(h);return c.setParams({epochs:n,initialEpoch:r,samples:i,steps:a,batchSize:s,verbose:e,doValidation:o,metrics:u}),{callbackList:c,history:l}}function cu(t,n,r){return void 0===n&&(n={}),void 0===r&&(r=!1),ss(t,e.serialization.SerializationMap.getMap().classNameMap,n,"layer",r)}function pu(t,n){return e.tidy((function(){"float32"!==t.dtype&&(t=t.asType("float32"));var r=e.sum(ro(t),n,!0),i=e.fill(r.shape,ja()),a=e.sqrt(e.maximum(r,i));return e.div(t,a)}))}function du(t,n){return e.tidy((function(){return e.mean(ro(e.sub(n,t)),-1)}))}function fu(t,n){return e.tidy((function(){return e.mean(e.abs(e.sub(n,t)),-1)}))}function gu(t,n){return e.tidy((function(){var r=e.sub(t,n),i=e.clipByValue(e.abs(t),ja(),Number.MAX_VALUE),a=e.abs(e.div(r,i));return e.mul(100,e.mean(a,-1))}))}function mu(t,n,r){return void 0===r&&(r=!1),e.tidy((function(){if(r)n=e.softmax(n);else{var i=e.sum(n,n.shape.length-1,!0);n=e.div(n,i)}return n=e.clipByValue(n,ja(),1-ja()),e.neg(e.sum(e.mul(t.toFloat(),e.log(n)),n.shape.length-1))}))}function yu(t,n,r){return void 0===r&&(r=!1),e.tidy((function(){var i,a,s=e.floor((i=t,a=[Ws(i.shape)],i.reshape(a))).toInt(),o=(n=e.clipByValue(n,ja(),1-ja())).shape;return mu(e.oneHot(s,o[o.length-1]).reshape(o),n,r)}))}function vu(t,n){return e.tidy((function(){var r;return r=e.clipByValue(n,ja(),1-ja()),r=e.log(e.div(r,e.sub(1,r))),e.mean(function(t,n){if(!e.util.arraysEqual(t.shape,n.shape))throw new Ga("logits and labels must have the same shape, but got shapes "+JSON.stringify(t.shape)+" and "+JSON.stringify(n.shape));return e.tidy((function(){var e=n.relu(),r=n.abs().neg();return e.sub(n.mul(t)).add(r.exp().log1p())}))}(t,r),-1)}))}function bu(t,n){return e.tidy((function(){var r=pu(t,-1),i=pu(n,-1),a=e.mul(r,i);return e.neg(e.sum(a,-1))}))}var wu={meanSquaredError:du,meanAbsoluteError:fu,meanAbsolutePercentageError:gu,meanSquaredLogarithmicError:function(t,n){return e.tidy((function(){var r=e.clipByValue(n,ja(),Number.MAX_VALUE),i=e.log(e.add(1,r)),a=e.clipByValue(t,ja(),Number.MAX_VALUE),s=e.log(e.add(1,a));return e.mean(ro(e.sub(i,s)),-1)}))},squaredHinge:function(t,n){return e.tidy((function(){var r=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(ro(r),-1)}))},hinge:function(t,n){return e.tidy((function(){var r=e.maximum(0,e.sub(1,e.mul(t,n)));return e.mean(r,-1)}))},categoricalHinge:function(t,n){return e.tidy((function(){var r=e.sum(e.mul(t,n),-1),i=e.max(e.mul(e.sub(1,t),n),-1);return e.maximum(0,e.add(1,e.sub(i,r)))}))},logcosh:function(t,n){return e.tidy((function(){var r=Math.log(2),i=e.sub(n,t),a=e.sub(e.add(i,e.softplus(e.mul(-2,i))),r);return e.mean(a,-1)}))},categoricalCrossentropy:mu,sparseCategoricalCrossentropy:yu,binaryCrossentropy:vu,kullbackLeiblerDivergence:function(t,n){return e.tidy((function(){var r=e.clipByValue(t,ja(),1),i=e.clipByValue(n,ja(),1);return e.sum(e.mul(t,e.log(e.div(r,i))),-1)}))},poisson:function(t,n){return e.tidy((function(){var r=e.log(e.add(ja(),n));return e.mean(e.sub(n,e.mul(t,r)),-1)}))},cosineProximity:bu};function ku(t){if("string"==typeof t){if(t in wu)return wu[t];var e="Unknown loss "+t;throw t.toLowerCase().includes("softmaxcrossentropy")&&(e="Unknown loss "+t+'. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy'),new Ga(e)}return t}function Su(t,n){return e.tidy((function(){var r=e.mul(.5,e.onesLike(n)),i=qs(e.greater(n,r),t.dtype);return e.mean(e.equal(t,i),-1)}))}function xu(t,n){return e.tidy((function(){return qs(e.equal(e.argMax(t,-1),e.argMax(n,-1)),"float32")}))}function Iu(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(1),n.equal(1)).sum().cast("float32")}))}function Nu(t,n){return e.tidy((function(){var r=Iu(t,n),i=function(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(0),n.equal(1)).sum().cast("float32")}))}(t,n),a=r.add(i);return e.where(e.greater(a,0),r.div(a),0).cast("float32")}))}function zu(t,n){return e.tidy((function(){var r=Iu(t,n),i=function(t,n){return e.tidy((function(){return e.logicalAnd(t.equal(1),n.equal(0)).sum().cast("float32")}))}(t,n),a=r.add(i);return e.where(e.greater(a,0),r.div(a),0).cast("float32")}))}function Au(t,e){return vu(t,e)}function Cu(t,n){return t.rank===n.rank&&(t=t.squeeze([t.rank-1])),(n=n.argMax(-1)).dtype!==t.dtype&&(n=n.asType(t.dtype)),e.equal(t,n).asType("float32")}var Du=mu,Tu=yu,Eu={binaryAccuracy:Su,categoricalAccuracy:xu,precision:Nu,categoricalCrossentropy:Du,sparseCategoricalCrossentropy:Tu,mse:du,MSE:du,mae:fu,MAE:fu,mape:gu,MAPE:gu,cosine:bu};function Fu(t){if(Xa(null!==t,"Unknown LossOrMetricFn "+t),"string"==typeof t)return t;for(var e=void 0,n=0,r=Object.keys(wu);nLu&&console.warn('User-defined metadata of model "'+e+'" is too large in size (length='+r.length+" when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.")}}function Ru(t){if(null===t)return!0;if("object"==typeof t){if(Object.getPrototypeOf(t)===Object.prototype){for(var e=0,n=Object.keys(t);e1||1===o.length&&o[0].inboundLayers.length>1){e=!1;break}r.push.apply(r,o)}if(e)for(var u=0,l=t.layers;u0&&(r=r.slice(0,r.length-1)+" "),r=(r+=t[i]).slice(0,e[i]),r+=" ".repeat(e[i]-r.length);n(r)}function Bu(t,e,n){var r;try{r=JSON.stringify(t.outputShape)}catch(t){r="multiple"}Ou([t.name+" ("+t.getClassName()+")",r,t.countParams().toString()],e,n)}function $u(t,e,n,r){var i;try{i=JSON.stringify(t.outputShape)}catch(t){i="multiple"}for(var a=[],s=0,o=t.inboundNodes;s0&&-1===n.indexOf(u)))for(var l=0;l0,(function(){return"Expected at least one fetch, got none"}));var r=[],i={};if(1===t.length){var a=Ju(t[0],n);r=a.sorted,i=a.recipientMap}else for(var s=new Set,o=0,u=t;oi.maxNumTensors&&(i.maxNumTensors=w),w0;){var h=u[u.length-1];if(n.has(h.name))u.pop();else{var c=l[l.length-1]===u.length-1;if(0===h.inputs.length||c)u.pop(),r.push(h),n.add(h.name),c&&l.pop();else{l.push(u.length-1);for(var p=0,d=h.inputs;p1 nodes"),Xa(0===l,"input layer has >1 tensors"),r.inputLayers.push(o),r.inputLayersNodeIndices.push(u),r.inputLayersTensorIndices.push(l)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var p=0;p=0;)i.splice(i.indexOf(u),1);w.push(u)}},S=[],x=[],I=0,N=r.outputs;Ir?1:0}));for(var U=0,K=W;U0)throw new Ga("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var t=[],e=0,n=this.layers;e0)throw new Ga(d.length+" of "+r+" weights are not set: "+d)}jo(l)},n.prototype.updatedConfig=function(){var t=this.getConfig(),e={};return e.className=this.getClassName(),e.config=t,e.kerasVersion="tfjs-layers 3.6.0",e.backend="TensorFlow.js",e},n.prototype.toJSON=function(t,e){void 0===e&&(e=!0);var n=Uu(this.updatedConfig());return e?JSON.stringify(n):n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){t=ts(t);for(var e=new ju,i=0;i1)for(var o=0,u=s;o0){for(var d=[],f=0;f0&&t.apply(Qa(r),n)}function u(t){var n=t.name,a=cu(t,null!=e.customObjects?e.customObjects:{});a.setFastWeightInitDuringBuild(r),i[n]=a,t.inboundNodes.forEach((function(t){if(!(t instanceof Array))throw new Ga("Corrupted configuration, expected array for nodeData: "+t);s(a,t)}))}for(var l=e.name,h=e.layers,c=0,p=h;c0&&"object"==typeof t[Object.keys(t)[0]]){var i=[];return e.forEach((function(e){e in t?i.push(t[e]):i.push(null)})),i}throw new Error("The model has multiple ("+r+") outputs, so "+n+" must be either an array with "+r+" elements or an object with "+e+" keys. Provided "+n+" not understood: "+JSON.stringify(t))}(t,e,"classWeight")}function Qu(t,n,r,i){return Ua(this,void 0,void 0,(function(){var a,s,o,u,l;return Ka(this,(function(h){switch(h.label){case 0:if(null!=n||null!=i)throw new Error("Support sampleWeight is not implemented yet");return null==r?[3,2]:(a=e.tidy((function(){if(1===t.shape.length)return t.clone();if(2===t.shape.length){if(t.shape[1]>1){return t.argMax(1)}if(1===t.shape[1])return t.reshape([t.shape[0]]);throw new Error("Encountered unexpected last-dimension size ("+t.shape[1]+") during handling of class weights. The size is expected to be >= 1.")}throw new Error("Unexpected rank of target (y) tensor ("+t.rank+") during handling of class weights. The rank is expected to be 1 or 2.")})),u=(o=Array).from,[4,a.data()]);case 1:return s=u.apply(o,[h.sent()]),e.dispose(a),l=[],s.forEach((function(t){if(null==r[t])throw new Error("classWeight must contain all classes in the training data. The class "+t+" exists in the data but not in classWeight");l.push(r[t])})),[2,e.tensor1d(l,"float32")];case 2:return[2,null]}}))}))}function tl(t,n){return e.mul(t,n)}function el(t,n){var r,i,a=n;r=a.xs,i=a.ys,e.util.assert(null!=r&&null!=i,(function(){return"A Dataset iterator for fitDataset() is expected to generate objects of the form `{xs: xVal, ys: yVal}`, where the two values may be `tf.Tensor`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates "+n}));var s=nl("input",t.inputNames,r),o=nl("output",t.outputNames,i),u=s[0].shape[0];e.util.assert(s.length===t.inputs.length,(function(){return"LayersModel has "+t.inputs.length+" inputs, but the dataset provides "+s.length+" inputs. (Expected input keys: "+JSON.stringify(t.inputNames)+")"})),e.util.assert(o.length===t.outputs.length,(function(){return"LayersModel has "+t.outputs.length+" outputs, but the dataset provides "+o.length+" outputs. (Expected output keys: "+JSON.stringify(t.outputNames)+")"}));for(var l=function(n){e.util.assert(s[n].shape[0]===u,(function(){return"Batch size mismatch: input "+t.inputNames[n]+" has "+s[n].shape[0]+"; expected "+u+" based on input "+t.inputNames[0]+"."}))},h=0;h0&&Number.isInteger(r.epochs),(function(){return"For fitDataset(), config.epochs is expected to be a positive integer, but got "+r.epochs})),e.util.assert(!i||r.batchesPerEpoch>0&&Number.isInteger(r.batchesPerEpoch),(function(){return"For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got "+r.batchesPerEpoch})),e.util.assert(null==r.validationSplit,(function(){return"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."})),t.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");t.isTraining=!0,B.label=1;case 1:return B.trys.push([1,,26,27]),a=null!=r.validationData,s=void 0,o=void 0,a&&(il(r.validationData)?e.util.assert(null==r.validationBatches||r.validationBatches>0&&Number.isInteger(r.validationBatches),(function(){return"For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got "+r.validationBatches})):(u=function(t){if(3===t.length)throw new Ha("Validation with sample weights is not implemented yet.");return{xs:t[0],ys:t[1]}}(r.validationData),s=u.xs,o=u.ys)),l=t.makeTrainFunction(),h=t.getDedupedMetricsNames(),c=void 0,c=a?h.slice().concat(h.map((function(t){return"val_"+t}))):h.slice(),p=uu(r.callbacks,r.yieldEvery),d=null==r.verbose?1:r.verbose,f=hu(p,d,r.epochs,null,null,function(t,e){var n=null;null!=e.batchesPerEpoch?n=e.batchesPerEpoch:Number.isFinite(t.size)&&(n=t.size);return n}(n,r),null,a,c),g=f.callbackList,m=f.history,g.setModel(t),t.history=m,[4,g.onTrainBegin()];case 2:return B.sent(),t.stopTraining_=!1,y=null==r.initialEpoch?0:r.initialEpoch,[4,n.iterator()];case 3:v=B.sent(),B.label=4;case 4:return y=r.batchesPerEpoch:S.done)?a?(R=void 0,il(r.validationData)?(M=ts,[4,t.evaluateDataset(r.validationData,{batches:r.validationBatches})]):[3,17]):[3,19]:[3,20];case 16:return R=M.apply(void 0,[B.sent()]),[3,18];case 17:R=ts(t.evaluate(s,o,{batchSize:null==r.validationBatchSize?32:r.validationBatchSize,verbose:0})),B.label=18;case 18:for(O=0;O0)throw new Ha("Verbose mode is not implemented yet.");return e.util.assert(!i||r.batches>0&&Number.isInteger(r.batches),(function(){return"Test loop expects `batches` to be a positive integer, but received "+JSON.stringify(r.batches)})),"function"!=typeof n.next?[3,1]:(u=n,[3,3]);case 1:return[4,n.iterator()];case 2:u=f.sent(),f.label=3;case 3:o=u,l=0,h=0,c=function(){var n;return Ka(this,(function(u){switch(u.label){case 0:return[4,o.next()];case 1:return n=u.sent(),s=e.tidy((function(){if(n.value){var r=el(t,n.value),i=r.xs,o=r.ys,u=i.concat(o),c=e.tidy((function(){return a(u)}));if(e.dispose(u),0===h)for(var p=0;p0&&e.dispose(r)};for(p=0;p0&&Number.isInteger(t),(function(){return"batchSize is required to be a positive integer, but got "+t}))}function ol(t,e,n){return null==t?[null]:Array.isArray(t)?t.map((function(t){return Hs(t,e,n-e)})):Hs(t,e,n-e)}function ul(t,n){return e.tidy((function(){return null==t?null:Array.isArray(t)?t.map((function(t){return ul(t,n)})):no(t,"int32"===n.dtype?n:n.toInt())}))}function ll(t,e){for(var n=[],r=0,i=null;r=t&&(i=t),n.push([r,i]),r=i;return n}function hl(t,n,r,i,a,s,o,u,l,h,c,p,d,f,g){return Ua(this,void 0,void 0,(function(){var m,y,v,b,w,k,S,x;return Ka(this,(function(I){switch(I.label){case 0:if(null==a&&(a=32),null==s&&(s=1),null==c&&(c=!0),null==d&&(d=0),m=!1,null!=l&&null!=h&&(m=!0),null!=g&&(m=!0,null==f))throw new Ga("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");return null!=(y=t.checkNumSamples(r,a,f,"steps_per_epoch"))&&(v=Vs(0,y)),null==o&&(o=1),b=hu(u,o,s,d,y,f,a,m,p),w=b.callbackList,k=b.history,w.setModel(t),t.history=k,[4,w.onTrainBegin()];case 1:I.sent(),t.stopTraining_=!1,S=function(s){var o,u,p,d,g;return Ka(this,(function(b){switch(b.label){case 0:return[4,w.onEpochBegin(s)];case 1:if(b.sent(),o={},null==f)return[3,2];throw new Ha("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===c)throw new Ha("batch shuffling is not implemneted yet");c&&e.util.shuffle(v),u=e.tensor1d(v),p=ll(y,a),d=function(s){var c;return Ka(this,(function(d){switch(d.label){case 0:return c={},[4,w.onBatchBegin(s,c)];case 1:return d.sent(),e.tidy((function(){var d=p[s][0],f=p[s][1],g=Hs(u,d,f-d);c.batch=s,c.size=f-d;for(var y=ul(r,g),v=n(y),b=0;b0))return[3,4];if(f=!0,2!==i.validationData.length)throw 3===i.validationData.length?new Ha("validationData including sample weights is not supported yet."):new Ga("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+i.validationData+" is invalid.");return o=i.validationData[0],u=i.validationData[1],!0,[4,t.standardizeUserData(o,u,null,null,true,p)];case 3:return m=N.sent(),l=m[0],h=m[1],g=l.concat(h),[3,5];case 4:null!=i.validationSplit&&i.validationSplit>0&&i.validationSplit<1?(f=!0,y=Math.floor(a[0].shape[0]*(1-i.validationSplit)),v=a[0].shape[0],l=ol(a,y,v),a=ol(a,0,y),h=ol(s,y,v),s=ol(s,0,y),g=l.concat(h)):null!=i.validationSteps&&(f=!0),N.label=5;case 5:return b=a.concat(s).concat(c),t.checkTrainableWeightsConsistency(),w=t.makeTrainFunction(),k=t.getDedupedMetricsNames(),S=void 0,x=void 0,f?(t.makeTestFunction(),S=t.testFunction,x=k.slice().concat(k.map((function(t){return"val_"+t})))):(S=null,g=[],x=k.slice()),I=uu(i.callbacks,i.yieldEvery),[4,hl(t,w,b,k,p,i.epochs,i.verbose,I,S,g,i.shuffle,x,i.initialEpoch,null,null)];case 6:return[2,N.sent()];case 7:return t.isTraining=!1,dl(a,n),dl(s,r),dl(l,o),dl(h,u),null!=c&&e.dispose(c),[7];case 8:return[2]}}))}))}function pl(t){var n=[];t instanceof e.Tensor&&(t=[t]);for(var r=0;r0)a=!0;else if(gl(t)){for(var s in t)if(t.hasOwnProperty(s)){a=!0;break}}else a=!0;if(a)throw new Ga("Error when checking model "+i+" expected no data, but got "+t)}return[]}if(null==t)return e.map((function(t){return null}));var o;if(gl(t)){t=t,o=[];for(var u=0,l=e;u1)throw new Ga("The model "+i+" expects "+e.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+t.shape);o=[t]}if(o=pl(o),null!=n)for(var c=0;c=0&&f!==g)throw new Ga("Error when checking "+i+": expected "+e[c]+" to have shape ["+n[c]+"], but got array with shape ["+p.shape+"].")}}return o}function yl(t,e,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(t)){if(t.length!==e.length)throw new Ga("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+e.length+" Tensor(s), but instead got "+t.length+" Tensors(s).");a=t}else{if(e.length>1)throw new Ga("The model expects "+e.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(t.shape)+".");a=[t]}if(null!=n)for(var s=0;s1&&(n.metricsTensors.push([e,t]),n.metricsNames.push(n.outputNames[t]+"_loss"))}}));var f=function(t,e){if(null==t||Array.isArray(t)&&0===t.length)return e.map((function(t){return[]}));var n;if("string"==typeof t||"function"==typeof t)n=[t];else{if(!Array.isArray(t)&&"object"!=typeof t)throw new TypeError("Type of metrics argument not understood. Expected an string,function, Array, or Object, found: "+t);n=t}if(Array.isArray(n))return e.map((function(t){return n}));for(var r=[],i=0,a=e;i1&&(e=n.outputNames[t]+"_"+e),n.metricsNames.push(e),n.metricsTensors.push([r,t])}(t,r,l)},o=0,u=e;o0){var h=[];throw e.forEach((function(e,n){null==e&&h.push(t[n])})),new Ga("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(h))}return e},n.prototype.predictLoop=function(t,n,r){var i=this;return void 0===n&&(n=32),void 0===r&&(r=!1),e.tidy((function(){var a=i.checkNumSamples(t);if(r)throw new Ha("Verbose predictLoop() is not implemented yet.");for(var s=ll(a,n),o=i.outputs.map((function(t){return[]})),u=function(n){e.tidy((function(){var e=s[n][0],r=s[n][1],a=ol(t,e,r),o=[];if(Array.isArray(a))for(var u=0;u1)throw new Ga("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map((function(t){return t.shape}))));if(a.length>1)throw new Ga("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(n.map((function(t){return t.shape}))));if(i.length>0&&a.length>0&&!e.util.arraysEqual(i,a))throw new Ga("Input Tensors should have the same number of samples as target Tensors. Found "+i[0]+" input sample(s) and "+a[0]+" target sample(s).")}(t=ml(t,this.feedInputNames,this.feedInputShapes,!1,"input"),n=ml(n,this.feedOutputNames,a,!1,"target")),function(t,e,n){for(var r=[du,vu,mu],i=0;i0&&t[0].shape[0]%i!=0)throw new Ga("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+i+". Found: "+t[0].shape[0]+" sample(s).");return[t,n]},n.prototype.standardizeUserData=function(t,e,n,r,i,a){return void 0===i&&(i=!0),Ua(this,void 0,void 0,(function(){var s,o,u,l,h,c,p,d;return Ka(this,(function(f){switch(f.label){case 0:if(s=this.standardizeUserDataXY(t,e,i,a),o=s[0],u=s[1],null!=n)throw new Error("sample weight is not supported yet.");if(l=null,null==r)return[3,4];h=Yu(r,this.outputNames),l=[],c=0,f.label=1;case 1:return c0)throw new Ha("Verbose mode is not implemented yet.");if(null!=a)throw new Ha("steps mode in testLoop() is not implemented yet");for(var l=ll(o,r),h=e.tensor1d(Vs(0,o)),c=0;c1)i+="_"+Ya(t.slice(0,n),r);e.push(i)}return e},n.prototype.makeTrainFunction=function(){var t=this;return function(n){var r=[],i=n.slice(0,t.inputs.length),a=n.slice(t.inputs.length,t.inputs.length+t.outputs.length),s=n.slice(t.inputs.length+t.outputs.length,t.inputs.length+2*t.outputs.length),o=[],u=t.collectedTrainableWeights.map((function(t){return t.read()}));return[t.optimizer_.minimize((function(){for(var n=[],u=0;u1&&u1)throw new Ga("Found more than one ("+r.length+") save handlers for URL '"+t+"'");t=r[0]}if(null==t.save)throw new Ga("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,e.io.encodeWeights(this.getNamedWeights(n))];case 1:return i=f.sent(),!1,null,a=this.toJSON(null,false),s={modelTopology:a,format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v3.6.0",convertedBy:null},null!=n&&n.includeOptimizer&&null!=this.optimizer?(s.trainingConfig=this.getTrainingConfig(),o="optimizer",p=(c=e.io).encodeWeights,[4,this.optimizer.getWeights()]):[3,4];case 2:return[4,p.apply(c,[f.sent(),o])];case 3:u=f.sent(),l=u.data,h=u.specs,(d=i.specs).push.apply(d,h),i.data=e.io.concatenateArrayBuffers([i.data,l]),f.label=4;case 4:return null!=this.userDefinedMetadata&&(!0,_u(this.userDefinedMetadata,this.name,true),s.userDefinedMetadata=this.userDefinedMetadata),s.weightData=i.data,s.weightSpecs=i.specs,[2,t.save(s)]}}))}))},n.prototype.setUserDefinedMetadata=function(t){_u(t,this.name),this.userDefinedMetadata=t},n.prototype.getUserDefinedMetadata=function(){return this.userDefinedMetadata},n.className="Model",n}(Xu);e.serialization.registerClass(vl);var bl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e.className="Functional",e}(vl);function wl(t,n,r){return Ua(this,void 0,void 0,(function(){var i,a,s,o,u,l,h,c,p;return Ka(this,(function(d){switch(d.label){case 0:if(null==r&&(r={}),null==t.load)throw new Ga("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,t.load()];case 1:if(i=d.sent(),null!=(a=i.modelTopology).model_config&&(a=a.model_config),s=null==r.strict||r.strict,o=null!=i.weightData&&null!=i.weightSpecs&&s,u=cu(Wu(a),n,o),null!=(l=i.trainingConfig)&&u.loadTrainingConfig(l),null!=i.userDefinedMetadata&&u.setUserDefinedMetadata(i.userDefinedMetadata),null==i.weightData)return[3,4];if(null==i.weightSpecs)throw new Ga("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");return h=function(t,n){var r=e.io.decodeWeights(t,n),i={},a=[];return n.forEach((function(t){"optimizer"===t.group?a.push({name:t.name,tensor:r[t.name]}):i[t.name]=r[t.name]})),{modelWeights:i,optimizerWeights:a}}(i.weightData,i.weightSpecs),c=h.modelWeights,p=h.optimizerWeights,u.loadWeights(c,s),null!=u.optimizer&&p.length>0?[4,u.optimizer.setWeights(p)]:[3,3];case 2:d.sent(),d.label=3;case 3:e.dispose(c),e.dispose(p.map((function(t){return t.tensor}))),d.label=4;case 4:return[2,u]}}))}))}e.serialization.registerClass(bl);var kl=function(t){function n(e){var n=t.call(this,{inputs:[],outputs:[]})||this;if(e=e||{},n.trainable=!0,n.built=!1,n.name=null!=e.name?e.name:Ro("sequential_"),null!=e.layers)for(var r=0,i=e.layers;r 0 but got "+JSON.stringify(t.filters))},n}(sh),uh=function(t){function e(n){var r=t.call(this,2,n)||this;return e.verifyArgs(n),r}return $a(e,t),e.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.rank,e},e.verifyArgs=function(t){if("number"!=typeof t.kernelSize&&!cs(t.kernelSize,"number",1,2))throw new Ga("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(t.kernelSize)+".")},e.className="Conv2D",e}(oh);e.serialization.registerClass(uh);var lh=function(t){function e(n){var r=t.call(this,3,n)||this;return e.verifyArgs(n),r}return $a(e,t),e.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.rank,e},e.verifyArgs=function(t){if("number"!=typeof t.kernelSize&&(!Array.isArray(t.kernelSize)||1!==t.kernelSize.length&&3!==t.kernelSize.length))throw new Ga("Conv3D expects config.kernelSize to be number or [number, number, number], but received "+JSON.stringify(t.kernelSize)+".")},e.className="Conv3D",e}(oh);e.serialization.registerClass(lh);var hh=function(t){function n(e){var n=t.call(this,e)||this;if(n.inputSpec=[new Vo({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new Ga("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return $a(n,t),n.prototype.build=function(t){var e;if(4!==(t=$o(t)).length)throw new Ga("Input should have rank 4; Received input shape: "+JSON.stringify(t));var n="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[n])throw new Ga("The channel dimension of the inputs should be defined. Found `None`.");var r=t[n],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vo({ndim:4,axes:(e={},e[n]=r,e)})],this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);if(4!==n.shape.length)throw new Ga("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+n.shape.length);var i,a,s=n.shape,o=s[0];"channelsFirst"===r.dataFormat?(i=2,a=3):(i=1,a=2);var u=s[i],l=s[a],h=r.kernelSize[0],c=r.kernelSize[1],p=r.strides[0],d=r.strides[1],f=[o,nh(u,p,h,r.padding),nh(l,d,c,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(n=e.transpose(n,[0,2,3,1]));var g=e.conv2dTranspose(n,r.kernel.read(),f,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(g=e.transpose(g,[0,3,1,2])),null!=r.bias&&(g=ao(g,r.bias.read(),r.dataFormat)),null!=r.activation&&(g=r.activation.apply(g)),g}))},n.prototype.computeOutputShape=function(t){var e,n,r,i=(t=$o(t)).slice();"channelsFirst"===this.dataFormat?(e=1,n=2,r=3):(e=3,n=1,r=2);var a=this.kernelSize[0],s=this.kernelSize[1],o=this.strides[0],u=this.strides[1];return i[e]=this.filters,i[n]=nh(i[n],o,a,this.padding),i[r]=nh(i[r],u,s,this.padding),i},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.dilationRate,e},n.className="Conv2DTranspose",n}(uh);e.serialization.registerClass(hh);var ch=function(t){function n(e){var n=t.call(this,e)||this;if(n.inputSpec=[new Vo({ndim:5})],"same"!==n.padding&&"valid"!==n.padding)throw new Ga("Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return $a(n,t),n.prototype.build=function(t){var e;if(5!==(t=$o(t)).length)throw new Ga("Input should have rank 5; Received input shape: "+JSON.stringify(t));var n="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[n])throw new Ga("The channel dimension of the inputs should be defined. Found `None`.");var r=t[n],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vo({ndim:5,axes:(e={},e[n]=r,e)})],this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);if(5!==n.shape.length)throw new Ga("Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+n.shape.length);var i,a,s,o=n.shape,u=o[0];"channelsFirst"===r.dataFormat?(s=2,i=3,a=4):(s=1,i=2,a=3);var l=o[s],h=o[i],c=o[a],p=r.kernelSize[0],d=r.kernelSize[1],f=r.kernelSize[2],g=r.strides[0],m=r.strides[1],y=r.strides[2],v=[u,nh(l,g,p,r.padding),nh(h,m,d,r.padding),nh(c,y,f,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(n=e.transpose(n,[0,2,3,4,1]));var b=e.conv3dTranspose(n,r.kernel.read(),v,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(b=e.transpose(b,[0,4,1,2,3])),null!==r.bias&&(b=ao(b,r.bias.read(),r.dataFormat)),null!==r.activation&&(b=r.activation.apply(b)),b}))},n.prototype.computeOutputShape=function(t){var e,n,r,i,a=(t=$o(t)).slice();"channelsFirst"===this.dataFormat?(e=1,n=2,r=3,i=4):(e=4,n=1,r=2,i=3);var s=this.kernelSize[0],o=this.kernelSize[1],u=this.kernelSize[2],l=this.strides[0],h=this.strides[1],c=this.strides[2];return a[e]=this.filters,a[n]=nh(a[n],l,s,this.padding),a[r]=nh(a[r],h,o,this.padding),a[i]=nh(a[i],c,u,this.padding),a},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.dilationRate,e},n.className="Conv3DTranspose",n}(lh);e.serialization.registerClass(ch);var ph=function(t){function e(e){return t.call(this,2,e)||this}return $a(e,t),e.className="SeparableConv2D",e}(function(t){function n(e,n){var r=t.call(this,e,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new Ga("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new Ga("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new Ga("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=To(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=Gl(n.depthwiseRegularizer),r.depthwiseConstraint=Is(n.depthwiseConstraint),r.pointwiseInitializer=To(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=Gl(n.pointwiseRegularizer),r.pointwiseConstraint=Is(n.pointwiseConstraint),r}return $a(n,t),n.prototype.build=function(t){var e;if((t=$o(t)).length1&&(e=t.slice(1,t.length)),t=t[0]}function i(t){return null==t||Array.isArray(t)?t:[t]}return{inputs:t,initialState:e=i(e),constants:n=i(n)}}function vh(t,n,r,i,a,s,o,u){return void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===u&&(u=!1),e.tidy((function(){var l=n.shape.length;if(l<3)throw new Ga("Input should be at least 3D, but is "+l+"D.");var h=[1,0].concat(Vs(2,l));if(n=e.transpose(n,h),null!=s)throw new Ha("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=a&&((a=a.asType("bool").asType("float32")).rank===l-1&&(a=e.expandDims(a,-1)),a=e.transpose(a,h)),i&&(n=e.reverse(n,0),null!=a&&(a=e.reverse(a,0)));var c,p,d=[],f=r,g=n.shape[0],m=e.unstack(n);null!=a&&(p=e.unstack(a));for(var y,v=function(n){var r=m[n],i=e.tidy((function(){return t(r,f)}));if(null==a)c=i[0],f=i[1];else{var s=e.tidy((function(){var t=p[n],r=e.onesLike(t).sub(t);return{output:i[0].mul(t).add(f[0].mul(r)),newStates:f.map((function(e,n){return i[1][n].mul(t).add(e.mul(r))}))}}));c=s.output,f=s.newStates}u&&d.push(c)},b=0;b1?Qs(r,[1,t]):r})):n.cell.stateSize>1?[Qs(r,[1,n.cell.stateSize])]:[r]}))},Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),n.prototype.setFastWeightInitDuringBuild=function(e){t.prototype.setFastWeightInitDuringBuild.call(this,e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),r={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(r.numConstants=this.numConstants);var i=this.cell.getConfig();return this.getClassName()===n.className&&(r.cell={className:this.cell.getClassName(),config:i}),Wa({},i,e,r)},n.fromConfig=function(t,e,n){void 0===n&&(n={});var r=cu(e.cell,n);return new t(Object.assign(e,{cell:r}))},n.className="RNN",n}(Zo);e.serialization.registerClass(bh);var wh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $a(e,t),e}(Zo),kh=function(t){function n(e){var n=t.call(this,e)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=e.units,ps(n.units,"units"),n.activation=Pl(null==e.activation?n.DEFAULT_ACTIVATION:e.activation),n.useBias=null==e.useBias||e.useBias,n.kernelInitializer=To(e.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=To(e.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=To(e.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=Gl(e.kernelRegularizer),n.recurrentRegularizer=Gl(e.recurrentRegularizer),n.biasRegularizer=Gl(e.biasRegularizer),n.kernelConstraint=Is(e.kernelConstraint),n.recurrentConstraint=Is(e.recurrentConstraint),n.biasConstraint=Is(e.biasConstraint),n.dropout=Ks([1,js([0,null==e.dropout?0:e.dropout])]),n.recurrentDropout=Ks([1,js([0,null==e.recurrentDropout?0:e.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return $a(n,t),n.prototype.build=function(t){t=$o(t),this.kernel=this.addWeight("kernel",[t[t.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){if(2!==(t=t).length)throw new Ga("SimpleRNNCell expects 2 input Tensors, got "+t.length+".");var i=t[1];t=t[0];var a,s=null!=n.training&&n.training;01){for(var i=[0],a=2;a1)throw new Ga("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(t)+".");for(var i=null==t[0]?null:t[0].slice(1),a=1;a1){var v=Vs(1,u).concat([0]);n.push(e.transpose(d,v)),h=!0}else n.push(d)}var b=r.mergeFunction(n),w=b.rank;if(h)if(null==w){var k=b.shape;m=[g=k[k.length-1]].concat(k.slice(0,k.length-1));b=e.transpose(b.reshape([-1,g]),[1,0]).reshape(m)}else if(w>1){v=[w-1].concat(Vs(0,w-1));b=e.transpose(b,v)}return b}return r.mergeFunction(t)}))},n.prototype.computeOutputShape=function(t){var e;e=null==(t=t)[0]?null:t[0].slice(1);for(var n=1;n1)throw new Ga("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(t))}},n.prototype.mergeFunction=function(t){var n=this;return e.tidy((function(){return Xs(t,n.axis)}))},n.prototype.computeOutputShape=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Ga("A `Concatenate` layer should be called on a list of inputs.");for(var e=t,n=e[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=e.slice(1);i3||r.length>3)throw new Ha("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(n,r);if(n[i[0]]!==r[i[1]])throw new Ga("Dimension incompatibility: "+n[i[0]]+" !== "+r[i[1]])},n.prototype.mergeFunction=function(t){if(2!==t.length)throw new Ga("A `Dot` layer must be called on exactly 2 inputs, but received "+t.length+" input(s).");var n,r=t[0],i=t[1];return n=Array.isArray(this.axes)?this.axes.map((function(e,n){return Jh(e,t[n].shape.length)})):[Jh(this.axes,r.shape.length),Jh(this.axes,i.shape.length)],this.normalize&&(r=pu(r,n[0]),i=pu(i,n[1])),function(t,n,r){if(t.shape.length>3||n.shape.length>3)throw new Ha("batchDot is not implemented for tensors of 4D or higher rank yet");if(e.util.assert(t.shape.length>=2,(function(){return"batchDot requires the rank of x to be >= 2, but got "+t.shape.length})),e.util.assert(t.shape.length>=2,(function(){return"batchDot requires the rank of y to be >= 2, but got "+n.shape.length})),"number"==typeof r&&(r=[r,r]),"complex64"===t.dtype||"complex64"===n.dtype)throw new Ha("batchDot is not implemented for complex64-type Tensors yet.");var i=t.shape.length,a=n.shape.length;null==r&&(r=[i-1,a-2]);var s=r;return e.tidy((function(){var e,r;if(i>a){e=i-a;for(var o=[],u=0;ui){for(e=a-i,o=[],u=0;u0){var c=void 0,p=[];for(u=c=i>a?i+a-3:i-1;u3||r.length>3)throw new Ha("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(n,r);n.splice(i[0],1),r.splice(i[1],1),r.splice(0,1);var a=n.concat(r);return 1===a.length&&a.push(1),a},n.prototype.computeMask=function(t,e){return null},n.prototype.getConfig=function(){var e={axes:this.axes,normalize:this.normalize},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="Dot",n}(Uh);e.serialization.registerClass(Zh);var Xh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.stddev=e.stddev,n}return $a(n,t),n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={stddev:this.stddev};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n);var e=Bo(t);return oo((function(){return to(e.shape,0,r.stddev).add(e)}),(function(){return e}),n.training||!1)}))},n.className="GaussianNoise",n}(Zo);e.serialization.registerClass(Xh);var Yh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.rate=e.rate,n}return $a(n,t),n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n);var e=Bo(t);if(r.rate>0&&r.rate<1){return oo((function(){var t=Math.sqrt(r.rate/(1-r.rate));return e.mul(to(e.shape,1,t))}),(function(){return e}),n.training||!1)}return e}))},n.className="GaussianDropout",n}(Zo);e.serialization.registerClass(Yh);var Qh=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n.rate=e.rate,n.noiseShape=e.noiseShape,n}return $a(n,t),n.prototype._getNoiseShape=function(t){return this.noiseShape||Bo(t).shape},n.prototype.computeOutputShape=function(t){return t},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,e),n},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){if(r.rate<1&&r.rate>0){var i=r._getNoiseShape(t);return oo((function(){var n=Bo(t),a=-1.7580993408473766,s=e.greaterEqual(e.randomUniform(i),r.rate);s=qs(s,"float32");var o=Math.pow((1-r.rate)*(1+r.rate*Math.pow(a,2)),-.5),u=-o*a*r.rate;return n.mul(s).add(s.add(-1).mul(a)).mul(o).add(u)}),(function(){return Bo(t)}),n.training||!1)}return t}))},n.className="AlphaDropout",n}(Zo);function tc(t,n,r,i,a,s){var o;if(void 0===s&&(s=.001),2===t.rank)o=e.batchNorm2d(t,n,r,i,a,s);else if(3===t.rank)o=e.batchNorm3d(t,n,r,i,a,s);else{if(4!==t.rank)throw new Ha("batchNormalization is not implemented for array of rank "+t.rank+" yet");o=e.batchNorm4d(t,n,r,i,a,s)}return o}function ec(t,n,r,i,a){return void 0===a&&(a=.001),e.util.arraysEqual(i.slice().sort(),Vs(0,t.rank-1))?function(t,n,r,i,a){return void 0===a&&(a=.001),e.tidy((function(){var s=e.moments(t,i),o=s.mean,u=s.variance;return[tc(t,o,u,r,n,a),o,u]}))}(t,n,r,i,a):function(t,n,r,i,a){return void 0===a&&(a=.001),e.tidy((function(){for(var s=e.moments(t,i),o=s.mean,u=s.variance,l=[],h=0,c=Vs(0,t.rank);h=0?this.axis:this.axis+t.length,r=t[n];if(null==r)throw new Ga("Axis "+n+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(t)+".");this.inputSpec=[new Vo({ndim:t.length,axes:(e={},e[n]=r,e)})];var i=[r];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var i=null!=n.training&&n.training,a=Bo(t),s=a.shape,o=s.length,u=Vs(0,o),l=r.axis>=0?r.axis:r.axis+o;u.splice(l,1);var h=Za(1,o);h[l]=s[l];var c=u.slice();c.sort();var p=!e.util.arraysEqual(c,Vs(0,o).slice(0,o-1));if(!i)return function(){if(p){var t=r.movingMean.read().reshape(h),e=r.movingVariance.read().reshape(h),n=r.center?r.beta.read().reshape(h):null,i=r.scale?r.gamma.read().reshape(h):null;return tc(a,t,e,n,i,r.epsilon)}return tc(a,r.movingMean.read(),r.movingVariance.read(),null==r.beta?null:r.beta.read(),null==r.gamma?null:r.gamma.read(),r.epsilon)}();var d=ec(a,r.gamma.read(),r.beta.read(),u,r.epsilon),f=d[0],g=d[1],m=d[2],y=function(t,n,r){e.tidy((function(){var e=1-r,i=t.read(),a=i.sub(n).mul(e);t.write(i.sub(a))}))};return y(r.movingMean,g,r.momentum),y(r.movingVariance,m,r.momentum),f}))},n.prototype.getConfig=function(){var e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Do(this.betaInitializer),gammaInitializer:Do(this.gammaInitializer),movingMeanInitializer:Do(this.movingMeanInitializer),movingVarianceInitializer:Do(this.movingVarianceInitializer),betaRegularizer:Vl(this.betaRegularizer),gammaRegularizer:Vl(this.gammaRegularizer),betaConstraint:Ss(this.betaConstraint),gammaConstraint:Ss(this.gammaConstraint)},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="BatchNormalization",n}(Zo);e.serialization.registerClass(nc);var rc=function(t){function n(e){var n=this;if(null==e&&(e={}),(n=t.call(this,e)||this).axis=null==e.axis?-1:e.axis,"number"==typeof n.axis){if(!Number.isInteger(n.axis))throw new Error("Expected axis to be an integer, but received "+n.axis)}else{if(!Array.isArray(n.axis))throw new Error("Expected axis to be an integer or an array of integers, but received "+JSON.stringify(n.axis));for(var r=0,i=n.axis;r=e)throw new Error("Invalid axis: "+a)}if(this.axis.length!==us(this.axis).length)throw new Error("Found duplicate axes in: "+this.axis);var s=this.axis.map((function(e){return t[e]}));this.scale?this.gamma=this.addWeight("gamma",s,"float32",this.gammaInitializer,this.gammaRegularizer,true):this.gamma=null,this.center?this.beta=this.addWeight("beta",s,"float32",this.betaInitializer,this.betaRegularizer,true):this.beta=null,this.built=!0},n.prototype.call=function(t,n){var r=this,i=Bo(t),a=i.shape,s=a.length;return e.tidy((function(){for(var t=e.moments(i,r.axis,!0),n=t.mean,o=t.variance,u=Za(1,s),l=0,h=r.axis;l=0?t[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[3]&&t[3]>=0?t[3]+this.padding[1][0]+this.padding[1][1]:null,[t[0],t[1],e,n]):(e=null!=t[1]&&t[1]>=0?t[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[2]&&t[2]>=0?t[2]+this.padding[1][0]+this.padding[1][1]:null,[t[0],e,n,t[3]])},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return n=Bo(t),i=r.padding,a=r.dataFormat,e.tidy((function(){if(4!==n.rank)throw new Ga("temporalPadding expects input tensor to be 4-D, but received a "+n.rank+"-D tensor.");if(null==i&&(i=[[1,1],[1,1]]),2!==i.length||2!==i[0].length||2!==i[1].length)throw new Ga("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==a&&(a="channelsLast"),"channelsLast"!==a&&"channelsFirst"!==a)throw new Ga("Unknown data format: "+a+". Supported data formats are 'channelsLast' and 'channelsFirst.");var t;return t="channelsFirst"===a?[[0,0],[0,0],i[0],i[1]]:[[0,0],i[0],i[1],[0,0]],e.pad(n,t)}));var n,i,a}))},n.prototype.getConfig=function(){var e={padding:this.padding,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="ZeroPadding2D",n}(Zo);function ac(t,n,r,i,a,s){return e.tidy((function(){var o;Fs(a),_s(s),Ls(i),null==r&&(r=[1,1]),null==i&&(i="valid"),null==a&&(a="channelsLast"),null==s&&(s="max"),t=rh(t,a);var u="same"===i?"same":"valid";return o="max"===s?e.maxPool(t,n,r,u):e.avgPool(t,n,r,u),"channelsFirst"===a&&(o=e.transpose(o,[0,3,1,2])),o}))}function sc(t,n,r,i,a,s){return e.tidy((function(){var o;Fs(a),_s(s),Ls(i),null==r&&(r=[1,1,1]),null==i&&(i="valid"),null==a&&(a="channelsLast"),null==s&&(s="max"),t=ih(t,a);var u="same"===i?"same":"valid";return o="max"===s?e.maxPool3d(t,n,r,u):e.avgPool3d(t,n,r,u),"channelsFirst"===a&&(o=e.transpose(o,[0,4,1,2,3])),o}))}e.serialization.registerClass(ic);var oc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=2),n=t.call(this,e)||this,"number"==typeof e.poolSize)n.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new Ga("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.poolSize));n.poolSize=e.poolSize}if(ps(n.poolSize,"poolSize"),null==e.strides)n.strides=n.poolSize;else if("number"==typeof e.strides)n.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new Ga("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.strides));n.strides=e.strides}return ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,Ls(n.padding),n.inputSpec=[new Vo({ndim:3})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){var e=eh((t=$o(t))[1],this.poolSize[0],this.padding,this.strides[0]);return[t[0],e,t[2]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){r.invokeCallHook(t,n),t=Gs(Bo(t),2);var i=r.poolingFunction(Bo(t),[r.poolSize[0],1],[r.strides[0],1],r.padding,"channelsLast");return e.squeeze(i,[2])}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),uc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"max")},e.className="MaxPooling1D",e}(oc);e.serialization.registerClass(uc);var lc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"avg")},e.className="AveragePooling1D",e}(oc);e.serialization.registerClass(lc);var hc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=[2,2]),(n=t.call(this,e)||this).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)n.strides=n.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new Ga("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+e.strides.length+".");n.strides=e.strides}else n.strides=[e.strides,e.strides];return ps(n.poolSize,"poolSize"),ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),Ls(n.padding),n.inputSpec=[new Vo({ndim:4})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){t=$o(t);var e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2];return e=eh(e,this.poolSize[0],this.padding,this.strides[0]),n=eh(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n]:[t[0],e,n,t[3]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return r.invokeCallHook(t,n),r.poolingFunction(Bo(t),r.poolSize,r.strides,r.padding,r.dataFormat)}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),cc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"max")},e.className="MaxPooling2D",e}(hc);e.serialization.registerClass(cc);var pc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),ac(t,e,n,r,i,"avg")},e.className="AveragePooling2D",e}(hc);e.serialization.registerClass(pc);var dc=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=[2,2,2]),(n=t.call(this,e)||this).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)n.strides=n.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new Ga("If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length "+e.strides.length+".");n.strides=e.strides}else n.strides=[e.strides,e.strides,e.strides];return ps(n.poolSize,"poolSize"),ps(n.strides,"strides"),n.padding=null==e.padding?"valid":e.padding,n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),Ls(n.padding),n.inputSpec=[new Vo({ndim:5})],n}return $a(n,t),n.prototype.computeOutputShape=function(t){t=$o(t);var e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2],r="channelsFirst"===this.dataFormat?t[4]:t[3];return e=eh(e,this.poolSize[0],this.padding,this.strides[0]),n=eh(n,this.poolSize[1],this.padding,this.strides[1]),r=eh(r,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n,r]:[t[0],e,n,r,t[4]]},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return r.invokeCallHook(t,n),r.poolingFunction(Bo(t),r.poolSize,r.strides,r.padding,r.dataFormat)}))},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(Zo),fc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),sc(t,e,n,r,i,"max")},e.className="MaxPooling3D",e}(dc);e.serialization.registerClass(fc);var gc=function(t){function e(e){return t.call(this,e)||this}return $a(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return Fs(i),Ls(r),sc(t,e,n,r,i,"avg")},e.className="AveragePooling3D",e}(dc);e.serialization.registerClass(gc);var mc=function(t){function e(e){var n=t.call(this,e)||this;return n.inputSpec=[new Vo({ndim:3})],n}return $a(e,t),e.prototype.computeOutputShape=function(t){return[t[0],t[2]]},e.prototype.call=function(t,e){throw new Ha},e}(Zo),yc=function(t){function n(e){return t.call(this,e||{})||this}return $a(n,t),n.prototype.call=function(t,n){return e.tidy((function(){var n=Bo(t);return e.mean(n,1)}))},n.className="GlobalAveragePooling1D",n}(mc);e.serialization.registerClass(yc);var vc=function(t){function n(e){return t.call(this,e||{})||this}return $a(n,t),n.prototype.call=function(t,n){return e.tidy((function(){var n=Bo(t);return e.max(n,1)}))},n.className="GlobalMaxPooling1D",n}(mc);e.serialization.registerClass(vc);var bc=function(t){function e(e){var n=t.call(this,e)||this;return n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Fs(n.dataFormat),n.inputSpec=[new Vo({ndim:4})],n}return $a(e,t),e.prototype.computeOutputShape=function(t){return t=t,"channelsLast"===this.dataFormat?[t[0],t[3]]:[t[0],t[1]]},e.prototype.call=function(t,e){throw new Ha},e.prototype.getConfig=function(){var e={dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},e}(Zo),wc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);return"channelsLast"===r.dataFormat?e.mean(n,[1,2]):e.mean(n,[2,3])}))},n.className="GlobalAveragePooling2D",n}(bc);e.serialization.registerClass(wc);var kc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return $a(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy((function(){var n=Bo(t);return"channelsLast"===r.dataFormat?e.max(n,[1,2]):e.max(n,[2,3])}))},n.className="GlobalMaxPooling2D",n}(bc);e.serialization.registerClass(kc);var Sc=function(t){function e(e){var n=t.call(this,e)||this;return n.layer=e.layer,n}return $a(e,t),e.prototype.build=function(t){this.built=!0},Object.defineProperty(e.prototype,"trainable",{get:function(){return null!=this.layer&&this.layer.trainable},set:function(t){null!=this.layer&&(this.layer.trainable=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trainableWeights",{get:function(){return this.layer.trainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nonTrainableWeights",{get:function(){return this.layer.nonTrainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updates",{get:function(){return this.layer._updates},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"losses",{get:function(){return this.layer.losses},enumerable:!0,configurable:!0}),e.prototype.getWeights=function(){return this.layer.getWeights()},e.prototype.setWeights=function(t){this.layer.setWeights(t)},e.prototype.getConfig=function(){var e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},e.prototype.setFastWeightInitDuringBuild=function(e){t.prototype.setFastWeightInitDuringBuild.call(this,e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)},e.fromConfig=function(t,e,n){void 0===n&&(n={});var r=cu(e.layer,n);delete e.layer;var i={layer:r};return Object.assign(i,e),new t(i)},e}(Zo),xc=function(t){function n(e){var n=t.call(this,e)||this;return n.supportsMasking=!0,n}return $a(n,t),n.prototype.build=function(e){if((e=$o(e)).length<3)throw new Ga("TimeDistributed layer expects an input shape >= 3D, but received input shape "+JSON.stringify(e));this.inputSpec=[{shape:e}];var n=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),t.prototype.build.call(this,e)},n.prototype.computeOutputShape=function(t){var e=[(t=$o(t))[0]].concat(t.slice(2)),n=this.layer.computeOutputShape(e),r=t[1];return[n[0],r].concat(n.slice(1))},n.prototype.call=function(t,n){var r=this;return e.tidy((function(){return vh((function(t,e){return[Bo(r.layer.call(t,n)),[]]}),t=Bo(t),[],!1,null,null,!1,!0)[1]}))},n.className="TimeDistributed",n}(Sc);e.serialization.registerClass(xc);var Ic=function(t){function n(e){var n=t.call(this,e)||this,r=e.layer.getConfig(),i={};i.className=e.layer.getClassName(),i.config=r,n.forwardLayer=cu(i),r.goBackwards=!0!==r.goBackwards;var a,s={};if(s.className=e.layer.getClassName(),s.config=r,n.backwardLayer=cu(s),n.forwardLayer.name="forward_"+n.forwardLayer.name,n.backwardLayer.name="backward_"+n.backwardLayer.name,n.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,a=n.mergeMode,hs(Ts,"BidirectionalMergeMode",a),e.weights)throw new Ha("weights support is not implemented for Bidirectional layer yet.");return n._stateful=e.layer.stateful,n.returnSequences=e.layer.returnSequences,n.returnState=e.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=e.layer.inputSpec,n.numConstants=null,n}return $a(n,t),Object.defineProperty(n.prototype,"trainable",{get:function(){return this._trainable},set:function(t){this._trainable=t,null!=this.forwardLayer&&(this.forwardLayer.trainable=t),null!=this.backwardLayer&&(this.backwardLayer.trainable=t)},enumerable:!0,configurable:!0}),n.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},n.prototype.setWeights=function(t){var e=t.length,n=Math.floor(e/2);this.forwardLayer.setWeights(t.slice(0,n)),this.backwardLayer.setWeights(t.slice(n))},n.prototype.computeOutputShape=function(t){var e,n,r,i=this.forwardLayer.computeOutputShape(t);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),e=i[0]):e=i[0],e=e,"concat"===this.mergeMode?(e[e.length-1]*=2,n=[e]):n=null==this.mergeMode?[e,e.slice()]:[e],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[e].concat(r).concat(r.slice()):Qa(n)},n.prototype.apply=function(e,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=yh(e,r,i,this.numConstants);if(e=a.inputs,r=a.initialState,i=a.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==i)return t.prototype.apply.call(this,e,n);var s=[],o=[];if(null!=r){var u=r.length;if(u%2>0)throw new Ga("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,s.push.apply(s,r);var l=r.map((function(t){return new Vo({shape:t.shape})}));this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),o.push.apply(o,l)}if(null!=i)throw new Ha("Support for constants in Bidirectional layers is not implemented yet.");for(var h=s[0]instanceof qo,c=0,p=s;ce}var $c=function(t){function e(e){var n=t.call(this)||this;if(null==e&&(e={}),e.restoreBestWeights)throw new Ha("restoreBestWeights = True is not implemented in EarlyStopping yet.");return n.monitor=e.monitor||"val_loss",n.minDelta=Math.abs(e.minDelta||0),n.patience=e.patience||0,n.verbose=e.verbose||0,n.mode=e.mode||"auto",n.baseline=e.baseline,-1===["auto","min","max"].indexOf(n.mode)&&(console.warn("EarlyStopping mode '"+n.mode+"' is invalid. Falling back to mode 'auto'."),n.mode="auto"),"min"===n.mode?n.monitorFunc=Oc:"max"===n.mode||-1!==n.monitor.indexOf("acc")?n.monitorFunc=Bc:n.monitorFunc=Oc,n.monitorFunc===Oc&&(n.minDelta*=-1),n}return $a(e,t),e.prototype.onTrainBegin=function(t){return Ua(this,void 0,void 0,(function(){return Ka(this,(function(t){return this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Oc?1/0:-1/0,[2]}))}))},e.prototype.onEpochEnd=function(t,e){return Ua(this,void 0,void 0,(function(){var n;return Ka(this,(function(r){switch(r.label){case 0:return[4,eu(e)];case 1:return r.sent(),null==(n=this.getMonitorValue(e))?[2]:(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=t,this.model.stopTraining=!0)),[2])}}))}))},e.prototype.onTrainEnd=function(t){return Ua(this,void 0,void 0,(function(){return Ka(this,(function(t){return this.stoppedEpoch>0&&this.verbose&&console.log("Epoch "+this.stoppedEpoch+": early stopping."),[2]}))}))},e.prototype.getMonitorValue=function(t){null==t&&(t={});var e=t[this.monitor];return null==e&&console.warn("Metric for EarlyStopping "+this.monitor+" is not available. Available metrics are: "+Object.keys(t)),e},e}(Mc);var Pc={earlyStopping:function(t){return new $c(t)}};t.Callback=Mc,t.CallbackList=iu,t.CustomCallback=ou,t.EarlyStopping=$c,t.History=su,t.InputSpec=Vo,t.LayerVariable=Uo,t.LayersModel=vl,t.RNN=bh,t.Sequential=kl,t.SymbolicTensor=qo,t.callbacks=Pc,t.constraints=Ns,t.initializers=Eo,t.input=Sl,t.layers=Fc,t.loadLayersModel=function(t,n){return null==n&&(n={}),function(t,n){return Ua(this,void 0,void 0,(function(){var r;return Ka(this,(function(i){if(null==n&&(n={}),"string"==typeof t){if(0===(r=e.io.getLoadHandlers(t,n)).length)r.push(e.io.browserHTTPRequest(t,n));else if(r.length>1)throw new Ga("Found more than one ("+r.length+") load handlers for URL '"+t+"'");t=r[0]}return[2,wl(t,void 0,n)]}))}))}(t,n)},t.metrics=Lc,t.model=function(t){return new vl(t)},t.models=_c,t.registerCallbackConstructor=function(t,e){lu.registerCallbackConstructor(t,e)},t.regularizers=Rc,t.sequential=function(t){return new kl(t)},t.version_layers=Ku,Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=tf-layers.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.html b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.html deleted file mode 100644 index 40ae38ca0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.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-layers/dist/tf-layers.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.map deleted file mode 100644 index aeed14506..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.min.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/base_callbacks.ts","../src/logs.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/optimizers.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["notYetImplemented","kernelName","Error","assert","expr","msg","flatten","arr","result","skipTypedArray","Array","isArray","isTypedArray","i","length","push","sizeFromShape","shape","size","arraysEqual","n1","n2","isInt","a","rightPad","repeat","parseAxisParam","axis","rank","map","s","concat","every","ax","Float32Array","Int32Array","Uint8Array","bytesPerElement","dtype","isString","value","String","inferDtype","values","isBoolean","isFunction","f","constructor","call","apply","computeStrides","strides","createNestedArray","offset","isComplex","ret","d","rest","slice","len","reduce","acc","c","toNestedArray","makeOnesTypedArray","array","makeZerosTypedArray","isPromise","object","then","TENSORFLOWJS_FLAGS_PREFIX","Environment","[object Object]","global","this","flags","flagRegistry","urlFlags","getQueryParams","populateURLFlags","platformName","platform","console","warn","flagName","evaluationFn","setHook","flagValue","set","evaluateFlag","get","features","Object","assign","location","search","urlParams","split","forEach","keyValue","key","toLowerCase","parseValue","queryString","params","replace","t","name","decodeURIComponent","decodeParam","join","env","ENV","globalNameSpace","getGlobalNamespace","ns","window","process","self","getGlobal","init","globalMap","_tfGlobals","Map","getGlobalMap","has","singleton","Acos","Acosh","Add","ArgMax","ArgMin","Asin","Asinh","Atan","Atanh","Atan2","AvgPool","BatchMatMul","BatchToSpaceND","Cast","Ceil","ClipByValue","ComplexAbs","Concat","Conv2D","Conv2DBackpropInput","Cosh","Cumsum","DepthwiseConv2dNative","Dilation2D","RealDiv","ExpandDims","Expm1","Floor","FloorDiv","FusedBatchNorm","GatherV2","GreaterEqual","Identity","IsFinite","IsInf","IsNan","LeakyRelu","Log1p","Maximum","MaxPool","Mean","Minimum","MirrorPad","Multiply","OnesLike","OneHot","Pack","PadV2","Prelu","Reciprocal","Relu","Reshape","ResizeNearestNeighbor","ResizeBilinear","Relu6","Reverse","Round","Rsqrt","Select","Selu","Slice","Sinh","Sign","Sigmoid","Softplus","Sqrt","SpaceToBatchND","SplitV","Softmax","SquaredDifference","Tanh","Tile","Transpose","Unpack","UnsortedSegmentSum","ZerosLike","Step","kernelRegistry","gradRegistry","getKernel","backendName","makeKey","getGradient","getKernelsForBackend","it","entries","done","next","config","backend","registerGradient","getBool","toTypedArray","base.flatten","vals","num","isNaN","isFinite","base.checkConversionForErrors","noConversionNeeded","bool","Math","round","now","decodeString","bytes","encoding","decode","Profiler","backendTimer","logger","Logger","inputs","outputs","holdResultWrapperFn","timer","start","util.now","timerAvailable","time","output","dataSync","Promise","resolve","kernelMs","data","tensorVals","checkComputationForErrors","timeMs","timing","extraInfo","getExtraProfileInfo","kernelProfile","all","valueContainer","logKernelProfile","util.rightPad","paddedName","toString","inputShapesDescription","input","inputShape","inputRank","log","tensorToString","verbose","padPerCol","n","numCols","fill","valuesOrTuples","createComplexTuples","row","j","max","valToString","computeMaxSizePerColumn","valsLines","subTensorToString","lines","l","val","pad","valStr","parseFloat","toFixed","boolNumToString","v","isLast","storagePerElement","firstValsSize","firstVals","from","lastVals","x","subshape","substrides","stride","end","sep","newLineSep","complexTuples","trackerFn","opHandler","Tensor","dataId","id","kept","isDisposedInternal","util.sizeFromShape","rankType","buffer","throwIfDisposed","read","b","util.decodeString","_a","readSync","isDisposed","disposeTensor","print","clone","cast","trainable","makeVariable","getGlobalTensorClass","defineProperty","Symbol","hasInstance","instance","Variable","initialValue","tensorId","super","newValue","util.arraysEqual","incRef","disposeVariable","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","UpcastComplex64AndMap","Function","upcastTypeMap","float32","int32","complex64","makeTypesMatch","typeA","typeB","upcastType","getTensorsInContainer","list","walkTensorContainer","Set","container","seen","obj","iterable","k","add","isRegisteredKernelInvocation","kernelInvocation","EngineState","registeredVariables","nextTapeNodeId","numBytes","numTensors","numStringTensors","numDataBuffers","gradientDepth","kernelDepth","scopeStack","numDataMovesStack","nextScopeId","tensorInfo","WeakMap","profiling","activeProfile","newBytes","newTensors","peakBytes","kernels","kernelNames","variableName","dispose","Engine","registry","registryFactory","pendingBackendInitId","state","pendingBackendInit","backendInstance","sortedBackends","getSortedBackends","initializeBackend","success","setBackend","asyncInit","initializeBackendsAndReturnBest","keys","factory","priority","setupRegisteredKernels","profiler","kernel","setupFunc","disposeFunc","registryFactoryEntry","force","refCount","floatPrecision","promiseId","catch","err","stack","message","disposeRegisteredKernels","sort","info","srcBackend","disposeData","move","shouldCheckForMemLeaks","nameOrFn","fn","scopedRun","startScope","endScope","error","res","ex","nextTensorId","nextVariableId","y","ENGINE","runKernel","addTapeNode","activeScope","dy","gradInputs","attrs","runKernelFunc","numDataIdsBefore","outInfos","numDataIdsAfter","numDataIds","numOutputDataIds","numMoves","dataIdsLeaked","kernelParams","saved","isTapeOn","startingBytecount","startingNumTensors","kernelFunc","out","kernelOrScopeName","util.assert","checkKernelForMemLeak","outTensors","outInfo","makeTensorFromDataId","tensorsToSave","getTensorsForGradient","saveTensorsForBackwardMode","forwardFunc","saveFunc","tensors","tensor","keep","tidy","outs","backwardsFunc","profileKernel","bytesAdded","totalBytesSnapshot","tensorsAdded","totalTensorsSnapshot","inputShapes","outputShapes","item","kernelTimeMs","gradConfig","inputsToSave","outputsToSave","inputTensorsToSave","saveAllInputs","inputName","outputTensorsToSave","filter","_","backendVals","util.isString","encode","util.encodeString","write","trackTensor","bytesFromStringArray","util.bytesPerElement","track","delete","removeDataId","varName","memory","unreliable","reasons","query","startBytes","startNumTensors","gradientsFunc","tapeNode","gradFunc","gradient","dys","util.makeZerosTypedArray","makeTensor","activeTape","scopeInfo","tensorsToTrackInParent","tensorsToTrackInParentSet","oldScope","pop","scopeId","xs","allowNoGradients","startTape","endTape","filteredTape","tape","tensorsFromX","nodesFromX","node","nodeInputs","anyInputFromX","tensorsLeadToY","nodesToY","prunedInputs","nodeInput","prunedNode","getFilteredNodesXToY","accumulatedGradientMap","ones","tensorAccumulatedGradientMap","o","gradTensor","inputGradients","dx","curGradient","backpropagateGradients","grads","util.isFunction","inputMap","save","gradRes","gradMap","grad","timingInfo","wallMs","reset","_tfengine","environment","getOrMakeEngine","inferShape","firstElem","deepAssertShapeConsistency","indices","subShape","assertDtype","expectedDtype","actualDType","argName","functionName","convertToTensor","parseAsDtype","inferredDtype","indexOf","type","inferredShape","convertToTensorArray","arg","op","opName","endsWith","substring","f2","args","configurable","abs","abs_","$x","acos","acos_","acosh","acosh_","add_","$a","$b","all_","keepDims","any","any_","argMax","argMax_","argMin","argMin_","asin","asin_","asinh","asinh_","atan","atan_","atan2","atan2_","atanh","atanh_","cast_","util.isValidDtype","computePool2DInfo","inShape","filterSize","dilations","roundingMode","dataFormat","filterHeight","filterWidth","parseTupleParam","filterShape","depthwise","batchSize","inHeight","inWidth","inChannels","filterChannels","strideHeight","strideWidth","dilationHeight","dilationWidth","effectiveFilterHeight","getEffectiveFilterSize","effectiveFilterWidth","padInfo","outHeight","outWidth","top","bottom","left","right","outShape","fieldSize","zeroPad","dilation","effectiveFieldSize","floor","computeDefaultPad","inputRows","inputCols","outputRows","outputCols","computeOutputShape2D","ceil","padAlongHeight","padAlongWidth","getPadAndOutInfo","outChannels","computeConv2DInfo","param","trunc","tupleValuesAreOne","dimA","dimB","dimC","eitherStridesOrDilationsAreOne","reshape","reshape_","avgPool","avgPool_","dimRoundingMode","conv_util.eitherStridesOrDilationsAreOne","x4D","reshapedTo4D","util.isInt","clone_","concat_","$tensors","attr","matMul","matMul_","transposeA","transposeB","mul","mul_","sigmoid","sigmoid_","slice_","begin","tanh","tanh_","batchToSpaceND","batchToSpaceND_","blockShape","crops","prod","batchNorm","batchNorm_","mean","variance","scale","varianceEpsilon","$mean","$variance","$scale","$offset","xAs4D","broadcastTo","broadcastTo_","xShape","some","newShape","unshift","reps","ceil_","clipByValue","clipByValue_","clipValueMin","clipValueMax","complex","complex_","real","imag","$real","$imag","shapeA","shapeB","errorMessagePrefix","util.assertShapesMatch","conv2d","conv2d_","$filter","inDepth","conv1d","conv1d_","x3D","reshapedTo3D","filter4D","input4D","conv2DBackpropInput","conv2DBackpropInput_","xShape4D","dy4D","outDepth","conv2dTranspose","conv2dTranspose_","outputShape","conv3DBackpropInput","conv3DBackpropInput_","xShape5D","dy5D","reshapedTo5D","cos","cos_","cosh","cosh_","cumsum","cumsum_","exclusive","reverse","depthToSpace","depthToSpace_","blockSize","inputHeight","inputWidth","inputDepth","depthwiseConv2d","depthwiseConv2d_","dilation2d","dilation2d_","floorDiv","floorDiv_","div","div_","getReductionAxes","inDim","outAxis","outDim","assertAndGetBroadcastShape","equal","equal_","where","where_","condition","$condition","broadcastShape","e","zerosLike","zerosLike_","divNoNan","divNoNan_","divResult","zeros","bEqualsZero","dot","dot_","t1","t2","$t1","$t2","t1Inner","t2Inner","t12D","t22D","t1t2","elu","elu_","erf","erf_","exp","exp_","expandDims","expandDims_","dim","expm1","expm1_","tile","tile_","floor_","gather","gather_","batchDims","greater","greater_","greaterEqual","greaterEqual_","imag_","isFinite_","isInf","isInf_","isNaN_","leakyRelu","leakyRelu_","alpha","less","less_","lessEqual","lessEqual_","localResponseNormalization","localResponseNormalization_","depthRadius","bias","beta","log_","log1p","log1p_","customGrad","neg","neg_","softplus","softplus_","logSigmoid","logSigmoid_","customOp","max_","reductionIndices","sub","sub_","sum","sum_","logSoftmax","logSoftmax_","logits","$logits","xMax","shifted","softmax","expandShapeToKeepDim","axes","outputLoc","reduceLoc","loc","outIdx","reduceIdx","combineLocations","getUndoAxesPermutation","logSumExp","logSumExp_","logicalAnd","logicalAnd_","logicalNot","logicalNot_","logicalOr","logicalOr_","logicalXor","logicalXor_","maxPool","maxPool_","maximum","maximum_","mean_","min","min_","minimum","minimum_","mirrorPad","mirrorPad_","paddings","mode","shapeOffset","mod","mod_","square","square_","notEqual","notEqual_","oneHot","oneHot_","depth","onValue","offValue","onesLike","onesLike_","pad_","constantValue","spaceToBatchND","spaceToBatchND_","pool","pool_","windowShape","poolingType","convInfo","conv_util.computePool2DInfo","basePadding","padExtraShape","padExtraStart","padExtraEnd","withSpaceToBatchBasePaddings","isDilationOne","adjustedPadding","adjustedCrops","padStart","origPadEnd","fullInputShape","padEndExtra","padEnd","requiredSpaceToBatchPaddings","convertedPad","convertedX","pow","pow_","base","$base","$exp","prelu","prelu_","prod_","real_","reciprocal","reciprocal_","relu","relu_","relu6","relu6_","reverse_","dims","round_","rsqrt","rsqrt_","dimSize","Number","isInteger","assertNonNegativeIntegerDimensions","providedSize","inferredSize","inferred","flatDimsDontMatch","scalar","selu","selu_","separableConv2d","separableConv2d_","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","sign","sign_","sin","sin_","sinh","sinh_","softmax_","fft","fft_","ifft","ifft_","irfft","irfft_","innerDimensionSize","batch","complexInput","realInput","imagInput","realConjugate","imagConjugate","r","temp","split_","numOrSizeSplits","rfft","rfft_","fftLength","adjustedInput","zerosShape","zerosInput","half","realValues","imagValues","realComplexConjugate","imagComplexConjugate","sqrt","sqrt_","squaredDifference","squaredDifference_","squeeze","squeeze_","keptDims","isEmptyArray","squeezeShape","stack_","step","step_","stridedSlice","stridedSlice_","beginMask","endMask","ellipsisMask","newAxisMask","shrinkAxisMask","tan","tan_","topk","topk_","sorted","lastDim","unique","unique_","unsortedSegmentSum","unsortedSegmentSum_","segmentIds","numSegments","$segmentIds","unstack","unstack_","transpose","transpose_","perm","normImpl","p","Infinity","norm","norm_","ord","keepDimsShape","axis_util.expandShapeToKeepDim","conv2DBackpropFilter","conv2DBackpropFilter_","depthwiseConv2dNativeBackpropFilter","depthwiseConv2dNativeBackpropFilter_","depthwiseConv2dNativeBackpropInput","depthwiseConv2dNativeBackpropInput_","resizeBilinear","resizeBilinear_","images","alignCorners","halfPixelCenters","$images","batchImages","resizeNearestNeighbor","resizeNearestNeighbor_","prototype","asScalar","asType","as1D","as2D","rows","columns","as3D","as4D","depth2","as5D","depth3","padding","dilationRate","reshapeAs","newShape2D","halfFloatCenters","tensorsToBeStacked","toBool","toFloat","toInt","absGradConfig","acosGradConfig","acoshGradConfig","addGradConfig","broadcast_util.assertAndGetBroadcastShape","reduceAxes","broadcast_util.getReductionAxes","addNGradConfig","ders","argMaxGradConfig","argMinGradConfig","asinGradConfig","asinhGradConfig","atan2GradConfig","atanGradConfig","atanhGradConfig","avgPool3dGrad","avgPool3dGrad_","$dy","$input","input5D","avgPool3DGradConfig","avgPoolGrad","avgPoolGrad_","avgPoolGradConfig","batchMatMulGradConfig","batchToSpaceNDGradConfig","broadcastToGradConfig","broadCastToAttrs","castGradConfig","ceilGradConfig","clipByValueGradConfig","complexAbsGradConfig","concatGradConfig","shapes","$axis","sizeSplits","conv2DGradConfig","conv_util.tupleValuesAreOne","conv2DBackpropInputGradConfig","ddx","conv3DBackpropFilter","conv3DBackpropFilter_","x5D","conv3DGradConfig","cosGradConfig","coshGradConfig","cumsumGradConfig","permutation","axesAreInnerMostDims","getAxesPermutation","depthwiseConv2dNativeGradConfig","$dilations","dilation2dGradConfig","inputInputs","filterInputs","eluGradConfig","erfGradConfig","PI","expGradConfig","expandDimsGradConfig","expm1GradConfig","floorGradConfig","floorDivGradConfig","tmp","fusedBatchNormGradConfig","scaleValue","reductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","gatherGradConfig","parsedAxis","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","stop","arrays","greaterEqualGradConfig","identityGradConfig","isFiniteGradConfig","isInfGradConfig","isNanGradConfig","leakyReluGradConfig","mask","log1pGradConfig","logGradConfig","logSoftmaxGradConfig","localResponseNormalizationBackprop","localResponseNormalizationBackprop_","lrnGradConfig","gradForMinAndMax","xOrig","origAxes","maxGradConfig","maxAttrs","maxGrad","util.parseAxisParam","maximumGradConfig","maxPool3dGrad","maxPool3dGrad_","$output","output5D","maxPool3DGradConfig","maxPoolGrad","maxPoolGrad_","padV2GradConfig","spaceToBatchNDGradConfig","splitVGradConfig","gradConfigs","reduceSize","aShape","computeOutAndReduceShapes","expandedDyShape","expandedDy","minAttrs","minGrad","expFloat","logBase","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","begin_","size_","xRank","parseSliceParams","dyTimesY","two","derX","xGrad","transposeAttrs","undoPerm","axis_util.getUndoAxesPermutation","unpackAttrs","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gatherDropNegatives","gradientConfig","_epsilon","epsilon","_super","setPrototypeOf","_this","AttributeError","tslib_1.__extends","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","pyListRepeat","numValues","newArray","count","refernce","counter","array_1","_i","singletonOrArray","toList","toSnakeCase","insecure","toCamelCase","identifier","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","dict","getClassName","getConfig","convertNDArrayScalarsInConfig","configItem","fields_1","field","deserializeKerasObject","moduleObjects","customObjects","printableModuleName","fastWeightInit","JSON","stringify","className","cls","fromConfig","_b","_c","customObjectsCombined","_d","_f","_e","backupCustomObjects","_h","_g","returnObj","_k","_j","reverseNumberCompare","numberCompare","xs_1","isObjectEmpty","hasOwnProperty","checkStringTypeUnionValue","label","checkArrayTypeAndLength","expectedType","minLength","maxLength","assertPositiveInteger","util","formatAsFriendlyString","mapActivationToFusedKernel","activationName","calcL2Norms","w","tfc.sqrt","tfc.sum","tfc.mul","Constraint","serialization","Serializable","maxValue","defaultMaxValue","defaultAxis","MaxNorm","norms","desired","tfc.clipByValue","tfc.div","tfc.add","registerClass","UnitNorm","NonNeg","tfc.relu","minValue","defaultMinValue","rate","defaultRate","MinMaxNorm","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","constraint","deserializeConstraint","SerializationMap","getMap","classNameMap","getConstraint","VALID_DATA_FORMAT_VALUES","VALID_INTERPOLATION_FORMAT_VALUES","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","VALID_BIDIRECTIONAL_MERGE_MODES","nameMap","checkDataFormat","checkPaddingMode","checkPoolMode","_nameScopeStack","nameScope","getScopedTensorName","tensorName","isValidTensorName","getUniqueTensorName","scopedName","index","tensorNameRegex","RegExp","match","arrayProd","toArray1D","tensor1d","tfc.min","tfc.max","range","splice","sliceAlongFirstAxis","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","sliceAlongLastAxis","sliceAlongAxis","concatenate","tfc.concat","concatAlongFirstAxis","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","randomNormal","stddev","seed","tfc.randomNormal","activation","ySecondLastDim","tfc.fused","reshapeBias","aFirstDims","aLastDim","bShape","bLastDim","yOtherDims","reference","tfc.gather","biasShape","biasAdd","dropout","level","noiseShape","tfc.dropout","inTrainPhase","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","Ones","undefined","Constant","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","RandomUniform","randomUniform","DEFAULT_MEAN","DEFAULT_STDDEV","RandomNormal","K.randomNormal","TruncatedNormal","truncatedNormal","gain","eye","distribution","checkDistribution","VarianceScaling","fans","fanIn","fanOut","receptiveFieldSize","shapeProd","computeFans","limit","GlorotUniform","GlorotNormal","HeNormal","HeUniform","LeCunNormal","LeCunUniform","DEFAULT_GAIN","Orthogonal","q","linalg","gramSchmidt","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","heUniform","identity","leCunNormal","leCunUniform","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","initializer","getInitializer","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","prefix","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","weights","weights_1","weight","DEFAULT_VARIABLE_NAME_PREFIX","originalName","trainable_","tfc.variable","LayerVariable","assertNotDisposed","newVal","checkShapesMatch","batchGetValue","batchSetValue","variablesAndValues","variableAndValue","ndim","maxNDim","minNDim","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","layer","outboundNodes","inboundNodes","Node","inboundNames","_nextLayerID","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","batchInputShape","inputDType","initialWeights","_refCount","fastWeightInitDuringBuild","Layer","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","built","trainableWeights","nonTrainableWeights","_stateful","stateful","generic_utils.toList","inputIndex","spec","xShapeAtAxis","specDim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","inputsList_1","SymbolicTensor","noneAreSymbolic","inputsList_2","assertInputCompatibility","xElem","build","setWeights","outputListCopy","outputList_1","inputTensors_1","collectInputShape","computeOutputShape","outputDType_1","warnOnIncompatibleInputShape","addInboundNode","dimMismatch_1","dimension","allOutputShapes","shapeString","variable_utils.countParamsInWeights","trainableOnly","weightValueTuples","paramValues","pv","regularizer","_addedWeightNames","initValue","addLoss","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","inputTensorList_1","tensorIndex","numDisposedVariables","disposeWeights","refCountAfterDispose","getSourceInputs","sourceTensors","previousSources_1","x_1","ModelLoggingVerbosity","sparse","inputTensor","InputLayer","Input","batchShape","resolveScalarsInLogs","logs","promises","scalarsToDispose","valueScalar","disposeTensorsInLogs","BaseCallback","epoch","model","callbacks","queueLength","CallbackList","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","totals","this_1","oldTotalsToDispose","total","this_2","History","history","valueArray","yieldEvery","waitMs","lastResult","lastTime","onYield","isNumber","maybeWait","bind","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","yield","CustomCallback","ps","nextFrame","currentEpoch","standardizeCallbacks","callbackConfig","CallbackConstructorRegistry","verbosityLevel","callbackConstructor","checkForDuplicate","constructors","levelName","ctor","configureCallbacks","epochs","initialEpoch","numTrainSamples","stepsPerEpoch","doValidation","callbackMetrics","actualCallbacks","createCallbacks","callbackList","samples","steps","metrics","deserialize","l2Normalize","squareSum","K.square","epsilonTensor","tfc.fill","tfc.maximum","meanSquaredError","yTrue","yPred","tfc.mean","tfc.sub","meanAbsoluteError","tfc.abs","meanAbsolutePercentageError","diff","clippedTrue","MAX_VALUE","absResult","categoricalCrossentropy","target","fromLogits","tfc.softmax","outputSum","tfc.neg","tfc.log","sparseCategoricalCrossentropy","flatTarget","tfc.floor","math_utils.arrayProd","tfc.oneHot","binaryCrossentropy","labels","reluLogits","negAbsLogits","sigmoidCrossEntropyWithLogits","cosineProximity","trueNormalized","predNormalized","trueXPred","lossesMap","meanSquaredLogarithmicError","clippedPred","firstLog","secondLog","squaredHinge","maxResult","hinge","categoricalHinge","pos","logcosh","log2","predictionDiff","logcoshResult","tfc.softplus","kullbackLeiblerDivergence","poisson","logPred","identifierOrFn","errMsg","includes","binaryAccuracy","threshold","tfc.onesLike","yPredThresholded","K.cast","tfc.greater","tfc.equal","categoricalAccuracy","tfc.argMax","truePositives","tfc.logicalAnd","precision","tp","fp","falsePositives","denominator","tfc.where","recall","falseNegatives","lossBinaryCrossentropy","sparseCategoricalAccuracy","categoricalCrossentropyLoss","sparseCategoricalCrossentropyLoss","metricsMap","mse","MSE","mae","MAE","mape","MAPE","cosine","getLossOrMetricName","fnName","MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH","checkUserDefinedMetadata","userDefinedMetadata","modelName","checkSize","getPrototypeOf","plainObjectCheck","keys_1","xType","printSummary","lineLength","positions","printFn","relevantNodes","sequentialLike","nodesByDepth","nodes","nodesByDepth_1","depthNodes","layers","flag","isModelSequentialLike","toDisplay","printRow","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","trainableCount","collectedTrainableWeights","countTrainableParams","nonTrainableCount","fields","line","countParams","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","isArrayItemInputOrOutputName","convertPythonicToTs","pythonicConfig","generic_utils.toCamelCase","tsArray","arrayLength","tsDict","pythonicKey","pythonicValue","tsKey","convertTsToPythonic","tsConfig","pyArray","pyDict","tsValue","pyKey","version","feeds","FeedDict","id2Value","id2Mask","feeds_1","feed","assertFeedCompatibility","name2Id","cachedSorted","cachedRecipientCounts","execute","fetches","feedDict","probe","arrayFetches","fetchArray","outputNames","finalOutputs","feedNames","names","outputNames_1","outputName","getValue","maxNumTensors","minNumTensors","recipientCounts","fetchAndFeedKey","finalSorted","finalRecipientMap","getTopologicalSortAndRecipientCountsForOneFetch","recipientMap","visited","fetches_1","sorted_1","symbolicTensor","name_1","recipient","recipientMap2Counts","getTopologicalSortAndRecipientCounts","internalFeedDict","symbolic","srcLayer","inputValues","tensorsToDispose","maskExists","getMask","hasKey","outputMask","computeMask","layerOutputs","getNodeOutputs","outputSymbolicTensors","i_1","disposeMasks","name_2","fetch","marks","top_1","topIsMarked","getOutputAt","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","internalContainerRefs","generic_utils.assert","inputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","finishedNodes","nodesInProgress","containerNodes","Container","nodeKey","numInboundLayers","layer_1","nodeIndex_1","tensorIndex_1","reversedNodesInDecreasingDepth_1","previousDepth","inboundNode","previousDepth_1","nodeID","layersByDepth","layerID","depthKeys","parseInt","generic_utils.reverseNumberCompare","depthKeys_1","layersForDepth","aIndex","bIndex","layersForDepth_1","computableTensors","layersWithCompleteInput","depthKeys_2","_l","_o","_m","_q","_p","_s","_r","allNames","numOccurrences","allNames_1","_t","strict","nameToWeight","totalWeightsCount","validatedName","tokens","unsetNames","name_3","theConfig","modelConfig","unused","returnString","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","inputShape_1","shapeKey","depthKeys_3","nodes_1","inputShapes_1","nodeIndex_2","inputShape_2","outputShapes_1","outputShapeKeys","tensorMap","depthKeys_4","nodes_2","referenceInputTensors","referenceOutputTensors","computedData","referenceInputTensors_1","computedTensors","computedMasks","outputTensors_1","outputMasks_1","computedTensor","computedMask","keptNodes","nodeConversionMap","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","addUnprocessedNode","processNode","nodeData_1","inputData","inboundLayerName","inboundNodeIndex","processLayer","layerData","layerName","deserializeLayer","setFastWeightInitDuringBuild","layersFromConfig","layersFromConfig_1","generic_utils.isObjectEmpty","layersFromConfig_2","currentUnprocessedNodesForLayer","currentUnprocessedNodesForLayer_1","inputLayersFromConfig_1","layerOutputTensors","outputLayersFromConfig_1","resetStates","standardizeClassWeights","classWeight","xWeight","weightType","numOutputs","output_1","standardizeSampleOrClassWeights","standardizeWeights","sampleWeight","sampleWeightMode","yClasses","yClassIndices","classSampleWeight_1","classIndex","computeWeightedLoss","sampleWeights","standardizeDataIteratorOutput","iteratorOut","ys","iteratorOutObj","tfc.util","flattenedXs","flattenTensorOrArrayOrMap","flattenedYs","xIndex","yIndex","inputOrOutput","tfc.Tensor","names_1","fitDataset","dataset","hasBatchesPerEpoch","batchesPerEpoch","optimizer","isTraining","validationData","valXs","valYs","isDatasetObject","validationBatches","standardizeTensorValidationData","trainFunction","makeTrainFunction","outLabels","getDedupedMetricsNames","getStepsPerEpoch","history_1","stopTraining_","iterator","dataIterator","epochLogs","stepsDone","batchIndex","batchLogs","standardClassWeights","ins","tfc.dispose","tfc.keep","valOuts","evaluateDataset","batches","evaluate","validationBatchSize","metricsNames","syncData","hasBatches","testFunction","numExamples","tfc.tidy","xsAndYs_1","batchOuts","batchSize_1","batchOut","oldScalar","checkBatchSize","sliceArrays","sliceArraysByIndices","makeBatches","batchStart","fitLoop","valF","valIns","shuffle","validationSteps","checkNumSamples","indexArray","epochIndexArray1D_1","batches_1","batchIds","insBatch","testLoop","fitTensors","standardizeUserData","standardizedOuts","targets","inputValX","inputValY","valStandardized","valX","valY","validationSplit","splitAt","originalBatchSize","valFunction","makeTestFunction","disposeNewTensors","ensureTensorsRank2OrHigher","refTensors","oldTensorIds","oldTensor","isDataArray","isDataDict","isDataTensor","standardizeInputData","checkBatchAxis","exceptionPrefix","gotUnexpectedData","refDim","checkInputData","LayersModel","loss","optimizer_","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","optimizers.getOptimizer","isOptimizerOwned","Optimizer","lossFunctions","theLosses","losses.get","lossFunction_1","name_4","feedOutputShapes","feedLossFns","name_5","skipTargetIndices","metricsTensors","weightedLoss","nestedMetrics","wrappedMetrics","outputMetrics","collectMetrics","metricName","accFn","weightedMetricFn","metric","losses.binaryCrossentropy","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","suffix","metricFn","Metrics.get","Metrics.getLossOrMetricName","metricResult","outputIndex","metricTensor","appendMetric","metrics_1","handleMetrics","standardizeUserDataXY","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","tensorValue","executeOutputs","symbolicTensorNames","outputsRemaining","layerOutputNames","remainingNames_1","outsBatches","xsRank2OrHigher","predictLoop","setX","setY","checkArrayLengths","lossFns","keyLosses","losses.meanSquaredError","losses.categoricalCrossentropy","slicedYShape","slicedShape","targetDim","checkLossAndTargetCompatibility","standardXs","standardYs","standardSampleWeights","classWeights","K.sliceAlongFirstAxis","dedupedOutLabels","newLabel","lossValues","metricsValues","variables","minimize","totalLoss","lossFunction","meanLoss","weightedMetric","regularizerLoss","valOutputs","meanMetric","standardizeOut","losses_1","namedWeights","weightValues","getWeights","numTensorsBeforeOptmizerDisposal","tfc.memory","lossNames","losses_2","outputNames_2","metricsIdentifiers","getLossIdentifiers","getMetricIdentifiers","optimizer_config","class_name","trainingConfig","weighted_metrics","loss_weights","sample_weight_mode","lossEntry","compile","handlerOrURL","handlers","io","getSaveHandlers","encodeWeights","getNamedWeights","weightDataAndSpecs","toJSON","modelArtifacts","modelTopology","format","generatedBy","convertedBy","includeOptimizer","getTrainingConfig","optimizerWeightData","optimizerWeightSpecs","specs","concatenateArrayBuffers","weightData","weightSpecs","Functional","loadLayersModelFromIOHandler","handler","options","load","artifacts","loadTrainingConfig","setUserDefinedMetadata","name2Tensor","decodeWeights","modelWeights","optimizerWeights","group","decodeModelAndOptimizerWeights","loadWeights","Sequential","modelLayer","isLayerModelInstance","checkShape","outputTensor","lastLayerIndex","summary","predict","predictOnBatch","fit","trainOnBatch","configArray","extraModelConfig","configArray_1","stopTraining","Activation","Elu","tfc.elu","K.elu","tfc.selu","tfc.minimum","Linear","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softsign","K.softsign","tfc.tanh","LogSoftmax","tfc.logSoftmax","Swish","Mish","serializeActivation","deserializeActivation","getActivation","assertObjectArgs","l1","l2","hasL1","hasL2","L1L2","regularization","Regularizer","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","ReLU","baseConfig","DEFAULT_ALPHA","LeakyReLU","alphaInitializer","DEFAULT_ALPHA_INITIALIZER","alphaRegularizer","alphaConstraint","sharedAxes","PReLU","paramShape","addWeight","InputSpec","ELU","theta","DEFAULT_THETA","ThresholdedReLU","softmaxActivation","DEFAULT_AXIS","normalizeArray","singleValue","convOutputLength","inputLength","outputLength","deconvLength","strideSize","kernelSize","preprocessConv2DInput","tfc.transpose","preprocessConv3DInput","conv2dWithBiasActivation","BaseConv","verifyArgs","generic_utils.assertPositiveInteger","useBias","biasInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","biasRegularizer","generic_utils.checkArrayTypeAndLength","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","biasValue","fusedActivationName","generic_utils.mapActivationToFusedKernel","tfc.conv1d","K.biasAdd","tfc.conv3d","conv3dWithBias","newSpace","space","newDim","Conv3D","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","tfc.conv2dTranspose","heightAxis","widthAxis","Conv3DTranspose","dAxis","kernelD","strideD","tfc.conv3dTranspose","depthAxis","SeparableConv2D","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","SeparableConv","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","Conv1D","cropping","Cropping2D","hSliced","K.sliceAlongAxis","DEFAULT_SIZE","interpolation","UpSampling2D","resized","DepthwiseConv2D","tfc.depthwiseConv2d","cols","outFilters","outRows","outCols","standardizeArgs","initialState","constants","numConstants","toListOrNull","rnn","stepFunction","initialStates","goBackwards","unroll","needPerStepOutputs","math_utils.range","tfc.expandDims","tfc.reverse","lastOutput","perStepMasks","perStepOutputs","states","timeSteps","perStepInputs","tfc.unstack","currentInput","stepOutputs","maskedOutputs","stepMask","negStepMask","newStates","tfc.stack","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","states_","keptStates","RNN","outputDim","stateShape","stateSize_1","stateMask","numStates","stepInputShape","tfc.zeros","expectedShape","standardized","additionalInputs","additionalSpecs","initialState_1","fullInput","fullInputSpec","originalInputSpec","getInitialState","cellCallKwargs","rnnOutputs","K.expandDims","K.tile","cellConfig","units","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","SimpleRNNCell","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","K.dot","RNNCell","SimpleRNN","resetAfter","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","GRUCell","hTMinus1","z","hh","matrixX","recurrentKernelValue","rk1","rk2","matrixInner","xZ","xR","xH","recurrentZ","recurrentR","recurrentH","GRU","unitForgetBias","LSTMCell","capturedBiasInit_1","capturedUnits_1","CustomInit","bI","bF","bCAndH","K.concatAlongFirstAxis","cTMinus1","z0","z1","z2","z3","LSTM","nestedStates","callInputs","newNestedStates","cellStates","cellConfigs","tuples","numParams","inputWeights","droppedInputs","K.dropout","createMask","K.inTrainPhase","ConvRNN2D","computeSingleOutputShape","getStates","isChannelsFirst","hOut","wOut","ConvLSTM2DCell","recurrentKernelShape","init_1","filters_1","K.concatenate","tfc.ones","applyDropout","xI","xF","xC","xO","recDropoutMask","hI","hF","hC","hO","kernelI","kernelF","kernelC","kernelO","biasI","biasF","biasC","biasO","inputConv","recKernelI","recKernelF","recKernelC","recKernelO","recurrentConv","tfc.conv2d","tslib_1.__assign","ConvLSTM2D","Dropout","invokeCallHook","noiseShape_1","getNoiseShape","SpatialDropout1D","Dense","inputLastDim","Flatten","K.batchFlatten","RepeatVector","targetShape","isUnknown","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","expectedSortedIndices","dimsIncludingBatch","Permute","maskValue","Masking","booleanMask","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","Embedding","embeddings","inLens","s1","s2","K.gather","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","inputs_1","xNDim","mergeFunction","transposed","inputs_2","xTransposed","mathUtils.arrayProd","mathUtils.range","yNDim","yShape","Average","Concatenate","allNoneShape","inputShape_3","shapeSet","shapeWithoutConcatAxis","exists","shapeSet_1","allNullMasks","concatenatedMasks","tfc.all","interpretAxis","normalize","Dot","interpretAxes","x1","x2","axesArray","diffShape","adjX","adjY","idx","squeezeAxes","batchDot","GaussianNoise","GaussianDropout","AlphaDropout","_getNoiseShape","alphaP","keptIdx","batchNormalization","gamma","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","normalizeBatchInTraining","meanAndVariance","tfc.moments","regularNormalizeBatchInTraining","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","broadcastNormalizeBatchInTraining","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","BatchNormalization","movingMean","movingVariance","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","doMovingAverage","variable","decay","origValue","updateDelta","LayerNormalization","nDims","broadcast","momentsTiling","scaleOffsetTiling","heightPadding","widthPadding","ZeroPadding2D","pattern","tfc.pad","pool2d","poolSize","poolMode","paddingString","tfc.maxPool","tfc.avgPool","pool3d","tfc.maxPool3d","tfc.avgPool3d","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","Pooling3D","depths","MaxPooling3D","AveragePooling3D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","timesteps","forwDict","forwardLayer","backDict","backwardLayer","mergeMode","generic_utils.checkStringTypeUnionValue","_trainable","Bidirectional","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","additionalInputs_1","yRev","forwardState","backwardState","rnnLayer","averagePooling1d","averagePooling2d","averagePooling3d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.sparseCategoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","metrics.precision","metrics.recall","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","modelAndWeightsConfig","weightsManifest","pathPrefix","uniqueWeightValues","Callback","currVal","prevVal","restoreBestWeights","monitor","minDelta","patience","baseline","monitorFunc","EarlyStopping","wait","stoppedEpoch","best","current","getMonitorValue","monitorValue","earlyStopping","pathOrIOHandler","getLoadHandlers","browserHTTPRequest","loadLayersModelInternal","registerCallbackConstructor"],"mappings":";;;;;;;;;;;;;;;;sQAmGA,SAASA,EAAkBC,GACvB,MAAM,IAAIC,MAAM,IAAID,6HCuCjB,SAASE,EAAOC,EAAMC,GACzB,IAAKD,EACD,MAAM,IAAIF,MAAqB,iBAARG,EAAmBA,EAAMA,KA4BjD,SAASC,EAAQC,EAAKC,EAAS,GAAIC,GAAiB,GAIvD,GAHc,MAAVD,IACAA,E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iB,EACA9iB,8EAIF,GAHe,MAAXA,IACFA,EAAU,IAEmB,iBAApB8iB,EAA8B,CAEvC,GAAwB,KADlBrkB,EAAWC,KAAGqkB,gBAAgBD,EAAiB9iB,IACxC9vE,OAKXuuE,EAAStuE,KAAKuuE,KAAGskB,mBAAmBF,EAAiB9iB,SAChD,GAAIvB,EAASvuE,OAAS,EAC3B,MAAM,IAAI+uC,GACN,wBAAwBw/B,EAASvuE,OAAjC,4BACQ4yF,OAEdA,EAAkBrkB,EAAS,GAE7B,SAAOqB,GAA6BgjB,OAAiB34C,EAAW61B,UCrBzDijB,CAAwBH,EAAiB9iB,kCArK5B1rD,GACpB,OAAO,IAAIyiD,GAAYziD,uDAmMrBukC,EACAC,GACFF,GAA4BsqC,4BACxBrqC,EAAgBC,4CAvIKn8C,GACzB,OAAO,IAAIikE,GAAWjkE"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js deleted file mode 100644 index 0e4319c7f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js +++ /dev/null @@ -1,36960 +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 tfc = require('@tensorflow/tfjs-core'); - -/** - * @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. - * ============================================================================= - */ -const EPSILON_FLOAT32 = 1e-7; -const EPSILON_FLOAT16 = 1e-4; -/** - * The interface that defines the kernels that should be implemented when - * adding a new backend. New backends don't need to implement every one of the - * methods, this can be done gradually (throw an error for unimplemented - * methods). - */ -class KernelBackend { - refCount(dataId) { - return notYetImplemented('refCount'); - } - incRef(dataId) { - return notYetImplemented('incRef'); - } - timerAvailable() { - return true; - } - time(f) { - return notYetImplemented('time'); - } - read(dataId) { - return notYetImplemented('read'); - } - readSync(dataId) { - return notYetImplemented('readSync'); - } - numDataIds() { - return notYetImplemented('numDataIds'); - } - disposeData(dataId, force) { - return notYetImplemented('disposeData'); - } - write(values, shape, dtype) { - return notYetImplemented('write'); - } - move(dataId, values, shape, dtype, refCount) { - return notYetImplemented('move'); - } - memory() { - return notYetImplemented('memory'); - } - /** Returns the highest precision for floats in bits (e.g. 16 or 32) */ - floatPrecision() { - return notYetImplemented('floatPrecision'); - } - /** Returns the smallest representable number. */ - epsilon() { - return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16; - } - dispose() { - return notYetImplemented('dispose'); - } -} -function notYetImplemented(kernelName) { - throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` + - `This kernel may not be supported by the tfjs backend you have chosen`); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Asserts that the expression is true. Otherwise throws an error with the - * provided message. - * - * ```js - * const x = 2; - * tf.util.assert(x === 2, 'x is not 2'); - * ``` - * - * @param expr The expression to assert (as a boolean). - * @param msg A function that returns the message to report when throwing an - * error. We use a function for performance reasons. - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function assert(expr, msg) { - if (!expr) { - throw new Error(typeof msg === 'string' ? msg : msg()); - } -} -function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') { - assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); -} -// NOTE: We explicitly type out what T extends instead of any so that -// util.flatten on a nested array of number doesn't try to infer T as a -// number[][], causing us to explicitly type util.flatten(). -/** - * Flattens an arbitrarily nested array. - * - * ```js - * const a = [[1, 2], [3, 4], [5, [6, [7]]]]; - * const flat = tf.util.flatten(a); - * console.log(flat); - * ``` - * - * @param arr The nested array to flatten. - * @param result The destination array which holds the elements. - * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults - * to false. - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function flatten(arr, result = [], skipTypedArray = false) { - if (result == null) { - result = []; - } - if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) { - for (let i = 0; i < arr.length; ++i) { - flatten(arr[i], result, skipTypedArray); - } - } - else { - result.push(arr); - } - return result; -} -/** - * Returns the size (number of elements) of the tensor given its shape. - * - * ```js - * const shape = [3, 4, 2]; - * const size = tf.util.sizeFromShape(shape); - * console.log(size); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function sizeFromShape(shape) { - if (shape.length === 0) { - // Scalar. - return 1; - } - let size = shape[0]; - for (let i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; -} -function arraysEqual(n1, n2) { - if (n1 === n2) { - return true; - } - if (n1 == null || n2 == null) { - return false; - } - if (n1.length !== n2.length) { - return false; - } - for (let i = 0; i < n1.length; i++) { - if (n1[i] !== n2[i]) { - return false; - } - } - return true; -} -function isInt(a) { - return a % 1 === 0; -} -function rightPad(a, size) { - if (size <= a.length) { - return a; - } - return a + ' '.repeat(size - a.length); -} -function parseAxisParam(axis, shape) { - const rank = shape.length; - // Normalize input - axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); - // Check for valid range - assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + - `got axis ${axis}`); - // Check for only integers - assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` + - `got axis ${axis}`); - // Handle negative axis. - return axis.map(a => a < 0 ? rank + a : a); -} -/** Reduces the shape by removing all dimensions of shape 1. */ -function squeezeShape(shape, axis) { - const newShape = []; - const keptDims = []; - const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; - const axes = (axis == null || isEmptyArray) ? - null : - parseAxisParam(axis, shape).sort(); - let j = 0; - for (let i = 0; i < shape.length; ++i) { - if (axes != null) { - if (axes[j] === i && shape[i] !== 1) { - throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); - } - if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - if (axes[j] <= i) { - j++; - } - } - if (shape[i] !== 1) { - newShape.push(shape[i]); - keptDims.push(i); - } - } - return { newShape, keptDims }; -} -function checkConversionForErrors(vals, dtype) { - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); - } - } -} -/** Returns true if the dtype is valid. */ -function isValidDtype(dtype) { - return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' || - dtype === 'int32' || dtype === 'string'; -} -function isTypedArray(a) { - return a instanceof Float32Array || a instanceof Int32Array || - a instanceof Uint8Array; -} -function bytesPerElement(dtype) { - if (dtype === 'float32' || dtype === 'int32') { - return 4; - } - else if (dtype === 'complex64') { - return 8; - } - else if (dtype === 'bool') { - return 1; - } - else { - throw new Error(`Unknown dtype ${dtype}`); - } -} -/** - * Returns the approximate number of bytes allocated in the string array - 2 - * bytes per character. Computing the exact bytes for a native string in JS is - * not possible since it depends on the encoding of the html page that serves - * the website. - */ -function bytesFromStringArray(arr) { - if (arr == null) { - return 0; - } - let bytes = 0; - arr.forEach(x => bytes += x.length); - return bytes; -} -/** Returns true if the value is a string. */ -function isString(value) { - return typeof value === 'string' || value instanceof String; -} -function isBoolean(value) { - return typeof value === 'boolean'; -} -function isNumber(value) { - return typeof value === 'number'; -} -function inferDtype(values) { - if (Array.isArray(values)) { - return inferDtype(values[0]); - } - if (values instanceof Float32Array) { - return 'float32'; - } - else if (values instanceof Int32Array || values instanceof Uint8Array) { - return 'int32'; - } - else if (isNumber(values)) { - return 'float32'; - } - else if (isString(values)) { - return 'string'; - } - else if (isBoolean(values)) { - return 'bool'; - } - return 'float32'; -} -function isFunction(f) { - return !!(f && f.constructor && f.call && f.apply); -} -function computeStrides(shape) { - const rank = shape.length; - if (rank < 2) { - return []; - } - // Last dimension has implicit stride of 1, thus having D-1 (instead of D) - // strides. - const strides = new Array(rank - 1); - strides[rank - 2] = shape[rank - 1]; - for (let i = rank - 3; i >= 0; --i) { - strides[i] = strides[i + 1] * shape[i + 1]; - } - return strides; -} -function createNestedArray(offset, shape, a, isComplex = false) { - const ret = new Array(); - if (shape.length === 1) { - const d = shape[0] * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = a[offset + i]; - } - } - else { - const d = shape[0]; - const rest = shape.slice(1); - const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - for (let i = 0; i < d; i++) { - ret[i] = createNestedArray(offset + i * len, rest, a, isComplex); - } - } - return ret; -} -// Provide a nested array of TypedArray in given shape. -function toNestedArray(shape, a, isComplex = false) { - if (shape.length === 0) { - // Scalar type should return a single number. - return a[0]; - } - const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); - if (size === 0) { - // A tensor with shape zero should be turned into empty list. - return []; - } - if (size !== a.length) { - throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`); - } - return createNestedArray(0, shape, a, isComplex); -} -function makeOnesTypedArray(size, dtype) { - const array = makeZerosTypedArray(size, dtype); - for (let i = 0; i < array.length; i++) { - array[i] = 1; - } - return array; -} -function makeZerosTypedArray(size, dtype) { - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(size); - } - else if (dtype === 'int32') { - return new Int32Array(size); - } - else if (dtype === 'bool') { - return new Uint8Array(size); - } - else { - throw new Error(`Unknown data type ${dtype}`); - } -} -function assertNonNegativeIntegerDimensions(shape) { - shape.forEach(dimSize => { - assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` + - `shape [${shape}].`); - }); -} -/** - * This method asserts whether an object is a Promise instance. - * @param object - */ -// tslint:disable-next-line: no-any -function isPromise(object) { - // We chose to not use 'obj instanceOf Promise' for two reasons: - // 1. It only reliably works for es6 Promise, not other Promise - // implementations. - // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch - // the async calls, so it is possible the obj (patched) is comparing to a - // pre-patched Promise. - return object && object.then && typeof object.then === 'function'; -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true. -const TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; -/** - * The environment contains evaluated flags as well as the registered platform. - * This is always used as a global singleton and can be retrieved with - * `tf.env()`. - * - * @doc {heading: 'Environment'} - */ -class Environment { - // tslint:disable-next-line: no-any - constructor(global) { - this.global = global; - this.flags = {}; - this.flagRegistry = {}; - this.urlFlags = {}; - // Jasmine spies on this in 'environment_test.ts' - this.getQueryParams = getQueryParams; - this.populateURLFlags(); - } - setPlatform(platformName, platform) { - if (this.platform != null) { - console.warn(`Platform ${this.platformName} has already been set. ` + - `Overwriting the platform with ${platform}.`); - } - this.platformName = platformName; - this.platform = platform; - } - registerFlag(flagName, evaluationFn, setHook) { - this.flagRegistry[flagName] = { evaluationFn, setHook }; - // Override the flag value from the URL. This has to happen here because the - // environment is initialized before flags get registered. - if (this.urlFlags[flagName] != null) { - const flagValue = this.urlFlags[flagName]; - console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`); - this.set(flagName, flagValue); - } - } - async getAsync(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - this.flags[flagName] = await this.evaluateFlag(flagName); - return this.flags[flagName]; - } - get(flagName) { - if (flagName in this.flags) { - return this.flags[flagName]; - } - const flagValue = this.evaluateFlag(flagName); - if (isPromise(flagValue)) { - throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` + - `Please use getAsync() instead.`); - } - this.flags[flagName] = flagValue; - return this.flags[flagName]; - } - getNumber(flagName) { - return this.get(flagName); - } - getBool(flagName) { - return this.get(flagName); - } - getFlags() { - return this.flags; - } - // For backwards compatibility. - get features() { - return this.flags; - } - set(flagName, value) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); - } - this.flags[flagName] = value; - if (this.flagRegistry[flagName].setHook != null) { - this.flagRegistry[flagName].setHook(value); - } - } - evaluateFlag(flagName) { - if (this.flagRegistry[flagName] == null) { - throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); - } - return this.flagRegistry[flagName].evaluationFn(); - } - setFlags(flags) { - this.flags = Object.assign({}, flags); - } - reset() { - this.flags = {}; - this.urlFlags = {}; - this.populateURLFlags(); - } - populateURLFlags() { - if (typeof this.global === 'undefined' || - typeof this.global.location === 'undefined' || - typeof this.global.location.search === 'undefined') { - return; - } - const urlParams = this.getQueryParams(this.global.location.search); - if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { - const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); - keyValues.forEach(keyValue => { - const [key, value] = keyValue.split(':'); - this.urlFlags[key] = parseValue(key, value); - }); - } - } -} -function getQueryParams(queryString) { - const params = {}; - queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { - decodeParam(params, t[0], t[1]); - return t.join('='); - }); - return params; -} -function decodeParam(params, name, value) { - params[decodeURIComponent(name)] = decodeURIComponent(value || ''); -} -function parseValue(flagName, value) { - value = value.toLowerCase(); - if (value === 'true' || value === 'false') { - return value === 'true'; - } - else if (`${+value}` === value) { - return +value; - } - throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); -} -/** - * Returns the current environment (a global singleton). - * - * The environment object contains the evaluated feature values as well as the - * active platform. - * - * @doc {heading: 'Environment'} - */ -function env() { - return ENV; -} -let ENV = null; -function setEnvironmentGlobal(environment) { - ENV = environment; -} - -/** - * @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. - * ============================================================================= - */ -// Note that the identifier globalNameSpace is scoped to this module, but will -// always resolve to the same global object regardless of how the module is -// resolved. -// tslint:disable-next-line:no-any -let globalNameSpace; -// tslint:disable-next-line:no-any -function getGlobalNamespace() { - if (globalNameSpace == null) { - // tslint:disable-next-line:no-any - let ns; - if (typeof (window) !== 'undefined') { - ns = window; - } - else if (typeof (global) !== 'undefined') { - ns = global; - } - else if (typeof (process) !== 'undefined') { - ns = process; - } - else if (typeof (self) !== 'undefined') { - ns = self; - } - else { - throw new Error('Could not find a global object'); - } - globalNameSpace = ns; - } - return globalNameSpace; -} -// tslint:disable-next-line:no-any -function getGlobalMap() { - const ns = getGlobalNamespace(); - if (ns._tfGlobals == null) { - ns._tfGlobals = new Map(); - } - return ns._tfGlobals; -} -/** - * Returns a globally accessible 'singleton' object. - * - * @param key the name of the object - * @param init a function to initialize to initialize this object - * the first time it is fetched. - */ -function getGlobal(key, init) { - const globalMap = getGlobalMap(); - if (globalMap.has(key)) { - return globalMap.get(key); - } - else { - const singleton = init(); - globalMap.set(key, singleton); - return globalMap.get(key); - } -} - -const Abs = 'Abs'; -const Acos = 'Acos'; -const Acosh = 'Acosh'; -const Add = 'Add'; -const AddN = 'AddN'; -const All = 'All'; -const Any = 'Any'; -const ArgMax = 'ArgMax'; -const ArgMin = 'ArgMin'; -const Asin = 'Asin'; -const Asinh = 'Asinh'; -const Atan = 'Atan'; -const Atanh = 'Atanh'; -const Atan2 = 'Atan2'; -const AvgPool = 'AvgPool'; -const AvgPoolGrad = 'AvgPoolGrad'; -const AvgPool3D = 'AvgPool3D'; -const AvgPool3DGrad = 'AvgPool3DGrad'; -const BatchMatMul = 'BatchMatMul'; -const BatchToSpaceND = 'BatchToSpaceND'; -const BroadcastTo = 'BroadcastTo'; -const Cast = 'Cast'; -const Ceil = 'Ceil'; -const ClipByValue = 'ClipByValue'; -const Complex = 'Complex'; -const ComplexAbs = 'ComplexAbs'; -const Concat = 'Concat'; -const Conv2D = 'Conv2D'; -const Conv2DBackpropFilter = 'Conv2DBackpropFilter'; -const Conv2DBackpropInput = 'Conv2DBackpropInput'; -const Conv3D = 'Conv3D'; -const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2'; -const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2'; -const Cos = 'Cos'; -const Cosh = 'Cosh'; -const Cumsum = 'Cumsum'; -const DepthToSpace = 'DepthToSpace'; -const DepthwiseConv2dNative = 'DepthwiseConv2dNative'; -const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter'; -const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput'; -const Dilation2D = 'Dilation2D'; -const Dilation2DBackpropInput = 'Dilation2DBackpropInput'; -const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter'; -const RealDiv = 'RealDiv'; -const Elu = 'Elu'; -const EluGrad = 'EluGrad'; -const Erf = 'Erf'; -const Equal = 'Equal'; -const Exp = 'Exp'; -const ExpandDims = 'ExpandDims'; -const Expm1 = 'Expm1'; -const FFT = 'FFT'; -const Floor = 'Floor'; -const FloorDiv = 'FloorDiv'; -const FusedBatchNorm = 'FusedBatchNorm'; -const GatherV2 = 'GatherV2'; -const Greater = 'Greater'; -const GreaterEqual = 'GreaterEqual'; -const Identity = 'Identity'; -const IFFT = 'IFFT'; -const Imag = 'Imag'; -const IsFinite = 'IsFinite'; -const IsInf = 'IsInf'; -const IsNan = 'IsNan'; -const LeakyRelu = 'LeakyRelu'; -const Less = 'Less'; -const LessEqual = 'LessEqual'; -const Log = 'Log'; -const Log1p = 'Log1p'; -const LogicalAnd = 'LogicalAnd'; -const LogicalNot = 'LogicalNot'; -const LogicalOr = 'LogicalOr'; -const LogSoftmax = 'LogSoftmax'; -const LRN = 'LRN'; -const LRNGrad = 'LRNGrad'; -const Max = 'Max'; -const Maximum = 'Maximum'; -const MaxPool = 'MaxPool'; -const MaxPoolGrad = 'MaxPoolGrad'; -const MaxPool3D = 'MaxPool3D'; -const MaxPool3DGrad = 'MaxPool3DGrad'; -const Mean = 'Mean'; -const Min = 'Min'; -const Minimum = 'Minimum'; -const MirrorPad = 'MirrorPad'; -const Mod = 'Mod'; -const Multiply = 'Multiply'; -const Neg = 'Neg'; -const NotEqual = 'NotEqual'; -const OnesLike = 'OnesLike'; -const OneHot = 'OneHot'; -const Pack = 'Pack'; -const PadV2 = 'PadV2'; -const Pow = 'Pow'; -const Prelu = 'Prelu'; -const Prod = 'Prod'; -const Real = 'Real'; -const Reciprocal = 'Reciprocal'; -const Relu = 'Relu'; -const Reshape = 'Reshape'; -const ResizeNearestNeighbor = 'ResizeNearestNeighbor'; -const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad'; -const ResizeBilinear = 'ResizeBilinear'; -const ResizeBilinearGrad = 'ResizeBilinearGrad'; -const Relu6 = 'Relu6'; -const Reverse = 'Reverse'; -const Round = 'Round'; -const Rsqrt = 'Rsqrt'; -const Select = 'Select'; -const Selu = 'Selu'; -const Slice = 'Slice'; -const Sin = 'Sin'; -const Sinh = 'Sinh'; -const Sign = 'Sign'; -const Sigmoid = 'Sigmoid'; -const Softplus = 'Softplus'; -const Sqrt = 'Sqrt'; -const Sum = 'Sum'; -const SpaceToBatchND = 'SpaceToBatchND'; -const SplitV = 'SplitV'; -const Softmax = 'Softmax'; -const SquaredDifference = 'SquaredDifference'; -const Square = 'Square'; -const StridedSlice = 'StridedSlice'; -const Sub = 'Sub'; -const Tan = 'Tan'; -const Tanh = 'Tanh'; -const Tile = 'Tile'; -const TopK = 'TopK'; -const Transpose = 'Transpose'; -const Unique = 'Unique'; -const Unpack = 'Unpack'; -const UnsortedSegmentSum = 'UnsortedSegmentSum'; -const ZerosLike = 'ZerosLike'; -/** - * TensorFlow.js-only kernels - */ -const Step = 'Step'; - -/** - * @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. - * ============================================================================= - */ -const kernelRegistry = getGlobal('kernelRegistry', () => new Map()); -const gradRegistry = getGlobal('gradRegistry', () => new Map()); -/** - * Returns the kernel function (code) associated with the provided names. - * - * @param kernelName The official name of the kernel. - * @param backendName The official name of the backend. - */ -function getKernel(kernelName, backendName) { - const key = makeKey(kernelName, backendName); - return kernelRegistry.get(key); -} -/** - * Returns the registered gradient info associated with the provided kernel. - * @param kernelName The official TF kernel name. - */ -function getGradient(kernelName) { - return gradRegistry.get(kernelName); -} -function getKernelsForBackend(backendName) { - const it = kernelRegistry.entries(); - const result = []; - while (true) { - const { done, value } = it.next(); - if (done) { - break; - } - const [key, config] = value; - const [backend,] = key.split('_'); - if (backend === backendName) { - result.push(config); - } - } - return result; -} -/** - * Registers a gradient function for a given kernel in the global registry, - * to be used during the back-propagation of that kernel. - * - * @param config An object with the following properties: - * - `kernelName` The name of the kernel that the gradient function is for. - * - `gradFunc` The function to run during back-propagation. - */ -function registerGradient(config) { - const { kernelName } = config; - if (gradRegistry.has(kernelName)) { - // TODO (yassogba) after 3.0 assess whether we need to keep this gated - // to debug mode. - if (env().getBool('DEBUG')) { - console.warn(`Overriding the gradient for '${kernelName}'`); - } - } - gradRegistry.set(kernelName, config); -} -function makeKey(kernelName, backendName) { - return `${backendName}_${kernelName}`; -} - -/** - * @license - * Copyright 2017 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 noConversionNeeded(a, dtype) { - return (a instanceof Float32Array && dtype === 'float32') || - (a instanceof Int32Array && dtype === 'int32') || - (a instanceof Uint8Array && dtype === 'bool'); -} -function toTypedArray(a, dtype) { - if (dtype === 'string') { - throw new Error('Cannot convert a string[] to a TypedArray'); - } - if (Array.isArray(a)) { - a = flatten(a); - } - if (env().getBool('DEBUG')) { - checkConversionForErrors(a, dtype); - } - if (noConversionNeeded(a, dtype)) { - return a; - } - if (dtype == null || dtype === 'float32' || dtype === 'complex64') { - return new Float32Array(a); - } - else if (dtype === 'int32') { - return new Int32Array(a); - } - else if (dtype === 'bool') { - const bool = new Uint8Array(a.length); - for (let i = 0; i < bool.length; ++i) { - if (Math.round(a[i]) !== 0) { - bool[i] = 1; - } - } - return bool; - } - else { - throw new Error(`Unknown data type ${dtype}`); - } -} -/** - * Returns the current high-resolution time in milliseconds relative to an - * arbitrary time in the past. It works across different platforms (node.js, - * browsers). - * - * ```js - * console.log(tf.util.now()); - * ``` - * - * @doc {heading: 'Util', namespace: 'util'} - */ -function now() { - return env().platform.now(); -} -/** - * Encodes the provided string into bytes using the provided encoding scheme. - * - * @param s The string to encode. - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ -function encodeString(s, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.encode(s, encoding); -} -/** - * Decodes the provided bytes into a string using the provided encoding scheme. - * @param bytes The bytes to decode. - * - * @param encoding The encoding scheme. Defaults to utf-8. - * - * @doc {heading: 'Util'} - */ -function decodeString(bytes, encoding = 'utf-8') { - encoding = encoding || 'utf-8'; - return env().platform.decode(bytes, encoding); -} - -/** - * @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 Profiler { - constructor(backendTimer, logger) { - this.backendTimer = backendTimer; - this.logger = logger; - if (logger == null) { - this.logger = new Logger(); - } - } - profileKernel(kernelName, inputs, f) { - let outputs; - const holdResultWrapperFn = () => { - outputs = f(); - }; - let timer; - const start = now(); - if (this.backendTimer.timerAvailable()) { - timer = this.backendTimer.time(holdResultWrapperFn); - } - else { - holdResultWrapperFn(); - for (const output of outputs) { - output.dataSync(); - } - timer = Promise.resolve({ kernelMs: now() - start }); - } - if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) { - for (let i = 0; i < outputs.length; i++) { - const output = outputs[i]; - // Dangling promise here because we don't want to propagate up - // asynchronicity. - output.data().then(tensorVals => { - checkComputationForErrors(tensorVals, output.dtype, kernelName); - }); - } - } - const kernelProfile = { - kernelName, - outputs, - inputs, - timeMs: timer.then(timing => timing.kernelMs), - extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ? - timing.getExtraProfileInfo() : - '') - }; - return kernelProfile; - } - logKernelProfile(kernelProfile) { - const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile; - outputs.forEach(result => { - Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => { - this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]); - }); - }); - } -} -function checkComputationForErrors(vals, dtype, kernelName) { - if (dtype !== 'float32') { - // Only floating point computations will generate NaN values - return false; - } - for (let i = 0; i < vals.length; i++) { - const num = vals[i]; - if (isNaN(num) || !isFinite(num)) { - // Throwing custom exception so behavior is testable. - console.warn(`Found ${num} in the result of '${kernelName}'`); - return true; - } - } - return false; -} -class Logger { - logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { - const time = typeof timeMs === 'number' ? rightPad(`${timeMs}ms`, 9) : - timeMs['error']; - const paddedName = rightPad(name, 25); - const rank = result.rank; - const size = result.size; - const shape = rightPad(result.shape.toString(), 14); - let inputShapesDescription = ''; - for (const name in inputs) { - const input = inputs[name]; - if (input != null) { - // The input might be a non-tensor (e.g HTMLImageElement), in which case - // we claim the output shape as input shape. - const inputShape = input.shape || result.shape; - const inputRank = inputShape.length; - inputShapesDescription += - `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `; - } - } - console.log(`%c${paddedName}\t%c${time}\t%c${rank}D ${shape}\t%c${size}\t%c${inputShapesDescription}\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue'); - } -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Computes a list of TapeNodes that connect x to y, filtering everything else - * out and preserving the order of the original tape elements. - * - * @param tape The tape elements to filter. - * @param xs The input Tensors. - * @param y The output Tensor. - */ -function getFilteredNodesXToY(tape, xs, y) { - // Forward pass to compute all the nodes and Tensors that are transitively a - // function of x. - const tensorsFromX = {}; - const nodesFromX = {}; - for (let i = 0; i < xs.length; i++) { - tensorsFromX[xs[i].id] = true; - } - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - const nodeInputs = node.inputs; - for (const inputName in nodeInputs) { - const input = nodeInputs[inputName]; - let anyInputFromX = false; - for (let j = 0; j < xs.length; j++) { - if (tensorsFromX[input.id]) { - node.outputs.forEach(output => tensorsFromX[output.id] = true); - anyInputFromX = true; - nodesFromX[node.id] = true; - break; - } - } - if (anyInputFromX) { - break; - } - } - } - // Backward pass to find all of the nodes and Tensors that lead to y. - const tensorsLeadToY = {}; - tensorsLeadToY[y.id] = true; - const nodesToY = {}; - for (let i = tape.length - 1; i >= 0; i--) { - const node = tape[i]; - const nodeInputs = node.inputs; - // If any of the outputs lead to y, mark all of the inputs as leading to y. - for (let j = 0; j < node.outputs.length; j++) { - if (tensorsLeadToY[node.outputs[j].id]) { - for (const inputName in nodeInputs) { - tensorsLeadToY[nodeInputs[inputName].id] = true; - nodesToY[node.id] = true; - } - break; - } - } - } - // Return the paths that come from x and lead to y. - const filteredTape = []; - for (let i = 0; i < tape.length; i++) { - const node = tape[i]; - if (nodesFromX[node.id] && nodesToY[node.id]) { - // Prune the inputs from the node that aren't a function of x. - const prunedInputs = {}; - for (const inputName in node.inputs) { - const nodeInput = node.inputs[inputName]; - if (tensorsFromX[nodeInput.id]) { - prunedInputs[inputName] = nodeInput; - } - } - // Copy the node and overwrite inputsAndArgs to the pruned version. - const prunedNode = Object.assign({}, node); - prunedNode.inputs = prunedInputs; - prunedNode.outputs = node.outputs; - filteredTape.push(prunedNode); - } - } - return filteredTape; -} -/** - * Backpropagate gradients through the filtered TapeNodes. - * - * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map - * is mutated by this method. - * @param filteredTape The filtered TapeNodes to backprop through. - */ -function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) { - // Walk the tape backward and keep a map of Tensor to its gradient. - for (let i = filteredTape.length - 1; i >= 0; i--) { - const node = filteredTape[i]; - const dys = []; - node.outputs.forEach(o => { - const gradTensor = tensorAccumulatedGradientMap[o.id]; - if (gradTensor != null) { - dys.push(gradTensor); - } - else { - // This particular output is not in the back-propagation subgraph, so it - // does not affect the final output, thus we put null for its dy. - dys.push(null); - } - }); - if (node.gradient == null) { - throw new Error(`Cannot compute gradient: gradient function not found ` + - `for ${node.kernelName}.`); - } - // Backprop dy through this node and accumulate gradients over the inputs. - const inputGradients = node.gradient(dys); - for (const inputName in node.inputs) { - if (!(inputName in inputGradients)) { - throw new Error(`Cannot backprop through input ${inputName}. ` + - `Available gradients found: ${Object.keys(inputGradients)}.`); - } - // Call the gradient function. - const dx = tidy(() => inputGradients[inputName]()); - if (dx.dtype !== 'float32') { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); - } - const x = node.inputs[inputName]; - if (!arraysEqual(dx.shape, x.shape)) { - throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + - `'${inputName}' has shape '${dx.shape}', which does not match ` + - `the shape of the input '${x.shape}'`); - } - if (tensorAccumulatedGradientMap[x.id] == null) { - tensorAccumulatedGradientMap[x.id] = dx; - } - else { - const curGradient = tensorAccumulatedGradientMap[x.id]; - tensorAccumulatedGradientMap[x.id] = add(curGradient, dx); - curGradient.dispose(); - } - } - } -} - -/** - * @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. - * ============================================================================= - */ -// Maximum number of values before we decide to show ellipsis. -const FORMAT_LIMIT_NUM_VALS = 20; -// Number of first and last values to show when displaying a, b,...,y, z. -const FORMAT_NUM_FIRST_LAST_VALS = 3; -// Number of significant digits to show. -const FORMAT_NUM_SIG_DIGITS = 7; -function tensorToString(vals, shape, dtype, verbose) { - const strides = computeStrides(shape); - const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides); - const rank = shape.length; - const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol); - const lines = ['Tensor']; - if (verbose) { - lines.push(` dtype: ${dtype}`); - lines.push(` rank: ${rank}`); - lines.push(` shape: [${shape}]`); - lines.push(` values:`); - } - lines.push(valsLines.map(l => ' ' + l).join('\n')); - return lines.join('\n'); -} -function computeMaxSizePerColumn(vals, shape, dtype, strides) { - const n = sizeFromShape(shape); - const numCols = strides[strides.length - 1]; - const padPerCol = new Array(numCols).fill(0); - const rank = shape.length; - const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals; - if (rank > 1) { - for (let row = 0; row < n / numCols; row++) { - const offset = row * numCols; - for (let j = 0; j < numCols; j++) { - padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length); - } - } - } - return padPerCol; -} -function valToString(val, pad, dtype) { - let valStr; - if (Array.isArray(val)) { - valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` + - `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; - } - else if (isString(val)) { - valStr = `'${val}'`; - } - else if (dtype === 'bool') { - valStr = boolNumToString(val); - } - else { - valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); - } - return rightPad(valStr, pad); -} -function boolNumToString(v) { - return v === 0 ? 'false' : 'true'; -} -function subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) { - const storagePerElement = dtype === 'complex64' ? 2 : 1; - const size = shape[0]; - const rank = shape.length; - if (rank === 0) { - if (dtype === 'complex64') { - const complexTuple = createComplexTuples(vals); - return [valToString(complexTuple[0], 0, dtype)]; - } - if (dtype === 'bool') { - return [boolNumToString(vals[0])]; - } - return [vals[0].toString()]; - } - if (rank === 1) { - if (size > FORMAT_LIMIT_NUM_VALS) { - const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement; - let firstVals = Array.from(vals.slice(0, firstValsSize)); - let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement)); - if (dtype === 'complex64') { - firstVals = createComplexTuples(firstVals); - lastVals = createComplexTuples(lastVals); - } - return [ - '[' + - firstVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ', ..., ' + - lastVals - .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype)) - .join(', ') + - ']' - ]; - } - const displayVals = dtype === 'complex64' ? createComplexTuples(vals) : - Array.from(vals); - return [ - '[' + - displayVals.map((x, i) => valToString(x, padPerCol[i], dtype)) - .join(', ') + - ']' - ]; - } - // The array is rank 2 or more. - const subshape = shape.slice(1); - const substrides = strides.slice(1); - const stride = strides[0] * storagePerElement; - const lines = []; - if (size > FORMAT_LIMIT_NUM_VALS) { - for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */)); - } - lines.push('...'); - for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - else { - for (let i = 0; i < size; i++) { - const start = i * stride; - const end = start + stride; - lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); - } - } - const sep = rank === 2 ? ',' : ''; - lines[0] = '[' + lines[0] + sep; - for (let i = 1; i < lines.length - 1; i++) { - lines[i] = ' ' + lines[i] + sep; - } - let newLineSep = ',\n'; - for (let i = 2; i < rank; i++) { - newLineSep += '\n'; - } - lines[lines.length - 1] = - ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); - return lines; -} -function createComplexTuples(vals) { - const complexTuples = []; - for (let i = 0; i < vals.length; i += 2) { - complexTuples.push([vals[i], vals[i + 1]]); - } - return complexTuples; -} - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -// For tracking tensor creation and disposal. -let trackerFn = null; -// Used by chaining methods to call into ops. -let opHandler = null; -/** - * An external consumer can register itself as the tensor tracker. This way - * the Tensor class can notify the tracker for every tensor created and - * disposed. - */ -function setTensorTracker(fn) { - trackerFn = fn; -} -/** - * A `tf.Tensor` object represents an immutable, multidimensional array of - * numbers that has a shape and a data type. - * - * For performance reasons, functions that create tensors do not necessarily - * perform a copy of the data passed to them (e.g. if the data is passed as a - * `Float32Array`), and changes to the data will change the tensor. This is not - * a feature and is not supported. To avoid this behavior, use the tensor before - * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`. - * - * See `tf.tensor` for details on how to create a `tf.Tensor`. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -class Tensor { - constructor(shape, dtype, dataId, id) { - /** Whether this tensor has been globally kept. */ - this.kept = false; - this.isDisposedInternal = false; - this.shape = shape.slice(); - this.dtype = dtype || 'float32'; - this.size = sizeFromShape(shape); - this.strides = computeStrides(shape); - this.dataId = dataId; - this.id = id; - this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); - } - get rank() { - return this.shape.length; - } - /** - * Returns a promise of `tf.TensorBuffer` that holds the underlying data. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async buffer() { - const vals = await this.data(); - return opHandler.buffer(this.shape, this.dtype, vals); - } - /** - * Returns a `tf.TensorBuffer` that holds the underlying data. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - bufferSync() { - return opHandler.buffer(this.shape, this.dtype, this.dataSync()); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * asynchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async array() { - const vals = await this.data(); - return toNestedArray(this.shape, vals, this.dtype === 'complex64'); - } - /** - * Returns the tensor data as a nested array. The transfer of data is done - * synchronously. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - arraySync() { - return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64'); - } - /** - * Asynchronously downloads the values from the `tf.Tensor`. Returns a - * promise of `TypedArray` that resolves when the computation has finished. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - async data() { - this.throwIfDisposed(); - const data = trackerFn().read(this.dataId); - if (this.dtype === 'string') { - const bytes = await data; - try { - return bytes.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** - * Synchronously downloads the values from the `tf.Tensor`. This blocks the - * UI thread until the values are ready, which can cause performance issues. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dataSync() { - this.throwIfDisposed(); - const data = trackerFn().readSync(this.dataId); - if (this.dtype === 'string') { - try { - return data.map(b => decodeString(b)); - } - catch (_a) { - throw new Error('Failed to decode the string bytes into utf-8. ' + - 'To get the original bytes, call tensor.bytes().'); - } - } - return data; - } - /** Returns the underlying bytes of the tensor's data. */ - async bytes() { - this.throwIfDisposed(); - const data = await trackerFn().read(this.dataId); - if (this.dtype === 'string') { - return data; - } - else { - return new Uint8Array(data.buffer); - } - } - /** - * Disposes `tf.Tensor` from memory. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - dispose() { - if (this.isDisposed) { - return; - } - trackerFn().disposeTensor(this); - this.isDisposedInternal = true; - } - get isDisposed() { - return this.isDisposedInternal; - } - throwIfDisposed() { - if (this.isDisposed) { - throw new Error(`Tensor is disposed.`); - } - } - /** - * Prints the `tf.Tensor`. See `tf.print` for details. - * - * @param verbose Whether to print verbose information about the tensor, - * including dtype and size. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - print(verbose = false) { - return opHandler.print(this, verbose); - } - /** - * Returns a copy of the tensor. See `tf.clone` for details. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - clone() { - this.throwIfDisposed(); - return opHandler.clone(this); - } - /** - * Returns a human-readable description of the tensor. Useful for logging. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - toString(verbose = false) { - const vals = this.dataSync(); - return tensorToString(vals, this.shape, this.dtype, verbose); - } - cast(dtype) { - this.throwIfDisposed(); - return opHandler.cast(this, dtype); - } - variable(trainable = true, name, dtype) { - this.throwIfDisposed(); - return trackerFn().makeVariable(this, trainable, name, dtype); - } -} -Object.defineProperty(Tensor, Symbol.hasInstance, { - value: (instance) => { - // Implementation note: we should use properties of the object that will be - // defined before the constructor body has finished executing (methods). - // This is because when this code is transpiled by babel, babel will call - // classCallCheck before the constructor body is run. - // See https://github.com/tensorflow/tfjs/issues/3384 for backstory. - return !!instance && instance.data != null && instance.dataSync != null && - instance.throwIfDisposed != null; - } -}); -function getGlobalTensorClass() { - // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules - // being returned for this file depending on the path they are loaded from. - return getGlobal('Tensor', () => { - return Tensor; - }); -} -// Global side effect. Cache global reference to Tensor class -getGlobalTensorClass(); -/** - * A mutable `tf.Tensor`, useful for persisting state, e.g. for training. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -class Variable extends Tensor { - constructor(initialValue, trainable, name, tensorId) { - super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); - this.trainable = trainable; - this.name = name; - } - /** - * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have - * the same shape and dtype as the old `tf.Tensor`. - * - * @param newValue New tensor to be assigned to this variable. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ - assign(newValue) { - if (newValue.dtype !== this.dtype) { - throw new Error(`dtype of the new value (${newValue.dtype}) and ` + - `previous value (${this.dtype}) must match`); - } - if (!arraysEqual(newValue.shape, this.shape)) { - throw new Error(`shape of the new value (${newValue.shape}) and ` + - `previous value (${this.shape}) must match`); - } - trackerFn().disposeTensor(this); - this.dataId = newValue.dataId; - trackerFn().incRef(this, null /* backend */); - } - dispose() { - trackerFn().disposeVariable(this); - this.isDisposedInternal = true; - } -} -Object.defineProperty(Variable, Symbol.hasInstance, { - value: (instance) => { - return instance instanceof Tensor && instance.assign != null && - instance.assign instanceof Function; - } -}); - -/** - * @license - * Copyright 2017 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 Rank; -(function (Rank) { - Rank["R0"] = "R0"; - Rank["R1"] = "R1"; - Rank["R2"] = "R2"; - Rank["R3"] = "R3"; - Rank["R4"] = "R4"; - Rank["R5"] = "R5"; - Rank["R6"] = "R6"; -})(Rank || (Rank = {})); -// Looks for upcasting types. Used, for example, in operations with mixed dtype -// inputs. -var UpcastInt32AndMap; -(function (UpcastInt32AndMap) { - UpcastInt32AndMap["float32"] = "float32"; - UpcastInt32AndMap["int32"] = "int32"; - UpcastInt32AndMap["bool"] = "int32"; - UpcastInt32AndMap["complex64"] = "complex64"; -})(UpcastInt32AndMap || (UpcastInt32AndMap = {})); -var UpcastBoolAndMap; -(function (UpcastBoolAndMap) { - UpcastBoolAndMap["float32"] = "float32"; - UpcastBoolAndMap["int32"] = "int32"; - UpcastBoolAndMap["bool"] = "bool"; - UpcastBoolAndMap["complex64"] = "complex64"; -})(UpcastBoolAndMap || (UpcastBoolAndMap = {})); -var UpcastFloat32AndMap; -(function (UpcastFloat32AndMap) { - UpcastFloat32AndMap["float32"] = "float32"; - UpcastFloat32AndMap["int32"] = "float32"; - UpcastFloat32AndMap["bool"] = "float32"; - UpcastFloat32AndMap["complex64"] = "complex64"; -})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); -var UpcastComplex64AndMap; -(function (UpcastComplex64AndMap) { - UpcastComplex64AndMap["float32"] = "complex64"; - UpcastComplex64AndMap["int32"] = "complex64"; - UpcastComplex64AndMap["bool"] = "complex64"; - UpcastComplex64AndMap["complex64"] = "complex64"; -})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); -const upcastTypeMap = { - 'float32': UpcastFloat32AndMap, - 'int32': UpcastInt32AndMap, - 'bool': UpcastBoolAndMap, - 'complex64': UpcastComplex64AndMap -}; -function upcastType(typeA, typeB) { - if (typeA === 'string' || typeB === 'string') { - if (typeA === 'string' && typeB === 'string') { - return 'string'; - } - throw new Error(`Can not upcast ${typeA} with ${typeB}`); - } - return upcastTypeMap[typeA][typeB]; -} - -/** - * @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 makeTypesMatch(a, b) { - if (a.dtype === b.dtype) { - return [a, b]; - } - const dtype = upcastType(a.dtype, b.dtype); - return [a.cast(dtype), b.cast(dtype)]; -} -/** - * Extracts any `Tensor`s found within the provided object. - * - * @param container an object that may be a `Tensor` or may directly contain - * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it - * is safe to pass any object here, except that `Promise`s are not - * supported. - * @returns An array of `Tensors` found within the passed object. If the - * argument is simply a `Tensor', a list containing that `Tensor` is - * returned. If the object is not a `Tensor` or does not - * contain `Tensors`, an empty list is returned. - */ -function getTensorsInContainer(result) { - const list = []; - const seen = new Set(); - walkTensorContainer(result, list, seen); - return list; -} -function walkTensorContainer(container, list, seen) { - if (container == null) { - return; - } - if (container instanceof Tensor) { - list.push(container); - return; - } - if (!isIterable(container)) { - return; - } - // Iteration over keys works also for arrays. - const iterable = container; - for (const k in iterable) { - const val = iterable[k]; - if (!seen.has(val)) { - seen.add(val); - walkTensorContainer(val, list, seen); - } - } -} -// tslint:disable-next-line:no-any -function isIterable(obj) { - return Array.isArray(obj) || typeof obj === 'object'; -} - -/** - * @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 isRegisteredKernelInvocation(kernelInvocation) { - return kernelInvocation.kernelName != null; -} -class EngineState { - constructor() { - // Public since optimizers will use it. - this.registeredVariables = {}; - this.nextTapeNodeId = 0; - this.numBytes = 0; - this.numTensors = 0; - this.numStringTensors = 0; - this.numDataBuffers = 0; - // Number of nested tf.grad() statements when computing higher-order - // gradients. E.g. `1` for first-order gradients and `2` for second-order - // gradients. Used to track if the tape should be removed after a backprop. - this.gradientDepth = 0; - // Number of nested kernel calls. When kernel depth is greater than 1, we turn - // off the tape. - this.kernelDepth = 0; - this.scopeStack = []; - /** - * Keeps track of the number of data moves during a kernel execution. We - * maintain a stack since kernels can call other kernels, recursively. - */ - this.numDataMovesStack = []; - this.nextScopeId = 0; - this.tensorInfo = new WeakMap(); - this.profiling = false; - this.activeProfile = { - newBytes: 0, - newTensors: 0, - peakBytes: 0, - kernels: [], - result: null, - get kernelNames() { - return Array.from(new Set(this.kernels.map(k => k.name))); - } - }; - } - dispose() { - for (const variableName in this.registeredVariables) { - this.registeredVariables[variableName].dispose(); - } - } -} -class Engine { - constructor(ENV) { - this.ENV = ENV; - this.registry = {}; - this.registryFactory = {}; - this.pendingBackendInitId = 0; - this.state = new EngineState(); - } - async ready() { - if (this.pendingBackendInit != null) { - return this.pendingBackendInit.then(() => { }); - } - if (this.backendInstance != null) { - return; - } - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const success = await this.initializeBackend(backendName).success; - if (success) { - await this.setBackend(backendName); - return; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - get backend() { - if (this.pendingBackendInit != null) { - throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` + - `sure to await tf.ready() or await tf.setBackend() before calling ` + - `other methods`); - } - if (this.backendInstance == null) { - const { name, asyncInit } = this.initializeBackendsAndReturnBest(); - if (asyncInit) { - throw new Error(`The highest priority backend '${name}' has not yet been ` + - `initialized. Make sure to await tf.ready() or ` + - `await tf.setBackend() before calling other methods`); - } - this.setBackend(name); - } - return this.backendInstance; - } - backendNames() { - return Object.keys(this.registryFactory); - } - findBackend(backendName) { - if (!(backendName in this.registry)) { - // If the backend hasn't been initialized but we have a registry entry for - // it, initialize it and return it. - if (backendName in this.registryFactory) { - const { asyncInit } = this.initializeBackend(backendName); - if (asyncInit) { - // Backend is not ready yet. - return null; - } - } - else { - return null; - } - } - return this.registry[backendName]; - } - findBackendFactory(backendName) { - if (!(backendName in this.registryFactory)) { - return null; - } - return this.registryFactory[backendName].factory; - } - registerBackend(backendName, factory, priority = 1) { - if (backendName in this.registryFactory) { - console.warn(`${backendName} backend was already registered. ` + - `Reusing existing backend factory.`); - return false; - } - this.registryFactory[backendName] = { factory, priority }; - return true; - } - async setBackend(backendName) { - if (this.registryFactory[backendName] == null) { - throw new Error(`Backend name '${backendName}' not found in registry`); - } - this.backendName = backendName; - if (this.registry[backendName] == null) { - this.backendInstance = null; - const { success, asyncInit } = this.initializeBackend(backendName); - const result = asyncInit ? await success : success; - if (!result) { - return false; - } - } - this.backendInstance = this.registry[backendName]; - this.setupRegisteredKernels(); - // Reset the profiler. - this.profiler = new Profiler(this.backendInstance); - return true; - } - setupRegisteredKernels() { - const kernels = getKernelsForBackend(this.backendName); - kernels.forEach(kernel => { - if (kernel.setupFunc != null) { - kernel.setupFunc(this.backendInstance); - } - }); - } - disposeRegisteredKernels(backendName) { - const kernels = getKernelsForBackend(backendName); - kernels.forEach(kernel => { - if (kernel.disposeFunc != null) { - kernel.disposeFunc(this.registry[backendName]); - } - }); - } - /** - * Initializes a backend by looking up the backend name in the factory - * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if - * there is no backend in the factory registry. - */ - initializeBackend(backendName) { - const registryFactoryEntry = this.registryFactory[backendName]; - if (registryFactoryEntry == null) { - throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); - } - try { - const backend = registryFactoryEntry.factory(); - /* Test if the factory returns a promise. - Done in a more liberal way than - previous 'Promise.resolve(backend)===backend' - as we needed to account for custom Promise - implementations (e.g. Angular) */ - if (backend && !(backend instanceof KernelBackend) && - typeof backend.then === 'function') { - const promiseId = ++this.pendingBackendInitId; - const success = backend - .then(backendInstance => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.registry[backendName] = backendInstance; - this.pendingBackendInit = null; - return true; - }) - .catch(err => { - // Outdated promise. Another backend was set in the meantime. - if (promiseId < this.pendingBackendInitId) { - return false; - } - this.pendingBackendInit = null; - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return false; - }); - this.pendingBackendInit = success; - return { success, asyncInit: true }; - } - else { - this.registry[backendName] = backend; - return { success: true, asyncInit: false }; - } - } - catch (err) { - console.warn(`Initialization of backend ${backendName} failed`); - console.warn(err.stack || err.message); - return { success: false, asyncInit: false }; - } - } - removeBackend(backendName) { - if (!(backendName in this.registryFactory)) { - throw new Error(`${backendName} backend not found in registry`); - } - if (this.backendName === backendName && this.pendingBackendInit != null) { - // There is a pending promise of the backend we want to remove. Make it - // obsolete. - this.pendingBackendInitId++; - } - if (backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - delete this.registryFactory[backendName]; - // Unset the backend if it is active. - if (this.backendName === backendName) { - this.pendingBackendInit = null; - this.backendName = null; - this.backendInstance = null; - } - } - getSortedBackends() { - if (Object.keys(this.registryFactory).length === 0) { - throw new Error('No backend found in registry.'); - } - return Object.keys(this.registryFactory).sort((a, b) => { - // Highest priority comes first. - return this.registryFactory[b].priority - - this.registryFactory[a].priority; - }); - } - initializeBackendsAndReturnBest() { - const sortedBackends = this.getSortedBackends(); - for (let i = 0; i < sortedBackends.length; i++) { - const backendName = sortedBackends[i]; - const { success, asyncInit } = this.initializeBackend(backendName); - if (asyncInit || success) { - return { name: backendName, asyncInit }; - } - } - throw new Error(`Could not initialize any backends, all backend initializations ` + - `failed.`); - } - moveData(backend, dataId) { - const info = this.state.tensorInfo.get(dataId); - const srcBackend = info.backend; - const values = this.readSync(dataId); - const refCount = srcBackend.refCount(dataId); - // Delete the tensor from the old backend and move it to the new - // backend. - srcBackend.disposeData(dataId, true); - info.backend = backend; - backend.move(dataId, values, info.shape, info.dtype, refCount); - if (this.shouldCheckForMemLeaks()) { - // Track the number of moves during a kernel execution to correctly - // detect memory leaks. - this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; - } - } - tidy(nameOrFn, fn) { - let name = null; - if (fn == null) { - // Called with only 1 argument. - if (typeof nameOrFn !== 'function') { - throw new Error('Please provide a function to tidy()'); - } - fn = nameOrFn; - } - else { - // Called with 2 arguments. - if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { - throw new Error('When calling with two arguments, the first argument ' + - 'to tidy() must be a string'); - } - if (typeof fn !== 'function') { - throw new Error('When calling with two arguments, the 2nd argument ' + - 'to tidy() must be a function'); - } - name = nameOrFn; - // TODO(nsthorat,smilkov): Do operation logging and performance - // profiling. - } - let result; - return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { - result = fn(); - if (result instanceof Promise) { - console.error('Cannot return a Promise inside of tidy.'); - } - return result; - }); - } - scopedRun(start, end, f) { - start(); - try { - const res = f(); - end(); - return res; - } - catch (ex) { - end(); - throw ex; - } - } - nextTensorId() { - return Engine.nextTensorId++; - } - nextVariableId() { - return Engine.nextVariableId++; - } - /** - * This method is called instead of the public-facing tensor.clone() when - * saving a tensor for backwards pass. It makes sure to add the clone - * operation to the tape regardless of being called inside a kernel - * execution. - */ - clone(x) { - const y = ENGINE.runKernel(Identity, { x }); - const inputs = { x }; - const grad = (dy) => ({ - x: () => { - const dtype = 'float32'; - const gradInputs = { x: dy }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, gradInputs, - // tslint:disable-next-line: no-unnecessary-type-assertion - attrs); - } - }); - const saved = []; - this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {}); - return y; - } - /** - * Execute a kernel with the given name and return the output tensor. - * - * @param kernelName The name of the kernel to execute. - * @param inputs A map of input names to tensors. - * @param attrs A map of attribute names to their values. An attribute is a - * primitive (non-tensor) input to the kernel. - * @param inputsToSave A list of tensors, inputs to save for the backprop - * computation. - * @param outputsToSave A list of booleans, specifying which output to save - * for the backprop computation. These are booleans since the output - * tensors are not visible to the user. - */ - runKernel(kernelName, inputs, attrs) { - const hasKernel = getKernel(kernelName, this.backendName) != null; - if (!hasKernel) { - throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`); - } - return this.runKernelFunc({ kernelName, inputs, attrs }); - } - shouldCheckForMemLeaks() { - return this.ENV.getBool('IS_TEST'); - } - checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { - const numDataIdsAfter = this.backend.numDataIds(); - // Count the number of data ids associated with the result of the kernel. - let numOutputDataIds = 0; - outInfos.forEach(info => { - // Complex numbers allocate 3 data ids, one for 'real', one for - // 'imaginary', and one for the container that holds the former two. - numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1); - }); - // Account for the number of moves during kernel execution. A "data move" - // can happen in the middle of a kernel execution, placing a new (key,value) - // pair in the data storage. Since data moves have net zero effect (we - // always remove the data from the old backend), we have to cancel them out - // when detecting memory leaks. - const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; - const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; - if (dataIdsLeaked > 0) { - throw new Error(`Backend '${this.backendName}' has an internal memory leak ` + - `(${dataIdsLeaked} data ids) after running '${kernelName}'`); - } - } - /** - * Internal helper method to execute a kernel Func - * - * Use `runKernel` to execute kernels from outside of engine. - */ - runKernelFunc(kernelParams) { - let outputs; - let saved = []; - const isTapeOn = this.isTapeOn(); - const startingBytecount = this.state.numBytes; - const startingNumTensors = this.state.numTensors; - if (this.shouldCheckForMemLeaks()) { - this.state.numDataMovesStack.push(0); - } - let kernelFunc; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - let out; - const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ? - kernelParams.kernelName : - this.state.activeScope != null ? this.state.activeScope.name : ''; - // Create the kernelFunc from either a registered kernel OR passed in - // forward/backward functions (used by custom grad). In this context a - // kernelFunc wraps a kernel implementation with some bookkeeping. - if (isRegisteredKernelInvocation(kernelParams)) { - const { kernelName, inputs, attrs } = kernelParams; - if (this.backendName == null) { - // backend has not been initialized yet (backend initialization is lazy - // can be deferred until an op/ kernel is run). - // The below getter has side effects that will try to initialize the - // backend and set properties like this.backendName - // tslint:disable-next-line: no-unused-expression - this.backend; - } - const kernel = getKernel(kernelName, this.backendName); - assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`); - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = kernel.kernelFunc({ inputs, attrs, backend: this.backend }); - const outInfos = Array.isArray(out) ? out : [out]; - if (this.shouldCheckForMemLeaks()) { - this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); - } - const outTensors = outInfos.map((outInfo) => { - // todo (yassogba) remove this option (Tensor) when node backend - // methods have been modularized and they all return tensorInfo. - // TensorInfos do not have a rank attribute. - if (outInfo.rank != null) { - return outInfo; - } - const { dataId, shape, dtype } = outInfo; - return this.makeTensorFromDataId(dataId, shape, dtype); - }); - // Save any required inputs and outputs. - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since there would be no backprop for these tensors - // (which would otherwise dispose them). - if (isTapeOn) { - const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors); - saved = this.saveTensorsForBackwardMode(tensorsToSave); - } - return outTensors; - }; - } - else { - const { forwardFunc } = kernelParams; - // Running a customGrad op. - const saveFunc = (tensors) => { - // Do not save unless we are recording to the tape. Otherwise it would - // cause a mem leak since we would never run backprop, which disposes - // the kept tensors. - if (!isTapeOn) { - return; - } - saved = tensors.map(tensor => this.keep(this.clone(tensor))); - }; - kernelFunc = () => { - const numDataIdsBefore = this.backend.numDataIds(); - out = this.tidy(() => forwardFunc(this.backend, saveFunc)); - const outs = (Array.isArray(out) ? out : [out]); - if (this.shouldCheckForMemLeaks()) { - // Scope name is used to print a more helpful error message if needed. - this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs); - } - return outs; - }; - } - // - // Run the kernelFunc. Optionally profiling it. - // - const { inputs, attrs } = kernelParams; - const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ? - null : - kernelParams.backwardsFunc; - let kernelProfile; - this.scopedRun( - // Stop recording to a tape when running a kernel. - () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { - if (!this.ENV.getBool('DEBUG') && !this.state.profiling) { - outputs = kernelFunc(); - } - else { - kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc()); - if (this.ENV.getBool('DEBUG')) { - this.profiler.logKernelProfile(kernelProfile); - } - outputs = kernelProfile.outputs; - } - }); - if (isTapeOn) { - this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs); - } - if (this.state.profiling) { - this.state.activeProfile.kernels.push({ - name: kernelOrScopeName, - bytesAdded: this.state.numBytes - startingBytecount, - totalBytesSnapshot: this.state.numBytes, - tensorsAdded: this.state.numTensors - startingNumTensors, - totalTensorsSnapshot: this.state.numTensors, - inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null), - outputShapes: outputs.map(item => item.shape), - kernelTimeMs: kernelProfile.timeMs, - extraInfo: kernelProfile.extraInfo - }); - } - return (Array.isArray(out) ? outputs : outputs[0]); - } - /** - * Saves tensors used in forward mode for use in backward mode. - * - * @param tensors the list of tensors to save. - */ - saveTensorsForBackwardMode(tensors) { - const saved = tensors.map(tensor => this.keep(this.clone(tensor))); - return saved; - } - /** - * Returns a list of tensors to save for a given gradient calculation. - * - * @param kernelName name of kernel to look up gradient for. - * @param inputs a map of input tensors. - * @param outputs an array of output tensors from forward mode of kernel. - */ - getTensorsForGradient(kernelName, inputs, outputs) { - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - const inputsToSave = gradConfig.inputsToSave || []; - const outputsToSave = gradConfig.outputsToSave || []; - // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs - // specified in inputsToSave will be saved. - let inputTensorsToSave; - if (gradConfig.saveAllInputs) { - assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.'); - inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); - } - else { - inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); - } - const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); - return inputTensorsToSave.concat(outputTensorsToSave); - } - // We return an empty list rather than throw an error because the kernel we - // are looking up may not actually be relevant to backproping through the - // overall function - // - // See 'does not error if irrelevant (pruned) ops are missing grads' test - // in gradients_test.ts for an example. - return []; - } - /** - * Internal method used by public APIs for tensor creation. Makes a new - * tensor with the provided shape, dtype and values. It always - * creates a new data id and writes the values to the underlying backend. - */ - makeTensor(values, shape, dtype, backend) { - if (values == null) { - throw new Error('Values passed to engine.makeTensor() are null'); - } - dtype = dtype || 'float32'; - backend = backend || this.backend; - let backendVals = values; - if (dtype === 'string' && isString(values[0])) { - backendVals = values.map(d => encodeString(d)); - } - const dataId = backend.write(backendVals, shape, dtype); - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - // Count bytes for string tensors. - if (dtype === 'string') { - const info = this.state.tensorInfo.get(dataId); - const newBytes = bytesFromStringArray(backendVals); - this.state.numBytes += newBytes - info.bytes; - info.bytes = newBytes; - } - return t; - } - /** - * Internal method used by backends. Makes a new tensor - * that is a wrapper around an existing data id. It doesn't create - * a new data id, only increments the ref count used in memory tracking. - */ - makeTensorFromDataId(dataId, shape, dtype, backend) { - dtype = dtype || 'float32'; - const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); - this.trackTensor(t, backend); - return t; - } - makeVariable(initialValue, trainable = true, name, dtype) { - name = name || this.nextVariableId().toString(); - if (dtype != null && dtype !== initialValue.dtype) { - initialValue = initialValue.cast(dtype); - } - const v = new Variable(initialValue, trainable, name, this.nextTensorId()); - if (this.state.registeredVariables[v.name] != null) { - throw new Error(`Variable with name ${v.name} was already registered`); - } - this.state.registeredVariables[v.name] = v; - this.incRef(v, this.backend); - return v; - } - trackTensor(a, backend) { - this.state.numTensors++; - if (a.dtype === 'string') { - this.state.numStringTensors++; - } - // Bytes for complex numbers are counted by their components. Bytes for - // string tensors are counted when writing values. - let bytes = 0; - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - bytes = a.size * bytesPerElement(a.dtype); - } - this.state.numBytes += bytes; - if (!this.state.tensorInfo.has(a.dataId)) { - this.state.numDataBuffers++; - this.state.tensorInfo.set(a.dataId, { - backend: backend || this.backend, - dtype: a.dtype, - shape: a.shape, - bytes - }); - } - if (!(a instanceof Variable)) { - this.track(a); - } - } - // Track the tensor by dataId and increase the refCount for the dataId in the - // backend. - // TODO(pyu10055): This is currently used by makeVariable method, to increase - // refCount on the backend for the dataId. It can potentially be replaced with - // Identity op indead of calling backend directly. - incRef(a, backend) { - this.trackTensor(a, backend); - this.backend.incRef(a.dataId); - } - removeDataId(dataId, backend) { - if (this.state.tensorInfo.has(dataId) && - this.state.tensorInfo.get(dataId).backend === backend) { - this.state.tensorInfo.delete(dataId); - this.state.numDataBuffers--; - } - } - disposeTensor(a) { - if (!this.state.tensorInfo.has(a.dataId)) { - return; - } - const info = this.state.tensorInfo.get(a.dataId); - this.state.numTensors--; - if (a.dtype === 'string') { - this.state.numStringTensors--; - this.state.numBytes -= info.bytes; - } - // Don't count bytes for complex numbers as they are counted by their - // components. - if (a.dtype !== 'complex64' && a.dtype !== 'string') { - const bytes = a.size * bytesPerElement(a.dtype); - this.state.numBytes -= bytes; - } - // Remove the reference to dataId if backend dispose the data successfully - if (info.backend.disposeData(a.dataId)) { - this.removeDataId(a.dataId, info.backend); - } - // TODO(nsthorat): Construct an error and save the stack trace for - // debugging when in debug mode. Creating a stack trace is too expensive - // to do unconditionally. - } - disposeVariables() { - for (const varName in this.state.registeredVariables) { - const v = this.state.registeredVariables[varName]; - this.disposeVariable(v); - } - } - disposeVariable(v) { - this.disposeTensor(v); - if (this.state.registeredVariables[v.name] != null) { - delete this.state.registeredVariables[v.name]; - } - } - memory() { - const info = this.backend.memory(); - info.numTensors = this.state.numTensors; - info.numDataBuffers = this.state.numDataBuffers; - info.numBytes = this.state.numBytes; - if (this.state.numStringTensors > 0) { - info.unreliable = true; - if (info.reasons == null) { - info.reasons = []; - } - info.reasons.push('Memory usage by string tensors is approximate ' + - '(2 bytes per character)'); - } - return info; - } - async profile(query) { - this.state.profiling = true; - const startBytes = this.state.numBytes; - const startNumTensors = this.state.numTensors; - this.state.activeProfile.kernels = []; - this.state.activeProfile.result = await query(); - this.state.profiling = false; - this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot)); - this.state.activeProfile.newBytes = this.state.numBytes - startBytes; - this.state.activeProfile.newTensors = - this.state.numTensors - startNumTensors; - for (const kernel of this.state.activeProfile.kernels) { - kernel.kernelTimeMs = await kernel.kernelTimeMs; - kernel.extraInfo = await kernel.extraInfo; - } - return this.state.activeProfile; - } - isTapeOn() { - return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; - } - addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { - const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; - const gradConfig = getGradient(kernelName); - if (gradConfig != null) { - gradientsFunc = gradConfig.gradFunc; - } - if (gradientsFunc != null) { - tapeNode.gradient = (dys) => { - // TODO(smilkov): To optimize back-prop, pass dys that are not used in - // the backprop graph to the user as null instead of zeros - dys = dys.map((dy, i) => { - if (dy == null) { - const output = outputs[i]; - const vals = makeZerosTypedArray(output.size, output.dtype); - return this.makeTensor(vals, output.shape, output.dtype); - } - return dy; - }); - // Grad functions of ops with single outputs expect a dy, while ops - // with multiple outputs expect dys (array of dy). - return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); - }; - } - this.state.activeTape.push(tapeNode); - } - keep(result) { - result.kept = true; - return result; - } - startTape() { - if (this.state.gradientDepth === 0) { - this.state.activeTape = []; - } - this.state.gradientDepth++; - } - endTape() { - this.state.gradientDepth--; - } - /** - * Start a scope. Use this with endScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - startScope(name) { - const scopeInfo = { - track: [], - name: 'unnamed scope', - id: this.state.nextScopeId++ - }; - if (name) { - scopeInfo.name = name; - } - this.state.scopeStack.push(scopeInfo); - this.state.activeScope = scopeInfo; - } - /** - * End a scope. Use this with startScope() to achieve the same functionality - * as scope() without the need for a function closure. - */ - endScope(result) { - const tensorsToTrackInParent = getTensorsInContainer(result); - const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id)); - // Dispose the arrays tracked in this scope. - for (let i = 0; i < this.state.activeScope.track.length; i++) { - const tensor = this.state.activeScope.track[i]; - if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) { - tensor.dispose(); - } - } - const oldScope = this.state.scopeStack.pop(); - this.state.activeScope = this.state.scopeStack.length === 0 ? - null : - this.state.scopeStack[this.state.scopeStack.length - 1]; - // Track the current result in the parent scope. - tensorsToTrackInParent.forEach(tensor => { - // Only track the tensor if was allocated in the inner scope and is not - // globally kept. - if (!tensor.kept && tensor.scopeId === oldScope.id) { - this.track(tensor); - } - }); - } - /** - * Returns gradients of `f` with respect to each of the `xs`. The gradients - * returned are of the same length as `xs`, but some might be null if `f` - * was not a function of that `x`. It also takes optional dy to multiply the - * gradient, which defaults to `1`. - */ - gradients(f, xs, dy, allowNoGradients = false) { - assert(xs.length > 0, () => 'gradients() received an empty list of xs.'); - if (dy != null && dy.dtype !== 'float32') { - throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); - } - const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f)); - assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.'); - // Filter out the nodes that don't connect x => y. - const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y); - if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { - throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + - 'that the f you passed encloses all operations that lead from x ' + - 'to y.'); - } - return this.tidy('backward', () => { - const accumulatedGradientMap = {}; - accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; - // Backprop gradients through the filtered nodes. - backpropagateGradients(accumulatedGradientMap, filteredTape, - // Pass the tidy function to avoid circular dep with `tape.ts`. - f => this.tidy(f), - // Pass an add function to avoide a circular dep with `tape.ts`. - add); - const grads = xs.map(x => accumulatedGradientMap[x.id]); - if (this.state.gradientDepth === 0) { - // This means that we are not computing higher-order gradients - // and can clean up the tape. - this.state.activeTape.forEach(node => { - for (const tensor of node.saved) { - tensor.dispose(); - } - }); - this.state.activeTape = null; - } - return { value: y, grads }; - }); - } - customGrad(f) { - assert(isFunction(f), () => 'The f passed in customGrad(f) must be a function.'); - return (...inputs) => { - assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' + - 'tensors'); - let res; - const inputMap = {}; - inputs.forEach((input, i) => { - inputMap[i] = input; - }); - const forwardFunc = (_, save) => { - res = f(...[...inputs, save]); - assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.value` is a tensor'); - assert(isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function.'); - return res.value; - }; - const backwardsFunc = (dy, saved) => { - const gradRes = res.gradFunc(dy, saved); - const grads = Array.isArray(gradRes) ? gradRes : [gradRes]; - assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'the same number of tensors as inputs passed to f(...).'); - assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' + - 'object where `obj.gradFunc` is a function that returns ' + - 'a list of only tensors.'); - const gradMap = {}; - grads.forEach((grad, i) => { - gradMap[i] = () => grad; - }); - return gradMap; - }; - return this.runKernelFunc({ - forwardFunc, - backwardsFunc, - inputs: inputMap, - }); - }; - } - readSync(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.readSync(dataId); - } - read(dataId) { - // Route the read to the correct backend. - const info = this.state.tensorInfo.get(dataId); - return info.backend.read(dataId); - } - async time(query) { - const start = now(); - const timingInfo = await this.backend.time(query); - timingInfo.wallMs = now() - start; - return timingInfo; - } - /** - * Tracks a Tensor in the current scope to be automatically cleaned up - * when the current scope ends, and returns the value. - * - * @param result The Tensor to track in the current scope. - */ - track(result) { - if (this.state.activeScope != null) { - result.scopeId = this.state.activeScope.id; - this.state.activeScope.track.push(result); - } - return result; - } - get registeredVariables() { - return this.state.registeredVariables; - } - /** - * Resets the engine state. Removes all backends but does not remove - * registered backend factories. - */ - reset() { - // Make any pending promise obsolete. - this.pendingBackendInitId++; - this.state.dispose(); - this.ENV.reset(); - this.state = new EngineState(); - for (const backendName in this.registry) { - this.disposeRegisteredKernels(backendName); - this.registry[backendName].dispose(); - delete this.registry[backendName]; - } - this.backendName = null; - this.backendInstance = null; - this.pendingBackendInit = null; - } -} -Engine.nextTensorId = 0; -Engine.nextVariableId = 0; -function ones(shape) { - const values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); - return ENGINE.makeTensor(values, shape, 'float32'); -} -function getOrMakeEngine() { - const ns = getGlobalNamespace(); - if (ns._tfengine == null) { - const environment = new Environment(ns); - ns._tfengine = new Engine(environment); - } - setEnvironmentGlobal(ns._tfengine.ENV); - // Tell the current tensor interface that the global engine is responsible - // for tracking. - setTensorTracker(() => ns._tfengine); - return ns._tfengine; -} -const ENGINE = getOrMakeEngine(); -/** - * A implementation of the add op for use within engine and tape. - * - * This allows us to avoid a circular dependency between add.ts and engine. - * It is exported to be available in tape tests. - */ -function add(a, b) { - // We duplicate Add here to avoid a circular dependency with add.ts. - const inputs = { a, b }; - return ENGINE.runKernel(Add, inputs); -} - -/** - * @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 inferShape(val, dtype) { - let firstElem = val; - if (isTypedArray(val)) { - return dtype === 'string' ? [] : [val.length]; - } - if (!Array.isArray(val)) { - return []; // Scalar. - } - const shape = []; - while (Array.isArray(firstElem) || - isTypedArray(firstElem) && dtype !== 'string') { - shape.push(firstElem.length); - firstElem = firstElem[0]; - } - if (Array.isArray(val) && - env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) { - deepAssertShapeConsistency(val, shape, []); - } - return shape; -} -function deepAssertShapeConsistency(val, shape, indices) { - indices = indices || []; - if (!(Array.isArray(val)) && !isTypedArray(val)) { - assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` + - `but should be an array/TypedArray of ${shape[0]} elements`); - return; - } - assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` + - `but is an array of ${val.length} elements`); - assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` + - `elements, but has ${val.length} elements`); - const subShape = shape.slice(1); - for (let i = 0; i < val.length; ++i) { - deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); - } -} -function assertDtype(expectedDtype, actualDType, argName, functionName) { - if (expectedDtype === 'string_or_numeric') { - return; - } - if (expectedDtype == null) { - throw new Error(`Expected dtype cannot be null.`); - } - if (expectedDtype !== 'numeric' && expectedDtype !== actualDType || - expectedDtype === 'numeric' && actualDType === 'string') { - throw new Error(`Argument '${argName}' passed to '${functionName}' must ` + - `be ${expectedDtype} tensor, but got ${actualDType} tensor`); - } -} -function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') { - if (x instanceof Tensor) { - assertDtype(parseAsDtype, x.dtype, argName, functionName); - return x; - } - let inferredDtype = inferDtype(x); - // If the user expects a bool/int/float, use that info to update the - // inferredDtype when it is not a string. - if (inferredDtype !== 'string' && - ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) { - inferredDtype = parseAsDtype; - } - assertDtype(parseAsDtype, inferredDtype, argName, functionName); - if ((x == null) || - (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && - typeof x !== 'boolean' && typeof x !== 'string')) { - const type = x == null ? 'null' : x.constructor.name; - throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` + - `Tensor or TensorLike, but got '${type}'`); - } - const inferredShape = inferShape(x, inferredDtype); - if (!isTypedArray(x) && !Array.isArray(x)) { - x = [x]; - } - const skipTypedArray = true; - const values = inferredDtype !== 'string' ? - toTypedArray(x, inferredDtype) : - flatten(x, [], skipTypedArray); - return ENGINE.makeTensor(values, inferredShape, inferredDtype); -} -function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') { - if (!Array.isArray(arg)) { - throw new Error(`Argument ${argName} passed to ${functionName} must be a ` + - '`Tensor[]` or `TensorLike[]`'); - } - const tensors = arg; - return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype)); -} - -/** - * @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 OP_SCOPE_SUFFIX = '__op'; -/** - * Used for wrapping functions that perform math operations on - * Tensors. The function will be wrapped in a named scope that cleans all - * memory usage after the function is done. - */ -function op(f) { - const keys = Object.keys(f); - if (keys.length !== 1) { - throw new Error(`Please provide an object with a single key ` + - `(operation name) mapping to a function. Got an object with ` + - `${keys.length} keys.`); - } - let opName = keys[0]; - const fn = f[opName]; - // Strip the underscore from the end of the function name. - if (opName.endsWith('_')) { - opName = opName.substring(0, opName.length - 1); - } - // add an __op suffix to distinguish ops from kernels in tf.profile - opName = opName + OP_SCOPE_SUFFIX; - // tslint:disable-next-line:no-any - const f2 = (...args) => { - ENGINE.startScope(opName); - try { - const result = fn(...args); - if (isPromise(result)) { - console.error('Cannot return a Promise inside of tidy.'); - } - ENGINE.endScope(result); - return result; - } - catch (ex) { - ENGINE.endScope(null); - throw ex; - } - }; - Object.defineProperty(f2, 'name', { value: opName, configurable: true }); - // tslint:disable-next-line:no-any - return f2; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes absolute value element-wise: `abs(x)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.abs().print(); // or tf.abs(x) - * ``` - * @param x The input `tf.Tensor`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function abs_(x) { - const $x = convertToTensor(x, 'x', 'abs'); - if ($x.dtype === 'complex64') { - const inputs = { x: $x }; - return ENGINE.runKernel(ComplexAbs, inputs); - } - else { - const inputs = { x: $x }; - return ENGINE.runKernel(Abs, inputs); - } -} -const abs = op({ abs_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes acos of the input `tf.Tensor` element-wise: `acos(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.acos().print(); // or tf.acos(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function acos_(x) { - const $x = convertToTensor(x, 'x', 'acos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acos, inputs); -} -const acos = op({ acos_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise: - * `acosh(x)` - * - * ```js - * const x = tf.tensor1d([10, 1, 3, 5.7]); - * - * x.acosh().print(); // or tf.acosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function acosh_(x) { - const $x = convertToTensor(x, 'x', 'acosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Acosh, inputs); -} -const acosh = op({ acosh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting. - * - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * - * ```js - * // Broadcast add a with b. - * const a = tf.scalar(5); - * const b = tf.tensor1d([10, 20, 30, 40]); - * - * a.add(b).print(); // or tf.add(a, b) - * ``` - * @param a The first `tf.Tensor` to add. - * @param b The second `tf.Tensor` to add. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function add_(a, b) { - let $a = convertToTensor(a, 'a', 'add'); - let $b = convertToTensor(b, 'b', 'add'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Add, inputs); -} -const add$1 = op({ add_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the logical and of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.all().print(); // or tf.all(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.all(axis).print(); // or tf.all(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function all_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'all', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(All, inputs, attrs); -} -const all = op({ all_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the logical or of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 1, 1], 'bool'); - * - * x.any().print(); // or tf.any(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); - * - * const axis = 1; - * x.any(axis).print(); // or tf.any(x, axis) - * ``` - * - * @param x The input tensor. Must be of dtype bool. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function any_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'any', 'bool'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Any, inputs, attrs); -} -// tslint:disable-next-line:variable-name -const any = op({ any_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Returns the indices of the maximum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMax().print(); // or tf.argMax(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMax(axis).print(); // or tf.argMax(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function argMax_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMax'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMax, inputs, attrs); -} -const argMax = op({ argMax_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Returns the indices of the minimum values along an `axis`. - * - * The result has the same shape as `input` with the dimension along `axis` - * removed. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.argMin().print(); // or tf.argMin(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); - * - * const axis = 1; - * x.argMin(axis).print(); // or tf.argMin(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function argMin_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'argMin'); - const inputs = { x: $x }; - const attrs = { axis }; - return ENGINE.runKernel(ArgMin, inputs, attrs); -} -const argMin = op({ argMin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes asin of the input `tf.Tensor` element-wise: `asin(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asin().print(); // or tf.asin(x) - * ``` - * @param x The input tensor. - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function asin_(x) { - const $x = convertToTensor(x, 'x', 'asin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asin, inputs); -} -const asin = op({ asin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise: - * `asinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.asinh().print(); // or tf.asinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function asinh_(x) { - const $x = convertToTensor(x, 'x', 'asinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Asinh, inputs); -} -const asinh = op({ asinh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes atan of the input `tf.Tensor` element-wise: `atan(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.atan().print(); // or tf.atan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atan_(x) { - const $x = convertToTensor(x, 'x', 'atan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atan, inputs); -} -const atan = op({ atan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]); - * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]); - * - * tf.atan2(a, b).print() - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atan2_(a, b) { - let $a = convertToTensor(a, 'a', 'atan2'); - let $b = convertToTensor(b, 'b', 'atan2'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Atan2, inputs); -} -const atan2 = op({ atan2_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise: - * `atanh(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.atanh().print(); // or tf.atanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function atanh_(x) { - const $x = convertToTensor(x, 'x', 'atanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Atanh, inputs); -} -const atanh = op({ atanh_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Casts a `tf.Tensor` to a new dtype. - * - * ```js - * const x = tf.tensor1d([1.5, 2.5, 3]); - * tf.cast(x, 'int32').print(); - * ``` - * @param x The input tensor to be casted. - * @param dtype The dtype to cast the input tensor to. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function cast_(x, dtype) { - const $x = convertToTensor(x, 'x', 'cast'); - // Sanity checks. - if (!isValidDtype(dtype)) { - throw new Error(`Failed to cast to unknown dtype ${dtype}`); - } - if (dtype === 'string' && $x.dtype !== 'string' || - dtype !== 'string' && $x.dtype === 'string') { - throw new Error('Only strings can be casted to strings'); - } - const inputs = { x: $x }; - const attrs = { dtype }; - return ENGINE.runKernel(Cast, inputs, attrs); -} -const cast = op({ cast_ }); - -/** - * @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. - * ============================================================================= - */ -function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') { - const [filterHeight, filterWidth] = parseTupleParam(filterSize); - let filterShape; - if (dataFormat === 'channelsLast') { - filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; - } - else if (dataFormat === 'channelsFirst') { - filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); -} -/** - * Computes the information for a forward pass of a convolution/pooling - * operation. - */ -function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') { - let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; - if (dataFormat === 'channelsLast') { - [batchSize, inHeight, inWidth, inChannels] = inShape; - } - else if (dataFormat === 'channelsFirst') { - [batchSize, inChannels, inHeight, inWidth] = inShape; - } - else { - throw new Error(`Unknown dataFormat ${dataFormat}`); - } - const [filterHeight, filterWidth, , filterChannels] = filterShape; - const [strideHeight, strideWidth] = parseTupleParam(strides); - const [dilationHeight, dilationWidth] = parseTupleParam(dilations); - const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); - const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); - const outChannels = depthwise ? filterChannels * inChannels : filterChannels; - let outShape; - if (dataFormat === 'channelsFirst') { - outShape = [batchSize, outChannels, outHeight, outWidth]; - } - else if (dataFormat === 'channelsLast') { - outShape = [batchSize, outHeight, outWidth, outChannels]; - } - return { - batchSize, - dataFormat, - inHeight, - inWidth, - inChannels, - outHeight, - outWidth, - outChannels, - padInfo, - strideHeight, - strideWidth, - filterHeight, - filterWidth, - effectiveFilterHeight, - effectiveFilterWidth, - dilationHeight, - dilationWidth, - inShape, - outShape, - filterShape - }; -} -function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) { - if (zeroPad == null) { - zeroPad = computeDefaultPad(inShape, fieldSize, stride); - } - const inputRows = inShape[0]; - const inputCols = inShape[1]; - const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); - return [outputRows, outputCols]; -} -function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) { - const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); - return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); -} -function parseTupleParam(param) { - if (typeof param === 'number') { - return [param, param, param]; - } - if (param.length === 2) { - return [param[0], param[1], 1]; - } - return param; -} -/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d - * Atrous convolution is equivalent to standard convolution with upsampled - * filters with effective_filter_height = - * filter_height + (filter_height - 1) * (dilation - 1) - * and effective_filter_width = - * filter_width + (filter_width - 1) * (dilation - 1), - * produced by inserting dilation - 1 zeros along consecutive elements across - * the filters' spatial dimensions. - * When there is a dilation, this converts a filter dimension to the - * effective filter dimension, so it can be used in a standard convolution. - */ -function getEffectiveFilterSize(filterSize, dilation) { - if (dilation <= 1) { - return filterSize; - } - return filterSize + (filterSize - 1) * (dilation - 1); -} -function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { - let padInfo; - let outHeight; - let outWidth; - if (typeof pad === 'number') { - const padType = (pad === 0) ? 'VALID' : 'NUMBER'; - padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; - const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode); - outHeight = outShape[0]; - outWidth = outShape[1]; - } - else if (pad === 'same') { - outHeight = Math.ceil(inHeight / strideHeight); - outWidth = Math.ceil(inWidth / strideWidth); - const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); - const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); - const top = Math.floor(padAlongHeight / 2); - const bottom = padAlongHeight - top; - const left = Math.floor(padAlongWidth / 2); - const right = padAlongWidth - left; - padInfo = { top, bottom, left, right, type: 'SAME' }; - } - else if (pad === 'valid') { - padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; - outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); - outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); - } - else if (typeof pad === 'object') { - const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0]; - const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1]; - const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0]; - const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1]; - const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ? - 'VALID' : - 'EXPLICIT'; - padInfo = { top, bottom, left, right, type: padType }; - outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); - outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); - } - else { - throw Error(`Unknown padding parameter: ${pad}`); - } - return { padInfo, outHeight, outWidth }; -} -/** - * Rounds a value depending on the rounding mode - * @param value - * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function round(value, roundingMode) { - if (!roundingMode) { - return Math.trunc(value); - } - switch (roundingMode) { - case 'round': - // used for Caffe Conv - return Math.round(value); - case 'ceil': - // used for Caffe Pool - return Math.ceil(value); - case 'floor': - return Math.floor(value); - default: - throw new Error(`Unknown roundingMode ${roundingMode}`); - } -} -function tupleValuesAreOne(param) { - const [dimA, dimB, dimC] = parseTupleParam(param); - return dimA === 1 && dimB === 1 && dimC === 1; -} -function eitherStridesOrDilationsAreOne(strides, dilations) { - return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Reshapes a `tf.Tensor` to a given shape. - * - * Given an input tensor, returns a new tensor with the same values as the - * input tensor with shape `shape`. - * - * If one component of shape is the special value -1, the size of that - * dimension is computed so that the total size remains constant. In - * particular, a shape of [-1] flattens into 1-D. At most one component of - * shape can be -1. - * - * If shape is 1-D or higher, then the operation returns a tensor with shape - * shape filled with the values of tensor. In this case, the number of - * elements implied by shape must be the same as the number of elements in - * tensor. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.reshape([2, 2]).print(); - * ``` - * - * @param x The input tensor to be reshaped. - * @param shape An array of integers defining the output tensor shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function reshape_(x, shape) { - const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric'); - const inputs = { x: $x }; - const attrs = { shape }; - return ENGINE.runKernel(Reshape, inputs, attrs); -} -const reshape = op({ reshape_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the 2D average pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'avgPool', 'float32'); - const dilations = 1; - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - let res = ENGINE.runKernel(AvgPool, inputs, attrs); - res = cast(res, $x.dtype); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const avgPool = op({ avgPool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a new tensor with the same values and shape as the specified - * tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * - * x.clone().print(); - * ``` - * - * @param x The tensor to clone. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function clone_(x) { - const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric'); - const inputs = { x: $x }; - // Note this op is called tf.identity in python. Hence the kernel name used - // here. - return ENGINE.runKernel(Identity, inputs); -} -const clone = op({ clone_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Concatenates a list of `tf.Tensor`s along a given axis. - * - * The tensors ranks and types must match, and their sizes must match in all - * dimensions except `axis`. - * - * Also available are stricter rank-specific methods that assert that - * `tensors` are of the given rank: - * - `tf.concat1d` - * - `tf.concat2d` - * - `tf.concat3d` - * - `tf.concat4d` - * - * Except `tf.concat1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * a.concat(b).print(); // or a.concat(b) - * ``` - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.concat([a, b, c]).print(); - * ``` - * - * ```js - * const a = tf.tensor2d([[1, 2], [10, 20]]); - * const b = tf.tensor2d([[3, 4], [30, 40]]); - * const axis = 1; - * tf.concat([a, b], axis).print(); - * ``` - * @param tensors A list of tensors to concatenate. - * @param axis The axis to concate along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function concat_(tensors, axis = 0) { - assert(tensors.length >= 1, () => 'Pass at least one tensor to concat'); - const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric'); - if ($tensors[0].dtype === 'complex64') { - $tensors.forEach(tensor => { - if (tensor.dtype !== 'complex64') { - throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${tensor.dtype}. `); - } - }); - } - if ($tensors.length === 1) { - return clone($tensors[0]); - } - const inputs = $tensors; - const attr = { axis }; - return ENGINE.runKernel(Concat, inputs, attr); -} -const concat = op({ concat_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the dot product of two matrices, A * B. These must be matrices. - * - * ```js - * const a = tf.tensor2d([1, 2], [1, 2]); - * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.matMul(b).print(); // or tf.matMul(a, b) - * ``` - * @param a First matrix in dot product operation. - * @param b Second matrix in dot product operation. - * @param transposeA If true, `a` is transposed before multiplication. - * @param transposeB If true, `b` is transposed before multiplication. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function matMul_(a, b, transposeA = false, transposeB = false) { - let $a = convertToTensor(a, 'a', 'matMul'); - let $b = convertToTensor(b, 'b', 'matMul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - const attrs = { transposeA, transposeB }; - return ENGINE.runKernel(BatchMatMul, inputs, attrs); -} -const matMul = op({ matMul_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting. - * - * We also expose `tf.mulStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.tensor1d([2, 3, 4, 5]); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * - * ```js - * // Broadcast mul a with b. - * const a = tf.tensor1d([1, 2, 3, 4]); - * const b = tf.scalar(5); - * - * a.mul(b).print(); // or tf.mul(a, b) - * ``` - * @param a The first tensor to multiply. - * @param b The second tensor to multiply. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function mul_(a, b) { - let $a = convertToTensor(a, 'a', 'mul'); - let $b = convertToTensor(b, 'b', 'mul'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Multiply, inputs); -} -const mul = op({ mul_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes sigmoid element-wise, `1 / (1 + exp(-x))` - * - * ```js - * const x = tf.tensor1d([0, -1, 2, -3]); - * - * x.sigmoid().print(); // or tf.sigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sigmoid_(x) { - const $x = convertToTensor(x, 'x', 'sigmoid'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sigmoid, inputs); -} -const sigmoid = op({ sigmoid_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Extracts a slice from a `tf.Tensor` starting at coordinates `begin` - * and is of size `size`. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `x` is of the given rank: - * - `tf.slice1d` - * - `tf.slice2d` - * - `tf.slice3d` - * - `tf.slice4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.slice([1], [2]).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * x.slice([1, 0], [1, 2]).print(); - * ``` - * @param x The input `tf.Tensor` to slice from. - * @param begin The coordinates to start the slice from. The length can be - * less than the rank of x - the rest of the axes will have implicit 0 as - * start. Can also be a single number, in which case it specifies the - * first axis. - * @param size The size of the slice. The length can be less than the rank of - * x - the rest of the axes will have implicit -1. A value of -1 requests - * the rest of the dimensions in the axis. Can also be a single number, - * in which case it specifies the size of the first axis. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function slice_(x, begin, size) { - const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric'); - if ($x.rank === 0) { - throw new Error('Slicing scalar is not possible'); - } - const inputs = { x: $x }; - const attrs = { begin, size }; - return ENGINE.runKernel(Slice, inputs, attrs); -} -const slice = op({ slice_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, 70]); - * - * x.tanh().print(); // or tf.tanh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function tanh_(x) { - const $x = convertToTensor(x, 'x', 'tanh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tanh, inputs); -} -const tanh = op({ tanh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of - * shape `blockShape + [batch]`, interleaves these blocks back into the grid - * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with - * the same rank as the input. The spatial dimensions of this intermediate - * result are then optionally cropped according to `crops` to produce the - * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise - * description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); - * const blockShape = [2, 2]; - * const crops = [[0, 0], [0, 0]]; - * - * x.batchToSpaceND(blockShape, crops).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required - * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]` - * - * This operation is equivalent to the following steps: - * - * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ..., - * blockShape[M-1], batch / prod(blockShape), x.shape[1], ..., - * x.shape[N-1]]` - * - * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch / - * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M], - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch / - * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] * - * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` - * - * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted` - * according to `crops` to produce the output of shape: `[batch / - * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1], - * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] - - * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function batchToSpaceND_(x, blockShape, crops) { - const $x = convertToTensor(x, 'x', 'batchToSpaceND'); - const prod = blockShape.reduce((a, b) => a * b); - assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); - assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); - assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` + - `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`); - const inputs = { x: $x }; - const attrs = { blockShape, crops }; - return ENGINE.runKernel(BatchToSpaceND, inputs, attrs); -} -const batchToSpaceND = op({ batchToSpaceND_ }); - -function xAs4D(x) { - let x4D; - if (x.rank === 0 || x.rank === 1) { - x4D = reshape(x, [1, 1, 1, x.size]); - } - else if (x.rank === 2) { - x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]); - } - else if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - else { - x4D = x; - } - return x4D; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Batch normalization. - * - * As described in - * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167). - * - * Mean, variance, scale, and offset can be of two shapes: - * - The same shape as the input. - * - In the common case, the depth dimension is the last dimension of x, so - * the values would be an `tf.Tensor1D` of shape [depth]. - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that parameters passed are of given rank - * - `tf.batchNorm2d` - * - `tf.batchNorm3d` - * - `tf.batchNorm4d` - * - * @param x The input Tensor. - * @param mean A mean Tensor. - * @param variance A variance Tensor. - * @param offset An offset Tensor. - * @param scale A scale Tensor. - * @param varianceEpsilon A small float number to avoid dividing by 0. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) { - if (varianceEpsilon == null) { - varianceEpsilon = 0.001; - } - const $x = convertToTensor(x, 'x', 'batchNorm'); - const $mean = convertToTensor(mean, 'mean', 'batchNorm'); - const $variance = convertToTensor(variance, 'variance', 'batchNorm'); - let $scale; - if (scale != null) { - $scale = convertToTensor(scale, 'scale', 'batchNorm'); - } - let $offset; - if (offset != null) { - $offset = convertToTensor(offset, 'offset', 'batchNorm'); - } - assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' + - 'equal ranks.'); - assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' + - 'equal ranks.'); - assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' + - 'equal ranks.'); - const x4D = xAs4D($x); - const inputs = { - x: x4D, - scale: $scale, - offset: $offset, - mean: $mean, - variance: $variance - }; - const attrs = { varianceEpsilon }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs); - return reshape(res, $x.shape); -} -const batchNorm = op({ batchNorm_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Broadcast an array to a compatible shape NumPy-style. - * - * The tensor's shape is compared to the broadcast shape from end to beginning. - * Ones are prepended to the tensor's shape until is has the same length as - * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is - * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then - * the input tensor is tiled N times along that axis (using tf.tile). - * - * @param input The tensor that is to be broadcasted. - * @param shape The input is to be broadcast to this shape. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function broadcastTo_(x, shape) { - let input = convertToTensor(x, 'broadcastTo', 'x'); - const xShape = input.shape; - if (shape.some(d => !(d > 0) || d % 1 !== 0)) { - throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); - } - if (shape.length < input.rank) { - throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`); - } - if (shape.length > input.rank) { - const newShape = input.shape.slice(); - while (newShape.length < shape.length) { - newShape.unshift(1); - } - input = reshape(input, newShape); - } - const inputShape = input.shape; - const reps = Array.from(shape); - for (let i = shape.length - 1; i >= 0; i--) { - if (inputShape[i] === shape[i]) { - reps[i] = 1; - } - else if (input.shape[i] !== 1) { - throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); - } - } - const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0); - if (axes.length === 0) { - return clone(input); - } - // TODO call broadcastTo kernel directly once backends implement broadcstTo - const inputs = { x: input }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); -} -const broadcastTo = op({ broadcastTo_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)` - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.ceil().print(); // or tf.ceil(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function ceil_(x) { - const $x = convertToTensor(x, 'x', 'ceil'); - const inputs = { x: $x }; - return ENGINE.runKernel(Ceil, inputs); -} -const ceil = op({ ceil_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) - * ``` - * @param x The input tensor. - * @param clipValueMin Lower-bound of range to be clipped to. - * @param clipValueMax Upper-bound of range to be clipped to. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function clipByValue_(x, clipValueMin, clipValueMax) { - const $x = convertToTensor(x, 'x', 'clipByValue'); - assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` + - `less than or equal to max (${clipValueMax}).`); - const inputs = { x: $x }; - const attrs = { clipValueMin, clipValueMax }; - return ENGINE.runKernel(ClipByValue, inputs, attrs); -} -const clipByValue = op({ clipByValue_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Converts two real numbers to a complex number. - * - * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], - * where r represents the real part and i represents the imag part. - * - * The input tensors real and imag must have the same shape. - * - * ```js - * const real = tf.tensor1d([2.25, 3.25]); - * const imag = tf.tensor1d([4.75, 5.75]); - * const complex = tf.complex(real, imag); - * - * complex.print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function complex_(real, imag) { - const $real = convertToTensor(real, 'real', 'complex'); - const $imag = convertToTensor(imag, 'imag', 'complex'); - assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` + - `must match in call to tf.complex().`); - const inputs = { real: $real, imag: $imag }; - return ENGINE.runKernel(Complex, inputs); -} -const complex = op({ complex_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes a 2D convolution over the input x. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2d'); - const $filter = convertToTensor(filter, 'filter', 'conv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` + - `input depth for filter ${$filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const conv2d = op({ conv2d_ }); - -/** - * Computes a 1D convolution over the input x. - * - * @param x The input tensor, of rank 3 or rank 2, of shape - * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed. - * @param filter The filter, rank 3, of shape - * `[filterWidth, inDepth, outDepth]`. - * @param stride The number of entries by which the filter is moved right at - * each step. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat An optional string from "NWC", "NCW". Defaults to "NWC", - * the data is stored in the order of [batch, in_width, in_channels]. Only - * "NWC" is currently supported. - * @param dilation The dilation rate in which we sample input values in - * atrous convolution. Defaults to `1`. If it is greater than 1, then - * stride must be `1`. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv1d'); - const $filter = convertToTensor(filter, 'filter', 'conv1d'); - let x3D = $x; - let reshapedTo3D = false; - if ($x.rank === 2) { - reshapedTo3D = true; - x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]); - } - assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); - assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` + - `input depth for filter ${$filter.shape[1]}.`); - assert(eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' + - `Got stride ${stride} and dilation '${dilation}'`); - assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`); - const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]); - const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]); - const strides = [1, stride]; - const dilations = [1, dilation]; - const conv2dDataFormat = 'NHWC'; - const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); - if (reshapedTo3D) { - return reshape(res, [res.shape[2], res.shape[3]]); - } - return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]); -} -const conv1d = op({ conv1d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the input of a 2D convolution. - * - * @param xShape The shape of the input: [batch, height, width, inDepth]. - * If length of 3, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 4 or rank 3 of shape - * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape4D = xShape; - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - xShape4D = [1, xShape[0], xShape[1], xShape[2]]; - } - assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` + - `${xShape4D.length}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` + - `rank ${dy4D.rank}`); - assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` + - `rank ${filter.rank}`); - const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[2]}.`); - assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[3]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const conv2DBackpropInput = op({ conv2DBackpropInput_ }); - -/** - * Computes the transposed 2D convolution of an image, also known as a - * deconvolution. - * - * @param x The input image, of rank 4 or rank 3, of shape - * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed. - * @param filter The filter, rank 4, of shape - * `[filterHeight, filterWidth, outDepth, inDepth]`. - * `inDepth` must match `inDepth` in `x`. - * @param outputShape Output shape, of rank 4 or rank 3: - * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed. - * @param strides The strides of the original convolution: - * `[strideHeight, strideWidth]`. - * @param pad The type of padding algorithm used in the non-transpose version - * of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'conv2dTranspose'); - const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose'); - return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode); -} -const conv2dTranspose = op({ conv2dTranspose_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the input of a 3D convolution. - * - * @param xShape The shape of the input: [batch, depth, height, width, - * in_channels]. If length of 4, batch of 1 is assumed. - * @param dy The derivative of the output, of rank 5 or rank 4 of shape - * `[batch, outDepth, outHeight, outWidth, in_channels]`. - * If rank 4, batch of 1 is assumed. - * @param filter The filter, rank 5, of shape - * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`. - * @param strides The strides of the convolution: `[strideDepth, strideHeight, - * strideWidth]`. - * @param pad The type of padding algorithm used: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - */ -function conv3DBackpropInput_(xShape, dy, filter, strides, pad) { - assert(xShape.length === dy.rank, () => `Length of inShape ` + - `(${xShape.length}) and rank of dy (${dy.rank}) must match`); - let xShape5D = xShape; - let dy5D = dy; - let reshapedTo5D = false; - if (dy.rank === 4) { - reshapedTo5D = true; - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; - } - const inDepth = xShape5D[4]; - const outDepth = dy5D.shape[4]; - assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` + - `${xShape5D.length}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` + - `rank ${dy5D.rank}`); - assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` + - `rank ${filter.rank}`); - assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` + - `match input depth for filter ${filter.shape[3]}.`); - assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` + - `match output depth for filter ${filter.shape[4]}.`); - const inputs = { dy: dy5D, filter }; - const attrs = { pad, strides, inputShape: xShape5D }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const conv3DBackpropInput = op({ conv3DBackpropInput_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes cos of the input `tf.Tensor` element-wise: `cos(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.cos().print(); // or tf.cos(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function cos_(x) { - const $x = convertToTensor(x, 'x', 'cos'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cos, inputs); -} -const cos = op({ cos_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.cosh().print(); // or tf.cosh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function cosh_(x) { - const $x = convertToTensor(x, 'x', 'cosh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Cosh, inputs); -} -const cosh = op({ cosh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the cumulative sum of a `tf.Tensor` along `axis`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4]); - * x.cumsum().print(); - * ``` - * ```js - * const x = tf.tensor([[1, 2], [3, 4]]); - * x.cumsum().print(); - * ``` - * - * @param x The input tensor to be summed. - * @param axis The axis along which to sum. Optional. Defaults to 0. - * @param exclusive Whether to perform exclusive cumulative sum. Optional. - * Defaults to false. If set to true then the sum of each tensor entry - * does not include its own value, but only the values previous to it - * along the specified axis. - * @param reverse Whether to sum in the opposite direction. Optional. - * Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Scan'} - */ -function cumsum_(x, axis = 0, exclusive = false, reverse = false) { - const $x = convertToTensor(x, 'x', 'cumsum'); - const inputs = { x: $x }; - const attrs = { axis, exclusive, reverse }; - return ENGINE.runKernel(Cumsum, inputs, attrs); -} -const cumsum = op({ cumsum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Rearranges data from depth into blocks of spatial data. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `blockSize` indicates the input block size and how the data is - * moved. - * - * - Chunks of data of size `blockSize * blockSize` from depth are rearranged - * into non-overlapping blocks of size `blockSize x blockSize` - * - * - The width the output tensor is `inputWidth * blockSize`, whereas the - * height is `inputHeight * blockSize` - * - * - The Y, X coordinates within each block of the output image are determined - * by the high order component of the input channel index - * - * - The depth of the input tensor must be divisible by `blockSize * - * blockSize` - * - * The `dataFormat` attr specifies the layout of the input and output tensors - * with the following options: "NHWC": [ `batch, height, width, channels` ] - * "NCHW": [ `batch, channels, height, width` ] - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]); - * const blockSize = 2; - * const dataFormat = "NHWC"; - * - * tf.depthToSpace(x, blockSize, dataFormat).print(); - * ``` - * - * @param x The input tensor of rank 4 - * @param blockSIze An `int` that is `>= 2`. The size of the spatial block - * @param dataFormat An optional string from: "NHWC", "NCHW". Defaults to "NHWC" - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function depthToSpace_(x, blockSize, dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'depthToSpace'); - const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2]; - const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3]; - const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1]; - assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputHeight} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying - ${inputWidth} and ${blockSize} for depthToSpace with input shape - ${$x.shape}`); - assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); - const inputs = { x: $x }; - const attrs = { blockSize, dataFormat }; - return ENGINE.runKernel(DepthToSpace, inputs, attrs); -} -const depthToSpace = op({ depthToSpace_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Depthwise 2D convolution. - * - * Given a 4D `input` array and a `filter` array of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing - * `inChannels` convolutional filters of depth 1, this op applies a - * different filter to each input channel (expanding from 1 channel to - * `channelMultiplier` channels for each), then concatenates the results - * together. The output has `inChannels * channelMultiplier` channels. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param filter The filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'depthwiseConv2d'); - const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` + - `${$filter.rank}.`); - assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` + - `(${x4D.shape[3]}) must match the inChannels dimension in ` + - `filter ${$filter.shape[2]}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const depthwiseConv2d = op({ depthwiseConv2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the grayscale dilation over the input `x`. - * - * @param x The input tensor, rank 3 or rank 4 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filter The filter tensor, rank 3, of shape - * `[filterHeight, filterWidth, depth]`. - * @param strides The strides of the sliding window for each dimension of the - * input tensor: `[strideHeight, strideWidth]`. - * If `strides` is a single number, - * then `strideHeight == strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1*1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dataFormat Specify the data format of the input and output data. - * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations` - * is a single number, then `dilationHeight == dilationWidth`. If it is - * greater than 1, then all values of `strides` must be 1. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'dilation2d'); - const $filter = convertToTensor(filter, 'filter', 'dilation2d'); - assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` + - `${$x.rank}.`); - assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` + - `${$filter.rank}.`); - assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` + - `but got dataFormat of ${dataFormat}`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - reshapedTo4D = true; - } - const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad, dilations }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(Dilation2D, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const dilation2d = op({ dilation2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * The result is rounded with floor function. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.floorDiv(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.floorDiv(b).print(); // or tf.floorDiv(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function floorDiv_(a, b) { - let $a = convertToTensor(a, 'a', 'floorDiv'); - let $b = convertToTensor(b, 'b', 'floorDiv'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(FloorDiv, inputs); -} -const floorDiv = op({ floorDiv_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function div_(a, b) { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'int32' && $b.dtype === 'int32') { - return floorDiv($a, $b); - } - const inputs = { a: $a, b: $b }; - const attrs = {}; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(RealDiv, inputs, attrs); -} -const div = op({ div_ }); - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Returns the axes in the output space that should be reduced to produce - * the input space. - */ -function getReductionAxes(inShape, outShape) { - const result = []; - for (let i = 0; i < outShape.length; i++) { - const inDim = inShape[inShape.length - i - 1]; - const outAxis = outShape.length - i - 1; - const outDim = outShape[outAxis]; - if (inDim == null || (inDim === 1 && outDim > 1)) { - result.unshift(outAxis); - } - } - return result; -} -function assertAndGetBroadcastShape(shapeA, shapeB) { - const result = []; - const l = Math.max(shapeA.length, shapeB.length); - for (let i = 0; i < l; i++) { - let a = shapeA[shapeA.length - i - 1]; - if (a == null) { - a = 1; - } - let b = shapeB[shapeB.length - i - 1]; - if (b == null) { - b = 1; - } - if (a === 1) { - result.unshift(b); - } - else if (b === 1) { - result.unshift(a); - } - else if (a !== b) { - const errMsg = `Operands could not be broadcast together with shapes ` + - `${shapeA} and ${shapeB}.`; - throw Error(errMsg); - } - else { - result.unshift(a); - } - } - return result; -} - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a == b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.equal(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function equal_(a, b) { - let $a = convertToTensor(a, 'a', 'equal'); - let $b = convertToTensor(b, 'b', 'equal'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Equal, inputs); -} -const equal = op({ equal_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the elements, either `a` or `b` depending on the `condition`. - * - * If the condition is true, select from `a`, otherwise select from `b`. - * - * ```js - * const cond = tf.tensor1d([false, false, true], 'bool'); - * const a = tf.tensor1d([1 , 2, 3]); - * const b = tf.tensor1d([-1, -2, -3]); - * - * a.where(cond, b).print(); - * ``` - * - * @param condition The input condition. Must be of dtype bool. - * @param a If `condition` is rank 1, `a` may have a higher rank but - * its first dimension must match the size of `condition`. - * @param b A tensor with the same dtype as `a` and with shape that is - * compatible with `a`. - * @return A tensor with same dtype as `a` and `b`, and shape that is - * broadcastable from `a` and `b`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function where_(condition, a, b) { - const $a = convertToTensor(a, 'a', 'where'); - const $b = convertToTensor(b, 'b', '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); - const $broadcastedA = broadcastTo($a, broadcastShape); - const $broadcastedB = broadcastTo($b, broadcastShape); - const inputs = { - condition: $broadcastedCondition, - t: $broadcastedA, - e: $broadcastedB - }; - return ENGINE.runKernel(Select, inputs); -} -const where = op({ where_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.zerosLike(x).print(); - * ``` - * - * @param x The tensor of required shape. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function zerosLike_(x) { - const $x = convertToTensor(x, 'x', 'zerosLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(ZerosLike, inputs); -} -const zerosLike = op({ zerosLike_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 - * if denominator is 0. - * - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * const c = tf.tensor1d([0, 0, 0, 0]); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * const c = tf.scalar(0); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function divNoNan_(a, b) { - // TODO: Make this into its own kernel. - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - const divResult = div($a, $b); - const zeros = zerosLike(divResult); - const bEqualsZero = equal($b, zeros); - return where(bEqualsZero, zeros, divResult); -} -const divNoNan = op({ divNoNan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the dot product of two matrices and/or vectors, `t1` and `t2`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor2d([[1, 2], [3, 4]]); - * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * - * a.dot(b).print(); // or tf.dot(a, b) - * b.dot(a).print(); - * b.dot(c).print(); - * ``` - * @param t1 The first tensor in the dot operation. - * @param t2 The second tensor in the dot operation. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function dot_(t1, t2) { - const $t1 = convertToTensor(t1, 't1', 'dot'); - const $t2 = convertToTensor(t2, 't2', 'dot'); - assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` + - `${$t1.rank} and ${$t2.rank}.`); - const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); - const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); - assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` + - `${t1Inner} and ${t2Inner}.`); - if ($t1.rank === 1 && $t2.rank === 1) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, []); - } - else if ($t1.rank === 1 && $t2.rank === 2) { - const t12D = reshape($t1, [1, -1]); - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul(t12D, t22D); - return reshape(t1t2, [t1t2.size]); - } - else if ($t1.rank === 2 && $t2.rank === 1) { - const t22D = reshape($t2, [-1, 1]); - const t1t2 = matMul($t1, t22D); - return reshape(t1t2, [t1t2.size]); - } - else { - const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]); - const t1t2 = matMul($t1, t22D); - return t1t2; - } -} -const dot = op({ dot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`. - * - * ```js - * const x = tf.tensor1d([-1, 1, -3, 2]); - * - * x.elu().print(); // or tf.elu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function elu_(x) { - const $x = convertToTensor(x, 'x', 'elu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Elu, inputs); -} -const elu = op({ elu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes gause error function of the input `tf.Tensor` element-wise: - * `erf(x)` - * - * ```js - * const x = tf.tensor1d([0, .1, -.1, .7]); - * - * x.erf().print(); // or tf.erf(x); - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function erf_(x) { - let $x = convertToTensor(x, 'x', 'erf'); - assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.'); - if ($x.dtype === 'int32') { - $x = cast($x, 'float32'); - } - const inputs = { x: $x }; - return ENGINE.runKernel(Erf, inputs); -} -const erf = op({ erf_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.exp().print(); // or tf.exp(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function exp_(x) { - const $x = convertToTensor(x, 'x', 'exp'); - const inputs = { x: $x }; - return ENGINE.runKernel(Exp, inputs); -} -const exp = op({ exp_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension - * into the tensor's shape. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const axis = 1; - * x.expandDims(axis).print(); - * ``` - * - * @param x The input tensor whose dimensions to be expanded. - * @param axis The dimension index at which to insert shape of `1`. Defaults - * to 0 (the first dimension). - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function expandDims_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric'); - assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor'); - const inputs = { input: $x }; - const attrs = { dim: axis }; - return ENGINE.runKernel(ExpandDims, inputs, attrs); -} -const expandDims = op({ expandDims_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes exponential of the input `tf.Tensor` minus one element-wise. - * `e ^ x - 1` - * - * ```js - * const x = tf.tensor1d([1, 2, -3]); - * - * x.expm1().print(); // or tf.expm1(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function expm1_(x) { - const $x = convertToTensor(x, 'x', 'expm1'); - const inputs = { x: $x }; - return ENGINE.runKernel(Expm1, inputs); -} -const expm1 = op({ expm1_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Construct a tensor by repeating it the number of times given by reps. - * - * This operation creates a new tensor by replicating `input` `reps` - * times. The output tensor's i'th dimension has `input.shape[i] * - * reps[i]` elements, and the values of `input` are replicated - * `reps[i]` times along the i'th dimension. For example, tiling - * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * - * a.tile([2]).print(); // or a.tile([2]) - * ``` - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * a.tile([1, 2]).print(); // or a.tile([1, 2]) - * ``` - * @param x The tensor to tile. - * @param reps Determines the number of replications per dimension. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function tile_(x, reps) { - const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric'); - assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of reps ${reps}.`); - const inputs = { x: $x }; - const attrs = { reps }; - return ENGINE.runKernel(Tile, inputs, attrs); -} -const tile = op({ tile_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes floor of input `tf.Tensor` element-wise: `floor(x)`. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.floor().print(); // or tf.floor(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function floor_(x) { - const $x = convertToTensor(x, 'x', 'floor'); - const inputs = { x: $x }; - return ENGINE.runKernel(Floor, inputs); -} -const floor = op({ floor_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Gather slices from tensor `x`'s axis `axis` according to `indices`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const indices = tf.tensor1d([1, 3, 3], 'int32'); - * - * x.gather(indices).print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const indices = tf.tensor1d([1, 1, 0], 'int32'); - * - * x.gather(indices).print(); - * ``` - * @param x The input tensor whose slices to be gathered. - * @param indices The indices of the values to extract. - * @param axis The axis over which to select values. Defaults to 0. - * @param batchDims Optional. The number of batch dimensions. It must be less - * than or equal to rank(indices). Defaults to 0. - * The output tensor will have shape of - * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]` - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function gather_(x, indices, axis = 0, batchDims = 0) { - const $x = convertToTensor(x, 'x', 'gather'); - const $indices = convertToTensor(indices, 'indices', 'gather', 'int32'); - const inputs = { x: $x, indices: $indices }; - const attrs = { axis, batchDims }; - return ENGINE.runKernel(GatherV2, inputs, attrs); -} -const gather = op({ gather_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a > b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greater(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function greater_(a, b) { - let $a = convertToTensor(a, 'a', 'greater'); - let $b = convertToTensor(b, 'b', 'greater'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Greater, inputs); -} -const greater = op({ greater_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a >= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.greaterEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function greaterEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'greaterEqual'); - let $b = convertToTensor(b, 'b', 'greaterEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(GreaterEqual, inputs); -} -const greaterEqual = op({ greaterEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the imaginary part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the imaginary part of each element in input considered as a complex number. - * If input is real, a tensor of all zeros is returned. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.imag(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function imag_(input) { - const $input = convertToTensor(input, 'input', 'imag'); - const inputs = { input: $input }; - return ENGINE.runKernel(Imag, inputs); -} -const imag = op({ imag_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns which elements of x are finite. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isFinite().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isFinite_(x) { - const $x = convertToTensor(x, 'x', 'isFinite'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsFinite, inputs); -} -const isFinite$1 = op({ isFinite_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns which elements of x are Infinity or -Infinity. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isInf().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isInf_(x) { - const $x = convertToTensor(x, 'x', 'isInf'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsInf, inputs); -} -const isInf = op({ isInf_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * RReturns which elements of x are NaN. - * - * ```js - * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); - * - * x.isNaN().print(); // or tf.isNaN(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function isNaN_(x) { - const $x = convertToTensor(x, 'x', 'isNaN'); - const inputs = { x: $x }; - return ENGINE.runKernel(IsNan, inputs); -} -const isNaN$1 = op({ isNaN_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes leaky rectified linear element-wise. - * - * See - * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf]( - * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf) - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1) - * ``` - * @param x The input tensor. - * @param alpha The scaling factor for negative values, defaults to 0.2. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function leakyRelu_(x, alpha = 0.2) { - const $x = convertToTensor(x, 'x', 'leakyRelu'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(LeakyRelu, inputs, attrs); -} -const leakyRelu = op({ leakyRelu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a < b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.less(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function less_(a, b) { - let $a = convertToTensor(a, 'a', 'less'); - let $b = convertToTensor(b, 'b', 'less'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Less, inputs); -} -const less = op({ less_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a <= b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([2, 2, 2]); - * - * a.lessEqual(b).print(); - * ``` - * - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function lessEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'lessEqual'); - let $b = convertToTensor(b, 'b', 'lessEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LessEqual, inputs); -} -const lessEqual = op({ lessEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Normalizes the activation of a local neighborhood across or within - * channels. - * - * @param x The input tensor. The 4-D input tensor is treated as a 3-D array - * of 1D vectors (along the last dimension), and each vector is - * normalized independently. - * @param depthRadius The number of adjacent channels in the 1D normalization - * window. - * @param bias A constant bias term for the basis. - * @param alpha A scale factor, usually positive. - * @param beta An exponent. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const $x = convertToTensor(x, 'x', 'localResponseNormalization'); - assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${$x.rank}.`); - assert(isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` + - `integer but got depthRadius ${depthRadius}.`); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - const inputs = { x: x4D }; - const attrs = { depthRadius, bias, alpha, beta }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(LRN, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - else { - return res; - } -} -const localResponseNormalization = op({ localResponseNormalization_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E]); - * - * x.log().print(); // or tf.log(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function log_(x) { - const $x = convertToTensor(x, 'x', 'log'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log, inputs); -} -const log = op({ log_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes natural logarithm of the input `tf.Tensor` plus one - * element-wise: `ln(1 + x)` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.E - 1]); - * - * x.log1p().print(); // or tf.log1p(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function log1p_(x) { - const $x = convertToTensor(x, 'x', 'log1p'); - const inputs = { x: $x }; - return ENGINE.runKernel(Log1p, inputs); -} -const log1p = op({ log1p_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Overrides the gradient computation of a function `f`. - * - * Takes a function - * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}` - * and returns another function `g(...inputs)` which takes the same inputs as - * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients - * with respect to each input of `f` are computed using `f().gradFunc`. - * - * The `save` function passsed to `f` should be used for saving tensors needed - * in the gradient. And the `saved` passed to the `gradFunc` is a - * `NamedTensorMap`, which contains those saved tensor. - * - * ```js - * const customOp = tf.customGrad((x, save) => { - * // Save x to make sure it's available later for the gradient. - * save([x]); - * // Override gradient of our custom x ^ 2 op to be dy * abs(x); - * return { - * value: x.square(), - * // Note `saved.x` which points to the `x` we saved earlier. - * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())] - * }; - * }); - * - * const x = tf.tensor1d([-1, -2, 3]); - * const dx = tf.grad(x => customOp(x)); - * - * console.log(`f(x):`); - * customOp(x).print(); - * console.log(`f'(x):`); - * dx(x).print(); - * ``` - * - * @param f The function to evaluate in forward mode, which should return - * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc` - * returns the custom gradients of `f` with respect to its inputs. - * - * @doc {heading: 'Training', subheading: 'Gradients'} - */ -function customGrad(f) { - return ENGINE.customGrad(f); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes `-1 * x` element-wise. - * - * ```js - * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]); - * - * x.neg().print(); // or tf.neg(x) - * ``` - * - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function neg_(x) { - const $x = convertToTensor(x, 'x', 'neg'); - const inputs = { x: $x }; - return ENGINE.runKernel(Neg, inputs); -} -const neg = op({ neg_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.softplus().print(); // or tf.softplus(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function softplus_(x) { - const $x = convertToTensor(x, 'x', 'softplus'); - const inputs = { x: $x }; - return ENGINE.runKernel(Softplus, inputs); -} -const softplus = op({ softplus_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes log sigmoid of the input `tf.Tensor` element-wise: - * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`. - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.logSigmoid().print(); // or tf.logSigmoid(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function logSigmoid_(x) { - const $x = convertToTensor(x, 'x', 'logSigmoid'); - // Use a custom gradient to maintain previous implementation. - // There is no LogSigmoid kernel in TF so we can't use engine.runKernel - // directly - const customOp = customGrad((x) => { - // TODO(yassogba) we can remove the chained softplus call here only - // after backends have modualrized softplus at which point we can call - // engine runKernel(..., Sotfplus, ...) directly. - const value = neg(softplus(neg(x))); - const gradFunc = (dy) => { - const derX = mul(dy, sigmoid(neg(x))); - return derX; - }; - return { value, gradFunc }; - }); - return customOp($x); -} -const logSigmoid = op({ logSigmoid_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the maximum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and an - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.max().print(); // or tf.max(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.max(axis).print(); // or tf.max(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function max_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'max'); - const inputs = { x: $x }; - const attrs = { reductionIndices: axis, keepDims }; - return ENGINE.runKernel(Max, inputs, attrs); -} -const max = op({ max_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * - * ```js - * // Broadcast subtract a with b. - * const a = tf.tensor1d([10, 20, 30, 40]); - * const b = tf.scalar(5); - * - * a.sub(b).print(); // or tf.sub(a, b) - * ``` - * @param a The first `tf.Tensor` to subtract from. - * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as - * `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function sub_(a, b) { - let $a = convertToTensor(a, 'a', 'sub'); - let $b = convertToTensor(b, 'b', 'sub'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Sub, inputs); -} -const sub = op({ sub_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the sum of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If axes has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.sum().print(); // or tf.sum(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.sum(axis).print(); // or tf.sum(x, axis) - * ``` - * - * @param x The input tensor to compute the sum over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function sum_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'sum'); - if ($x.dtype === 'bool') { - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Sum, inputs, attrs); -} -const sum = op({ sum_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the log softmax. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.logSoftmax().print(); // or tf.logSoftmax(a) - * ``` - * - * @param logits The logits array. - * @param axis The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function logSoftmax_(logits, axis = -1) { - const $logits = convertToTensor(logits, 'logits', 'logSoftmax'); - if (axis === -1) { - axis = $logits.rank - 1; - } - if (axis !== $logits.rank - 1) { - throw Error('Log Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and axis was ${axis}`); - } - // const forward: ForwardFunc = (backend, save) => { - // const keepDims = true; - // const xMax = max(logits, axis, true); - // const shifted = sub(logits, xMax); - // const value = - // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, - // keepDims))); - // save([value]); - // return value; - // }; - // Use a custom gradient for numerical stability. - const customOp = customGrad((logits, save) => { - const keepDims = true; - const xMax = max(logits, axis, true); - const shifted = sub(logits, xMax); - const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims))); - save([value]); - const gradFunc = (dy, saved) => { - const [value] = saved; - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - }; - return { value, gradFunc }; - }); - return customOp($logits); - // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this. - // const inputs: LogSoftmaxInputs = {logits: $logits}; - // const attrs: LogSoftmaxAttrs = {axis}; - // return ENGINE.runKernel( - // LogSoftmax, inputs as {} as NamedTensorMap, - // attrs as {} as NamedAttrMap); -} -const logSoftmax = op({ logSoftmax_ }); - -/** - * @license - * Copyright 2017 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. - * ============================================================================= - */ -/** - * Returns true if the axis specifies the inner most dimensions of the - * array. - */ -function axesAreInnerMostDims(axes, rank) { - for (let i = 0; i < axes.length; ++i) { - if (axes[axes.length - i - 1] !== rank - 1 - i) { - return false; - } - } - return true; -} -function combineLocations(outputLoc, reduceLoc, axes) { - const rank = outputLoc.length + reduceLoc.length; - const loc = []; - let outIdx = 0; - let reduceIdx = 0; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - loc.push(outputLoc[outIdx++]); - } - else { - loc.push(reduceLoc[reduceIdx++]); - } - } - return loc; -} -function computeOutAndReduceShapes(aShape, axes) { - const outShape = []; - const rank = aShape.length; - for (let dim = 0; dim < rank; dim++) { - if (axes.indexOf(dim) === -1) { - outShape.push(aShape[dim]); - } - } - const reduceShape = axes.map(dim => aShape[dim]); - return [outShape, reduceShape]; -} -function expandShapeToKeepDim(shape, axes) { - const reduceSubShape = axes.map(x => 1); - return combineLocations(shape, reduceSubShape, axes); -} -/** - * Returns the axes permutation to be used with `tf.transpose`, if such - * permutation is necessary. Otherwise it returns null. This method is used by - * operations that operate only on inner-most axes. - */ -function getAxesPermutation(axes, rank) { - if (axesAreInnerMostDims(axes, rank)) { - return null; - } - const result = []; - for (let i = 0; i < rank; ++i) { - if (axes.indexOf(i) === -1) { - result.push(i); - } - } - axes.forEach(axis => result.push(axis)); - return result; -} -/** Returns the axes permutation that undoes the original permutation. */ -function getUndoAxesPermutation(axes) { - return axes.map((axis, i) => [i, axis]) - .sort((a, b) => a[1] - b[1]) - .map(x => x[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. - * ============================================================================= - */ -/** - * Computes the log(sum(exp(elements across the reduction dimensions)). - * - * Reduces the input along the dimensions given in `axis`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.logSumExp().print(); // or tf.logSumExp(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis) - * ``` - * @param x The input tensor. - * @param axis The dimension(s) to reduce. If null (the default), - * reduces all dimensions. - * @param keepDims If true, retains reduced dimensions with length - * of 1. Defaults to false. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function logSumExp_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'logSumExp'); - const axes = parseAxisParam(axis, $x.shape); - const xMax = max($x, axes, true /* keepDims */); - const a = sub($x, xMax); - const b = exp(a); - const c = sum(b, axes); - const d = log(c); - const res = add$1(reshape(xMax, d.shape), d); - if (keepDims) { - const newShape = expandShapeToKeepDim(res.shape, axes); - return reshape(res, newShape); - } - return res; -} -const logSumExp = op({ logSumExp_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a AND b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalAnd(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalAnd_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalAnd, inputs); -} -const logicalAnd = op({ logicalAnd_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `NOT x` element-wise. - * - * ```js - * const a = tf.tensor1d([false, true], 'bool'); - * - * a.logicalNot().print(); - * ``` - * - * @param x The input tensor. Must be of dtype 'bool'. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalNot_(x) { - const $x = convertToTensor(x, 'x', 'logicalNot', 'bool'); - const inputs = { x: $x }; - return ENGINE.runKernel(LogicalNot, inputs); -} -const logicalNot = op({ logicalNot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a OR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalOr(b).print(); - * ``` - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalOr_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalOr', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalOr', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(LogicalOr, inputs); -} -const logicalOr = op({ logicalOr_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of `a XOR b` element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([false, false, true, true], 'bool'); - * const b = tf.tensor1d([false, true, false, true], 'bool'); - * - * a.logicalXor(b).print(); - * ``` - * - * @param a The first input tensor. Must be of dtype bool. - * @param b The second input tensor. Must be of dtype bool. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function logicalXor_(a, b) { - const $a = convertToTensor(a, 'a', 'logicalXor', 'bool'); - const $b = convertToTensor(b, 'b', 'logicalXor', 'bool'); - assertAndGetBroadcastShape($a.shape, $b.shape); - // x ^ y = (x | y) & ~(x & y) - return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b))); -} -const logicalXor = op({ logicalXor_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the 2D max pooling of an image. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { - const $x = convertToTensor(x, 'x', 'maxPool'); - const dilations = 1; - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const maxPool = op({ maxPool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the max of a and b (`a > b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `tf.maximumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * ```js - * // Broadcast maximum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.maximum(b).print(); // or tf.maximum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function maximum_(a, b) { - let $a = convertToTensor(a, 'a', 'maximum'); - let $b = convertToTensor(b, 'b', 'maximum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Maximum, inputs); -} -const maximum = op({ maximum_ }); - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the mean of elements across dimensions of a `tf.Tensor`. - * - * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is - * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with - * a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.mean().print(); // or tf.mean(a) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.mean(axis).print(); // or tf.mean(x, axis) - * ``` - * - * @param x The input tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function mean_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'mean'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Mean, inputs, attrs); -} -const mean = op({ mean_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 0. - * - * ```js - * tf.zeros([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Can - * be 'float32', 'int32' or 'bool'. Defaults to 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function zeros(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = zeros(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeZerosTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 1. - * - * ```js - * tf.ones([2, 2]).print(); - * ``` - * - * @param shape An array of integers defining the output tensor shape. - * @param dtype The type of an element in the resulting tensor. Defaults to - * 'float'. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function ones$1(shape, dtype = 'float32') { - if (dtype === 'complex64') { - const real = ones$1(shape, 'float32'); - const imag = zeros(shape, 'float32'); - return complex(real, imag); - } - const values = makeOnesTypedArray(sizeFromShape(shape), dtype); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @license - * Copyright 2020 Google Inc. 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. - * ============================================================================= - */ -/** - * Computes the minimum value from the input. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the array is reduced by 1 for each entry in `axes`. - * If `keepDims` is true, the reduced dimensions are retained with length 1. - * If `axes` has no entries, all dimensions are reduced, and an array with a - * single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.min().print(); // or tf.min(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.min(axis).print(); // or tf.min(x, axis) - * ``` - * - * @param x The input Tensor. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function min_(x, axis = null, keepDims = false) { - const $x = convertToTensor(x, 'x', 'min'); - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Min, inputs, attrs); -} -const min = op({ min_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the min of a and b (`a < b ? a : b`) element-wise. - * Supports broadcasting. - * - * We also expose `minimumStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * ```js - * // Broadcast minimum a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.minimum(b).print(); // or tf.minimum(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function minimum_(a, b) { - let $a = convertToTensor(a, 'a', 'minimum'); - let $b = convertToTensor(b, 'b', 'minimum'); - [$a, $b] = makeTypesMatch($a, $b); - if ($a.dtype === 'bool') { - $a = cast($a, 'int32'); - $b = cast($b, 'int32'); - } - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Minimum, inputs); -} -const minimum = op({ minimum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Pads a `tf.Tensor` using mirror padding. - * - * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad. - * - * ```js - * const x = tf.range(0, 9).reshape([1, 1, 3, 3]); - * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * In "reflect" mode, the padded regions do not include the borders, - * while in "symmetric" mode the padded regions do include the borders. - * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`, - * then the output is `[1, 2, 3, 2, 1]` in "reflect" mode, and - * `[1, 2, 3, 3, 2]` in "symmetric" mode. - * If `mode` is "reflect" then both `paddings[D, 0]` and `paddings[D, 1]` - * must be no greater than `x.shape[D] - 1`. If mode is "symmetric" - * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than - * `x.shape[D]` - * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'` - */ -/** @doc {heading: 'Tensors', subheading: 'Transformations'} */ -function mirrorPad_(x, paddings, mode) { - assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` + - `Got ${mode}.`); - const $x = convertToTensor(x, 'x', 'mirrorPad'); - if ($x.rank === 0) { - throw new Error('mirrorPad(scalar) is not defined. ' + - 'Pass non-scalar to mirrorPad'); - } - assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` + - `Got ${paddings.length}.`); - const shapeOffset = mode === 'reflect' ? 1 : 0; - for (let i = 0; i < $x.rank; i++) { - assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`); - assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset && - paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` + - `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` + - `shape ${$x.shape}`); - } - const attrs = { paddings, mode }; - const inputs = { x: $x }; - return ENGINE.runKernel(MirrorPad, inputs, attrs); -} -const mirrorPad = op({ mirrorPad_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the mod of a and b element-wise. - * `floor(x / y) * y + mod(x, y) = x` - * Supports broadcasting. - * - * We also expose `tf.modStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * ```js - * // Broadcast a mod b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.mod(b).print(); // or tf.mod(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function mod_(a, b) { - let $a = convertToTensor(a, 'a', 'mod'); - let $b = convertToTensor(b, 'b', 'mod'); - [$a, $b] = makeTypesMatch($a, $b); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(Mod, inputs); -} -const mod = op({ mod_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes square of `x` element-wise: `x ^ 2` - * - * ```js - * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]); - * - * x.square().print(); // or tf.square(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function square_(x) { - const $x = convertToTensor(x, 'x', 'square'); - const attrs = {}; - return ENGINE.runKernel('Square', { x: $x }, attrs); -} -const square = op({ square_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the truth value of (a != b) element-wise. Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * const b = tf.tensor1d([0, 2, 3]); - * - * a.notEqual(b).print(); - * ``` - * @param a The first input tensor. - * @param b The second input tensor. Must have the same dtype as `a`. - * - * @doc {heading: 'Operations', subheading: 'Logical'} - */ -function notEqual_(a, b) { - let $a = convertToTensor(a, 'a', 'notEqual'); - let $b = convertToTensor(b, 'b', 'notEqual'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - return ENGINE.runKernel(NotEqual, inputs); -} -const notEqual = op({ notEqual_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take - * value `onValue` (defaults to 1), while all other locations take value - * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank - * `R+1` with the last axis of size `depth`. - * - * ```js - * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print(); - * ``` - * - * @param indices `tf.Tensor` of indices with dtype `int32`. - * @param depth The depth of the one hot dimension. - * @param onValue A number used to fill in the output when the index matches - * the location. - * @param offValue A number used to fill in the output when the index does - * not match the location. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function oneHot_(indices, depth, onValue = 1, offValue = 0) { - if (depth < 2) { - throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); - } - const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); - const inputs = { indices: $indices }; - const attrs = { depth, onValue, offValue }; - return ENGINE.runKernel(OneHot, inputs, attrs); -} -const oneHot = op({ oneHot_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the - * given tensor. - * - * ```js - * const x = tf.tensor([1, 2]); - * tf.onesLike(x).print(); - * ``` - * @param x A tensor. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function onesLike_(x) { - const $x = convertToTensor(x, 'x', 'onesLike'); - const inputs = { x: $x }; - return ENGINE.runKernel(OnesLike, inputs); -} -const onesLike = op({ onesLike_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Pads a `tf.Tensor` with a given value and paddings. - * - * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`, - * refer to `tf.mirrorPad` - * - * Also available are stricter rank-specific methods with the same signature - * as this method that assert that `paddings` is of given length. - * - `tf.pad1d` - * - `tf.pad2d` - * - `tf.pad3d` - * - `tf.pad4d` - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * x.pad([[1, 2]]).print(); - * ``` - * @param x The tensor to pad. - * @param paddings An array of length `R` (the rank of the tensor), where - * each element is a length-2 tuple of ints `[padBefore, padAfter]`, - * specifying how much to pad along each dimension of the tensor. - * @param constantValue The pad value to use. Defaults to 0. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function pad_(x, paddings, constantValue = 0) { - const $x = convertToTensor(x, 'x', 'pad'); - if ($x.rank === 0) { - throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); - } - const attrs = { paddings, constantValue }; - const inputs = { x: $x }; - return ENGINE.runKernel(PadV2, inputs, attrs); -} -const pad = op({ pad_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * This operation divides "spatial" dimensions `[1, ..., M]` of the input into - * a grid of blocks of shape `blockShape`, and interleaves these blocks with - * the "batch" dimension (0) such that in the output, the spatial - * dimensions `[1, ..., M]` correspond to the position within the grid, - * and the batch dimension combines both the position within a spatial block - * and the original batch position. Prior to division into blocks, - * the spatial dimensions of the input are optionally zero padded - * according to `paddings`. See below for a precise description. - * - * ```js - * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); - * const blockShape = [2, 2]; - * const paddings = [[0, 0], [0, 0]]; - * - * x.spaceToBatchND(blockShape, paddings).print(); - * ``` - * - * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + - * remainingShape`, where spatialShape has `M` dimensions. - * @param blockShape A 1-D array. Must have shape `[M]`, all values must - * be >= 1. - * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >= - * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad - * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It - * is required that - * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0` - * - * This operation is equivalent to the following steps: - * - * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input - * according to `paddings` to produce `padded` of shape paddedShape. - * - * 2. Reshape `padded` to `reshapedPadded` of shape: - * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., - * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape` - * - * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded` - * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the - * batch dimension, producing an output tensor of shape: - * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., - * paddedShape[M] / blockShape[M-1]] + remainingShape` - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function spaceToBatchND_(x, blockShape, paddings) { - const $x = convertToTensor(x, 'x', 'spaceToBatchND'); - assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); - assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); - assert($x.shape.reduce((a, b, i) => { - if (i > 0 && i <= blockShape.length) { - return a && - ((b + paddings[i - 1][0] + paddings[i - 1][1]) % - blockShape[i - 1] === - 0); - } - return a; - }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); - const inputs = { x: $x }; - const attrs = { blockShape, paddings }; - return ENGINE.runKernel(SpaceToBatchND, inputs, attrs); -} -const spaceToBatchND = op({ spaceToBatchND_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Performs an N-D pooling operation - * - * @param input The input tensor, of rank 4 or rank 3 of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param windowShape The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param poolingType The type of pooling, either 'max' or 'avg'. - * @param pad The type of padding algorithm: - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function pool_(input, windowShape, poolingType, pad, dilations, strides) { - if (dilations == null) { - dilations = [1, 1]; - } - if (strides == null) { - strides = 1; - } - if (pad === 0) { - pad = 'valid'; - } - const $x = convertToTensor(input, 'x', 'maxPool'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' + - `Got strides ${strides} and dilations '${dilations}'`); - const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad); - const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; - // The following implementation does batchToSpace(pool(spaceToBatch(x))) - // whenever dilation > 1 since the TF kernels do not support dilation > 1. - // tslint:disable-next-line:max-line-length - // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037 - let basePadding; - if (pad === 'same') { - basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation); - } - else { - basePadding = [[0, 0], [0, 0]]; - } - const isDilationOne = dilation[0] === 1 && dilation[1] === 1; - const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); - const convertedPad = isDilationOne ? pad : 'valid'; - const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding); - const forwardOp = poolingType === 'avg' ? - () => avgPool(convertedX, windowShape, strides, convertedPad) : - () => maxPool(convertedX, windowShape, strides, convertedPad); - const y = forwardOp(); - const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -// Helper function to compute crops and paddings for pool with dilation > 1. -// tslint:disable-next-line:max-line-length -// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184 -function requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) { - const padStart = basePadding.map(b => b[0]); - const origPadEnd = basePadding.map(b => b[1]); - const fullInputShape = inputShape.concat(padStart, origPadEnd); - const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b); - const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]); - const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]); - const crops = blockShape.map((_, i) => [0, padEndExtra[i]]); - return [paddings, crops]; -} -// Helper function to compute base paddings for pool with dilation > 1. -// tslint:disable-next-line:max-line-length -// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524 -function withSpaceToBatchBasePaddings(filterShape, dilation) { - // Spatial dimensions of the filters and the upsampled filters in which we - // introduce (rate - 1) zeros between consecutive filter values. - const dilatedFilterShape = filterShape.map((s, i) => { - return s + (s - 1) * (dilation[i] - 1); - }); - const padExtraShape = dilatedFilterShape.map(s => s - 1); - // When padding is odd, we pad more at end, following the same - // convention as conv2d. - const padExtraStart = padExtraShape.map(s => Math.floor(s / 2)); - const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]); - return padExtraShape.map((_, i) => { - return [padExtraStart[i], padExtraEnd[i]]; - }); -} -const pool = op({ pool_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the power of one `tf.Tensor` to another. Supports broadcasting. - * - * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for - * corresponding elements in x and y. The result's dtype will be the upcasted - * type of the `base` and `exp` dtypes. - * - * ```js - * const a = tf.tensor([[2, 3], [4, 5]]) - * const b = tf.tensor([[1, 2], [3, 0]]).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * - * ```js - * const a = tf.tensor([[1, 2], [3, 4]]) - * const b = tf.tensor(2).toInt(); - * - * a.pow(b).print(); // or tf.pow(a, b) - * ``` - * We also expose `powStrict` which has the same signature as this op and - * asserts that `base` and `exp` are the same shape (does not broadcast). - * - * @param base The base `tf.Tensor` to pow element-wise. - * @param exp The exponent `tf.Tensor` to pow element-wise. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function pow_(base, exp) { - let $base = convertToTensor(base, 'base', 'pow'); - let $exp = convertToTensor(exp, 'exp', 'pow'); - [$base, $exp] = makeTypesMatch($base, $exp); - const inputs = { a: $base, b: $exp }; - return ENGINE.runKernel(Pow, inputs); -} -const pow = op({ pow_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes leaky rectified linear element-wise with parametric alphas. - * - * `x < 0 ? alpha * x : f(x) = x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * const alpha = tf.scalar(0.1); - * - * x.prelu(alpha).print(); // or tf.prelu(x, alpha) - * ``` - * @param x The input tensor. - * @param alpha Scaling factor for negative values. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function prelu_(x, alpha) { - const $x = convertToTensor(x, 'x', 'prelu'); - const $alpha = convertToTensor(alpha, 'alpha', 'prelu'); - const inputs = { x: $x, alpha: $alpha }; - return ENGINE.runKernel(Prelu, inputs); -} -const prelu = op({ prelu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the product of elements across dimensions of a `tf.Tensor`. - * - * Reduces the input along the dimensions given in `axes`. Unless `keepDims` - * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in - * `axes`. If `keepDims` is true, the reduced dimensions are retained with - * length 1. If `axes` has no entries, all dimensions are reduced, and a - * `tf.Tensor` with a single element is returned. - * - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * - * x.prod().print(); // or tf.prod(x) - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.prod(axis).print(); // or tf.prod(x, axis) - * ``` - * - * @param x The input tensor to compute the product over. If the dtype is `bool` - * it will be converted to `int32` and the output dtype will be `int32`. - * @param axis The dimension(s) to reduce. By default it reduces - * all dimensions. - * @param keepDims If true, retains reduced dimensions with size 1. - * - * @doc {heading: 'Operations', subheading: 'Reduction'} - */ -function prod_(x, axis = null, keepDims = false) { - let $x = convertToTensor(x, 'x', 'prod'); - if ($x.dtype === 'bool') { - // bool is not an allowed type for the underlying kernel. - $x = cast($x, 'int32'); - } - const inputs = { x: $x }; - const attrs = { axis, keepDims }; - return ENGINE.runKernel(Prod, inputs, attrs); -} -const prod = op({ prod_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns the real part of a complex (or real) tensor. - * - * Given a tensor input, this operation returns a tensor of type float that is - * the real part of each element in input considered as a complex number. - * - * If the input is real, it simply makes a clone. - * - * ```js - * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); - * tf.real(x).print(); - * ``` - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function real_(input) { - const $input = convertToTensor(input, 'input', 'real'); - const inputs = { input: $input }; - return ENGINE.runKernel(Real, inputs); -} -const real = op({ real_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes reciprocal of x element-wise: `1 / x` - * - * ```js - * const x = tf.tensor1d([0, 1, 2]); - * - * x.reciprocal().print(); // or tf.reciprocal(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function reciprocal_(x) { - const $x = convertToTensor(x, 'x', 'reciprocal'); - const inputs = { x: $x }; - return ENGINE.runKernel(Reciprocal, inputs); -} -const reciprocal = op({ reciprocal_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes rectified linear element-wise: `max(x, 0)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.relu().print(); // or tf.relu(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function relu_(x) { - const $x = convertToTensor(x, 'x', 'relu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu, inputs); -} -const relu = op({ relu_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`. - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 8]); - * - * x.relu6().print(); // or tf.relu6(x) - * ``` - * @param x The input tensor. If the dtype is `bool`, the output dtype will be - * `int32'. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function relu6_(x) { - const $x = convertToTensor(x, 'x', 'relu6'); - const inputs = { x: $x }; - return ENGINE.runKernel(Relu6, inputs); -} -const relu6 = op({ relu6_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Reverses a `tf.Tensor` along a specified axis. - * - * Also available are stricter rank-specific methods that assert that `x` is - * of the given rank: - * - `tf.reverse1d` - * - `tf.reverse2d` - * - `tf.reverse3d` - * - `tf.reverse4d` - * - * Except `tf.reverse1d` (which does not have axis param), all methods have - * same signature as this method. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.reverse().print(); - * ``` - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * const axis = 1; - * x.reverse(axis).print(); - * ``` - * @param x The input tensor to be reversed. - * @param axis The set of dimensions to reverse. Must be in the - * range [-rank(x), rank(x)). Defaults to all axes. - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function reverse_(x, axis) { - const $x = convertToTensor(x, 'x', 'reverse'); - const inputs = { x: $x }; - const attrs = { dims: axis }; - return ENGINE.runKernel(Reverse, inputs, attrs); -} -const reverse = op({ reverse_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes round of input `tf.Tensor` element-wise: `round(x)`. - * It implements banker's rounding. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3]); - * - * x.round().print(); // or tf.round(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function round_(x) { - const $x = convertToTensor(x, 'x', 'round'); - const inputs = { x: $x }; - return ENGINE.runKernel(Round, inputs); -} -const round$1 = op({ round_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes reciprocal of square root of the input `tf.Tensor` element-wise: - * `y = 1 / sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.rsqrt().print(); // or tf.rsqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function rsqrt_(x) { - const $x = convertToTensor(x, 'x', 'rsqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Rsqrt, inputs); -} -const rsqrt = op({ rsqrt_ }); - -/** - * @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. - * ============================================================================= - */ -/** This is shared code across all tensor creation methods. */ -function makeTensor(values, shape, inferredShape, dtype) { - if (dtype == null) { - dtype = inferDtype(values); - } - if (dtype === 'complex64') { - throw new Error(`Cannot construct a complex64 tensor directly. ` + - `Please use tf.complex(real, imag).`); - } - if (!isTypedArray(values) && !Array.isArray(values) && - typeof values !== 'number' && typeof values !== 'boolean' && - typeof values !== 'string') { - throw new Error('values passed to tensor(values) must be a number/boolean/string or ' + - 'an array of numbers/booleans/strings, or a TypedArray'); - } - if (shape != null) { - assertNonNegativeIntegerDimensions(shape); - const providedSize = sizeFromShape(shape); - const inferredSize = sizeFromShape(inferredShape); - assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` + - `${providedSize} values but has ${inferredSize}`); - for (let i = 0; i < inferredShape.length; ++i) { - const inferred = inferredShape[i]; - const flatDimsDontMatch = i === inferredShape.length - 1 ? - inferred !== sizeFromShape(shape.slice(i)) : - true; - assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` + - `(${inferredShape}) does not match the provided ` + - `shape (${shape}). `); - } - } - if (!isTypedArray(values) && !Array.isArray(values)) { - values = [values]; - } - shape = shape || inferredShape; - values = dtype !== 'string' ? - toTypedArray(values, dtype) : - flatten(values, [], true); - return ENGINE.makeTensor(values, shape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype. - * - * The same functionality can be achieved with `tf.tensor`, but in general - * we recommend using `tf.scalar` as it makes the code more readable. - * - * ```js - * tf.scalar(3.14).print(); - * ``` - * - * @param value The value of the scalar. - * @param dtype The data type. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} - */ -function scalar(value, dtype) { - if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) && - dtype !== 'complex64') { - throw new Error('Error creating a new Scalar: value must be a primitive ' + - '(number|boolean|string)'); - } - if (dtype === 'string' && isTypedArray(value) && - !(value instanceof Uint8Array)) { - throw new Error('When making a scalar from encoded string, ' + - 'the value must be `Uint8Array`.'); - } - const shape = []; - const inferredShape = []; - return makeTensor(value, shape, inferredShape, dtype); -} - -/** - * @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. - * ============================================================================= - */ -/** - * Computes scaled exponential linear element-wise. - * - * `x < 0 ? scale * alpha * (exp(x) - 1) : x` - * - * ```js - * const x = tf.tensor1d([-1, 2, -3, 4]); - * - * x.selu().print(); // or tf.selu(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function selu_(x) { - const $x = convertToTensor(x, 'x', 'selu'); - const inputs = { x: $x }; - return ENGINE.runKernel(Selu, inputs); -} -const selu = op({ selu_ }); - -/** - * 2-D convolution with separable filters. - * - * Performs a depthwise convolution that acts separately on channels followed - * by a pointwise convolution that mixes channels. Note that this is - * separability between dimensions [1, 2] and 3, not spatial separability - * between dimensions 1 and 2. - * - * See - * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d]( - * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d) - * for more details. - * - * @param x The input tensor, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is - * assumed. - * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape - * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is - * the filter used in the first step. - * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape - * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is - * the filter used in the second step. - * @param strides The strides of the convolution: `[strideHeight, - * strideWidth]`. If strides is a single number, then `strideHeight == - * strideWidth`. - * @param pad The type of padding algorithm. - * - `same` and stride 1: output will be of same size as input, - * regardless of filter size. - * - `valid`: output will be smaller than input if filter is larger - * than 1x1. - * - For more info, see this guide: - * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( - * https://www.tensorflow.org/api_guides/python/nn#Convolution) - * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` - * in which we sample input values across the height and width dimensions - * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single - * number, then `dilationHeight == dilationWidth`. If it is greater than - * 1, then all values of `strides` must be 1. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. Only "NHWC" is currently supported. - * - * @doc {heading: 'Operations', subheading: 'Convolution'} - */ -function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') { - const $x = convertToTensor(x, 'x', 'separableConv2d'); - const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); - const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); - let x4D = $x; - let reshapedTo4D = false; - if ($x.rank === 3) { - reshapedTo4D = true; - x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); - } - if (dataFormat === 'NCHW') { - throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + - 'NHWC is supported'); - } - assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` + - `rank ${x4D.rank}.`); - assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` + - `got rank ${$depthwiseFilter.rank}.`); - assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` + - ` must be 1, but got ${$pointwiseFilter.shape[0]}.`); - assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` + - `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`); - const inChannels = $depthwiseFilter.shape[2]; - const channelMultiplier = $depthwiseFilter.shape[3]; - assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` + - `must be ${inChannels * channelMultiplier}, ` + - `but got ${$pointwiseFilter.shape[2]}.`); - const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); - const pointwiseStride = 1; - const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const separableConv2d = op({ separableConv2d_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns an element-wise indication of the sign of a number. - * - * ```js - * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]); - * - * x.sign().print(); // or tf.sign(x) - * ``` - * @param x The input Tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sign_(x) { - const $x = convertToTensor(x, 'x', 'sign'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sign, inputs); -} -const sign = op({ sign_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes sin of the input Tensor element-wise: `sin(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.sin().print(); // or tf.sin(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sin_(x) { - const $x = convertToTensor(x, 'x', 'sin'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sin, inputs); -} -const sin = op({ sin_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)` - * - * ```js - * const x = tf.tensor1d([0, 1, -1, .7]); - * - * x.sinh().print(); // or tf.sinh(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sinh_(x) { - const $x = convertToTensor(x, 'x', 'sinh'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sinh, inputs); -} -const sinh = op({ sinh_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the softmax normalized vector given the logits. - * - * ```js - * const a = tf.tensor1d([1, 2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * ```js - * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]); - * - * a.softmax().print(); // or tf.softmax(a) - * ``` - * - * @param logits The logits array. - * @param dim The dimension softmax would be performed on. Defaults to `-1` - * which indicates the last dimension. - * - * @doc {heading: 'Operations', subheading: 'Normalization'} - */ -function softmax_(logits, dim = -1) { - const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32'); - if (dim === -1) { - dim = $logits.rank - 1; - } - if (dim !== $logits.rank - 1) { - throw Error('Softmax along a non-last dimension is not yet supported. ' + - `Logits was rank ${$logits.rank} and dim was ${dim}`); - } - const inputs = { logits: $logits }; - const attrs = { dim }; - return ENGINE.runKernel(Softmax, inputs, attrs); -} -const softmax = op({ softmax_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.fft().print(); // tf.spectral.fft(x).print(); - * ``` - * @param input The complex input to compute an fft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function fft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(FFT, inputs); -} -const fft = op({ fft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Inverse fast Fourier transform. - * - * Computes the inverse 1-dimensional discrete Fourier transform over the - * inner-most dimension of input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([1, 2, 3]); - * const x = tf.complex(real, imag); - * - * x.ifft().print(); // tf.spectral.ifft(x).print(); - * ``` - * @param input The complex input to compute an ifft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function ifft_(input) { - assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` + - `but got ${input.dtype}.`); - const inputs = { input }; - return ENGINE.runKernel(IFFT, inputs); -} -const ifft = op({ ifft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Inversed real value input fast Fourier transform. - * - * Computes the 1-dimensional inversed discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * const imag = tf.tensor1d([0, 0, 0]); - * const x = tf.complex(real, imag); - * - * x.irfft().print(); - * ``` - * @param input The real value input to compute an irfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function irfft_(input) { - const innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let ret; - if (innerDimensionSize <= 2) { - const complexInput = reshape(input, [batch, innerDimensionSize]); - ret = ifft(complexInput); - } - else { - // The length of unique components of the DFT of a real-valued signal - // is 2 * (input_len - 1) - const outputShape = [batch, 2 * (innerDimensionSize - 1)]; - const realInput = reshape(real(input), [batch, innerDimensionSize]); - const imagInput = reshape(imag(input), [batch, innerDimensionSize]); - const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); - const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1)); - const r = concat([realInput, realConjugate], 1); - const i = concat([imagInput, imagConjugate], 1); - const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]); - ret = ifft(complexInput); - } - ret = real(ret); - // reshape the result if the input is 3D tensor. - if (input.rank === 3 && input.shape[0] !== 0) { - const temp = ret; - const batch = input.shape[0]; - ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]); - temp.dispose(); - } - return ret; -} -const irfft = op({ irfft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Splits a `tf.Tensor` into sub tensors. - * - * If `numOrSizeSplits` is a number, splits `x` along dimension `axis` - * into `numOrSizeSplits` smaller tensors. - * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`. - * - * If `numOrSizeSplits` is a number array, splits `x` into - * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the - * same size as `x` except along dimension `axis` where the size is - * `numOrSizeSplits[i]`. - * - * ```js - * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - * const [a, b] = tf.split(x, 2, 1); - * a.print(); - * b.print(); - * - * const [c, d, e] = tf.split(x, [1, 2, 1], 1); - * c.print(); - * d.print(); - * e.print(); - * ``` - * - * @param x The input tensor to split. - * @param numOrSizeSplits Either an integer indicating the number of - * splits along the axis or an array of integers containing the sizes of - * each output tensor along the axis. If a number then it must evenly divide - * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`. - * Can contain one -1 indicating that dimension is to be inferred. - * @param axis The dimension along which to split. Defaults to 0 (the first - * dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function split_(x, numOrSizeSplits, axis = 0) { - const $x = convertToTensor(x, 'x', 'split'); - const inputs = { x: $x }; - const attr = { numOrSizeSplits, axis }; - return ENGINE.runKernel(SplitV, inputs, attr); -} -const split = op({ split_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Real value input fast Fourier transform. - * - * Computes the 1-dimensional discrete Fourier transform over the - * inner-most dimension of the real input. - * - * ```js - * const real = tf.tensor1d([1, 2, 3]); - * - * real.rfft().print(); - * ``` - * @param input The real value input to compute an rfft over. - * - * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'} - */ -function rfft_(input, fftLength) { - assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`); - let innerDimensionSize = input.shape[input.shape.length - 1]; - const batch = input.size / innerDimensionSize; - let adjustedInput; - if (fftLength != null && fftLength < innerDimensionSize) { - // Need to crop - const begin = input.shape.map(v => 0); - const size = input.shape.map(v => v); - size[input.shape.length - 1] = fftLength; - adjustedInput = slice(input, begin, size); - innerDimensionSize = fftLength; - } - else if (fftLength != null && fftLength > innerDimensionSize) { - // Need to pad with zeros - const zerosShape = input.shape.map(v => v); - zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize; - adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1); - innerDimensionSize = fftLength; - } - else { - adjustedInput = input; - } - // Complement the input with zero imaginary numbers. - const zerosInput = zerosLike(adjustedInput); - const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]); - const ret = fft(complexInput); - // Exclude complex conjugations. These conjugations are put symmetrically. - const half = Math.floor(innerDimensionSize / 2) + 1; - const realValues = real(ret); - const imagValues = imag(ret); - const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1); - const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1); - const outputShape = adjustedInput.shape.slice(); - outputShape[adjustedInput.shape.length - 1] = half; - return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape); -} -const rfft = op({ rfft_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)` - * - * ```js - * const x = tf.tensor1d([1, 2, 4, -1]); - * - * x.sqrt().print(); // or tf.sqrt(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function sqrt_(x) { - const $x = convertToTensor(x, 'x', 'sqrt'); - const inputs = { x: $x }; - return ENGINE.runKernel(Sqrt, inputs); -} -const sqrt = op({ sqrt_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Returns (a - b) * (a - b) element-wise. - * Supports broadcasting. - * - * ```js - * const a = tf.tensor1d([1, 4, 3, 16]); - * const b = tf.tensor1d([1, 2, 9, 4]); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * ```js - * // Broadcast squared difference a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(5); - * - * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) - * ``` - * - * @param a The first tensor. - * @param b The second tensor. Must have the same type as `a`. - * - * @doc {heading: 'Operations', subheading: 'Arithmetic'} - */ -function squaredDifference_(a, b) { - let $a = convertToTensor(a, 'a', 'squaredDifference'); - let $b = convertToTensor(b, 'b', 'squaredDifference'); - [$a, $b] = makeTypesMatch($a, $b); - assertAndGetBroadcastShape($a.shape, $b.shape); - const inputs = { a: $a, b: $b }; - const attrs = {}; - return ENGINE.runKernel(SquaredDifference, inputs, attrs); -} -const squaredDifference = op({ squaredDifference_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Removes dimensions of size 1 from the shape of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]); - * x.squeeze().print(); - * ``` - * - * @param x The input tensor to be squeezed. - * @param axis An optional list of numbers. If specified, only - * squeezes the dimensions listed. The dimension index starts at 0. It - * is an error to squeeze a dimension that is not 1. - * - * @doc {heading: 'Tensors', subheading: 'Transformations'} - */ -function squeeze_(x, axis) { - const $x = convertToTensor(x, 'x', 'squeeze'); - return reshape($x, squeezeShape($x.shape, axis).newShape); -} -const squeeze = op({ squeeze_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`. - * - * ```js - * const a = tf.tensor1d([1, 2]); - * const b = tf.tensor1d([3, 4]); - * const c = tf.tensor1d([5, 6]); - * tf.stack([a, b, c]).print(); - * ``` - * - * @param tensors A list of tensor objects with the same shape and dtype. - * @param axis The axis to stack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function stack_(tensors, axis = 0) { - const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric'); - assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack'); - if ($tensors.length > 0) { - assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor'); - } - const inputs = $tensors; - const attrs = { axis }; - return ENGINE.runKernel(Pack, inputs, attrs); -} -const stack = op({ stack_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x` - * - * ```js - * const x = tf.tensor1d([0, 2, -1, -3]); - * - * x.step(.5).print(); // or tf.step(x, .5) - * ``` - * @param x The input tensor. - * @param alpha The gradient when input is negative. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function step_(x, alpha = 0.0) { - const $x = convertToTensor(x, 'x', 'step'); - const inputs = { x: $x }; - const attrs = { alpha }; - return ENGINE.runKernel(Step, inputs, attrs); -} -const step = op({ step_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Extracts a strided slice of a tensor. - * - * Roughly speaking, this op extracts a slice of size (end-begin)/stride from - * the given input tensor (x). Starting at the location specified by begin the - * slice continues by adding stride to the index until all dimensions are not - * less than end. Note that a stride can be negative, which causes a reverse - * slice. - * - * ```js - * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6], - * [3, 2, 3]); - * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]] - * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3], - * // [4, 4, 4]]] - * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4], - * // [3, 3, 3]]] - * ``` - * - * @param x The tensor to stride slice. - * @param begin The coordinates to start the slice from. - * @param end: The coordinates to end the slice at. - * @param strides: The size of the slice. - * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param endMask: If the ith bit of endMask is set, end[i] is ignored - * and the fullest possible range in that dimension is used instead. - * @param shrinkAxisMask: a bitmask where bit i implies that - * the ith specification should shrink the dimensionality. begin and end must - * imply a slice of size 1 in the dimension. - * - * @doc {heading: 'Operations', subheading: 'Slicing and Joining'} - */ -function stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { - const $x = convertToTensor(x, 'x', 'stridedSlice'); - const inputs = { x: $x }; - const attrs = { - begin, - end, - strides, - beginMask, - endMask, - ellipsisMask, - newAxisMask, - shrinkAxisMask - }; - return ENGINE.runKernel(StridedSlice, inputs, attrs); -} -const stridedSlice = op({ stridedSlice_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes tan of the input `tf.Tensor` element-wise, `tan(x)` - * - * ```js - * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); - * - * x.tan().print(); // or tf.tan(x) - * ``` - * @param x The input tensor. - * - * @doc {heading: 'Operations', subheading: 'Basic math'} - */ -function tan_(x) { - const $x = convertToTensor(x, 'x', 'tan'); - const inputs = { x: $x }; - return ENGINE.runKernel(Tan, inputs); -} -const tan = op({ tan_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Finds the values and indices of the `k` largest entries along the last - * dimension. - * - * If the input is a vector (rank=1), finds the k largest entries in the vector - * and outputs their values and indices as vectors. Thus values[j] is the j-th - * largest entry in input, and its index is indices[j]. - * For higher rank inputs, computes the top k entries along the last dimension. - * - * If two elements are equal, the lower-index element appears first. - * - * ```js - * const a = tf.tensor2d([[1, 5], [4, 3]]); - * const {values, indices} = tf.topk(a); - * values.print(); - * indices.print(); - * ``` - * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`. - * @param k Number of top elements to look for along the last dimension. - * @param sorted If true, the resulting `k` elements will be sorted by the - * values in descending order. - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ -function topk_(x, k = 1, sorted = true) { - const $x = convertToTensor(x, 'x', 'topk'); - if ($x.rank === 0) { - throw new Error('topk() expects the input to be of rank 1 or higher'); - } - const lastDim = $x.shape[$x.shape.length - 1]; - if (k > lastDim) { - throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` + - `but got ${k}`); - } - const inputs = { x: $x }; - const attrs = { k, sorted }; - const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs); - return { values, indices }; -} -const topk = op({ topk_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Finds unique elements along an axis of a tensor. - * - * It returns a tensor `values` containing all of the unique elements along the - * `axis` of the given tensor `x` in the same order that they occur along the - * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor - * `indices` the same size as the number of the elements in `x` along the `axis` - * dimension. It contains the index in the unique output `values`. - * - * ```js - * // A 1-D tensor - * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]); - * const {values, indices} = tf.unique(a); - * values.print(); // [1, 2, 4, 7, 8,] - * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4] - * ``` - * - * ```js - * // A 2-D tensor with axis=0 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 0) - * values.print(); // [[1, 0, 0], - * // [2, 0, 0]] - * indices.print(); // [0, 0, 1] - * ``` - * - * ```js - * // A 2-D tensor with axis=1 - * // - * // 'a' is: [[1, 0, 0], - * // [1, 0, 0], - * // [2, 0, 0]] - * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]); - * const {values, indices} = tf.unique(a, 1) - * values.print(); // [[1, 0], - * // [1, 0], - * // [2, 0]] - * indices.print(); // [0, 1, 1] - * ``` - * @param x A tensor (int32, string, bool). - * @param axis The axis of the tensor to find the unique elements. - * @returns [uniqueElements, indices] (see above for details) - * - * @doc {heading: 'Operations', subheading: 'Evaluation'} - */ -function unique_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric'); - assert($x.rank > 0, () => 'The input tensor must be at least 1D'); - const inputs = { x: $x }; - const attrs = { axis }; - const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs); - return { values, indices }; -} -const unique = op({ unique_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the sum along segments of a `tf.Tensor`. - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32'); - * const numSegments = 3; - * - * x.unsortedSegmentSum(segmentIds, numSegments).print() - * //or tf.unsortedSegmentSum(x, segmentIds, numSegments) - * ``` - * @param x The `tf.Tensor` that will be summed along its segments. - * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s - * dimension along the `axis`. Maps each element of `x` to a segment. - * @param numSegments The number of distinct `segmentIds`. - * - * @doc {heading: 'Operations', subheading: 'Segment'} - */ -function unsortedSegmentSum_(x, segmentIds, numSegments) { - const $x = convertToTensor(x, 'x', 'unsortedSegmentSum'); - const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); - assert(isInt(numSegments), () => 'numSegments must be of dtype int'); - const inputs = { x: $x, segmentIds: $segmentIds }; - const attrs = { numSegments }; - return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs); -} -const unsortedSegmentSum = op({ unsortedSegmentSum_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * - * tf.unstack(a).forEach(tensor => tensor.print()); - * ``` - * - * @param x A tensor object. - * @param axis The axis to unstack along. Defaults to 0 (the first dim). - * - * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} - */ -function unstack_(x, axis = 0) { - const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric'); - assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); - const inputs = { value: $x }; - const attrs = { axis }; - return ENGINE.runKernel(Unpack, inputs, attrs); -} -const unstack = op({ unstack_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`. - * - * The returned `tf.Tensor`'s dimension `i` will correspond to the input - * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`, - * where `n` is the rank of the input `tf.Tensor`. Hence by default, this - * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s. - * - * ```js - * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); - * - * a.transpose().print(); // or tf.transpose(a) - * ``` - * - * @param x The tensor to transpose. - * @param perm The permutation of the dimensions of a. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function transpose_(x, perm) { - const $x = convertToTensor(x, 'x', 'transpose'); - if (perm == null) { - perm = $x.shape.map((s, i) => i).reverse(); - } - assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` + - `must match length of perm ${perm}.`); - perm.forEach(axis => { - assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` + - ` but got ${perm}`); - }); - if ($x.rank <= 1) { - return $x.clone(); - } - const inputs = { x: $x }; - const attrs = { perm }; - return ENGINE.runKernel(Transpose, inputs, attrs); -} -const transpose = op({ transpose_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the norm of scalar, vectors, and matrices. - * This function can compute several different vector norms (the 1-norm, the - * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) - * and matrix norms (Frobenius, 1-norm, and inf-norm). - * - * ```js - * const x = tf.tensor1d([1, 2, 3, 4]); - * - * x.norm().print(); // or tf.norm(x) - * ``` - * - * @param x The input array. - * @param ord Optional. Order of the norm. Supported norm types are - * following: - * - * | ord | norm for matrices | norm for vectors - * |------------|---------------------------|--------------------- - * |'euclidean' |Frobenius norm |2-norm - * |'fro' |Frobenius norm | - * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x)) - * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x)) - * |1 |max(sum(abs(x), axis=0)) |sum(abs(x)) - * |2 | |sum(abs(x)^2)^1/2* - * - * @param axis Optional. If axis is null (the default), the input is - * considered a vector and a single vector norm is computed over the entire - * set of values in the Tensor, i.e. norm(x, ord) is equivalent - * to norm(x.reshape([-1]), ord). If axis is a integer, the input - * is considered a batch of vectors, and axis determines the axis in x - * over which to compute vector norms. If axis is a 2-tuple of integer it is - * considered a batch of matrices and axis determines the axes in NDArray - * over which to compute a matrix norm. - * @param keepDims Optional. If true, the norm have the same dimensionality - * as the input. - * - * @doc {heading: 'Operations', subheading: 'Matrices'} - */ -function norm_(x, ord = 'euclidean', axis = null, keepDims = false) { - x = convertToTensor(x, 'x', 'norm'); - const norm = normImpl(x, ord, axis); - let keepDimsShape = norm.shape; - if (keepDims) { - const axes = parseAxisParam(axis, x.shape); - keepDimsShape = expandShapeToKeepDim(norm.shape, axes); - } - return reshape(norm, keepDimsShape); -} -function normImpl(x, p, axis = null) { - if (x.rank === 0) { - return abs(x); - } - // consider vector when no axis is specified - if (x.rank !== 1 && axis === null) { - return normImpl(reshape(x, [-1]), p, axis); - } - // vector - if (x.rank === 1 || typeof axis === 'number' || - Array.isArray(axis) && axis.length === 1) { - if (p === 1) { - return sum(abs(x), axis); - } - if (p === Infinity) { - return max(abs(x), axis); - } - if (p === -Infinity) { - return min(abs(x), axis); - } - if (p === 'euclidean' || p === 2) { - // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2 - return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - // matrix (assumption axis[0] < axis[1]) - if (Array.isArray(axis) && axis.length === 2) { - if (p === 1) { - return max(sum(abs(x), axis[0]), axis[1] - 1); - } - if (p === Infinity) { - return max(sum(abs(x), axis[1]), axis[0]); - } - if (p === -Infinity) { - return min(sum(abs(x), axis[1]), axis[0]); - } - if (p === 'fro' || p === 'euclidean') { - // norm(x) = sqrt(sum(pow(x, 2))) - return sqrt(sum(square(x), axis)); - } - throw new Error(`Error in norm: invalid ord value: ${p}`); - } - throw new Error(`Error in norm: invalid axis: ${axis}`); -} -const norm = op({ norm_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the filter of a 2D convolution. - * - * @param x The input tensor, of rank 4 or rank 3 of shape - * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed. - * @param dy The dy image, of rank 4 or rank 3, of shape - * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed. - * @param filterShape The shape of the filter, length 4, - * [filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to - * "NHWC". Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: [batch, - * height, width, channels]. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` + - `${x4D.shape}.`); - assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` + - `${dy4D.shape}.`); - assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` + - `${filterShape}.`); - const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; - const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; - assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` + - `match input depth in filter (${filterShape[2]}.`); - assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` + - `match output depth for filter (${filterShape[3]}).`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs); -} -const conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) { - let x4D = x; - if (x.rank === 3) { - x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); - } - let dy4D = dy; - if (dy4D.rank === 3) { - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad, dimRoundingMode, dilations, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs); -} -const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) { - let dy4D = dy; - let reshapedTo4D = false; - if (dy.rank === 3) { - reshapedTo4D = true; - dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); - } - const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape }; - const res = - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * Bilinear resize a single 3D image or a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to `false`. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers - * are at 0.5, which would make the floating point coordinates of the top - * left pixel 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ -function resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeBilinear'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` + - `${size}.`); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const resizeBilinear = op({ resizeBilinear_ }); - -/** - * @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. - * ============================================================================= - */ -/** - * NearestNeighbor resize a batch of 3D images to a new shape. - * - * @param images The images, of rank 4 or rank 3, of shape - * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed. - * @param size The new shape `[newHeight, newWidth]` to resize the - * images to. Each channel is resized individually. - * @param alignCorners Defaults to False. If true, rescale - * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4 - * corners of images and resized images. If false, rescale by - * `new_height / height`. Treat similarly the width dimension. - * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of - * half the actual dimensions, and yields more accurate resizes. This flag - * would also make the floating point coordinates of the top left pixel - * 0.5, 0.5. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ -function resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) { - const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor'); - assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` + - `rank ${$images.rank}.`); - assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` + - `${size}.`); - assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype'); - assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` + - `alignCorners must be false.`); - let batchImages = $images; - let reshapedTo4D = false; - if ($images.rank === 3) { - reshapedTo4D = true; - batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); - } - const inputs = { images: batchImages }; - const attrs = { alignCorners, halfPixelCenters, size }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const resizeNearestNeighbor = op({ resizeNearestNeighbor_ }); - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.abs = function () { - this.throwIfDisposed(); - return abs(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.acos = function () { - this.throwIfDisposed(); - return acos(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.acosh = function () { - this.throwIfDisposed(); - return acosh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.add = function (b) { - this.throwIfDisposed(); - return add$1(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.all = function (axis, keepDims) { - this.throwIfDisposed(); - return all(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.any = function (axis, keepDims) { - this.throwIfDisposed(); - return any(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.argMax = function (axis) { - this.throwIfDisposed(); - return argMax(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.argMin = function (axis) { - this.throwIfDisposed(); - return argMin(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Converts a size-1 `tf.Tensor` to a `tf.Scalar`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.asScalar = function () { - this.throwIfDisposed(); - assert(this.size === 1, () => 'The array must have only 1 element.'); - return reshape(this, []); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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 (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Converts a `tf.Tensor` to a `tf.Tensor1D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as1D = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns) { - this.throwIfDisposed(); - return reshape(this, [rows, columns]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth, depth2) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2]); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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, columns, depth, depth2, depth3) { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2, depth3]); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.asin = function () { - this.throwIfDisposed(); - return asin(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.asinh = function () { - this.throwIfDisposed(); - return asinh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atan = function () { - this.throwIfDisposed(); - return atan(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atan2 = function (b) { - this.throwIfDisposed(); - return atan2(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.atanh = function () { - this.throwIfDisposed(); - return atanh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.avgPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) { - this.throwIfDisposed(); - return batchToSpaceND(this, blockShape, crops); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) { - this.throwIfDisposed(); - return batchNorm(this, mean, variance, offset, scale, varianceEpsilon); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.broadcastTo = function (shape) { - this.throwIfDisposed(); - return broadcastTo(this, shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cast = function (dtype) { - this.throwIfDisposed(); - return cast(this, dtype); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.ceil = function () { - this.throwIfDisposed(); - return ceil(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.clipByValue = function (min, max) { - this.throwIfDisposed(); - return clipByValue(this, min, max); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.concat = function (x, axis) { - this.throwIfDisposed(); - if (x instanceof Tensor) { - x = [x]; - } - return concat([this, ...x], axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { - this.throwIfDisposed(); - return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv2dTranspose = - function (filter, outputShape, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cos = function () { - this.throwIfDisposed(); - return cos(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cosh = function () { - this.throwIfDisposed(); - return cosh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) { - this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) { - this.throwIfDisposed(); - return depthToSpace(this, blockSize, dataFormat); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.depthwiseConv2d = - function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { - this.throwIfDisposed(); - return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.dilation2d = - function (filter, strides, pad, dilations, dataFormat) { - this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad, dilations, dataFormat); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.divNoNan = function (b) { - this.throwIfDisposed(); - return divNoNan(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.div = function (b) { - this.throwIfDisposed(); - return div(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.dot = function (b) { - this.throwIfDisposed(); - return dot(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.elu = function () { - this.throwIfDisposed(); - return elu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.equal = function (b) { - this.throwIfDisposed(); - return equal(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.erf = function () { - this.throwIfDisposed(); - return erf(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.exp = function () { - this.throwIfDisposed(); - return exp(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.expandDims = function (axis) { - this.throwIfDisposed(); - return expandDims(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.expm1 = function () { - this.throwIfDisposed(); - return expm1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.fft = function () { - this.throwIfDisposed(); - return fft(this); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Flatten a Tensor to a 1D array. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.flatten = function () { - this.throwIfDisposed(); - return reshape(this, [this.size]); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.floor = function () { - this.throwIfDisposed(); - return floor(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.floorDiv = function (b) { - this.throwIfDisposed(); - return floorDiv(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.gather = function (indices, axis) { - this.throwIfDisposed(); - return gather(this, indices, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.greaterEqual = function (b) { - this.throwIfDisposed(); - return greaterEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.greater = function (b) { - this.throwIfDisposed(); - return greater(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.ifft = function () { - this.throwIfDisposed(); - return ifft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.irfft = function () { - this.throwIfDisposed(); - return irfft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isFinite = function () { - this.throwIfDisposed(); - return isFinite$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isInf = function () { - this.throwIfDisposed(); - return isInf(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.isNaN = function () { - this.throwIfDisposed(); - return isNaN$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.leakyRelu = function (alpha) { - this.throwIfDisposed(); - return leakyRelu(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.lessEqual = function (b) { - this.throwIfDisposed(); - return lessEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.less = function (b) { - this.throwIfDisposed(); - return less(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.localResponseNormalization = - function (depthRadius, bias, alpha, beta) { - this.throwIfDisposed(); - return localResponseNormalization(this, depthRadius, bias, alpha, beta); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSigmoid = function () { - this.throwIfDisposed(); - return logSigmoid(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSoftmax = function (axis) { - this.throwIfDisposed(); - return logSoftmax(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) { - this.throwIfDisposed(); - return logSumExp(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.log = function () { - this.throwIfDisposed(); - return log(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.log1p = function () { - this.throwIfDisposed(); - return log1p(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalAnd = function (b) { - this.throwIfDisposed(); - return logicalAnd(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalNot = function () { - this.throwIfDisposed(); - return logicalNot(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalOr = function (b) { - this.throwIfDisposed(); - return logicalOr(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.logicalXor = function (b) { - this.throwIfDisposed(); - return logicalXor(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) { - this.throwIfDisposed(); - return matMul(this, b, transposeA, transposeB); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.maxPool = - function (filterSize, strides, pad, dimRoundingMode) { - this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad, dimRoundingMode); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.max = function (axis, keepDims) { - this.throwIfDisposed(); - return max(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.maximum = function (b) { - this.throwIfDisposed(); - return maximum(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mean = function (axis, keepDims) { - this.throwIfDisposed(); - return mean(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.min = function (axis, keepDims) { - this.throwIfDisposed(); - return min(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.minimum = function (b) { - this.throwIfDisposed(); - return minimum(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) { - this.throwIfDisposed(); - return mirrorPad(this, paddings, mode); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mod = function (b) { - this.throwIfDisposed(); - return mod(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.mul = function (b) { - this.throwIfDisposed(); - return mul(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.neg = function () { - this.throwIfDisposed(); - return neg(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) { - this.throwIfDisposed(); - return norm(this, ord, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.notEqual = function (b) { - this.throwIfDisposed(); - return notEqual(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) { - this.throwIfDisposed(); - return oneHot(this, depth, onValue, offValue); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.onesLike = function () { - this.throwIfDisposed(); - return onesLike(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pad = function (paddings, constantValue) { - this.throwIfDisposed(); - return pad(this, paddings, constantValue); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) { - this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.pow = function (exp) { - this.throwIfDisposed(); - return pow(this, exp); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.prelu = function (alpha) { - this.throwIfDisposed(); - return prelu(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.prod = function (axis, keepDims) { - this.throwIfDisposed(); - return prod(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reciprocal = function () { - this.throwIfDisposed(); - return reciprocal(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.relu = function () { - this.throwIfDisposed(); - return relu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.relu6 = function () { - this.throwIfDisposed(); - return relu6(this); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * 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) { - this.throwIfDisposed(); - return reshape(this, x.shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reshape = function (shape) { - this.throwIfDisposed(); - return reshape(this, shape); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.resizeBilinear = - function (newShape2D, alignCorners, halfPixelCenters) { - this.throwIfDisposed(); - return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.resizeNearestNeighbor = - function (newShape2D, alignCorners, halfFloatCenters) { - this.throwIfDisposed(); - return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.reverse = function (axis) { - this.throwIfDisposed(); - return reverse(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.rfft = function () { - this.throwIfDisposed(); - return rfft(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.round = function () { - this.throwIfDisposed(); - return round$1(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.rsqrt = function () { - this.throwIfDisposed(); - return rsqrt(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.selu = function () { - this.throwIfDisposed(); - return selu(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.separableConv2d = - function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { - this.throwIfDisposed(); - return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sigmoid = function () { - this.throwIfDisposed(); - return sigmoid(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sign = function () { - this.throwIfDisposed(); - return sign(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sin = function () { - this.throwIfDisposed(); - return sin(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sinh = function () { - this.throwIfDisposed(); - return sinh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.slice = function (begin, size) { - this.throwIfDisposed(); - return slice(this, begin, size); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.softmax = function (dim) { - this.throwIfDisposed(); - return softmax(this, dim); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.softplus = function () { - this.throwIfDisposed(); - return softplus(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) { - this.throwIfDisposed(); - return spaceToBatchND(this, blockShape, paddings); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) { - this.throwIfDisposed(); - return split(this, numOrSizeSplits, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sqrt = function () { - this.throwIfDisposed(); - return sqrt(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.square = function () { - this.throwIfDisposed(); - return square(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.squaredDifference = function (b) { - this.throwIfDisposed(); - return squaredDifference(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.squeeze = function (axis) { - this.throwIfDisposed(); - return squeeze(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.stack = function (x, axis) { - this.throwIfDisposed(); - const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x]; - return stack(tensorsToBeStacked, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.step = function (alpha) { - this.throwIfDisposed(); - return step(this, alpha); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { - this.throwIfDisposed(); - return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sub = function (b) { - this.throwIfDisposed(); - return sub(this, b); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.sum = function (axis, keepDims) { - this.throwIfDisposed(); - return sum(this, axis, keepDims); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tan = function () { - this.throwIfDisposed(); - return tan(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tanh = function () { - this.throwIfDisposed(); - return tanh(this); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.tile = function (reps) { - this.throwIfDisposed(); - return tile(this, reps); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `bool` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toBool = function () { - this.throwIfDisposed(); - return cast(this, 'bool'); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `float32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toFloat = function () { - this.throwIfDisposed(); - return cast(this, 'float32'); -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Casts the array to type `int32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toInt = function () { - this.throwIfDisposed(); - return cast(this, 'int32'); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.topk = function (k, sorted) { - this.throwIfDisposed(); - return topk(this, k, sorted); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.transpose = function (perm) { - this.throwIfDisposed(); - return transpose(this, perm); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unique = function (axis) { - this.throwIfDisposed(); - return unique(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unsortedSegmentSum = - function (segmentIds, numSegments) { - this.throwIfDisposed(); - return unsortedSegmentSum(this, segmentIds, numSegments); - }; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.unstack = function (axis) { - this.throwIfDisposed(); - return unstack(this, axis); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.where = function (condition, x) { - this.throwIfDisposed(); - return where(condition, this, x); -}; - -/** - * @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. - * ============================================================================= - */ -getGlobalTensorClass().prototype.zerosLike = function () { - this.throwIfDisposed(); - return zerosLike(this); -}; - -/** - * @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. - * ============================================================================= - */ -const absGradConfig = { - kernelName: Abs, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, step(cast(x, 'float32'), -1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const acosGradConfig = { - kernelName: Acos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = square(cast(x, 'float32')); - const b = sqrt(sub(scalar(1), a)); - return neg(div(dy, b)); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const acoshGradConfig = { - kernelName: Acosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(sub(square(cast(x, 'float32')), 1)); - return div(dy, a); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const addGradConfig = { - kernelName: Add, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const addNGradConfig = { - kernelName: AddN, - saveAllInputs: true, - gradFunc: (dy, saved) => { - const ders = {}; - saved.forEach((_, i) => { - ders[i] = () => dy.clone(); - }); - return ders; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 argMaxGradConfig = { - kernelName: ArgMax, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 argMinGradConfig = { - kernelName: ArgMin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => zerosLike(x) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const asinGradConfig = { - kernelName: Asin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const asinhGradConfig = { - kernelName: Asinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const a = sqrt(add$1(scalar(1), square(cast(x, 'float32')))); - return div(dy, a); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atan2GradConfig = { - kernelName: Atan2, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const d = add$1(square(a), square(b)); - let res = mul(dy, div(b, d)); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - const d = add$1(square(a), square(b)); - let res = neg(mul(dy, div(a, d))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atanGradConfig = { - kernelName: Atan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(square(cast(x, 'float32')), 1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const atanhGradConfig = { - kernelName: Atanh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 3d avg pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank4 of shape - * [batchSize, depth, height, width, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad'); - const $input = convertToTensor(input, 'input', 'avgPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const avgPool3dGrad = op({ avgPool3dGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const avgPool3DGradConfig = { - kernelName: AvgPool3D, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of an 2D avg pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The input image, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ -function avgPoolGrad_(dy, input, filterSize, strides, pad) { - const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad'); - const $input = convertToTensor(input, 'input', 'avgPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); - let input4D = $input; - let dy4D = $dy; - let reshapedTo4D = false; - if ($input.rank === 3) { - reshapedTo4D = true; - input4D = - reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]); - dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]); - } - assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` + - `${dy4D.rank}.`); - assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` + - `${input4D.rank}.`); - const inputs = { dy: dy4D, input: input4D }; - const attrs = { filterSize, strides, pad }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs); - if (reshapedTo4D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); - } - return res; -} -const avgPoolGrad = op({ avgPoolGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const avgPoolGradConfig = { - kernelName: AvgPool, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { filterSize, strides, pad } = attrs; - return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const batchMatMulGradConfig = { - kernelName: BatchMatMul, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved, attrs) => { - const [a, b] = saved; - const { transposeA, transposeB } = attrs; - if (!transposeA && !transposeB) { - return { - a: () => matMul(dy, b, false, true), - b: () => matMul(a, dy, true, false) - }; - } - else if (!transposeA && transposeB) { - return { - a: () => matMul(dy, b, false, false), - b: () => matMul(dy, a, true, false) - }; - } - else if (transposeA && !transposeB) { - return { - a: () => matMul(b, dy, false, true), - b: () => matMul(a, dy, false, false) - }; - } - else { - return { - a: () => matMul(b, dy, true, true), - b: () => matMul(dy, a, true, true) - }; - } - } -}; - -/** - * @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. - * ============================================================================= - */ -const batchToSpaceNDGradConfig = { - kernelName: BatchToSpaceND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, crops } = attrs; - return { x: () => spaceToBatchND(dy, blockShape, crops) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const broadcastToGradConfig = { - kernelName: BroadcastTo, - gradFunc: (dy, saved, attrs) => { - const broadCastToAttrs = attrs; - const inputShape = broadCastToAttrs.inputShape; - const outputShape = broadCastToAttrs.shape; - const reps = Array.from(outputShape); - for (let i = inputShape.length - 1; i >= 0; i--) { - if (inputShape[i] === outputShape[i]) { - reps[i] = 1; - } - else if (inputShape[i] !== 1) { - throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); - } - } - const axes = []; - for (let i = 0; i < reps.length; i++) { - if (reps[i] > 1) { - axes.push(i); - } - } - return { x: () => sum(dy, axes, true /* keepDims */) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const castGradConfig = { - kernelName: Cast, - gradFunc: (dy) => { - return { x: () => dy.clone() }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const ceilGradConfig = { - kernelName: Ceil, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports it. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const clipByValueGradConfig = { - kernelName: ClipByValue, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { clipValueMin, clipValueMax } = attrs; - return { - x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)), - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const complexAbsGradConfig = { - kernelName: ComplexAbs, - inputsToSave: ['x'], - gradFunc: absGradConfig.gradFunc, -}; - -/** - * @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. - * ============================================================================= - */ -const concatGradConfig = { - kernelName: Concat, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const shapes = saved.map(t => t.shape); - const { axis } = attrs; - const $axis = parseAxisParam(axis, saved[0].shape)[0]; - const sizeSplits = shapes.map(s => s[$axis]); - const derTensors = split(dy, sizeSplits, $axis); - return derTensors.map(t => () => t); - } -}; - -/** - * @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. - * ============================================================================= - */ -const conv2DGradConfig = { - kernelName: Conv2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x4D, $filter] = saved; - const { dilations, strides, pad, dataFormat } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' + - `are not yet supported in gradients. Got dilations '${dilations}'`); - return { - x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat), - filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const conv2DBackpropInputGradConfig = { - kernelName: Conv2DBackpropInput, - inputsToSave: ['dy', 'filter'], - gradFunc: (ddx, saved, attrs) => { - const [dy, filter] = saved; - const { strides, pad, dataFormat, dimRoundingMode } = attrs; - return { - dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode), - filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the derivative of the filter of a 3D convolution. - * - * @param x The input tensor, of rank 5 or rank 4 of shape - * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is - * assumed. - * @param dy The dy image, of rank 5 or rank 4, of shape - * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is - * assumed. - * @param filterShape The shape of the filter, length 5, - * [filterDepth, filterHeight, filterWidth, inDepth, outDepth]. - * @param strides The strides of the convolution: [strideDepth, strideHeight, - * strideWidth]. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - */ -function conv3DBackpropFilter_(x, dy, filterShape, strides, pad) { - let x5D = x; - if (x.rank === 4) { - x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); - } - let dy5D = dy; - if (dy5D.rank === 4) { - dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); - } - assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` + - `${x5D.shape}.`); - assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` + - `${dy5D.shape}.`); - assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` + - `${filterShape}.`); - assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` + - `match input depth in filter (${filterShape[3]}.`); - assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` + - `match output depth for filter (${filterShape[4]}).`); - const inputs = { x: x5D, dy: dy5D }; - const attrs = { strides, pad, filterShape }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs); -} -const conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); - -/** - * @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. - * ============================================================================= - */ -const conv3DGradConfig = { - kernelName: Conv3D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad } = attrs; - assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' + - `not yet supported in gradients. Got dilations '${dilations}'`); - const [x5D, $filter] = saved; - return { - x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad), - filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const cosGradConfig = { - kernelName: Cos, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const coshGradConfig = { - kernelName: Cosh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(sinh(cast(x, 'float32')), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const cumsumGradConfig = { - kernelName: Cumsum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis, exclusive, reverse } = attrs; - return { - x: () => { - const permutation = getAxesPermutation([axis], x.rank); - let out = cumsum(dy, axis, exclusive, !reverse); - if (permutation != null) { - out = transpose(out, permutation); - } - return out; - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const depthwiseConv2dNativeGradConfig = { - kernelName: DepthwiseConv2dNative, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad, dimRoundingMode } = attrs; - const $dilations = dilations == null ? [1, 1] : dilations; - assert(tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' + - `greater than 1 are not yet supported. Got dilations ` + - `'${$dilations}'`); - const [x, filter] = saved; - assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` + - `rank 4, but got rank ${x.rank}.`); - assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` + - `rank 4, but got rank ${filter.rank}.`); - assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` + - `channels (${x.shape[3]}) must match the inChannels dimension ` + - `in filter ${filter.shape[2]}.`); - assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' + - `dilations must be 1. Got strides ${strides} and dilations ` + - `'${$dilations}'.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - return { - x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode), - filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode), - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const dilation2dGradConfig = { - kernelName: Dilation2D, - inputsToSave: ['x', 'filter'], - gradFunc: (dy, saved, attrs) => { - const [x, filter] = saved; - const inputInputs = { x, filter, dy }; - const filterInputs = { x, filter, dy }; - return { - x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs), - filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const eluGradConfig = { - kernelName: Elu, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - const inputs = { dy, y }; - return { x: () => ENGINE.runKernel(EluGrad, inputs) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const erfGradConfig = { - kernelName: Erf, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI)); - return { x: () => mul(dy, a) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expGradConfig = { - kernelName: Exp, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, y) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expandDimsGradConfig = { - kernelName: ExpandDims, - inputsToSave: ['input'], - gradFunc: (dy, saved) => { - const [input] = saved; - return { input: () => reshape(dy, input.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const expm1GradConfig = { - kernelName: Expm1, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, exp(x)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const floorGradConfig = { - kernelName: Floor, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const floorDivGradConfig = { - kernelName: FloorDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const fusedBatchNormGradConfig = { - kernelName: FusedBatchNorm, - inputsToSave: ['x', 'mean', 'variance', 'scale'], - gradFunc: (dy, saved, attrs) => { - const { varianceEpsilon } = attrs; - const [x, mean, variance, scale] = saved; - const scaleValue = scale == null ? scalar(1) : scale; - const reductionAxes = getReductionAxes(mean.shape, x.shape); - const tileShape = []; - if (mean.rank === 1) { - for (let i = 0; i < x.shape.length - 1; ++i) { - tileShape.push(x.shape[i]); - } - tileShape.push(1); - } - const xMinusMean = sub(x, mean); - const dyTimesScaleValue = mul(dy, scaleValue); - const oneOverSqrtVariance = rsqrt(add$1(variance, scalar(varianceEpsilon))); - const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); - const derX = () => { - if (mean.rank === 1) { - return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape); - } - else { - return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); - } - }; - const derMean = () => { - let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); - if (mean.rank === 1) { - meanDer = sum(meanDer, reductionAxes); - } - return reshape(meanDer, mean.shape); - }; - const derVariance = () => { - let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); - if (mean.rank === 1) { - varianceDer = sum(varianceDer, reductionAxes); - } - return reshape(varianceDer, mean.shape); - }; - const derScale = () => { - const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); - let scaleDer = mul(dy, xMinusMean2TimesRsqrt); - if (mean.rank === 1) { - scaleDer = sum(scaleDer, reductionAxes); - } - return reshape(scaleDer, mean.shape); - }; - const derOffset = () => { - let offsetDer = dy; - if (mean.rank === 1) { - offsetDer = sum(offsetDer, reductionAxes); - } - return reshape(offsetDer, mean.shape); - }; - return { - x: derX, - mean: derMean, - variance: derVariance, - scale: derScale, - offset: derOffset - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const gatherGradConfig = { - kernelName: GatherV2, - inputsToSave: ['x', 'indices'], - gradFunc: (dy, saved, attrs) => { - const [x, indices] = saved; - const { axis } = attrs; - const parsedAxis = parseAxisParam(axis, x.shape)[0]; - const derX = () => { - const paramsShape = x.shape; - const indicesSize = indices.size; - const outerShape = paramsShape.slice(0, parsedAxis); - const outerDims = outerShape.length; - const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); - const innerDims = innerShape.length; - const outerAxesIndices = arrayRange(0, outerDims); - const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); - const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); - const values = reshape(dy, valuesShape); - const reshapedIndices = reshape(indices, [indicesSize]); - const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); - const valuesTranspose = transpose(values, transposeDims); - let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]); - const invertTransposeDims = getUndoAxesPermutation(transposeDims); - paramsGrad = transpose(paramsGrad, invertTransposeDims); - return paramsGrad; - }; - return { x: derX, indices: () => indices }; - } -}; -function arrayRange(start, stop) { - const result = []; - for (let i = start; i < stop; ++i) { - result.push(i); - } - return result; -} -function arrayConcat(arrays) { - const result = []; - for (let i = 0; i < arrays.length; ++i) { - for (let j = 0; j < arrays[i].length; ++j) { - result.push(arrays[i][j]); - } - } - return result; -} - -/** - * @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. - * ============================================================================= - */ -const greaterEqualGradConfig = { - kernelName: GreaterEqual, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - return { a: () => zerosLike(a), b: () => zerosLike(b) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const identityGradConfig = { - kernelName: Identity, - gradFunc: (dy) => { - return { x: () => cast(dy, 'float32') }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isFiniteGradConfig = { - kernelName: IsFinite, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isInfGradConfig = { - kernelName: IsInf, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const isNanGradConfig = { - kernelName: IsNan, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const leakyReluGradConfig = { - kernelName: LeakyRelu, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { alpha } = attrs; - const mask = greater(x, 0); - // Returns `gradients * (features > 0) + alpha * gradients * (features <= - // 0)`. - return { x: () => where(mask, dy, mul(dy, alpha)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const log1pGradConfig = { - kernelName: Log1p, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, add$1(x, 1)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const logGradConfig = { - kernelName: Log, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, cast(x, 'float32')) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const logSoftmaxGradConfig = { - kernelName: LogSoftmax, - inputsToSave: [], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [value] = saved; - const { axis } = attrs; - return { - logits: () => { - const keepDims = true; - const softmax = exp(value); - return sub(dy, mul(sum(dy, axis, keepDims), softmax)); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -function localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { - const inputs = { x, y, dy }; - const attrs = { depthRadius, bias, alpha, beta }; - return ENGINE.runKernel(LRNGrad, inputs, attrs); -} -const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ }); - -/** - * @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. - * ============================================================================= - */ -const lrnGradConfig = { - kernelName: LRN, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { depthRadius, bias, alpha, beta } = attrs; - return { - x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Gradient helper function for the min and max operations. - */ -function gradForMinAndMax(dy, y, xOrig, origAxes) { - if (y.rank < xOrig.rank) { - y = reshape(y, expandShapeToKeepDim(y.shape, origAxes)); - } - if (dy.rank < xOrig.rank) { - dy = reshape(dy, expandShapeToKeepDim(dy.shape, origAxes)); - } - return { - x: () => { - const dx = mul(dy, cast(equal(xOrig, y), dy.dtype)); - return dx; - } - }; -} - -/** - * @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. - * ============================================================================= - */ -const maxGradConfig = { - kernelName: Max, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const maxAttrs = attrs; - const { reductionIndices } = maxAttrs; - const x = saved[0]; - const y = saved[1]; - const origAxes = parseAxisParam(reductionIndices, x.shape); - const maxGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return maxGrad['x'](); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const maximumGradConfig = { - kernelName: Maximum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(less(a, b), 'float32')); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 3d max pool. - * - * @param dy The dy error, of rank 5 of shape - * [batchSize, depth, height, width, channels]. - * assumed. - * @param input The original input image, of rank 5 or rank 4 of shape - * [batchSize, depth, height, width, channels]. - * @param output The original output image, of rank 5 of shape - * [batchSize, outDepth, outHeight, outWidth, channels]. - * @param filterSize The filter size: - * `[filterDepth, filterHeight, filterWidth]`. - * `filterSize` is a single number, - * then `filterDepth == filterHeight == filterWidth`. - * @param strides The strides of the pooling: - * `[strideDepth, strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad'); - const $input = convertToTensor(input, 'input', 'maxPool3dGrad'); - const $output = convertToTensor(output, 'output', 'maxPool3dGrad'); - let dy5D = $dy; - let input5D = $input; - let output5D = $output; - let reshapedTo5D = false; - if ($input.rank === 4) { - reshapedTo5D = true; - dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); - input5D = reshape($input, [ - 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3] - ]); - output5D = reshape($output, [ - 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3] - ]); - } - assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` + - `${dy5D.rank}.`); - assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` + - `${input5D.rank}.`); - assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` + - `${output5D.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` + - `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: dy5D, input: input5D, output: output5D }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs); - if (reshapedTo5D) { - return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); - } - return res; -} -const maxPool3dGrad = op({ maxPool3dGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const maxPool3DGradConfig = { - kernelName: MaxPool3D, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad, dimRoundingMode } = attrs; - return { - x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -/** - * Computes the backprop of a 2D max pool. - * - * @param dy The dy error, of rank 4 or rank 3 of shape - * [batchSize, height, width, channels]. If rank 3, batch of 1 is - * assumed. - * @param input The original input image, of rank 4, of shape - * [batchSize, height, width, channels]. - * @param output The original output image, of rank 4, of shape - * [batchSize, outHeight, outWidth, channels]. - * @param filterSize The filter size: `[filterHeight, filterWidth]`. If - * `filterSize` is a single number, then `filterHeight == filterWidth`. - * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If - * `strides` is a single number, then `strideHeight == strideWidth`. - * @param pad A string from: 'same', 'valid'. The type of padding algorithm - * used in the forward prop of the op. - * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is - * provided, it will default to truncate. - */ -function maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) { - const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad'); - const $input = convertToTensor(input, 'input', 'maxPoolGrad'); - const $output = convertToTensor(output, 'output', 'maxPoolGrad'); - assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` + - `(${$dy.rank})`); - assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` + - `${$dy.rank}.`); - assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` + - `${$input.rank}.`); - if (dimRoundingMode != null) { - assert(isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` + - `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); - } - const inputs = { dy: $dy, input: $input, output: $output }; - const attrs = { filterSize, strides, pad, dimRoundingMode }; - // tslint:disable-next-line: no-unnecessary-type-assertion - return ENGINE.runKernel(MaxPoolGrad, inputs, attrs); -} -const maxPoolGrad = op({ maxPoolGrad_ }); - -/** - * @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. - * ============================================================================= - */ -const maxPoolGradConfig = { - kernelName: MaxPool, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [x, y] = saved; - const { filterSize, strides, pad } = attrs; - return { - x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const meanGradConfig = { - kernelName: Mean, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - const shapes = computeOutAndReduceShapes(x.shape, axes); - const reduceShape = shapes[1]; - const reduceSize = sizeFromShape(reduceShape); - const derX = () => { - const expandedDyShape = x.shape.slice(); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const res = div(mul(expandedDy, ones$1(x.shape, 'float32')), reduceSize); - return res; - }; - return { x: derX }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const minGradConfig = { - kernelName: Min, - inputsToSave: ['x'], - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const minAttrs = attrs; - const { axis } = minAttrs; - const [x, y] = saved; - const origAxes = parseAxisParam(axis, x.shape); - const minGrad = gradForMinAndMax(dy, y, x, origAxes); - return { - x: () => { - return minGrad['x'](); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const minimumGradConfig = { - kernelName: Minimum, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const derA = () => mul(dy, cast(lessEqual(a, b), 'float32')); - const derB = () => mul(dy, cast(greater(a, b), 'float32')); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const mirrorPadGradConfig = { - kernelName: MirrorPad, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const modGradConfig = { - kernelName: Mod, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(dy, reduceAxes), a.shape); - } - return dy; - }; - const derB = () => { - const res = mul(dy, neg(floor(div(a, b)))); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const multiplyGradConfig = { - kernelName: Multiply, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = mul(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - const res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), b.shape); - } - return res; - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const negGradConfig = { - kernelName: Neg, - gradFunc: (dy) => { - return { x: () => neg(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const oneHotGradConfig = { - kernelName: OneHot, - inputsToSave: ['indices'], - gradFunc: (dy, saved) => { - const indices = saved[0]; - return { indices: () => zeros(indices.shape, 'float32') }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const onesLikeGradConfig = { - kernelName: OnesLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const packGradConfig = { - kernelName: Pack, - saveAllInputs: true, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - const derTensors = unstack(dy, axis); - return derTensors.map(t => () => t); - } -}; - -/** - * @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. - * ============================================================================= - */ -const padV2GradConfig = { - kernelName: PadV2, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - // Pad introduces values around the original tensor, so the gradient - // slices the original shape out of the gradient. - const x = saved[0]; - const { paddings } = attrs; - const begin = paddings.map(p => p[0]); - return { x: () => slice(dy, begin, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const powGradConfig = { - kernelName: Pow, - inputsToSave: ['a', 'b'], - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [a, b, y] = saved; - const base = a; - const exp = b; - const outShape = assertAndGetBroadcastShape(base.shape, exp.shape); - const derBase = () => { - const expFloat = cast(exp, 'float32'); - let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1))))); - const reduceAxes = getReductionAxes(base.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, base.shape); - }; - const derExp = () => { - const condition = greater(base, 0); - const logBase = where(condition, log(base), zerosLike(base)); - let res = mul(dy, mul(y, logBase)); - const reduceAxes = getReductionAxes(exp.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, exp.shape); - }; - return { a: derBase, b: derExp }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const preluGradConfig = { - kernelName: Prelu, - inputsToSave: ['x', 'alpha'], - gradFunc: (dy, saved) => { - const [x, alpha] = saved; - const mask = greater(x, 0); - return { - x: () => where(mask, dy, mul(dy, alpha)), - alpha: () => { - let res = where(mask, zerosLike(dy), mul(dy, x)); - const reduceAxes = getReductionAxes(alpha.shape, dy.shape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, alpha.shape); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const divGradConfig = { - kernelName: RealDiv, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - const res = div(dy, cast(b, 'float32')); - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - return reshape(sum(res, reduceAxes), a.shape); - } - return res; - }; - const derB = () => { - let res = mul(dy, cast(a, 'float32')); - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = reshape(sum(res, reduceAxes), b.shape); - } - const tmp = square(b); - return neg(div(res, cast(tmp, 'float32'))); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reciprocalGradConfig = { - kernelName: Reciprocal, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, neg(square(x))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const relu6GradConfig = { - kernelName: Relu6, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - const mask = mul(lessEqual(x, 6), step(x)); - return { x: () => mul(dy, cast(mask, 'float32')) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reluGradConfig = { - kernelName: Relu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, cast(step(x), 'float32')) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 reshapeGradConfig = { - kernelName: Reshape, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => reshape(dy, x.shape) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const resizeBilinearGradConfig = { - kernelName: ResizeBilinear, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs); - return { images: imagesDer }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const resizeNearestNeighborGradConfig = { - kernelName: ResizeNearestNeighbor, - inputsToSave: ['images'], - gradFunc: (dy, saved, attrs) => { - const [images] = saved; - const inputs = { dy, images }; - const imagesDer = () => - // tslint:disable-next-line: no-unnecessary-type-assertion - ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs); - return { images: imagesDer }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const reverseGradConfig = { - kernelName: Reverse, - gradFunc: (dy, saved, attrs) => { - const { dims } = attrs; - const axes = parseAxisParam(dims, dy.shape); - return { x: () => reverse(dy, axes) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const roundGradConfig = { - kernelName: Round, - gradFunc: (dy) => { - // TODO(nsthorat): Let gradients be null for cases where we want to stop - // backpropgation. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const rsqrtGradConfig = { - kernelName: Rsqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const selectGradConfig = { - kernelName: Select, - inputsToSave: ['condition'], - gradFunc: (dy, saved) => { - const [condition] = saved; - return { - // TODO(julianoks): Return null for condition gradient - // when backprop supports it. - condition: () => cast(zerosLike(condition), 'float32'), - t: () => mul(dy, cast(condition, dy.dtype)), - e: () => mul(dy, cast(logicalNot(condition), dy.dtype)) - }; - } -}; - -/** - * @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 SELU_SCALEALPHA = 1.7580993408473768599402175208123; -const SELU_SCALE = 1.0507009873554804934193349852946; - -/** - * @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. - * ============================================================================= - */ -const seluGradConfig = { - kernelName: Selu, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { - x: () => { - const mask = greater(x, scalar(0)); - const scaleAlpha = scalar(SELU_SCALEALPHA); - const scale = scalar(SELU_SCALE); - const greaterThanZeroDer = mul(dy, scale); - const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32'))); - return where(mask, greaterThanZeroDer, lessEqualZeroDer); - } - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sigmoidGradConfig = { - kernelName: Sigmoid, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(dy, mul(y, sub(scalar(1), y))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const signGradConfig = { - kernelName: Sign, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sinGradConfig = { - kernelName: Sin, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cos(cast(x, 'float32')), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sinhGradConfig = { - kernelName: Sinh, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(cosh(cast(x, 'float32')), dy) }; - } -}; - -/** - * @license - * Copyright 2017 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 parseSliceParams(x, begin, size) { - // The following logic allows for more ergonomic calls. - let begin_; - const xRank = x.shape.length; - if (typeof begin === 'number') { - begin_ = [begin, ...new Array(xRank - 1).fill(0)]; - } - else if (begin.length < xRank) { - begin_ = begin.concat(new Array(xRank - begin.length).fill(0)); - } - else { - begin_ = begin.slice(); - } - begin_.forEach(d => { - assert(d !== -1, () => 'slice() does not support negative begin indexing.'); - }); - let size_; - if (size == null) { - size_ = new Array(xRank).fill(-1); - } - else if (typeof size === 'number') { - size_ = [size, ...new Array(xRank - 1).fill(-1)]; - } - else if (size.length < xRank) { - size_ = size.concat(new Array(xRank - size.length).fill(-1)); - } - else { - size_ = size; - } - size_ = size_.map((d, i) => { - if (d >= 0) { - return d; - } - else { - assert(d === -1, () => `Negative size values should be exactly -1 but got ` + - `${d} for the slice() size at index ${i}.`); - return x.shape[i] - begin_[i]; - } - }); - return [begin_, size_]; -} - -/** - * @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. - * ============================================================================= - */ -const sliceGradConfig = { - kernelName: Slice, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { begin, size } = attrs; - const inputShape = x.shape; - const [begin_, size_] = parseSliceParams(x, begin, size); - // Create an Nx2 padding where the first column represents how many - // zeros are prepended (at start) for each dimension, and the second - // column indicates how many zeros are appended (at end). - // The number of zeros to append is the shape of the input - // elementwise-subtracted by both the begin vector and sizes vector. - const paddings = []; - for (let i = 0; i < dy.rank; i++) { - paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); - } - return { x: () => pad(dy, paddings) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const softmaxGradConfig = { - kernelName: Softmax, - outputsToSave: [true], - gradFunc: (dy, saved, attrs) => { - const [y] = saved; - const { dim } = attrs; - const keepDims = true; - const dyTimesY = mul(dy, y); - return { - logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y)) - }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const softplusGradConfig = { - kernelName: Softplus, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, sigmoid(x)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const spaceToBatchNDGradConfig = { - kernelName: SpaceToBatchND, - gradFunc: (dy, saved, attrs) => { - const { blockShape, paddings } = attrs; - return { x: () => batchToSpaceND(dy, blockShape, paddings) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const splitVGradConfig = { - kernelName: SplitV, - gradFunc: (dy, saved, attrs) => { - const { axis } = attrs; - return { x: () => concat(dy, axis) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const sqrtGradConfig = { - kernelName: Sqrt, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const squareGradConfig = { - kernelName: Square, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const squaredDifferenceGradConfig = { - kernelName: SquaredDifference, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const two = scalar(2); - const derA = () => mul(dy, mul(two, sub(a, b))); - const derB = () => mul(dy, mul(two, sub(b, a))); - return { a: derA, b: derB }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const stepGradConfig = { - kernelName: Step, - gradFunc: (dy) => { - // TODO(manrajgrover): Return null for gradients when backprop supports - // it. - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const subGradConfig = { - kernelName: Sub, - inputsToSave: ['a', 'b'], - gradFunc: (dy, saved) => { - const [a, b] = saved; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const derA = () => { - let res = dy; - const reduceAxes = getReductionAxes(a.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(res, a.shape); - }; - const derB = () => { - let res = dy; - const reduceAxes = getReductionAxes(b.shape, outShape); - if (reduceAxes.length > 0) { - res = sum(res, reduceAxes); - } - return reshape(neg(res), b.shape); - }; - return { a: derA, b: derB }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 sumGradConfig = { - kernelName: Sum, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const expandedDyShape = x.shape.slice(); - const { axis } = attrs; - const axes = parseAxisParam(axis, x.shape); - axes.forEach(axis => { - expandedDyShape[axis] = 1; - }); - const expandedDy = reshape(dy, expandedDyShape); - const derX = mul(expandedDy, ones$1(x.shape, 'float32')); - return { x: () => derX }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tanGradConfig = { - kernelName: Tan, - inputsToSave: ['x'], - gradFunc: (dy, saved) => { - const [x] = saved; - return { x: () => div(dy, square(cos(x))) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tanhGradConfig = { - kernelName: Tanh, - outputsToSave: [true], - gradFunc: (dy, saved) => { - const [y] = saved; - return { x: () => mul(sub(scalar(1), square(y)), dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const tileGradConfig = { - kernelName: Tile, - inputsToSave: ['x'], - gradFunc: (dy, saved, attrs) => { - const [x] = saved; - const { reps } = attrs; - const derX = () => { - let xGrad = zerosLike(x); - // TODO(cais): Maybe reduce memory footprint by avoiding repeated - // slicing. - if (x.rank === 1) { - for (let i = 0; i < reps[0]; ++i) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]])); - } - } - else if (x.rank === 2) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - xGrad = add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [ - x.shape[0], x.shape[1] - ])); - } - } - } - else if (x.rank === 3) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - xGrad = - add$1(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); - } - } - } - } - else if (x.rank === 4) { - for (let i = 0; i < reps[0]; ++i) { - for (let j = 0; j < reps[1]; ++j) { - for (let k = 0; k < reps[2]; ++k) { - for (let l = 0; l < reps[3]; ++l) { - xGrad = - add$1(xGrad, slice(dy, [ - i * x.shape[0], j * x.shape[1], k * x.shape[2], - l * x.shape[3] - ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); - } - } - } - } - } - else { - throw new Error(`Gradient for tile operation is not implemented for rank-` + - `${x.rank} tensors yet.`); - } - return xGrad; - }; - return { x: derX }; - }, -}; - -/** - * @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. - * ============================================================================= - */ -const transposeGradConfig = { - kernelName: Transpose, - gradFunc: (dy, saved, attrs) => { - const transposeAttrs = attrs; - const { perm } = transposeAttrs; - const undoPerm = getUndoAxesPermutation(perm); - return { x: () => transpose(dy, undoPerm) }; - } -}; - -/** - * @license - * Copyright 2020 Google Inc. 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 unpackGradConfig = { - kernelName: Unpack, - gradFunc: (dy, saved, attrs) => { - const unpackAttrs = attrs; - const { axis } = unpackAttrs; - return { value: () => stack(dy, axis) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -const unsortedSegmentSumGradConfig = { - kernelName: UnsortedSegmentSum, - inputsToSave: ['segmentIds'], - gradFunc: (dy, saved) => { - const [segmentIds] = saved; - const derX = () => { - return gatherDropNegatives(dy, segmentIds); - }; - return { x: derX }; - } -}; -function gatherDropNegatives(x, indices) { - // Helper function for unsorted segment ops. Gathers params for - // positive segment ids and gathers 0 for inputs with negative segment id. - // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py - const zeroClippedIndices = maximum(indices, zerosLike(indices)); - const gathered = gather(x, zeroClippedIndices); - let isPositive = greaterEqual(indices, scalar(0, 'int32')); - const numIters = gathered.rank - isPositive.rank; - for (let i = 0; i < numIters; ++i) { - isPositive = expandDims(isPositive, i + 1); - } - isPositive = logicalAnd(isPositive, ones$1(gathered.shape, 'bool')); - const zeroSlice = zerosLike(gathered); - return where(isPositive, gathered, zeroSlice); -} - -/** - * @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. - * ============================================================================= - */ -const zerosLikeGradConfig = { - kernelName: ZerosLike, - gradFunc: (dy) => { - return { x: () => zerosLike(dy) }; - } -}; - -/** - * @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. - * ============================================================================= - */ -// Export all kernel configs here so that the package can auto register them -const gradConfigs = [ - absGradConfig, - acosGradConfig, - acoshGradConfig, - addGradConfig, - addNGradConfig, - argMaxGradConfig, - argMinGradConfig, - asinGradConfig, - asinhGradConfig, - atan2GradConfig, - atanGradConfig, - atanhGradConfig, - avgPool3DGradConfig, - avgPoolGradConfig, - batchMatMulGradConfig, - batchToSpaceNDGradConfig, - broadcastToGradConfig, - castGradConfig, - ceilGradConfig, - clipByValueGradConfig, - complexAbsGradConfig, - concatGradConfig, - conv2DBackpropInputGradConfig, - conv2DGradConfig, - conv3DGradConfig, - cosGradConfig, - coshGradConfig, - cumsumGradConfig, - depthwiseConv2dNativeGradConfig, - dilation2dGradConfig, - divGradConfig, - eluGradConfig, - erfGradConfig, - expGradConfig, - expandDimsGradConfig, - expm1GradConfig, - floorDivGradConfig, - floorGradConfig, - fusedBatchNormGradConfig, - gatherGradConfig, - greaterEqualGradConfig, - identityGradConfig, - isFiniteGradConfig, - isInfGradConfig, - isNanGradConfig, - leakyReluGradConfig, - log1pGradConfig, - logGradConfig, - logSoftmaxGradConfig, - lrnGradConfig, - maxGradConfig, - maxGradConfig, - maximumGradConfig, - maxPool3DGradConfig, - maxPoolGradConfig, - meanGradConfig, - minGradConfig, - minimumGradConfig, - mirrorPadGradConfig, - modGradConfig, - multiplyGradConfig, - negGradConfig, - oneHotGradConfig, - onesLikeGradConfig, - packGradConfig, - padV2GradConfig, - padV2GradConfig, - powGradConfig, - preluGradConfig, - reciprocalGradConfig, - relu6GradConfig, - reluGradConfig, - reshapeGradConfig, - resizeBilinearGradConfig, - resizeNearestNeighborGradConfig, - reverseGradConfig, - roundGradConfig, - rsqrtGradConfig, - selectGradConfig, - seluGradConfig, - sigmoidGradConfig, - signGradConfig, - sinGradConfig, - sinhGradConfig, - sliceGradConfig, - softmaxGradConfig, - softplusGradConfig, - spaceToBatchNDGradConfig, - spaceToBatchNDGradConfig, - splitVGradConfig, - splitVGradConfig, - sqrtGradConfig, - squaredDifferenceGradConfig, - squareGradConfig, - stepGradConfig, - subGradConfig, - sumGradConfig, - tanGradConfig, - tanhGradConfig, - tileGradConfig, - transposeGradConfig, - unpackGradConfig, - unsortedSegmentSumGradConfig, - zerosLikeGradConfig -]; -for (const gradientConfig of gradConfigs) { - registerGradient(gradientConfig); -} - -/*! ***************************************************************************** -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 __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -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 }; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var _epsilon; -/** - * Returns the value of the fuzz factor used in numeric expressions. - */ -function epsilon() { - if (_epsilon == null) { - _epsilon = tfc.backend().epsilon(); - } - return _epsilon; -} -/** - * Returns the default image data format convention. - */ -function imageDataFormat() { - return 'channelsLast'; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ -// tslint:enable -/** - * Equivalent of Python's AttributeError. - */ -var AttributeError = /** @class */ (function (_super) { - __extends(AttributeError, _super); - function AttributeError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, AttributeError.prototype); - return _this; - } - return AttributeError; -}(Error)); -/** - * Equivalent of Python's RuntimeError. - */ -var RuntimeError = /** @class */ (function (_super) { - __extends(RuntimeError, _super); - function RuntimeError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, RuntimeError.prototype); - return _this; - } - return RuntimeError; -}(Error)); -/** - * Equivalent of Python's ValueError. - */ -var ValueError = /** @class */ (function (_super) { - __extends(ValueError, _super); - function ValueError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, ValueError.prototype); - return _this; - } - return ValueError; -}(Error)); -/** - * Equivalent of Python's NotImplementedError. - */ -var NotImplementedError = /** @class */ (function (_super) { - __extends(NotImplementedError, _super); - function NotImplementedError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, NotImplementedError.prototype); - return _this; - } - return NotImplementedError; -}(Error)); -/** - * Equivalent of Python's AssertionError. - */ -var AssertionError = /** @class */ (function (_super) { - __extends(AssertionError, _super); - function AssertionError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, AssertionError.prototype); - return _this; - } - return AssertionError; -}(Error)); -/** - * Equivalent of Python's IndexError. - */ -var IndexError = /** @class */ (function (_super) { - __extends(IndexError, _super); - function IndexError(message) { - var _this = _super.call(this, message) || this; - // Set the prototype explicitly. - Object.setPrototypeOf(_this, IndexError.prototype); - return _this; - } - return IndexError; -}(Error)); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ -// tslint:disable-next-line:no-any -function pyListRepeat(value, numValues) { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - var newArray = []; - for (var i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } - else { - var newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } -} -function assert$1(val, message) { - if (!val) { - throw new AssertionError(message); - } -} -/** - * Count the number of elements of the `array` that are equal to `reference`. - */ -function count(array, refernce) { - var counter = 0; - for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { - var item = array_1[_i]; - if (item === refernce) { - counter++; - } - } - return counter; -} -/** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ -function singletonOrArray(xs) { - if (xs.length === 1) { - return xs[0]; - } - return xs; -} -/** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ -// tslint:disable-next-line:no-any -function toList(x) { - if (Array.isArray(x)) { - return x; - } - return [x]; -} -/** - * Converts string to snake-case. - * @param name - */ -function toSnakeCase(name) { - var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; -} -function toCamelCase(identifier) { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); -} -// tslint:disable-next-line:no-any -var _GLOBAL_CUSTOM_OBJECTS = {}; -function serializeKerasObject(instance) { - if (instance === null || instance === undefined) { - return null; - } - var dict = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; -} -/** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ -function convertNDArrayScalarsInConfig(config) { - if (config == null || typeof config !== 'object') { - return; - } - else if (Array.isArray(config)) { - config.forEach(function (configItem) { return convertNDArrayScalarsInConfig(configItem); }); - } - else { - var fields = Object.keys(config); - for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) { - var field = fields_1[_i]; - var value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } - else { - convertNDArrayScalarsInConfig(value); - } - } - } - } -} -/** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ -// tslint:disable:no-any -function deserializeKerasObject(identifier, moduleObjects, customObjects, printableModuleName, fastWeightInit) { - var _a, _b, _c; - if (moduleObjects === void 0) { moduleObjects = {}; } - if (customObjects === void 0) { customObjects = {}; } - if (printableModuleName === void 0) { printableModuleName = 'object'; } - if (fastWeightInit === void 0) { fastWeightInit = false; } - // tslint:enable - if (typeof identifier === 'string') { - var functionName = identifier; - var fn = void 0; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } - else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } - else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError("Unknown " + printableModuleName + ": " + identifier + ". " + - "This may be due to one of the following reasons:\n" + - ("1. The " + printableModuleName + " is defined in Python, in which ") + - "case it needs to be ported to TensorFlow.js or your JavaScript " + - "code.\n" + - ("2. The custom " + printableModuleName + " is defined in JavaScript, ") + - "but is not registered properly with " + - "tf.serialization.registerClass()."); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } - else { - // In this case we are dealing with a Keras config dictionary. - var config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError(printableModuleName + ": Improper config format: " + - (JSON.stringify(config) + ".\n") + - "'className' and 'config' must set."); - } - var className = config['className']; - var cls = void 0, fromConfig = void 0; - if (className in customObjects) { - _a = customObjects[className], cls = _a[0], fromConfig = _a[1]; - } - else if (className in _GLOBAL_CUSTOM_OBJECTS) { - _b = _GLOBAL_CUSTOM_OBJECTS['className'], cls = _b[0], fromConfig = _b[1]; - } - else if (className in moduleObjects) { - _c = moduleObjects[className], cls = _c[0], fromConfig = _c[1]; - } - if (cls == null) { - throw new ValueError("Unknown " + printableModuleName + ": " + className + ". " + - "This may be due to one of the following reasons:\n" + - ("1. The " + printableModuleName + " is defined in Python, in which ") + - "case it needs to be ported to TensorFlow.js or your JavaScript " + - "code.\n" + - ("2. The custom " + printableModuleName + " is defined in JavaScript, ") + - "but is not registered properly with " + - "tf.serialization.registerClass()."); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - // tslint:disable-next-line:no-any - var customObjectsCombined = {}; - for (var _i = 0, _d = Object.keys(_GLOBAL_CUSTOM_OBJECTS); _i < _d.length; _i++) { - var key = _d[_i]; - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (var _e = 0, _f = Object.keys(customObjects); _e < _f.length; _e++) { - var key = _f[_e]; - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - var nestedConfig = config['config']; - nestedConfig['customObjects'] = customObjectsCombined; - var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (var _g = 0, _h = Object.keys(customObjects); _g < _h.length; _g++) { - var key = _h[_g]; - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - var returnObj = fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); - return returnObj; - } - else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (var _j = 0, _k = Object.keys(customObjects); _j < _k.length; _j++) { - var key = _k[_j]; - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - var returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); - return returnObj; - } - } -} -/** - * Compares two numbers for sorting. - * @param a - * @param b - */ -function numberCompare(a, b) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); -} -/** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ -function reverseNumberCompare(a, b) { - return -1 * numberCompare(a, b); -} -/** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ -function unique$1(xs) { - if (xs == null) { - return xs; - } - var out = []; - // TODO(cais): Maybe improve performance by sorting. - for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) { - var x = xs_1[_i]; - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; -} -/** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ -function isObjectEmpty(obj) { - if (obj == null) { - throw new ValueError("Invalid value in obj: " + JSON.stringify(obj)); - } - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; -} -/** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ -function checkStringTypeUnionValue(values, label, value) { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(value + " is not a valid " + label + ". Valid values are " + values + " or null/undefined."); - } -} -/** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ -// tslint:disable:no-any -function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) { - if (minLength === void 0) { minLength = 0; } - if (maxLength === void 0) { maxLength = Infinity; } - assert$1(minLength >= 0); - assert$1(maxLength >= minLength); - return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(function (e) { return typeof e === expectedType; })); -} -// tslint:enable:no-any -/** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ -function assertPositiveInteger(value, name) { - if (Array.isArray(value)) { - tfc.util.assert(value.length > 0, function () { return name + " is unexpectedly an empty array."; }); - value.forEach(function (v, i) { return assertPositiveInteger(v, "element " + (i + 1) + " of " + name); }); - } - else { - tfc.util.assert(Number.isInteger(value) && value > 0, function () { return "Expected " + name + " to be a positive integer, but got " + - (formatAsFriendlyString(value) + "."); }); - } -} -/** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ -// tslint:disable-next-line:no-any -function formatAsFriendlyString(value) { - if (value === null) { - return 'null'; - } - else if (Array.isArray(value)) { - return '[' + value.map(function (v) { return formatAsFriendlyString(v); }).join(',') + ']'; - } - else if (typeof value === 'string') { - return "\"" + value + "\""; - } - else { - return "" + value; - } -} -/** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ -function debounce(f, waitMs) { - var lastTime = tfc.util.now(); - var lastResult; - var f2 = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var now = tfc.util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f.apply(void 0, args); - return lastResult; - }; - return f2; -} -/** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ -function mapActivationToFusedKernel(activationName) { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function used by many of the Constraints to find the L2Norms. - */ -function calcL2Norms(w, axis) { - return tfc.tidy(function () { return tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)); }); -} -/** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ -var Constraint = /** @class */ (function (_super) { - __extends(Constraint, _super); - function Constraint() { - return _super !== null && _super.apply(this, arguments) || this; - } - Constraint.prototype.getConfig = function () { - return {}; - }; - return Constraint; -}(tfc.serialization.Serializable)); -var MaxNorm = /** @class */ (function (_super) { - __extends(MaxNorm, _super); - function MaxNorm(args) { - var _this = _super.call(this) || this; - _this.defaultMaxValue = 2; - _this.defaultAxis = 0; - _this.maxValue = - args.maxValue != null ? args.maxValue : _this.defaultMaxValue; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - MaxNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { - var norms = calcL2Norms(w, _this.axis); - var desired = tfc.clipByValue(norms, 0, _this.maxValue); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - }; - MaxNorm.prototype.getConfig = function () { - return { maxValue: this.maxValue, axis: this.axis }; - }; - /** @nocollapse */ - MaxNorm.className = 'MaxNorm'; - return MaxNorm; -}(Constraint)); -tfc.serialization.registerClass(MaxNorm); -var UnitNorm = /** @class */ (function (_super) { - __extends(UnitNorm, _super); - function UnitNorm(args) { - var _this = _super.call(this) || this; - _this.defaultAxis = 0; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - UnitNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { return tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, _this.axis))); }); - }; - UnitNorm.prototype.getConfig = function () { - return { axis: this.axis }; - }; - /** @nocollapse */ - UnitNorm.className = 'UnitNorm'; - return UnitNorm; -}(Constraint)); -tfc.serialization.registerClass(UnitNorm); -var NonNeg = /** @class */ (function (_super) { - __extends(NonNeg, _super); - function NonNeg() { - return _super !== null && _super.apply(this, arguments) || this; - } - NonNeg.prototype.apply = function (w) { - return tfc.relu(w); - }; - /** @nocollapse */ - NonNeg.className = 'NonNeg'; - return NonNeg; -}(Constraint)); -tfc.serialization.registerClass(NonNeg); -var MinMaxNorm = /** @class */ (function (_super) { - __extends(MinMaxNorm, _super); - function MinMaxNorm(args) { - var _this = _super.call(this) || this; - _this.defaultMinValue = 0.0; - _this.defaultMaxValue = 1.0; - _this.defaultRate = 1.0; - _this.defaultAxis = 0; - _this.minValue = - args.minValue != null ? args.minValue : _this.defaultMinValue; - _this.maxValue = - args.maxValue != null ? args.maxValue : _this.defaultMaxValue; - _this.rate = args.rate != null ? args.rate : _this.defaultRate; - _this.axis = args.axis != null ? args.axis : _this.defaultAxis; - return _this; - } - MinMaxNorm.prototype.apply = function (w) { - var _this = this; - return tfc.tidy(function () { - var norms = calcL2Norms(w, _this.axis); - var desired = tfc.add(tfc.mul(_this.rate, tfc.clipByValue(norms, _this.minValue, _this.maxValue)), tfc.mul(1.0 - _this.rate, norms)); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - }; - MinMaxNorm.prototype.getConfig = function () { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - }; - /** @nocollapse */ - MinMaxNorm.className = 'MinMaxNorm'; - return MinMaxNorm; -}(Constraint)); -tfc.serialization.registerClass(MinMaxNorm); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' -}; -function serializeConstraint(constraint) { - return serializeKerasObject(constraint); -} -function deserializeConstraint(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); -} -function getConstraint(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - var className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - var config = { className: className, config: {} }; - return deserializeConstraint(config); - } - else if (identifier instanceof Constraint) { - return identifier; - } - else { - return deserializeConstraint(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ -function maxNorm(args) { - return new MaxNorm(args); -} -/** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -function unitNorm(args) { - return new UnitNorm(args); -} -/** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -function nonNeg() { - return new NonNeg(); -} -/** @doc {heading: 'Constraints', namespace: 'constraints'} */ -function minMaxNorm(config) { - return new MinMaxNorm(config); -} - -var exports_constraints = { - __proto__: null, - maxNorm: maxNorm, - unitNorm: unitNorm, - nonNeg: nonNeg, - minMaxNorm: minMaxNorm -}; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; -var VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; -var VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; -var VALID_POOL_MODE_VALUES = ['max', 'avg']; -var VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// A map from the requested scoped name of a Tensor to the number of Tensors -// wanting that name so far. This allows enforcing name uniqueness by appending -// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. -var nameMap = new Map(); -function checkDataFormat(value) { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); -} -function checkInterpolationFormat(value) { - checkStringTypeUnionValue(VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); -} -function checkPaddingMode(value) { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); -} -function checkPoolMode(value) { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); -} -var _nameScopeStack = []; -var _nameScopeDivider = '/'; -/** - * Enter namescope, which can be nested. - */ -function nameScope(name, fn) { - _nameScopeStack.push(name); - try { - var val = fn(); - _nameScopeStack.pop(); - return val; - } - catch (e) { - _nameScopeStack.pop(); - throw e; - } -} -/** - * Get the current namescope as a flat, concatenated string. - */ -function currentNameScopePrefix() { - if (_nameScopeStack.length === 0) { - return ''; - } - else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } -} -/** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ -function getScopedTensorName(tensorName) { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; -} -/** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ -function getUniqueTensorName(scopedName) { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - var index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - if (index > 0) { - var result = scopedName + "_" + index; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } - else { - return scopedName; - } -} -var tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); -/** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ -function isValidTensorName(name) { - return !!name.match(tensorNameRegex); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Determine if a number is an integer. - */ -function isInteger(x) { - return x === parseInt(x.toString(), 10); -} -/** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ -function arrayProd(array, begin, end) { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - var prod = 1; - for (var i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; -} -/** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ -function toArray1D(array) { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tfc.tensor1d(array); -} -/** - * Compute minimum value. - * @param array - * @return minimum value. - */ -function min$1(array) { - return tfc.min(toArray1D(array)).dataSync()[0]; -} -/** - * Compute maximum value. - * @param array - * @return maximum value - */ -function max$1(array) { - return tfc.max(toArray1D(array)).dataSync()[0]; -} -/** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ -function range(begin, end) { - if (end < begin) { - throw new ValueError("end (" + end + ") < begin (" + begin + ") is forbidden."); - } - var out = []; - for (var i = begin; i < end; ++i) { - out.push(i); - } - return out; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ -function cast$1(x, dtype) { - return x.asType(dtype); -} -/** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ -function expandDims$1(x, axis) { - if (axis === void 0) { axis = -1; } - var outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); -} -/** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ -function repeat(x, n) { - return tfc.tidy(function () { - if (x.shape.length !== 2) { - throw new ValueError("repeat() expects a rank-2 tensor, but received a " + - ("rank-" + x.shape.length + " tensor.")); - } - var y = expandDims$1(x, 1); - return tile$1(y, [1, n, 1]); - }); -} -/** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ -function flatten$1(x) { - var newShape = [arrayProd(x.shape)]; - return x.reshape(newShape); -} -/** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ -function batchFlatten(x) { - if (x.rank <= 1) { - throw new ValueError("batchFlatten requires a minimum rank of 2. Got rank: " + x.rank + "."); - } - var newShape = [x.shape[0], arrayProd(x.shape, 1)]; - return x.reshape(newShape); -} -/** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongFirstAxis(array, start, size) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); - case 3: - return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); - case 4: - return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return tfc.slice(array, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return tfc.slice(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError("sliceAlongFirstAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); -} -/** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongLastAxis(array, start, size) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - return tfc.slice2d(array, [0, start], [array.shape[0], size]); - case 3: - return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); - case 4: - return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); -} -/** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -function sliceAlongAxis(array, start, size, axis) { - return tfc.tidy(function () { - switch (array.rank) { - case 1: - return tfc.slice1d(array, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError("The axis is not within the rank of the tensor " + - ("" + axis)); - } - default: - throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + - ("" + array.rank)); - } - }); -} -/** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ -function concatenate(tensors, axis) { - if (axis === void 0) { axis = -1; } - var rank; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } - else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return tfc.concat(tensors, axis); -} -/** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ -function concatAlongFirstAxis(a, b) { - switch (a.rank) { - case 1: - return tfc.concat1d([a, b]); - case 2: - return tfc.concat2d([a, b], 0); - case 3: - return tfc.concat3d([a, b], 0); - case 4: - return tfc.concat4d([a, b], 0); - default: - throw new ValueError("concatAlongFirstAxis() received an unsupported " + - ("tensor rank: " + a.rank)); - } -} -/** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ -function tile$1(x, n) { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError("The length of input n (" + n.length + ") does not match " + - ("the number of dimensions in input x (" + x.rank + ")")); - } - return tfc.tile(x, n); -} -/* Creation of random tensors. */ -/** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ -function randomNormal(shape, mean, stddev, dtype, seed) { - if (mean === void 0) { mean = 0.0; } - if (stddev === void 0) { stddev = 1.0; } - return tfc.randomNormal(shape, mean, stddev, dtype, seed); -} -/* Linear Algebra */ -/** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ -function dot$1(a, b, activation, bias) { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError("dot requires both inputs to be rank >= 2" + - (" but got x shape = " + a.shape + " and y shape = " + b.shape)); - } - if (b.rank >= 3) { - var xLastDim = a.shape.slice(-1)[0]; - var ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError("If rank y >= 3, then the second last dim" + - (" of y must equal the last dim of x but got x shape = " + a.shape + " and ") + - (" y shape = " + b.shape)); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - var transposeA = false; - var transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return tfc.fused.matMul({ - a: a, - b: b, - transposeA: transposeA, - transposeB: transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation: activation - }); - } - else { - // Reshape x into the analogous 2D Tensor. - var aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - var aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - var bShape = b.shape.slice(); - var bLastDim = bShape.pop(); - var ySecondLastDim = bShape.pop(); - var yOtherDims = bShape.concat([bLastDim]); - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - var perm = Array.from({ length: b.rank }, function (_, i) { - if (i === 0) { - return b.rank - 2; - } - else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - // Multiply x and y as 2D Tensors, and then reshape back to original. - var outputShape = aFirstDims.concat(yOtherDims); - var transposeA = false; - var transposeB = false; - return tfc.fused - .matMul({ - a: a, - b: b, - transposeA: transposeA, - transposeB: transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation: activation - }) - .reshape(outputShape); - } -} -/* Elementary math functions. */ -/** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ -function gather$1(reference, indices, axis) { - return tfc.tidy(function () { - if (Array.isArray(indices)) { - indices = tfc.tensor1d(indices, 'int32'); - } - else { - indices = indices.toInt(); - } - return tfc.gather(reference, indices, axis); - }); -} -/** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ -function square$1(x) { - return tfc.mul(x, x); -} -/** - * Reshapes bias tensor according to rank of x. - */ -function reshapeBias(xRank, bias, dataFormat) { - var biasShape = bias.shape; - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError("Unexpected bias dimensions: " + bias.rank + - ("; expected it to be 1 or " + xRank)); - } - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } - else { - return bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } - else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } - else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } - else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } - else { - return bias.reshape([1].concat(biasShape)); - } - } - } - else if (xRank < 3) { - return bias; - } - throw new ValueError("Unsupported input rank by biasAdd: " + bias.rank); -} -/* Neural-network operations. */ -/** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ -function biasAdd(x, bias, dataFormat) { - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); -} -/** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ -function elu$1(x, alpha) { - if (alpha === void 0) { alpha = 1; } - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError("Support for alpha values other than 1 (" + alpha + ") is not implemented " + - "yet."); - } - return tfc.elu(x); -} -/** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ -function softsign(x) { - return tfc.tidy(function () { return tfc.div(x, tfc.abs(x).add(1)); }); -} -/** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ -function dropout(x, level, noiseShape, seed) { - return tfc.tidy(function () { return tfc.dropout(x, level, noiseShape, seed); }); -} -/** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ -function hardSigmoid(x) { - return tfc.tidy(function () { - var y = tfc.add(.5, tfc.mul(.2, x)); - return tfc.clipByValue(y, 0, 1); - }); -} -/** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ -function inTrainPhase(x, alt, training) { - if (training === void 0) { training = false; } - return training ? x() : alt(); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; -var VALID_DISTRIBUTION_VALUES = ['normal', 'uniform', 'truncatedNormal']; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function checkFanMode(value) { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); -} -function checkDistribution(value) { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); -} -/** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ -var Initializer = /** @class */ (function (_super) { - __extends(Initializer, _super); - function Initializer() { - return _super !== null && _super.apply(this, arguments) || this; - } - Initializer.prototype.fromConfigUsesCustomObjects = function () { - return false; - }; - Initializer.prototype.getConfig = function () { - return {}; - }; - return Initializer; -}(tfc.serialization.Serializable)); -var Zeros = /** @class */ (function (_super) { - __extends(Zeros, _super); - function Zeros() { - return _super !== null && _super.apply(this, arguments) || this; - } - Zeros.prototype.apply = function (shape, dtype) { - return tfc.zeros(shape, dtype); - }; - /** @nocollapse */ - Zeros.className = 'Zeros'; - return Zeros; -}(Initializer)); -tfc.serialization.registerClass(Zeros); -var Ones = /** @class */ (function (_super) { - __extends(Ones, _super); - function Ones() { - return _super !== null && _super.apply(this, arguments) || this; - } - Ones.prototype.apply = function (shape, dtype) { - return tfc.ones(shape, dtype); - }; - /** @nocollapse */ - Ones.className = 'Ones'; - return Ones; -}(Initializer)); -tfc.serialization.registerClass(Ones); -var Constant = /** @class */ (function (_super) { - __extends(Constant, _super); - function Constant(args) { - var _this = _super.call(this) || this; - if (typeof args !== 'object') { - throw new ValueError("Expected argument of type ConstantConfig but got " + args); - } - if (args.value === undefined) { - throw new ValueError("config must have value set but got " + args); - } - _this.value = args.value; - return _this; - } - Constant.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { return tfc.mul(tfc.scalar(_this.value), tfc.ones(shape, dtype)); }); - }; - Constant.prototype.getConfig = function () { - return { - value: this.value, - }; - }; - /** @nocollapse */ - Constant.className = 'Constant'; - return Constant; -}(Initializer)); -tfc.serialization.registerClass(Constant); -var RandomUniform = /** @class */ (function (_super) { - __extends(RandomUniform, _super); - function RandomUniform(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MINVAL = -0.05; - _this.DEFAULT_MAXVAL = 0.05; - _this.minval = args.minval || _this.DEFAULT_MINVAL; - _this.maxval = args.maxval || _this.DEFAULT_MAXVAL; - _this.seed = args.seed; - return _this; - } - RandomUniform.prototype.apply = function (shape, dtype) { - return tfc.randomUniform(shape, this.minval, this.maxval, dtype); - }; - RandomUniform.prototype.getConfig = function () { - return { minval: this.minval, maxval: this.maxval, seed: this.seed }; - }; - /** @nocollapse */ - RandomUniform.className = 'RandomUniform'; - return RandomUniform; -}(Initializer)); -tfc.serialization.registerClass(RandomUniform); -var RandomNormal = /** @class */ (function (_super) { - __extends(RandomNormal, _super); - function RandomNormal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MEAN = 0.; - _this.DEFAULT_STDDEV = 0.05; - _this.mean = args.mean || _this.DEFAULT_MEAN; - _this.stddev = args.stddev || _this.DEFAULT_STDDEV; - _this.seed = args.seed; - return _this; - } - RandomNormal.prototype.apply = function (shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError("randomNormal does not support dType " + dtype + "."); - } - return randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - }; - RandomNormal.prototype.getConfig = function () { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - }; - /** @nocollapse */ - RandomNormal.className = 'RandomNormal'; - return RandomNormal; -}(Initializer)); -tfc.serialization.registerClass(RandomNormal); -var TruncatedNormal = /** @class */ (function (_super) { - __extends(TruncatedNormal, _super); - function TruncatedNormal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_MEAN = 0.; - _this.DEFAULT_STDDEV = 0.05; - _this.mean = args.mean || _this.DEFAULT_MEAN; - _this.stddev = args.stddev || _this.DEFAULT_STDDEV; - _this.seed = args.seed; - return _this; - } - TruncatedNormal.prototype.apply = function (shape, dtype) { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError("truncatedNormal does not support dType " + dtype + "."); - } - return tfc.truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); - }; - TruncatedNormal.prototype.getConfig = function () { - return { mean: this.mean, stddev: this.stddev, seed: this.seed }; - }; - /** @nocollapse */ - TruncatedNormal.className = 'TruncatedNormal'; - return TruncatedNormal; -}(Initializer)); -tfc.serialization.registerClass(TruncatedNormal); -var Identity$1 = /** @class */ (function (_super) { - __extends(Identity, _super); - function Identity(args) { - var _this = _super.call(this) || this; - _this.gain = args.gain != null ? args.gain : 1.0; - return _this; - } - Identity.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError('Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } - else { - return tfc.mul(_this.gain, tfc.eye(shape[0])); - } - }); - }; - Identity.prototype.getConfig = function () { - return { gain: this.gain }; - }; - /** @nocollapse */ - Identity.className = 'Identity'; - return Identity; -}(Initializer)); -tfc.serialization.registerClass(Identity$1); -/** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ -function computeFans(shape, dataFormat) { - if (dataFormat === void 0) { dataFormat = 'channelsLast'; } - var fanIn; - var fanOut; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } - else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - var receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } - else if (dataFormat === 'channelsLast') { - var receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } - else { - var shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - return [fanIn, fanOut]; -} -var VarianceScaling = /** @class */ (function (_super) { - __extends(VarianceScaling, _super); - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - function VarianceScaling(args) { - var _this = _super.call(this) || this; - if (args.scale < 0.0) { - throw new ValueError("scale must be a positive float. Got: " + args.scale); - } - _this.scale = args.scale == null ? 1.0 : args.scale; - _this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(_this.mode); - _this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(_this.distribution); - _this.seed = args.seed; - return _this; - } - VarianceScaling.prototype.apply = function (shape, dtype) { - var fans = computeFans(shape); - var fanIn = fans[0]; - var fanOut = fans[1]; - var scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } - else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } - else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - if (this.distribution === 'normal') { - var stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(this.getClassName() + " does not support dType " + dtype + "."); - } - return tfc.truncatedNormal(shape, 0, stddev, dtype, this.seed); - } - else { - var limit = Math.sqrt(3 * scale); - return tfc.randomUniform(shape, -limit, limit, dtype); - } - }; - VarianceScaling.prototype.getConfig = function () { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - }; - /** @nocollapse */ - VarianceScaling.className = 'VarianceScaling'; - return VarianceScaling; -}(Initializer)); -tfc.serialization.registerClass(VarianceScaling); -var GlorotUniform = /** @class */ (function (_super) { - __extends(GlorotUniform, _super); - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - function GlorotUniform(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - GlorotUniform.prototype.getClassName = function () { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - GlorotUniform.className = 'GlorotUniform'; - return GlorotUniform; -}(VarianceScaling)); -tfc.serialization.registerClass(GlorotUniform); -var GlorotNormal = /** @class */ (function (_super) { - __extends(GlorotNormal, _super); - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - function GlorotNormal(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - GlorotNormal.prototype.getClassName = function () { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - GlorotNormal.className = 'GlorotNormal'; - return GlorotNormal; -}(VarianceScaling)); -tfc.serialization.registerClass(GlorotNormal); -var HeNormal = /** @class */ (function (_super) { - __extends(HeNormal, _super); - function HeNormal(args) { - return _super.call(this, { - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - HeNormal.prototype.getClassName = function () { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - HeNormal.className = 'HeNormal'; - return HeNormal; -}(VarianceScaling)); -tfc.serialization.registerClass(HeNormal); -var HeUniform = /** @class */ (function (_super) { - __extends(HeUniform, _super); - function HeUniform(args) { - return _super.call(this, { - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - HeUniform.prototype.getClassName = function () { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - HeUniform.className = 'HeUniform'; - return HeUniform; -}(VarianceScaling)); -tfc.serialization.registerClass(HeUniform); -var LeCunNormal = /** @class */ (function (_super) { - __extends(LeCunNormal, _super); - function LeCunNormal(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }) || this; - } - LeCunNormal.prototype.getClassName = function () { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - LeCunNormal.className = 'LeCunNormal'; - return LeCunNormal; -}(VarianceScaling)); -tfc.serialization.registerClass(LeCunNormal); -var LeCunUniform = /** @class */ (function (_super) { - __extends(LeCunUniform, _super); - function LeCunUniform(args) { - return _super.call(this, { - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }) || this; - } - LeCunUniform.prototype.getClassName = function () { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - }; - /** @nocollapse */ - LeCunUniform.className = 'LeCunNormal'; - return LeCunUniform; -}(VarianceScaling)); -tfc.serialization.registerClass(LeCunUniform); -var Orthogonal = /** @class */ (function (_super) { - __extends(Orthogonal, _super); - function Orthogonal(args) { - var _this = _super.call(this) || this; - _this.DEFAULT_GAIN = 1; - _this.gain = args.gain == null ? _this.DEFAULT_GAIN : args.gain; - _this.seed = args.seed; - if (_this.seed != null) { - throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); - } - return _this; - } - Orthogonal.prototype.apply = function (shape, dtype) { - var _this = this; - return tfc.tidy(function () { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn("Orthogonal initializer is being called on a matrix with more " + - ("than 2000 (" + shape[0] * shape[1] + ") elements: ") + - "Slowness may result."); - } - // TODO(cais): Add seed support. - var normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - var a = randomNormal(normalizedShape, 0, 1, 'float32'); - var q = tfc.linalg.gramSchmidt(a); - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return tfc.mul(_this.gain, q); - }); - }; - Orthogonal.prototype.getConfig = function () { - return { - gain: this.gain, - seed: this.seed, - }; - }; - /** @nocollapse */ - Orthogonal.className = 'Orthogonal'; - return Orthogonal; -}(Initializer)); -tfc.serialization.registerClass(Orthogonal); -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' -}; -function deserializeInitializer(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); -} -function serializeInitializer(initializer) { - return serializeKerasObject(initializer); -} -function getInitializer(identifier) { - if (typeof identifier === 'string') { - var className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } - else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } - else if (className === 'HeNormal') { - return new HeNormal(); - } - else if (className === 'HeUniform') { - return new HeUniform(); - } - else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } - else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } - else { - var config = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } - else if (identifier instanceof Initializer) { - return identifier; - } - else { - return deserializeInitializer(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function zeros$1() { - return new Zeros(); -} -/** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function ones$2() { - return new Ones(); -} -/** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function constant(args) { - return new Constant(args); -} -/** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function randomUniform(args) { - return new RandomUniform(args); -} -/** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function randomNormal$1(args) { - return new RandomNormal(args); -} -/** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function truncatedNormal(args) { - return new TruncatedNormal(args); -} -/** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function identity(args) { - return new Identity$1(args); -} -/** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -function varianceScaling(config) { - return new VarianceScaling(config); -} -/** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function glorotUniform(args) { - return new GlorotUniform(args); -} -/** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function glorotNormal(args) { - return new GlorotNormal(args); -} -/** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function heNormal(args) { - return new HeNormal(args); -} -/** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -function heUniform(args) { - return new HeUniform(args); -} -/** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function leCunNormal(args) { - return new LeCunNormal(args); -} -/** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function leCunUniform(args) { - return new LeCunUniform(args); -} -/** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -function orthogonal(args) { - return new Orthogonal(args); -} - -var exports_initializers = { - __proto__: null, - zeros: zeros$1, - ones: ones$2, - constant: constant, - randomUniform: randomUniform, - randomNormal: randomNormal$1, - truncatedNormal: truncatedNormal, - identity: identity, - varianceScaling: varianceScaling, - glorotUniform: glorotUniform, - glorotNormal: glorotNormal, - heNormal: heNormal, - heUniform: heUniform, - leCunNormal: leCunNormal, - leCunUniform: leCunUniform, - orthogonal: orthogonal -}; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Utilities related to persistent state in the backend. - */ -/** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ -var _nextUniqueTensorId = 0; -function getNextUniqueTensorId() { - return _nextUniqueTensorId++; -} -var _uidPrefixes = {}; -/** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ -function getUid(prefix) { - if (prefix === void 0) { prefix = ''; } - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * Determine whether the input is an Array of Shapes. - */ -function isArrayOfShapes(x) { - return Array.isArray(x) && Array.isArray(x[0]); -} -/** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ -function normalizeShapeList(x) { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x]; - } - return x; -} -/** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ -function getExactlyOneTensor(xs) { - var x; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError("Expected Tensor length to be 1; got " + xs.length); - } - x = xs[0]; - } - else { - x = xs; - } - return x; -} -/** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ -function getExactlyOneShape(shapes) { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes; - return shapes[0]; - } - else { - throw new ValueError("Expected exactly 1 Shape; got " + shapes.length); - } - } - else { - return shapes; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ -function countParamsInWeights(weights) { - var count = 0; - for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) { - var weight = weights_1[_i]; - if (weight.shape.length === 0) { - count += 1; - } - else { - count += weight.shape.reduce(function (a, b) { return a * b; }); - } - } - return count; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; -/** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ -var LayerVariable = /** @class */ (function () { - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - function LayerVariable(val, dtype, name, trainable, constraint) { - if (dtype === void 0) { dtype = 'float32'; } - if (name === void 0) { name = DEFAULT_VARIABLE_NAME_PREFIX; } - if (trainable === void 0) { trainable = true; } - if (constraint === void 0) { constraint = null; } - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - this.trainable_ = trainable; - this.constraint = constraint; - this.val = tfc.variable(val, this.trainable_, this.name, this.dtype); - } - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - LayerVariable.prototype.read = function () { - this.assertNotDisposed(); - return this.val; - }; - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - LayerVariable.prototype.write = function (newVal) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - }; - /** - * Dispose this LayersVariable instance from memory. - */ - LayerVariable.prototype.dispose = function () { - this.assertNotDisposed(); - this.val.dispose(); - }; - LayerVariable.prototype.assertNotDisposed = function () { - if (this.val.isDisposed) { - throw new Error("LayersVariable " + this.name + " is already disposed."); - } - }; - Object.defineProperty(LayerVariable.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this.trainable_ = trainable; - this.val.trainable = trainable; - }, - enumerable: true, - configurable: true - }); - return LayerVariable; -}()); -function checkShapesMatch(x, y) { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } -} -/** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ -function batchGetValue(xs) { - return xs.map(function (x) { return x.read(); }); -} -/** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ -function batchSetValue(variablesAndValues) { - variablesAndValues.forEach(function (variableAndValue) { - var variable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ -var InputSpec = /** @class */ (function () { - function InputSpec(args) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } - else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } - return InputSpec; -}()); -/** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ -var SymbolicTensor = /** @class */ (function () { - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - function SymbolicTensor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { - this.dtype = dtype; - this.shape = shape; - this.sourceLayer = sourceLayer; - this.inputs = inputs; - this.callArgs = callArgs; - this.outputTensorIndex = outputTensorIndex; - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } - return SymbolicTensor; -}()); -var _nextNodeID = 0; -/** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ -var Node = /** @class */ (function () { - function Node(args, - // TODO(michaelterry): Define actual type for this. - callArgs) { - this.callArgs = callArgs; - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - // Following 2 properties: input and output shapes. - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - // Add nodes to all layers involved. - for (var _i = 0, _a = args.inboundLayers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - Node.prototype.getConfig = function () { - var inboundNames = []; - for (var _i = 0, _a = this.inboundLayers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer != null) { - inboundNames.push(layer.name); - } - else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - }; - return Node; -}()); -var _nextLayerID = 0; -/** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ -var Layer = /** @class */ (function (_super) { - __extends(Layer, _super); - function Layer(args) { - if (args === void 0) { args = {}; } - var _this = _super.call(this) || this; - _this._callHook = null; - _this._addedWeightNames = []; - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - _this._stateful = false; - _this.id = _nextLayerID++; - _this.activityRegularizer = null; - _this.inputSpec = null; - _this.supportsMasking = false; - // These properties will be set upon call of this.build() - _this._trainableWeights = []; - _this._nonTrainableWeights = []; - _this._losses = []; - _this._updates = []; - _this._built = false; - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - _this.inboundNodes = []; - _this.outboundNodes = []; - var name = args.name; - if (!name) { - var prefix = _this.getClassName(); - name = toSnakeCase(prefix) + '_' + getUid(prefix); - } - _this.name = name; - _this.trainable_ = args.trainable == null ? true : args.trainable; - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - var batchInputShape = void 0; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } - else if (args.inputShape != null) { - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - _this.batchInputShape = batchInputShape; - // Set dtype. - var dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - _this.dtype = dtype; - } - if (args.weights != null) { - _this.initialWeights = args.weights; - } - else { - _this.initialWeights = null; - } - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - _this._refCount = null; - _this.fastWeightInitDuringBuild = false; - return _this; - } - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - Layer.nodeKey = function (layer, nodeIndex) { - return layer.name + '_ib-' + nodeIndex.toString(); - }; - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - Layer.prototype.getNodeAtIndex = function (nodeIndex, attrName) { - if (this.inboundNodes.length === 0) { - throw new RuntimeError('The layer has never been called ' + - ("and thus has no defined " + attrName + ".")); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError("Asked to get " + attrName + " at node " + nodeIndex + ", " + - ("but the layer has only " + this.inboundNodes.length + " inbound nodes.")); - } - return this.inboundNodes[nodeIndex]; - }; - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - Layer.prototype.getInputAt = function (nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - }; - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - Layer.prototype.getOutputAt = function (nodeIndex) { - return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - }; - Object.defineProperty(Layer.prototype, "input", { - // Properties - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get: function () { - if (this.inboundNodes.length > 1) { - throw new AttributeError("Layer " + this.name + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } - else if (this.inboundNodes.length === 0) { - throw new AttributeError("Layer " + this.name + - ' is not connected, no input to return.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "output", { - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get: function () { - if (this.inboundNodes.length === 0) { - throw new AttributeError("Layer " + this.name + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError("Layer " + this.name + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "losses", { - get: function () { - return this._losses; - }, - enumerable: true, - configurable: true - }); - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - Layer.prototype.calculateLosses = function () { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(function (lossFn) { return lossFn(); }); - }; - Object.defineProperty(Layer.prototype, "updates", { - get: function () { - return this._updates; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "built", { - get: function () { - return this._built; - }, - set: function (built) { - this._built = built; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this._trainableWeights.forEach(function (w) { return w.trainable = trainable; }); - this.trainable_ = trainable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "trainableWeights", { - get: function () { - if (this.trainable_) { - return this._trainableWeights.filter(function (w) { return w.trainable; }); - } - else { - return []; - } - }, - set: function (weights) { - this._trainableWeights = weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "nonTrainableWeights", { - get: function () { - if (this.trainable) { - return this._trainableWeights.filter(function (w) { return !w.trainable; }) - .concat(this._nonTrainableWeights); - } - else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - }, - set: function (weights) { - this._nonTrainableWeights = weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "weights", { - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get: function () { - return this.trainableWeights.concat(this.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Layer.prototype, "stateful", { - get: function () { - return this._stateful; - }, - enumerable: true, - configurable: true - }); - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - Layer.prototype.resetStates = function () { - if (!this.stateful) { - throw new Error('Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - }; - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - Layer.prototype.assertInputCompatibility = function (inputs) { - inputs = toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - var inputSpec = toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError("Layer " + this.name + " expects " + inputSpec.length + " inputs, " + - ("but it received " + inputs.length + " input tensors. ") + - ("Input received: " + inputs)); - } - for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - var x = inputs[inputIndex]; - var spec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - // Check ndim. - var ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + ": " + - ("expected ndim=" + spec.ndim + ", found ndim=" + ndim)); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + - (": expected max_ndim=" + spec.maxNDim + ", found ndim=" + ndim)); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + - (": expected min_ndim=" + spec.minNDim + ", found ndim=" + ndim + ".")); - } - } - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + " " + - (": expected dtype=" + spec.dtype + ", found dtype=" + x.dtype + ".")); - } - } - // Check specific shape axes. - if (spec.axes) { - var xShape = x.shape; - for (var key in spec.axes) { - var axis = Number(key); - var value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - var xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + - (this.name + ": expected axis " + axis + " of input shape to ") + - ("have value " + value + " but got shape " + xShape + ".")); - } - } - } - // Check shape. - if (spec.shape != null) { - for (var i = 0; i < spec.shape.length; ++i) { - var specDim = spec.shape[i]; - var dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError("Input " + inputIndex + " is incompatible with layer " + - (this.name + ": expected shape=" + spec.shape + ", ") + - ("found shape=" + x.shape + ".")); - } - } - } - } - } - }; - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - Layer.prototype.call = function (inputs, kwargs) { - return inputs; - }; - Layer.prototype.invokeCallHook = function (inputs, kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - }; - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - Layer.prototype.setCallHook = function (callHook) { - this._callHook = callHook; - }; - /** - * Clear call hook. - * This is currently used for testing only. - */ - Layer.prototype.clearCallHook = function () { - this._callHook = null; - }; - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - Layer.prototype.apply = function (inputs, kwargs) { - var _this = this; - kwargs = kwargs || {}; - this.assertNotDisposed(); - // Ensure inputs are all the same type. - var inputsList = toList(inputs); - var allAreSymbolic = true; - for (var _i = 0, inputsList_1 = inputsList; _i < inputsList_1.length; _i++) { - var input = inputsList_1[_i]; - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - var noneAreSymbolic = true; - for (var _a = 0, inputsList_2 = inputsList; _a < inputsList_2.length; _a++) { - var input = inputsList_2[_a]; - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError('Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, function () { - // Handle laying building (weight creating, input spec locking). - if (!_this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - _this.assertInputCompatibility(inputs); - // Collect input shapes to build layer. - var inputShapes = []; - for (var _i = 0, _a = toList(inputs); _i < _a.length; _i++) { - var xElem = _a[_i]; - inputShapes.push(xElem.shape); - } - _this.build(singletonOrArray(inputShapes)); - _this.built = true; - // Load weights that were specified at layer instantiation. - if (_this.initialWeights) { - _this.setWeights(_this.initialWeights); - } - if (_this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - _this._refCount = 1; - } - } - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - _this.assertInputCompatibility(inputs); - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - var output = _this.call(inputs, kwargs); - // TODO(michaelterry): Compute the outputMask - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - var outputList = toList(output); - var outputListCopy = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (var _b = 0, outputList_1 = outputList; _b < outputList_1.length; _b++) { - var x = outputList_1[_b]; - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = singletonOrArray(outputListCopy); - if (_this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Call addInboundNode()? - return output; - } - else { - var inputShape = collectInputShape(inputs); - var outputShape = _this.computeOutputShape(inputShape); - var output = void 0; - var outputDType_1 = guessOutputDType(inputs); - _this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : - inputShape); - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = outputShape - .map(function (shape, index) { return new SymbolicTensor(outputDType_1, shape, _this, toList(inputs), kwargs, _this.name, index); }); - } - else { - output = new SymbolicTensor(outputDType_1, outputShape, _this, toList(inputs), kwargs, _this.name); - } - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - _this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); - _this._refCount++; - if (_this.activityRegularizer != null) { - throw new NotImplementedError('Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - return output; - } - }); - }; - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - Layer.prototype.warnOnIncompatibleInputShape = function (inputShape) { - if (this.batchInputShape == null) { - return; - } - else if (inputShape.length !== this.batchInputShape.length) { - console.warn("The rank of the input tensor provided (shape: " + - (JSON.stringify(inputShape) + ") does not match that of the ") + - ("batchInputShape (" + JSON.stringify(this.batchInputShape) + ") ") + - ("of the layer " + this.name)); - } - else { - var dimMismatch_1 = false; - this.batchInputShape.forEach(function (dimension, i) { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch_1 = true; - } - }); - if (dimMismatch_1) { - console.warn("The shape of the input tensor " + - ("(" + JSON.stringify(inputShape) + ") does not ") + - ("match the expectation of layer " + this.name + ": ") + - ("" + JSON.stringify(this.batchInputShape))); - } - } - }; - Object.defineProperty(Layer.prototype, "outputShape", { - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get: function () { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError("The layer " + this.name + " has never been called and thus has no " + - "defined output shape."); - } - var allOutputShapes = []; - for (var _i = 0, _a = this.inboundNodes; _i < _a.length; _i++) { - var node = _a[_i]; - var shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - var outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return outputShapes[0]; - } - else { - return outputShapes; - } - } - else { - throw new AttributeError("The layer " + this.name + " has multiple inbound nodes with different " + - "output shapes. Hence the notion of \"output shape\" is ill-defined " + - "for the layer."); - // TODO(cais): Implement getOutputShapeAt(). - } - }, - enumerable: true, - configurable: true - }); - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.countParams = function () { - if (!this.built) { - throw new RuntimeError("You tried to call countParams() on " + this.name + ", " + - "but the layer is not built yet. Build it first by calling " + - "build(batchInputShape)."); - } - return countParamsInWeights(this.weights); - }; - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.build = function (inputShape) { - this.built = true; - }; - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.getWeights = function (trainableOnly) { - if (trainableOnly === void 0) { trainableOnly = false; } - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - }; - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.setWeights = function (weights) { - var _this = this; - tfc.tidy(function () { - var params = _this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError("You called setWeights(weights) on layer \"" + _this.name + "\" " + - ("with a weight list of length " + weights.length + ", ") + - ("but the layer was expecting " + params.length + " weights. ") + - ("Provided weights: " + weights + "...")); - } - if (params.length === 0) { - return; - } - var weightValueTuples = []; - var paramValues = batchGetValue(params); - for (var i = 0; i < paramValues.length; ++i) { - var pv = paramValues[i]; - var p = params[i]; - var w = weights[i]; - if (!tfc.util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError("Layer weight shape " + pv.shape + " " + - ("not compatible with provided weight shape " + w.shape)); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - }; - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.addWeight = function (name, shape, dtype, initializer, regularizer, trainable, constraint) { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError("Duplicate weight name " + name + " for layer " + this.name); - } - this._addedWeightNames.push(name); - if (dtype == null) { - dtype = 'float32'; - } - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - var initValue = initializer.apply(shape, dtype); - var weight = new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(function () { return regularizer.apply(weight.read()); }); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } - else { - this._nonTrainableWeights.push(weight); - } - return weight; - }; - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - Layer.prototype.setFastWeightInitDuringBuild = function (value) { - this.fastWeightInitDuringBuild = value; - }; - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.addLoss = function (losses) { - var _a; - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = toList(losses); - if (this._losses !== undefined && this._losses !== null) { - (_a = this.losses).push.apply(_a, losses); - } - }; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - Layer.prototype.computeMask = function (inputs, mask) { - var _this = this; - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(function (maskElement) { - if (maskElement != null) { - throw new TypeError("Layer " + _this.name + " does not support masking, " + - 'but was passed an inputMask.'); - } - }); - } - else { - throw new TypeError("Layer " + this.name + " does not support masking, " + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - }; - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - Layer.prototype.addInboundNode = function (inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs) { - if (kwargs === void 0) { kwargs = null; } - var inputTensorList = toList(inputTensors); - outputTensors = toList(outputTensors); - inputMasks = toList(inputMasks); - outputMasks = toList(outputMasks); - inputShapes = normalizeShapeList(inputShapes); - outputShapes = normalizeShapeList(outputShapes); - // Collect input tensor(s) coordinates. - var inboundLayers = []; - var nodeIndices = []; - var tensorIndices = []; - for (var _i = 0, inputTensorList_1 = inputTensorList; _i < inputTensorList_1.length; _i++) { - var x = inputTensorList_1[_i]; - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: inboundLayers, - nodeIndices: nodeIndices, - tensorIndices: tensorIndices, - inputTensors: inputTensorList, - outputTensors: outputTensors, - inputMasks: inputMasks, - outputMasks: outputMasks, - inputShapes: inputShapes, - outputShapes: outputShapes - }, kwargs); - // Update tensor history - for (var i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - }; - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.getConfig = function () { - var config = { name: this.name, trainable: this.trainable }; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - }; - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - Layer.prototype.disposeWeights = function () { - this.weights.forEach(function (weight) { return weight.dispose(); }); - return this.weights.length; - }; - Layer.prototype.assertNotDisposed = function () { - if (this._refCount === 0) { - throw new Error("Layer '" + this.name + "' is already disposed."); - } - }; - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - Layer.prototype.dispose = function () { - if (!this.built) { - throw new Error("Cannot dispose Layer " + this.name + " because it has not been " + - "built yet."); - } - if (this._refCount === null) { - throw new Error("Cannot dispose Layer " + this.name + " because it has not been used " + - "yet."); - } - this.assertNotDisposed(); - var numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - return { refCountAfterDispose: this._refCount, numDisposedVariables: numDisposedVariables }; - }; - return Layer; -}(tfc.serialization.Serializable)); -/** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ -function collectInputShape(inputTensors) { - inputTensors = - toList(inputTensors); - var shapes = []; - for (var _i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { - var x = inputTensors_1[_i]; - shapes.push(x.shape); - } - return singletonOrArray(shapes); -} -/** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ -function guessOutputDType(inputTensors) { - return 'float32'; -} -/** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ -function getSourceInputs(tensor, layer, nodeIndex) { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } - else { - var node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } - else { - var sourceTensors = []; - for (var i = 0; i < node.inboundLayers.length; i++) { - var x = node.inputTensors[i]; - var layer_1 = node.inboundLayers[i]; - var nodeIndex_1 = node.nodeIndices[i]; - var previousSources = getSourceInputs(x, layer_1, nodeIndex_1); - // Avoid input redundancy. - for (var _i = 0, previousSources_1 = previousSources; _i < previousSources_1.length; _i++) { - var x_1 = previousSources_1[_i]; - if (sourceTensors.indexOf(x_1) === -1) { - sourceTensors.push(x_1); - } - } - } - return sourceTensors; - } - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var InputLayer = /** @class */ (function (_super) { - __extends(InputLayer, _super); - function InputLayer(args) { - var _this = _super.call(this, { - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }) || this; - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - _this.trainable = false; - _this.built = true; - _this.sparse = args.sparse; - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError('Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - var batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError('An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } - else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } - else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError('Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - var dtype = args.dtype || 'float32'; - _this.batchInputShape = batchInputShape; - _this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - _this.inputSpec = [{ shape: batchInputShape }]; - var inputTensor = new SymbolicTensor(_this.dtype, _this.batchInputShape, _this, [], {}, _this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: _this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - return _this; - } - InputLayer.prototype.apply = function (inputs, kwargs) { - throw new ValueError('Cannot pass any input to an ' + - ("InputLayer's apply() method. InputLayer name: " + this.name)); - }; - InputLayer.prototype.dispose = function () { - // dispose() for InputLayer is overridden as no-op. - return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; - }; - InputLayer.prototype.getConfig = function () { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - }; - /** @nocollapse */ - InputLayer.className = 'InputLayer'; - return InputLayer; -}(Layer)); -tfc.serialization.registerClass(InputLayer); -function Input(config) { - if (config.batchShape == null && config.shape == null) { - throw new Error('Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError('Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - var batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - var dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - var inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype: dtype, - sparse: config.sparse - }); - var outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ -function resolveScalarsInLogs(logs) { - return __awaiter(this, void 0, void 0, function () { - var promises, keys, scalarsToDispose, key, value, valueScalar, values, i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (logs == null) { - return [2 /*return*/]; - } - promises = []; - keys = []; - scalarsToDispose = []; - for (key in logs) { - value = logs[key]; - if (typeof value !== 'number') { - valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (!(promises.length > 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, Promise.all(promises)]; - case 1: - values = _a.sent(); - for (i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - tfc.dispose(scalarsToDispose); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); -} -/** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ -function disposeTensorsInLogs(logs) { - if (logs == null) { - return; - } - for (var key in logs) { - var value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Verbosity logging level when fitting a model. */ -var ModelLoggingVerbosity; -(function (ModelLoggingVerbosity) { - ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; -})(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); -/** How often to yield to the main thread when training (in ms). */ -var DEFAULT_YIELD_EVERY_MS = 125; -/** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ -var BaseCallback = /** @class */ (function () { - function BaseCallback() { - // TODO(michaelterry): This type is a best guess. - this.validationData = null; - } - BaseCallback.prototype.setParams = function (params) { - this.params = params; - }; - BaseCallback.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - BaseCallback.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }; - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - BaseCallback.prototype.setModel = function (model) { - // Do nothing. Use Callback instead of BaseCallback to track the model. - }; - return BaseCallback; -}()); -/** - * Container abstracting a list of callbacks. - */ -var CallbackList = /** @class */ (function () { - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - function CallbackList(callbacks, queueLength) { - if (queueLength === void 0) { queueLength = 10; } - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - CallbackList.prototype.append = function (callback) { - this.callbacks.push(callback); - }; - CallbackList.prototype.setParams = function (params) { - for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { - var callback = _a[_i]; - callback.setParams(params); - } - }; - CallbackList.prototype.setModel = function (model) { - for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { - var callback = _a[_i]; - callback.setModel(model); - } - }; - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onEpochBegin(epoch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onEpochEnd(epoch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onBatchBegin(batch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onBatchEnd(batch, logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onTrainBegin(logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - CallbackList.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - var _i, _a, callback; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (logs == null) { - logs = {}; - } - _i = 0, _a = this.callbacks; - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - callback = _a[_i]; - return [4 /*yield*/, callback.onTrainEnd(logs)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - return CallbackList; -}()); -/** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ -var BaseLogger = /** @class */ (function (_super) { - __extends(BaseLogger, _super); - function BaseLogger() { - return _super.call(this) || this; - } - BaseLogger.prototype.onEpochBegin = function (epoch) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.seen = 0; - this.totals = {}; - return [2 /*return*/]; - }); - }); - }; - BaseLogger.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var batchSize, _loop_1, this_1, key; - var _this = this; - return __generator(this, function (_a) { - if (logs == null) { - logs = {}; - } - batchSize = logs['size'] == null ? 0 : logs['size']; - this.seen += batchSize; - _loop_1 = function (key) { - var value = logs[key]; - if (typeof value === 'number') { - if (!this_1.totals.hasOwnProperty(key)) { - this_1.totals[key] = 0; - } - this_1.totals[key] = this_1.totals[key] + value * batchSize; - } - else { - var oldTotalsToDispose = void 0; - if (key in this_1.totals) { - oldTotalsToDispose = this_1.totals[key]; - } - else { - this_1.totals[key] = 0; - } - var total = tfc.tidy(function () { return tfc.add((_this.totals[key]), tfc.mul(value, batchSize)); }); - this_1.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - }; - this_1 = this; - for (key in logs) { - _loop_1(key); - } - return [2 /*return*/]; - }); - }); - }; - BaseLogger.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var _loop_2, this_2, _i, _a, key; - var _this = this; - return __generator(this, function (_b) { - if (logs != null) { - _loop_2 = function (key) { - if (this_2.totals[key] == null) { - return "continue"; - } - if (typeof this_2.totals[key] === 'number') { - logs[key] = this_2.totals[key] / this_2.seen; - } - else { - tfc.tidy(function () { - var log = tfc.mul(tfc.div(1, _this.seen), _this.totals[key]); - logs[key] = log; - _this.totals[key].dispose(); - tfc.keep(logs[key]); - }); - } - }; - this_2 = this; - for (_i = 0, _a = this.params['metrics']; _i < _a.length; _i++) { - key = _a[_i]; - _loop_2(key); - } - } - return [2 /*return*/]; - }); - }); - }; - return BaseLogger; -}(BaseCallback)); -/** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ -var History = /** @class */ (function (_super) { - __extends(History, _super); - function History() { - return _super !== null && _super.apply(this, arguments) || this; - } - History.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.epoch = []; - this.history = {}; - return [2 /*return*/]; - }); - }); - }; - History.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var key; - return __generator(this, function (_a) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - return [2 /*return*/]; - }); - }); - }; - /** - * Await the values of all losses and metrics. - */ - History.prototype.syncData = function () { - return __awaiter(this, void 0, void 0, function () { - var promises, keys, indices, key, valueArray, i, valueScalar, values, n, tensorToDispose; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - promises = []; - keys = []; - indices = []; - for (key in this.history) { - valueArray = this.history[key]; - for (i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - valueScalar = valueArray[i]; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - return [4 /*yield*/, Promise.all(promises)]; - case 1: - values = _a.sent(); - for (n = 0; n < values.length; ++n) { - tensorToDispose = this.history[keys[n]][indices[n]]; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - return [2 /*return*/]; - } - }); - }); - }; - return History; -}(BaseCallback)); -/** - * Custom callback for training. - */ -var CustomCallback = /** @class */ (function (_super) { - __extends(CustomCallback, _super); - function CustomCallback(args, yieldEvery) { - var _this = _super.call(this) || this; - _this.currentEpoch = 0; - _this.yieldEvery = yieldEvery || 'auto'; - if (_this.yieldEvery === 'auto') { - _this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (_this.yieldEvery === 'never' && args.onYield != null) { - throw new Error('yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (tfc.util.isNumber(_this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - _this.maybeWait = debounce(_this.maybeWait.bind(_this), _this.yieldEvery); - } - _this.trainBegin = args.onTrainBegin; - _this.trainEnd = args.onTrainEnd; - _this.epochBegin = args.onEpochBegin; - _this.epochEnd = args.onEpochEnd; - _this.batchBegin = args.onBatchBegin; - _this.batchEnd = args.onBatchEnd; - _this.yield = args.onYield; - return _this; - } - CustomCallback.prototype.maybeWait = function (epoch, batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.yield != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.yield(epoch, batch, logs)); - _a.label = 2; - case 2: - ps.push(tfc.nextFrame()); - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onEpochBegin = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.currentEpoch = epoch; - if (!(this.epochBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.epochBegin(epoch, logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.epochEnd != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.epochEnd(epoch, logs)); - _a.label = 2; - case 2: - if (this.yieldEvery === 'epoch') { - ps.push(tfc.nextFrame()); - } - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onBatchBegin = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.batchBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.batchBegin(batch, logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onBatchEnd = function (batch, logs) { - return __awaiter(this, void 0, void 0, function () { - var ps; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ps = []; - if (!(this.batchEnd != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - ps.push(this.batchEnd(batch, logs)); - _a.label = 2; - case 2: - if (this.yieldEvery === 'batch') { - ps.push(tfc.nextFrame()); - } - else if (tfc.util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - return [4 /*yield*/, Promise.all(ps)]; - case 3: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.trainBegin != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.trainBegin(logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - CustomCallback.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.trainEnd != null)) return [3 /*break*/, 3]; - return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - return [4 /*yield*/, this.trainEnd(logs)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: return [2 /*return*/]; - } - }); - }); - }; - return CustomCallback; -}(BaseCallback)); -/** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ -function standardizeCallbacks(callbacks, yieldEvery) { - if (callbacks == null) { - callbacks = {}; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks; - } - // Convert custom callback configs to custom callback objects. - var callbackConfigs = toList(callbacks); - return callbackConfigs.map(function (callbackConfig) { return new CustomCallback(callbackConfig, yieldEvery); }); -} -/** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ -var CallbackConstructorRegistry = /** @class */ (function () { - /** - * Blocks public access to constructor. - */ - function CallbackConstructorRegistry() { - } - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - CallbackConstructorRegistry.registerCallbackConstructor = function (verbosityLevel, callbackConstructor) { - tfc.util.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), function () { return "Verbosity level is expected to be an integer >= 0, " + - ("but got " + verbosityLevel); }); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push(callbackConstructor); - }; - CallbackConstructorRegistry.checkForDuplicate = function (callbackConstructor) { - for (var levelName in CallbackConstructorRegistry.constructors) { - var constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(function (ctor) { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - }; - /** - * Clear all registered callback constructors. - */ - CallbackConstructorRegistry.clear = function () { - CallbackConstructorRegistry.constructors = {}; - }; - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - CallbackConstructorRegistry.createCallbacks = function (verbosityLevel) { - var constructors = []; - for (var levelName in CallbackConstructorRegistry.constructors) { - var level = +levelName; - if (verbosityLevel >= level) { - constructors.push.apply(constructors, CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(function (ctor) { return new ctor(); }); - }; - CallbackConstructorRegistry.constructors = {}; - return CallbackConstructorRegistry; -}()); -function configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { - var history = new History(); - var actualCallbacks = [ - new BaseLogger() - ].concat(CallbackConstructorRegistry.createCallbacks(verbose)); - if (callbacks != null) { - actualCallbacks.push.apply(actualCallbacks, callbacks); - } - actualCallbacks.push(history); - var callbackList = new CallbackList(actualCallbacks); - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - callbackList.setParams({ - epochs: epochs, - initialEpoch: initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize: batchSize, - verbose: verbose, - doValidation: doValidation, - metrics: callbackMetrics, - }); - return { callbackList: callbackList, history: history }; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ -function deserialize(config, customObjects, fastWeightInit) { - if (customObjects === void 0) { customObjects = {}; } - if (fastWeightInit === void 0) { fastWeightInit = false; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer', fastWeightInit); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ -function l2Normalize(x, axis) { - return tfc.tidy(function () { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - var squareSum = tfc.sum(square$1(x), axis, true); - var epsilonTensor = tfc.fill(squareSum.shape, epsilon()); - var norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); - return tfc.div(x, norm); - }); -} -function meanSquaredError(yTrue, yPred) { - return tfc.tidy(function () { return tfc.mean(square$1(tfc.sub(yPred, yTrue)), -1); }); -} -function meanAbsoluteError(yTrue, yPred) { - return tfc.tidy(function () { return tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1); }); -} -function meanAbsolutePercentageError(yTrue, yPred) { - return tfc.tidy(function () { - var diff = tfc.sub(yTrue, yPred); - var clippedTrue = tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); - var absResult = tfc.abs(tfc.div(diff, clippedTrue)); - return tfc.mul(100, tfc.mean(absResult, -1)); - }); -} -function meanSquaredLogarithmicError(yTrue, yPred) { - return tfc.tidy(function () { - var clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); - var firstLog = tfc.log(tfc.add(1, clippedPred)); - var clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); - var secondLog = tfc.log(tfc.add(1, clippedTrue)); - return tfc.mean(square$1(tfc.sub(firstLog, secondLog)), -1); - }); -} -function squaredHinge(yTrue, yPred) { - return tfc.tidy(function () { - var maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(square$1(maxResult), -1); - }); -} -function hinge(yTrue, yPred) { - return tfc.tidy(function () { - var maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(maxResult, -1); - }); -} -function categoricalHinge(yTrue, yPred) { - return tfc.tidy(function () { - var pos = tfc.sum(tfc.mul(yTrue, yPred), -1); - var neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1); - return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos))); - }); -} -/** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ -function logcosh(yTrue, yPred) { - return tfc.tidy(function () { - var log2 = Math.log(2); - var predictionDiff = tfc.sub(yPred, yTrue); - var logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))), log2); - return tfc.mean(logcoshResult, -1); - }); -} -function categoricalCrossentropy(target, output, fromLogits) { - if (fromLogits === void 0) { fromLogits = false; } - return tfc.tidy(function () { - if (fromLogits) { - output = tfc.softmax(output); - } - else { - // scale preds so that the class probabilities of each sample sum to 1. - var outputSum = tfc.sum(output, output.shape.length - 1, true); - output = tfc.div(output, outputSum); - } - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); - }); -} -/** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ -function sparseCategoricalCrossentropy(target, output, fromLogits) { - if (fromLogits === void 0) { fromLogits = false; } - return tfc.tidy(function () { - var flatTarget = tfc.floor(flatten$1(target)).toInt(); - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - var outputShape = output.shape; - var oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); -} -/** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ -function sigmoidCrossEntropyWithLogits(labels, logits) { - if (!tfc.util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError("logits and labels must have the same shape, but got shapes " + - (JSON.stringify(labels.shape) + " and " + JSON.stringify(logits.shape))); - } - return tfc.tidy(function () { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - var reluLogits = logits.relu(); - var negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); -} -function binaryCrossentropy(yTrue, yPred) { - return tfc.tidy(function () { - var y; - y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); - y = tfc.log(tfc.div(y, tfc.sub(1, y))); - return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); -} -function kullbackLeiblerDivergence(yTrue, yPred) { - return tfc.tidy(function () { - var clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); - var clippedPred = tfc.clipByValue(yPred, epsilon(), 1); - return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); - }); -} -function poisson(yTrue, yPred) { - return tfc.tidy(function () { - var logPred = tfc.log(tfc.add(epsilon(), yPred)); - return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); - }); -} -function cosineProximity(yTrue, yPred) { - return tfc.tidy(function () { - var trueNormalized = l2Normalize(yTrue, -1); - var predNormalized = l2Normalize(yPred, -1); - var trueXPred = tfc.mul(trueNormalized, predNormalized); - return tfc.neg(tfc.sum(trueXPred, -1)); - }); -} -// TODO(michaelterry): Add deserialize() function. -var lossesMap = { - meanSquaredError: meanSquaredError, - meanAbsoluteError: meanAbsoluteError, - meanAbsolutePercentageError: meanAbsolutePercentageError, - meanSquaredLogarithmicError: meanSquaredLogarithmicError, - squaredHinge: squaredHinge, - hinge: hinge, - categoricalHinge: categoricalHinge, - logcosh: logcosh, - categoricalCrossentropy: categoricalCrossentropy, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy, - binaryCrossentropy: binaryCrossentropy, - kullbackLeiblerDivergence: kullbackLeiblerDivergence, - poisson: poisson, - cosineProximity: cosineProximity -}; -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -function get(identifierOrFn) { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - var errMsg = "Unknown loss " + identifierOrFn; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = "Unknown loss " + identifierOrFn + ". " + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } - else { - return identifierOrFn; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function binaryAccuracy(yTrue, yPred) { - return tfc.tidy(function () { - var threshold = tfc.mul(.5, tfc.onesLike(yPred)); - var yPredThresholded = cast$1(tfc.greater(yPred, threshold), yTrue.dtype); - return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); - }); -} -function categoricalAccuracy(yTrue, yPred) { - return tfc.tidy(function () { return cast$1(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'); }); -} -function truePositives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); -} -function falseNegatives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); -} -function falsePositives(yTrue, yPred) { - return tfc.tidy(function () { - return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); -} -function precision(yTrue, yPred) { - return tfc.tidy(function () { - var tp = truePositives(yTrue, yPred); - var fp = falsePositives(yTrue, yPred); - var denominator = tp.add(fp); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -function recall(yTrue, yPred) { - return tfc.tidy(function () { - var tp = truePositives(yTrue, yPred); - var fn = falseNegatives(yTrue, yPred); - var denominator = tp.add(fn); - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} -function binaryCrossentropy$1(yTrue, yPred) { - return binaryCrossentropy(yTrue, yPred); -} -function sparseCategoricalAccuracy(yTrue, yPred) { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return tfc.equal(yTrue, yPred).asType('float32'); -} -// Aliases. -var mse = meanSquaredError; -var MSE = meanSquaredError; -var mae = meanAbsoluteError; -var MAE = meanAbsoluteError; -var mape = meanAbsolutePercentageError; -var MAPE = meanAbsolutePercentageError; -var categoricalCrossentropy$1 = categoricalCrossentropy; -var cosine = cosineProximity; -var sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy; -// TODO(cais, nielsene): Add serialize(). -var metricsMap = { - binaryAccuracy: binaryAccuracy, - categoricalAccuracy: categoricalAccuracy, - precision: precision, - categoricalCrossentropy: categoricalCrossentropy$1, - sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, - mse: mse, - MSE: MSE, - mae: mae, - MAE: MAE, - mape: mape, - MAPE: MAPE, - cosine: cosine -}; -function get$1(identifier) { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } - else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } - else { - throw new ValueError("Unknown metric " + identifier); - } -} -/** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ -function getLossOrMetricName(fn) { - assert$1(fn !== null, "Unknown LossOrMetricFn " + fn); - if (typeof fn === 'string') { - return fn; - } - else { - var fnName = void 0; - for (var _i = 0, _a = Object.keys(lossesMap); _i < _a.length; _i++) { - var key = _a[_i]; - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (var _b = 0, _c = Object.keys(metricsMap); _b < _c.length; _b++) { - var key = _c[_b]; - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return fn.name; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// Add (de)serialize() -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -function getOptimizer(identifier) { - var optimizerMap = { - 'Adagrad': function () { return tfc.train.adagrad(0.01); }, - 'Adadelta': function () { return tfc.train.adadelta(1, 0.95, epsilon()); }, - 'Adam': function () { return tfc.train.adam(0.001, 0.9, 0.999, epsilon()); }, - 'Adamax': function () { return tfc.train.adamax(0.002, 0.9, 0.999, epsilon(), 0); }, - 'RMSProp': function () { return tfc.train.rmsprop(0.001, 0.9, 0, epsilon()); }, - 'SGD': function () { return tfc.train.sgd(0.01); } - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError("Unknown Optimizer " + identifier); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Utility functions related to user-defined metadata. */ -// Maximum recommended serialized size for user-defined metadata. -// Beyond this limit, a warning message will be printed during model loading and -// saving. -var MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; -/** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ -function checkUserDefinedMetadata(userDefinedMetadata, modelName, checkSize) { - if (checkSize === void 0) { checkSize = false; } - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error('User-defined metadata is expected to be a JSON object, but is not.'); - } - if (checkSize) { - var out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn("User-defined metadata of model \"" + modelName + "\" is too large in " + - ("size (length=" + out.length + " when serialized). It is not ") + - "recommended to store such large objects in user-defined metadata. " + - "Please make sure its serialized length is <= " + - (MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH + ".")); - } - } -} -/** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ -// tslint:disable-next-line:no-any -function plainObjectCheck(x) { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } - else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - var keys = Object.keys(x); - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (var _a = 0, x_1 = x; _a < x_1.length; _a++) { - var item = x_1[_a]; - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } - else { - // `x` is not a JavaScript object or `null`. - var xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ -function printSummary(model, lineLength, positions, -// tslint:disable-next-line:no-any -printFn) { - if (printFn === void 0) { printFn = console.log; } - var sequentialLike = isModelSequentialLike(model); - // Header names for different log elements. - var toDisplay = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } - else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(function (p) { return Math.floor(lineLength * p); }); - } - var relevantNodes; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (var depth in model.nodesByDepth) { - relevantNodes.push.apply(relevantNodes, model.nodesByDepth[depth]); - } - } - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - var layers = model.layers; - for (var i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } - else { - printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - // tslint:disable-next-line:no-any - model.checkTrainableWeightsConsistency(); - var trainableCount = countTrainableParams(model); - var nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - printFn("Total params: " + (trainableCount + nonTrainableCount)); - printFn("Trainable params: " + trainableCount); - printFn("Non-trainable params: " + nonTrainableCount); - printFn('_'.repeat(lineLength)); -} -function countTrainableParams(model) { - var trainableCount; - // tslint:disable:no-any - if (model.collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights(model.collectedTrainableWeights); - } - else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; -} -function isModelSequentialLike(model) { - var sequentialLike = true; - var nodesByDepth = []; - var nodes = []; - for (var depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (var _i = 0, nodesByDepth_1 = nodesByDepth; _i < nodesByDepth_1.length; _i++) { - var depthNodes = nodesByDepth_1[_i]; - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push.apply(nodes, depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (var _a = 0, _b = model.layers; _a < _b.length; _a++) { - var layer = _b[_a]; - var flag = false; - for (var _c = 0, _d = layer.inboundNodes; _c < _d.length; _c++) { - var node = _d[_c]; - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } - else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; -} -function printRow(fields, positions, -// tslint:disable-next-line:no-any -printFn) { - if (printFn === void 0) { printFn = console.log; } - var line = ''; - for (var i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); -} -/** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ -function printLayerSummary(layer, positions, -// tslint:disable-next-line:no-any -printFn) { - var outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - var name = layer.name; - var className = layer.getClassName(); - var fields = [name + " (" + className + ")", outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); -} -/** - * Prints a summary for a single Layer, with connectivity information. - */ -function printLayerSummaryWithConnections(layer, positions, relevantNodes, -// tslint:disable-next-line:no-any -printFn) { - var outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - var connections = []; - for (var _i = 0, _a = layer.inboundNodes; _i < _a.length; _i++) { - var node = _a[_i]; - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (var i = 0; i < node.inboundLayers.length; ++i) { - var inboundLayer = node.inboundLayers[i].name; - var inboundLayerIndex = node.nodeIndices[i]; - var inboundTensorIndex = node.tensorIndices[i]; - connections.push(inboundLayer + "[" + inboundLayerIndex + "][" + inboundTensorIndex + "]"); - } - } - var name = layer.name; - var className = layer.getClassName(); - var firstConnection = connections.length === 0 ? '' : connections[0]; - var fields = [ - name + " (" + className + ")", outputShape, layer.countParams().toString(), - firstConnection - ]; - printRow(fields, positions, printFn); - for (var i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:enable -/** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ -function isArrayItemInputOrOutputName(key, index, value) { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; -} -/** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -function convertPythonicToTs(pythonicConfig, key) { - if (pythonicConfig === null) { - return null; - } - else if (typeof pythonicConfig === 'string') { - return toCamelCase(pythonicConfig); - } - else if ((typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } - else if (pythonicConfig instanceof Array) { - var tsArray = []; - var arrayLength = pythonicConfig.length; - for (var i = 0; i < arrayLength; ++i) { - var item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } - else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } - else { - var tsDict = {}; - for (var _i = 0, _a = Object.keys(pythonicConfig); _i < _a.length; _i++) { - var pythonicKey = _a[_i]; - var pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } - else { - var tsKey = toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } -} -/** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -function convertTsToPythonic(tsConfig, key) { - if (tsConfig === null || tsConfig === undefined) { - return null; - } - else if (typeof tsConfig === 'string') { - return toSnakeCase(tsConfig); - } - else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } - else if (tsConfig instanceof Array) { - var pyArray = []; - var arrayLength = tsConfig.length; - for (var i = 0; i < arrayLength; ++i) { - var item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } - else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } - else { - var pyDict = {}; - for (var _i = 0, _a = Object.keys(tsConfig); _i < _a.length; _i++) { - var tsKey = _a[_i]; - var tsValue = tsConfig[tsKey]; - var pyKey = toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } - else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } -} - -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -var version = '3.6.0'; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function to check the dtype and shape compatibility of a feed value. - */ -function assertFeedCompatibility(key, val) { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return tfc.cast(val, key.dtype); - } - catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError("The dtype of the feed (" + val.dtype + ") can not be cast to the dtype " + - ("of the key '" + key.name + "' (" + key.dtype + ").")); - } -} -/** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ -var FeedDict = /** @class */ (function () { - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - function FeedDict(feeds) { - this.id2Value = {}; - this.id2Mask = {}; - this.name2Id = {}; - if (feeds instanceof FeedDict) { - for (var id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } - else { - if (feeds == null) { - return; - } - for (var _i = 0, feeds_1 = feeds; _i < feeds_1.length; _i++) { - var feed = feeds_1[_i]; - this.add(feed.key, feed.value); - } - } - } - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - FeedDict.prototype.add = function (key, value, mask) { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } - else { - throw new ValueError("Duplicate key: name=" + key.name + ", id=" + key.id); - } - return this; - }; - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - FeedDict.prototype.addFeed = function (feed) { - this.add(feed.key, feed.value); - }; - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - FeedDict.prototype.hasKey = function (key) { - return this.id2Value[key.id] != null; - }; - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - FeedDict.prototype.names = function () { - return Object.keys(this.name2Id); - }; - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - FeedDict.prototype.getValue = function (key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError("Nonexistent key: " + key.name); - } - else { - return this.id2Value[key.id]; - } - } - else { - var id = this.name2Id[key]; - if (id == null) { - throw new ValueError("Feed dict has no SymbolicTensor name: " + key); - } - return this.id2Value[id]; - } - }; - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - FeedDict.prototype.getMask = function (key) { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError("Nonexistent key: " + key.name); - } - else { - return this.id2Mask[key.id]; - } - } - else { - var id = this.name2Id[key]; - if (id == null) { - throw new ValueError("Feed dict has no SymbolicTensor name: " + key); - } - return this.id2Mask[id]; - } - }; - /** Dispose all mask Tensors held by this object. */ - FeedDict.prototype.disposeMasks = function () { - if (this.id2Mask != null) { - tfc.dispose(this.id2Mask); - } - }; - return FeedDict; -}()); -// Cache for topologically sorted SymbolicTensors for given execution -// targets (i.e., fetches). -var cachedSorted = {}; -// Cache for recipient count maps for given execution targets (i.e., fetches). -var cachedRecipientCounts = {}; -/** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ -function execute(fetches, feedDict, kwargs, probe) { - var training = kwargs == null ? false : kwargs['training']; - var arrayFetches = Array.isArray(fetches); - var fetchArray = arrayFetches ? fetches : [fetches]; - var outputNames = fetchArray.map(function (t) { return t.name; }); - var finalOutputs = []; - var feedNames = feedDict.names(); - for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { - var outputName = outputNames_1[_i]; - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } - else { - finalOutputs.push(null); - } - } - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - // Check cache. - var fetchAndFeedKey = outputNames.join(',') + '|' + feedDict.names().join(','); - var sorted; - var recipientCounts; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - var out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - var internalFeedDict = new FeedDict(feedDict); - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (var i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - var numTensors = tfc.memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - var symbolic = sorted[i]; - var srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - var inputValues = []; - var inputMasks = []; - var tensorsToDispose = []; - var maskExists = false; - for (var _a = 0, _b = symbolic.inputs; _a < _b.length; _a++) { - var input = _b[_a]; - var value = internalFeedDict.getValue(input); - var mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - var outputTensors = toList(srcLayer.apply(inputValues, kwargs)); - var outputMask = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - var layerOutputs = getNodeOutputs(symbolic); - var outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (var i_1 = 0; i_1 < outputSymbolicTensors.length; ++i_1) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i_1])) { - internalFeedDict.add(outputSymbolicTensors[i_1], outputTensors[i_1], Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - var index = outputNames.indexOf(outputSymbolicTensors[i_1].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i_1]; - } - } - if (!training) { - // Clean up Tensors that are no longer needed. - tfc.dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - return arrayFetches ? finalOutputs : finalOutputs[0]; -} -/** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCounts(fetches, feedDict) { - tfc.util.assert(fetches != null && fetches.length > 0, function () { return "Expected at least one fetch, got none"; }); - var finalSorted = []; - var finalRecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - var out = getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } - else { - var visited = new Set(); - for (var _i = 0, fetches_1 = fetches; _i < fetches_1.length; _i++) { - var fetch_1 = fetches_1[_i]; - var _a = getTopologicalSortAndRecipientCountsForOneFetch(fetch_1, feedDict), sorted = _a.sorted, recipientMap = _a.recipientMap; - // Merge sorted SymbolicTensor Arrays. - for (var _b = 0, sorted_1 = sorted; _b < sorted_1.length; _b++) { - var symbolicTensor = sorted_1[_b]; - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - var _loop_1 = function (name_1) { - if (finalRecipientMap[name_1] == null) { - finalRecipientMap[name_1] = new Set(); - } - recipientMap[name_1].forEach(function (recipient) { return finalRecipientMap[name_1].add(recipient); }); - }; - // Merge recipient maps. - for (var name_1 in recipientMap) { - _loop_1(name_1); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; -} -function recipientMap2Counts(recipientMap) { - var recipientCounts = {}; - for (var name_2 in recipientMap) { - recipientCounts[name_2] = recipientMap[name_2].size; - } - return recipientCounts; -} -/** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict) { - var visited = new Set(); - var sorted = []; - var recipientMap = {}; - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (var _i = 0, _a = feedDict.names(); _i < _a.length; _i++) { - var key = _a[_i]; - visited.add(key); - } - var stack = []; - var marks = []; - // Initial population of stack and marks. - stack.push(fetch); - while (stack.length > 0) { - var top_1 = stack[stack.length - 1]; - if (visited.has(top_1.name)) { - stack.pop(); - continue; - } - var topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top_1.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top_1); - visited.add(top_1.name); - if (topIsMarked) { - marks.pop(); - } - } - else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (var _b = 0, _c = top_1.inputs; _b < _c.length; _b++) { - var input = _c[_b]; - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top_1.name); - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return { sorted: sorted, recipientMap: recipientMap }; -} -/** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ -function getNodeOutputs(fetch) { - var layerOutputs; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } - else { - var nodeIndex = null; - for (var i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (var _i = 0, _a = fetch.sourceLayer.inboundNodes[i] - .outputTensors; _i < _a.length; _i++) { - var outputTensor = _a[_i]; - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ -var Container = /** @class */ (function (_super) { - __extends(Container, _super); - function Container(args) { - var _this = - // No args passed to super's constructor. - _super.call(this, {}) || this; - _this.containerNodes = new Set(); - _this.name = args.name; - if (_this.name == null) { - var prefix = _this.getClassName().toLowerCase(); - _this.name = getUid(prefix); - } - _this.supportsMasking = false; - _this.trainable_ = true; - // TODO(michaelterry): Initialize perInputLosses/Updates here. - // Container-specific properties. - if (Array.isArray(args.inputs)) { - _this.inputs = args.inputs.slice(); - } - else { - _this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - _this.outputs = args.outputs.slice(); - } - else { - _this.outputs = [args.outputs]; - } - // Check for redundancy in inputs. - if (unique$1(_this.inputs).length !== _this.inputs.length) { - throw new ValueError('The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - ("" + _this.inputs.map(function (x) { return x.name; }))); - } - // Check for redundancy in outputs. - if (unique$1(_this.outputs).length !== _this.outputs.length) { - console.warn('The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - ("" + _this.outputs.map(function (x) { return x.name; }))); - } - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - _this.inputLayers = []; - _this.inputLayersNodeIndices = []; - _this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - _this.outputLayers = []; - _this.outputLayersNodeIndices = []; - _this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - _this.layers = []; - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - _this.internalContainerRefs = []; - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - // Build this.outputLayers: - for (var _i = 0, _a = _this.outputs; _i < _a.length; _i++) { - var x = _a[_i]; - var layer = x.sourceLayer; - var nodeIndex = x.nodeIndex; - var tensorIndex = x.tensorIndex; - _this.outputLayers.push(layer); - _this.outputLayersNodeIndices.push(nodeIndex); - _this.outputLayersTensorIndices.push(tensorIndex); - } - // TODO(michaelterry): Add output mask cache code. - // Build this.inputLayers: - for (var _b = 0, _c = _this.inputs; _b < _c.length; _b++) { - var x = _c[_b]; - var layer = x.sourceLayer; - var nodeIndex = x.nodeIndex; - var tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - assert$1(nodeIndex === 0, 'input layer has >1 nodes'); - assert$1(tensorIndex === 0, 'input layer has >1 tensors'); - _this.inputLayers.push(layer); - _this.inputLayersNodeIndices.push(nodeIndex); - _this.inputLayersTensorIndices.push(tensorIndex); - } - // Build this.inputNames and this.outputNames. - _this.inputNames = []; - _this.outputNames = []; - _this.feedInputShapes = []; - _this.feedInputNames = []; - _this.feedOutputNames = []; - for (var i = 0; i < _this.inputLayers.length; i++) { - var layer = _this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError('Input layers to a LayersModel must be InputLayer objects. ' + - ("Received inputs: " + args.inputs + ". ") + - ("Input " + i + " (0-based) originates ") + - ("from layer type " + layer.getClassName() + ".")); - } - _this.inputNames.push(layer.name); - _this.feedInputShapes.push(layer.batchInputShape); - _this.feedInputNames.push(layer.name); - } - for (var _d = 0, _e = _this.outputLayers; _d < _e.length; _d++) { - var layer = _e[_d]; - _this.outputNames.push(layer.name); - } - _this.internalInputShapes = _this.inputs.map(function (x) { return x.shape; }); - _this.internalOutputShapes = _this.outputs.map(function (x) { return x.shape; }); - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - var nodesDepths = {}; - // To recover nodes from their ID. - var nodeIDToNode = {}; - var layersDepths = {}; - // To layers from their ID. - var layerIDToLayer = {}; - var layerIndices = {}; - var nodesInDecreasingDepth = []; - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - var buildMapOfGraph = function (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - var node = layer.inboundNodes[nodeIndex]; - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError("The tensor " + tensor.name + " at layer \"" + layer.name + "\" " + - 'is part of a cycle.'); - } - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - // Update containerNodes. - _this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - // Propagate to all previous tensors connected to this node. - var numInboundLayers = node.inboundLayers.length; - for (var i = 0; i < numInboundLayers; i++) { - var x = node.inputTensors[i]; - var layer_1 = node.inboundLayers[i]; - var nodeIndex_1 = node.nodeIndices[i]; - var tensorIndex_1 = node.tensorIndices[i]; - buildMapOfGraph(x, finishedNodes, nodesInProgress, layer_1, nodeIndex_1, tensorIndex_1); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - var finishedNodes = []; - var nodesInProgress = []; - for (var _f = 0, _g = _this.outputs; _f < _g.length; _f++) { - var x = _g[_f]; - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - var reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); - for (var _h = 0, reversedNodesInDecreasingDepth_1 = reversedNodesInDecreasingDepth; _h < reversedNodesInDecreasingDepth_1.length; _h++) { - var node = reversedNodesInDecreasingDepth_1[_h]; - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - var depth = nodesDepths[node.id]; - // Update the depth of the corresponding layer - var previousDepth = (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - // Update the depth of inbound nodes. - for (var i = 0; i < node.inboundLayers.length; i++) { - var inboundLayer = node.inboundLayers[i]; - var nodeIndex = node.nodeIndices[i]; - var inboundNode = inboundLayer.inboundNodes[nodeIndex]; - var previousDepth_1 = (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth_1); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - // Build a dict {depth: list of nodes with this depth} - var nodesByDepth = {}; - for (var nodeID in nodesDepths) { - var depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - // Build a dict {depth: list of layers with this depth} - var layersByDepth = {}; - for (var layerID in layersDepths) { - var depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - // Get sorted list of layer depths. - var depthKeys = Object.keys(layersByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Set this.layers and this.layersByDepth. - _this.layers = []; - for (var _j = 0, depthKeys_1 = depthKeys; _j < depthKeys_1.length; _j++) { - var depth = depthKeys_1[_j]; - var layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort(function (a, b) { - var aIndex = layerIndices[a.id]; - var bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (var _k = 0, layersForDepth_1 = layersForDepth; _k < layersForDepth_1.length; _k++) { - var layer = layersForDepth_1[_k]; - if (layer instanceof Container) { - _this.internalContainerRefs.push(layer); - } - _this.layers.push(layer); - } - } - _this.layersByDepth = layersByDepth; - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - var computableTensors = _this.inputs.slice(); - // To provide a better error msg. - var layersWithCompleteInput = []; - for (var _l = 0, depthKeys_2 = depthKeys; _l < depthKeys_2.length; _l++) { - var depth = depthKeys_2[_l]; - for (var _m = 0, _o = nodesByDepth[depth]; _m < _o.length; _m++) { - var node = _o[_m]; - var layer = node.outboundLayer; - if (layer != null) { - for (var _p = 0, _q = node.inputTensors; _p < _q.length; _p++) { - var x = _q[_p]; - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError("Graph disconnected: cannot obtain value for tensor " + x + - (" at layer \"" + layer.name + "\". ") + - 'The following previous layers were accessed without ' + - ("issue: " + layersWithCompleteInput)); - } - } - for (var _r = 0, _s = node.outputTensors; _r < _s.length; _r++) { - var x = _s[_r]; - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - // Set this.containerNodes and this.nodesByDepth. - _this.nodesByDepth = nodesByDepth; - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - var allNames = _this.layers.map(function (x) { return x.name; }); - var _loop_1 = function (name_1) { - var numOccurrences = allNames.filter(function (x) { return x === name_1; }).length; - if (numOccurrences !== 1) { - throw new RuntimeError("The name \"" + name_1 + "\" is used " + numOccurrences + " times " + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - }; - for (var _t = 0, allNames_1 = allNames; _t < allNames_1.length; _t++) { - var name_1 = allNames_1[_t]; - _loop_1(name_1); - } - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - _this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - _this.inboundNodes = []; - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: _this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: _this.inputs, - outputTensors: _this.outputs, - inputMasks: _this.inputs.map(function (x) { return null; }), - outputMasks: _this.outputs.map(function (x) { return null; }), - inputShapes: _this.inputs.map(function (x) { return x.shape; }), - outputShapes: _this.outputs.map(function (x) { return x.shape; }) - }); - _this.built = true; - _this._refCount = 1; // The ref count of a container always start at 1. - return _this; - } - Container.prototype.assertNotDisposed = function () { - if (this._refCount === 0) { - throw new Error("Container '" + this.name + "' is already disposed."); - } - }; - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - Container.prototype.dispose = function () { - this.assertNotDisposed(); - var result = { refCountAfterDispose: null, numDisposedVariables: 0 }; - if (--this._refCount === 0) { - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (var _b = 0, _c = this.internalContainerRefs; _b < _c.length; _b++) { - var container = _c[_b]; - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - }; - Object.defineProperty(Container.prototype, "trainable", { - get: function () { - return this.trainable_; - }, - set: function (trainable) { - this.layers.forEach(function (layer) { - // tslint:disable-next-line:no-any - layer._trainableWeights - .forEach(function (w) { return w.trainable = trainable; }); - }); - this.trainable_ = trainable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "trainableWeights", { - get: function () { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - if (!this.trainable) { - return []; - } - var weights = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - weights = weights.concat(layer.trainableWeights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "nonTrainableWeights", { - get: function () { - var weights = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - weights.push.apply(weights, layer.nonTrainableWeights); - } - if (!this.trainable) { - var trainableWeights = []; - for (var _b = 0, _c = this.layers; _b < _c.length; _b++) { - var layer = _c[_b]; - trainableWeights.push.apply(trainableWeights, layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Container.prototype, "weights", { - get: function () { - return this.trainableWeights.concat(this.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - Container.prototype.loadWeights = function (weights, strict) { - if (strict === void 0) { strict = true; } - var nameToWeight = {}; - var totalWeightsCount = 0; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - for (var _b = 0, _c = layer.weights; _b < _c.length; _b++) { - var weight = _c[_b]; - if (nameToWeight[weight.originalName] != null) { - throw new ValueError("Duplicate weight name: " + weight.originalName); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - var weightValueTuples = []; - for (var name_2 in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - var validatedName = name_2; - if (nameToWeight[name_2] == null) { - var tokens = name_2.split('/'); - var shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name_2]]); - } - else if (strict) { - throw new ValueError("Provided weight data has no target variable: " + name_2); - } - delete nameToWeight[validatedName]; - } - if (strict) { - // Check that all weights are set. - var unsetNames = []; - for (var name_3 in nameToWeight) { - unsetNames.push(name_3); - } - if (unsetNames.length > 0) { - throw new ValueError(unsetNames.length + " of " + totalWeightsCount + " weights are not set: " + - ("" + unsetNames)); - } - } - batchSetValue(weightValueTuples); - }; - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - Container.prototype.updatedConfig = function () { - var theConfig = this.getConfig(); - var modelConfig = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = "tfjs-layers " + version; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - }; - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - Container.prototype.toJSON = function (unused, returnString) { - if (returnString === void 0) { returnString = true; } - var modelConfig = convertTsToPythonic(this.updatedConfig()); - return returnString ? JSON.stringify(modelConfig) : modelConfig; - }; - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - Container.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = toList(inputs); - var feedDict = new FeedDict(); - for (var i = 0; i < _this.inputs.length; ++i) { - feedDict.add(_this.inputs[i], inputs[i]); - } - return execute(_this.outputs, feedDict, kwargs); - }); - }; - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - Container.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - inputs = toList(inputs); - var masks; - if (mask == null) { - masks = pyListRepeat(null, inputs.length); - } - else { - masks = toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return _this.runInternalGraph(inputs, masks)[1]; - }); - }; - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - Container.prototype.computeOutputShape = function (inputShape) { - var inputShapes = normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError("Invalid inputShape argument " + inputShape + ": " + - ("model has " + this.inputLayers.length + " tensor inputs.")); - } - // TODO(michaelterry): Add caching - var layersToOutputShapes = {}; - for (var i = 0; i < inputShapes.length; i++) { - var layer = this.inputLayers[i]; - var inputShape_1 = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - var shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape_1; - } - var depthKeys = Object.keys(this.nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (var _i = 0, depthKeys_3 = depthKeys; _i < depthKeys_3.length; _i++) { - var depth = depthKeys_3[_i]; - var nodes = this.nodesByDepth[depth]; - for (var _a = 0, nodes_1 = nodes; _a < nodes_1.length; _a++) { - var node = nodes_1[_a]; - // This is always a single layer, never a list. - var layer = node.outboundLayer; - if (this.inputLayers.map(function (x) { return x.id; }).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - var inputShapes_1 = []; - for (var j = 0; j < node.inboundLayers.length; j++) { - var inboundLayer = node.inboundLayers[j]; - var nodeIndex_2 = node.nodeIndices[j]; - var tensorIndex = node.tensorIndices[j]; - var shapeKey = inboundLayer.name + "_" + nodeIndex_2 + "_" + tensorIndex; - var inputShape_2 = layersToOutputShapes[shapeKey]; - inputShapes_1.push(inputShape_2); - } - var outputShape = layer.computeOutputShape(singletonOrArray(inputShapes_1)); - var outputShapes_1 = normalizeShapeList(outputShape); - var nodeIndex = layer.inboundNodes.indexOf(node); - for (var j = 0; j < outputShapes_1.length; j++) { - var shapeKey = layer.name + "_" + nodeIndex + "_" + j; - layersToOutputShapes[shapeKey] = outputShapes_1[j]; - } - } - } - } - // Read final output shapes from layersToOutputShapes. - var outputShapes = []; - var outputShapeKeys = []; - for (var i = 0; i < this.outputLayers.length; i++) { - var layer = this.outputLayers[i]; - var nodeIndex = this.outputLayersNodeIndices[i]; - var tensorIndex = this.outputLayersTensorIndices[i]; - var shapeKey = layer.name + "_" + nodeIndex + "_" + tensorIndex; - outputShapeKeys.push(shapeKey); - } - for (var i = 0; i < outputShapeKeys.length; i++) { - var key = outputShapeKeys[i]; - assert$1(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - // TODO(michaelterry): Update cache - return singletonOrArray(outputShapes); - }; - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - Container.prototype.runInternalGraph = function (inputs, masks) { - if (masks == null) { - masks = pyListRepeat(null, inputs.length); - } - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - var tensorMap = {}; - for (var i = 0; i < this.inputs.length; ++i) { - var x = this.inputs[i]; - var y = inputs[i]; - var mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - var depthKeys = Object.keys(this.nodesByDepth) - .map(function (x) { return parseInt(x, 10); }) - .sort(reverseNumberCompare); - for (var _i = 0, depthKeys_4 = depthKeys; _i < depthKeys_4.length; _i++) { - var depth = depthKeys_4[_i]; - var nodes = this.nodesByDepth[depth]; - for (var _a = 0, nodes_2 = nodes; _a < nodes_2.length; _a++) { - var node = nodes_2[_a]; - // This is always a single layer, never a list. - var layer = node.outboundLayer; - var referenceInputTensors = node.inputTensors; - var referenceOutputTensors = node.outputTensors; - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - var computedData = new Array(); - for (var _b = 0, referenceInputTensors_1 = referenceInputTensors; _b < referenceInputTensors_1.length; _b++) { - var x = referenceInputTensors_1[_b]; - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - var kwargs = {}; - var computedTensors = void 0; - var computedMasks = void 0; - var outputTensors_1 = void 0; - var outputMasks_1 = void 0; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - var _c = computedData[0], computedTensor = _c[0], computedMask = _c[1]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors_1 = - toList(layer.call(computedTensor, kwargs)); - outputMasks_1 = toList(layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } - else { - computedTensors = computedData.map(function (x) { return x[0]; }); - computedMasks = computedData.map(function (x) { return x[1]; }); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors_1 = - toList(layer.call(computedTensors, kwargs)); - outputMasks_1 = toList(layer.computeMask(computedTensors, computedMasks)); - } - if (layer.activityRegularizer) { - throw new NotImplementedError('LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - // Update tensor map. - for (var i = 0; i < referenceOutputTensors.length; ++i) { - var x = referenceOutputTensors[i]; - var y = outputTensors_1[i]; - var mask = outputMasks_1[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - var outputTensors = []; - var outputMasks = []; - var outputShapes = []; - for (var _d = 0, _e = this.outputs; _d < _e.length; _d++) { - var x = _e[_d]; - assert$1(x.id in tensorMap, "Could not compute output " + x.name + " : " + x.id); - var _f = tensorMap[x.id], tensor = _f[0], mask = _f[1]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - }; - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - Container.prototype.buildNodeConversionMap = function (layers) { - var nodeConversionMap = {}; - var keptNodes; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - keptNodes = layer instanceof Container ? 1 : 0; - for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - var nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - }; - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - Container.prototype.getLayer = function (name, index) { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError("Was asked to retrieve layer at index " + index + ", but model only " + - ("has " + this.layers.length + " layer(s).")); - } - else { - return this.layers[index]; - } - } - else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer.name === name) { - return layer; - } - } - throw new ValueError("No such layer: " + name); - }; - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - Container.prototype.calculateLosses = function () { - var _this = this; - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tfc.tidy(function () { - var losses = []; - for (var _i = 0, _a = _this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - for (var nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (_this.containerNodes.has(nodeKey)) { - losses.push.apply(losses, layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - }; - Container.prototype.getConfig = function () { - var config = { name: this.name }; - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - var nodeConversionMap = this.buildNodeConversionMap(this.layers); - // Serialize and save the layers in layerConfigs - var layerConfigs = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var layerClassName = layer.getClassName(); - var layerConfig = layer.getConfig(); - var filteredInboundNodes = []; - for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - var node = layer.inboundNodes[originalNodeIndex]; - var nodeKey = Container.nodeKey(layer, originalNodeIndex); - var kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } - catch (err) { - console.warn("Layer " + layer.name + " was passed " + - "non-serializable keyword arguments: " + - (node.callArgs + ". They will not be included ") + - "in the serialized model (and thus will be " + - "missing at deserialization time)."); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - var nodeData = []; - for (var i = 0; i < node.inboundLayers.length; i++) { - var inboundLayer = node.inboundLayers[i]; - var nodeIndex = node.nodeIndices[i]; - var tensorIndex = node.tensorIndices[i]; - var nodeKey_1 = Container.nodeKey(inboundLayer, nodeIndex); - var newNodeIndex = nodeConversionMap[nodeKey_1]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - var dict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - var modelInputs = []; - for (var i = 0; i < this.inputLayers.length; i++) { - var layer = this.inputLayers[i]; - var nodeIndex = this.inputLayersNodeIndices[i]; - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - var newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - var tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - var modelOutputs = []; - for (var i = 0; i < this.outputLayers.length; i++) { - var layer = this.outputLayers[i]; - var nodeIndex = this.outputLayersNodeIndices[i]; - var nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - var newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - var tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - }; - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - Container.fromConfig = function (cls, config, customObjects, fastWeightInit) { - if (fastWeightInit === void 0) { fastWeightInit = false; } - // Layer instances created during - // the graph reconstruction process - var createdLayers = {}; - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - var unprocessedNodes = {}; - function addUnprocessedNode(layer, nodeData) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } - else { - unprocessedNodes[layer.name].push(nodeData); - } - } - function processNode(layer, nodeData) { - var inputTensors = []; - var kwargs; - for (var _i = 0, nodeData_1 = nodeData; _i < nodeData_1.length; _i++) { - var inputData = nodeData_1[_i]; - var inboundLayerName = inputData[0]; - var inboundNodeIndex = inputData[1]; - var inboundTensorIndex = inputData[2]; - kwargs = inputData[3] == null ? - {} : - inputData[3]; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - var inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - var inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply(singletonOrArray(inputTensors), kwargs); // was ** kwargs - } - } - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData) { - var layerName = layerData['name']; - // Instantiate layer. - var layer = deserialize(layerData, config['customObjects'] != null ? - config['customObjects'] : - {}); - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - var inboundNodesData = layerData['inboundNodes']; - inboundNodesData.forEach(function (nodeData) { - if (!(nodeData instanceof Array)) { - throw new ValueError("Corrupted configuration, expected array for nodeData: " + nodeData); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - // First, we create all layers and enqueue nodes to be processed. - var name = config['name']; - var layersFromConfig = config['layers']; - for (var _i = 0, layersFromConfig_1 = layersFromConfig; _i < layersFromConfig_1.length; _i++) { - var layerData = layersFromConfig_1[_i]; - processLayer(layerData); - } - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!isObjectEmpty(unprocessedNodes)) { - for (var _a = 0, layersFromConfig_2 = layersFromConfig; _a < layersFromConfig_2.length; _a++) { - var layerData = layersFromConfig_2[_a]; - var layer = createdLayers[layerData['name']]; - if (layer.name in unprocessedNodes) { - var currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (var _b = 0, currentUnprocessedNodesForLayer_1 = currentUnprocessedNodesForLayer; _b < currentUnprocessedNodesForLayer_1.length; _b++) { - var nodeData = currentUnprocessedNodesForLayer_1[_b]; - processNode(layer, nodeData); - } - } - } - } - var inputTensors = []; - var outputTensors = []; - var inputLayersFromConfig = config['inputLayers']; - for (var _c = 0, inputLayersFromConfig_1 = inputLayersFromConfig; _c < inputLayersFromConfig_1.length; _c++) { - var layerData = inputLayersFromConfig_1[_c]; - var layerName = layerData[0]; - var nodeIndex = layerData[1]; - var tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - var layer = createdLayers[layerName]; - var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - var outputLayersFromConfig = config['outputLayers']; - for (var _d = 0, outputLayersFromConfig_1 = outputLayersFromConfig; _d < outputLayersFromConfig_1.length; _d++) { - var layerData = outputLayersFromConfig_1[_d]; - var layerName = layerData[0]; - var nodeIndex = layerData[1]; - var tensorIndex = layerData[2]; - assert$1(layerName in createdLayers); - var layer = createdLayers[layerName]; - var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({ inputs: inputTensors, outputs: outputTensors, name: name }); - }; - Object.defineProperty(Container.prototype, "stateful", { - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get: function () { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - if (layer.stateful) { - return true; - } - } - return false; - }, - enumerable: true, - configurable: true - }); - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - Container.prototype.resetStates = function () { - var _this = this; - tfc.tidy(function () { - _this.layers.forEach(function (layer) { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - }; - return Container; -}(Layer)); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function standardizeSampleOrClassWeights(xWeight, outputNames, weightType) { - var numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(function (name) { return null; }); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } - else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [xWeight[outputNames[0]]]; - } - else { - return [xWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error("Provided " + weightType + " is an array of " + xWeight.length + " " + - ("element(s), but the model has " + numOutputs + " outputs. ") + - "Make sure a set of weights is provided for each model output."); - } - return xWeight; - } - else if (typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof xWeight[Object.keys(xWeight)[0]] === - 'object') { - var output_1 = []; - outputNames.forEach(function (outputName) { - if (outputName in xWeight) { - output_1.push(xWeight[outputName]); - } - else { - output_1.push(null); - } - }); - return output_1; - } - else { - throw new Error("The model has multiple (" + numOutputs + ") outputs, " + - ("so " + weightType + " must be either an array with ") + - (numOutputs + " elements or an object with " + outputNames + " keys. ") + - ("Provided " + weightType + " not understood: " + JSON.stringify(xWeight))); - } -} -/** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ -function standardizeClassWeights(classWeight, outputNames) { - return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight'); -} -/** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ -function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) { - return __awaiter(this, void 0, void 0, function () { - var yClasses, yClassIndices, _a, _b, classSampleWeight_1; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - if (!(classWeight != null)) return [3 /*break*/, 2]; - yClasses = tfc.tidy(function () { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone(); - } - else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - var axis = 1; - return y.argMax(axis); - } - else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } - else { - throw new Error("Encountered unexpected last-dimension size (" + y.shape[1] + ") " + - "during handling of class weights. The size is expected to be " + - ">= 1."); - } - } - else { - throw new Error("Unexpected rank of target (y) tensor (" + y.rank + ") during " + - "handling of class weights. The rank is expected to be 1 or 2."); - } - }); - _b = (_a = Array).from; - return [4 /*yield*/, yClasses.data()]; - case 1: - yClassIndices = _b.apply(_a, [_c.sent()]); - tfc.dispose(yClasses); - classSampleWeight_1 = []; - yClassIndices.forEach(function (classIndex) { - if (classWeight[classIndex] == null) { - throw new Error("classWeight must contain all classes in the training data. " + - ("The class " + classIndex + " exists in the data but not in ") + - "classWeight"); - } - else { - classSampleWeight_1.push(classWeight[classIndex]); - } - }); - return [2 /*return*/, tfc.tensor1d(classSampleWeight_1, 'float32')]; - case 2: return [2 /*return*/, null]; - } - }); - }); -} -/** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ -function computeWeightedLoss(losses, sampleWeights) { - return tfc.mul(losses, sampleWeights); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// Default batch size used during tensor-based validation. -var DEFAULT_VALIDATION_BATCH_SIZE = 32; -/** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ -function standardizeDataIteratorOutput( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, iteratorOut) { - var xs; - var ys; - var iteratorOutObj = iteratorOut; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - tfc.util.assert(xs != null && ys != null, function () { return 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - ("" + iteratorOut); }); - var flattenedXs = flattenTensorOrArrayOrMap('input', model.inputNames, xs); - var flattenedYs = flattenTensorOrArrayOrMap('output', model.outputNames, ys); - var batchSize = flattenedXs[0].shape[0]; - tfc.util.assert(flattenedXs.length === model.inputs.length, function () { return "LayersModel has " + model.inputs.length + " inputs, but the dataset " + - ("provides " + flattenedXs.length + " inputs. (Expected input keys: ") + - (JSON.stringify(model.inputNames) + ")"); }); - tfc.util.assert(flattenedYs.length === model.outputs.length, function () { - return "LayersModel has " + model.outputs.length + " outputs, but the dataset " + - ("provides " + flattenedYs.length + " outputs. (Expected output keys: ") + - (JSON.stringify(model.outputNames) + ")"); - }); - var _loop_1 = function (xIndex) { - tfc.util.assert(flattenedXs[xIndex].shape[0] === batchSize, function () { return "Batch size mismatch: input " + - (model.inputNames[xIndex] + " has " + flattenedXs[xIndex].shape[0] + "; ") + - ("expected " + batchSize + " based on input " + model.inputNames[0] + "."); }); - }; - for (var xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - _loop_1(xIndex); - } - var _loop_2 = function (yIndex) { - tfc.util.assert(flattenedYs[yIndex].shape[0] === batchSize, function () { return "Batch size mismatch: output " + - (model.outputNames[yIndex] + " has " + flattenedYs[yIndex].shape[0] + "; ") + - ("expected " + batchSize + " based on input " + model.inputNames[0] + "."); }); - }; - for (var yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - _loop_2(yIndex); - } - return { xs: flattenedXs, ys: flattenedYs }; -} -function flattenTensorOrArrayOrMap(inputOrOutput, names, values) { - if (values instanceof tfc.Tensor) { - return [values]; - } - else if (Array.isArray(values)) { - tfc.util.assert(values.length === names.length, function () { return "Received an array of " + values.length + " Tensors, but expected " + names.length + " to match the " + inputOrOutput + " keys " + names + "."; }); - return values; - } - else { - var result = []; - // Check that all the required keys are available. - for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_1 = names_1[_i]; - if (values[name_1] == null) { - throw new ValueError("The feature data generated by the dataset lacks the required " + - (inputOrOutput + " key '" + name_1 + "'.")); - } - result.push(values[name_1]); - } - return result; - } -} -function standardizeTensorValidationData(data) { - if (data.length === 3) { - throw new NotImplementedError('Validation with sample weights is not implemented yet.'); - } - return { xs: data[0], ys: data[1] }; -} -function fitDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - return __awaiter(this, void 0, void 0, function () { - var hasBatchesPerEpoch, doValidation, valXs, valYs, validationData, trainFunction, outLabels, callbackMetrics, callbacks, verbose, _a, callbackList, history_1, epoch, dataIterator, epochLogs, stepsDone, batchIndex, iteratorOut, _b, xs, ys, batchLogs, sampleWeights, standardClassWeights, i, _c, _d, ins, outs, i, label, out, valOuts, _e, i; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - hasBatchesPerEpoch = args.batchesPerEpoch != null; - tfc.util.assert(model.optimizer != null, function () { return 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'; }); - tfc.util.assert(args != null, function () { return "For fitDataset(), the 2nd argument (config) is required, " + - "but it is not provided in this call."; }); - tfc.util.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), function () { return "For fitDataset(), config.epochs is expected to be a positive " + - ("integer, but got " + args.epochs); }); - tfc.util.assert(!hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), function () { return "For fitDataset(), config.batchesPerEpoch is expected to be a " + - ("positive integer if specified, but got " + args.batchesPerEpoch); }); - tfc.util.assert( - // tslint:disable-next-line:no-any - args['validationSplit'] == null, function () { return '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'; }); - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - _f.label = 1; - case 1: - _f.trys.push([1, , 26, 27]); - doValidation = args.validationData != null; - valXs = void 0; - valYs = void 0; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - tfc.util.assert(args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), function () { return "For fitDataset() with dataset-based validation, " + - "config.validationBatches is expected not to be provided, " + - "or to be a positive integer, " + - ("but got " + args.validationBatches); }); - } - else { - validationData = standardizeTensorValidationData(args.validationData); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - trainFunction = model.makeTrainFunction(); - outLabels = model.getDedupedMetricsNames(); - callbackMetrics = void 0; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); - } - else { - callbackMetrics = outLabels.slice(); - } - callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - verbose = args.verbose == null ? 1 : args.verbose; - _a = configureCallbacks(callbacks, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics), callbackList = _a.callbackList, history_1 = _a.history; - callbackList.setModel(model); - model.history = history_1; - return [4 /*yield*/, callbackList.onTrainBegin()]; - case 2: - _f.sent(); - model.stopTraining_ = false; - epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - return [4 /*yield*/, dataset.iterator()]; - case 3: - dataIterator = _f.sent(); - _f.label = 4; - case 4: - if (!(epoch < args.epochs)) return [3 /*break*/, 23]; - epochLogs = {}; - return [4 /*yield*/, callbackList.onEpochBegin(epoch)]; - case 5: - _f.sent(); - stepsDone = 0; - batchIndex = 0; - if (!!hasBatchesPerEpoch) return [3 /*break*/, 7]; - return [4 /*yield*/, dataset.iterator()]; - case 6: - dataIterator = _f.sent(); - _f.label = 7; - case 7: - if (!(hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true)) return [3 /*break*/, 21]; - return [4 /*yield*/, dataIterator.next()]; - case 8: - iteratorOut = _f.sent(); - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn('You provided `batchesPerEpoch` as ' + - (args.batchesPerEpoch + ", ") + - 'but your dataset iterator ran out of data after ' + - (stepsDone + " batches; ") + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - (args.batchesPerEpoch * args.epochs + " batches). ") + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - return [3 /*break*/, 21]; - } - if (!(iteratorOut.value != null)) return [3 /*break*/, 15]; - _b = standardizeDataIteratorOutput(model, iteratorOut.value), xs = _b.xs, ys = _b.ys; - batchLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - return [4 /*yield*/, callbackList.onBatchBegin(batchIndex, batchLogs)]; - case 9: - _f.sent(); - sampleWeights = []; - if (!(args.classWeight != null)) return [3 /*break*/, 13]; - standardClassWeights = standardizeClassWeights(args.classWeight, model.outputNames); - i = 0; - _f.label = 10; - case 10: - if (!(i < standardClassWeights.length)) return [3 /*break*/, 13]; - _d = (_c = sampleWeights).push; - return [4 /*yield*/, standardizeWeights(ys[i], null, standardClassWeights[i])]; - case 11: - _d.apply(_c, [_f.sent()]); - _f.label = 12; - case 12: - ++i; - return [3 /*break*/, 10]; - case 13: - ins = xs.concat(ys).concat(sampleWeights); - outs = trainFunction(ins); - tfc.dispose(ins); - for (i = 0; i < outLabels.length; ++i) { - label = outLabels[i]; - out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - } - return [4 /*yield*/, callbackList.onBatchEnd(batchIndex, batchLogs)]; - case 14: - _f.sent(); - disposeTensorsInLogs(batchLogs); - batchIndex++; - stepsDone++; - _f.label = 15; - case 15: - if (!(hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done)) return [3 /*break*/, 20]; - if (!doValidation) return [3 /*break*/, 19]; - valOuts = void 0; - if (!isDatasetObject(args.validationData)) return [3 /*break*/, 17]; - _e = toList; - return [4 /*yield*/, model.evaluateDataset(args.validationData, { batches: args.validationBatches })]; - case 16: - valOuts = _e.apply(void 0, [_f.sent()]); - return [3 /*break*/, 18]; - case 17: - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - _f.label = 18; - case 18: - for (i = 0; i < model.metricsNames.length; ++i) { - epochLogs["val_" + model.metricsNames[i]] = valOuts[i]; - } - _f.label = 19; - case 19: - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - return [3 /*break*/, 21]; - case 20: - if (model.stopTraining_) { - return [3 /*break*/, 21]; - } - return [3 /*break*/, 7]; - case 21: return [4 /*yield*/, callbackList.onEpochEnd(epoch, epochLogs)]; - case 22: - _f.sent(); - epoch++; - if (model.stopTraining_) { - return [3 /*break*/, 23]; - } - return [3 /*break*/, 4]; - case 23: return [4 /*yield*/, callbackList.onTrainEnd()]; - case 24: - _f.sent(); - return [4 /*yield*/, model.history.syncData()]; - case 25: - _f.sent(); - return [2 /*return*/, model.history]; - case 26: - model.isTraining = false; - return [7 /*endfinally*/]; - case 27: return [2 /*return*/]; - } - }); - }); -} -/** Helper function that determines number of steps (batches) per epoch. */ -function getStepsPerEpoch(dataset, args) { - // Attempt to determine # of batches in an epoch. - var stepsPerEpoch = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } - else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; -} -// Check if provided object is a Dataset object by checking its .iterator -// element. -function isDatasetObject(dataset) { - return (typeof dataset.iterator === 'function'); -} -// Check if provided object is a LazyIterator object by checking it's .next -// element. -function isLazyIteratorObject(iterator) { - return (typeof iterator.next === 'function'); -} -function evaluateDataset( -// Type `model` as `any` here to avoid circular dependency w/ -// training.ts. -// tslint:disable-next-line:no-any -model, dataset, args) { - return __awaiter(this, void 0, void 0, function () { - var hasBatches, f, outs, dataIterator, _a, numExamples, batch, _loop_3, state_1, i, oldScalar; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - args = args || {}; - hasBatches = args.batches != null; - f = model.testFunction; - outs = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - tfc.util.assert(!hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), function () { return 'Test loop expects `batches` to be a positive integer, but ' + - ("received " + JSON.stringify(args.batches)); }); - if (!isLazyIteratorObject(dataset)) return [3 /*break*/, 1]; - _a = dataset; - return [3 /*break*/, 3]; - case 1: return [4 /*yield*/, dataset.iterator()]; - case 2: - _a = _b.sent(); - _b.label = 3; - case 3: - dataIterator = _a; - numExamples = 0; - batch = 0; - _loop_3 = function () { - var iteratorOut; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, dataIterator.next()]; - case 1: - iteratorOut = _a.sent(); - outs = tfc.tidy(function () { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - var _a = standardizeDataIteratorOutput(model, iteratorOut.value), xs = _a.xs, ys = _a.ys; - var xsAndYs_1 = xs.concat(ys); - var batchOuts = tfc.tidy(function () { return f(xsAndYs_1); }); - tfc.dispose(xsAndYs_1); - if (batch === 0) { - for (var i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - var batchSize_1 = xsAndYs_1[0].shape[0]; - var _loop_4 = function (i) { - var batchOut = batchOuts[i]; - var oldScalar = outs[i]; - outs[i] = - tfc.tidy(function () { return tfc.add(outs[i], tfc.mul(batchSize_1, batchOut)); }); - if (batch > 0) { - tfc.dispose(oldScalar); - } - }; - for (var i = 0; i < batchOuts.length; ++i) { - _loop_4(i); - } - tfc.dispose(batchOuts); - numExamples += batchSize_1; - ++batch; - } - return outs; - }); - if (iteratorOut.done) { - if (hasBatches) { - console.warn('Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - ("batches (in this case, " + args.batches + " batches). ") + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - _b.label = 4; - case 4: - if (!(hasBatches ? batch < args.batches : true)) return [3 /*break*/, 6]; - return [5 /*yield**/, _loop_3()]; - case 5: - state_1 = _b.sent(); - if (state_1 === "break") - return [3 /*break*/, 6]; - return [3 /*break*/, 4]; - case 6: - for (i = 0; i < outs.length; ++i) { - oldScalar = outs[i]; - outs[i] = tfc.div(outs[i], numExamples); - tfc.dispose(oldScalar); - } - return [2 /*return*/, singletonOrArray(outs)]; - } - }); - }); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function checkBatchSize(batchSize) { - tfc.util.assert(batchSize > 0 && Number.isInteger(batchSize), function () { return "batchSize is required to be a positive integer, but got " + batchSize; }); -} -/** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ -function sliceArrays(arrays, start, stop) { - if (arrays == null) { - return [null]; - } - else if (Array.isArray(arrays)) { - return arrays.map(function (array) { return sliceAlongFirstAxis(array, start, stop - start); }); - } - else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } -} -/** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ -function sliceArraysByIndices(arrays, indices) { - return tfc.tidy(function () { - if (arrays == null) { - return null; - } - else if (Array.isArray(arrays)) { - return arrays.map(function (array) { return sliceArraysByIndices(array, indices); }); - } - else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather$1(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); -} -/** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ -function makeBatches(size, batchSize) { - var output = []; - var batchStart = 0; - var batchEnd = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; -} -/** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ -function fitLoop( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { - return __awaiter(this, void 0, void 0, function () { - var doValidation, numTrainSamples, indexArray, _a, callbackList, history, _loop_1, epoch, state_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - numTrainSamples = model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - if (verbose == null) { - verbose = 1; - } - _a = configureCallbacks(callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics), callbackList = _a.callbackList, history = _a.history; - callbackList.setModel(model); - model.history = history; - return [4 /*yield*/, callbackList.onTrainBegin()]; - case 1: - _b.sent(); - model.stopTraining_ = false; - _loop_1 = function (epoch) { - var epochLogs, epochIndexArray1D_1, batches_1, _loop_2, batchIndex, state_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, callbackList.onEpochBegin(epoch)]; - case 1: - _a.sent(); - epochLogs = {}; - if (!(stepsPerEpoch != null)) return [3 /*break*/, 2]; - throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); - case 2: - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } - else if (shuffle) { - tfc.util.shuffle(indexArray); - } - epochIndexArray1D_1 = tfc.tensor1d(indexArray); - batches_1 = makeBatches(numTrainSamples, batchSize); - _loop_2 = function (batchIndex) { - var batchLogs; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - batchLogs = {}; - return [4 /*yield*/, callbackList.onBatchBegin(batchIndex, batchLogs)]; - case 1: - _a.sent(); - tfc.tidy(function () { - var batchStart = batches_1[batchIndex][0]; - var batchEnd = batches_1[batchIndex][1]; - var batchIds = sliceAlongFirstAxis(epochIndexArray1D_1, batchStart, batchEnd - batchStart); - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - var insBatch = sliceArraysByIndices(ins, batchIds); - var outs = f(insBatch); - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - if (batchIndex === batches_1.length - 1) { // Last batch. - if (doValidation) { - var valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var out = valOuts[i]; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - return [4 /*yield*/, callbackList.onBatchEnd(batchIndex, batchLogs)]; - case 2: - _a.sent(); - disposeTensorsInLogs(batchLogs); - if (model.stopTraining_) { - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - batchIndex = 0; - _a.label = 3; - case 3: - if (!(batchIndex < batches_1.length)) return [3 /*break*/, 6]; - return [5 /*yield**/, _loop_2(batchIndex)]; - case 4: - state_2 = _a.sent(); - if (state_2 === "break") - return [3 /*break*/, 6]; - _a.label = 5; - case 5: - ++batchIndex; - return [3 /*break*/, 3]; - case 6: - epochIndexArray1D_1.dispose(); - _a.label = 7; - case 7: - // TODO(cais): Run validation at the end of the epoch. - return [4 /*yield*/, callbackList.onEpochEnd(epoch, epochLogs)]; - case 8: - // TODO(cais): Run validation at the end of the epoch. - _a.sent(); - if (model.stopTraining_) { - return [2 /*return*/, "break"]; - } - return [2 /*return*/]; - } - }); - }; - epoch = initialEpoch; - _b.label = 2; - case 2: - if (!(epoch < epochs)) return [3 /*break*/, 5]; - return [5 /*yield**/, _loop_1(epoch)]; - case 3: - state_1 = _b.sent(); - if (state_1 === "break") - return [3 /*break*/, 5]; - _b.label = 4; - case 4: - ++epoch; - return [3 /*break*/, 2]; - case 5: return [4 /*yield*/, callbackList.onTrainEnd()]; - case 6: - _b.sent(); - return [4 /*yield*/, model.history.syncData()]; - case 7: - _b.sent(); - return [2 /*return*/, model.history]; - } - }); - }); -} -function fitTensors( -// Type `model` as `any` here to avoid circular dependency w/ training.ts. -// tslint:disable-next-line:no-any -model, x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - var inputs, targets, inputValX, inputValY, valX, valY, sampleWeights, batchSize, checkBatchAxis, standardizedOuts, doValidation, valIns, checkBatchAxis_1, valStandardized, splitAt, originalBatchSize, ins, trainFunction, outLabels, valFunction, callbackMetrics, callbacks, out; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (model.isTraining) { - throw new Error('Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - _a.label = 1; - case 1: - _a.trys.push([1, , 7, 8]); - batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - checkBatchAxis = false; - return [4 /*yield*/, model.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize)]; - case 2: - standardizedOuts = _a.sent(); - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - doValidation = false; - valIns = void 0; - if (!(args.validationData != null && args.validationData.length > 0)) return [3 /*break*/, 4]; - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } - else if (args.validationData.length === 3) { - throw new NotImplementedError('validationData including sample weights is not supported yet.'); - } - else { - throw new ValueError("When passing validation data, it must contain 2 (valX, valY) " + - "or 3 (valX, valY, valSampleWeight) items; " + - (args.validationData + " is invalid.")); - } - checkBatchAxis_1 = true; - return [4 /*yield*/, model.standardizeUserData(inputValX, inputValY, null, /** Unused sample weights. */ null, /** Unused class weights. */ checkBatchAxis_1, batchSize)]; - case 3: - valStandardized = _a.sent(); - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - return [3 /*break*/, 5]; - case 4: - if (args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize); - inputs = sliceArrays(inputs, 0, splitAt); - valY = sliceArrays(targets, splitAt, originalBatchSize); - targets = sliceArrays(targets, 0, splitAt); - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } - else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - _a.label = 5; - case 5: - ins = inputs.concat(targets).concat(sampleWeights); - model.checkTrainableWeightsConsistency(); - trainFunction = model.makeTrainFunction(); - outLabels = model.getDedupedMetricsNames(); - valFunction = void 0; - callbackMetrics = void 0; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); - } - else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - return [4 /*yield*/, fitLoop(model, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null)]; - case 6: - out = _a.sent(); - return [2 /*return*/, out]; - case 7: - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX, inputValX); - disposeNewTensors(valY, inputValY); - if (sampleWeights != null) { - tfc.dispose(sampleWeights); - } - return [7 /*endfinally*/]; - case 8: return [2 /*return*/]; - } - }); - }); -} -/** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ -function ensureTensorsRank2OrHigher(tensors) { - var outs = []; - if (tensors instanceof tfc.Tensor) { - tensors = [tensors]; - } - // Make Tensors at least 2D. - for (var i = 0; i < tensors.length; ++i) { - var tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims$1(tensor, 1)); - } - else if (tensor.rank === 0) { - throw new Error('Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } - else { - outs.push(tensor); - } - } - return outs; -} -/** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ -// TODO(cais, kangyizhang): Deduplicate with tfjs-data. -function disposeNewTensors(tensors, refTensors) { - if (tensors == null) { - return; - } - var oldTensorIds = []; - if (refTensors instanceof tfc.Tensor) { - oldTensorIds.push(refTensors.id); - } - else if (Array.isArray(refTensors)) { - refTensors.forEach(function (t) { return oldTensorIds.push(t.id); }); - } - else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (var name_1 in refTensors) { - var oldTensor = refTensors[name_1]; - oldTensorIds.push(oldTensor.id); - } - } - var tensorsToDispose = []; - if (tensors instanceof tfc.Tensor) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } - else if (Array.isArray(tensors)) { - tensors.forEach(function (t) { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } - else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (var name_2 in tensors) { - var tensor = tensors[name_2]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - tensorsToDispose.forEach(function (t) { - if (!t.isDisposed) { - t.dispose(); - } - }); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ -function isDataTensor(x) { - return x instanceof tfc.Tensor; -} -/** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ -function isDataArray(x) { - return Array.isArray(x); -} -/** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ -function isDataDict(x) { - return !isDataTensor(x) && !isDataArray(x); -} -/** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ -function standardizeInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - if (exceptionPrefix === void 0) { exceptionPrefix = ''; } - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - var gotUnexpectedData = false; - if (isDataArray(data) && data.length > 0) { - gotUnexpectedData = true; - } - else if (isDataDict(data)) { - for (var key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } - else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError("Error when checking model " + exceptionPrefix + " expected no data, " + - ("but got " + data)); - } - } - return []; - } - if (data == null) { - return names.map(function (name) { return null; }); - } - var arrays; - if (isDataDict(data)) { - data = data; - arrays = []; - for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name_1 = names_1[_i]; - if (data[name_1] == null) { - throw new ValueError("No data provided for \"" + name_1 + "\". Need data for each key in: " + - ("" + names)); - } - arrays.push(data[name_1]); - } - } - else if (isDataArray(data)) { - data = data; - if (data.length !== names.length) { - throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + - "Tensors that you are passing to your model is not the size the " + - ("model expected. Expected to see " + names.length + " Tensor(s), but ") + - ("instead got the following list of Tensor(s): " + data)); - } - arrays = data; - } - else { - data = data; - if (names.length > 1) { - throw new ValueError("The model " + exceptionPrefix + " expects " + names.length + " Tensor(s), " + - ("but only received one Tensor. Found: Tensor with shape " + data.shape)); - } - arrays = [data]; - } - arrays = ensureTensorsRank2OrHigher(arrays); - // Check shape compatibility. - if (shapes != null) { - for (var i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - var array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have " + shapes[i].length + " dimension(s). but got array with ") + - ("shape " + array.shape)); - } - for (var j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - var dim = array.shape[j]; - var refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have shape [" + shapes[i] + "], but got array with shape ") + - ("[" + array.shape + "].")); - } - } - } - } - return arrays; -} -/** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ -function checkArrayLengths(inputs, targets, weights) { - var setX = unique$1(inputs.map(function (input) { return input.shape[0]; })); - setX.sort(); - var setY = unique$1(targets.map(function (target) { return target.shape[0]; })); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError("All input Tensors (x) should have the same number of samples. " + - "Got array shapes: " + - ("" + JSON.stringify(inputs.map(function (input) { return input.shape; })))); - } - if (setY.length > 1) { - throw new ValueError("All target Tensors (y) should have the same number of samples. " + - "Got array shapes: " + - ("" + JSON.stringify(targets.map(function (target) { return target.shape; })))); - } - if (setX.length > 0 && setY.length > 0 && !tfc.util.arraysEqual(setX, setY)) { - throw new ValueError("Input Tensors should have the same number of samples as target " + - ("Tensors. Found " + setX[0] + " input sample(s) and " + setY[0] + " target ") + - "sample(s)."); - } -} -/** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ -function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { - // TODO(cais): Dedicated test coverage? - var keyLosses = [ - meanSquaredError, binaryCrossentropy, - categoricalCrossentropy - ]; - for (var i = 0; i < targets.length; ++i) { - var y = targets[i]; - var loss = lossFns[i]; - var shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError("You are passing a target array of shape " + y.shape + " while using " + - "a loss 'categorical_crossentropy'. 'categorical_crossentropy'" + - "expects targets to be binary matrices (1s and 0s) of shape " + - "[samples, classes]."); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - var slicedYShape = y.shape.slice(1); - var slicedShape = shape.slice(1); - for (var j = 0; j < slicedYShape.length; ++j) { - var targetDim = slicedYShape[j]; - var outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError("A target Tensor with shape " + y.shape + " was passed for an " + - ("output of shape " + shape + ", while using a loss function that ") + - "expects targets to have the same shape as the output."); - } - } - } - } -} -/** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ -function checkInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - if (exceptionPrefix === void 0) { exceptionPrefix = ''; } - var arrays; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + - "Tensors that you are passing to your model is not the size the " + - ("the model expected. Expected to see " + names.length + " Tensor(s),") + - (" but instead got " + data.length + " Tensors(s).")); - } - arrays = data; - } - else { - if (names.length > 1) { - throw new ValueError("The model expects " + names.length + " " + exceptionPrefix + " Tensors, " + - "but only received one Tensor. Found: array with shape " + - (JSON.stringify(data.shape) + ".")); - } - arrays = [data]; - } - if (shapes != null) { - for (var i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - var array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + - ("to have " + shapes[i].length + " dimension(s), but got array with ") + - ("shape " + JSON.stringify(array.shape))); - } - for (var j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - var dim = array.shape[j]; - var refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + - (names[i] + " to have shape " + JSON.stringify(shapes[i]) + " but ") + - ("got array with shape " + JSON.stringify(array.shape) + ".")); - } - } - } - } - } -} -/** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ -function collectMetrics(metrics, outputNames) { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(function (name) { return []; }); - } - var wrappedMetrics; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } - else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics; - } - else { - throw new TypeError('Type of metrics argument not understood. Expected an string,' + - ("function, Array, or Object, found: " + metrics)); - } - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map(function (name) { return wrappedMetrics; }); - } - else { - // In this case, metrics is a dict. - var nestedMetrics = []; - for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { - var name_2 = outputNames_1[_i]; - var outputMetrics = wrappedMetrics.hasOwnProperty(name_2) ? wrappedMetrics[name_2] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } -} -var LAYERS_MODEL_FORMAT_NAME = 'layers-model'; -/** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -var LayersModel = /** @class */ (function (_super) { - __extends(LayersModel, _super); - function LayersModel(args) { - var _this = _super.call(this, args) || this; - _this.isTraining = false; - return _this; - } - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.summary = function (lineLength, positions, printFn) { - if (printFn === void 0) { printFn = console.log; } - if (!this.built) { - throw new ValueError("This model has never been called, thus its weights have not been " + - "created yet. So no summary can be displayed. Build the model " + - "first (e.g., by calling it on some test data)."); - } - printSummary(this, lineLength, positions, printFn); - }; - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.compile = function (args) { - var _this = this; - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - if (typeof args.optimizer === 'string') { - this.optimizer_ = getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } - else { - if (!(args.optimizer instanceof tfc.Optimizer)) { - throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer."); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - // Prepare loss functions. - var lossFunctions = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss; - for (var name_3 in args.loss) { - if (this.outputNames.indexOf(name_3) === -1) { - throw new ValueError("Unknown entry in loss dictionary: \"" + name_3 + "\". " + - ("Only expected the following keys: " + this.outputNames)); - } - } - for (var _i = 0, _a = this.outputNames; _i < _a.length; _i++) { - var name_4 = _a[_i]; - if (args.loss[name_4] == null) { - console.warn("Output \"" + name_4 + "\" is missing from loss dictionary. We assume " + - "this was done on purpose, and we will not be expecting data " + - ("to be passed to " + name_4 + " during training")); - } - lossFunctions.push(get(args.loss[name_4])); - } - } - else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError("When passing an Array as loss, it should have one entry per " + - ("model output. The model has " + this.outputs.length + " output(s), ") + - ("but you passed loss=" + args.loss + ".")); - } - var theLosses = args.loss; - lossFunctions = theLosses.map(function (l) { return get(l); }); - } - else { - var lossFunction_1 = get(args.loss); - this.outputs.forEach(function (_) { - lossFunctions.push(lossFunction_1); - }); - } - this.lossFunctions = lossFunctions; - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (var i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - var shape = this.internalOutputShapes[i]; - var name_5 = this.outputNames[i]; - this.feedOutputNames.push(name_5); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - var skipTargetIndices = []; - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', function () { - for (var i = 0; i < _this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - var weightedLoss = _this.lossFunctions[i]; - if (_this.outputs.length > 1) { - _this.metricsTensors.push([weightedLoss, i]); - _this.metricsNames.push(_this.outputNames[i] + '_loss'); - } - } - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - var nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - /** - * Helper function used in loop below. - */ - var appendMetric = function (outputIndex, metricName, metricTensor) { - if (_this.outputNames.length > 1) { - metricName = _this.outputNames[outputIndex] + '_' + metricName; - } - _this.metricsNames.push(metricName); - _this.metricsTensors.push([metricTensor, outputIndex]); - }; - nameScope('metric', function () { - var _loop_1 = function (i) { - if (skipTargetIndices.indexOf(i) !== -1) { - return "continue"; - } - var outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - // TODO(cais): Add optional arg `weights` to the following function. - var handleMetrics = function (metrics) { - var metricNamePrefix = ''; - var metricName; - var accFn; - var weightedMetricFn; - var _loop_2 = function (metric) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - var outputShape = _this.internalOutputShapes[i]; - if (outputShape[outputShape.length - 1] === 1 || - _this.lossFunctions[i] === binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = binaryAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = binaryCrossentropy$1; - } - } - else if (_this.lossFunctions[i] === - sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = sparseCategoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = sparseCategoricalCrossentropy$1; - } - } - else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = categoricalAccuracy; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = categoricalCrossentropy$1; - } - } - var suffix = void 0; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } - else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } - else { - var metricFn = get$1(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + getLossOrMetricName(metric); - } - // TODO(cais): Add weighting and masking to metricResult. - var metricResult; - nameScope(metricName, function () { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - }; - // TODO(cais): Use 'weights_' for weighted metrics. - for (var _i = 0, metrics_1 = metrics; _i < metrics_1.length; _i++) { - var metric = metrics_1[_i]; - _loop_2(metric); - } - }; - handleMetrics(outputMetrics); - }; - for (var i = 0; i < _this.outputs.length; ++i) { - _loop_1(i); - } - }); - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - }; - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - LayersModel.prototype.checkTrainableWeightsConsistency = function () { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn('Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - }; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.evaluate = function (x, y, args) { - if (args === void 0) { args = {}; } - var batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - var checkBatchAxis = true; - var standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - var ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - var f = this.testFunction; - var testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } - finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - }; - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.evaluateDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.makeTestFunction(); - return [2 /*return*/, evaluateDataset(this, dataset, args)]; - }); - }); - }; - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - LayersModel.prototype.checkNumSamples = function (ins, batchSize, steps, stepsName) { - if (stepsName === void 0) { stepsName = 'steps'; } - var numSamples; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError("If " + stepsName + " is set, batchSize must be null or undefined." + - ("Got batchSize = " + batchSize)); - } - } - else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } - else { - numSamples = ins.shape[0]; - } - } - else { - throw new ValueError("Either the input data should have a defined shape, or " + - (stepsName + " shoud be specified.")); - } - return numSamples; - }; - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - LayersModel.prototype.execute = function (inputs, outputs) { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError('`outputs` is an empty Array, which is not allowed.'); - } - var outputsIsArray = Array.isArray(outputs); - var outputNames = (outputsIsArray ? outputs : [outputs]); - var outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - // Format the input into a FeedDict. - var feedDict = new FeedDict(); - if (inputs instanceof tfc.Tensor) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError("The number of inputs provided (" + inputs.length + ") " + - "does not match the number of inputs of this model " + - ("(" + this.inputs.length + ").")); - } - for (var i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } - else { - for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) { - var input = _a[_i]; - var tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError("No value is provided for the model's input " + input.name); - } - feedDict.add(input, tensorValue); - } - } - // Run execution. - var executeOutputs = execute(outputSymbolicTensors, feedDict); - return outputsIsArray ? executeOutputs : executeOutputs[0]; - }; - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - LayersModel.prototype.retrieveSymbolicTensors = function (symbolicTensorNames) { - var outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); - var outputsRemaining = symbolicTensorNames.length; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; - var layerOutputNames = layerOutputs.map(function (output) { return output.name; }); - for (var i = 0; i < symbolicTensorNames.length; ++i) { - var index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining > 0) { - var remainingNames_1 = []; - outputSymbolicTensors.forEach(function (tensor, i) { - if (tensor == null) { - remainingNames_1.push(symbolicTensorNames[i]); - } - }); - throw new ValueError("Cannot find SymbolicTensors for output name(s): " + - ("" + JSON.stringify(remainingNames_1))); - } - return outputSymbolicTensors; - }; - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - LayersModel.prototype.predictLoop = function (ins, batchSize, verbose) { - var _this = this; - if (batchSize === void 0) { batchSize = 32; } - if (verbose === void 0) { verbose = false; } - return tfc.tidy(function () { - var numSamples = _this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); - } - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - var batches = makeBatches(numSamples, batchSize); - var outsBatches = _this.outputs.map(function (output) { return []; }); - var _loop_3 = function (batchIndex) { - var batchOuts = tfc.tidy(function () { - var batchStart = batches[batchIndex][0]; - var batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - var insBatch = sliceArrays(ins, batchStart, batchEnd); - // Construct the feeds for execute(); - var feeds = []; - if (Array.isArray(insBatch)) { - for (var i = 0; i < insBatch.length; ++i) { - feeds.push({ key: _this.inputs[i], value: insBatch[i] }); - } - } - else { - feeds.push({ key: _this.inputs[0], value: insBatch }); - } - var feedDict = new FeedDict(feeds); - return execute(_this.outputs, feedDict); - }); - batchOuts.forEach(function (batchOut, i) { return outsBatches[i].push(batchOut); }); - }; - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - _loop_3(batchIndex); - } - return singletonOrArray(outsBatches.map(function (batches) { return tfc.concat(batches, 0); })); - }); - }; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.predict = function (x, args) { - if (args === void 0) { args = {}; } - var xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - var batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } - finally { - disposeNewTensors(xsRank2OrHigher, x); - } - }; - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.predictOnBatch = function (x) { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - var batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - }; - LayersModel.prototype.standardizeUserDataXY = function (x, y, checkBatchAxis, batchSize) { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError('You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - var outputShapes = []; - for (var i = 0; i < this.feedOutputShapes.length; ++i) { - var outputShape = this.feedOutputShapes[i]; - var lossFn = this.feedLossFns[i]; - if (lossFn === sparseCategoricalCrossentropy) { - outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); - } - else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError("In a stateful network, you should only pass inputs with a " + - "number of samples that is divisible by the batch size " + - (batchSize + ". Found: " + x[0].shape[0] + " sample(s).")); - } - } - return [x, y]; - }; - LayersModel.prototype.standardizeUserData = function (x, y, sampleWeight, classWeight, checkBatchAxis, batchSize) { - if (checkBatchAxis === void 0) { checkBatchAxis = true; } - return __awaiter(this, void 0, void 0, function () { - var _a, standardXs, standardYs, standardSampleWeights, classWeights, i, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - _a = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize), standardXs = _a[0], standardYs = _a[1]; - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - standardSampleWeights = null; - if (!(classWeight != null)) return [3 /*break*/, 4]; - classWeights = standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - i = 0; - _d.label = 1; - case 1: - if (!(i < classWeights.length)) return [3 /*break*/, 4]; - _c = (_b = standardSampleWeights).push; - return [4 /*yield*/, standardizeWeights(standardYs[i], null, classWeights[i])]; - case 2: - _c.apply(_b, [_d.sent()]); - _d.label = 3; - case 3: - ++i; - return [3 /*break*/, 1]; - case 4: - // TODO(cais): Deal with the case of model.stateful == true. - return [2 /*return*/, [standardXs, standardYs, standardSampleWeights]]; - } - }); - }); - }; - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - LayersModel.prototype.testLoop = function (f, ins, batchSize, verbose, steps) { - var _this = this; - if (verbose === void 0) { verbose = 0; } - return tfc.tidy(function () { - var numSamples = _this.checkNumSamples(ins, batchSize, steps, 'steps'); - var outs = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); - } - else { - var batches = makeBatches(numSamples, batchSize); - var indexArray = tfc.tensor1d(range(0, numSamples)); - for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - var batchStart = batches[batchIndex][0]; - var batchEnd = batches[batchIndex][1]; - var batchIds = sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - var insBatch = sliceArraysByIndices(ins, batchIds); - var batchOuts = f(insBatch); - if (batchIndex === 0) { - for (var i = 0; i < batchOuts.length; ++i) { - outs.push(tfc.scalar(0)); - } - } - for (var i = 0; i < batchOuts.length; ++i) { - var batchOut = batchOuts[i]; - outs[i] = - tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut)); - } - } - for (var i = 0; i < outs.length; ++i) { - outs[i] = tfc.div(outs[i], numSamples); - } - } - return outs; - }); - }; - LayersModel.prototype.getDedupedMetricsNames = function () { - var outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - var dedupedOutLabels = []; - for (var i = 0; i < outLabels.length; ++i) { - var label = outLabels[i]; - var newLabel = label; - if (count(outLabels, label) > 1) { - var dupIndex = count(outLabels.slice(0, i), label); - newLabel += "_" + dupIndex; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - }; - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - LayersModel.prototype.makeTrainFunction = function () { - var _this = this; - return function (data) { - var lossValues = []; - var inputs = data.slice(0, _this.inputs.length); - var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); - var sampleWeights = data.slice(_this.inputs.length + _this.outputs.length, _this.inputs.length + _this.outputs.length * 2); - var metricsValues = []; - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - var totalLossFunction = function () { - var feeds = []; - for (var i = 0; i < _this.inputs.length; ++i) { - feeds.push({ key: _this.inputs[i], value: inputs[i] }); - } - var feedDict = new FeedDict(feeds); - var outputs = execute(_this.outputs, feedDict, { 'training': true }); - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - var totalLoss; - for (var i = 0; i < _this.lossFunctions.length; ++i) { - var lossFunction = _this.lossFunctions[i]; - var loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - // TODO(cais): push Scalar instead. - var meanLoss = tfc.mean(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - } - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (var i = 0; i < _this.metricsTensors.length; ++i) { - var weightedMetric = void 0; - if (_this.outputs.length > 1 && i < _this.outputs.length) { - weightedMetric = lossValues[i]; - } - else { - var metric = _this.metricsTensors[i][0]; - var outputIndex = _this.metricsTensors[i][1]; - weightedMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - } - tfc.keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - totalLoss = tfc.mean(totalLoss); - // Add regularizer penalties. - _this.calculateLosses().forEach(function (regularizerLoss) { - totalLoss = tfc.add(totalLoss, regularizerLoss); - }); - return totalLoss; - }; - var variables = _this.collectedTrainableWeights.map(function (param) { return param.read(); }); - var returnCost = true; - var totalLossValue = _this.optimizer_.minimize(totalLossFunction, returnCost, variables); - return [totalLossValue].concat(metricsValues); - }; - }; - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - LayersModel.prototype.makeTestFunction = function () { - var _this = this; - this.testFunction = function (data) { - return tfc.tidy(function () { - var valOutputs = []; - var totalLoss; - var inputs = data.slice(0, _this.inputs.length); - var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); - var feeds = []; - for (var i = 0; i < _this.inputs.length; ++i) { - feeds.push({ key: _this.inputs[i], value: inputs[i] }); - } - var feedDict = new FeedDict(feeds); - var outputs = execute(_this.outputs, feedDict); - // Compute total loss. - for (var i = 0; i < _this.lossFunctions.length; ++i) { - var lossFunction = _this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - var loss = tfc.mean(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } - else { - totalLoss = tfc.add(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (var i = 0; i < _this.metricsTensors.length; ++i) { - var metric = _this.metricsTensors[i][0]; - var outputIndex = _this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric); - } - return valOutputs; - }); - }; - }; - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.fit = function (x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, fitTensors(this, x, y, args)]; - }); - }); - }; - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.fitDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, fitDataset(this, dataset, args)]; - }); - }); - }; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - LayersModel.prototype.trainOnBatch = function (x, y) { - return __awaiter(this, void 0, void 0, function () { - var standardizeOut, inputs, targets, trainFunction, losses, lossValues, _i, losses_1, loss, v; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.standardizeUserData(x, y)]; - case 1: - standardizeOut = _a.sent(); - inputs = standardizeOut[0]; - targets = standardizeOut[1]; - trainFunction = this.makeTrainFunction(); - losses = trainFunction(inputs.concat(targets)); - lossValues = []; - _i = 0, losses_1 = losses; - _a.label = 2; - case 2: - if (!(_i < losses_1.length)) return [3 /*break*/, 5]; - loss = losses_1[_i]; - return [4 /*yield*/, loss.data()]; - case 3: - v = _a.sent(); - lossValues.push(v[0]); - _a.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: - tfc.dispose(losses); - return [2 /*return*/, singletonOrArray(lossValues)]; - } - }); - }); - }; - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - LayersModel.prototype.getNamedWeights = function (config) { - var namedWeights = []; - var trainableOnly = config != null && config.trainableOnly; - var weights = trainableOnly ? this.trainableWeights : this.weights; - var weightValues = this.getWeights(trainableOnly); - for (var i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); - } - return namedWeights; - }; - Object.defineProperty(LayersModel.prototype, "stopTraining", { - get: function () { - return this.stopTraining_; - }, - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set: function (stop) { - this.stopTraining_ = stop; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(LayersModel.prototype, "optimizer", { - get: function () { - return this.optimizer_; - }, - set: function (optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - }, - enumerable: true, - configurable: true - }); - LayersModel.prototype.dispose = function () { - var result = _super.prototype.dispose.call(this); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - var numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors; - } - return result; - }; - LayersModel.prototype.getLossIdentifiers = function () { - var lossNames; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss); - } - else if (Array.isArray(this.loss)) { - for (var _i = 0, _a = this.loss; _i < _a.length; _i++) { - var loss = _a[_i]; - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = this.loss.map(function (name) { return toSnakeCase(name); }); - } - else { - var outputNames = Object.keys(this.loss); - lossNames = {}; - var losses_2 = this.loss; - for (var _b = 0, outputNames_2 = outputNames; _b < outputNames_2.length; _b++) { - var outputName = outputNames_2[_b]; - if (typeof losses_2[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses_2[outputName]); - } - else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - }; - LayersModel.prototype.getMetricIdentifiers = function () { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(getLossOrMetricName(this.metrics))]; - } - else if (Array.isArray(this.metrics)) { - return this.metrics.map(function (metric) { return toSnakeCase(getLossOrMetricName(metric)); }); - } - else { - var metricsIdentifiers = {}; - for (var key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - }; - LayersModel.prototype.getTrainingConfig = function () { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - }; - LayersModel.prototype.loadTrainingConfig = function (trainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - var tsConfig = convertPythonicToTs(trainingConfig.optimizer_config); - var optimizer = deserialize(tsConfig); - var loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } - else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(function (lossEntry) { return toCamelCase(lossEntry); }); - } - else if (trainingConfig.loss != null) { - loss = {}; - for (var key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]); - } - } - var metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(function (metric) { return toCamelCase(metric); }); - } - else if (trainingConfig.metrics != null) { - metrics = {}; - for (var key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - this.compile({ loss: loss, metrics: metrics, optimizer: optimizer }); - }; - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - LayersModel.prototype.save = function (handlerOrURL, config) { - return __awaiter(this, void 0, void 0, function () { - var handlers, weightDataAndSpecs, returnString, unusedArg, modelConfig, modelArtifacts, includeOptimizer, weightType, _a, optimizerWeightData, optimizerWeightSpecs, _b, _c, checkSize; - var _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - if (typeof handlerOrURL === 'string') { - handlers = tfc.io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError("Cannot find any save handlers for URL '" + handlerOrURL + "'"); - } - else if (handlers.length > 1) { - throw new ValueError("Found more than one (" + handlers.length + ") save handlers for " + - ("URL '" + handlerOrURL + "'")); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError('LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - return [4 /*yield*/, tfc.io.encodeWeights(this.getNamedWeights(config))]; - case 1: - weightDataAndSpecs = _e.sent(); - returnString = false; - unusedArg = null; - modelConfig = this.toJSON(unusedArg, returnString); - modelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: "TensorFlow.js tfjs-layers v" + version, - convertedBy: null, - }; - includeOptimizer = config == null ? false : config.includeOptimizer; - if (!(includeOptimizer && this.optimizer != null)) return [3 /*break*/, 4]; - modelArtifacts.trainingConfig = this.getTrainingConfig(); - weightType = 'optimizer'; - _c = (_b = tfc.io).encodeWeights; - return [4 /*yield*/, this.optimizer.getWeights()]; - case 2: return [4 /*yield*/, _c.apply(_b, [_e.sent(), weightType])]; - case 3: - _a = _e.sent(), optimizerWeightData = _a.data, optimizerWeightSpecs = _a.specs; - (_d = weightDataAndSpecs.specs).push.apply(_d, optimizerWeightSpecs); - weightDataAndSpecs.data = tfc.io.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); - _e.label = 4; - case 4: - if (this.userDefinedMetadata != null) { - checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return [2 /*return*/, handlerOrURL.save(modelArtifacts)]; - } - }); - }); - }; - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - LayersModel.prototype.setUserDefinedMetadata = function (userDefinedMetadata) { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - }; - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - LayersModel.prototype.getUserDefinedMetadata = function () { - return this.userDefinedMetadata; - }; - // The class name is 'Model' rather than 'LayersModel' for backwards - // compatibility since this class name shows up in the serialization format. - /** @nocollapse */ - LayersModel.className = 'Model'; - return LayersModel; -}(Container)); -tfc.serialization.registerClass(LayersModel); -/** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ -/** @doc {heading: 'Models', subheading: 'Classes'} */ -var Functional = /** @class */ (function (_super) { - __extends(Functional, _super); - function Functional() { - return _super !== null && _super.apply(this, arguments) || this; - } - Functional.className = 'Functional'; - return Functional; -}(LayersModel)); -tfc.serialization.registerClass(Functional); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ -function modelFromJSON(modelAndWeightsConfig, customObjects) { - return __awaiter(this, void 0, void 0, function () { - var modelTopology, tsConfig, model, weightValues, uniqueWeightValues, _i, _a, weight; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = { modelTopology: modelAndWeightsConfig }; - } - modelAndWeightsConfig = modelAndWeightsConfig; - modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config']; - } - tsConfig = convertPythonicToTs(modelTopology); - model = deserialize(tsConfig, customObjects); - if (!(modelAndWeightsConfig.weightsManifest != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, tfc.io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(function (weight) { return weight.originalName; }))]; - case 1: - weightValues = _b.sent(); - uniqueWeightValues = {}; - for (_i = 0, _a = model.weights; _i < _a.length; _i++) { - weight = _a[_i]; - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - tfc.dispose(weightValues); - _b.label = 2; - case 2: return [2 /*return*/, model]; - } - }); - }); -} -/** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ -function loadLayersModelInternal(pathOrIOHandler, options) { - return __awaiter(this, void 0, void 0, function () { - var handlers; - return __generator(this, function (_a) { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - handlers = tfc.io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(tfc.io.browserHTTPRequest(pathOrIOHandler, options)); - } - else if (handlers.length > 1) { - throw new ValueError("Found more than one (" + handlers.length + ") load handlers for " + - ("URL '" + pathOrIOHandler + "'")); - } - pathOrIOHandler = handlers[0]; - } - return [2 /*return*/, loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options)]; - }); - }); -} -/** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ -function loadLayersModelFromIOHandler(handler, customObjects, options) { - return __awaiter(this, void 0, void 0, function () { - var artifacts, modelTopology, strict, fastWeightInit, model, trainingConfig, _a, modelWeights, optimizerWeights; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - return [4 /*yield*/, handler.load()]; - case 1: - artifacts = _b.sent(); - modelTopology = artifacts.modelTopology; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config']; - } - strict = options.strict == null ? true : options.strict; - fastWeightInit = artifacts.weightData != null && artifacts.weightSpecs != null && strict; - model = deserialize(convertPythonicToTs(modelTopology), customObjects, fastWeightInit); - trainingConfig = artifacts.trainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - if (!(artifacts.weightData != null)) return [3 /*break*/, 4]; - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError('LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - _a = decodeModelAndOptimizerWeights(artifacts.weightData, artifacts.weightSpecs), modelWeights = _a.modelWeights, optimizerWeights = _a.optimizerWeights; - model.loadWeights(modelWeights, strict); - if (!(model.optimizer != null && optimizerWeights.length > 0)) return [3 /*break*/, 3]; - return [4 /*yield*/, model.optimizer.setWeights(optimizerWeights)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - // Dispose temporary weight values. - tfc.dispose(modelWeights); - tfc.dispose(optimizerWeights.map(function (w) { return w.tensor; })); - _b.label = 4; - case 4: return [2 /*return*/, model]; - } - }); - }); -} -function decodeModelAndOptimizerWeights(buffer, specs) { - var name2Tensor = tfc.io.decodeWeights(buffer, specs); - var modelWeights = {}; - var optimizerWeights = []; - specs.forEach(function (spec) { - if (spec.group === 'optimizer') { - optimizerWeights.push({ name: spec.name, tensor: name2Tensor[spec.name] }); - } - else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return { modelWeights: modelWeights, optimizerWeights: optimizerWeights }; -} -/** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -var Sequential = /** @class */ (function (_super) { - __extends(Sequential, _super); - function Sequential(args) { - var _this = _super.call(this, { inputs: [], outputs: [] }) || this; - args = args || {}; - _this.trainable = true; - _this.built = false; - // Set model name. - _this.name = (args.name != null) ? args.name : getUid('sequential_'); - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (var _i = 0, _a = args.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - _this.add(layer); - } - } - return _this; - } - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - Sequential.prototype.checkShape = function (layer) { - var shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(function (x) { return x < 0; })) { - throw new ValueError('Negative dimension size caused by adding layer ' + - (layer.name + " with input shape [") + - (layer.inboundNodes[0].inputTensors[0].shape + "]")); - } - }; - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.add = function (layer) { - var isLayerModelInstance = layer instanceof Sequential || layer instanceof LayersModel; - var modelLayer; - if (isLayerModelInstance) { - modelLayer = layer; - if (modelLayer.outputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError('The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - var x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } - else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError('A layer added to a Sequential model must not already be ' + - ("connected somewhere else. LayersModel received layer " + layer.name + " ") + - ("which has " + layer.inboundNodes.length + " pre-existing inbound ") + - 'connections.'); - } - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(function (x) { return x.shape; }), - outputShapes: this.outputs[0].shape - }); - } - else { - var outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError('All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - this.layers.push(layer); - this.built = false; - }; - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - Sequential.prototype.pop = function () { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } - else { - var lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - }; - Sequential.prototype.call = function (inputs, kwargs) { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - }; - Sequential.prototype.build = function (inputShape) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError('Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - }; - Sequential.prototype.countParams = function () { - if (!this.built) { - this.build(); - } - return _super.prototype.countParams.call(this); - }; - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.summary = function (lineLength, positions, printFn) { - if (printFn === void 0) { printFn = console.log; } - if (!this.built) { - this.build(); - } - _super.prototype.summary.call(this, lineLength, positions, printFn); - }; - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - Sequential.prototype.setWeights = function (weights) { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - }; - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.evaluate = function (x, y, args) { - if (args === void 0) { args = {}; } - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - }; - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.evaluateDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before being used.'); - } - return [2 /*return*/, this.model.evaluateDataset(dataset, args)]; - }); - }); - }; - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.predict = function (x, args) { - if (args === void 0) { args = {}; } - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - }; - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - Sequential.prototype.predictOnBatch = function (x) { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - }; - /** - * See `LayersModel.compile`. - * - * @param args - */ - Sequential.prototype.compile = function (args) { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = this.model.isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - }; - Object.defineProperty(Sequential.prototype, "optimizer", { - get: function () { - return this.model == null ? undefined : this.model.optimizer; - }, - set: function (optimizer) { - this.model.optimizer = optimizer; - }, - enumerable: true, - configurable: true - }); - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.fit = function (x, y, args) { - if (args === void 0) { args = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return [2 /*return*/, this.model.fit(x, y, args)]; - }); - }); - }; - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - Sequential.prototype.fitDataset = function (dataset, args) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.built) { - throw new RuntimeError('The model needs to be compiled before ' + - 'being used.'); - } - return [2 /*return*/, this.model.fitDataset(dataset, args)]; - }); - }); - }; - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - Sequential.prototype.trainOnBatch = function (x, y) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.model.trainOnBatch(x, y)]; - }); - }); - }; - /* See parent class for JsDoc */ - /** @nocollapse */ - Sequential.fromConfig = function (cls, config, customObjects, fastWeightInit) { - if (fastWeightInit === void 0) { fastWeightInit = false; } - var configArray; - var extraModelConfig = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } - else { - tfc.util.assert(config['layers'] != null, function () { - return "When the config data for a Sequential model is not an Array, " + - "it must be an Object that contains the 'layers' field."; - }); - configArray = config['layers']; - delete config['layers']; - extraModelConfig = config; - } - var model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError("Sequential.fromConfig called on non-Sequential input: " + model); - } - for (var _i = 0, configArray_1 = configArray; _i < configArray_1.length; _i++) { - var conf = configArray_1[_i]; - var customObjects_1 = undefined; - var layer = deserialize(conf, customObjects_1, fastWeightInit); - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - }; - Object.defineProperty(Sequential.prototype, "stopTraining", { - get: function () { - if (this.model == null) { - throw new ValueError('Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - }, - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set: function (stop) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError('Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Override get trainableWeights() here - // tslint:disable-next-line:no-any - Sequential.prototype.getConfig = function () { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - var layers = []; - for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { - var layer = _a[_i]; - var dict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return { name: this.name, layers: layers }; - }; - /** @nocollapse */ - Sequential.className = 'Sequential'; - return Sequential; -}(LayersModel)); -tfc.serialization.registerClass(Sequential); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// LayersModel and related factory methods. -/** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -function model(args) { - return new LayersModel(args); -} -/** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -function sequential(config) { - return new Sequential(config); -} -/** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ -function loadLayersModel(pathOrIOHandler, options) { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); -} -/** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ -function input(config) { - return Input(config); -} -function registerCallbackConstructor(verbosityLevel, callbackConstructor) { - CallbackConstructorRegistry.registerCallbackConstructor(verbosityLevel, callbackConstructor); -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ -var Activation = /** @class */ (function (_super) { - __extends(Activation, _super); - function Activation() { - return _super !== null && _super.apply(this, arguments) || this; - } - Activation.prototype.getConfig = function () { - return {}; - }; - return Activation; -}(tfc.serialization.Serializable)); -/** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ -var Elu$1 = /** @class */ (function (_super) { - __extends(Elu, _super); - function Elu() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - Elu.prototype.apply = function (x, alpha) { - if (alpha === void 0) { alpha = 1; } - return elu$1(x, alpha); - }; - /** @nocollapse */ - Elu.className = 'elu'; - return Elu; -}(Activation)); -tfc.serialization.registerClass(Elu$1); -/** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ -var Selu$1 = /** @class */ (function (_super) { - __extends(Selu, _super); - function Selu() { - return _super !== null && _super.apply(this, arguments) || this; - } - Selu.prototype.apply = function (x) { - return tfc.selu(x); - }; - /** @nocollapse */ - Selu.className = 'selu'; - return Selu; -}(Activation)); -tfc.serialization.registerClass(Selu$1); -/** - * Rectified linear unit - */ -var Relu$1 = /** @class */ (function (_super) { - __extends(Relu, _super); - function Relu() { - return _super !== null && _super.apply(this, arguments) || this; - } - Relu.prototype.apply = function (x) { - return tfc.relu(x); - }; - /** @nocollapse */ - Relu.className = 'relu'; - return Relu; -}(Activation)); -tfc.serialization.registerClass(Relu$1); -/** - * Rectified linear unit activation maxing out at 6.0. - */ -var Relu6$1 = /** @class */ (function (_super) { - __extends(Relu6, _super); - function Relu6() { - return _super !== null && _super.apply(this, arguments) || this; - } - Relu6.prototype.apply = function (x) { - return tfc.tidy(function () { return tfc.minimum(6.0, tfc.relu(x)); }); - }; - /** @nocollapse */ - Relu6.className = 'relu6'; - return Relu6; -}(Activation)); -tfc.serialization.registerClass(Relu6$1); -//* Linear activation (no-op) */ -var Linear = /** @class */ (function (_super) { - __extends(Linear, _super); - function Linear() { - return _super !== null && _super.apply(this, arguments) || this; - } - Linear.prototype.apply = function (x) { - return x; - }; - /** @nocollapse */ - Linear.className = 'linear'; - return Linear; -}(Activation)); -tfc.serialization.registerClass(Linear); -/** - * Sigmoid activation function. - */ -var Sigmoid$1 = /** @class */ (function (_super) { - __extends(Sigmoid, _super); - function Sigmoid() { - return _super !== null && _super.apply(this, arguments) || this; - } - Sigmoid.prototype.apply = function (x) { - return tfc.sigmoid(x); - }; - /** @nocollapse */ - Sigmoid.className = 'sigmoid'; - return Sigmoid; -}(Activation)); -tfc.serialization.registerClass(Sigmoid$1); -/** - * Segment-wise linear approximation of sigmoid. - */ -var HardSigmoid = /** @class */ (function (_super) { - __extends(HardSigmoid, _super); - function HardSigmoid() { - return _super !== null && _super.apply(this, arguments) || this; - } - HardSigmoid.prototype.apply = function (x) { - return hardSigmoid(x); - }; - /** @nocollapse */ - HardSigmoid.className = 'hardSigmoid'; - return HardSigmoid; -}(Activation)); -tfc.serialization.registerClass(HardSigmoid); -/** - * Softplus activation function. - */ -var Softplus$1 = /** @class */ (function (_super) { - __extends(Softplus, _super); - function Softplus() { - return _super !== null && _super.apply(this, arguments) || this; - } - Softplus.prototype.apply = function (x) { - return tfc.softplus(x); - }; - /** @nocollapse */ - Softplus.className = 'softplus'; - return Softplus; -}(Activation)); -tfc.serialization.registerClass(Softplus$1); -/** - * Softsign activation function. - */ -var Softsign = /** @class */ (function (_super) { - __extends(Softsign, _super); - function Softsign() { - return _super !== null && _super.apply(this, arguments) || this; - } - Softsign.prototype.apply = function (x) { - return softsign(x); - }; - /** @nocollapse */ - Softsign.className = 'softsign'; - return Softsign; -}(Activation)); -tfc.serialization.registerClass(Softsign); -/** - * Hyperbolic tangent function. - */ -var Tanh$1 = /** @class */ (function (_super) { - __extends(Tanh, _super); - function Tanh() { - return _super !== null && _super.apply(this, arguments) || this; - } - Tanh.prototype.apply = function (x) { - return tfc.tanh(x); - }; - /** @nocollapse */ - Tanh.className = 'tanh'; - return Tanh; -}(Activation)); -tfc.serialization.registerClass(Tanh$1); -/** - * Softmax activation function - */ -var Softmax$1 = /** @class */ (function (_super) { - __extends(Softmax, _super); - function Softmax() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - Softmax.prototype.apply = function (x, axis) { - if (axis === void 0) { axis = (-1); } - return tfc.softmax(x, axis); - }; - /** @nocollapse */ - Softmax.className = 'softmax'; - return Softmax; -}(Activation)); -tfc.serialization.registerClass(Softmax$1); -/** - * Log softmax activation function - */ -var LogSoftmax$1 = /** @class */ (function (_super) { - __extends(LogSoftmax, _super); - function LogSoftmax() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - LogSoftmax.prototype.apply = function (x, axis) { - if (axis === void 0) { axis = (-1); } - return tfc.logSoftmax(x, axis); - }; - /** @nocollapse */ - LogSoftmax.className = 'logSoftmax'; - return LogSoftmax; -}(Activation)); -tfc.serialization.registerClass(LogSoftmax$1); -/** - * Swish activation function - */ -var Swish = /** @class */ (function (_super) { - __extends(Swish, _super); - function Swish() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - Swish.prototype.apply = function (x, alpha) { - if (alpha === void 0) { alpha = 1; } - return tfc.tidy(function () { return tfc.sigmoid(x.mul(alpha)).mul(x); }); - }; - /** @nocollapse */ - Swish.className = 'swish'; - return Swish; -}(Activation)); -tfc.serialization.registerClass(Swish); -/** - * Mish activation function - */ -var Mish = /** @class */ (function (_super) { - __extends(Mish, _super); - function Mish() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - Mish.prototype.apply = function (x) { - return tfc.tidy(function () { return tfc.mul(x, tfc.tanh(tfc.softplus(x))); }); - }; - /** @nocollapse */ - Mish.className = 'mish'; - return Mish; -}(Activation)); -tfc.serialization.registerClass(Mish); -function serializeActivation(activation) { - return activation.getClassName(); -} -function deserializeActivation(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); -} -function getActivation(identifier) { - if (identifier == null) { - var config = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - var config = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } - else if (identifier instanceof Activation) { - return identifier; - } - else { - return deserializeActivation(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -function assertObjectArgs(args) { - if (args != null && typeof args !== 'object') { - throw new Error("Argument to L1L2 regularizer's constructor is expected to be an " + - ("object, but received: " + args)); - } -} -/** - * Regularizer base class. - */ -var Regularizer = /** @class */ (function (_super) { - __extends(Regularizer, _super); - function Regularizer() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Regularizer; -}(tfc.serialization.Serializable)); -var L1L2 = /** @class */ (function (_super) { - __extends(L1L2, _super); - function L1L2(args) { - var _this = _super.call(this) || this; - assertObjectArgs(args); - _this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - _this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - _this.hasL1 = _this.l1 !== 0; - _this.hasL2 = _this.l2 !== 0; - return _this; - } - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - L1L2.prototype.apply = function (x) { - var _this = this; - return tfc.tidy(function () { - var regularization = tfc.zeros([1]); - if (_this.hasL1) { - regularization = tfc.add(regularization, tfc.sum(tfc.mul(_this.l1, tfc.abs(x)))); - } - if (_this.hasL2) { - regularization = - tfc.add(regularization, tfc.sum(tfc.mul(_this.l2, square$1(x)))); - } - return regularization.asScalar(); - }); - }; - L1L2.prototype.getConfig = function () { - return { 'l1': this.l1, 'l2': this.l2 }; - }; - /** @nocollapse */ - L1L2.fromConfig = function (cls, config) { - return new cls({ l1: config['l1'], l2: config['l2'] }); - }; - /** @nocollapse */ - L1L2.className = 'L1L2'; - return L1L2; -}(Regularizer)); -tfc.serialization.registerClass(L1L2); -function l1(args) { - assertObjectArgs(args); - return new L1L2({ l1: args != null ? args.l1 : null, l2: 0 }); -} -function l2(args) { - assertObjectArgs(args); - return new L1L2({ l2: args != null ? args.l2 : null, l1: 0 }); -} -// Maps the JavaScript-like identifier keys to the corresponding keras symbols. -var REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { - 'l1l2': 'L1L2' -}; -function serializeRegularizer(constraint) { - return serializeKerasObject(constraint); -} -function deserializeRegularizer(config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); -} -function getRegularizer(identifier) { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - var className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - var config = { className: className, config: {} }; - return deserializeRegularizer(config); - } - else if (identifier instanceof Regularizer) { - return identifier; - } - else { - return deserializeRegularizer(identifier); - } -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var ReLU = /** @class */ (function (_super) { - __extends(ReLU, _super); - function ReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.supportsMasking = true; - if (args != null) { - _this.maxValue = args.maxValue; - } - return _this; - } - ReLU.prototype.call = function (inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - var output = tfc.relu(inputs); - if (this.maxValue != null) { - output = tfc.clipByValue(output, 0, this.maxValue); - } - return output; - }; - ReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ReLU.prototype.getConfig = function () { - var config = { maxValue: this.maxValue }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ReLU.className = 'ReLU'; - return ReLU; -}(Layer)); -tfc.serialization.registerClass(ReLU); -var LeakyReLU = /** @class */ (function (_super) { - __extends(LeakyReLU, _super); - function LeakyReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA = 0.3; - if (args == null) { - args = {}; - } - _this.alpha = args.alpha == null ? _this.DEFAULT_ALPHA : args.alpha; - return _this; - } - LeakyReLU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return tfc.leakyRelu(x, this.alpha); - }; - LeakyReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - LeakyReLU.prototype.getConfig = function () { - var config = { alpha: this.alpha }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - LeakyReLU.className = 'LeakyReLU'; - return LeakyReLU; -}(Layer)); -tfc.serialization.registerClass(LeakyReLU); -var PReLU = /** @class */ (function (_super) { - __extends(PReLU, _super); - function PReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA_INITIALIZER = 'zeros'; - if (args == null) { - args = {}; - } - _this.supportsMasking = true; - _this.alphaInitializer = - getInitializer(args.alphaInitializer || _this.DEFAULT_ALPHA_INITIALIZER); - _this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - _this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - _this.sharedAxes = null; - } - else if (Array.isArray(args.sharedAxes)) { - _this.sharedAxes = args.sharedAxes; - } - else if (typeof args.sharedAxes === 'number') { - _this.sharedAxes = [args.sharedAxes]; - } - else { - throw new ValueError("Expected sharedAxes to be a number or an array of numbers, " + - ("but got " + args.sharedAxes)); - } - return _this; - } - PReLU.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var paramShape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (var _i = 0, _a = this.sharedAxes; _i < _a.length; _i++) { - var i = _a[_i]; - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight('alpha', paramShape, 'float32', this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - var axes = {}; - if (this.sharedAxes != null) { - for (var i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes: axes, - })]; - this.built = true; - }; - PReLU.prototype.call = function (inputs, kwargs) { - inputs = getExactlyOneTensor(inputs); - return tfc.prelu(inputs, this.alpha.read()); - }; - PReLU.prototype.getConfig = function () { - var config = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - PReLU.className = 'PReLU'; - return PReLU; -}(Layer)); -tfc.serialization.registerClass(PReLU); -var ELU = /** @class */ (function (_super) { - __extends(ELU, _super); - function ELU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_ALPHA = 1.0; - if (args == null) { - args = {}; - } - if (args.alpha != null && args.alpha !== _this.DEFAULT_ALPHA) { - throw new NotImplementedError("Non-default alpha value (" + args.alpha + ") is not supported by the " + - "ELU layer yet."); - } - _this.alpha = args.alpha == null ? _this.DEFAULT_ALPHA : args.alpha; - return _this; - } - ELU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return tfc.elu(x); - }; - ELU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ELU.prototype.getConfig = function () { - var config = { alpha: this.alpha }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ELU.className = 'ELU'; - return ELU; -}(Layer)); -tfc.serialization.registerClass(ELU); -var ThresholdedReLU = /** @class */ (function (_super) { - __extends(ThresholdedReLU, _super); - function ThresholdedReLU(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_THETA = 1.0; - if (args == null) { - args = {}; - } - _this.theta = args.theta == null ? _this.DEFAULT_THETA : args.theta; - return _this; - } - ThresholdedReLU.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return x.mul(cast$1(x.greater(this.theta), 'float32')); - }; - ThresholdedReLU.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - ThresholdedReLU.prototype.getConfig = function () { - var config = { theta: this.theta }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ThresholdedReLU.className = 'ThresholdedReLU'; - return ThresholdedReLU; -}(Layer)); -tfc.serialization.registerClass(ThresholdedReLU); -var Softmax$2 = /** @class */ (function (_super) { - __extends(Softmax, _super); - function Softmax(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.DEFAULT_AXIS = 1.0; - if (args == null) { - args = {}; - } - _this.softmax = new Softmax$1().apply; - _this.axis = args.axis == null ? _this.DEFAULT_AXIS : args.axis; - return _this; - } - Softmax.prototype.call = function (inputs, kwargs) { - var x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - }; - Softmax.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - Softmax.prototype.getConfig = function () { - var config = { axis: this.axis }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Softmax.className = 'Softmax'; - return Softmax; -}(Layer)); -tfc.serialization.registerClass(Softmax$2); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ -function normalizeArray(value, n, name) { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } - else { - if (value.length !== n) { - throw new ValueError("The " + name + " argument must be an integer or tuple of " + n + " integers." + - (" Received: " + value.length + " elements.")); - } - for (var i = 0; i < n; ++i) { - var singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError("The " + name + " argument must be an integer or tuple of " + n + - (" integers. Received: " + JSON.stringify(value) + " including a") + - (" non-integer number " + singleValue)); - } - } - return value; - } -} -/** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ -function convOutputLength(inputLength, filterSize, padding, stride, dilation) { - if (dilation === void 0) { dilation = 1; } - if (inputLength == null) { - return inputLength; - } - var dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - var outputLength; - if (padding === 'same') { - outputLength = inputLength; - } - else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); -} -function deconvLength(dimSize, strideSize, kernelSize, padding) { - if (dimSize == null) { - return null; - } - if (padding === 'valid') { - dimSize = dimSize * strideSize + max$1([kernelSize - strideSize, 0]); - } - else if (padding === 'same') { - dimSize = dimSize * strideSize; - } - else { - throw new ValueError("Unsupport padding mode: " + padding + "."); - } - return dimSize; -} - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ -function preprocessConv2DInput(x, dataFormat) { - // TODO(cais): Cast type to float32 if not. - return tfc.tidy(function () { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } - else { - return x; - } - }); -} -/** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ -function preprocessConv3DInput(x, dataFormat) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } - else { - return x; - } - }); -} -/** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -function conv1dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = 1; } - if (padding === void 0) { padding = 'valid'; } - if (dilationRate === void 0) { dilationRate = 1; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError("The input of a conv1dWithBias operation should be 3, but is " + - (x.shape.length + " instead.")); - } - if (kernel.shape.length !== 3) { - throw new ValueError("The kernel for a conv1dWithBias operation should be 3, but is " + - (kernel.shape.length + " instead")); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError("The bias for a conv1dWithBias operation should be 1, but is " + - (kernel.shape.length + " instead")); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - var y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - return y; - }); -} -/** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ -function conv2dWithBiasActivation(x, kernel, bias, strides, padding, dataFormat, dilationRate, activation) { - if (strides === void 0) { strides = [1, 1]; } - if (padding === void 0) { padding = 'valid'; } - if (activation === void 0) { activation = null; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError("conv2dWithBiasActivation expects input to be of rank 3 or 4, " + - ("but received " + x.rank + ".")); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError("conv2dWithBiasActivation expects kernel to be of rank 3 or 4, " + - ("but received " + x.rank + ".")); - } - var y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.fused.conv2d({ - x: y, - filter: kernel, - strides: strides, - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias: bias, - activation: activation - }); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} -/** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ -function conv3dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = [1, 1, 1]; } - if (padding === void 0) { padding = 'valid'; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError("conv3dWithBias expects input to be of rank 4 or 5, but received " + - (x.rank + ".")); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError("conv3dWithBias expects kernel to be of rank 4 or 5, but received " + - (x.rank + ".")); - } - var y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError('The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.conv3d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = biasAdd(y, bias); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); - } - return y; - }); -} -/** - * Abstract convolution layer. - */ -var BaseConv = /** @class */ (function (_super) { - __extends(BaseConv, _super); - function BaseConv(rank, args) { - var _this = _super.call(this, args) || this; - _this.bias = null; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - BaseConv.verifyArgs(args); - _this.rank = rank; - assertPositiveInteger(_this.rank, 'rank'); - if (_this.rank !== 1 && _this.rank !== 2 && _this.rank !== 3) { - throw new NotImplementedError("Convolution layer for rank other than 1, 2, or 3 (" + _this.rank + ") is " + - "not implemented yet."); - } - _this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - _this.strides = normalizeArray(args.strides == null ? 1 : args.strides, rank, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(_this.padding); - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.activation = getActivation(args.activation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.dilationRate = normalizeArray(args.dilationRate == null ? 1 : args.dilationRate, rank, 'dilationRate'); - if (_this.rank === 1 && - (Array.isArray(_this.dilationRate) && _this.dilationRate.length !== 1)) { - throw new ValueError("dilationRate must be a number or an array of a single number " + - "for 1D convolution, but received " + - ("" + JSON.stringify(_this.dilationRate))); - } - else if (_this.rank === 2) { - if (typeof _this.dilationRate === 'number') { - _this.dilationRate = [_this.dilationRate, _this.dilationRate]; - } - else if (_this.dilationRate.length !== 2) { - throw new ValueError("dilationRate must be a number or array of two numbers for 2D " + - ("convolution, but received " + JSON.stringify(_this.dilationRate))); - } - } - else if (_this.rank === 3) { - if (typeof _this.dilationRate === 'number') { - _this.dilationRate = - [_this.dilationRate, _this.dilationRate, _this.dilationRate]; - } - else if (_this.dilationRate.length !== 3) { - throw new ValueError("dilationRate must be a number or array of three numbers for 3D " + - ("convolution, but received " + JSON.stringify(_this.dilationRate))); - } - } - return _this; - } - BaseConv.verifyArgs = function (args) { - // Check config.kernelSize type and shape. - assert$1('kernelSize' in args, "required key 'kernelSize' not in config"); - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 3)) { - throw new ValueError("BaseConv expects config.kernelSize to be number or number[] with " + - ("length 1, 2, or 3, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - BaseConv.prototype.getConfig = function () { - var config = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return BaseConv; -}(Layer)); -/** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ -var Conv = /** @class */ (function (_super) { - __extends(Conv, _super); - function Conv(rank, args) { - var _this = _super.call(this, rank, args) || this; - _this.kernel = null; - Conv.verifyArgs(args); - _this.filters = args.filters; - assertPositiveInteger(_this.filters, 'filters'); - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - return _this; - } - Conv.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError("The channel dimension of the input should be defined. " + - ("Found " + inputShape[channelAxis])); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([inputDim, this.filters]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.inputSpec = [{ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) }]; - this.built = true; - }; - Conv.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var outputs; - var biasValue = _this.bias == null ? null : _this.bias.read(); - var fusedActivationName = mapActivationToFusedKernel(_this.activation.getClassName()); - if (fusedActivationName != null && _this.rank === 2) { - outputs = conv2dWithBiasActivation(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate, fusedActivationName); - } - else { - if (_this.rank === 1) { - outputs = conv1dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides[0], _this.padding, _this.dataFormat, _this.dilationRate[0]); - } - else if (_this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); - } - else if (_this.rank === 3) { - outputs = conv3dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); - } - else { - throw new NotImplementedError('convolutions greater than 3D are not implemented yet.'); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - } - return outputs; - }); - }; - Conv.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var newSpace = []; - var space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (var i = 0; i < space.length; ++i) { - var newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - var outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } - else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - }; - Conv.prototype.getConfig = function () { - var config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Conv.verifyArgs = function (args) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError("Convolution layer expected config.filters to be a 'number' > 0 " + - ("but got " + JSON.stringify(args.filters))); - } - }; - return Conv; -}(BaseConv)); -var Conv2D$1 = /** @class */ (function (_super) { - __extends(Conv2D, _super); - function Conv2D(args) { - var _this = _super.call(this, 2, args) || this; - Conv2D.verifyArgs(args); - return _this; - } - Conv2D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - return config; - }; - Conv2D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 2)) { - throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with " + - ("length 1 or 2, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - /** @nocollapse */ - Conv2D.className = 'Conv2D'; - return Conv2D; -}(Conv)); -tfc.serialization.registerClass(Conv2D$1); -var Conv3D$1 = /** @class */ (function (_super) { - __extends(Conv3D, _super); - function Conv3D(args) { - var _this = _super.call(this, 3, args) || this; - Conv3D.verifyArgs(args); - return _this; - } - Conv3D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - return config; - }; - Conv3D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError("Conv3D expects config.kernelSize to be number or" + - (" [number, number, number], but received " + JSON.stringify(args.kernelSize) + ".")); - } - } - }; - /** @nocollapse */ - Conv3D.className = 'Conv3D'; - return Conv3D; -}(Conv)); -tfc.serialization.registerClass(Conv3D$1); -var Conv2DTranspose = /** @class */ (function (_super) { - __extends(Conv2DTranspose, _super); - function Conv2DTranspose(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - if (_this.padding !== 'same' && _this.padding !== 'valid') { - throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' " + - ("and 'valid', but received padding mode " + _this.padding)); - } - return _this; - } - Conv2DTranspose.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 4) { - throw new ValueError('Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 4, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - Conv2DTranspose.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but " + - ("received a tensor of rank-" + input.shape.length)); - } - var inputShape = input.shape; - var batchSize = inputShape[0]; - var hAxis; - var wAxis; - if (_this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } - else { - hAxis = 1; - wAxis = 2; - } - var height = inputShape[hAxis]; - var width = inputShape[wAxis]; - var kernelH = _this.kernelSize[0]; - var kernelW = _this.kernelSize[1]; - var strideH = _this.strides[0]; - var strideW = _this.strides[1]; - // Infer the dynamic output shape. - var outHeight = deconvLength(height, strideH, kernelH, _this.padding); - var outWidth = deconvLength(width, strideW, kernelW, _this.padding); - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - var outputShape = [batchSize, outHeight, outWidth, _this.filters]; - if (_this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 1]); - } - var outputs = tfc.conv2dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); - if (_this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 3, 1, 2]); - } - if (_this.bias != null) { - outputs = - biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - Conv2DTranspose.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - var channelAxis; - var heightAxis; - var widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - var kernelH = this.kernelSize[0]; - var kernelW = this.kernelSize[1]; - var strideH = this.strides[0]; - var strideW = this.strides[1]; - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - }; - Conv2DTranspose.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['dilationRate']; - return config; - }; - /** @nocollapse */ - Conv2DTranspose.className = 'Conv2DTranspose'; - return Conv2DTranspose; -}(Conv2D$1)); -tfc.serialization.registerClass(Conv2DTranspose); -var Conv3DTranspose = /** @class */ (function (_super) { - __extends(Conv3DTranspose, _super); - function Conv3DTranspose(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - if (_this.padding !== 'same' && _this.padding !== 'valid') { - throw new ValueError("Conv3DTranspose currently supports only padding modes 'same' " + - ("and 'valid', but received padding mode " + _this.padding)); - } - return _this; - } - Conv3DTranspose.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length !== 5) { - throw new ValueError('Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError('The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - var inputDim = inputShape[channelAxis]; - var kernelShape = this.kernelSize.concat([this.filters, inputDim]); - this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - // Set input spec. - this.inputSpec = - [new InputSpec({ ndim: 5, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - Conv3DTranspose.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError("Conv3DTranspose.call() expects input tensor to be rank-4, but " + - ("received a tensor of rank-" + input.shape.length)); - } - var inputShape = input.shape; - var batchSize = inputShape[0]; - var hAxis; - var wAxis; - var dAxis; - if (_this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } - else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - var depth = inputShape[dAxis]; - var height = inputShape[hAxis]; - var width = inputShape[wAxis]; - var kernelD = _this.kernelSize[0]; - var kernelH = _this.kernelSize[1]; - var kernelW = _this.kernelSize[2]; - var strideD = _this.strides[0]; - var strideH = _this.strides[1]; - var strideW = _this.strides[2]; - // Infer the dynamic output shape. - var outDepth = deconvLength(depth, strideD, kernelD, _this.padding); - var outHeight = deconvLength(height, strideH, kernelH, _this.padding); - var outWidth = deconvLength(width, strideW, kernelW, _this.padding); - // Same as `conv2dTranspose`. We always assumes channelsLast. - var outputShape = [batchSize, outDepth, outHeight, outWidth, _this.filters]; - if (_this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 4, 1]); - } - var outputs = tfc.conv3dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); - if (_this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]); - } - if (_this.bias !== null) { - outputs = - biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation !== null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - Conv3DTranspose.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - var channelAxis; - var depthAxis; - var heightAxis; - var widthAxis; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } - else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - var kernelD = this.kernelSize[0]; - var kernelH = this.kernelSize[1]; - var kernelW = this.kernelSize[2]; - var strideD = this.strides[0]; - var strideH = this.strides[1]; - var strideW = this.strides[2]; - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - }; - Conv3DTranspose.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['dilationRate']; - return config; - }; - /** @nocollapse */ - Conv3DTranspose.className = 'Conv3DTranspose'; - return Conv3DTranspose; -}(Conv3D$1)); -tfc.serialization.registerClass(Conv3DTranspose); -var SeparableConv = /** @class */ (function (_super) { - __extends(SeparableConv, _super); - function SeparableConv(rank, config) { - var _this = _super.call(this, rank, config) || this; - _this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; - _this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; - _this.depthwiseKernel = null; - _this.pointwiseKernel = null; - if (config.filters == null) { - throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError("SeparableConv" + _this.rank + "D supports only padding modes: " + - ("'same' and 'valid', but received " + JSON.stringify(config.padding))); - } - _this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - _this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_DEPTHWISE_INITIALIZER); - _this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - _this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - _this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_POINTWISE_INITIALIZER); - _this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - _this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - return _this; - } - SeparableConv.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError("Inputs to SeparableConv" + this.rank + "D should have rank " + - (this.rank + 2 + ", but received input shape: ") + - ("" + JSON.stringify(inputShape))); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError("The channel dimension of the inputs should be defined, " + - ("but found " + JSON.stringify(inputShape[channelAxis]))); - } - var inputDim = inputShape[channelAxis]; - var depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); - var pointwiseKernelShape = []; - for (var i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - var trainable = true; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); - } - else { - this.bias = null; - } - this.inputSpec = - [new InputSpec({ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; - this.built = true; - }; - SeparableConv.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var output; - if (_this.rank === 1) { - throw new NotImplementedError('1D separable convolution is not implemented yet.'); - } - else if (_this.rank === 2) { - if (_this.dataFormat === 'channelsFirst') { - inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - output = tfc.separableConv2d(inputs, _this.depthwiseKernel.read(), _this.pointwiseKernel.read(), _this.strides, _this.padding, _this.dilationRate, 'NHWC'); - } - if (_this.useBias) { - output = biasAdd(output, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - output = _this.activation.apply(output); - } - if (_this.dataFormat === 'channelsFirst') { - output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - }; - SeparableConv.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - }; - /** @nocollapse */ - SeparableConv.className = 'SeparableConv'; - return SeparableConv; -}(Conv)); -var SeparableConv2D = /** @class */ (function (_super) { - __extends(SeparableConv2D, _super); - function SeparableConv2D(args) { - return _super.call(this, 2, args) || this; - } - /** @nocollapse */ - SeparableConv2D.className = 'SeparableConv2D'; - return SeparableConv2D; -}(SeparableConv)); -tfc.serialization.registerClass(SeparableConv2D); -var Conv1D = /** @class */ (function (_super) { - __extends(Conv1D, _super); - function Conv1D(args) { - var _this = _super.call(this, 1, args) || this; - Conv1D.verifyArgs(args); - _this.inputSpec = [{ ndim: 3 }]; - return _this; - } - Conv1D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - delete config['rank']; - delete config['dataFormat']; - return config; - }; - Conv1D.verifyArgs = function (args) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !checkArrayTypeAndLength(args.kernelSize, 'number', 1, 1)) { - throw new ValueError("Conv1D expects config.kernelSize to be number or number[] with " + - ("length 1, but received " + JSON.stringify(args.kernelSize) + ".")); - } - }; - /** @nocollapse */ - Conv1D.className = 'Conv1D'; - return Conv1D; -}(Conv)); -tfc.serialization.registerClass(Conv1D); -var Cropping2D = /** @class */ (function (_super) { - __extends(Cropping2D, _super); - function Cropping2D(args) { - var _this = _super.call(this, args) || this; - if (typeof args.cropping === 'number') { - _this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } - else if (typeof args.cropping[0] === 'number') { - _this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1], args.cropping[1]] - ]; - } - else { - _this.cropping = args.cropping; - } - _this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - _this.inputSpec = [{ ndim: 4 }]; - return _this; - } - Cropping2D.prototype.computeOutputShape = function (inputShape) { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } - else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - }; - Cropping2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[1] - _this.cropping[0][0] - _this.cropping[0][1], 2); - return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[2] - _this.cropping[1][1] - _this.cropping[1][0], 3); - } - else { - var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[2] - _this.cropping[0][0] - _this.cropping[0][1], 3); - return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[3] - _this.cropping[1][1] - _this.cropping[1][0], 4); - } - }); - }; - Cropping2D.prototype.getConfig = function () { - var config = { cropping: this.cropping, dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Cropping2D.className = 'Cropping2D'; - return Cropping2D; -}(Layer)); -tfc.serialization.registerClass(Cropping2D); -var UpSampling2D = /** @class */ (function (_super) { - __extends(UpSampling2D, _super); - function UpSampling2D(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_SIZE = [2, 2]; - _this.inputSpec = [{ ndim: 4 }]; - _this.size = args.size == null ? _this.DEFAULT_SIZE : args.size; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(_this.interpolation); - return _this; - } - UpSampling2D.prototype.computeOutputShape = function (inputShape) { - if (this.dataFormat === 'channelsFirst') { - var height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; - var width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } - else { - var height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; - var width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - }; - UpSampling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - if (_this.dataFormat === 'channelsFirst') { - input = tfc.transpose(input, [0, 2, 3, 1]); - var height = _this.size[0] * inputShape[2]; - var width = _this.size[1] * inputShape[3]; - var resized = _this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return tfc.transpose(resized, [0, 3, 1, 2]); - } - else { - var height = _this.size[0] * inputShape[1]; - var width = _this.size[1] * inputShape[2]; - return _this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - }; - UpSampling2D.prototype.getConfig = function () { - var config = { size: this.size, dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - UpSampling2D.className = 'UpSampling2D'; - return UpSampling2D; -}(Layer)); -tfc.serialization.registerClass(UpSampling2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ -function depthwiseConv2d$1(x, depthwiseKernel, strides, padding, dataFormat, dilationRate) { - if (strides === void 0) { strides = [1, 1]; } - if (padding === void 0) { padding = 'valid'; } - return tfc.tidy(function () { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - var y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError("Input for depthwiseConv2d is required to be 4-D, but is instead " + - (x.rank + "-D")); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError("depthwiseKernel is required to be 4-D, but is instead " + - (depthwiseKernel.rank + "-D")); - } - y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} -var DepthwiseConv2D = /** @class */ (function (_super) { - __extends(DepthwiseConv2D, _super); - function DepthwiseConv2D(args) { - var _this = _super.call(this, 2, args) || this; - _this.depthwiseKernel = null; - _this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - _this.depthwiseInitializer = getInitializer(args.depthwiseInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - _this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - return _this; - } - DepthwiseConv2D.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError("Inputs to DepthwiseConv2D should have rank 4. " + - ("Received input shape: " + JSON.stringify(inputShape) + ".")); - } - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + - ("be defined, but is not (" + inputShape[channelAxis] + ").")); - } - var inputDim = inputShape[channelAxis]; - var depthwiseKernelShape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - }; - DepthwiseConv2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - var outputs = depthwiseConv2d$1(inputs, _this.depthwiseKernel.read(), _this.strides, _this.padding, _this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (_this.useBias) { - outputs = biasAdd(outputs, _this.bias.read(), _this.dataFormat); - } - if (_this.activation != null) { - outputs = _this.activation.apply(outputs); - } - return outputs; - }); - }; - DepthwiseConv2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - var outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - var outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); - var outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } - else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - }; - DepthwiseConv2D.prototype.getConfig = function () { - var config = _super.prototype.getConfig.call(this); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - }; - /** @nocollapse */ - DepthwiseConv2D.className = 'DepthwiseConv2D'; - return DepthwiseConv2D; -}(BaseConv)); -tfc.serialization.registerClass(DepthwiseConv2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ -function standardizeArgs(inputs, initialState, constants, numConstants) { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError('When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - function toListOrNull(x) { - if (x == null || Array.isArray(x)) { - return x; - } - else { - return [x]; - } - } - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - return { inputs: inputs, initialState: initialState, constants: constants }; -} -/** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ -function rnn(stepFunction, inputs, initialStates, goBackwards, mask, constants, unroll, needPerStepOutputs) { - if (goBackwards === void 0) { goBackwards = false; } - if (unroll === void 0) { unroll = false; } - if (needPerStepOutputs === void 0) { needPerStepOutputs = false; } - return tfc.tidy(function () { - var ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError("Input should be at least 3D, but is " + ndim + "D."); - } - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - var axes = [1, 0].concat(range(2, ndim)); - inputs = tfc.transpose(inputs, axes); - if (constants != null) { - throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = tfc.expandDims(mask, -1); - } - mask = tfc.transpose(mask, axes); - } - if (goBackwards) { - inputs = tfc.reverse(inputs, 0); - if (mask != null) { - mask = tfc.reverse(mask, 0); - } - } - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - var perStepOutputs = []; - var lastOutput; - var states = initialStates; - var timeSteps = inputs.shape[0]; - var perStepInputs = tfc.unstack(inputs); - var perStepMasks; - if (mask != null) { - perStepMasks = tfc.unstack(mask); - } - var _loop_1 = function (t) { - var currentInput = perStepInputs[t]; - var stepOutputs = tfc.tidy(function () { return stepFunction(currentInput, states); }); - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } - else { - var maskedOutputs = tfc.tidy(function () { - var stepMask = perStepMasks[t]; - var negStepMask = tfc.onesLike(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - var output = stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - var newStates = states.map(function (state, i) { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return { output: output, newStates: newStates }; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - }; - for (var t = 0; t < timeSteps; ++t) { - _loop_1(t); - } - var outputs; - if (needPerStepOutputs) { - var axis = 1; - outputs = tfc.stack(perStepOutputs, axis); - } - return [lastOutput, outputs, states]; - }); -} -var RNN = /** @class */ (function (_super) { - __extends(RNN, _super); - function RNN(args) { - var _this = _super.call(this, args) || this; - var cell; - if (args.cell == null) { - throw new ValueError('cell property is missing for the constructor of RNN.'); - } - else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({ cells: args.cell }); - } - else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - _this.cell = cell; - _this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - _this.returnState = args.returnState == null ? false : args.returnState; - _this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - _this._stateful = args.stateful == null ? false : args.stateful; - _this.unroll = args.unroll == null ? false : args.unroll; - _this.supportsMasking = true; - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - _this.stateSpec = null; - _this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - _this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - _this.keptStates = []; - return _this; - } - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - RNN.prototype.getStates = function () { - if (this.states_ == null) { - var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return range(0, numStates).map(function (x) { return null; }); - } - else { - return this.states_; - } - }; - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - RNN.prototype.setStates = function (states) { - this.states_ = states; - }; - RNN.prototype.computeOutputShape = function (inputShape) { - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - // TODO(cais): Remove the casting once stacked RNN cells become supported. - var stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - var outputDim = stateSize[0]; - var outputShape; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } - else { - outputShape = [inputShape[0], outputDim]; - } - if (this.returnState) { - var stateShape = []; - for (var _i = 0, stateSize_1 = stateSize; _i < stateSize_1.length; _i++) { - var dim = stateSize_1[_i]; - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } - else { - return outputShape; - } - }; - RNN.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - if (Array.isArray(mask)) { - mask = mask[0]; - } - var outputMask = _this.returnSequences ? mask : null; - if (_this.returnState) { - var stateMask = _this.states.map(function (s) { return null; }); - return [outputMask].concat(stateMask); - } - else { - return outputMask; - } - }); - }; - Object.defineProperty(RNN.prototype, "states", { - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get: function () { - if (this.states_ == null) { - var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - var output = []; - for (var i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } - else { - return this.states_; - } - }, - set: function (s) { - this.states_ = s; - }, - enumerable: true, - configurable: true - }); - RNN.prototype.build = function (inputShape) { - if (this.numConstants != null) { - throw new NotImplementedError('Constants support is not implemented in RNN yet.'); - } - if (isArrayOfShapes(inputShape)) { - inputShape = inputShape[0]; - } - inputShape = inputShape; - var batchSize = this.stateful ? inputShape[0] : null; - var inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({ shape: [batchSize, null].concat(inputDim) }); - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - var stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - { - this.cell.build(stepInputShape); - } - // Set or validate stateSpec. - var stateSize; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } - else { - stateSize = [this.cell.stateSize]; - } - if (this.stateSpec != null) { - if (!tfc.util.arraysEqual(this.stateSpec.map(function (spec) { return spec.shape[spec.shape.length - 1]; }), stateSize)) { - throw new ValueError("An initialState was passed that is not compatible with " + - ("cell.stateSize. Received stateSpec=" + this.stateSpec + "; ") + - ("However cell.stateSize is " + this.cell.stateSize)); - } - } - else { - this.stateSpec = - stateSize.map(function (dim) { return new InputSpec({ shape: [null, dim] }); }); - } - if (this.stateful) { - this.resetStates(); - } - }; - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - RNN.prototype.resetStates = function (states, training) { - var _this = this; - if (training === void 0) { training = false; } - tfc.tidy(function () { - if (!_this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - var batchSize = _this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (_this.states_ == null) { - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = - _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); - } - else { - _this.states_ = [tfc.zeros([batchSize, _this.cell.stateSize])]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(_this.states_); - // For stateful RNNs, fully dispose kept old states. - if (_this.keptStates != null) { - tfc.dispose(_this.keptStates); - _this.keptStates = []; - } - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = - _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); - } - else { - _this.states_[0] = tfc.zeros([batchSize, _this.cell.stateSize]); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== _this.states_.length) { - throw new ValueError("Layer " + _this.name + " expects " + _this.states_.length + " state(s), " + - ("but it received " + states.length + " state value(s). Input ") + - ("received: " + states)); - } - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - _this.keptStates.push(_this.states_.slice()); - } - else { - tfc.dispose(_this.states_); - } - for (var index = 0; index < _this.states_.length; ++index) { - var value = states[index]; - var dim = Array.isArray(_this.cell.stateSize) ? - _this.cell.stateSize[index] : - _this.cell.stateSize; - var expectedShape = [batchSize, dim]; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + - ("expected shape=" + expectedShape + ", received shape=" + value.shape)); - } - _this.states_[index] = value; - } - } - _this.states_ = _this.states_.map(function (state) { return tfc.keep(state.clone()); }); - }); - }; - RNN.prototype.apply = function (inputs, kwargs) { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - var initialState = kwargs == null ? null : kwargs['initialState']; - var constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - var additionalInputs = []; - var additionalSpecs = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (var _i = 0, initialState_1 = initialState; _i < initialState_1.length; _i++) { - var state = initialState_1[_i]; - this.stateSpec.push(new InputSpec({ shape: state.shape })); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - var isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - var fullInput = [inputs].concat(additionalInputs); - var fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - var originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - var output = _super.prototype.apply.call(this, fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return _super.prototype.apply.call(this, inputs, kwargs); - } - }; - // tslint:disable-next-line:no-any - RNN.prototype.call = function (inputs, kwargs) { - var _this = this; - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tfc.tidy(function () { - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (_this.stateful) { - initialState = _this.states_; - } - else { - initialState = _this.getInitialState(inputs); - } - } - var numStates = Array.isArray(_this.cell.stateSize) ? _this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError("RNN Layer has " + numStates + " state(s) but was passed " + - (initialState.length + " initial state(s).")); - } - if (_this.unroll) { - console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - var cellCallKwargs = { training: training }; - // TODO(cais): Add support for constants. - var step = function (inputs, states) { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - var outputs = _this.cell.call([inputs].concat(states), cellCallKwargs); - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)]; - }; - // TODO(cais): Add support for constants. - var rnnOutputs = rnn(step, inputs, initialState, _this.goBackwards, mask, null, _this.unroll, _this.returnSequences); - var lastOutput = rnnOutputs[0]; - var outputs = rnnOutputs[1]; - var states = rnnOutputs[2]; - if (_this.stateful) { - _this.resetStates(states, training); - } - var output = _this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. - if (_this.returnState) { - return [output].concat(states); - } - else { - return output; - } - }); - }; - RNN.prototype.getInitialState = function (inputs) { - var _this = this; - return tfc.tidy(function () { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - var initialState = tfc.zeros(inputs.shape); - // [Samples]. - initialState = tfc.sum(initialState, [1, 2]); - initialState = expandDims$1(initialState); // [Samples, 1]. - if (Array.isArray(_this.cell.stateSize)) { - return _this.cell.stateSize.map(function (dim) { return dim > 1 ? tile$1(initialState, [1, dim]) : initialState; }); - } - else { - return _this.cell.stateSize > 1 ? - [tile$1(initialState, [1, _this.cell.stateSize])] : - [initialState]; - } - }); - }; - Object.defineProperty(RNN.prototype, "trainableWeights", { - get: function () { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(RNN.prototype, "nonTrainableWeights", { - get: function () { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - }, - enumerable: true, - configurable: true - }); - RNN.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - }; - RNN.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - var cellConfig = this.cell.getConfig(); - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - }; - } - // this order is necessary, to prevent cell name from replacing layer name - return __assign({}, cellConfig, baseConfig, config); - }; - /** @nocollapse */ - RNN.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var cellConfig = config['cell']; - var cell = deserialize(cellConfig, customObjects); - return new cls(Object.assign(config, { cell: cell })); - }; - /** @nocollapse */ - RNN.className = 'RNN'; - return RNN; -}(Layer)); -tfc.serialization.registerClass(RNN); -// Porting Note: This is a common parent class for RNN cells. There is no -// equivalent of this in PyKeras. Having a common parent class forgoes the -// need for `has_attr(cell, ...)` checks or its TypeScript equivalent. -/** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ -var RNNCell = /** @class */ (function (_super) { - __extends(RNNCell, _super); - function RNNCell() { - return _super !== null && _super.apply(this, arguments) || this; - } - return RNNCell; -}(Layer)); -var SimpleRNNCell = /** @class */ (function (_super) { - __extends(SimpleRNNCell, _super); - function SimpleRNNCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - _this.units = args.units; - assertPositiveInteger(_this.units, "units"); - _this.activation = getActivation(args.activation == null ? _this.DEFAULT_ACTIVATION : args.activation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.stateSize = _this.units; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - SimpleRNNCell.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - this.built = true; - }; - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - SimpleRNNCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError("SimpleRNNCell expects 2 input Tensors, got " + inputs.length + "."); - } - var prevOutput = inputs[1]; - inputs = inputs[0]; - var training = kwargs['training'] == null ? false : kwargs['training']; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(prevOutput); }, - rate: _this.recurrentDropout, - training: training - }); - } - var h; - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - if (dpMask != null) { - h = dot$1(tfc.mul(inputs, dpMask), _this.kernel.read()); - } - else { - h = dot$1(inputs, _this.kernel.read()); - } - if (_this.bias != null) { - h = biasAdd(h, _this.bias.read()); - } - if (recDpMask != null) { - prevOutput = tfc.mul(prevOutput, recDpMask); - } - var output = tfc.add(h, dot$1(prevOutput, _this.recurrentKernel.read())); - if (_this.activation != null) { - output = _this.activation.apply(output); - } - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - }; - SimpleRNNCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - SimpleRNNCell.className = 'SimpleRNNCell'; - return SimpleRNNCell; -}(RNNCell)); -tfc.serialization.registerClass(SimpleRNNCell); -var SimpleRNN = /** @class */ (function (_super) { - __extends(SimpleRNN, _super); - function SimpleRNN(args) { - var _this = this; - args.cell = new SimpleRNNCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - SimpleRNN.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - SimpleRNN.fromConfig = function (cls, config) { - return new cls(config); - }; - /** @nocollapse */ - SimpleRNN.className = 'SimpleRNN'; - return SimpleRNN; -}(RNN)); -tfc.serialization.registerClass(SimpleRNN); -var GRUCell = /** @class */ (function (_super) { - __extends(GRUCell, _super); - function GRUCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.resetAfter) { - throw new ValueError("GRUCell does not support reset_after parameter set to true."); - } - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation === undefined ? _this.DEFAULT_ACTIVATION : - args.activation); - _this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - _this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.implementation = args.implementation; - _this.stateSize = _this.units; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - GRUCell.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - }; - GRUCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (inputs.length !== 2) { - throw new ValueError("GRUCell expects 2 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var training = kwargs['training'] == null ? false : kwargs['training']; - var hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training, - count: 3 - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: 3 - }); - } - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - var z; - var r; - var hh; - if (0 < _this.dropout && _this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - var matrixX = dot$1(inputs, _this.kernel.read()); - if (_this.useBias) { - matrixX = biasAdd(matrixX, _this.bias.read()); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - var recurrentKernelValue = _this.recurrentKernel.read(); - var _a = tfc.split(recurrentKernelValue, [2 * _this.units, _this.units], recurrentKernelValue.rank - 1), rk1 = _a[0], rk2 = _a[1]; - var matrixInner = dot$1(hTMinus1, rk1); - var _b = tfc.split(matrixX, 3, matrixX.rank - 1), xZ = _b[0], xR = _b[1], xH = _b[2]; - var _c = tfc.split(matrixInner, 2, matrixInner.rank - 1), recurrentZ = _c[0], recurrentR = _c[1]; - z = _this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); - r = _this.recurrentActivation.apply(tfc.add(xR, recurrentR)); - var recurrentH = dot$1(tfc.mul(r, hTMinus1), rk2); - hh = _this.activation.apply(tfc.add(xH, recurrentH)); - var h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - }; - GRUCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - GRUCell.className = 'GRUCell'; - return GRUCell; -}(RNNCell)); -tfc.serialization.registerClass(GRUCell); -var GRU = /** @class */ (function (_super) { - __extends(GRU, _super); - function GRU(args) { - var _this = this; - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - GRU.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - GRU.fromConfig = function (cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - }; - /** @nocollapse */ - GRU.className = 'GRU'; - return GRU; -}(RNN)); -tfc.serialization.registerClass(GRU); -var LSTMCell = /** @class */ (function (_super) { - __extends(LSTMCell, _super); - function LSTMCell(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_ACTIVATION = 'tanh'; - _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation === undefined ? _this.DEFAULT_ACTIVATION : - args.activation); - _this.recurrentActivation = getActivation(args.recurrentActivation === undefined ? - _this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - _this.useBias = args.useBias == null ? true : args.useBias; - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.recurrentInitializer = getInitializer(args.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.unitForgetBias = args.unitForgetBias; - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.recurrentConstraint = getConstraint(args.recurrentConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.dropout = min$1([1, max$1([0, args.dropout == null ? 0 : args.dropout])]); - _this.recurrentDropout = min$1([ - 1, - max$1([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - _this.implementation = args.implementation; - _this.stateSize = [_this.units, _this.units]; - _this.dropoutMask = null; - _this.recurrentDropoutMask = null; - return _this; - } - LSTMCell.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - var biasInitializer; - if (this.useBias) { - if (this.unitForgetBias) { - var capturedBiasInit_1 = this.biasInitializer; - var capturedUnits_1 = this.units; - biasInitializer = new (_a = /** @class */ (function (_super) { - __extends(CustomInit, _super); - function CustomInit() { - return _super !== null && _super.apply(this, arguments) || this; - } - CustomInit.prototype.apply = function (shape, dtype) { - // TODO(cais): More informative variable names? - var bI = capturedBiasInit_1.apply([capturedUnits_1]); - var bF = (new Ones()).apply([capturedUnits_1]); - var bCAndH = capturedBiasInit_1.apply([capturedUnits_1 * 2]); - return concatAlongFirstAxis(concatAlongFirstAxis(bI, bF), bCAndH); - }; - return CustomInit; - }(Initializer)), - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - }; - LSTMCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs; - if (inputs.length !== 3) { - throw new ValueError("LSTMCell expects 3 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var hTMinus1 = inputs[1]; // Previous memory state. - var cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(inputs); }, - rate: _this.dropout, - training: training, - count: 4 - }); - } - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: 4 - }); - } - var dpMask = _this.dropoutMask; - var recDpMask = _this.recurrentDropoutMask; - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - var i; - var f; - var c; - var o; - if (0 < _this.dropout && _this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - var z = dot$1(inputs, _this.kernel.read()); - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - z = tfc.add(z, dot$1(hTMinus1, _this.recurrentKernel.read())); - if (_this.useBias) { - z = biasAdd(z, _this.bias.read()); - } - var _a = tfc.split(z, 4, z.rank - 1), z0 = _a[0], z1 = _a[1], z2 = _a[2], z3 = _a[3]; - i = _this.recurrentActivation.apply(z0); - f = _this.recurrentActivation.apply(z1); - c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(z2))); - o = _this.recurrentActivation.apply(z3); - var h = tfc.mul(o, _this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - }; - LSTMCell.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - LSTMCell.className = 'LSTMCell'; - return LSTMCell; -}(RNNCell)); -tfc.serialization.registerClass(LSTMCell); -var LSTM = /** @class */ (function (_super) { - __extends(LSTM, _super); - function LSTM(args) { - var _this = this; - if (args.implementation === 0) { - console.warn('`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - _this = _super.call(this, args) || this; - return _this; - // TODO(cais): Add activityRegularizer. - } - LSTM.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - /** @nocollapse */ - LSTM.fromConfig = function (cls, config) { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - }; - /** @nocollapse */ - LSTM.className = 'LSTM'; - return LSTM; -}(RNN)); -tfc.serialization.registerClass(LSTM); -var StackedRNNCells = /** @class */ (function (_super) { - __extends(StackedRNNCells, _super); - function StackedRNNCells(args) { - var _this = _super.call(this, args) || this; - _this.cells = args.cells; - return _this; - } - Object.defineProperty(StackedRNNCells.prototype, "stateSize", { - get: function () { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - var stateSize = []; - for (var _i = 0, _a = this.cells.slice().reverse(); _i < _a.length; _i++) { - var cell = _a[_i]; - if (Array.isArray(cell.stateSize)) { - stateSize.push.apply(stateSize, cell.stateSize); - } - else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - }, - enumerable: true, - configurable: true - }); - StackedRNNCells.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - var states = inputs.slice(1); - // Recover per-cell states. - var nestedStates = []; - for (var _i = 0, _a = _this.cells.slice().reverse(); _i < _a.length; _i++) { - var cell = _a[_i]; - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } - else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - // Call the cells in order and store the returned states. - var newNestedStates = []; - var callInputs; - for (var i = 0; i < _this.cells.length; ++i) { - var cell = _this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } - else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs); - newNestedStates.push(callInputs.slice(1)); - } - // Format the new states as a flat list in reverse cell order. - states = []; - for (var _b = 0, _c = newNestedStates.slice().reverse(); _b < _c.length; _b++) { - var cellStates = _c[_b]; - states.push.apply(states, cellStates); - } - return [callInputs[0]].concat(states); - }); - }; - StackedRNNCells.prototype.build = function (inputShape) { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = inputShape[0]; - } - inputShape = inputShape; - var outputDim; - this.cells.forEach(function (cell, i) { - nameScope("RNNCell_" + i, function () { - // TODO(cais): Take care of input constants. - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } - else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim]; - }); - }); - this.built = true; - }; - StackedRNNCells.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var getCellConfig = function (cell) { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - var cellConfigs = this.cells.map(getCellConfig); - var config = { 'cells': cellConfigs }; - return __assign({}, baseConfig, config); - }; - /** @nocollapse */ - StackedRNNCells.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var cells = []; - for (var _i = 0, _a = config['cells']; _i < _a.length; _i++) { - var cellConfig = _a[_i]; - cells.push(deserialize(cellConfig, customObjects)); - } - return new cls({ cells: cells }); - }; - Object.defineProperty(StackedRNNCells.prototype, "trainableWeights", { - get: function () { - if (!this.trainable) { - return []; - } - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.trainableWeights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(StackedRNNCells.prototype, "nonTrainableWeights", { - get: function () { - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.nonTrainableWeights); - } - if (!this.trainable) { - var trainableWeights = []; - for (var _b = 0, _c = this.cells; _b < _c.length; _b++) { - var cell = _c[_b]; - trainableWeights.push.apply(trainableWeights, cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - }, - enumerable: true, - configurable: true - }); - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - StackedRNNCells.prototype.getWeights = function () { - var weights = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - weights.push.apply(weights, cell.weights); - } - return batchGetValue(weights); - }; - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - StackedRNNCells.prototype.setWeights = function (weights) { - var tuples = []; - for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { - var cell = _a[_i]; - var numParams = cell.weights.length; - var inputWeights = weights.splice(numParams); - for (var i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - }; - /** @nocollapse */ - StackedRNNCells.className = 'StackedRNNCells'; - return StackedRNNCells; -}(RNNCell)); -tfc.serialization.registerClass(StackedRNNCells); -function generateDropoutMask(args) { - var ones = args.ones, rate = args.rate, _a = args.training, training = _a === void 0 ? false : _a, _b = args.count, count = _b === void 0 ? 1 : _b; - var droppedInputs = function () { return dropout(ones(), rate); }; - var createMask = function () { return inTrainPhase(droppedInputs, ones, training); }; - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return tfc.keep(createMask().clone()); - } - var masks = Array(count).fill(undefined).map(createMask); - return masks.map(function (m) { return tfc.keep(m.clone()); }); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var ConvRNN2DCell = /** @class */ (function (_super) { - __extends(ConvRNN2DCell, _super); - function ConvRNN2DCell() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ConvRNN2DCell; -}(RNNCell)); -/** - * Base class for convolutional-recurrent layers. - */ -var ConvRNN2D = /** @class */ (function (_super) { - __extends(ConvRNN2D, _super); - function ConvRNN2D(args) { - var _this = this; - if (args.unroll) { - throw new NotImplementedError('Unrolling is not possible with convolutional RNNs.'); - } - if (Array.isArray(args.cell)) { - throw new NotImplementedError('It is not possible at the moment to stack convolutional cells.'); - } - _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - return _this; - } - ConvRNN2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.cell.dropoutMask != null) { - tfc.dispose(_this.cell.dropoutMask); - _this.cell.dropoutMask = null; - } - if (_this.cell.recurrentDropoutMask != null) { - tfc.dispose(_this.cell.recurrentDropoutMask); - _this.cell.recurrentDropoutMask = null; - } - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - var mask = kwargs == null ? null : kwargs['mask']; - var training = kwargs == null ? null : kwargs['training']; - var initialState = kwargs == null ? null : kwargs['initialState']; - return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); - }); - }; - ConvRNN2D.prototype.computeOutputShape = function (inputShape) { - var outShape = this.computeSingleOutputShape(inputShape); - if (!this.returnSequences) { - outShape = [outShape[0]].concat(outShape.slice(2)); - } - if (this.returnState) { - outShape = [outShape].concat(Array(2).fill([inputShape[0]].concat(outShape.slice(-3)))); - } - return outShape; - }; - ConvRNN2D.prototype.getInitialState = function (inputs) { - var _this = this; - return tfc.tidy(function () { - var stateSize = _this.cell.stateSize; - var inputShape = inputs.shape; - var outputShape = _this.computeSingleOutputShape(inputShape); - var stateShape = [outputShape[0]].concat(outputShape.slice(2)); - var initialState = tfc.zeros(stateShape); - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - return [initialState]; - }); - }; - ConvRNN2D.prototype.resetStates = function (states, training) { - var _this = this; - if (training === void 0) { training = false; } - tfc.tidy(function () { - if (!_this.stateful) { - throw new AttributeError('Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - var inputShape = _this.inputSpec[0].shape; - var outputShape = _this.computeSingleOutputShape(inputShape); - var stateShape = [outputShape[0]].concat(outputShape.slice(2)); - var batchSize = inputShape[0]; - if (batchSize == null) { - throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (_this.getStates() == null) { - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = _this.cell.stateSize.map(function () { return tfc.zeros(stateShape); }); - } - else { - _this.states_ = [tfc.zeros(stateShape)]; - } - } - else if (states == null) { - // Dispose old state tensors. - tfc.dispose(_this.states_); - // For stateful RNNs, fully dispose kept old states. - if (_this.keptStates != null) { - tfc.dispose(_this.keptStates); - _this.keptStates = []; - } - if (Array.isArray(_this.cell.stateSize)) { - _this.states_ = _this.cell.stateSize.map(function () { return tfc.zeros(stateShape); }); - } - else { - _this.states_[0] = tfc.zeros(stateShape); - } - } - else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== _this.states_.length) { - throw new ValueError("Layer " + _this.name + " expects " + _this.states_.length + " state(s), " + - ("but it received " + states.length + " state value(s). Input ") + - ("received: " + states)); - } - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - _this.keptStates.push(_this.states_.slice()); - } - else { - tfc.dispose(_this.states_); - } - for (var index = 0; index < _this.states_.length; ++index) { - var value = states[index]; - var expectedShape = stateShape; - if (!tfc.util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + - ("expected shape=" + expectedShape + ", received shape=" + value.shape)); - } - _this.states_[index] = value; - } - } - _this.states_ = _this.states_.map(function (state) { return tfc.keep(state.clone()); }); - }); - }; - ConvRNN2D.prototype.computeSingleOutputShape = function (inputShape) { - var _a = this.cell, dataFormat = _a.dataFormat, filters = _a.filters, kernelSize = _a.kernelSize, padding = _a.padding, strides = _a.strides, dilationRate = _a.dilationRate; - var isChannelsFirst = dataFormat === 'channelsFirst'; - var h = inputShape[isChannelsFirst ? 3 : 2]; - var w = inputShape[isChannelsFirst ? 4 : 3]; - var hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - var wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); - var outShape = inputShape.slice(0, 2).concat((isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])); - return outShape; - }; - /** @nocollapse */ - ConvRNN2D.className = 'ConvRNN2D'; - return ConvRNN2D; -}(RNN)); -var ConvLSTM2DCell = /** @class */ (function (_super) { - __extends(ConvLSTM2DCell, _super); - function ConvLSTM2DCell(args) { - var _this = this; - var filters = args.filters, kernelSize = args.kernelSize, strides = args.strides, padding = args.padding, dataFormat = args.dataFormat, dilationRate = args.dilationRate; - _this = _super.call(this, __assign({}, args, { units: filters })) || this; - _this.filters = filters; - assertPositiveInteger(_this.filters, 'filters'); - _this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - _this.kernelSize.forEach(function (size) { return assertPositiveInteger(size, 'kernelSize'); }); - _this.strides = normalizeArray(strides || 1, 2, 'strides'); - _this.strides.forEach(function (stride) { return assertPositiveInteger(stride, 'strides'); }); - _this.padding = padding || 'valid'; - checkPaddingMode(_this.padding); - _this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(_this.dataFormat); - _this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - _this.dilationRate.forEach(function (rate) { return assertPositiveInteger(rate, 'dilationRate'); }); - return _this; - } - ConvLSTM2DCell.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError("The channel dimension of the input should be defined. " + - ("Found " + inputShape[channelAxis])); - } - var inputDim = inputShape[channelAxis]; - var numOfKernels = 4; - var kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - var recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - this.recurrentKernel = this.addWeight('recurrent_kernel', recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); - if (this.useBias) { - var biasInitializer = void 0; - if (this.unitForgetBias) { - var init_1 = this.biasInitializer; - var filters_1 = this.filters; - biasInitializer = new (_a = /** @class */ (function (_super) { - __extends(CustomInit, _super); - function CustomInit() { - return _super !== null && _super.apply(this, arguments) || this; - } - CustomInit.prototype.apply = function (shape, dtype) { - var biasI = init_1.apply([filters_1]); - var biasF = tfc.ones([filters_1]); - var biasCAndO = init_1.apply([filters_1 * 2]); - return concatenate([biasI, biasF, biasCAndO]); - }; - return CustomInit; - }(Initializer)), - /** @nocollapse */ - _a.className = 'CustomInit', - _a)(); - } - else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight('bias', [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - this.built = true; - }; - ConvLSTM2DCell.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (inputs.length !== 3) { - throw new ValueError("ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got " + - (inputs.length + ".")); - } - var training = kwargs['training'] || false; - var x = inputs[0]; // Current input - var hTMinus1 = inputs[1]; // Previous memory state. - var cTMinus1 = inputs[2]; // Previous carry state. - var numOfKernels = 4; - if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { - _this.dropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(x); }, - rate: _this.dropout, - training: training, - count: numOfKernels - }); - } - var dropoutMask = _this.dropoutMask; - var applyDropout = function (x, mask, index) { - if (!mask || !mask[index]) { - return x; - } - return tfc.mul(mask[index], x); - }; - var xI = applyDropout(x, dropoutMask, 0); - var xF = applyDropout(x, dropoutMask, 1); - var xC = applyDropout(x, dropoutMask, 2); - var xO = applyDropout(x, dropoutMask, 3); - if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && - _this.recurrentDropoutMask == null) { - _this.recurrentDropoutMask = generateDropoutMask({ - ones: function () { return tfc.onesLike(hTMinus1); }, - rate: _this.recurrentDropout, - training: training, - count: numOfKernels - }); - } - var recDropoutMask = _this.recurrentDropoutMask; - var hI = applyDropout(hTMinus1, recDropoutMask, 0); - var hF = applyDropout(hTMinus1, recDropoutMask, 1); - var hC = applyDropout(hTMinus1, recDropoutMask, 2); - var hO = applyDropout(hTMinus1, recDropoutMask, 3); - var kernelChannelAxis = 3; - var _a = tfc.split(_this.kernel.read(), numOfKernels, kernelChannelAxis), kernelI = _a[0], kernelF = _a[1], kernelC = _a[2], kernelO = _a[3]; - var _b = _this.useBias ? - tfc.split(_this.bias.read(), numOfKernels) : - [null, null, null, null], biasI = _b[0], biasF = _b[1], biasC = _b[2], biasO = _b[3]; - xI = _this.inputConv(xI, kernelI, biasI, _this.padding); - xF = _this.inputConv(xF, kernelF, biasF, _this.padding); - xC = _this.inputConv(xC, kernelC, biasC, _this.padding); - xO = _this.inputConv(xO, kernelO, biasO, _this.padding); - var _c = tfc.split(_this.recurrentKernel.read(), numOfKernels, kernelChannelAxis), recKernelI = _c[0], recKernelF = _c[1], recKernelC = _c[2], recKernelO = _c[3]; - hI = _this.recurrentConv(hI, recKernelI); - hF = _this.recurrentConv(hF, recKernelF); - hC = _this.recurrentConv(hC, recKernelC); - hO = _this.recurrentConv(hO, recKernelO); - var i = _this.recurrentActivation.apply(tfc.add(xI, hI)); - var f = _this.recurrentActivation.apply(tfc.add(xF, hF)); - var c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(tfc.add(xC, hC)))); - var h = tfc.mul(_this.recurrentActivation.apply(tfc.add(xO, hO)), _this.activation.apply(c)); - return [h, h, c]; - }); - }; - ConvLSTM2DCell.prototype.getConfig = function () { - var _a = _super.prototype.getConfig.call(this), _ = _a["units"], baseConfig = __rest(_a, ['units']); - var config = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - return __assign({}, baseConfig, config); - }; - ConvLSTM2DCell.prototype.inputConv = function (x, w, b, padding) { - var out = tfc.conv2d(x, w, this.strides, (padding || 'valid'), this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', this.dilationRate); - if (b) { - return biasAdd(out, b, this.dataFormat); - } - return out; - }; - ConvLSTM2DCell.prototype.recurrentConv = function (x, w) { - var strides = 1; - return tfc.conv2d(x, w, strides, 'same', this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - }; - /** @nocollapse */ - ConvLSTM2DCell.className = 'ConvLSTM2DCell'; - return ConvLSTM2DCell; -}(LSTMCell)); -tfc.serialization.registerClass(ConvLSTM2DCell); -var ConvLSTM2D = /** @class */ (function (_super) { - __extends(ConvLSTM2D, _super); - function ConvLSTM2D(args) { - var _this = this; - var cell = new ConvLSTM2DCell(args); - _this = _super.call(this, __assign({}, args, { cell: cell })) || this; - return _this; - } - /** @nocollapse */ - ConvLSTM2D.fromConfig = function (cls, config) { - return new cls(config); - }; - /** @nocollapse */ - ConvLSTM2D.className = 'ConvLSTM2D'; - return ConvLSTM2D; -}(ConvRNN2D)); -tfc.serialization.registerClass(ConvLSTM2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var Dropout = /** @class */ (function (_super) { - __extends(Dropout, _super); - function Dropout(args) { - var _this = _super.call(this, args) || this; - _this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - _this.noiseShape = args.noiseShape; - _this.seed = args.seed; - _this.supportsMasking = true; - return _this; - } - Dropout.prototype.getNoiseShape = function (input) { - if (this.noiseShape == null) { - return this.noiseShape; - } - var inputShape = input.shape; - var noiseShape = []; - for (var i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - }; - Dropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (0 < _this.rate && _this.rate < 1) { - var training = kwargs['training'] == null ? false : kwargs['training']; - var noiseShape_1 = _this.getNoiseShape(input); - var output = inTrainPhase(function () { return dropout(input, _this.rate, noiseShape_1, _this.seed); }, function () { return input; }, training); - return output; - } - return inputs; - }); - }; - Dropout.prototype.getConfig = function () { - var config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Dropout.prototype.dispose = function () { - return _super.prototype.dispose.call(this); - }; - /** @nocollapse */ - Dropout.className = 'Dropout'; - return Dropout; -}(Layer)); -tfc.serialization.registerClass(Dropout); -var SpatialDropout1D = /** @class */ (function (_super) { - __extends(SpatialDropout1D, _super); - function SpatialDropout1D(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [{ ndim: 3 }]; - return _this; - } - SpatialDropout1D.prototype.getNoiseShape = function (input) { - var inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - }; - /** @nocollapse */ - SpatialDropout1D.className = 'SpatialDropout1D'; - return SpatialDropout1D; -}(Dropout)); -tfc.serialization.registerClass(SpatialDropout1D); -var Dense = /** @class */ (function (_super) { - __extends(Dense, _super); - function Dense(args) { - var _this = _super.call(this, args) || this; - // Default activation: Linear (none). - _this.activation = null; - _this.useBias = true; - _this.kernel = null; - _this.bias = null; - _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - _this.batchInputShape = [batchSize, args.inputDim]; - } - _this.units = args.units; - assertPositiveInteger(_this.units, 'units'); - _this.activation = getActivation(args.activation); - if (args.useBias != null) { - _this.useBias = args.useBias; - } - _this.kernelInitializer = getInitializer(args.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); - _this.biasInitializer = - getInitializer(args.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); - _this.kernelConstraint = getConstraint(args.kernelConstraint); - _this.biasConstraint = getConstraint(args.biasConstraint); - _this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - _this.biasRegularizer = getRegularizer(args.biasRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.supportsMasking = true; - _this.inputSpec = [{ minNDim: 2 }]; - return _this; - } - Dense.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); - } - } - this.inputSpec = [{ minNDim: 2, axes: (_a = {}, _a[-1] = inputLastDim, _a) }]; - this.built = true; - }; - Dense.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - }; - Dense.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - var input = getExactlyOneTensor(inputs); - var fusedActivationName = mapActivationToFusedKernel(_this.activation.getClassName()); - var output; - if (fusedActivationName != null) { - output = dot$1(input, _this.kernel.read(), fusedActivationName, _this.bias ? _this.bias.read() : null); - } - else { - output = dot$1(input, _this.kernel.read()); - if (_this.bias != null) { - output = biasAdd(output, _this.bias.read()); - } - if (_this.activation != null) { - output = _this.activation.apply(output); - } - } - return output; - }); - }; - Dense.prototype.getConfig = function () { - var config = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Dense.className = 'Dense'; - return Dense; -}(Layer)); -tfc.serialization.registerClass(Dense); -var Flatten = /** @class */ (function (_super) { - __extends(Flatten, _super); - function Flatten(args) { - var _this = this; - args = args || {}; - _this = _super.call(this, args) || this; - _this.inputSpec = [{ minNDim: 3 }]; - _this.dataFormat = args.dataFormat; - return _this; - } - Flatten.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - for (var _i = 0, _a = inputShape.slice(1); _i < _a.length; _i++) { - var dim = _a[_i]; - if (dim == null) { - throw new ValueError("The shape of the input to \"Flatten\" is not fully defined " + - ("(got " + inputShape.slice(1) + "). Make sure to pass a complete ") + - "\"input_shape\" or \"batch_input_shape\" argument to the first " + - "layer in your model."); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - }; - Flatten.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsFirst' && input.rank > 1) { - var permutation = [0]; - for (var i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - return batchFlatten(input); - }); - }; - Flatten.prototype.getConfig = function () { - var config = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Flatten.className = 'Flatten'; - return Flatten; -}(Layer)); -tfc.serialization.registerClass(Flatten); -var Activation$1 = /** @class */ (function (_super) { - __extends(Activation, _super); - function Activation(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.activation = getActivation(args.activation); - return _this; - } - Activation.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - return _this.activation.apply(input); - }); - }; - Activation.prototype.getConfig = function () { - var config = { activation: serializeActivation(this.activation) }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Activation.className = 'Activation'; - return Activation; -}(Layer)); -tfc.serialization.registerClass(Activation$1); -var RepeatVector = /** @class */ (function (_super) { - __extends(RepeatVector, _super); - function RepeatVector(args) { - var _this = _super.call(this, args) || this; - _this.n = args.n; - _this.inputSpec = [{ ndim: 2 }]; - return _this; - } - RepeatVector.prototype.computeOutputShape = function (inputShape) { - return [inputShape[0], this.n, inputShape[1]]; - }; - RepeatVector.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = getExactlyOneTensor(inputs); - return repeat(inputs, _this.n); - }); - }; - RepeatVector.prototype.getConfig = function () { - var config = { - n: this.n, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - RepeatVector.className = 'RepeatVector'; - return RepeatVector; -}(Layer)); -tfc.serialization.registerClass(RepeatVector); -var Reshape$1 = /** @class */ (function (_super) { - __extends(Reshape, _super); - function Reshape(args) { - var _this = _super.call(this, args) || this; - _this.targetShape = args.targetShape; - // Make sure that all unknown dimensions are represented as `null`. - for (var i = 0; i < _this.targetShape.length; ++i) { - if (_this.isUnknown(_this.targetShape[i])) { - _this.targetShape[i] = null; - } - } - return _this; - } - Reshape.prototype.isUnknown = function (dim) { - return dim < 0 || dim == null; - }; - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - Reshape.prototype.fixUnknownDimension = function (inputShape, outputShape) { - var errorMsg = 'Total size of new array must be unchanged.'; - var finalShape = outputShape.slice(); - var known = 1; - var unknown = null; - for (var i = 0; i < finalShape.length; ++i) { - var dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } - else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } - else { - known *= dim; - } - } - var originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } - else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - return finalShape; - }; - Reshape.prototype.computeOutputShape = function (inputShape) { - var anyUnknownDims = false; - for (var i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } - else { - return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - }; - Reshape.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var outputShape = inputShape.slice(0, 1).concat(_this.fixUnknownDimension(inputShape.slice(1), _this.targetShape)); - return input.reshape(outputShape); - }); - }; - Reshape.prototype.getConfig = function () { - var config = { - targetShape: this.targetShape, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Reshape.className = 'Reshape'; - return Reshape; -}(Layer)); -tfc.serialization.registerClass(Reshape$1); -var Permute = /** @class */ (function (_super) { - __extends(Permute, _super); - function Permute(args) { - var _this = _super.call(this, args) || this; - if (args.dims == null) { - throw new Error('Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error('Permute constructor requires `dims` to be an Array, but received ' + - (args.dims + " instead.")); - } - // Check the validity of the permutation indices. - var expectedSortedIndices = range(1, args.dims.length + 1); - if (!tfc.util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error('Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - _this.dims = args.dims; - _this.dimsIncludingBatch = [0].concat(_this.dims); - _this.inputSpec = [new InputSpec({ ndim: _this.dims.length + 1 })]; - return _this; - } - Permute.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var outputShape = inputShape.slice(); - this.dims.forEach(function (dim, i) { - outputShape[i + 1] = inputShape[dim]; - }); - return outputShape; - }; - Permute.prototype.call = function (inputs, kwargs) { - return tfc.transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - }; - Permute.prototype.getConfig = function () { - var config = { - dims: this.dims, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Permute.className = 'Permute'; - return Permute; -}(Layer)); -tfc.serialization.registerClass(Permute); -var Masking = /** @class */ (function (_super) { - __extends(Masking, _super); - function Masking(args) { - var _this = _super.call(this, args == null ? {} : args) || this; - _this.supportsMasking = true; - if (args != null) { - _this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } - else { - _this.maskValue = 0; - } - return _this; - } - Masking.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - Masking.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { maskValue: this.maskValue }; - Object.assign(config, baseConfig); - return config; - }; - Masking.prototype.computeMask = function (inputs, mask) { - var input = getExactlyOneTensor(inputs); - var axis = -1; - return tfc.any(tfc.notEqual(input, this.maskValue), axis); - }; - Masking.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var axis = -1; - var keepDims = true; - var booleanMask = tfc.any(tfc.notEqual(input, _this.maskValue), axis, keepDims); - var output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - }; - /** @nocollapse */ - Masking.className = 'Masking'; - return Masking; -}(Layer)); -tfc.serialization.registerClass(Masking); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var Embedding = /** @class */ (function (_super) { - __extends(Embedding, _super); - function Embedding(args) { - var _this = _super.call(this, args) || this; - _this.embeddings = null; - _this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - var batchSize = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - _this.batchInputShape = [batchSize, null]; - } - else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - _this.batchInputShape = - [batchSize].concat(toList(args.inputLength)); - } - } - _this.inputDim = args.inputDim; - assertPositiveInteger(_this.inputDim, 'inputDim'); - _this.outputDim = args.outputDim; - assertPositiveInteger(_this.outputDim, 'outputDim'); - _this.embeddingsInitializer = getInitializer(args.embeddingsInitializer || _this.DEFAULT_EMBEDDINGS_INITIALIZER); - _this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - _this.activityRegularizer = getRegularizer(args.activityRegularizer); - _this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - _this.maskZero = args.maskZero; - _this.supportsMasking = args.maskZero; - _this.inputLength = args.inputLength; - return _this; - } - Embedding.prototype.build = function (inputShape) { - this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); - this.built = true; - }; - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - Embedding.prototype.warnOnIncompatibleInputShape = function (inputShape) { }; - Embedding.prototype.computeMask = function (inputs, mask) { - var _this = this; - return tfc.tidy(function () { - if (!_this.maskZero) { - return null; - } - else { - inputs = getExactlyOneTensor(inputs); - return tfc.notEqual(inputs, tfc.zerosLike(inputs)); - } - }); - }; - Embedding.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return inputShape.concat([this.outputDim]); - } - // inputLength can be an array if input is 3D or higher. - var inLens = toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + - ("input shape has shape " + inputShape)); - } - else { - var i = 0; - for (var k = 0; k < inLens.length; ++k) { - var s1 = inLens[k]; - var s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + - ("input shape has shape " + inputShape)); - } - else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0]].concat(inLens, [this.outputDim]); - }; - Embedding.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - var input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = cast$1(input, 'int32'); - } - var output = gather$1(_this.embeddings.read(), input.as1D()); - return output.reshape(getExactlyOneShape(_this.computeOutputShape(input.shape))); - }); - }; - Embedding.prototype.getConfig = function () { - var config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Embedding.className = 'Embedding'; - return Embedding; -}(Layer)); -tfc.serialization.registerClass(Embedding); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ -var Merge = /** @class */ (function (_super) { - __extends(Merge, _super); - function Merge(args) { - var _this = _super.call(this, args || {}) || this; - _this.supportsMasking = true; - return _this; - } - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - Merge.prototype.mergeFunction = function (inputs) { - throw new NotImplementedError(); - }; - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - Merge.prototype.computeElementwiseOpOutputShape = function (shape1, shape2) { - if (shape1 == null || shape2 == null) { - return null; - } - else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } - else if (shape2.length === 0) { - return shape1; - } - var outputShape = shape1.slice(0, shape1.length - shape2.length); - for (var k = 0; k < shape2.length; ++k) { - var i = shape1[shape1.length - shape2.length + k]; - var j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } - else if (i === 1) { - outputShape.push(j); - } - else if (j === 1) { - outputShape.push(i); - } - else { - if (i !== j) { - throw new ValueError('Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - }; - Merge.prototype.build = function (inputShape) { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape; - if (inputShape.length < 2) { - throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + - (" Got " + inputShape.length + " input(s).")); - } - // Make sure that there is at most one unique batch size among the input - // shapes. - var batchSizes = []; - for (var _i = 0, inputShape_1 = inputShape; _i < inputShape_1.length; _i++) { - var shape = inputShape_1[_i]; - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError("Can not merge tensors with different batch sizes. " + - ("Got tensors with shapes: " + JSON.stringify(inputShape) + ".")); - } - var outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); - for (var i = 1; i < inputShape.length; ++i) { - var shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - var allRanks = inputShape.map(function (shape) { return shape.length; }); - if (inputShape.indexOf(null) === -1 && - unique$1(allRanks).length === 1) { - this.reshapeRequired = false; - } - else { - this.reshapeRequired = true; - } - }; - Merge.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - inputs = inputs; - if (_this.reshapeRequired) { - var reshapedInputs = []; - var inputDims = inputs.map(function (input) { return input.rank; }); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - var maxNDim = max$1(inputDims); - for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { - var x = inputs_1[_i]; - var xNDim = x.rank; - for (var k = 0; k < maxNDim - xNDim; ++k) { - x = expandDims$1(x, 1); - } - reshapedInputs.push(x); - } - return _this.mergeFunction(reshapedInputs); - } - else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - var transposed = false; - for (var _a = 0, inputs_2 = inputs; _a < inputs_2.length; _a++) { - var x = inputs_2[_a]; - var xNDim = x.rank; - if (xNDim == null) { - var xShape = x.shape; - var batchSize = xShape[0]; - var newShape = xShape.slice(1).concat([batchSize]); - var xTransposed = x.reshape([batchSize].concat(arrayProd(xShape.slice(1)))); - xTransposed = tfc.transpose(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } - else if (xNDim > 1) { - var dims = range(1, xNDim).concat([0]); - reshapedInputs.push(tfc.transpose(x, dims)); - transposed = true; - } - else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - var y = _this.mergeFunction(reshapedInputs); - var yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - var yShape = y.shape; - var yNDim_1 = yShape.length; - var batchSize = yShape[yNDim_1 - 1]; - var newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } - else if (yNDim > 1) { - var dims = [yNDim - 1].concat(range(0, yNDim - 1)); - y = tfc.transpose(y, dims); - } - } - return y; - } - } - else { - return _this.mergeFunction(inputs); - } - }); - }; - Merge.prototype.computeOutputShape = function (inputShape) { - inputShape = inputShape; - var outputShape; - if (inputShape[0] == null) { - outputShape = null; - } - else { - outputShape = inputShape[0].slice(1); - } - for (var i = 1; i < inputShape.length; ++i) { - var shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - var batchSizes = []; - for (var _i = 0, inputShape_2 = inputShape; _i < inputShape_2.length; _i++) { - var shape = inputShape_2[_i]; - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = unique$1(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } - else { - outputShape = [null].concat(outputShape); - } - return outputShape; - }; - Merge.prototype.computeMask = function (inputs, mask) { - return tfc.tidy(function () { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError("The Array 'inputs' and 'mask' are expected to have the same " + - "length, but have different lengths " + - ("(" + inputs.length + " vs " + mask.length + ")")); - } - if (mask.every(function (m) { return m == null; })) { - return null; - } - mask = mask.map(function (m) { return m == null ? m : tfc.expandDims(m, 0); }); - var output = mask[0]; - for (var i = 1; i < mask.length - 1; ++i) { - output = tfc.logicalAnd(output, mask[i]); - } - return output; - }); - }; - return Merge; -}(Layer)); -var Add$1 = /** @class */ (function (_super) { - __extends(Add, _super); - function Add(args) { - return _super.call(this, args) || this; - } - Add.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Add.className = 'Add'; - return Add; -}(Merge)); -tfc.serialization.registerClass(Add$1); -var Multiply$1 = /** @class */ (function (_super) { - __extends(Multiply, _super); - function Multiply(args) { - return _super.call(this, args) || this; - } - Multiply.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.mul(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Multiply.className = 'Multiply'; - return Multiply; -}(Merge)); -tfc.serialization.registerClass(Multiply$1); -var Average = /** @class */ (function (_super) { - __extends(Average, _super); - function Average(args) { - return _super.call(this, args) || this; - } - Average.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0].clone(); - for (var i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return tfc.mul(1 / inputs.length, output); - }); - }; - /** @nocollapse */ - Average.className = 'Average'; - return Average; -}(Merge)); -tfc.serialization.registerClass(Average); -var Maximum$1 = /** @class */ (function (_super) { - __extends(Maximum, _super); - function Maximum(args) { - return _super.call(this, args) || this; - } - Maximum.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0]; - for (var i = 1; i < inputs.length; ++i) { - output = tfc.maximum(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Maximum.className = 'Maximum'; - return Maximum; -}(Merge)); -tfc.serialization.registerClass(Maximum$1); -var Minimum$1 = /** @class */ (function (_super) { - __extends(Minimum, _super); - function Minimum(args) { - return _super.call(this, args) || this; - } - Minimum.prototype.mergeFunction = function (inputs) { - return tfc.tidy(function () { - var output = inputs[0]; - for (var i = 1; i < inputs.length; ++i) { - output = tfc.minimum(output, inputs[i]); - } - return output; - }); - }; - /** @nocollapse */ - Minimum.className = 'Minimum'; - return Minimum; -}(Merge)); -tfc.serialization.registerClass(Minimum$1); -var Concatenate = /** @class */ (function (_super) { - __extends(Concatenate, _super); - function Concatenate(args) { - var _this = _super.call(this, args) || this; - _this.DEFAULT_AXIS = -1; - if (args == null) { - args = {}; - } - _this.axis = args.axis == null ? _this.DEFAULT_AXIS : args.axis; - _this.supportsMasking = true; - _this.reshapeRequired = false; - return _this; - } - Concatenate.prototype.build = function (inputShape) { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape; - var allNoneShape = true; - for (var _i = 0, inputShape_3 = inputShape; _i < inputShape_3.length; _i++) { - var shape = inputShape_3[_i]; - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - var shapeSet = []; - for (var i = 0; i < inputShape.length; ++i) { - var shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - var exists = false; - for (var _a = 0, shapeSet_1 = shapeSet; _a < shapeSet_1.length; _a++) { - var shape = shapeSet_1[_a]; - if (tfc.util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - }; - Concatenate.prototype.mergeFunction = function (inputs) { - var _this = this; - return tfc.tidy(function () { - return concatenate(inputs, _this.axis); - }); - }; - Concatenate.prototype.computeOutputShape = function (inputShape) { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); - } - var inputShapes = inputShape; - var outputShape = inputShapes[0].slice(); - var axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (var _i = 0, _a = inputShapes.slice(1); _i < _a.length; _i++) { - var shape = _a[_i]; - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - }; - Concatenate.prototype.computeMask = function (inputs, mask) { - var _this = this; - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError("Mismatch in the length of mask (" + mask.length + ") " + - ("and the legnth of inputs (" + inputs.length + ")")); - } - return tfc.tidy(function () { - var allNullMasks = true; - mask.forEach(function (m) { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - var outputMasks = []; - for (var i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(tfc.onesLike(inputs[i]).asType('bool')); - } - else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(tfc.expandDims(mask[i], -1)); - } - else { - outputMasks.push(mask[i]); - } - } - var concatenatedMasks = tfc.concat(outputMasks, _this.axis); - return tfc.all(concatenatedMasks, -1, false); - }); - }; - Concatenate.prototype.getConfig = function () { - var config = { - 'axis': this.axis, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Concatenate.className = 'Concatenate'; - return Concatenate; -}(Merge)); -tfc.serialization.registerClass(Concatenate); -/** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ -function interpretAxis(axis, dim) { - while (axis < 0) { - axis += dim; - } - return axis; -} -function batchDot(x, y, axes) { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError('batchDot is not implemented for tensors of 4D or higher rank yet'); - } - tfc.util.assert(x.shape.length >= 2, function () { return "batchDot requires the rank of x to be >= 2, " + - ("but got " + x.shape.length); }); - tfc.util.assert(x.shape.length >= 2, function () { return "batchDot requires the rank of y to be >= 2, " + - ("but got " + y.shape.length); }); - if (typeof axes === 'number') { - axes = [axes, axes]; - } - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError('batchDot is not implemented for complex64-type Tensors yet.'); - } - var xNDim = x.shape.length; - var yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - var axesArray = axes; - return tfc.tidy(function () { - var diff; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - var diffShape = []; - for (var i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } - else if (yNDim > xNDim) { - diff = yNDim - xNDim; - var diffShape = []; - for (var i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } - else { - diff = 0; - } - var out; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } - else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } - else { - var adjX = axesArray[0] !== x.shape.length - 1; - var adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - if (diff > 0) { - var idx = void 0; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } - else { - idx = xNDim - 1; - } - var squeezeAxes = []; - for (var i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); -} -var Dot = /** @class */ (function (_super) { - __extends(Dot, _super); - function Dot(args) { - var _this = _super.call(this, args) || this; - _this.axes = args.axes; - _this.normalize = args.normalize == null ? false : args.normalize; - _this.supportsMasking = true; - _this.reshapeRequired = false; - return _this; - } - Dot.prototype.build = function (inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), function () { return 'A `Dot` layer should be called on a list of exactly 2 inputs.'; }); - var shape1 = inputShape[0]; - var shape2 = inputShape[1]; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - var axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError("Dimension incompatibility: " + - (shape1[axes[0]] + " !== " + shape2[axes[1]])); - } - }; - Dot.prototype.mergeFunction = function (inputs) { - if (inputs.length !== 2) { - throw new ValueError('A `Dot` layer must be called on exactly 2 inputs, ' + - ("but received " + inputs.length + " input(s).")); - } - var x1 = inputs[0]; - var x2 = inputs[1]; - var axes; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } - else { - axes = this.axes.map(function (axis, i) { return interpretAxis(axis, inputs[i].shape.length); }); - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - }; - Dot.prototype.interpretAxes = function (shape1, shape2) { - var axes; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } - else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - }; - Dot.prototype.computeOutputShape = function (inputShape) { - tfc.util.assert(Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), function () { return 'A `Dot` layer should be called on a list of exactly 2 inputs.'; }); - var shape1 = inputShape[0].slice(); - var shape2 = inputShape[1].slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError('Dot layer does not support tensors of 4D or higher rank yet.'); - } - var axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - var outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - }; - Dot.prototype.computeMask = function (inputs, mask) { - return null; - }; - Dot.prototype.getConfig = function () { - var config = { - 'axes': this.axes, - 'normalize': this.normalize - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Dot.className = 'Dot'; - return Dot; -}(Merge)); -tfc.serialization.registerClass(Dot); -// TODO(cais): Add functional interfaces for the merge layers. - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var GaussianNoise = /** @class */ (function (_super) { - __extends(GaussianNoise, _super); - function GaussianNoise(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.stddev = args.stddev; - return _this; - } - GaussianNoise.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - GaussianNoise.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { stddev: this.stddev }; - Object.assign(config, baseConfig); - return config; - }; - GaussianNoise.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - var noised = function () { - return randomNormal(input.shape, 0, _this.stddev).add(input); - }; - var output = inTrainPhase(noised, function () { return input; }, kwargs['training'] || false); - return output; - }); - }; - /** @nocollapse */ - GaussianNoise.className = 'GaussianNoise'; - return GaussianNoise; -}(Layer)); -tfc.serialization.registerClass(GaussianNoise); -var GaussianDropout = /** @class */ (function (_super) { - __extends(GaussianDropout, _super); - function GaussianDropout(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.rate = args.rate; - return _this; - } - GaussianDropout.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - GaussianDropout.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - }; - GaussianDropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - var input = getExactlyOneTensor(inputs); - if (_this.rate > 0 && _this.rate < 1) { - var noised = function () { - var stddev = Math.sqrt(_this.rate / (1 - _this.rate)); - return input.mul(randomNormal(input.shape, 1, stddev)); - }; - return inTrainPhase(noised, function () { return input; }, kwargs['training'] || false); - } - return input; - }); - }; - /** @nocollapse */ - GaussianDropout.className = 'GaussianDropout'; - return GaussianDropout; -}(Layer)); -tfc.serialization.registerClass(GaussianDropout); -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ -var AlphaDropout = /** @class */ (function (_super) { - __extends(AlphaDropout, _super); - function AlphaDropout(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.rate = args.rate; - _this.noiseShape = args.noiseShape; - return _this; - } - AlphaDropout.prototype._getNoiseShape = function (inputs) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - }; - AlphaDropout.prototype.computeOutputShape = function (inputShape) { - return inputShape; - }; - AlphaDropout.prototype.getConfig = function () { - var baseConfig = _super.prototype.getConfig.call(this); - var config = { rate: this.rate }; - Object.assign(config, baseConfig); - return config; - }; - AlphaDropout.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - if (_this.rate < 1 && _this.rate > 0) { - var noiseShape_1 = _this._getNoiseShape(inputs); - var droppedInputs = function () { - var input = getExactlyOneTensor(inputs); - var alpha = 1.6732632423543772848170429916717; - var scale = 1.0507009873554804934193349852946; - var alphaP = -alpha * scale; - var keptIdx = tfc.greaterEqual(tfc.randomUniform(noiseShape_1), _this.rate); - keptIdx = cast$1(keptIdx, 'float32'); // get default dtype. - // Get affine transformation params. - var a = Math.pow(((1 - _this.rate) * (1 + _this.rate * Math.pow(alphaP, 2))), -0.5); - var b = -a * alphaP * _this.rate; - // Apply mask. - var x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - return x.mul(a).add(b); - }; - return inTrainPhase(droppedInputs, function () { return getExactlyOneTensor(inputs); }, kwargs['training'] || false); - } - return inputs; - }); - }; - /** @nocollapse */ - AlphaDropout.className = 'AlphaDropout'; - return AlphaDropout; -}(Layer)); -tfc.serialization.registerClass(AlphaDropout); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ -function batchNormalization(x, mean, variance, beta, gamma, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - var out; - if (x.rank === 2) { - out = tfc.batchNorm2d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = tfc.batchNorm3d(x, mean, variance, beta, gamma, epsilon); - } - else if (x.rank === 4) { - out = tfc.batchNorm4d(x, mean, variance, beta, gamma, epsilon); - } - else { - throw new NotImplementedError("batchNormalization is not implemented for array of rank " + x.rank + " " + - "yet"); - } - return out; -} -/** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - return tfc.tidy(function () { - var meanAndVariance = tfc.moments(x, reductionAxes); - var mean = meanAndVariance.mean; - var variance = meanAndVariance.variance; - var normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - return tfc.tidy(function () { - var meanAndVariance = tfc.moments(x, reductionAxes); - var mean = meanAndVariance.mean; - var variance = meanAndVariance.variance; - var targetShape = []; - for (var _i = 0, _a = range(0, x.rank); _i < _a.length; _i++) { - var axis = _a[_i]; - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } - else { - targetShape.push(x.shape[axis]); - } - } - var broadcastMean = mean.reshape(targetShape); - var broadcastVariance = variance.reshape(targetShape); - var broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); - var broadcastBeta = beta == null ? null : beta.reshape(targetShape); - var normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); - return [normed, mean, variance]; - }); -} -/** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { - if (epsilon === void 0) { epsilon = 1e-3; } - if (tfc.util.arraysEqual(reductionAxes.slice().sort(), range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } - else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); - } -} -var BatchNormalization = /** @class */ (function (_super) { - __extends(BatchNormalization, _super); - function BatchNormalization(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.supportsMasking = true; - _this.axis = args.axis == null ? -1 : args.axis; - _this.momentum = args.momentum == null ? 0.99 : args.momentum; - _this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - _this.center = args.center == null ? true : args.center; - _this.scale = args.scale == null ? true : args.scale; - _this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - _this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - _this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - _this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - _this.betaConstraint = getConstraint(args.betaConstraint); - _this.gammaConstraint = getConstraint(args.gammaConstraint); - _this.betaRegularizer = getRegularizer(args.betaRegularizer); - _this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - return _this; - } - BatchNormalization.prototype.build = function (inputShape) { - var _a; - inputShape = getExactlyOneShape(inputShape); - var axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - var dim = inputShape[axis]; - if (dim == null) { - throw new ValueError("Axis " + axis + " of input tensor should have a defined dimension but " + - "the layer received an input with shape " + - (JSON.stringify(inputShape) + ".")); - } - this.inputSpec = - [new InputSpec({ ndim: inputShape.length, axes: (_a = {}, _a[axis] = dim, _a) })]; - var shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); - } - this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); - this.built = true; - }; - BatchNormalization.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var training = kwargs['training'] == null ? false : kwargs['training']; - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var ndim = inputShape.length; - var reductionAxes = range(0, ndim); - var axis = _this.axis >= 0 ? _this.axis : (_this.axis + ndim); - reductionAxes.splice(axis, 1); - var broadcastShape = pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - var sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - var needsBroadcasting = !tfc.util.arraysEqual(sortedReductionAxes, range(0, ndim).slice(0, ndim - 1)); - var normalizeInference = function () { - if (needsBroadcasting) { - var broadcastMovingMean = _this.movingMean.read().reshape(broadcastShape); - var broadcastMovingVariance = _this.movingVariance.read().reshape(broadcastShape); - var broadcastBeta = _this.center ? _this.beta.read().reshape(broadcastShape) : null; - var broadcastGamma = _this.scale ? _this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, _this.epsilon); - } - else { - return batchNormalization(input, _this.movingMean.read(), _this.movingVariance.read(), _this.beta == null ? null : _this.beta.read(), _this.gamma == null ? null : _this.gamma.read(), _this.epsilon); - } - }; - if (!training) { - return normalizeInference(); - } - var _a = normalizeBatchInTraining(input, _this.gamma.read(), _this.beta.read(), reductionAxes, _this.epsilon), normedTraining = _a[0], mean = _a[1], variance = _a[2]; - var doMovingAverage = function (variable, value, momentum) { - tfc.tidy(function () { - var decay = 1 - momentum; - var origValue = variable.read(); - var updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - var updateMovingMeanAndVariance = function () { - doMovingAverage(_this.movingMean, mean, _this.momentum); - doMovingAverage(_this.movingVariance, variance, _this.momentum); - }; - updateMovingMeanAndVariance(); - return normedTraining; - }); - }; - BatchNormalization.prototype.getConfig = function () { - var config = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - BatchNormalization.className = 'BatchNormalization'; - return BatchNormalization; -}(Layer)); -tfc.serialization.registerClass(BatchNormalization); -var LayerNormalization = /** @class */ (function (_super) { - __extends(LayerNormalization, _super); - function LayerNormalization(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.axis = args.axis == null ? -1 : args.axis; - if (typeof _this.axis === 'number') { - if (!Number.isInteger(_this.axis)) { - throw new Error("Expected axis to be an integer, but received " + _this.axis); - } - } - else if (Array.isArray(_this.axis)) { - for (var _i = 0, _a = _this.axis; _i < _a.length; _i++) { - var axis = _a[_i]; - if (!Number.isInteger(axis)) { - throw new Error("Expected axis to be an array of integers, " + - ("but received " + JSON.stringify(_this.axis))); - } - } - } - else { - throw new Error("Expected axis to be an integer or an array of integers, " + - ("but received " + JSON.stringify(_this.axis))); - } - _this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - _this.center = args.center == null ? true : args.center; - _this.scale = args.scale == null ? true : args.scale; - _this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - _this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - _this.betaRegularizer = getRegularizer(args.betaRegularizer); - _this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - _this.supportsMasking = true; - return _this; - } - LayerNormalization.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var nDims = inputShape.length; - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (var i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - // Further validate axes. - for (var _i = 0, _a = this.axis; _i < _a.length; _i++) { - var axis = _a[_i]; - if (axis < 0 || axis >= nDims) { - throw new Error("Invalid axis: " + axis); - } - } - if (this.axis.length !== unique$1(this.axis).length) { - throw new Error("Found duplicate axes in: " + this.axis); - } - var paramShape = this.axis.map(function (axis) { return inputShape[axis]; }); - var trainable = true; - if (this.scale) { - this.gamma = this.addWeight('gamma', paramShape, 'float32', this.gammaInitializer, this.gammaRegularizer, trainable); - } - else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight('beta', paramShape, 'float32', this.betaInitializer, this.betaRegularizer, trainable); - } - else { - this.beta = null; - } - this.built = true; - }; - LayerNormalization.prototype.call = function (inputs, kwargs) { - var _this = this; - var input = getExactlyOneTensor(inputs); - var inputShape = input.shape; - var nDims = inputShape.length; - return tfc.tidy(function () { - var keepDims = true; - var _a = tfc.moments(input, _this.axis, keepDims), mean = _a.mean, variance = _a.variance; - var broadcastShape = pyListRepeat(1, nDims); - for (var _i = 0, _b = _this.axis; _i < _b.length; _i++) { - var dim = _b[_i]; - broadcastShape[dim] = inputShape[dim]; - } - var broadcast = function (v) { - if (v != null && v.shape.length !== nDims && - _this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } - else { - return v; - } - }; - var scale = broadcast(_this.gamma.read()); - var offset = broadcast(_this.beta.read()); - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - var momentsTiling = []; - var scaleOffsetTiling = []; - for (var i = 0; i < nDims; ++i) { - if (_this.axis.indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } - else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - return batchNormalization(input, mean, variance, offset, scale, _this.epsilon); - }); - }; - LayerNormalization.prototype.getConfig = function () { - var config = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - LayerNormalization.className = 'LayerNormalization'; - return LayerNormalization; -}(Layer)); -tfc.serialization.registerClass(LayerNormalization); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ -function spatial2dPadding(x, padding, dataFormat) { - return tfc.tidy(function () { - if (x.rank !== 4) { - throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a " + - (x.rank + "-D tensor.")); - } - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError("Unknown data format: " + dataFormat + ". " + - "Supported data formats are 'channelsLast' and 'channelsFirst."); - } - var pattern; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } - else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - return tfc.pad(x, pattern); - }); -} -var ZeroPadding2D = /** @class */ (function (_super) { - __extends(ZeroPadding2D, _super); - function ZeroPadding2D(args) { - var _this = this; - if (args == null) { - args = {}; - } - _this = _super.call(this, args) || this; - _this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - _this.padding = [[1, 1], [1, 1]]; - } - else if (typeof args.padding === 'number') { - _this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } - else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but " + - ("received a length-" + args.padding.length + " array.")); - } - var heightPadding = void 0; - var widthPadding = void 0; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1], args.padding[1]]; - } - else { - args.padding = args.padding; - if (args.padding[0].length !== 2) { - throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, " + - ("but received a length-" + args.padding[0].length + " array.")); - } - heightPadding = args.padding[0]; - if (args.padding[1].length !== 2) { - throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, " + - ("but received a length-" + args.padding[1].length + " array.")); - } - widthPadding = args.padding[1]; - } - _this.padding = [heightPadding, widthPadding]; - } - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - ZeroPadding2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows; - var cols; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } - else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } - else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - }; - ZeroPadding2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { return spatial2dPadding(getExactlyOneTensor(inputs), _this.padding, _this.dataFormat); }); - }; - ZeroPadding2D.prototype.getConfig = function () { - var config = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - ZeroPadding2D.className = 'ZeroPadding2D'; - return ZeroPadding2D; -}(Layer)); -tfc.serialization.registerClass(ZeroPadding2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ -function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - var y; - var paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = tfc.maxPool(x, poolSize, strides, paddingString); - } - else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = tfc.avgPool( - // TODO(cais): Rank check? - x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); -} -/** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ -function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { - return tfc.tidy(function () { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x, dataFormat); - var y; - var paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = tfc.maxPool3d(x, poolSize, strides, paddingString); - } - else { // 'avg' - y = tfc.avgPool3d(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); -} -/** - * Abstract class for different pooling 1D layers. - */ -var Pooling1D = /** @class */ (function (_super) { - __extends(Pooling1D, _super); - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - function Pooling1D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = 2; - } - _this = _super.call(this, args) || this; - if (typeof args.poolSize === 'number') { - _this.poolSize = [args.poolSize]; - } - else if (Array.isArray(args.poolSize) && - args.poolSize.length === 1 && - typeof args.poolSize[0] === 'number') { - _this.poolSize = args.poolSize; - } - else { - throw new ValueError("poolSize for 1D convolutional layer must be a number or an " + - "Array of a single number, but received " + - ("" + JSON.stringify(args.poolSize))); - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else { - if (typeof args.strides === 'number') { - _this.strides = [args.strides]; - } - else if (Array.isArray(args.strides) && - args.strides.length === 1 && - typeof args.strides[0] === 'number') { - _this.strides = args.strides; - } - else { - throw new ValueError("strides for 1D convolutional layer must be a number or an " + - "Array of a single number, but received " + - ("" + JSON.stringify(args.strides))); - } - } - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - return _this; - } - Pooling1D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - }; - Pooling1D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = expandDims$1(getExactlyOneTensor(inputs), 2); - var output = _this.poolingFunction(getExactlyOneTensor(inputs), [_this.poolSize[0], 1], [_this.strides[0], 1], _this.padding, 'channelsLast'); - // Remove dummy last dimension. - return tfc.squeeze(output, [2]); - }); - }; - Pooling1D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling1D; -}(Layer)); -var MaxPooling1D = /** @class */ (function (_super) { - __extends(MaxPooling1D, _super); - function MaxPooling1D(args) { - return _super.call(this, args) || this; - } - MaxPooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling1D.className = 'MaxPooling1D'; - return MaxPooling1D; -}(Pooling1D)); -tfc.serialization.registerClass(MaxPooling1D); -var AveragePooling1D = /** @class */ (function (_super) { - __extends(AveragePooling1D, _super); - function AveragePooling1D(args) { - return _super.call(this, args) || this; - } - AveragePooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling1D.className = 'AveragePooling1D'; - return AveragePooling1D; -}(Pooling1D)); -tfc.serialization.registerClass(AveragePooling1D); -/** - * Abstract class for different pooling 2D layers. - */ -var Pooling2D = /** @class */ (function (_super) { - __extends(Pooling2D, _super); - function Pooling2D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - _this = _super.call(this, args) || this; - _this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError("If the strides property of a 2D pooling layer is an Array, " + - "it is expected to have a length of 2, but received length " + - (args.strides.length + ".")); - } - _this.strides = args.strides; - } - else { - // `config.strides` is a number. - _this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - Pooling2D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } - else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - }; - Pooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - return _this.poolingFunction(getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); - }); - }; - Pooling2D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling2D; -}(Layer)); -var MaxPooling2D = /** @class */ (function (_super) { - __extends(MaxPooling2D, _super); - function MaxPooling2D(args) { - return _super.call(this, args) || this; - } - MaxPooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling2D.className = 'MaxPooling2D'; - return MaxPooling2D; -}(Pooling2D)); -tfc.serialization.registerClass(MaxPooling2D); -var AveragePooling2D = /** @class */ (function (_super) { - __extends(AveragePooling2D, _super); - function AveragePooling2D(args) { - return _super.call(this, args) || this; - } - AveragePooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling2D.className = 'AveragePooling2D'; - return AveragePooling2D; -}(Pooling2D)); -tfc.serialization.registerClass(AveragePooling2D); -/** - * Abstract class for different pooling 3D layers. - */ -var Pooling3D = /** @class */ (function (_super) { - __extends(Pooling3D, _super); - function Pooling3D(args) { - var _this = this; - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - _this = _super.call(this, args) || this; - _this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - _this.strides = _this.poolSize; - } - else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError("If the strides property of a 3D pooling layer is an Array, " + - "it is expected to have a length of 3, but received length " + - (args.strides.length + ".")); - } - _this.strides = args.strides; - } - else { - // `config.strides` is a number. - _this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(_this.poolSize, 'poolSize'); - assertPositiveInteger(_this.strides, 'strides'); - _this.padding = args.padding == null ? 'valid' : args.padding; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - checkPaddingMode(_this.padding); - _this.inputSpec = [new InputSpec({ ndim: 5 })]; - return _this; - } - Pooling3D.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var depths = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - var rows = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - var cols = this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength(depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } - else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - }; - Pooling3D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - _this.invokeCallHook(inputs, kwargs); - return _this.poolingFunction(getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); - }); - }; - Pooling3D.prototype.getConfig = function () { - var config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return Pooling3D; -}(Layer)); -var MaxPooling3D = /** @class */ (function (_super) { - __extends(MaxPooling3D, _super); - function MaxPooling3D(args) { - return _super.call(this, args) || this; - } - MaxPooling3D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'max'); - }; - /** @nocollapse */ - MaxPooling3D.className = 'MaxPooling3D'; - return MaxPooling3D; -}(Pooling3D)); -tfc.serialization.registerClass(MaxPooling3D); -var AveragePooling3D = /** @class */ (function (_super) { - __extends(AveragePooling3D, _super); - function AveragePooling3D(args) { - return _super.call(this, args) || this; - } - AveragePooling3D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - }; - /** @nocollapse */ - AveragePooling3D.className = 'AveragePooling3D'; - return AveragePooling3D; -}(Pooling3D)); -tfc.serialization.registerClass(AveragePooling3D); -/** - * Abstract class for different global pooling 1D layers. - */ -var GlobalPooling1D = /** @class */ (function (_super) { - __extends(GlobalPooling1D, _super); - function GlobalPooling1D(args) { - var _this = _super.call(this, args) || this; - _this.inputSpec = [new InputSpec({ ndim: 3 })]; - return _this; - } - GlobalPooling1D.prototype.computeOutputShape = function (inputShape) { - return [inputShape[0], inputShape[2]]; - }; - GlobalPooling1D.prototype.call = function (inputs, kwargs) { - throw new NotImplementedError(); - }; - return GlobalPooling1D; -}(Layer)); -var GlobalAveragePooling1D = /** @class */ (function (_super) { - __extends(GlobalAveragePooling1D, _super); - function GlobalAveragePooling1D(args) { - return _super.call(this, args || {}) || this; - } - GlobalAveragePooling1D.prototype.call = function (inputs, kwargs) { - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - return tfc.mean(input, 1); - }); - }; - /** @nocollapse */ - GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; - return GlobalAveragePooling1D; -}(GlobalPooling1D)); -tfc.serialization.registerClass(GlobalAveragePooling1D); -var GlobalMaxPooling1D = /** @class */ (function (_super) { - __extends(GlobalMaxPooling1D, _super); - function GlobalMaxPooling1D(args) { - return _super.call(this, args || {}) || this; - } - GlobalMaxPooling1D.prototype.call = function (inputs, kwargs) { - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - return tfc.max(input, 1); - }); - }; - /** @nocollapse */ - GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; - return GlobalMaxPooling1D; -}(GlobalPooling1D)); -tfc.serialization.registerClass(GlobalMaxPooling1D); -/** - * Abstract class for different global pooling 2D layers. - */ -var GlobalPooling2D = /** @class */ (function (_super) { - __extends(GlobalPooling2D, _super); - function GlobalPooling2D(args) { - var _this = _super.call(this, args) || this; - _this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(_this.dataFormat); - _this.inputSpec = [new InputSpec({ ndim: 4 })]; - return _this; - } - GlobalPooling2D.prototype.computeOutputShape = function (inputShape) { - inputShape = inputShape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } - else { - return [inputShape[0], inputShape[1]]; - } - }; - GlobalPooling2D.prototype.call = function (inputs, kwargs) { - throw new NotImplementedError(); - }; - GlobalPooling2D.prototype.getConfig = function () { - var config = { dataFormat: this.dataFormat }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - return GlobalPooling2D; -}(Layer)); -var GlobalAveragePooling2D = /** @class */ (function (_super) { - __extends(GlobalAveragePooling2D, _super); - function GlobalAveragePooling2D() { - return _super !== null && _super.apply(this, arguments) || this; - } - GlobalAveragePooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - return tfc.mean(input, [1, 2]); - } - else { - return tfc.mean(input, [2, 3]); - } - }); - }; - /** @nocollapse */ - GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; - return GlobalAveragePooling2D; -}(GlobalPooling2D)); -tfc.serialization.registerClass(GlobalAveragePooling2D); -var GlobalMaxPooling2D = /** @class */ (function (_super) { - __extends(GlobalMaxPooling2D, _super); - function GlobalMaxPooling2D() { - return _super !== null && _super.apply(this, arguments) || this; - } - GlobalMaxPooling2D.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var input = getExactlyOneTensor(inputs); - if (_this.dataFormat === 'channelsLast') { - return tfc.max(input, [1, 2]); - } - else { - return tfc.max(input, [2, 3]); - } - }); - }; - /** @nocollapse */ - GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; - return GlobalMaxPooling2D; -}(GlobalPooling2D)); -tfc.serialization.registerClass(GlobalMaxPooling2D); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ -var Wrapper = /** @class */ (function (_super) { - __extends(Wrapper, _super); - function Wrapper(args) { - var _this = - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - _super.call(this, args) || this; - _this.layer = args.layer; - return _this; - } - Wrapper.prototype.build = function (inputShape) { - this.built = true; - }; - Object.defineProperty(Wrapper.prototype, "trainable", { - // TODO(cais): Implement activityRegularizer getter. - get: function () { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } - else { - return false; - } - }, - set: function (value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "trainableWeights", { - get: function () { - return this.layer.trainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "nonTrainableWeights", { - // TODO(cais): Implement setter for trainableWeights. - get: function () { - return this.layer.nonTrainableWeights; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "updates", { - // TODO(cais): Implement setter for nonTrainableWeights. - get: function () { - // tslint:disable-next-line:no-any - return this.layer._updates; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Wrapper.prototype, "losses", { - // TODO(cais): Implement getUpdatesFor(). - get: function () { - return this.layer.losses; - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Implement getLossesFor(). - Wrapper.prototype.getWeights = function () { - return this.layer.getWeights(); - }; - Wrapper.prototype.setWeights = function (weights) { - this.layer.setWeights(weights); - }; - Wrapper.prototype.getConfig = function () { - var config = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - Wrapper.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - }; - /** @nocollapse */ - Wrapper.fromConfig = function (cls, config, customObjects) { - if (customObjects === void 0) { customObjects = {}; } - var layerConfig = config['layer']; - var layer = deserialize(layerConfig, customObjects); - delete config['layer']; - var newConfig = { layer: layer }; - Object.assign(newConfig, config); - return new cls(newConfig); - }; - return Wrapper; -}(Layer)); -var TimeDistributed = /** @class */ (function (_super) { - __extends(TimeDistributed, _super); - function TimeDistributed(args) { - var _this = _super.call(this, args) || this; - _this.supportsMasking = true; - return _this; - } - TimeDistributed.prototype.build = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError("TimeDistributed layer expects an input shape >= 3D, but received " + - ("input shape " + JSON.stringify(inputShape))); - } - this.inputSpec = [{ shape: inputShape }]; - var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - _super.prototype.build.call(this, inputShape); - }; - TimeDistributed.prototype.computeOutputShape = function (inputShape) { - inputShape = getExactlyOneShape(inputShape); - var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - var childOutputShape = this.layer.computeOutputShape(childInputShape); - var timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - }; - TimeDistributed.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - var step = function (inputs, states) { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - var output = getExactlyOneTensor(_this.layer.call(inputs, kwargs)); - return [output, []]; - }; - var rnnOutputs = rnn(step, inputs, [], false /* goBackwards */, null /* mask */, null /* constants */, false /* unroll */, true /* needPerStepOutputs */); - var y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - }; - /** @nocollapse */ - TimeDistributed.className = 'TimeDistributed'; - return TimeDistributed; -}(Wrapper)); -tfc.serialization.registerClass(TimeDistributed); -function checkBidirectionalMergeMode(value) { - checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); -} -var DEFAULT_BIDIRECTIONAL_MERGE_MODE = 'concat'; -var Bidirectional = /** @class */ (function (_super) { - __extends(Bidirectional, _super); - function Bidirectional(args) { - var _this = _super.call(this, args) || this; - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - var layerConfig = args.layer.getConfig(); - var forwDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - _this.forwardLayer = deserialize(forwDict); - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - var backDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - _this.backwardLayer = deserialize(backDict); - _this.forwardLayer.name = 'forward_' + _this.forwardLayer.name; - _this.backwardLayer.name = 'backward_' + _this.backwardLayer.name; - _this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(_this.mergeMode); - if (args.weights) { - throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); - } - _this._stateful = args.layer.stateful; - _this.returnSequences = args.layer.returnSequences; - _this.returnState = args.layer.returnState; - _this.supportsMasking = true; - _this._trainable = true; - _this.inputSpec = args.layer.inputSpec; - _this.numConstants = null; - return _this; - } - Object.defineProperty(Bidirectional.prototype, "trainable", { - get: function () { - return this._trainable; - }, - set: function (value) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - }, - enumerable: true, - configurable: true - }); - Bidirectional.prototype.getWeights = function () { - return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); - }; - Bidirectional.prototype.setWeights = function (weights) { - var numWeights = weights.length; - var numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - }; - Bidirectional.prototype.computeOutputShape = function (inputShape) { - var layerShapes = this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes]; - } - layerShapes = layerShapes; - var outputShape; - var outputShapes; - var stateShape; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } - else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } - else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } - else { - outputShapes = [outputShape]; - } - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return singletonOrArray(outputShapes); - }; - Bidirectional.prototype.apply = function (inputs, kwargs) { - var initialState = kwargs == null ? null : kwargs['initialState']; - var constants = kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - if (Array.isArray(inputs)) { - initialState = inputs.slice(1); - inputs = inputs[0]; - } - if ((initialState == null || initialState.length === 0) && - constants == null) { - return _super.prototype.apply.call(this, inputs, kwargs); - } - var additionalInputs = []; - var additionalSpecs = []; - if (initialState != null) { - var numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push.apply(additionalInputs, initialState); - var stateSpecs = initialState - .map(function (state) { return new InputSpec({ shape: state.shape }); }); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push.apply(additionalSpecs, stateSpecs); - } - if (constants != null) { - throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - var isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (var _i = 0, additionalInputs_1 = additionalInputs; _i < additionalInputs_1.length; _i++) { - var tensor = additionalInputs_1[_i]; - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError('The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - var fullInput = [inputs].concat(additionalInputs); - var fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - var originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - var output = _super.prototype.apply.call(this, fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } - else { - return _super.prototype.apply.call(this, inputs, kwargs); - } - }; - Bidirectional.prototype.call = function (inputs, kwargs) { - var _this = this; - return tfc.tidy(function () { - var initialState = kwargs['initialState']; - var y; - var yRev; - if (initialState == null) { - y = _this.forwardLayer.call(inputs, kwargs); - yRev = _this.backwardLayer.call(inputs, kwargs); - } - else { - var forwardState = initialState.slice(0, initialState.length / 2); - var backwardState = initialState.slice(initialState.length / 2); - y = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); - yRev = _this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); - } - var states; - if (_this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat(yRev.slice(1)); - } - y = y[0]; - yRev = yRev[0]; - } - if (_this.returnSequences) { - yRev = tfc.reverse(yRev, 1); - } - var output; - if (_this.mergeMode === 'concat') { - output = concatenate([y, yRev]); - } - else if (_this.mergeMode === 'sum') { - output = tfc.add(y, yRev); - } - else if (_this.mergeMode === 'ave') { - output = tfc.mul(.5, tfc.add(y, yRev)); - } - else if (_this.mergeMode === 'mul') { - output = tfc.mul(y, yRev); - } - else if (_this.mergeMode == null) { - output = [y, yRev]; - } - // TODO(cais): Properly set learning phase. - if (_this.returnState) { - if (_this.mergeMode == null) { - return output.concat(states); - } - return [output].concat(states); - } - return output; - }); - }; - Bidirectional.prototype.resetStates = function (states) { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - }; - Bidirectional.prototype.build = function (inputShape) { - var _this = this; - nameScope(this.forwardLayer.name, function () { - _this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, function () { - _this.backwardLayer.build(inputShape); - }); - this.built = true; - }; - Bidirectional.prototype.computeMask = function (inputs, mask) { - if (Array.isArray(mask)) { - mask = mask[0]; - } - var outputMask; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } - else { - outputMask = mask; - } - } - else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } - else { - outputMask = null; - } - } - if (this.returnState) { - var states = this.forwardLayer.states; - var stateMask = states.map(function (state) { return null; }); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } - else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } - else { - return outputMask; - } - }; - Object.defineProperty(Bidirectional.prototype, "trainableWeights", { - get: function () { - return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Bidirectional.prototype, "nonTrainableWeights", { - get: function () { - return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); - }, - enumerable: true, - configurable: true - }); - // TODO(cais): Implement constraints(). - Bidirectional.prototype.setFastWeightInitDuringBuild = function (value) { - _super.prototype.setFastWeightInitDuringBuild.call(this, value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - }; - Bidirectional.prototype.getConfig = function () { - var config = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - var baseConfig = _super.prototype.getConfig.call(this); - Object.assign(config, baseConfig); - return config; - }; - /** @nocollapse */ - Bidirectional.fromConfig = function (cls, config) { - var rnnLayer = deserialize(config['layer']); - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError("Deserialization of a Bidirectional layer with numConstants " + - "present is not supported yet."); - } - // tslint:disable-next-line:no-any - var newConfig = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - }; - /** @nocollapse */ - Bidirectional.className = 'Bidirectional'; - return Bidirectional; -}(Wrapper)); -tfc.serialization.registerClass(Bidirectional); - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). -// Input Layer. -/** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ -function inputLayer(args) { - return new InputLayer(args); -} -// Advanced Activation Layers. -/** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function elu$2(args) { - return new ELU(args); -} -/** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function reLU(args) { - return new ReLU(args); -} -/** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function leakyReLU(args) { - return new LeakyReLU(args); -} -/** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function prelu$1(args) { - return new PReLU(args); -} -/** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function softmax$1(args) { - return new Softmax$2(args); -} -/** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -function thresholdedReLU(args) { - return new ThresholdedReLU(args); -} -// Convolutional Layers. -/** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv1d$1(args) { - return new Conv1D(args); -} -/** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv2d$1(args) { - return new Conv2D$1(args); -} -/** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv2dTranspose$1(args) { - return new Conv2DTranspose(args); -} -/** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function conv3d(args) { - return new Conv3D$1(args); -} -function conv3dTranspose(args) { - return new Conv3DTranspose(args); -} -/** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function separableConv2d$1(args) { - return new SeparableConv2D(args); -} -/** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function cropping2D(args) { - return new Cropping2D(args); -} -/** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function upSampling2d(args) { - return new UpSampling2D(args); -} -// Convolutional(depthwise) Layers. -/** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -function depthwiseConv2d$2(args) { - return new DepthwiseConv2D(args); -} -// Basic Layers. -/** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function activation(args) { - return new Activation$1(args); -} -/** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function dense(args) { - return new Dense(args); -} -/** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function dropout$1(args) { - return new Dropout(args); -} -/** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function spatialDropout1d(args) { - return new SpatialDropout1D(args); -} -/** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function flatten$2(args) { - return new Flatten(args); -} -/** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function repeatVector(args) { - return new RepeatVector(args); -} -/** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function reshape$1(args) { - return new Reshape$1(args); -} -/** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function permute(args) { - return new Permute(args); -} -/** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -function embedding(args) { - return new Embedding(args); -} -// Merge Layers. -/** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function add$2(args) { - return new Add$1(args); -} -/** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function average(args) { - return new Average(args); -} -/** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function concatenate$1(args) { - return new Concatenate(args); -} -/** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function maximum$1(args) { - return new Maximum$1(args); -} -/** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function minimum$1(args) { - return new Minimum$1(args); -} -/** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function multiply(args) { - return new Multiply$1(args); -} -/** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -function dot$2(args) { - return new Dot(args); -} -// Normalization Layers. -/** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -function batchNormalization$1(args) { - return new BatchNormalization(args); -} -/** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -function layerNormalization(args) { - return new LayerNormalization(args); -} -// Padding Layers. -/** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ -function zeroPadding2d(args) { - return new ZeroPadding2D(args); -} -// Pooling Layers. -/** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling1d(args) { - return new AveragePooling1D(args); -} -function avgPool1d(args) { - return averagePooling1d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling1d(args) { - return averagePooling1d(args); -} -/** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling2d(args) { - return new AveragePooling2D(args); -} -function avgPool2d(args) { - return averagePooling2d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling2d(args) { - return averagePooling2d(args); -} -/** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function averagePooling3d(args) { - return new AveragePooling3D(args); -} -function avgPool3d(args) { - return averagePooling3d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -function avgPooling3d(args) { - return averagePooling3d(args); -} -/** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalAveragePooling1d(args) { - return new GlobalAveragePooling1D(args); -} -/** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalAveragePooling2d(args) { - return new GlobalAveragePooling2D(args); -} -/** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalMaxPooling1d(args) { - return new GlobalMaxPooling1D(args); -} -/** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function globalMaxPooling2d(args) { - return new GlobalMaxPooling2D(args); -} -/** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling1d(args) { - return new MaxPooling1D(args); -} -/** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling2d(args) { - return new MaxPooling2D(args); -} -/** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -function maxPooling3d(args) { - return new MaxPooling3D(args); -} -// Recurrent Layers. -/** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function gru(args) { - return new GRU(args); -} -/** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function gruCell(args) { - return new GRUCell(args); -} -/** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function lstm(args) { - return new LSTM(args); -} -/** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function lstmCell(args) { - return new LSTMCell(args); -} -/** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function simpleRNN(args) { - return new SimpleRNN(args); -} -/** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function simpleRNNCell(args) { - return new SimpleRNNCell(args); -} -/** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -function convLstm2d(args) { - return new ConvLSTM2D(args); -} -/** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -function convLstm2dCell(args) { - return new ConvLSTM2DCell(args); -} -/** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function rnn$1(args) { - return new RNN(args); -} -/** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -function stackedRNNCells(args) { - return new StackedRNNCells(args); -} -// Wrapper Layers. -/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ -function bidirectional(args) { - return new Bidirectional(args); -} -/** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ -function timeDistributed(args) { - return new TimeDistributed(args); -} -// Aliases for pooling. -var globalMaxPool1d = globalMaxPooling1d; -var globalMaxPool2d = globalMaxPooling2d; -var maxPool1d = maxPooling1d; -var maxPool2d = maxPooling2d; -/** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function gaussianNoise(args) { - return new GaussianNoise(args); -} -/** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function gaussianDropout(args) { - return new GaussianDropout(args); -} -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -function alphaDropout(args) { - return new AlphaDropout(args); -} -/** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ -function masking(args) { - return new Masking(args); -} - -var exports_layers = { - __proto__: null, - inputLayer: inputLayer, - elu: elu$2, - reLU: reLU, - leakyReLU: leakyReLU, - prelu: prelu$1, - softmax: softmax$1, - thresholdedReLU: thresholdedReLU, - conv1d: conv1d$1, - conv2d: conv2d$1, - conv2dTranspose: conv2dTranspose$1, - conv3d: conv3d, - conv3dTranspose: conv3dTranspose, - separableConv2d: separableConv2d$1, - cropping2D: cropping2D, - upSampling2d: upSampling2d, - depthwiseConv2d: depthwiseConv2d$2, - activation: activation, - dense: dense, - dropout: dropout$1, - spatialDropout1d: spatialDropout1d, - flatten: flatten$2, - repeatVector: repeatVector, - reshape: reshape$1, - permute: permute, - embedding: embedding, - add: add$2, - average: average, - concatenate: concatenate$1, - maximum: maximum$1, - minimum: minimum$1, - multiply: multiply, - dot: dot$2, - batchNormalization: batchNormalization$1, - layerNormalization: layerNormalization, - zeroPadding2d: zeroPadding2d, - averagePooling1d: averagePooling1d, - avgPool1d: avgPool1d, - avgPooling1d: avgPooling1d, - averagePooling2d: averagePooling2d, - avgPool2d: avgPool2d, - avgPooling2d: avgPooling2d, - averagePooling3d: averagePooling3d, - avgPool3d: avgPool3d, - avgPooling3d: avgPooling3d, - globalAveragePooling1d: globalAveragePooling1d, - globalAveragePooling2d: globalAveragePooling2d, - globalMaxPooling1d: globalMaxPooling1d, - globalMaxPooling2d: globalMaxPooling2d, - maxPooling1d: maxPooling1d, - maxPooling2d: maxPooling2d, - maxPooling3d: maxPooling3d, - gru: gru, - gruCell: gruCell, - lstm: lstm, - lstmCell: lstmCell, - simpleRNN: simpleRNN, - simpleRNNCell: simpleRNNCell, - convLstm2d: convLstm2d, - convLstm2dCell: convLstm2dCell, - rnn: rnn$1, - stackedRNNCells: stackedRNNCells, - bidirectional: bidirectional, - timeDistributed: timeDistributed, - globalMaxPool1d: globalMaxPool1d, - globalMaxPool2d: globalMaxPool2d, - maxPool1d: maxPool1d, - maxPool2d: maxPool2d, - Layer: Layer, - RNN: RNN, - RNNCell: RNNCell, - input: input, - gaussianNoise: gaussianNoise, - gaussianDropout: gaussianDropout, - alphaDropout: alphaDropout, - masking: masking -}; - -/** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function binaryAccuracy$1(yTrue, yPred) { - return binaryAccuracy(yTrue, yPred); -} -/** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function binaryCrossentropy$2(yTrue, yPred) { - return binaryCrossentropy$1(yTrue, yPred); -} -/** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function sparseCategoricalAccuracy$1(yTrue, yPred) { - return sparseCategoricalAccuracy(yTrue, yPred); -} -/** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function categoricalAccuracy$1(yTrue, yPred) { - return categoricalAccuracy(yTrue, yPred); -} -/** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function categoricalCrossentropy$2(yTrue, yPred) { - return categoricalCrossentropy$1(yTrue, yPred); -} -/** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function precision$1(yTrue, yPred) { - return precision(yTrue, yPred); -} -/** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function recall$1(yTrue, yPred) { - return recall(yTrue, yPred); -} -/** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function cosineProximity$1(yTrue, yPred) { - return cosineProximity(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanAbsoluteError$1(yTrue, yPred) { - return meanAbsoluteError(yTrue, yPred); -} -/** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanAbsolutePercentageError$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -function MAPE$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -function mape$1(yTrue, yPred) { - return meanAbsolutePercentageError(yTrue, yPred); -} -/** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -function meanSquaredError$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} -function MSE$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} -function mse$1(yTrue, yPred) { - return meanSquaredError(yTrue, yPred); -} - -var exports_metrics = { - __proto__: null, - binaryAccuracy: binaryAccuracy$1, - binaryCrossentropy: binaryCrossentropy$2, - sparseCategoricalAccuracy: sparseCategoricalAccuracy$1, - categoricalAccuracy: categoricalAccuracy$1, - categoricalCrossentropy: categoricalCrossentropy$2, - precision: precision$1, - recall: recall$1, - cosineProximity: cosineProximity$1, - meanAbsoluteError: meanAbsoluteError$1, - meanAbsolutePercentageError: meanAbsolutePercentageError$1, - MAPE: MAPE$1, - mape: mape$1, - meanSquaredError: meanSquaredError$1, - MSE: MSE$1, - mse: mse$1 -}; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -var exports_models = { - __proto__: null, - modelFromJSON: modelFromJSON -}; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l1l2(config) { - return new L1L2(config); -} -/** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l1$1(config) { - return l1(config); -} -/** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -function l2$1(config) { - return l2(config); -} - -var exports_regularizers = { - __proto__: null, - l1l2: l1l2, - l1: l1$1, - l2: l2$1 -}; - -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -var Callback = /** @class */ (function (_super) { - __extends(Callback, _super); - function Callback() { - var _this = _super !== null && _super.apply(this, arguments) || this; - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - _this.model = null; - return _this; - } - Callback.prototype.setModel = function (model) { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - }; - return Callback; -}(BaseCallback)); -function less$1(currVal, prevVal) { - return currVal < prevVal; -} -function greater$1(currVal, prevVal) { - return currVal > prevVal; -} -/** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ -var EarlyStopping = /** @class */ (function (_super) { - __extends(EarlyStopping, _super); - function EarlyStopping(args) { - var _this = _super.call(this) || this; - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError('restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - _this.monitor = args.monitor || 'val_loss'; - _this.minDelta = Math.abs(args.minDelta || 0); - _this.patience = args.patience || 0; - _this.verbose = args.verbose || 0; - _this.mode = args.mode || 'auto'; - _this.baseline = args.baseline; - if (['auto', 'min', 'max'].indexOf(_this.mode) === -1) { - console.warn("EarlyStopping mode '" + _this.mode + "' is invalid. " + - "Falling back to mode 'auto'."); - _this.mode = 'auto'; - } - if (_this.mode === 'min') { - _this.monitorFunc = less$1; - } - else if (_this.mode === 'max') { - _this.monitorFunc = greater$1; - } - else { - // For mode === 'auto'. - if (_this.monitor.indexOf('acc') !== -1) { - _this.monitorFunc = greater$1; - } - else { - _this.monitorFunc = less$1; - } - } - if (_this.monitorFunc === less$1) { - _this.minDelta *= -1; - } - return _this; - } - EarlyStopping.prototype.onTrainBegin = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } - else { - this.best = this.monitorFunc === less$1 ? Infinity : -Infinity; - } - return [2 /*return*/]; - }); - }); - }; - EarlyStopping.prototype.onEpochEnd = function (epoch, logs) { - return __awaiter(this, void 0, void 0, function () { - var current; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, resolveScalarsInLogs(logs)]; - case 1: - _a.sent(); - current = this.getMonitorValue(logs); - if (current == null) { - return [2 /*return*/]; - } - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } - else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - return [2 /*return*/]; - } - }); - }); - }; - EarlyStopping.prototype.onTrainEnd = function (logs) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log("Epoch " + this.stoppedEpoch + ": early stopping."); - } - return [2 /*return*/]; - }); - }); - }; - EarlyStopping.prototype.getMonitorValue = function (logs) { - if (logs == null) { - logs = {}; - } - var monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn("Metric for EarlyStopping " + this.monitor + " is not available. " + - ("Available metrics are: " + Object.keys(logs))); - } - return monitorValue; - }; - return EarlyStopping; -}(Callback)); -/** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ -function earlyStopping(args) { - return new EarlyStopping(args); -} -var callbacks = { earlyStopping: earlyStopping }; - -exports.Callback = Callback; -exports.CallbackList = CallbackList; -exports.CustomCallback = CustomCallback; -exports.EarlyStopping = EarlyStopping; -exports.History = History; -exports.InputSpec = InputSpec; -exports.LayerVariable = LayerVariable; -exports.LayersModel = LayersModel; -exports.RNN = RNN; -exports.Sequential = Sequential; -exports.SymbolicTensor = SymbolicTensor; -exports.callbacks = callbacks; -exports.constraints = exports_constraints; -exports.initializers = exports_initializers; -exports.input = input; -exports.layers = exports_layers; -exports.loadLayersModel = loadLayersModel; -exports.metrics = exports_metrics; -exports.model = model; -exports.models = exports_models; -exports.registerCallbackConstructor = registerCallbackConstructor; -exports.regularizers = exports_regularizers; -exports.sequential = sequential; -exports.version_layers = version; -//# sourceMappingURL=tf-layers.node.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js.map deleted file mode 100644 index baada1537..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-layers.node.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/backends/backend.js","../node_modules/@tensorflow/tfjs-core/dist/util_base.js","../node_modules/@tensorflow/tfjs-core/dist/environment.js","../node_modules/@tensorflow/tfjs-core/dist/global_util.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_names.js","../node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js","../node_modules/@tensorflow/tfjs-core/dist/util.js","../node_modules/@tensorflow/tfjs-core/dist/profiler.js","../node_modules/@tensorflow/tfjs-core/dist/tape.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_format.js","../node_modules/@tensorflow/tfjs-core/dist/tensor.js","../node_modules/@tensorflow/tfjs-core/dist/types.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util.js","../node_modules/@tensorflow/tfjs-core/dist/engine.js","../node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js","../node_modules/@tensorflow/tfjs-core/dist/ops/operation.js","../node_modules/@tensorflow/tfjs-core/dist/ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clone.js","../node_modules/@tensorflow/tfjs-core/dist/ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/ops/complex.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/imag.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/gradients.js","../node_modules/@tensorflow/tfjs-core/dist/ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones.js","../node_modules/@tensorflow/tfjs-core/dist/ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/ops/real.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js","../node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js","../node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js","../node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js","../node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js","../src/backend/common.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/keras_format/common.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/keras_format/initializer_config.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/backend/state.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/layers/serialization.ts","../src/losses.ts","../src/metrics.ts","../src/optimizers.ts","../src/user_defined_metadata.ts","../src/utils/layer_utils.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/executor.ts","../src/engine/container.ts","../src/engine/training_utils.ts","../src/engine/training_dataset.ts","../src/engine/training_tensors.ts","../src/engine/training.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/regularizers.ts","../src/layers/advanced_activations.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/recurrent.ts","../src/layers/convolutional_recurrent.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/noise.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_models.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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 */\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n constructor(backend, dataMover) {\n this.backend = backend;\n this.dataMover = dataMover;\n this.data = new WeakMap();\n this.dataIdsCount = 0;\n }\n get(dataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n set(dataId, value) {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n has(dataId) {\n return this.data.has(dataId);\n }\n delete(dataId) {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n numDataIds() {\n return this.dataIdsCount;\n }\n}\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend {\n refCount(dataId) {\n return notYetImplemented('refCount');\n }\n incRef(dataId) {\n return notYetImplemented('incRef');\n }\n timerAvailable() {\n return true;\n }\n time(f) {\n return notYetImplemented('time');\n }\n read(dataId) {\n return notYetImplemented('read');\n }\n readSync(dataId) {\n return notYetImplemented('readSync');\n }\n numDataIds() {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId, force) {\n return notYetImplemented('disposeData');\n }\n write(values, shape, dtype) {\n return notYetImplemented('write');\n }\n move(dataId, values, shape, dtype, refCount) {\n return notYetImplemented('move');\n }\n memory() {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision() {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose() {\n return notYetImplemented('dispose');\n }\n}\nfunction notYetImplemented(kernelName) {\n throw new Error(`'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n//# sourceMappingURL=backend.js.map","/**\n * @license\n * Copyright 2020 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 * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n// tslint:disable-next-line:no-any\narray, \n// tslint:disable-next-line:no-any\narray2) {\n if (array.length !== array2.length) {\n throw new Error(`Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n/** Clamps a value to a specified range. */\nexport function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}\nexport function nearestLargerEven(val) {\n return val % 2 === 0 ? val : val + 1;\n}\nexport function sum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a, b) {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr, msg) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\nexport function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') {\n assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\nexport function assertNonNull(a) {\n assert(a != null, () => `The input to the tensor constructor must be a non-null value.`);\n}\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function flatten(arr, result = [], skipTypedArray = false) {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n }\n else {\n result.push(arr);\n }\n return result;\n}\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape) {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function isScalarShape(shape) {\n return shape.length === 0;\n}\nexport function arraysEqual(n1, n2) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isInt(a) {\n return a % 1 === 0;\n}\nexport function tanh(x) {\n // tslint:disable-next-line:no-any\n if (Math.tanh != null) {\n // tslint:disable-next-line:no-any\n return Math.tanh(x);\n }\n if (x === Infinity) {\n return 1;\n }\n else if (x === -Infinity) {\n return -1;\n }\n else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\nexport function sizeToSquarishShape(size) {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n) {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\nexport function rightPad(a, size) {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\nexport function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n tryCount++;\n const nextBackoff = delayFn(tryCount);\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n tryFn();\n });\n}\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(shape, size) {\n let shapeProd = 1;\n let implicitIdx = -1;\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n }\n else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(`Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n }\n else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n if (shapeProd === 0) {\n throw Error(`Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(`The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\nexport function parseAxisParam(axis, shape) {\n const rank = shape.length;\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n // Check for valid range\n assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n // Check for only integers\n assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape, axis) {\n const newShape = [];\n const keptDims = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return { newShape, keptDims };\n}\nexport function getTypedArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function getArrayFromDType(dtype, size) {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n }\n else if (dtype === 'int32') {\n values = new Int32Array(size);\n }\n else if (dtype === 'bool') {\n values = new Uint8Array(size);\n }\n else if (dtype === 'string') {\n values = new Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\nexport function checkConversionForErrors(vals, dtype) {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype) {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType, newType) {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\nexport function isTypedArray(a) {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\nexport function bytesPerElement(dtype) {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n }\n else if (dtype === 'complex64') {\n return 8;\n }\n else if (dtype === 'bool') {\n return 1;\n }\n else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr) {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n/** Returns true if the value is a string. */\nexport function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function inferDtype(values) {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n }\n else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n }\n else if (isNumber(values)) {\n return 'float32';\n }\n else if (isString(values)) {\n return 'string';\n }\n else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\nexport function isFunction(f) {\n return !!(f && f.constructor && f.call && f.apply);\n}\nexport function nearestDivisor(size, start) {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\nexport function computeStrides(shape) {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\nfunction createNestedArray(offset, shape, a, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n }\n else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape, a, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? ' for a complex tensor' : ''}.`);\n }\n return createNestedArray(0, shape, a, isComplex);\n}\nexport function makeOnesTypedArray(size, dtype) {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\nexport function makeZerosTypedArray(size, dtype) {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size);\n }\n else if (dtype === 'int32') {\n return new Int32Array(size);\n }\n else if (dtype === 'bool') {\n return new Uint8Array(size);\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(shape, dtype) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n }\n else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n }\n else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\nexport function assertNonNegativeIntegerDimensions(shape) {\n shape.forEach(dimSize => {\n assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(locs, rank, strides) {\n if (rank === 0) {\n return 0;\n }\n else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(index, rank, strides) {\n if (rank === 0) {\n return [];\n }\n else if (rank === 1) {\n return [index];\n }\n const locs = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n//# sourceMappingURL=util_base.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { isPromise } from './util_base';\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n // tslint:disable-next-line: no-any\n constructor(global) {\n this.global = global;\n this.flags = {};\n this.flagRegistry = {};\n this.urlFlags = {};\n // Jasmine spies on this in 'environment_test.ts'\n this.getQueryParams = getQueryParams;\n this.populateURLFlags();\n }\n setPlatform(platformName, platform) {\n if (this.platform != null) {\n console.warn(`Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n registerFlag(flagName, evaluationFn, setHook) {\n this.flagRegistry[flagName] = { evaluationFn, setHook };\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n async getAsync(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n get(flagName) {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(`Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n this.flags[flagName] = flagValue;\n return this.flags[flagName];\n }\n getNumber(flagName) {\n return this.get(flagName);\n }\n getBool(flagName) {\n return this.get(flagName);\n }\n getFlags() {\n return this.flags;\n }\n // For backwards compatibility.\n get features() {\n return this.flags;\n }\n set(flagName, value) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n evaluateFlag(flagName) {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n setFlags(flags) {\n this.flags = Object.assign({}, flags);\n }\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n populateURLFlags() {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':');\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\nexport function getQueryParams(queryString) {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\nfunction decodeParam(params, name, value) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\nfunction parseValue(flagName, value) {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n }\n else if (`${+value}` === value) {\n return +value;\n }\n throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\nexport let ENV = null;\nexport function setEnvironmentGlobal(environment) {\n ENV = environment;\n}\n//# sourceMappingURL=environment.js.map","/**\n * @license\n * Copyright 2020 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// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace;\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace() {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns;\n if (typeof (window) !== 'undefined') {\n ns = window;\n }\n else if (typeof (global) !== 'undefined') {\n ns = global;\n }\n else if (typeof (process) !== 'undefined') {\n ns = process;\n }\n else if (typeof (self) !== 'undefined') {\n ns = self;\n }\n else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n// tslint:disable-next-line:no-any\nfunction getGlobalMap() {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key, init) {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n }\n else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n//# sourceMappingURL=global_util.js.map","export const Abs = 'Abs';\nexport const Acos = 'Acos';\nexport const Acosh = 'Acosh';\nexport const Add = 'Add';\nexport const AddN = 'AddN';\nexport const All = 'All';\nexport const Any = 'Any';\nexport const ArgMax = 'ArgMax';\nexport const ArgMin = 'ArgMin';\nexport const Asin = 'Asin';\nexport const Asinh = 'Asinh';\nexport const Atan = 'Atan';\nexport const Atanh = 'Atanh';\nexport const Atan2 = 'Atan2';\nexport const AvgPool = 'AvgPool';\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport const AvgPool3D = 'AvgPool3D';\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport const BatchMatMul = 'BatchMatMul';\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport const Bincount = 'Bincount';\nexport const BroadcastTo = 'BroadcastTo';\nexport const Cast = 'Cast';\nexport const Ceil = 'Ceil';\nexport const ClipByValue = 'ClipByValue';\nexport const Complex = 'Complex';\nexport const ComplexAbs = 'ComplexAbs';\nexport const Concat = 'Concat';\nexport const Conv2D = 'Conv2D';\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport const Conv3D = 'Conv3D';\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport const Cos = 'Cos';\nexport const Cosh = 'Cosh';\nexport const Cumsum = 'Cumsum';\nexport const CropAndResize = 'CropAndResize';\nexport const DenseBincount = 'DenseBincount';\nexport const DepthToSpace = 'DepthToSpace';\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter';\nexport const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput';\nexport const Diag = 'Diag';\nexport const Dilation2D = 'Dilation2D';\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport const RealDiv = 'RealDiv';\nexport const Einsum = 'Einsum';\nexport const Elu = 'Elu';\nexport const EluGrad = 'EluGrad';\nexport const Erf = 'Erf';\nexport const Equal = 'Equal';\nexport const Exp = 'Exp';\nexport const ExpandDims = 'ExpandDims';\nexport const Expm1 = 'Expm1';\nexport const FFT = 'FFT';\nexport const Fill = 'Fill';\nexport const FlipLeftRight = 'FlipLeftRight';\nexport const Floor = 'Floor';\nexport const FloorDiv = 'FloorDiv';\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport const GatherV2 = 'GatherV2';\nexport const GatherNd = 'GatherNd';\nexport const Greater = 'Greater';\nexport const GreaterEqual = 'GreaterEqual';\nexport const Identity = 'Identity';\nexport const IFFT = 'IFFT';\nexport const Imag = 'Imag';\nexport const IsFinite = 'IsFinite';\nexport const IsInf = 'IsInf';\nexport const IsNan = 'IsNan';\nexport const LeakyRelu = 'LeakyRelu';\nexport const Less = 'Less';\nexport const LessEqual = 'LessEqual';\nexport const LinSpace = 'LinSpace';\nexport const Log = 'Log';\nexport const Log1p = 'Log1p';\nexport const LogicalAnd = 'LogicalAnd';\nexport const LogicalNot = 'LogicalNot';\nexport const LogicalOr = 'LogicalOr';\nexport const LogSoftmax = 'LogSoftmax';\nexport const LRN = 'LRN';\nexport const LRNGrad = 'LRNGrad';\nexport const Max = 'Max';\nexport const Maximum = 'Maximum';\nexport const MaxPool = 'MaxPool';\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport const MaxPool3D = 'MaxPool3D';\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport const Mean = 'Mean';\nexport const Min = 'Min';\nexport const Minimum = 'Minimum';\nexport const MirrorPad = 'MirrorPad';\nexport const Mod = 'Mod';\nexport const Multinomial = 'Multinomial';\nexport const Multiply = 'Multiply';\nexport const Neg = 'Neg';\nexport const NotEqual = 'NotEqual';\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport const OnesLike = 'OnesLike';\nexport const OneHot = 'OneHot';\nexport const Pack = 'Pack';\nexport const PadV2 = 'PadV2';\nexport const Pool = 'Pool';\nexport const Pow = 'Pow';\nexport const Prelu = 'Prelu';\nexport const Prod = 'Prod';\nexport const Range = 'Range';\nexport const Real = 'Real';\nexport const Reciprocal = 'Reciprocal';\nexport const Relu = 'Relu';\nexport const Reshape = 'Reshape';\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport const ResizeBilinear = 'ResizeBilinear';\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport const Relu6 = 'Relu6';\nexport const Reverse = 'Reverse';\nexport const Round = 'Round';\nexport const Rsqrt = 'Rsqrt';\nexport const ScatterNd = 'ScatterNd';\nexport const Select = 'Select';\nexport const Selu = 'Selu';\nexport const Slice = 'Slice';\nexport const Sin = 'Sin';\nexport const Sinh = 'Sinh';\nexport const Sign = 'Sign';\nexport const Sigmoid = 'Sigmoid';\nexport const Softplus = 'Softplus';\nexport const Sqrt = 'Sqrt';\nexport const Sum = 'Sum';\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport const SplitV = 'SplitV';\nexport const Softmax = 'Softmax';\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport const SparseReshape = 'SparseReshape';\nexport const SparseToDense = 'SparseToDense';\nexport const SquaredDifference = 'SquaredDifference';\nexport const Square = 'Square';\nexport const StridedSlice = 'StridedSlice';\nexport const Sub = 'Sub';\nexport const Tan = 'Tan';\nexport const Tanh = 'Tanh';\nexport const Tile = 'Tile';\nexport const TopK = 'TopK';\nexport const Transform = 'Transform';\nexport const Transpose = 'Transpose';\nexport const Unique = 'Unique';\nexport const Unpack = 'Unpack';\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport const ZerosLike = 'ZerosLike';\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport const FromPixels = 'FromPixels';\nexport const RotateWithOffset = 'RotateWithOffset';\nexport const _FusedMatMul = '_FusedMatMul';\nexport const FusedConv2D = 'FusedConv2D';\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\n//# sourceMappingURL=kernel_names.js.map","/**\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 */\nimport { env } from './environment';\nimport { getGlobal } from './global_util';\nconst kernelRegistry = getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry = getGlobal('gradRegistry', () => new Map());\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n}\nexport function getKernelsForBackend(backendName) {\n const it = kernelRegistry.entries();\n const result = [];\n while (true) {\n const { done, value } = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend,] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config) {\n const { kernelName, backendName } = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(kernelName, backendName) {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(`The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName) {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(`The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(registeredBackendName, newBackendName) {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig = Object.assign({}, kernelConfig, { backendName: newBackendName });\n registerKernel(newKernelConfig);\n });\n}\nfunction makeKey(kernelName, backendName) {\n return `${backendName}_${kernelName}`;\n}\n//# sourceMappingURL=kernel_registry.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { env } from './environment';\nimport * as base from './util_base';\nexport * from './util_base';\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(value, dtype) {\n if (dtype === 'string') {\n return encodeString(value);\n }\n return toTypedArray([value], dtype);\n}\nfunction noConversionNeeded(a, dtype) {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\nexport function toTypedArray(a, dtype) {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a, dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a);\n }\n else if (dtype === 'int32') {\n return new Int32Array(a);\n }\n else if (dtype === 'bool') {\n const bool = new Uint8Array(a.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(a[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n }\n else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now() {\n return env().platform.now();\n}\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(path, requestInits) {\n return env().platform.fetch(path, requestInits);\n}\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes, encoding = 'utf-8') {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n//# sourceMappingURL=util.js.map","/**\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 */\nimport { env } from './environment';\nimport * as util from './util';\nexport class Profiler {\n constructor(backendTimer, logger) {\n this.backendTimer = backendTimer;\n this.logger = logger;\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n profileKernel(kernelName, inputs, f) {\n let outputs;\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n }\n else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({ kernelMs: util.now() - start });\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n logKernelProfile(kernelProfile) {\n const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile;\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]);\n });\n });\n }\n}\nexport function checkComputationForErrors(vals, dtype, kernelName) {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i];\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\nexport class Logger {\n logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n console.log(`%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${inputShapesDescription}\\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue');\n }\n}\n//# sourceMappingURL=profiler.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from './util';\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n if (anyInputFromX) {\n break;\n }\n }\n }\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY = {};\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n // Return the paths that come from x and lead to y.\n const filteredTape = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n filteredTape.push(prunedNode);\n }\n }\n return filteredTape;\n}\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const dys = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n }\n else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n if (node.gradient == null) {\n throw new Error(`Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(`Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n }\n else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n//# sourceMappingURL=tape.js.map","/**\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 */\nimport { computeStrides, isString, rightPad, sizeFromShape } from './util';\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\nexport function tensorToString(vals, shape, dtype, verbose) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\nfunction computeMaxSizePerColumn(vals, shape, dtype, strides) {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\nfunction valToString(val, pad, dtype) {\n let valStr;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n }\n else if (isString(val)) {\n valStr = `'${val}'`;\n }\n else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n }\n else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n return rightPad(valStr, pad);\n}\nfunction boolNumToString(v) {\n return v === 0 ? 'false' : 'true';\n}\nfunction subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0])];\n }\n return [vals[0].toString()];\n }\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n let firstVals = Array.from(vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals = dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\nfunction createComplexTuples(vals) {\n const complexTuples = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]]);\n }\n return complexTuples;\n}\n//# sourceMappingURL=tensor_format.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport { getGlobal } from './global_util';\nimport { tensorToString } from './tensor_format';\nimport * as util from './util';\nimport { computeStrides, toNestedArray } from './util';\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n constructor(shape, dtype, values) {\n this.dtype = dtype;\n this.shape = shape.slice();\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n const n = values.length;\n util.assert(n === this.size, () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value, ...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs) {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n locToIndex(locs) {\n if (this.rank === 0) {\n return 0;\n }\n else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n indexToLoc(index) {\n if (this.rank === 0) {\n return [];\n }\n else if (this.rank === 1) {\n return [index];\n }\n const locs = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor() {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype);\n }\n}\n// For tracking tensor creation and disposal.\nlet trackerFn = null;\n// Used by chaining methods to call into ops.\nlet opHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn) {\n trackerFn = fn;\n}\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler) {\n opHandler = handler;\n}\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n constructor(shape, dtype, dataId, id) {\n /** Whether this tensor has been globally kept. */\n this.kept = false;\n this.isDisposedInternal = false;\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher');\n }\n get rank() {\n return this.shape.length;\n }\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer() {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype, vals);\n }\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync() {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array() {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64');\n }\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync() {\n return toNestedArray(this.shape, this.dataSync(), this.dtype === 'complex64');\n }\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data() {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data;\n try {\n return bytes.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync() {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return data.map(b => util.decodeString(b));\n }\n catch (_a) {\n throw new Error('Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data;\n }\n /** Returns the underlying bytes of the tensor's data. */\n async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n get isDisposed() {\n return this.isDisposedInternal;\n }\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false) {\n return opHandler.print(this, verbose);\n }\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone() {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false) {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n cast(dtype) {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype);\n }\n variable(trainable = true, name, dtype) {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n constructor(initialValue, trainable, name, tensorId) {\n super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.trainable = trainable;\n this.name = name;\n }\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue) {\n if (newValue.dtype !== this.dtype) {\n throw new Error(`dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(`shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n dispose() {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n//# sourceMappingURL=tensor.js.map","/**\n * @license\n * Copyright 2017 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 */\nexport var Rank;\n(function (Rank) {\n Rank[\"R0\"] = \"R0\";\n Rank[\"R1\"] = \"R1\";\n Rank[\"R2\"] = \"R2\";\n Rank[\"R3\"] = \"R3\";\n Rank[\"R4\"] = \"R4\";\n Rank[\"R5\"] = \"R5\";\n Rank[\"R6\"] = \"R6\";\n})(Rank || (Rank = {}));\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nvar UpcastInt32AndMap;\n(function (UpcastInt32AndMap) {\n UpcastInt32AndMap[\"float32\"] = \"float32\";\n UpcastInt32AndMap[\"int32\"] = \"int32\";\n UpcastInt32AndMap[\"bool\"] = \"int32\";\n UpcastInt32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastInt32AndMap || (UpcastInt32AndMap = {}));\nvar UpcastBoolAndMap;\n(function (UpcastBoolAndMap) {\n UpcastBoolAndMap[\"float32\"] = \"float32\";\n UpcastBoolAndMap[\"int32\"] = \"int32\";\n UpcastBoolAndMap[\"bool\"] = \"bool\";\n UpcastBoolAndMap[\"complex64\"] = \"complex64\";\n})(UpcastBoolAndMap || (UpcastBoolAndMap = {}));\nvar UpcastFloat32AndMap;\n(function (UpcastFloat32AndMap) {\n UpcastFloat32AndMap[\"float32\"] = \"float32\";\n UpcastFloat32AndMap[\"int32\"] = \"float32\";\n UpcastFloat32AndMap[\"bool\"] = \"float32\";\n UpcastFloat32AndMap[\"complex64\"] = \"complex64\";\n})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));\nvar UpcastComplex64AndMap;\n(function (UpcastComplex64AndMap) {\n UpcastComplex64AndMap[\"float32\"] = \"complex64\";\n UpcastComplex64AndMap[\"int32\"] = \"complex64\";\n UpcastComplex64AndMap[\"bool\"] = \"complex64\";\n UpcastComplex64AndMap[\"complex64\"] = \"complex64\";\n})(UpcastComplex64AndMap || (UpcastComplex64AndMap = {}));\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\nexport function upcastType(typeA, typeB) {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n/** Returns the output type after summation. */\nexport function sumOutType(type) {\n return upcastType(type, 'int32');\n}\n//# sourceMappingURL=types.js.map","/**\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 */\nimport { Tensor } from './tensor';\nimport { upcastType } from './types';\nimport { assert } from './util';\nexport function makeTypesMatch(a, b) {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\nexport function assertTypesMatch(a, b) {\n assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\nexport function isTensorInList(tensor, tensorList) {\n return tensorList.some(x => x.id === tensor.id);\n}\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result) {\n const list = [];\n const seen = new Set();\n walkTensorContainer(result, list, seen);\n return list;\n}\nfunction walkTensorContainer(container, list, seen) {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n// tslint:disable-next-line:no-any\nfunction isIterable(obj) {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n//# sourceMappingURL=tensor_util.js.map","/**\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 */\nimport { KernelBackend } from './backends/backend';\nimport { Environment, setEnvironmentGlobal } from './environment';\nimport { getGlobalNamespace } from './global_util';\nimport { Add, Cast, Identity } from './kernel_names';\nimport { getGradient, getKernel, getKernelsForBackend } from './kernel_registry';\nimport { Profiler } from './profiler';\nimport { backpropagateGradients, getFilteredNodesXToY } from './tape';\nimport { setTensorTracker, Tensor, Variable } from './tensor';\nimport { getTensorsInContainer } from './tensor_util';\nimport * as util from './util';\nimport { bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape } from './util';\nfunction isRegisteredKernelInvocation(kernelInvocation) {\n return kernelInvocation.kernelName != null;\n}\nclass EngineState {\n constructor() {\n // Public since optimizers will use it.\n this.registeredVariables = {};\n this.nextTapeNodeId = 0;\n this.numBytes = 0;\n this.numTensors = 0;\n this.numStringTensors = 0;\n this.numDataBuffers = 0;\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n this.gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n this.kernelDepth = 0;\n this.scopeStack = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n this.numDataMovesStack = [];\n this.nextScopeId = 0;\n this.tensorInfo = new WeakMap();\n this.profiling = false;\n this.activeProfile = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames() {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n }\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\nexport class Engine {\n constructor(ENV) {\n this.ENV = ENV;\n this.registry = {};\n this.registryFactory = {};\n this.pendingBackendInitId = 0;\n this.state = new EngineState();\n }\n async ready() {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => { });\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n get backend() {\n if (this.pendingBackendInit != null) {\n throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const { name, asyncInit } = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(`The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n backendNames() {\n return Object.keys(this.registryFactory);\n }\n findBackend(backendName) {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const { asyncInit } = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n }\n else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n findBackendFactory(backendName) {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n registerBackend(backendName, factory, priority = 1) {\n if (backendName in this.registryFactory) {\n console.warn(`${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = { factory, priority };\n return true;\n }\n async setBackend(backendName) {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const { success, asyncInit } = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n return true;\n }\n setupRegisteredKernels() {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n disposeRegisteredKernels(backendName) {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n initializeBackend(backendName) {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(`Cannot initialize backend ${backendName}, no registration found.`);\n }\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success = backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return { success, asyncInit: true };\n }\n else {\n this.registry[backendName] = backend;\n return { success: true, asyncInit: false };\n }\n }\n catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return { success: false, asyncInit: false };\n }\n }\n removeBackend(backendName) {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n delete this.registryFactory[backendName];\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n getSortedBackends() {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a, b) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n initializeBackendsAndReturnBest() {\n const sortedBackends = this.getSortedBackends();\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const { success, asyncInit } = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return { name: backendName, asyncInit };\n }\n }\n throw new Error(`Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n moveData(backend, dataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n tidy(nameOrFn, fn) {\n let name = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n }\n else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error('When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error('When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result;\n return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n scopedRun(start, end, f) {\n start();\n try {\n const res = f();\n end();\n return res;\n }\n catch (ex) {\n end();\n throw ex;\n }\n }\n nextTensorId() {\n return Engine.nextTensorId++;\n }\n nextVariableId() {\n return Engine.nextVariableId++;\n }\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(kernelName, inputs, attrs) {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`);\n }\n return this.runKernelFunc({ kernelName, inputs, attrs });\n }\n shouldCheckForMemLeaks() {\n return this.ENV.getBool('IS_TEST');\n }\n checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) {\n const numDataIdsAfter = this.backend.numDataIds();\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(`Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n runKernelFunc(kernelParams) {\n let outputs;\n let saved = [];\n const isTapeOn = this.isTapeOn();\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n let kernelFunc;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n let out;\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n if (isRegisteredKernelInvocation(kernelParams)) {\n const { kernelName, inputs, attrs } = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`);\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({ inputs, attrs, backend: this.backend });\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n const outTensors = outInfos.map((outInfo) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if (outInfo.rank != null) {\n return outInfo;\n }\n const { dataId, shape, dtype } = outInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n // Save any required inputs and outputs.\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n }\n else {\n const { forwardFunc } = kernelParams;\n // Running a customGrad op.\n const saveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]);\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const { inputs, attrs } = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n let kernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n }\n else {\n kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n if (isTapeOn) {\n this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]);\n }\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n saveTensorsForBackwardMode(tensors) {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n getTensorsForGradient(kernelName, inputs, outputs) {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave = gradConfig.inputsToSave || [];\n const outputsToSave = gradConfig.outputsToSave || [];\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave;\n if (gradConfig.saveAllInputs) {\n util.assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.');\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n }\n else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]);\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(values, shape, dtype, backend) {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = values.map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(dataId, shape, dtype, backend) {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n makeVariable(initialValue, trainable = true, name, dtype) {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n trackTensor(a, backend) {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a, backend) {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n removeDataId(dataId, backend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a) {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n disposeVariables() {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n disposeVariable(v) {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n memory() {\n const info = this.backend.memory();\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push('Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n async profile(query) {\n this.state.profiling = true;\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n this.state.profiling = false;\n this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n isTapeOn() {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) {\n const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved };\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n keep(result) {\n result.kept = true;\n return result;\n }\n startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n endTape() {\n this.state.gradientDepth--;\n }\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name) {\n const scopeInfo = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id));\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }\n customGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs) => {\n util.assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n let res;\n const inputMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n const forwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(util.isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n const backwardsFunc = (dy, saved) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n readSync(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId) {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n async time(query) {\n const start = now();\n const timingInfo = await this.backend.time(query);\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n track(result) {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n return result;\n }\n get registeredVariables() {\n return this.state.registeredVariables;\n }\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\nEngine.nextTensorId = 0;\nEngine.nextVariableId = 0;\nfunction ones(shape) {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\nexport function getOrMakeEngine() {\n const ns = getGlobalNamespace();\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\nexport const ENGINE = getOrMakeEngine();\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(Add, inputs);\n}\n//# sourceMappingURL=engine.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { env } from './environment';\nimport { Tensor } from './tensor';\nimport { assert, flatten, inferDtype, isTypedArray, toTypedArray } from './util';\nexport function inferShape(val, dtype) {\n let firstElem = val;\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape = [];\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\nfunction deepAssertShapeConsistency(val, shape, indices) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\nfunction assertDtype(expectedDtype, actualDType, argName, functionName) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(`Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\nexport function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : x.constructor.name;\n throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype) :\n flatten(x, [], skipTypedArray);\n return ENGINE.makeTensor(values, inferredShape, inferredDtype);\n}\nexport function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') {\n if (!Array.isArray(arg)) {\n throw new Error(`Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg;\n return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n//# sourceMappingURL=tensor_util_env.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { isPromise } from '../util';\nexport const OP_SCOPE_SUFFIX = '__op';\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}\n//# sourceMappingURL=operation.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Abs, ComplexAbs } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `tf.Tensor`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction abs_(x) {\n const $x = convertToTensor(x, 'x', 'abs');\n if ($x.dtype === 'complex64') {\n const inputs = { x: $x };\n return ENGINE.runKernel(ComplexAbs, inputs);\n }\n else {\n const inputs = { x: $x };\n return ENGINE.runKernel(Abs, inputs);\n }\n}\nexport const abs = op({ abs_ });\n//# sourceMappingURL=abs.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes acos of the input `tf.Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acos_(x) {\n const $x = convertToTensor(x, 'x', 'acos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acos, inputs);\n}\nexport const acos = op({ acos_ });\n//# sourceMappingURL=acos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Acosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction acosh_(x) {\n const $x = convertToTensor(x, 'x', 'acosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Acosh, inputs);\n}\nexport const acosh = op({ acosh_ });\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Add } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `tf.Tensor` to add.\n * @param b The second `tf.Tensor` to add. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction add_(a, b) {\n let $a = convertToTensor(a, 'a', 'add');\n let $b = convertToTensor(b, 'b', 'add');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Add, inputs);\n}\nexport const add = op({ add_ });\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { All } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical and of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction all_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'all', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(All, inputs, attrs);\n}\nexport const all = op({ all_ });\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Any } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the logical or of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1], 'bool');\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction any_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'any', 'bool');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Any, inputs, attrs);\n}\n// tslint:disable-next-line:variable-name\nexport const any = op({ any_ });\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMax_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMax');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMax, inputs, attrs);\n}\nexport const argMax = op({ argMax_ });\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { ArgMin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction argMin_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'argMin');\n const inputs = { x: $x };\n const attrs = { axis };\n return ENGINE.runKernel(ArgMin, inputs, attrs);\n}\nexport const argMin = op({ argMin_ });\n//# sourceMappingURL=arg_min.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes asin of the input `tf.Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asin_(x) {\n const $x = convertToTensor(x, 'x', 'asin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asin, inputs);\n}\nexport const asin = op({ asin_ });\n//# sourceMappingURL=asin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Asinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction asinh_(x) {\n const $x = convertToTensor(x, 'x', 'asinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Asinh, inputs);\n}\nexport const asinh = op({ asinh_ });\n//# sourceMappingURL=asinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes atan of the input `tf.Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan_(x) {\n const $x = convertToTensor(x, 'x', 'atan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atan, inputs);\n}\nexport const atan = op({ atan_ });\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Atan2 } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atan2_(a, b) {\n let $a = convertToTensor(a, 'a', 'atan2');\n let $b = convertToTensor(b, 'b', 'atan2');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Atan2, inputs);\n}\nexport const atan2 = op({ atan2_ });\n//# sourceMappingURL=atan2.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Atanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction atanh_(x) {\n const $x = convertToTensor(x, 'x', 'atanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Atanh, inputs);\n}\nexport const atanh = op({ atanh_ });\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Cast } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x, dtype) {\n const $x = convertToTensor(x, 'x', 'cast');\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n const inputs = { x: $x };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, inputs, attrs);\n}\nexport const cast = op({ cast_ });\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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 * @param inputShape Input tensor shape is of the following dimensions:\n * `[batch, height, width, inChannels]`.\n * @param filterShape The filter shape is of the following dimensions:\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat The data format of the input and output data.\n * Defaults to 'NHWC'.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`.\n * Defaults to `[1, 1]`. If `dilations` is a single number, then\n * `dilationHeight == dilationWidth`.\n */\nexport function computeDilation2DInfo(inputShape, filterShape, strides, pad, dataFormat = 'NHWC', dilations) {\n // `computerConv2DInfo` require filterShape to be in the dimension of:\n // `[filterHeight, filterWidth, depth, outDepth]`, dilation2d doesn't have\n // outDepth, it should have the same depth as the input.\n // Input shape: [batch, height, width, inChannels]\n const inputChannels = inputShape[3];\n const $filterShape = [...filterShape, inputChannels];\n const $dataFormat = convertConv2DDataFormat(dataFormat);\n return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad, null /* roundingMode */, null /* depthWise */, $dataFormat);\n}\nexport function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n let filterShape;\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n }\n else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat);\n}\n/**\n * Computes the information for a forward pass of a pooling3D operation.\n */\nexport function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') {\n const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize);\n let filterShape;\n let $dataFormat;\n if (dataFormat === 'NDHWC') {\n $dataFormat = 'channelsLast';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]];\n }\n else if (dataFormat === 'NCDHW') {\n $dataFormat = 'channelsFirst';\n filterShape =\n [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]];\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode);\n}\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n/**\n * Computes the information for a forward pass of a 3D convolution/pooling\n * operation.\n */\nexport function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) {\n let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides);\n const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations);\n const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outDepth, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outDepth, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inDepth,\n inHeight,\n inWidth,\n inChannels,\n outDepth,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideDepth,\n strideHeight,\n strideWidth,\n filterDepth,\n filterHeight,\n filterWidth,\n effectiveFilterDepth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationDepth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\nfunction computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputRows, outputCols];\n}\nfunction computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputDepth = inShape[0];\n const inputRows = inShape[1];\n const inputCols = inShape[2];\n const outputDepths = round((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputRows = round((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n const outputCols = round((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n return [outputDepths, outputRows, outputCols, outChannels];\n}\nexport function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\nfunction parseTupleParam(param) {\n if (typeof param === 'number') {\n return [param, param, param];\n }\n if (param.length === 2) {\n return [param[0], param[1], 1];\n }\n return param;\n}\nfunction parse3TupleParam(param) {\n return typeof param === 'number' ? [param, param, param] : param;\n}\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize, dilation) {\n if (dilation <= 1) {\n return filterSize;\n }\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\nfunction getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) {\n let padInfo;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType };\n const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n }\n else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight);\n const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth);\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' };\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else if (typeof pad === 'object') {\n const top = dataFormat === 'channelsLast' ? pad[1][0] : pad[2][0];\n const bottom = dataFormat === 'channelsLast' ? pad[1][1] : pad[2][1];\n const left = dataFormat === 'channelsLast' ? pad[2][0] : pad[3][0];\n const right = dataFormat === 'channelsLast' ? pad[2][1] : pad[3][1];\n const padType = (top === 0 && bottom === 0 && left === 0 && right === 0) ?\n 'VALID' :\n 'EXPLICIT';\n padInfo = { top, bottom, left, right, type: padType };\n outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);\n outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outHeight, outWidth };\n}\nfunction get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) {\n let padInfo;\n let outDepth;\n let outHeight;\n let outWidth;\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {\n top: pad,\n bottom: pad,\n left: pad,\n right: pad,\n front: pad,\n back: pad,\n type: padType\n };\n const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode);\n outDepth = outShape[0];\n outHeight = outShape[1];\n outWidth = outShape[2];\n }\n else if (pad === 'same') {\n outDepth = Math.ceil(inDepth / strideDepth);\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth;\n const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const front = Math.floor(padAlongDepth / 2);\n const back = padAlongDepth - front;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = { top, bottom, left, right, front, back, type: 'SAME' };\n }\n else if (pad === 'valid') {\n padInfo = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n front: 0,\n back: 0,\n type: 'VALID'\n };\n outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth);\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n }\n else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return { padInfo, outDepth, outHeight, outWidth };\n}\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\nexport function tupleValuesAreOne(param) {\n const [dimA, dimB, dimC] = parseTupleParam(param);\n return dimA === 1 && dimB === 1 && dimC === 1;\n}\nexport function eitherStridesOrDilationsAreOne(strides, dilations) {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n/**\n * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to\n * 'channelsLast'|'channelsFirst'\n * @param dataFormat in 'NHWC'|'NCHW' mode\n * @return dataFormat in 'channelsLast'|'channelsFirst' mode\n * @throws unknown dataFormat\n */\nexport function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}\n//# sourceMappingURL=conv_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Reshape } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reshapes a `tf.Tensor` to a given shape.\n *\n * Given an input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction reshape_(x, shape) {\n const $x = convertToTensor(x, 'x', 'reshape', 'string_or_numeric');\n const inputs = { x: $x };\n const attrs = { shape };\n return ENGINE.runKernel(Reshape, inputs, attrs);\n}\nexport const reshape = op({ reshape_ });\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'avgPool', 'float32');\n const dilations = 1;\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in avgPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n let res = ENGINE.runKernel(AvgPool, inputs, attrs);\n res = cast(res, $x.dtype);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPool = op({ avgPool_ });\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Identity } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x) {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs = { x: $x };\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs);\n}\nexport const clone = op({ clone_ });\n//# sourceMappingURL=clone.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Concat } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { clone } from './clone';\nimport { op } from './operation';\n/**\n * Concatenates a list of `tf.Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction concat_(tensors, axis = 0) {\n assert(tensors.length >= 1, () => 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat', 'string_or_numeric');\n if ($tensors[0].dtype === 'complex64') {\n $tensors.forEach(tensor => {\n if (tensor.dtype !== 'complex64') {\n throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${tensor.dtype}. `);\n }\n });\n }\n if ($tensors.length === 1) {\n return clone($tensors[0]);\n }\n const inputs = $tensors;\n const attr = { axis };\n return ENGINE.runKernel(Concat, inputs, attr);\n}\nexport const concat = op({ concat_ });\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchMatMul } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(a, b, transposeA = false, transposeB = false) {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n const attrs = { transposeA, transposeB };\n return ENGINE.runKernel(BatchMatMul, inputs, attrs);\n}\nexport const matMul = op({ matMul_ });\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Multiply } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `tf.mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mul_(a, b) {\n let $a = convertToTensor(a, 'a', 'mul');\n let $b = convertToTensor(b, 'b', 'mul');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Multiply, inputs);\n}\nexport const mul = op({ mul_ });\n//# sourceMappingURL=mul.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sigmoid } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sigmoid, inputs);\n}\nexport const sigmoid = op({ sigmoid_ });\n//# sourceMappingURL=sigmoid.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Slice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a slice from a `tf.Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `tf.Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction slice_(x, begin, size) {\n const $x = convertToTensor(x, 'x', 'slice', 'string_or_numeric');\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n const inputs = { x: $x };\n const attrs = { begin, size };\n return ENGINE.runKernel(Slice, inputs, attrs);\n}\nexport const slice = op({ slice_ });\n//# sourceMappingURL=slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tanh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tanh_(x) {\n const $x = convertToTensor(x, 'x', 'tanh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tanh, inputs);\n}\nexport const tanh = op({ tanh_ });\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { BatchToSpaceND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0.\n * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input\n * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required\n * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction batchToSpaceND_(x, blockShape, crops) {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`);\n util.assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`);\n util.assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` +\n `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`);\n const inputs = { x: $x };\n const attrs = { blockShape, crops };\n return ENGINE.runKernel(BatchToSpaceND, inputs, attrs);\n}\nexport const batchToSpaceND = op({ batchToSpaceND_ });\n//# sourceMappingURL=batch_to_space_nd.js.map","import { reshape } from './reshape';\nexport function xAs4D(x) {\n let x4D;\n if (x.rank === 0 || x.rank === 1) {\n x4D = reshape(x, [1, 1, 1, x.size]);\n }\n else if (x.rank === 2) {\n x4D = reshape(x, [1, 1, x.shape[0], x.shape[1]]);\n }\n else if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n else {\n x4D = x;\n }\n return x4D;\n}\n//# sourceMappingURL=batchnorm_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FusedBatchNorm } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { xAs4D } from './batchnorm_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `tf.Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNorm2d`\n * - `tf.batchNorm3d`\n * - `tf.batchNorm4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param offset An offset Tensor.\n * @param scale A scale Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction batchNorm_(x, mean, variance, offset, scale, varianceEpsilon) {\n if (varianceEpsilon == null) {\n varianceEpsilon = 0.001;\n }\n const $x = convertToTensor(x, 'x', 'batchNorm');\n const $mean = convertToTensor(mean, 'mean', 'batchNorm');\n const $variance = convertToTensor(variance, 'variance', 'batchNorm');\n let $scale;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNorm');\n }\n let $offset;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNorm');\n }\n util.assert($mean.rank === $variance.rank, () => 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert($offset == null || $mean.rank === $offset.rank, () => 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert($scale == null || $mean.rank === $scale.rank, () => 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n const x4D = xAs4D($x);\n const inputs = {\n x: x4D,\n scale: $scale,\n offset: $offset,\n mean: $mean,\n variance: $variance\n };\n const attrs = { varianceEpsilon };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(FusedBatchNorm, inputs, attrs);\n return reshape(res, $x.shape);\n}\nexport const batchNorm = op({ batchNorm_ });\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { clone } from './clone';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Broadcast an array to a compatible shape NumPy-style.\n *\n * The tensor's shape is compared to the broadcast shape from end to beginning.\n * Ones are prepended to the tensor's shape until is has the same length as\n * the broadcast shape. If input.shape[i]==shape[i], the (i+1)-th axis is\n * already broadcast-compatible. If input.shape[i]==1 and shape[i]==N, then\n * the input tensor is tiled N times along that axis (using tf.tile).\n *\n * @param input The tensor that is to be broadcasted.\n * @param shape The input is to be broadcast to this shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction broadcastTo_(x, shape) {\n let input = convertToTensor(x, 'broadcastTo', 'x');\n const xShape = input.shape;\n if (shape.some(d => !(d > 0) || d % 1 !== 0)) {\n throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`);\n }\n if (shape.length < input.rank) {\n throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input.rank}.`);\n }\n if (shape.length > input.rank) {\n const newShape = input.shape.slice();\n while (newShape.length < shape.length) {\n newShape.unshift(1);\n }\n input = reshape(input, newShape);\n }\n const inputShape = input.shape;\n const reps = Array.from(shape);\n for (let i = shape.length - 1; i >= 0; i--) {\n if (inputShape[i] === shape[i]) {\n reps[i] = 1;\n }\n else if (input.shape[i] !== 1) {\n throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`);\n }\n }\n const axes = reps.map((n, i) => n > 1 ? i : -1).filter(i => i >= 0);\n if (axes.length === 0) {\n return clone(input);\n }\n // TODO call broadcastTo kernel directly once backends implement broadcstTo\n const inputs = { x: input };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const broadcastTo = op({ broadcastTo_ });\n//# sourceMappingURL=broadcast_to.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Ceil } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction ceil_(x) {\n const $x = convertToTensor(x, 'x', 'ceil');\n const inputs = { x: $x };\n return ENGINE.runKernel(Ceil, inputs);\n}\nexport const ceil = op({ ceil_ });\n//# sourceMappingURL=ceil.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ClipByValue } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction clipByValue_(x, clipValueMin, clipValueMax) {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n const inputs = { x: $x };\n const attrs = { clipValueMin, clipValueMax };\n return ENGINE.runKernel(ClipByValue, inputs, attrs);\n}\nexport const clipByValue = op({ clipByValue_ });\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Complex } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real, imag) {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n const inputs = { real: $real, imag: $imag };\n return ENGINE.runKernel(Complex, inputs);\n}\nexport const complex = op({ complex_ });\n//# sourceMappingURL=complex.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n util.assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2d = op({ conv2d_ });\n//# sourceMappingURL=conv2d.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv1d_(x, filter, stride, pad, dataFormat = 'NWC', dilation = 1, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n let x3D = $x;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = reshape($x, [1, $x.shape[0], $x.shape[1]]);\n }\n util.assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n util.assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(stride, dilation), () => 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(dataFormat === 'NWC', () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`);\n const filter4D = reshape($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]);\n const input4D = reshape(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]);\n const strides = [1, stride];\n const dilations = [1, dilation];\n const conv2dDataFormat = 'NHWC';\n const res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode);\n if (reshapedTo3D) {\n return reshape(res, [res.shape[2], res.shape[3]]);\n }\n return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]);\n}\nexport const conv1d = op({ conv1d_ });\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape4D = xShape;\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n util.assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, inputShape: xShape4D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const conv2DBackpropInput = op({ conv2DBackpropInput_ });\n//# sourceMappingURL=conv2d_backprop_input.js.map","import { convertToTensor } from '../tensor_util_env';\nimport { conv2DBackpropInput } from './conv2d_backprop_input';\nimport { op } from './operation';\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n return conv2DBackpropInput(outputShape, $x, $filter, strides, pad, 'NHWC', dimRoundingMode);\n}\nexport const conv2dTranspose = op({ conv2dTranspose_ });\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropInputV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the input of a 3D convolution.\n *\n * @param xShape The shape of the input: [batch, depth, height, width,\n * in_channels]. If length of 4, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 5 or rank 4 of shape\n * `[batch, outDepth, outHeight, outWidth, in_channels]`.\n * If rank 4, batch of 1 is assumed.\n * @param filter The filter, rank 5, of shape\n * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideDepth, strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n */\nfunction conv3DBackpropInput_(xShape, dy, filter, strides, pad) {\n util.assert(xShape.length === dy.rank, () => `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n let xShape5D = xShape;\n let dy5D = dy;\n let reshapedTo5D = false;\n if (dy.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]];\n }\n const inDepth = xShape5D[4];\n const outDepth = dy5D.shape[4];\n util.assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` +\n `${xShape5D.length}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` +\n `rank ${dy5D.rank}`);\n util.assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` +\n `rank ${filter.rank}`);\n util.assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[3]}.`);\n util.assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[4]}.`);\n const inputs = { dy: dy5D, filter };\n const attrs = { pad, strides, inputShape: xShape5D };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const conv3DBackpropInput = op({ conv3DBackpropInput_ });\n//# sourceMappingURL=conv3d_backprop_input.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cos } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes cos of the input `tf.Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cos_(x) {\n const $x = convertToTensor(x, 'x', 'cos');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cos, inputs);\n}\nexport const cos = op({ cos_ });\n//# sourceMappingURL=cos.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cosh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction cosh_(x) {\n const $x = convertToTensor(x, 'x', 'cosh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Cosh, inputs);\n}\nexport const cosh = op({ cosh_ });\n//# sourceMappingURL=cosh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Cumsum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the cumulative sum of a `tf.Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Scan'}\n */\nfunction cumsum_(x, axis = 0, exclusive = false, reverse = false) {\n const $x = convertToTensor(x, 'x', 'cumsum');\n const inputs = { x: $x };\n const attrs = { axis, exclusive, reverse };\n return ENGINE.runKernel(Cumsum, inputs, attrs);\n}\nexport const cumsum = op({ cumsum_ });\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthToSpace } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Rearranges data from depth into blocks of spatial data. More specifically,\n * this op outputs a copy of the input tensor where values from the `depth`\n * dimension are moved in spatial blocks to the `height` and `width` dimensions.\n * The attr `blockSize` indicates the input block size and how the data is\n * moved.\n *\n * - Chunks of data of size `blockSize * blockSize` from depth are rearranged\n * into non-overlapping blocks of size `blockSize x blockSize`\n *\n * - The width the output tensor is `inputWidth * blockSize`, whereas the\n * height is `inputHeight * blockSize`\n *\n * - The Y, X coordinates within each block of the output image are determined\n * by the high order component of the input channel index\n *\n * - The depth of the input tensor must be divisible by `blockSize *\n * blockSize`\n *\n * The `dataFormat` attr specifies the layout of the input and output tensors\n * with the following options: \"NHWC\": [ `batch, height, width, channels` ]\n * \"NCHW\": [ `batch, channels, height, width` ]\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]);\n * const blockSize = 2;\n * const dataFormat = \"NHWC\";\n *\n * tf.depthToSpace(x, blockSize, dataFormat).print();\n * ```\n *\n * @param x The input tensor of rank 4\n * @param blockSIze An `int` that is `>= 2`. The size of the spatial block\n * @param dataFormat An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\"\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction depthToSpace_(x, blockSize, dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'depthToSpace');\n const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2];\n const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3];\n const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1];\n util.assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputHeight} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying\n ${inputWidth} and ${blockSize} for depthToSpace with input shape\n ${$x.shape}`);\n util.assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`);\n const inputs = { x: $x };\n const attrs = { blockSize, dataFormat };\n return ENGINE.runKernel(DepthToSpace, inputs, attrs);\n}\nexport const depthToSpace = op({ depthToSpace_ });\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction depthwiseConv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2d = op({ depthwiseConv2d_ });\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the grayscale dilation over the input `x`.\n *\n * @param x The input tensor, rank 3 or rank 4 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter tensor, rank 3, of shape\n * `[filterHeight, filterWidth, depth]`.\n * @param strides The strides of the sliding window for each dimension of the\n * input tensor: `[strideHeight, strideWidth]`.\n * If `strides` is a single number,\n * then `strideHeight == strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1*1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat Specify the data format of the input and output data.\n * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`\n * is a single number, then `dilationHeight == dilationWidth`. If it is\n * greater than 1, then all values of `strides` must be 1.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction dilation2d_(x, filter, strides, pad, dilations = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'dilation2d');\n const $filter = convertToTensor(filter, 'filter', 'dilation2d');\n util.assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ` +\n `${$x.rank}.`);\n util.assert($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n util.assert(dataFormat === 'NHWC', () => `Error in dilation2d: Only NHWC is currently supported, ` +\n `but got dataFormat of ${dataFormat}`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n reshapedTo4D = true;\n }\n const inputs = { x: x4D, filter: $filter };\n const attrs = { strides, pad, dilations };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(Dilation2D, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const dilation2d = op({ dilation2d_ });\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { FloorDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction floorDiv_(a, b) {\n let $a = convertToTensor(a, 'a', 'floorDiv');\n let $b = convertToTensor(b, 'b', 'floorDiv');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(FloorDiv, inputs);\n}\nexport const floorDiv = op({ floorDiv_ });\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { RealDiv } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { floorDiv } from './floorDiv';\nimport { op } from './operation';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction div_(a, b) {\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n }\n const inputs = { a: $a, b: $b };\n const attrs = {};\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(RealDiv, inputs, attrs);\n}\nexport const div = op({ div_ });\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2017 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 * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(inShape, outShape) {\n const inRank = inShape.length;\n const dims = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(inShape, outShape) {\n const result = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\nexport function assertAndGetBroadcastShape(shapeA, shapeB) {\n const result = [];\n const l = Math.max(shapeA.length, shapeB.length);\n for (let i = 0; i < l; i++) {\n let a = shapeA[shapeA.length - i - 1];\n if (a == null) {\n a = 1;\n }\n let b = shapeB[shapeB.length - i - 1];\n if (b == null) {\n b = 1;\n }\n if (a === 1) {\n result.unshift(b);\n }\n else if (b === 1) {\n result.unshift(a);\n }\n else if (a !== b) {\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n throw Error(errMsg);\n }\n else {\n result.unshift(a);\n }\n }\n return result;\n}\n//# sourceMappingURL=broadcast_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Equal } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction equal_(a, b) {\n let $a = convertToTensor(a, 'a', 'equal');\n let $b = convertToTensor(b, 'b', 'equal');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Equal, inputs);\n}\nexport const equal = op({ equal_ });\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Select } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { broadcastTo } from './broadcast_to';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same dtype as `a` and with shape that is\n * compatible with `a`.\n * @return A tensor with same dtype as `a` and `b`, and shape that is\n * broadcastable from `a` and `b`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction where_(condition, a, b) {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n // TODO: move this logic to forward function when the broadcastTo op is\n // implemented in WASM.\n // Find the broadcastable shape for $condition, $a, and $b.\n const broadcastShape = assertAndGetBroadcastShape(assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape);\n const $broadcastedCondition = broadcastTo($condition, broadcastShape);\n const $broadcastedA = broadcastTo($a, broadcastShape);\n const $broadcastedB = broadcastTo($b, broadcastShape);\n const inputs = {\n condition: $broadcastedCondition,\n t: $broadcastedA,\n e: $broadcastedB\n };\n return ENGINE.runKernel(Select, inputs);\n}\nexport const where = op({ where_ });\n//# sourceMappingURL=where.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { ZerosLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction zerosLike_(x) {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(ZerosLike, inputs);\n}\nexport const zerosLike = op({ zerosLike_ });\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { div } from './div';\nimport { equal } from './equal';\nimport { op } from './operation';\nimport { where } from './where';\nimport { zerosLike } from './zeros_like';\n/**\n * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0\n * if denominator is 0.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n * const c = tf.tensor1d([0, 0, 0, 0]);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n * const c = tf.scalar(0);\n *\n * a.divNoNan(b).print(); // or tf.divNoNan(a, b)\n * a.divNoNan(c).print(); // or tf.divNoNan(a, c)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction divNoNan_(a, b) {\n // TODO: Make this into its own kernel.\n let $a = convertToTensor(a, 'a', 'div');\n let $b = convertToTensor(b, 'b', 'div');\n [$a, $b] = makeTypesMatch($a, $b);\n const divResult = div($a, $b);\n const zeros = zerosLike(divResult);\n const bEqualsZero = equal($b, zeros);\n return where(bEqualsZero, zeros, divResult);\n}\nexport const divNoNan = op({ divNoNan_ });\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { matMul } from './mat_mul';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the dot product of two matrices and/or vectors, `t1` and `t2`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction dot_(t1, t2) {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n util.assert(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n if ($t1.rank === 1 && $t2.rank === 1) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, []);\n }\n else if ($t1.rank === 1 && $t2.rank === 2) {\n const t12D = reshape($t1, [1, -1]);\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul(t12D, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else if ($t1.rank === 2 && $t2.rank === 1) {\n const t22D = reshape($t2, [-1, 1]);\n const t1t2 = matMul($t1, t22D);\n return reshape(t1t2, [t1t2.size]);\n }\n else {\n const t22D = reshape($t2, [$t2.shape[0], $t2.shape[1]]);\n const t1t2 = matMul($t1, t22D);\n return t1t2;\n }\n}\nexport const dot = op({ dot_ });\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential linear element-wise: `x > 0 ? e ^ x - 1 : 0`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction elu_(x) {\n const $x = convertToTensor(x, 'x', 'elu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Elu, inputs);\n}\nexport const elu = op({ elu_ });\n//# sourceMappingURL=elu.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Erf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes gause error function of the input `tf.Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction erf_(x) {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.');\n if ($x.dtype === 'int32') {\n $x = cast($x, 'float32');\n }\n const inputs = { x: $x };\n return ENGINE.runKernel(Erf, inputs);\n}\nexport const erf = op({ erf_ });\n//# sourceMappingURL=erf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Exp } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction exp_(x) {\n const $x = convertToTensor(x, 'x', 'exp');\n const inputs = { x: $x };\n return ENGINE.runKernel(Exp, inputs);\n}\nexport const exp = op({ exp_ });\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ExpandDims } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction expandDims_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'expandDims', 'string_or_numeric');\n util.assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor');\n const inputs = { input: $x };\n const attrs = { dim: axis };\n return ENGINE.runKernel(ExpandDims, inputs, attrs);\n}\nexport const expandDims = op({ expandDims_ });\n//# sourceMappingURL=expand_dims.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Expm1 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes exponential of the input `tf.Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction expm1_(x) {\n const $x = convertToTensor(x, 'x', 'expm1');\n const inputs = { x: $x };\n return ENGINE.runKernel(Expm1, inputs);\n}\nexport const expm1 = op({ expm1_ });\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Tile } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Construct a tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction tile_(x, reps) {\n const $x = convertToTensor(x, 'x', 'tile', 'string_or_numeric');\n util.assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const inputs = { x: $x };\n const attrs = { reps };\n return ENGINE.runKernel(Tile, inputs, attrs);\n}\nexport const tile = op({ tile_ });\n//# sourceMappingURL=tile.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Floor } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes floor of input `tf.Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction floor_(x) {\n const $x = convertToTensor(x, 'x', 'floor');\n const inputs = { x: $x };\n return ENGINE.runKernel(Floor, inputs);\n}\nexport const floor = op({ floor_ });\n//# sourceMappingURL=floor.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { GatherV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n * @param batchDims Optional. The number of batch dimensions. It must be less\n * than or equal to rank(indices). Defaults to 0.\n * The output tensor will have shape of\n * `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction gather_(x, indices, axis = 0, batchDims = 0) {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n const inputs = { x: $x, indices: $indices };\n const attrs = { axis, batchDims };\n return ENGINE.runKernel(GatherV2, inputs, attrs);\n}\nexport const gather = op({ gather_ });\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Greater } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greater_(a, b) {\n let $a = convertToTensor(a, 'a', 'greater');\n let $b = convertToTensor(b, 'b', 'greater');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Greater, inputs);\n}\nexport const greater = op({ greater_ });\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { GreaterEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction greaterEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'greaterEqual');\n let $b = convertToTensor(b, 'b', 'greaterEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(GreaterEqual, inputs);\n}\nexport const greaterEqual = op({ greaterEqual_ });\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Imag } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the imaginary part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the imaginary part of each element in input considered as a complex number.\n * If input is real, a tensor of all zeros is returned.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.imag(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction imag_(input) {\n const $input = convertToTensor(input, 'input', 'imag');\n const inputs = { input: $input };\n return ENGINE.runKernel(Imag, inputs);\n}\nexport const imag = op({ imag_ });\n//# sourceMappingURL=imag.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsFinite } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are finite.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isFinite().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isFinite_(x) {\n const $x = convertToTensor(x, 'x', 'isFinite');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsFinite, inputs);\n}\nexport const isFinite = op({ isFinite_ });\n//# sourceMappingURL=is_finite.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsInf } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns which elements of x are Infinity or -Infinity.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isInf().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isInf_(x) {\n const $x = convertToTensor(x, 'x', 'isInf');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsInf, inputs);\n}\nexport const isInf = op({ isInf_ });\n//# sourceMappingURL=is_inf.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { IsNan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * RReturns which elements of x are NaN.\n *\n * ```js\n * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]);\n *\n * x.isNaN().print(); // or tf.isNaN(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction isNaN_(x) {\n const $x = convertToTensor(x, 'x', 'isNaN');\n const inputs = { x: $x };\n return ENGINE.runKernel(IsNan, inputs);\n}\nexport const isNaN = op({ isNaN_ });\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LeakyRelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction leakyRelu_(x, alpha = 0.2) {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(LeakyRelu, inputs, attrs);\n}\nexport const leakyRelu = op({ leakyRelu_ });\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Less } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction less_(a, b) {\n let $a = convertToTensor(a, 'a', 'less');\n let $b = convertToTensor(b, 'b', 'less');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Less, inputs);\n}\nexport const less = op({ less_ });\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LessEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction lessEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'lessEqual');\n let $b = convertToTensor(b, 'b', 'lessEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LessEqual, inputs);\n}\nexport const lessEqual = op({ lessEqual_ });\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRN } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction localResponseNormalization_(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(util.isInt(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an ` +\n `integer but got depthRadius ${depthRadius}.`);\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n const inputs = { x: x4D };\n const attrs = { depthRadius, bias, alpha, beta };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(LRN, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n else {\n return res;\n }\n}\nexport const localResponseNormalization = op({ localResponseNormalization_ });\n//# sourceMappingURL=local_response_normalization.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log_(x) {\n const $x = convertToTensor(x, 'x', 'log');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log, inputs);\n}\nexport const log = op({ log_ });\n//# sourceMappingURL=log.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Log1p } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes natural logarithm of the input `tf.Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction log1p_(x) {\n const $x = convertToTensor(x, 'x', 'log1p');\n const inputs = { x: $x };\n return ENGINE.runKernel(Log1p, inputs);\n}\nexport const log1p = op({ log1p_ });\n//# sourceMappingURL=log1p.js.map","/**\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 */\nimport { ENGINE } from './engine';\nimport { Tensor, Variable } from './tensor';\nimport { convertToTensor, convertToTensorArray } from './tensor_util_env';\nimport * as util from './util';\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grad(f) must be a function');\n return (x, dy) => {\n // x can be of any dtype, thus null as the last argument.\n const $x = convertToTensor(x, 'x', 'tf.grad', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0];\n });\n };\n}\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction grads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in grads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' +\n 'of `Tensor`s or `TensorLike`s');\n // args can be of any dtype, thus null as the last argument.\n const $args = convertToTensorArray(args, 'args', 'tf.grads', 'string_or_numeric');\n const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null;\n return ENGINE.tidy(() => {\n const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy);\n if ($dy != null) {\n util.assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n/**\n * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrad(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function');\n return (x, dy) => {\n util.assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const { grads, value } = ENGINE.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return { grad: grads[0], value };\n };\n}\n/**\n * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction valueAndGrads(f) {\n util.assert(util.isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function');\n return (args, dy) => {\n util.assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' +\n 'tensors');\n util.assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENGINE.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of variables to compute the gradients with respect\n * to. Defaults to all trainable variables.\n * @returns An object with the following keys and values:\n * - `value`: The value of the function `f`.\n * - `grads`: A map from the names of the variables to the gradients.\n * If the `varList` argument is provided explicitly and contains a subset of\n * non-trainable variables, this map in the return value will contain keys\n * that map the names of the non-trainable variables to `null`.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction variableGrads(f, varList) {\n util.assert(util.isFunction(f), () => 'The f passed in variableGrads(f) must be a function');\n util.assert(varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n const specifiedVarList = varList != null;\n if (!specifiedVarList) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENGINE.registeredVariables) {\n varList.push(ENGINE.registeredVariables[varName]);\n }\n }\n const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null;\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` +\n `be trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n const allowNoGradients = true;\n const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients);\n util.assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' +\n 'the loss function y=f(x). Please make sure the operations that ' +\n 'use variables are inside the function f passed to minimize().');\n util.assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n const namedGrads = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n if (specifiedNonTrainable != null) {\n // If varList is explicitly provided and contains non-trainable values,\n // add them to the returned gradients with `null` values.\n specifiedNonTrainable.forEach(v => namedGrads[v.name] = null);\n }\n return { value, grads: namedGrads };\n}\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}`\n * and returns another function `g(...inputs)` which takes the same inputs as\n * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients\n * with respect to each input of `f` are computed using `f().gradFunc`.\n *\n * The `save` function passsed to `f` should be used for saving tensors needed\n * in the gradient. And the `saved` passed to the `gradFunc` is a\n * `NamedTensorMap`, which contains those saved tensor.\n *\n * ```js\n * const customOp = tf.customGrad((x, save) => {\n * // Save x to make sure it's available later for the gradient.\n * save([x]);\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {\n * value: x.square(),\n * // Note `saved.x` which points to the `x` we saved earlier.\n * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())]\n * };\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc`\n * returns the custom gradients of `f` with respect to its inputs.\n *\n * @doc {heading: 'Training', subheading: 'Gradients'}\n */\nfunction customGrad(f) {\n return ENGINE.customGrad(f);\n}\nfunction checkGrads(grads) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\nexport { customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };\n//# sourceMappingURL=gradients.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Neg } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction neg_(x) {\n const $x = convertToTensor(x, 'x', 'neg');\n const inputs = { x: $x };\n return ENGINE.runKernel(Neg, inputs);\n}\nexport const neg = op({ neg_ });\n//# sourceMappingURL=neg.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softplus } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction softplus_(x) {\n const $x = convertToTensor(x, 'x', 'softplus');\n const inputs = { x: $x };\n return ENGINE.runKernel(Softplus, inputs);\n}\nexport const softplus = op({ softplus_ });\n//# sourceMappingURL=softplus.js.map","/**\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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { mul } from './mul';\nimport { neg } from './neg';\nimport { op } from './operation';\nimport { sigmoid } from './sigmoid';\nimport { softplus } from './softplus';\n/**\n * Computes log sigmoid of the input `tf.Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction logSigmoid_(x) {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n // Use a custom gradient to maintain previous implementation.\n // There is no LogSigmoid kernel in TF so we can't use engine.runKernel\n // directly\n const customOp = customGrad((x) => {\n // TODO(yassogba) we can remove the chained softplus call here only\n // after backends have modualrized softplus at which point we can call\n // engine runKernel(..., Sotfplus, ...) directly.\n const value = neg(softplus(neg(x)));\n const gradFunc = (dy) => {\n const derX = mul(dy, sigmoid(neg(x)));\n return derX;\n };\n return { value, gradFunc };\n });\n return customOp($x);\n}\nexport const logSigmoid = op({ logSigmoid_ });\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Max } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the maximum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and an\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction max_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'max');\n const inputs = { x: $x };\n const attrs = { reductionIndices: axis, keepDims };\n return ENGINE.runKernel(Max, inputs, attrs);\n}\nexport const max = op({ max_ });\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Sub } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `tf.Tensor` to subtract from.\n * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction sub_(a, b) {\n let $a = convertToTensor(a, 'a', 'sub');\n let $b = convertToTensor(b, 'b', 'sub');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Sub, inputs);\n}\nexport const sub = op({ sub_ });\n//# sourceMappingURL=sub.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the sum of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If axes has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction sum_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'sum');\n if ($x.dtype === 'bool') {\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Sum, inputs, attrs);\n}\nexport const sum = op({ sum_ });\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { customGrad } from '../gradients';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { mul } from './mul';\nimport { op } from './operation';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log softmax.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.logSoftmax().print(); // or tf.logSoftmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param axis The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction logSoftmax_(logits, axis = -1) {\n const $logits = convertToTensor(logits, 'logits', 'logSoftmax');\n if (axis === -1) {\n axis = $logits.rank - 1;\n }\n if (axis !== $logits.rank - 1) {\n throw Error('Log Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and axis was ${axis}`);\n }\n // const forward: ForwardFunc = (backend, save) => {\n // const keepDims = true;\n // const xMax = max(logits, axis, true);\n // const shifted = sub(logits, xMax);\n // const value =\n // sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis,\n // keepDims)));\n // save([value]);\n // return value;\n // };\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((logits, save) => {\n const keepDims = true;\n const xMax = max(logits, axis, true);\n const shifted = sub(logits, xMax);\n const value = sub(cast(shifted, 'float32'), log(sum(exp(shifted), axis, keepDims)));\n save([value]);\n const gradFunc = (dy, saved) => {\n const [value] = saved;\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n };\n return { value, gradFunc };\n });\n return customOp($logits);\n // TODO Use Engine.runKernel when CPU/WebGL/WASM backends implement this.\n // const inputs: LogSoftmaxInputs = {logits: $logits};\n // const attrs: LogSoftmaxAttrs = {axis};\n // return ENGINE.runKernel(\n // LogSoftmax, inputs as {} as NamedTensorMap,\n // attrs as {} as NamedAttrMap);\n}\nexport const logSoftmax = op({ logSoftmax_ });\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes, rank) {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\nexport function combineLocations(outputLoc, reduceLoc, axes) {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n }\n else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\nexport function computeOutAndReduceShapes(aShape, axes) {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\nexport function expandShapeToKeepDim(shape, axes) {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\nexport function assertAxesAreInnerMostDims(msg, axes, rank) {\n util.assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is necessary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes, rank) {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes) {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\nexport function getInnerMostAxes(numAxes, rank) {\n const res = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n//# sourceMappingURL=axis_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { add } from './add';\nimport { expandShapeToKeepDim } from './axis_util';\nimport { exp } from './exp';\nimport { log } from './log';\nimport { max } from './max';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { sub } from './sub';\nimport { sum } from './sum';\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction logSumExp_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n const axes = parseAxisParam(axis, $x.shape);\n const xMax = max($x, axes, true /* keepDims */);\n const a = sub($x, xMax);\n const b = exp(a);\n const c = sum(b, axes);\n const d = log(c);\n const res = add(reshape(xMax, d.shape), d);\n if (keepDims) {\n const newShape = expandShapeToKeepDim(res.shape, axes);\n return reshape(res, newShape);\n }\n return res;\n}\nexport const logSumExp = op({ logSumExp_ });\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalAnd } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a AND b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalAnd_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalAnd, inputs);\n}\nexport const logicalAnd = op({ logicalAnd_ });\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalNot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalNot_(x) {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n const inputs = { x: $x };\n return ENGINE.runKernel(LogicalNot, inputs);\n}\nexport const logicalNot = op({ logicalNot_ });\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LogicalOr } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalOr_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(LogicalOr, inputs);\n}\nexport const logicalOr = op({ logicalOr_ });\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { logicalAnd } from './logical_and';\nimport { logicalNot } from './logical_not';\nimport { logicalOr } from './logical_or';\nimport { op } from './operation';\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction logicalXor_(a, b) {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n // x ^ y = (x | y) & ~(x & y)\n return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b)));\n}\nexport const logicalXor = op({ logicalXor_ });\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool_(x, filterSize, strides, pad, dimRoundingMode) {\n const $x = convertToTensor(x, 'x', 'maxPool');\n const dilations = 1;\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in maxPool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const maxPool = op({ maxPool_ });\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Maximum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `tf.maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction maximum_(a, b) {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Maximum, inputs);\n}\nexport const maximum = op({ maximum_ });\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Mean } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the mean of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction mean_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'mean');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Mean, inputs, attrs);\n}\nexport const mean = op({ mean_ });\n//# sourceMappingURL=mean.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeZerosTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\n/**\n * Creates a `tf.Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function zeros(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = zeros(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=zeros.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { makeOnesTypedArray, sizeFromShape } from '../util';\nimport { complex } from './complex';\nimport { zeros } from './zeros';\n/**\n * Creates a `tf.Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function ones(shape, dtype = 'float32') {\n if (dtype === 'complex64') {\n const real = ones(shape, 'float32');\n const imag = zeros(shape, 'float32');\n return complex(real, imag);\n }\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=ones.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ENGINE } from '../engine';\nimport { Min } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction min_(x, axis = null, keepDims = false) {\n const $x = convertToTensor(x, 'x', 'min');\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Min, inputs, attrs);\n}\nexport const min = op({ min_ });\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Minimum } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction minimum_(a, b) {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n [$a, $b] = makeTypesMatch($a, $b);\n if ($a.dtype === 'bool') {\n $a = cast($a, 'int32');\n $b = cast($b, 'int32');\n }\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Minimum, inputs);\n}\nexport const minimum = op({ minimum_ });\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MirrorPad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` using mirror padding.\n *\n * This operation implements the `REFLECT` and `SYMMETRIC` modes of pad.\n *\n * ```js\n * const x = tf.range(0, 9).reshape([1, 1, 3, 3]);\n * x.mirrorPad([[0, 0], [0, 0], [2, 2], [2, 2]], 'reflect').print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * In \"reflect\" mode, the padded regions do not include the borders,\n * while in \"symmetric\" mode the padded regions do include the borders.\n * For example, if the input is `[1, 2, 3]` and paddings is `[0, 2]`,\n * then the output is `[1, 2, 3, 2, 1]` in \"reflect\" mode, and\n * `[1, 2, 3, 3, 2]` in \"symmetric\" mode.\n * If `mode` is \"reflect\" then both `paddings[D, 0]` and `paddings[D, 1]`\n * must be no greater than `x.shape[D] - 1`. If mode is \"symmetric\"\n * then both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than\n * `x.shape[D]`\n * @param mode String to specify padding mode. Can be `'reflect' | 'symmetric'`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction mirrorPad_(x, paddings, mode) {\n util.assert(mode === 'reflect' || mode === 'symmetric', () => `Invalid mode. Mode must be either reflect or symmetric. ` +\n `Got ${mode}.`);\n const $x = convertToTensor(x, 'x', 'mirrorPad');\n if ($x.rank === 0) {\n throw new Error('mirrorPad(scalar) is not defined. ' +\n 'Pass non-scalar to mirrorPad');\n }\n util.assert(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. ` +\n `Got ${paddings.length}.`);\n const shapeOffset = mode === 'reflect' ? 1 : 0;\n for (let i = 0; i < $x.rank; i++) {\n util.assert(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`);\n util.assert(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset &&\n paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal ` +\n `to ${$x.shape[i] - shapeOffset} or less than 0 for input of ` +\n `shape ${$x.shape}`);\n }\n const attrs = { paddings, mode };\n const inputs = { x: $x };\n return ENGINE.runKernel(MirrorPad, inputs, attrs);\n}\nexport const mirrorPad = op({ mirrorPad_ });\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Mod } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `tf.modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction mod_(a, b) {\n let $a = convertToTensor(a, 'a', 'mod');\n let $b = convertToTensor(b, 'b', 'mod');\n [$a, $b] = makeTypesMatch($a, $b);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(Mod, inputs);\n}\nexport const mod = op({ mod_ });\n//# sourceMappingURL=mod.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction square_(x) {\n const $x = convertToTensor(x, 'x', 'square');\n const attrs = {};\n return ENGINE.runKernel('Square', { x: $x }, attrs);\n}\nexport const square = op({ square_ });\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { NotEqual } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Logical'}\n */\nfunction notEqual_(a, b) {\n let $a = convertToTensor(a, 'a', 'notEqual');\n let $b = convertToTensor(b, 'b', 'notEqual');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n return ENGINE.runKernel(NotEqual, inputs);\n}\nexport const notEqual = op({ notEqual_ });\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { OneHot } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(indices, depth, onValue = 1, offValue = 0) {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n const inputs = { indices: $indices };\n const attrs = { depth, onValue, offValue };\n return ENGINE.runKernel(OneHot, inputs, attrs);\n}\nexport const oneHot = op({ oneHot_ });\n//# sourceMappingURL=one_hot.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { OnesLike } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction onesLike_(x) {\n const $x = convertToTensor(x, 'x', 'onesLike');\n const inputs = { x: $x };\n return ENGINE.runKernel(OnesLike, inputs);\n}\nexport const onesLike = op({ onesLike_ });\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { PadV2 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Pads a `tf.Tensor` with a given value and paddings.\n *\n * This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,\n * refer to `tf.mirrorPad`\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction pad_(x, paddings, constantValue = 0) {\n const $x = convertToTensor(x, 'x', 'pad');\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n const attrs = { paddings, constantValue };\n const inputs = { x: $x };\n return ENGINE.runKernel(PadV2, inputs, attrs);\n}\nexport const pad = op({ pad_ });\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SpaceToBatchND } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * This operation divides \"spatial\" dimensions `[1, ..., M]` of the input into\n * a grid of blocks of shape `blockShape`, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions `[1, ..., M]` correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to `paddings`. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must have shape `[M]`, all values must\n * be >= 1.\n * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=\n * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad\n * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It\n * is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input\n * according to `paddings` to produce `padded` of shape paddedShape.\n *\n * 2. Reshape `padded` to `reshapedPadded` of shape:\n * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape`\n *\n * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`\n * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the\n * batch dimension, producing an output tensor of shape:\n * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ...,\n * paddedShape[M] / blockShape[M-1]] + remainingShape`\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction spaceToBatchND_(x, blockShape, paddings) {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n util.assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`);\n util.assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`);\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a &&\n ((b + paddings[i - 1][0] + paddings[i - 1][1]) %\n blockShape[i - 1] ===\n 0);\n }\n return a;\n }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`);\n const inputs = { x: $x };\n const attrs = { blockShape, paddings };\n return ENGINE.runKernel(SpaceToBatchND, inputs, attrs);\n}\nexport const spaceToBatchND = op({ spaceToBatchND_ });\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { avgPool } from './avg_pool';\nimport { batchToSpaceND } from './batch_to_space_nd';\nimport * as conv_util from './conv_util';\nimport { maxPool } from './max_pool';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nimport { spaceToBatchND } from './space_to_batch_nd';\n/**\n * Performs an N-D pooling operation\n *\n * @param input The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param windowShape The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param poolingType The type of pooling, either 'max' or 'avg'.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction pool_(input, windowShape, poolingType, pad, dilations, strides) {\n if (dilations == null) {\n dilations = [1, 1];\n }\n if (strides == null) {\n strides = 1;\n }\n if (pad === 0) {\n pad = 'valid';\n }\n const $x = convertToTensor(input, 'x', 'maxPool');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in pool: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n const convInfo = conv_util.computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad);\n const dilation = [convInfo.dilationHeight, convInfo.dilationWidth];\n // The following implementation does batchToSpace(pool(spaceToBatch(x)))\n // whenever dilation > 1 since the TF kernels do not support dilation > 1.\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L1037\n let basePadding;\n if (pad === 'same') {\n basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation);\n }\n else {\n basePadding = [[0, 0], [0, 0]];\n }\n const isDilationOne = dilation[0] === 1 && dilation[1] === 1;\n const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding);\n const convertedPad = isDilationOne ? pad : 'valid';\n const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding);\n const forwardOp = poolingType === 'avg' ?\n () => avgPool(convertedX, windowShape, strides, convertedPad) :\n () => maxPool(convertedX, windowShape, strides, convertedPad);\n const y = forwardOp();\n const res = isDilationOne ? y : batchToSpaceND(y, dilation, adjustedCrops);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\n// Helper function to compute crops and paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/array_ops.py#L2184\nfunction requiredSpaceToBatchPaddings(inputShape, blockShape, basePadding) {\n const padStart = basePadding.map(b => b[0]);\n const origPadEnd = basePadding.map(b => b[1]);\n const fullInputShape = inputShape.concat(padStart, origPadEnd);\n const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b);\n const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]);\n const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]);\n const crops = blockShape.map((_, i) => [0, padEndExtra[i]]);\n return [paddings, crops];\n}\n// Helper function to compute base paddings for pool with dilation > 1.\n// tslint:disable-next-line:max-line-length\n// https://github.com/tensorflow/tensorflow/blob/50f6bb67dc98c9b74630b6047aae7a4f8a40fd02/tensorflow/python/ops/nn_ops.py#L524\nfunction withSpaceToBatchBasePaddings(filterShape, dilation) {\n // Spatial dimensions of the filters and the upsampled filters in which we\n // introduce (rate - 1) zeros between consecutive filter values.\n const dilatedFilterShape = filterShape.map((s, i) => {\n return s + (s - 1) * (dilation[i] - 1);\n });\n const padExtraShape = dilatedFilterShape.map(s => s - 1);\n // When padding is odd, we pad more at end, following the same\n // convention as conv2d.\n const padExtraStart = padExtraShape.map(s => Math.floor(s / 2));\n const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]);\n return padExtraShape.map((_, i) => {\n return [padExtraStart[i], padExtraEnd[i]];\n });\n}\nexport const pool = op({ pool_ });\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pow } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the power of one `tf.Tensor` to another. Supports broadcasting.\n *\n * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `tf.Tensor` to pow element-wise.\n * @param exp The exponent `tf.Tensor` to pow element-wise.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction pow_(base, exp) {\n let $base = convertToTensor(base, 'base', 'pow');\n let $exp = convertToTensor(exp, 'exp', 'pow');\n [$base, $exp] = makeTypesMatch($base, $exp);\n const inputs = { a: $base, b: $exp };\n return ENGINE.runKernel(Pow, inputs);\n}\nexport const pow = op({ pow_ });\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prelu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction prelu_(x, alpha) {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n const inputs = { x: $x, alpha: $alpha };\n return ENGINE.runKernel(Prelu, inputs);\n}\nexport const prelu = op({ prelu_ });\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Prod } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { cast } from './cast';\nimport { op } from './operation';\n/**\n * Computes the product of elements across dimensions of a `tf.Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in\n * `axes`. If `keepDims` is true, the reduced dimensions are retained with\n * length 1. If `axes` has no entries, all dimensions are reduced, and a\n * `tf.Tensor` with a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.prod().print(); // or tf.prod(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.prod(axis).print(); // or tf.prod(x, axis)\n * ```\n *\n * @param x The input tensor to compute the product over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n *\n * @doc {heading: 'Operations', subheading: 'Reduction'}\n */\nfunction prod_(x, axis = null, keepDims = false) {\n let $x = convertToTensor(x, 'x', 'prod');\n if ($x.dtype === 'bool') {\n // bool is not an allowed type for the underlying kernel.\n $x = cast($x, 'int32');\n }\n const inputs = { x: $x };\n const attrs = { axis, keepDims };\n return ENGINE.runKernel(Prod, inputs, attrs);\n}\nexport const prod = op({ prod_ });\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Real } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns the real part of a complex (or real) tensor.\n *\n * Given a tensor input, this operation returns a tensor of type float that is\n * the real part of each element in input considered as a complex number.\n *\n * If the input is real, it simply makes a clone.\n *\n * ```js\n * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]);\n * tf.real(x).print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction real_(input) {\n const $input = convertToTensor(input, 'input', 'real');\n const inputs = { input: $input };\n return ENGINE.runKernel(Real, inputs);\n}\nexport const real = op({ real_ });\n//# sourceMappingURL=real.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reciprocal } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction reciprocal_(x) {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n const inputs = { x: $x };\n return ENGINE.runKernel(Reciprocal, inputs);\n}\nexport const reciprocal = op({ reciprocal_ });\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear element-wise: `max(x, 0)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu_(x) {\n const $x = convertToTensor(x, 'x', 'relu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu, inputs);\n}\nexport const relu = op({ relu_ });\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Relu6 } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes rectified linear 6 element-wise: `min(max(x, 0), 6)`.\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 8]);\n *\n * x.relu6().print(); // or tf.relu6(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction relu6_(x) {\n const $x = convertToTensor(x, 'x', 'relu6');\n const inputs = { x: $x };\n return ENGINE.runKernel(Relu6, inputs);\n}\nexport const relu6 = op({ relu6_ });\n//# sourceMappingURL=relu6.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Reverse } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Reverses a `tf.Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction reverse_(x, axis) {\n const $x = convertToTensor(x, 'x', 'reverse');\n const inputs = { x: $x };\n const attrs = { dims: axis };\n return ENGINE.runKernel(Reverse, inputs, attrs);\n}\nexport const reverse = op({ reverse_ });\n//# sourceMappingURL=reverse.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Round } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes round of input `tf.Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction round_(x) {\n const $x = convertToTensor(x, 'x', 'round');\n const inputs = { x: $x };\n return ENGINE.runKernel(Round, inputs);\n}\nexport const round = op({ round_ });\n//# sourceMappingURL=round.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Rsqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes reciprocal of square root of the input `tf.Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction rsqrt_(x) {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Rsqrt, inputs);\n}\nexport const rsqrt = op({ rsqrt_ });\n//# sourceMappingURL=rsqrt.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray } from '../util';\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(values, shape, inferredShape, dtype) {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(`Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error('values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values];\n }\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values, [], true);\n return ENGINE.makeTensor(values, shape, dtype);\n}\n//# sourceMappingURL=tensor_ops_util.js.map","/**\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 */\nimport { isTypedArray } from '../util';\nimport { makeTensor } from './tensor_ops_util';\n/**\n * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tf.tensor`, but in general\n * we recommend using `tf.scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function scalar(value, dtype) {\n if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) &&\n dtype !== 'complex64') {\n throw new Error('Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean|string)');\n }\n if (dtype === 'string' && isTypedArray(value) &&\n !(value instanceof Uint8Array)) {\n throw new Error('When making a scalar from encoded string, ' +\n 'the value must be `Uint8Array`.');\n }\n const shape = [];\n const inferredShape = [];\n return makeTensor(value, shape, inferredShape, dtype);\n}\n//# sourceMappingURL=scalar.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Selu } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction selu_(x) {\n const $x = convertToTensor(x, 'x', 'selu');\n const inputs = { x: $x };\n return ENGINE.runKernel(Selu, inputs);\n}\nexport const selu = op({ selu_ });\n//# sourceMappingURL=selu.js.map","import { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { conv2d } from './conv2d';\nimport { depthwiseConv2d } from './depthwise_conv2d';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n *\n * @doc {heading: 'Operations', subheading: 'Convolution'}\n */\nfunction separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation = [1, 1], dataFormat = 'NHWC') {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n let x4D = $x;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]);\n }\n if (dataFormat === 'NCHW') {\n throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n util.assert(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but ` +\n `got rank ${$depthwiseFilter.rank}.`);\n util.assert($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise ` +\n `filter must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const separableConv2d = op({ separableConv2d_ });\n//# sourceMappingURL=separable_conv2d.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sign } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sign_(x) {\n const $x = convertToTensor(x, 'x', 'sign');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sign, inputs);\n}\nexport const sign = op({ sign_ });\n//# sourceMappingURL=sign.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sin } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sin_(x) {\n const $x = convertToTensor(x, 'x', 'sin');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sin, inputs);\n}\nexport const sin = op({ sin_ });\n//# sourceMappingURL=sin.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sinh } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sinh_(x) {\n const $x = convertToTensor(x, 'x', 'sinh');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sinh, inputs);\n}\nexport const sinh = op({ sinh_ });\n//# sourceMappingURL=sinh.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Softmax } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Normalization'}\n */\nfunction softmax_(logits, dim = -1) {\n const $logits = convertToTensor(logits, 'logits', 'softmax', 'float32');\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error('Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n const inputs = { logits: $logits };\n const attrs = { dim };\n return ENGINE.runKernel(Softmax, inputs, attrs);\n}\nexport const softmax = op({ softmax_ });\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { FFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the inner-most\n * dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.fft().print(); // tf.spectral.fft(x).print();\n * ```\n * @param input The complex input to compute an fft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction fft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.fft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(FFT, inputs);\n}\nexport const fft = op({ fft_ });\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { IFFT } from '../../kernel_names';\nimport { assert } from '../../util';\nimport { op } from '../operation';\n/**\n * Inverse fast Fourier transform.\n *\n * Computes the inverse 1-dimensional discrete Fourier transform over the\n * inner-most dimension of input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([1, 2, 3]);\n * const x = tf.complex(real, imag);\n *\n * x.ifft().print(); // tf.spectral.ifft(x).print();\n * ```\n * @param input The complex input to compute an ifft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction ifft_(input) {\n assert(input.dtype === 'complex64', () => `The dtype for tf.spectral.ifft() must be complex64 ` +\n `but got ${input.dtype}.`);\n const inputs = { input };\n return ENGINE.runKernel(IFFT, inputs);\n}\nexport const ifft = op({ ifft_ });\n//# sourceMappingURL=ifft.js.map","/**\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 */\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { mul } from '../mul';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { reverse } from '../reverse';\nimport { scalar } from '../scalar';\nimport { slice } from '../slice';\nimport { ifft } from './ifft';\n/**\n * Inversed real value input fast Fourier transform.\n *\n * Computes the 1-dimensional inversed discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n * const imag = tf.tensor1d([0, 0, 0]);\n * const x = tf.complex(real, imag);\n *\n * x.irfft().print();\n * ```\n * @param input The real value input to compute an irfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction irfft_(input) {\n const innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let ret;\n if (innerDimensionSize <= 2) {\n const complexInput = reshape(input, [batch, innerDimensionSize]);\n ret = ifft(complexInput);\n }\n else {\n // The length of unique components of the DFT of a real-valued signal\n // is 2 * (input_len - 1)\n const outputShape = [batch, 2 * (innerDimensionSize - 1)];\n const realInput = reshape(real(input), [batch, innerDimensionSize]);\n const imagInput = reshape(imag(input), [batch, innerDimensionSize]);\n const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1);\n const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1));\n const r = concat([realInput, realConjugate], 1);\n const i = concat([imagInput, imagConjugate], 1);\n const complexInput = reshape(complex(r, i), [outputShape[0], outputShape[1]]);\n ret = ifft(complexInput);\n }\n ret = real(ret);\n // reshape the result if the input is 3D tensor.\n if (input.rank === 3 && input.shape[0] !== 0) {\n const temp = ret;\n const batch = input.shape[0];\n ret = reshape(ret, [batch, ret.shape[0] / batch, ret.shape[1]]);\n temp.dispose();\n }\n return ret;\n}\nexport const irfft = op({ irfft_ });\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SplitV } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Splits a `tf.Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * Can contain one -1 indicating that dimension is to be inferred.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction split_(x, numOrSizeSplits, axis = 0) {\n const $x = convertToTensor(x, 'x', 'split');\n const inputs = { x: $x };\n const attr = { numOrSizeSplits, axis };\n return ENGINE.runKernel(SplitV, inputs, attr);\n}\nexport const split = op({ split_ });\n//# sourceMappingURL=split.js.map","/**\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 */\nimport { assert } from '../../util';\nimport { complex } from '../complex';\nimport { concat } from '../concat';\nimport { imag } from '../imag';\nimport { op } from '../operation';\nimport { real } from '../real';\nimport { reshape } from '../reshape';\nimport { slice } from '../slice';\nimport { split } from '../split';\nimport { zeros } from '../zeros';\nimport { zerosLike } from '../zeros_like';\nimport { fft } from './fft';\n/**\n * Real value input fast Fourier transform.\n *\n * Computes the 1-dimensional discrete Fourier transform over the\n * inner-most dimension of the real input.\n *\n * ```js\n * const real = tf.tensor1d([1, 2, 3]);\n *\n * real.rfft().print();\n * ```\n * @param input The real value input to compute an rfft over.\n *\n * @doc {heading: 'Operations', subheading: 'Spectral', namespace: 'spectral'}\n */\nfunction rfft_(input, fftLength) {\n assert(input.dtype === 'float32', () => `The dtype for rfft() must be real value but got ${input.dtype}`);\n let innerDimensionSize = input.shape[input.shape.length - 1];\n const batch = input.size / innerDimensionSize;\n let adjustedInput;\n if (fftLength != null && fftLength < innerDimensionSize) {\n // Need to crop\n const begin = input.shape.map(v => 0);\n const size = input.shape.map(v => v);\n size[input.shape.length - 1] = fftLength;\n adjustedInput = slice(input, begin, size);\n innerDimensionSize = fftLength;\n }\n else if (fftLength != null && fftLength > innerDimensionSize) {\n // Need to pad with zeros\n const zerosShape = input.shape.map(v => v);\n zerosShape[input.shape.length - 1] = fftLength - innerDimensionSize;\n adjustedInput = concat([input, zeros(zerosShape)], input.shape.length - 1);\n innerDimensionSize = fftLength;\n }\n else {\n adjustedInput = input;\n }\n // Complement the input with zero imaginary numbers.\n const zerosInput = zerosLike(adjustedInput);\n const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]);\n const ret = fft(complexInput);\n // Exclude complex conjugations. These conjugations are put symmetrically.\n const half = Math.floor(innerDimensionSize / 2) + 1;\n const realValues = real(ret);\n const imagValues = imag(ret);\n const realComplexConjugate = split(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1);\n const imagComplexConjugate = split(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1);\n const outputShape = adjustedInput.shape.slice();\n outputShape[adjustedInput.shape.length - 1] = half;\n return reshape(complex(realComplexConjugate[0], imagComplexConjugate[0]), outputShape);\n}\nexport const rfft = op({ rfft_ });\n//# sourceMappingURL=rfft.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Sqrt } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction sqrt_(x) {\n const $x = convertToTensor(x, 'x', 'sqrt');\n const inputs = { x: $x };\n return ENGINE.runKernel(Sqrt, inputs);\n}\nexport const sqrt = op({ sqrt_ });\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { SquaredDifference } from '../kernel_names';\nimport { makeTypesMatch } from '../tensor_util';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assertAndGetBroadcastShape } from './broadcast_util';\nimport { op } from './operation';\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n *\n * @doc {heading: 'Operations', subheading: 'Arithmetic'}\n */\nfunction squaredDifference_(a, b) {\n let $a = convertToTensor(a, 'a', 'squaredDifference');\n let $b = convertToTensor(b, 'b', 'squaredDifference');\n [$a, $b] = makeTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n const inputs = { a: $a, b: $b };\n const attrs = {};\n return ENGINE.runKernel(SquaredDifference, inputs, attrs);\n}\nexport const squaredDifference = op({ squaredDifference_ });\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { squeezeShape } from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Removes dimensions of size 1 from the shape of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction squeeze_(x, axis) {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, squeezeShape($x.shape, axis).newShape);\n}\nexport const squeeze = op({ squeeze_ });\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Pack } from '../kernel_names';\nimport { convertToTensorArray } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction stack_(tensors, axis = 0) {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack', 'string_or_numeric');\n util.assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack');\n if ($tensors.length > 0) {\n util.assert(axis <= $tensors[0].rank, () => 'Axis must be <= rank of the tensor');\n }\n const inputs = $tensors;\n const attrs = { axis };\n return ENGINE.runKernel(Pack, inputs, attrs);\n}\nexport const stack = op({ stack_ });\n//# sourceMappingURL=stack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Step } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction step_(x, alpha = 0.0) {\n const $x = convertToTensor(x, 'x', 'step');\n const inputs = { x: $x };\n const attrs = { alpha };\n return ENGINE.runKernel(Step, inputs, attrs);\n}\nexport const step = op({ step_ });\n//# sourceMappingURL=step.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { StridedSlice } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input tensor (x). Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * const t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of beginMask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of endMask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param shrinkAxisMask: a bitmask where bit i implies that\n * the ith specification should shrink the dimensionality. begin and end must\n * imply a slice of size 1 in the dimension.\n *\n * @doc {heading: 'Operations', subheading: 'Slicing and Joining'}\n */\nfunction stridedSlice_(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n const inputs = { x: $x };\n const attrs = {\n begin,\n end,\n strides,\n beginMask,\n endMask,\n ellipsisMask,\n newAxisMask,\n shrinkAxisMask\n };\n return ENGINE.runKernel(StridedSlice, inputs, attrs);\n}\nexport const stridedSlice = op({ stridedSlice_ });\n//# sourceMappingURL=strided_slice.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Tan } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Computes tan of the input `tf.Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n *\n * @doc {heading: 'Operations', subheading: 'Basic math'}\n */\nfunction tan_(x) {\n const $x = convertToTensor(x, 'x', 'tan');\n const inputs = { x: $x };\n return ENGINE.runKernel(Tan, inputs);\n}\nexport const tan = op({ tan_ });\n//# sourceMappingURL=tan.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { TopK } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { op } from './operation';\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tf.tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `tf.Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction topk_(x, k = 1, sorted = true) {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n const inputs = { x: $x };\n const attrs = { k, sorted };\n const [values, indices] = ENGINE.runKernel(TopK, inputs, attrs);\n return { values, indices };\n}\nexport const topk = op({ topk_ });\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unique } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert } from '../util';\nimport { op } from './operation';\n/**\n * Finds unique elements along an axis of a tensor.\n *\n * It returns a tensor `values` containing all of the unique elements along the\n * `axis` of the given tensor `x` in the same order that they occur along the\n * `axis` in `x`; `x` does not need to be sorted. It also returns a tensor\n * `indices` the same size as the number of the elements in `x` along the `axis`\n * dimension. It contains the index in the unique output `values`.\n *\n * ```js\n * // A 1-D tensor\n * const a = tf.tensor1d([1, 1, 2, 4, 4, 4, 7, 8, 8]);\n * const {values, indices} = tf.unique(a);\n * values.print(); // [1, 2, 4, 7, 8,]\n * indices.print(); // [0, 0, 1, 2, 2, 2, 3, 4, 4]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=0\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 0)\n * values.print(); // [[1, 0, 0],\n * // [2, 0, 0]]\n * indices.print(); // [0, 0, 1]\n * ```\n *\n * ```js\n * // A 2-D tensor with axis=1\n * //\n * // 'a' is: [[1, 0, 0],\n * // [1, 0, 0],\n * // [2, 0, 0]]\n * const a = tf.tensor2d([[1, 0, 0], [1, 0, 0], [2, 0, 0]]);\n * const {values, indices} = tf.unique(a, 1)\n * values.print(); // [[1, 0],\n * // [1, 0],\n * // [2, 0]]\n * indices.print(); // [0, 1, 1]\n * ```\n * @param x A tensor (int32, string, bool).\n * @param axis The axis of the tensor to find the unique elements.\n * @returns [uniqueElements, indices] (see above for details)\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nfunction unique_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unique', 'string_or_numeric');\n assert($x.rank > 0, () => 'The input tensor must be at least 1D');\n const inputs = { x: $x };\n const attrs = { axis };\n const [values, indices] = ENGINE.runKernel(Unique, inputs, attrs);\n return { values, indices };\n}\nexport const unique = op({ unique_ });\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport { assert, isInt } from '../util';\nimport { op } from './operation';\n/**\n * Computes the sum along segments of a `tf.Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `tf.Tensor` that will be summed along its segments.\n * @param segmentIds A `tf.Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`.\n *\n * @doc {heading: 'Operations', subheading: 'Segment'}\n */\nfunction unsortedSegmentSum_(x, segmentIds, numSegments) {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert(isInt(numSegments), () => 'numSegments must be of dtype int');\n const inputs = { x: $x, segmentIds: $segmentIds };\n const attrs = { numSegments };\n return ENGINE.runKernel(UnsortedSegmentSum, inputs, attrs);\n}\nexport const unsortedSegmentSum = op({ unsortedSegmentSum_ });\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Unpack } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n *\n * @doc {heading: 'Tensors', subheading: 'Slicing and Joining'}\n */\nfunction unstack_(x, axis = 0) {\n const $x = convertToTensor(x, 'x', 'unstack', 'string_or_numeric');\n util.assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`);\n const inputs = { value: $x };\n const attrs = { axis };\n return ENGINE.runKernel(Unpack, inputs, attrs);\n}\nexport const unstack = op({ unstack_ });\n//# sourceMappingURL=unstack.js.map","/**\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 */\nimport { ENGINE } from '../engine';\nimport { Transpose } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x, perm) {\n const $x = convertToTensor(x, 'x', 'transpose');\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n if ($x.rank <= 1) {\n return $x.clone();\n }\n const inputs = { x: $x };\n const attrs = { perm };\n return ENGINE.runKernel(Transpose, inputs, attrs);\n}\nexport const transpose = op({ transpose_ });\n//# sourceMappingURL=transpose.js.map","/**\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 */\nimport { convertToTensor } from '../tensor_util_env';\nimport { parseAxisParam } from '../util';\nimport { abs } from './abs';\nimport * as axis_util from './axis_util';\nimport { max } from './max';\nimport { min } from './min';\nimport { op } from './operation';\nimport { pow } from './pow';\nimport { reshape } from './reshape';\nimport { scalar } from './scalar';\nimport { sqrt } from './sqrt';\nimport { square } from './square';\nimport { sum } from './sum';\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction norm_(x, ord = 'euclidean', axis = null, keepDims = false) {\n x = convertToTensor(x, 'x', 'norm');\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return reshape(norm, keepDimsShape);\n}\nfunction normImpl(x, p, axis = null) {\n if (x.rank === 0) {\n return abs(x);\n }\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(reshape(x, [-1]), p, axis);\n }\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n Array.isArray(axis) && axis.length === 1) {\n if (p === 1) {\n return sum(abs(x), axis);\n }\n if (p === Infinity) {\n return max(abs(x), axis);\n }\n if (p === -Infinity) {\n return min(abs(x), axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return sqrt(sum(pow(abs(x), scalar(2, 'int32')), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n // matrix (assumption axis[0] < axis[1])\n if (Array.isArray(axis) && axis.length === 2) {\n if (p === 1) {\n return max(sum(abs(x), axis[0]), axis[1] - 1);\n }\n if (p === Infinity) {\n return max(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === -Infinity) {\n return min(sum(abs(x), axis[1]), axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return sqrt(sum(square(x), axis));\n }\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\nexport const norm = op({ norm_ });\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv2DBackpropFilter } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels].\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n util.assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1];\n const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1];\n util.assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dataFormat, dimRoundingMode, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs);\n}\nexport const conv2DBackpropFilter = op({ conv2DBackpropFilter_ });\n//# sourceMappingURL=conv2d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropFilter } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let x4D = x;\n if (x.rank === 3) {\n x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);\n }\n let dy4D = dy;\n if (dy4D.rank === 3) {\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { x: x4D, dy: dy4D };\n const attrs = { strides, pad, dimRoundingMode, dilations, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs);\n}\nexport const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { DepthwiseConv2dNativeBackpropInput } from '../kernel_names';\nimport { op } from './operation';\nimport { reshape } from './reshape';\nfunction depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad, dilations = [1, 1], dimRoundingMode) {\n let dy4D = dy;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);\n }\n const inputs = { dy: dy4D, filter };\n const attrs = { strides, pad, dimRoundingMode, dilations, inputShape: xShape };\n const res = \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ });\n//# sourceMappingURL=depthwise_conv2d_native_backprop_input.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeBilinear } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * Bilinear resize a single 3D image or a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to `false`. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assume pixel centers\n * are at 0.5, which would make the floating point coordinates of the top\n * left pixel 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeBilinear_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeBilinear, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeBilinear = op({ resizeBilinear_ });\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../../engine';\nimport { ResizeNearestNeighbor } from '../../kernel_names';\nimport { convertToTensor } from '../../tensor_util_env';\nimport * as util from '../../util';\nimport { op } from '../operation';\nimport { reshape } from '../reshape';\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of\n * half the actual dimensions, and yields more accurate resizes. This flag\n * would also make the floating point coordinates of the top left pixel\n * 0.5, 0.5.\n *\n * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}\n */\nfunction resizeNearestNeighbor_(images, size, alignCorners = false, halfPixelCenters = false) {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(size.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert($images.dtype === 'float32' || $images.dtype === 'int32', () => '`images` must have `int32` or `float32` as dtype');\n util.assert(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, ` +\n `alignCorners must be false.`);\n let batchImages = $images;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);\n }\n const [] = size;\n const inputs = { images: batchImages };\n const attrs = { alignCorners, halfPixelCenters, size };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const resizeNearestNeighbor = op({ resizeNearestNeighbor_ });\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { abs } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.abs = function () {\n this.throwIfDisposed();\n return abs(this);\n};\n//# sourceMappingURL=abs.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acos = function () {\n this.throwIfDisposed();\n return acos(this);\n};\n//# sourceMappingURL=acos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { acosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.acosh = function () {\n this.throwIfDisposed();\n return acosh(this);\n};\n//# sourceMappingURL=acosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { add } from '../../ops/add';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.add = function (b) {\n this.throwIfDisposed();\n return add(this, b);\n};\n//# sourceMappingURL=add.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { all } from '../../ops/all';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.all = function (axis, keepDims) {\n this.throwIfDisposed();\n return all(this, axis, keepDims);\n};\n//# sourceMappingURL=all.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { any } from '../../ops/any';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.any = function (axis, keepDims) {\n this.throwIfDisposed();\n return any(this, axis, keepDims);\n};\n//# sourceMappingURL=any.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMax } from '../../ops/arg_max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMax = function (axis) {\n this.throwIfDisposed();\n return argMax(this, axis);\n};\n//# sourceMappingURL=arg_max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { argMin } from '../../ops/arg_min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.argMin = function (axis) {\n this.throwIfDisposed();\n return argMin(this, axis);\n};\n//# sourceMappingURL=arg_min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\nimport { assert } from '../../util';\n/**\n * Converts a size-1 `tf.Tensor` to a `tf.Scalar`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asScalar = function () {\n this.throwIfDisposed();\n assert(this.size === 1, () => 'The array must have only 1 element.');\n return reshape(this, []);\n};\n//# sourceMappingURL=as_scalar.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts a `tf.Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.asType = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=as_type.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor1D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as1D = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=as1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor2D`.\n *\n * @param rows Number of rows in `tf.Tensor2D`.\n * @param columns Number of columns in `tf.Tensor2D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as2D = function (rows, columns) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns]);\n};\n//# sourceMappingURL=as2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor3D`.\n *\n * @param rows Number of rows in `tf.Tensor3D`.\n * @param columns Number of columns in `tf.Tensor3D`.\n * @param depth Depth of `tf.Tensor3D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as3D = function (rows, columns, depth) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth]);\n};\n//# sourceMappingURL=as3d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor4D`.\n *\n * @param rows Number of rows in `tf.Tensor4D`.\n * @param columns Number of columns in `tf.Tensor4D`.\n * @param depth Depth of `tf.Tensor4D`.\n * @param depth2 4th dimension of `tf.Tensor4D`.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as4D = function (rows, columns, depth, depth2) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2]);\n};\n//# sourceMappingURL=as4d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Converts a `tf.Tensor` to a `tf.Tensor5D`.\n *\n * @param rows Number of rows in `tf.Tensor5D`.\n * @param columns Number of columns in `tf.Tensor5D`.\n * @param depth Depth of `tf.Tensor5D`.\n * @param depth2 4th dimension of `tf.Tensor5D`.\n * @param depth3 5th dimension of 'tf.Tensor5D'\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.as5D = function (rows, columns, depth, depth2, depth3) {\n this.throwIfDisposed();\n return reshape(this, [rows, columns, depth, depth2, depth3]);\n};\n//# sourceMappingURL=as5d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asin = function () {\n this.throwIfDisposed();\n return asin(this);\n};\n//# sourceMappingURL=asin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { asinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.asinh = function () {\n this.throwIfDisposed();\n return asinh(this);\n};\n//# sourceMappingURL=asinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan = function () {\n this.throwIfDisposed();\n return atan(this);\n};\n//# sourceMappingURL=atan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { atan2 } from '../../ops/atan2';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atan2 = function (b) {\n this.throwIfDisposed();\n return atan2(this, b);\n};\n//# sourceMappingURL=atan2.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { atanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.atanh = function () {\n this.throwIfDisposed();\n return atanh(this);\n};\n//# sourceMappingURL=atanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { avgPool } from '../../ops/avg_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.avgPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return avgPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=avg_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchToSpaceND } from '../../ops/batch_to_space_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchToSpaceND = function (blockShape, crops) {\n this.throwIfDisposed();\n return batchToSpaceND(this, blockShape, crops);\n};\n//# sourceMappingURL=batch_to_space_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { batchNorm } from '../../ops/batchnorm';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.batchNorm = function (mean, variance, offset, scale, varianceEpsilon) {\n this.throwIfDisposed();\n return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);\n};\n//# sourceMappingURL=batchnorm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { broadcastTo } from '../../ops/broadcast_to';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.broadcastTo = function (shape) {\n this.throwIfDisposed();\n return broadcastTo(this, shape);\n};\n//# sourceMappingURL=broadcast_to.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cast = function (dtype) {\n this.throwIfDisposed();\n return cast(this, dtype);\n};\n//# sourceMappingURL=cast.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ceil } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ceil = function () {\n this.throwIfDisposed();\n return ceil(this);\n};\n//# sourceMappingURL=ceil.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { clipByValue } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.clipByValue = function (min, max) {\n this.throwIfDisposed();\n return clipByValue(this, min, max);\n};\n//# sourceMappingURL=clip_by_value.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { concat } from '../../ops/concat';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.concat = function (x, axis) {\n this.throwIfDisposed();\n if (x instanceof Tensor) {\n x = [x];\n }\n return concat([this, ...x], axis);\n};\n//# sourceMappingURL=concat.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv1d } from '../../ops/conv1d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) {\n this.throwIfDisposed();\n return conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n};\n//# sourceMappingURL=conv1d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2dTranspose } from '../../ops/conv2d_transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2dTranspose =\n function (filter, outputShape, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=conv2d_transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { conv2d } from '../../ops/conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n};\n//# sourceMappingURL=conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cos } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cos = function () {\n this.throwIfDisposed();\n return cos(this);\n};\n//# sourceMappingURL=cos.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cosh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cosh = function () {\n this.throwIfDisposed();\n return cosh(this);\n};\n//# sourceMappingURL=cosh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { cumsum } from '../../ops/cumsum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.cumsum = function (axis, exclusive, reverse) {\n this.throwIfDisposed();\n return cumsum(this, axis, exclusive, reverse);\n};\n//# sourceMappingURL=cumsum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthToSpace } from '../../ops/depth_to_space';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthToSpace = function (blockSize, dataFormat) {\n this.throwIfDisposed();\n return depthToSpace(this, blockSize, dataFormat);\n};\n//# sourceMappingURL=depth_to_space.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { depthwiseConv2d } from '../../ops/depthwise_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.depthwiseConv2d =\n function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) {\n this.throwIfDisposed();\n return depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n };\n//# sourceMappingURL=depthwise_conv2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dilation2d } from '../../ops/dilation2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dilation2d =\n function (filter, strides, pad, dilations, dataFormat) {\n this.throwIfDisposed();\n return dilation2d(this, filter, strides, pad, dilations, dataFormat);\n };\n//# sourceMappingURL=dilation2d.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { divNoNan } from '../../ops/div_no_nan';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.divNoNan = function (b) {\n this.throwIfDisposed();\n return divNoNan(this, b);\n};\n//# sourceMappingURL=div_no_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { div } from '../../ops/div';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.div = function (b) {\n this.throwIfDisposed();\n return div(this, b);\n};\n//# sourceMappingURL=div.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { dot } from '../../ops/dot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.dot = function (b) {\n this.throwIfDisposed();\n return dot(this, b);\n};\n//# sourceMappingURL=dot.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { elu } from '../../ops/elu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.elu = function () {\n this.throwIfDisposed();\n return elu(this);\n};\n//# sourceMappingURL=elu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { equal } from '../../ops/equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.equal = function (b) {\n this.throwIfDisposed();\n return equal(this, b);\n};\n//# sourceMappingURL=equal.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { erf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.erf = function () {\n this.throwIfDisposed();\n return erf(this);\n};\n//# sourceMappingURL=erf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { exp } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.exp = function () {\n this.throwIfDisposed();\n return exp(this);\n};\n//# sourceMappingURL=exp.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { expandDims } from '../../ops/expand_dims';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expandDims = function (axis) {\n this.throwIfDisposed();\n return expandDims(this, axis);\n};\n//# sourceMappingURL=expand_dims.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { expm1 } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.expm1 = function () {\n this.throwIfDisposed();\n return expm1(this);\n};\n//# sourceMappingURL=expm1.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { fft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.fft = function () {\n this.throwIfDisposed();\n return fft(this);\n};\n//# sourceMappingURL=fft.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Flatten a Tensor to a 1D array.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.flatten = function () {\n this.throwIfDisposed();\n return reshape(this, [this.size]);\n};\n//# sourceMappingURL=flatten.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { floor } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floor = function () {\n this.throwIfDisposed();\n return floor(this);\n};\n//# sourceMappingURL=floor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { floorDiv } from '../../ops/floorDiv';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.floorDiv = function (b) {\n this.throwIfDisposed();\n return floorDiv(this, b);\n};\n//# sourceMappingURL=floorDiv.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { gather } from '../../ops/gather';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.gather = function (indices, axis) {\n this.throwIfDisposed();\n return gather(this, indices, axis);\n};\n//# sourceMappingURL=gather.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greaterEqual } from '../../ops/greater_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greaterEqual = function (b) {\n this.throwIfDisposed();\n return greaterEqual(this, b);\n};\n//# sourceMappingURL=greater_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { greater } from '../../ops/greater';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.greater = function (b) {\n this.throwIfDisposed();\n return greater(this, b);\n};\n//# sourceMappingURL=greater.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { ifft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.ifft = function () {\n this.throwIfDisposed();\n return ifft(this);\n};\n//# sourceMappingURL=ifft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { irfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.irfft = function () {\n this.throwIfDisposed();\n return irfft(this);\n};\n//# sourceMappingURL=irfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isFinite } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isFinite = function () {\n this.throwIfDisposed();\n return isFinite(this);\n};\n//# sourceMappingURL=is_finite.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isInf } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isInf = function () {\n this.throwIfDisposed();\n return isInf(this);\n};\n//# sourceMappingURL=is_inf.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { isNaN } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.isNaN = function () {\n this.throwIfDisposed();\n return isNaN(this);\n};\n//# sourceMappingURL=is_nan.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { leakyRelu } from '../../ops/leaky_relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.leakyRelu = function (alpha) {\n this.throwIfDisposed();\n return leakyRelu(this, alpha);\n};\n//# sourceMappingURL=leaky_relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { lessEqual } from '../../ops/less_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.lessEqual = function (b) {\n this.throwIfDisposed();\n return lessEqual(this, b);\n};\n//# sourceMappingURL=less_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { less } from '../../ops/less';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.less = function (b) {\n this.throwIfDisposed();\n return less(this, b);\n};\n//# sourceMappingURL=less.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { localResponseNormalization } from '../../ops/local_response_normalization';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.localResponseNormalization =\n function (depthRadius, bias, alpha, beta) {\n this.throwIfDisposed();\n return localResponseNormalization(this, depthRadius, bias, alpha, beta);\n };\n//# sourceMappingURL=local_response_normalization.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSigmoid = function () {\n this.throwIfDisposed();\n return logSigmoid(this);\n};\n//# sourceMappingURL=log_sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { logSoftmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSoftmax = function (axis) {\n this.throwIfDisposed();\n return logSoftmax(this, axis);\n};\n//# sourceMappingURL=log_softmax.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logSumExp } from '../../ops/log_sum_exp';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logSumExp = function (axis, keepDims) {\n this.throwIfDisposed();\n return logSumExp(this, axis, keepDims);\n};\n//# sourceMappingURL=log_sum_exp.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log = function () {\n this.throwIfDisposed();\n return log(this);\n};\n//# sourceMappingURL=log.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { log1p } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.log1p = function () {\n this.throwIfDisposed();\n return log1p(this);\n};\n//# sourceMappingURL=log1p.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalAnd } from '../../ops/logical_and';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalAnd = function (b) {\n this.throwIfDisposed();\n return logicalAnd(this, b);\n};\n//# sourceMappingURL=logical_and.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalNot } from '../../ops/logical_not';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalNot = function () {\n this.throwIfDisposed();\n return logicalNot(this);\n};\n//# sourceMappingURL=logical_not.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalOr } from '../../ops/logical_or';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalOr = function (b) {\n this.throwIfDisposed();\n return logicalOr(this, b);\n};\n//# sourceMappingURL=logical_or.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { logicalXor } from '../../ops/logical_xor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.logicalXor = function (b) {\n this.throwIfDisposed();\n return logicalXor(this, b);\n};\n//# sourceMappingURL=logical_xor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { matMul } from '../../ops/mat_mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.matMul = function (b, transposeA, transposeB) {\n this.throwIfDisposed();\n return matMul(this, b, transposeA, transposeB);\n};\n//# sourceMappingURL=mat_mul.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maxPool } from '../../ops/max_pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maxPool =\n function (filterSize, strides, pad, dimRoundingMode) {\n this.throwIfDisposed();\n return maxPool(this, filterSize, strides, pad, dimRoundingMode);\n };\n//# sourceMappingURL=max_pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { max } from '../../ops/max';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.max = function (axis, keepDims) {\n this.throwIfDisposed();\n return max(this, axis, keepDims);\n};\n//# sourceMappingURL=max.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { maximum } from '../../ops/maximum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.maximum = function (b) {\n this.throwIfDisposed();\n return maximum(this, b);\n};\n//# sourceMappingURL=maximum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mean } from '../../ops/mean';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mean = function (axis, keepDims) {\n this.throwIfDisposed();\n return mean(this, axis, keepDims);\n};\n//# sourceMappingURL=mean.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { min } from '../../ops/min';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.min = function (axis, keepDims) {\n this.throwIfDisposed();\n return min(this, axis, keepDims);\n};\n//# sourceMappingURL=min.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { minimum } from '../../ops/minimum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.minimum = function (b) {\n this.throwIfDisposed();\n return minimum(this, b);\n};\n//# sourceMappingURL=minimum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mirrorPad } from '../../ops/mirror_pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mirrorPad = function (paddings, mode) {\n this.throwIfDisposed();\n return mirrorPad(this, paddings, mode);\n};\n//# sourceMappingURL=mirror_pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mod } from '../../ops/mod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mod = function (b) {\n this.throwIfDisposed();\n return mod(this, b);\n};\n//# sourceMappingURL=mod.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { mul } from '../../ops/mul';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.mul = function (b) {\n this.throwIfDisposed();\n return mul(this, b);\n};\n//# sourceMappingURL=mul.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { neg } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.neg = function () {\n this.throwIfDisposed();\n return neg(this);\n};\n//# sourceMappingURL=neg.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { norm } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.norm = function (ord, axis, keepDims) {\n this.throwIfDisposed();\n return norm(this, ord, axis, keepDims);\n};\n//# sourceMappingURL=norm.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { notEqual } from '../../ops/not_equal';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.notEqual = function (b) {\n this.throwIfDisposed();\n return notEqual(this, b);\n};\n//# sourceMappingURL=not_equal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { oneHot } from '../../ops/one_hot';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.oneHot = function (depth, onValue = 1, offValue = 0) {\n this.throwIfDisposed();\n return oneHot(this, depth, onValue, offValue);\n};\n//# sourceMappingURL=one_hot.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { onesLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.onesLike = function () {\n this.throwIfDisposed();\n return onesLike(this);\n};\n//# sourceMappingURL=ones_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pad } from '../../ops/pad';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pad = function (paddings, constantValue) {\n this.throwIfDisposed();\n return pad(this, paddings, constantValue);\n};\n//# sourceMappingURL=pad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pool } from '../../ops/pool';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pool = function (windowShape, poolingType, padding, dilationRate, strides) {\n this.throwIfDisposed();\n return pool(this, windowShape, poolingType, padding, dilationRate, strides);\n};\n//# sourceMappingURL=pool.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { pow } from '../../ops/pow';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.pow = function (exp) {\n this.throwIfDisposed();\n return pow(this, exp);\n};\n//# sourceMappingURL=pow.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prelu } from '../../ops/prelu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prelu = function (alpha) {\n this.throwIfDisposed();\n return prelu(this, alpha);\n};\n//# sourceMappingURL=prelu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { prod } from '../../ops/prod';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.prod = function (axis, keepDims) {\n this.throwIfDisposed();\n return prod(this, axis, keepDims);\n};\n//# sourceMappingURL=prod.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { reciprocal } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reciprocal = function () {\n this.throwIfDisposed();\n return reciprocal(this);\n};\n//# sourceMappingURL=reciprocal.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu } from '../../ops/relu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu = function () {\n this.throwIfDisposed();\n return relu(this);\n};\n//# sourceMappingURL=relu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { relu6 } from '../../ops/relu6';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.relu6 = function () {\n this.throwIfDisposed();\n return relu6(this);\n};\n//# sourceMappingURL=relu6.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.reshapeAs = function (x) {\n this.throwIfDisposed();\n return reshape(this, x.shape);\n};\n//# sourceMappingURL=reshape_as.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reshape } from '../../ops/reshape';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reshape = function (shape) {\n this.throwIfDisposed();\n return reshape(this, shape);\n};\n//# sourceMappingURL=reshape.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeBilinear } from '../../ops/image/resize_bilinear';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeBilinear =\n function (newShape2D, alignCorners, halfPixelCenters) {\n this.throwIfDisposed();\n return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters);\n };\n//# sourceMappingURL=resize_bilinear.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { resizeNearestNeighbor } from '../../ops/image/resize_nearest_neighbor';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.resizeNearestNeighbor =\n function (newShape2D, alignCorners, halfFloatCenters) {\n this.throwIfDisposed();\n return resizeNearestNeighbor(this, newShape2D, alignCorners, halfFloatCenters);\n };\n//# sourceMappingURL=resize_nearest_neighbor.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { reverse } from '../../ops/reverse';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.reverse = function (axis) {\n this.throwIfDisposed();\n return reverse(this, axis);\n};\n//# sourceMappingURL=reverse.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rfft } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rfft = function () {\n this.throwIfDisposed();\n return rfft(this);\n};\n//# sourceMappingURL=rfft.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { round } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.round = function () {\n this.throwIfDisposed();\n return round(this);\n};\n//# sourceMappingURL=round.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { rsqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.rsqrt = function () {\n this.throwIfDisposed();\n return rsqrt(this);\n};\n//# sourceMappingURL=rsqrt.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { selu } from '../../ops/selu';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.selu = function () {\n this.throwIfDisposed();\n return selu(this);\n};\n//# sourceMappingURL=selu.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { separableConv2d } from '../../ops/separable_conv2d';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.separableConv2d =\n function (depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) {\n this.throwIfDisposed();\n return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat);\n };\n//# sourceMappingURL=separable_conv2d.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sigmoid } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sigmoid = function () {\n this.throwIfDisposed();\n return sigmoid(this);\n};\n//# sourceMappingURL=sigmoid.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sign } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sign = function () {\n this.throwIfDisposed();\n return sign(this);\n};\n//# sourceMappingURL=sign.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sin } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sin = function () {\n this.throwIfDisposed();\n return sin(this);\n};\n//# sourceMappingURL=sin.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sinh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sinh = function () {\n this.throwIfDisposed();\n return sinh(this);\n};\n//# sourceMappingURL=sinh.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { slice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.slice = function (begin, size) {\n this.throwIfDisposed();\n return slice(this, begin, size);\n};\n//# sourceMappingURL=slice.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softmax } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softmax = function (dim) {\n this.throwIfDisposed();\n return softmax(this, dim);\n};\n//# sourceMappingURL=softmax.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { softplus } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.softplus = function () {\n this.throwIfDisposed();\n return softplus(this);\n};\n//# sourceMappingURL=softplus.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { spaceToBatchND } from '../../ops/space_to_batch_nd';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.spaceToBatchND = function (blockShape, paddings) {\n this.throwIfDisposed();\n return spaceToBatchND(this, blockShape, paddings);\n};\n//# sourceMappingURL=space_to_batch_nd.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { split } from '../../ops/split';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.split = function (numOrSizeSplits, axis) {\n this.throwIfDisposed();\n return split(this, numOrSizeSplits, axis);\n};\n//# sourceMappingURL=split.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { sqrt } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sqrt = function () {\n this.throwIfDisposed();\n return sqrt(this);\n};\n//# sourceMappingURL=sqrt.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { square } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.square = function () {\n this.throwIfDisposed();\n return square(this);\n};\n//# sourceMappingURL=square.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squaredDifference } from '../../ops/squared_difference';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squaredDifference = function (b) {\n this.throwIfDisposed();\n return squaredDifference(this, b);\n};\n//# sourceMappingURL=squared_difference.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { squeeze } from '../../ops/squeeze';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.squeeze = function (axis) {\n this.throwIfDisposed();\n return squeeze(this, axis);\n};\n//# sourceMappingURL=squeeze.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { stack } from '../../ops/stack';\nimport { getGlobalTensorClass, Tensor } from '../../tensor';\ngetGlobalTensorClass().prototype.stack = function (x, axis) {\n this.throwIfDisposed();\n const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x];\n return stack(tensorsToBeStacked, axis);\n};\n//# sourceMappingURL=stack.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { step } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.step = function (alpha) {\n this.throwIfDisposed();\n return step(this, alpha);\n};\n//# sourceMappingURL=step.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { stridedSlice } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.stridedSlice = function (begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n this.throwIfDisposed();\n return stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask);\n};\n//# sourceMappingURL=strided_slice.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sub } from '../../ops/sub';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sub = function (b) {\n this.throwIfDisposed();\n return sub(this, b);\n};\n//# sourceMappingURL=sub.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { sum } from '../../ops/sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.sum = function (axis, keepDims) {\n this.throwIfDisposed();\n return sum(this, axis, keepDims);\n};\n//# sourceMappingURL=sum.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tan } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tan = function () {\n this.throwIfDisposed();\n return tan(this);\n};\n//# sourceMappingURL=tan.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { tanh } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tanh = function () {\n this.throwIfDisposed();\n return tanh(this);\n};\n//# sourceMappingURL=tanh.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { tile } from '../../ops/tile';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.tile = function (reps) {\n this.throwIfDisposed();\n return tile(this, reps);\n};\n//# sourceMappingURL=tile.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `bool`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toBool = function () {\n this.throwIfDisposed();\n return cast(this, 'bool');\n};\n//# sourceMappingURL=to_bool.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `float32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toFloat = function () {\n this.throwIfDisposed();\n return cast(this, 'float32');\n};\n//# sourceMappingURL=to_float.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { cast } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\n/**\n * Casts the array to type `int32`\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\ngetGlobalTensorClass().prototype.toInt = function () {\n this.throwIfDisposed();\n return cast(this, 'int32');\n};\n//# sourceMappingURL=to_int.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { topk } from '../../ops/topk';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.topk = function (k, sorted) {\n this.throwIfDisposed();\n return topk(this, k, sorted);\n};\n//# sourceMappingURL=topk.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { transpose } from '../../ops/transpose';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.transpose = function (perm) {\n this.throwIfDisposed();\n return transpose(this, perm);\n};\n//# sourceMappingURL=transpose.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unique } from '../../ops/unique';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unique = function (axis) {\n this.throwIfDisposed();\n return unique(this, axis);\n};\n//# sourceMappingURL=unique.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unsortedSegmentSum } from '../../ops/unsorted_segment_sum';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unsortedSegmentSum =\n function (segmentIds, numSegments) {\n this.throwIfDisposed();\n return unsortedSegmentSum(this, segmentIds, numSegments);\n };\n//# sourceMappingURL=unsorted_segment_sum.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { unstack } from '../../ops/unstack';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.unstack = function (axis) {\n this.throwIfDisposed();\n return unstack(this, axis);\n};\n//# sourceMappingURL=unstack.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { where } from '../../ops/where';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.where = function (condition, x) {\n this.throwIfDisposed();\n return where(condition, this, x);\n};\n//# sourceMappingURL=where.js.map","/**\n * @license\n * Copyright 2020 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// TODO update import path once op is modularized.\nimport { zerosLike } from '../../ops/ops';\nimport { getGlobalTensorClass } from '../../tensor';\ngetGlobalTensorClass().prototype.zerosLike = function () {\n this.throwIfDisposed();\n return zerosLike(this);\n};\n//# sourceMappingURL=zeros_like.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Abs } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const absGradConfig = {\n kernelName: Abs,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, step(cast(x, 'float32'), -1)) };\n }\n};\n//# sourceMappingURL=Abs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acosGradConfig = {\n kernelName: Acos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = square(cast(x, 'float32'));\n const b = sqrt(sub(scalar(1), a));\n return neg(div(dy, b));\n }\n };\n }\n};\n//# sourceMappingURL=Acos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Acosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const acoshGradConfig = {\n kernelName: Acosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(sub(square(cast(x, 'float32')), 1));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Acosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Add } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const addGradConfig = {\n kernelName: Add,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Add_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AddN } from '../kernel_names';\nexport const addNGradConfig = {\n kernelName: AddN,\n saveAllInputs: true,\n gradFunc: (dy, saved) => {\n const ders = {};\n saved.forEach((_, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n }\n};\n//# sourceMappingURL=AddN_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMax } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMaxGradConfig = {\n kernelName: ArgMax,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMax_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { ArgMin } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const argMinGradConfig = {\n kernelName: ArgMin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => zerosLike(x) };\n }\n};\n//# sourceMappingURL=ArgMin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const asinGradConfig = {\n kernelName: Asin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sqrt(sub(scalar(1), square(cast(x, 'float32'))))) };\n }\n};\n//# sourceMappingURL=Asin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Asinh } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { scalar } from '../ops/scalar';\nimport { sqrt } from '../ops/sqrt';\nimport { square } from '../ops/square';\nexport const asinhGradConfig = {\n kernelName: Asinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const a = sqrt(add(scalar(1), square(cast(x, 'float32'))));\n return div(dy, a);\n }\n };\n }\n};\n//# sourceMappingURL=Asinh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan2 } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const atan2GradConfig = {\n kernelName: Atan2,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const d = add(square(a), square(b));\n let res = mul(dy, div(b, d));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n const d = add(square(a), square(b));\n let res = neg(mul(dy, div(a, d)));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Atan2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atan } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const atanGradConfig = {\n kernelName: Atan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(square(cast(x, 'float32')), 1)) };\n }\n};\n//# sourceMappingURL=Atan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Atanh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nimport { scalar } from '../ops/scalar';\nexport const atanhGradConfig = {\n kernelName: Atanh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, sub(scalar(1), square(cast(x, 'float32')))) };\n }\n};\n//# sourceMappingURL=Atanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d avg pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank4 of shape\n * [batchSize, depth, height, width, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction avgPool3dGrad_(dy, input, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'avgPool3dGrad');\n const $input = convertToTensor(input, 'input', 'avgPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in avgPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const avgPool3dGrad = op({ avgPool3dGrad_ });\n//# sourceMappingURL=avg_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool3D } from '../kernel_names';\nimport { avgPool3dGrad } from '../ops/avg_pool_3d_grad';\nexport const avgPool3DGradConfig = {\n kernelName: AvgPool3D,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => avgPool3dGrad(dy, x, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=AvgPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { AvgPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of an 2D avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolGrad_(dy, input, filterSize, strides, pad) {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolGrad');\n const $input = convertToTensor(input, 'input', 'avgPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n let input4D = $input;\n let dy4D = $dy;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D =\n reshape($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]);\n dy4D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]);\n }\n util.assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n const inputs = { dy: dy4D, input: input4D };\n const attrs = { filterSize, strides, pad };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs);\n if (reshapedTo4D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);\n }\n return res;\n}\nexport const avgPoolGrad = op({ avgPoolGrad_ });\n//# sourceMappingURL=avg_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { AvgPool } from '../kernel_names';\nimport { avgPoolGrad } from '../ops/avg_pool_grad';\nexport const avgPoolGradConfig = {\n kernelName: AvgPool,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { filterSize, strides, pad } = attrs;\n return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad) };\n }\n};\n//# sourceMappingURL=AvgPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchMatMul } from '../kernel_names';\nimport { matMul } from '../ops/mat_mul';\nexport const batchMatMulGradConfig = {\n kernelName: BatchMatMul,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved, attrs) => {\n const [a, b] = saved;\n const { transposeA, transposeB } = attrs;\n if (!transposeA && !transposeB) {\n return {\n a: () => matMul(dy, b, false, true),\n b: () => matMul(a, dy, true, false)\n };\n }\n else if (!transposeA && transposeB) {\n return {\n a: () => matMul(dy, b, false, false),\n b: () => matMul(dy, a, true, false)\n };\n }\n else if (transposeA && !transposeB) {\n return {\n a: () => matMul(b, dy, false, true),\n b: () => matMul(a, dy, false, false)\n };\n }\n else {\n return {\n a: () => matMul(b, dy, true, true),\n b: () => matMul(dy, a, true, true)\n };\n }\n }\n};\n//# sourceMappingURL=BatchMatMul_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BatchToSpaceND } from '../kernel_names';\nimport { spaceToBatchND } from '../ops/space_to_batch_nd';\nexport const batchToSpaceNDGradConfig = {\n kernelName: BatchToSpaceND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, crops } = attrs;\n return { x: () => spaceToBatchND(dy, blockShape, crops) };\n }\n};\n//# sourceMappingURL=BatchToSpaceND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { BroadcastTo } from '../kernel_names';\nimport { sum } from '../ops/sum';\nexport const broadcastToGradConfig = {\n kernelName: BroadcastTo,\n gradFunc: (dy, saved, attrs) => {\n const broadCastToAttrs = attrs;\n const inputShape = broadCastToAttrs.inputShape;\n const outputShape = broadCastToAttrs.shape;\n const reps = Array.from(outputShape);\n for (let i = inputShape.length - 1; i >= 0; i--) {\n if (inputShape[i] === outputShape[i]) {\n reps[i] = 1;\n }\n else if (inputShape[i] !== 1) {\n throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`);\n }\n }\n const axes = [];\n for (let i = 0; i < reps.length; i++) {\n if (reps[i] > 1) {\n axes.push(i);\n }\n }\n return { x: () => sum(dy, axes, true /* keepDims */) };\n }\n};\n//# sourceMappingURL=BroadcastTo_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cast } from '../kernel_names';\nexport const castGradConfig = {\n kernelName: Cast,\n gradFunc: (dy) => {\n return { x: () => dy.clone() };\n }\n};\n//# sourceMappingURL=Cast_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Ceil } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const ceilGradConfig = {\n kernelName: Ceil,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Ceil_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ClipByValue } from '../kernel_names';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { lessEqual } from '../ops/less_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const clipByValueGradConfig = {\n kernelName: ClipByValue,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { clipValueMin, clipValueMax } = attrs;\n return {\n x: () => where(logicalAnd(greaterEqual(x, clipValueMin), lessEqual(x, clipValueMax)), dy, zerosLike(dy)),\n };\n }\n};\n//# sourceMappingURL=ClipByValue_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ComplexAbs } from '../kernel_names';\nimport { absGradConfig } from './Abs_grad';\nexport const complexAbsGradConfig = {\n kernelName: ComplexAbs,\n inputsToSave: ['x'],\n gradFunc: absGradConfig.gradFunc,\n};\n//# sourceMappingURL=ComplexAbs_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Concat } from '../kernel_names';\nimport { split } from '../ops/split';\nimport { parseAxisParam } from '../util';\nexport const concatGradConfig = {\n kernelName: Concat,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const shapes = saved.map(t => t.shape);\n const { axis } = attrs;\n const $axis = parseAxisParam(axis, saved[0].shape)[0];\n const sizeSplits = shapes.map(s => s[$axis]);\n const derTensors = split(dy, sizeSplits, $axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Concat_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2D } from '../kernel_names';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nimport { conv2DBackpropInput } from '../ops/conv2d_backprop_input';\nimport * as conv_util from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv2DGradConfig = {\n kernelName: Conv2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x4D, $filter] = saved;\n const { dilations, strides, pad, dataFormat } = attrs;\n util.assert(conv_util.tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' +\n `are not yet supported in gradients. Got dilations '${dilations}'`);\n return {\n x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat),\n filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat)\n };\n }\n};\n//# sourceMappingURL=Conv2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv2DBackpropInput } from '../kernel_names';\nimport { conv2d } from '../ops/conv2d';\nimport { conv2DBackpropFilter } from '../ops/conv2d_backprop_filter';\nexport const conv2DBackpropInputGradConfig = {\n kernelName: Conv2DBackpropInput,\n inputsToSave: ['dy', 'filter'],\n gradFunc: (ddx, saved, attrs) => {\n const [dy, filter] = saved;\n const { strides, pad, dataFormat, dimRoundingMode } = attrs;\n return {\n dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode),\n filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=Conv2DBackpropInput_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Conv3DBackpropFilterV2 } from '../kernel_names';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the derivative of the filter of a 3D convolution.\n *\n * @param x The input tensor, of rank 5 or rank 4 of shape\n * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is\n * assumed.\n * @param dy The dy image, of rank 5 or rank 4, of shape\n * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is\n * assumed.\n * @param filterShape The shape of the filter, length 5,\n * [filterDepth, filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideDepth, strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction conv3DBackpropFilter_(x, dy, filterShape, strides, pad) {\n let x5D = x;\n if (x.rank === 4) {\n x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]);\n }\n let dy5D = dy;\n if (dy5D.rank === 4) {\n dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]);\n }\n util.assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` +\n `${x5D.shape}.`);\n util.assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` +\n `${dy5D.shape}.`);\n util.assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` +\n `${filterShape}.`);\n util.assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` +\n `match input depth in filter (${filterShape[3]}.`);\n util.assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` +\n `match output depth for filter (${filterShape[4]}).`);\n const inputs = { x: x5D, dy: dy5D };\n const attrs = { strides, pad, filterShape };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs);\n}\nexport const conv3DBackpropFilter = op({ conv3DBackpropFilter_ });\n//# sourceMappingURL=conv3d_backprop_filter.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Conv3D } from '../kernel_names';\nimport { conv3DBackpropFilter } from '../ops/conv3d_backprop_filter';\nimport { conv3DBackpropInput } from '../ops/conv3d_backprop_input';\nimport { tupleValuesAreOne } from '../ops/conv_util';\nimport * as util from '../util';\nexport const conv3DGradConfig = {\n kernelName: Conv3D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad } = attrs;\n util.assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' +\n `not yet supported in gradients. Got dilations '${dilations}'`);\n const [x5D, $filter] = saved;\n return {\n x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad),\n filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad)\n };\n }\n};\n//# sourceMappingURL=Conv3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cos } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { sin } from '../ops/sin';\nexport const cosGradConfig = {\n kernelName: Cos,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(neg(sin(cast(x, 'float32'))), dy) };\n }\n};\n//# sourceMappingURL=Cos_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cosh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { sinh } from '../ops/sinh';\nexport const coshGradConfig = {\n kernelName: Cosh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(sinh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Cosh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Cumsum } from '../kernel_names';\nimport { getAxesPermutation } from '../ops/axis_util';\nimport { cumsum } from '../ops/cumsum';\nimport { transpose } from '../ops/transpose';\nexport const cumsumGradConfig = {\n kernelName: Cumsum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis, exclusive, reverse } = attrs;\n return {\n x: () => {\n const permutation = getAxesPermutation([axis], x.rank);\n let out = cumsum(dy, axis, exclusive, !reverse);\n if (permutation != null) {\n out = transpose(out, permutation);\n }\n return out;\n }\n };\n }\n};\n//# sourceMappingURL=Cumsum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { DepthwiseConv2dNative } from '../kernel_names';\nimport * as conv_util from '../ops/conv_util';\nimport { depthwiseConv2dNativeBackpropFilter } from '../ops/depthwise_conv2d_native_backprop_filter';\nimport { depthwiseConv2dNativeBackpropInput } from '../ops/depthwise_conv2d_native_backprop_input';\nimport * as util from '../util';\nexport const depthwiseConv2dNativeGradConfig = {\n kernelName: DepthwiseConv2dNative,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const { dilations, strides, pad, dimRoundingMode } = attrs;\n const $dilations = dilations == null ? [1, 1] : dilations;\n util.assert(conv_util.tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' +\n `greater than 1 are not yet supported. Got dilations ` +\n `'${$dilations}'`);\n const [x, filter] = saved;\n util.assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` +\n `rank 4, but got rank ${x.rank}.`);\n util.assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` +\n `rank 4, but got rank ${filter.rank}.`);\n util.assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` +\n `channels (${x.shape[3]}) must match the inChannels dimension ` +\n `in filter ${filter.shape[2]}.`);\n util.assert(conv_util.eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' +\n `dilations must be 1. Got strides ${strides} and dilations ` +\n `'${$dilations}'.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n return {\n x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad, dilations, dimRoundingMode),\n filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad, dilations, dimRoundingMode),\n };\n }\n};\n//# sourceMappingURL=DepthwiseConv2dNative_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Dilation2D, Dilation2DBackpropFilter, Dilation2DBackpropInput } from '../kernel_names';\nexport const dilation2dGradConfig = {\n kernelName: Dilation2D,\n inputsToSave: ['x', 'filter'],\n gradFunc: (dy, saved, attrs) => {\n const [x, filter] = saved;\n const inputInputs = { x, filter, dy };\n const filterInputs = { x, filter, dy };\n return {\n x: () => ENGINE.runKernel(Dilation2DBackpropInput, inputInputs, attrs),\n filter: () => ENGINE.runKernel(Dilation2DBackpropFilter, filterInputs, attrs)\n };\n }\n};\n//# sourceMappingURL=Dilation2D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { Elu, EluGrad } from '../kernel_names';\nexport const eluGradConfig = {\n kernelName: Elu,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n const inputs = { dy, y };\n return { x: () => ENGINE.runKernel(EluGrad, inputs) };\n }\n};\n//# sourceMappingURL=Elu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Erf } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const erfGradConfig = {\n kernelName: Erf,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const a = mul(exp(neg(square(x))), 2 / Math.sqrt(Math.PI));\n return { x: () => mul(dy, a) };\n }\n};\n//# sourceMappingURL=Erf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Exp } from '../kernel_names';\nimport { mul } from '../ops/mul';\nexport const expGradConfig = {\n kernelName: Exp,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, y) };\n }\n};\n//# sourceMappingURL=Exp_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ExpandDims } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const expandDimsGradConfig = {\n kernelName: ExpandDims,\n inputsToSave: ['input'],\n gradFunc: (dy, saved) => {\n const [input] = saved;\n return { input: () => reshape(dy, input.shape) };\n }\n};\n//# sourceMappingURL=ExpandDims_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Expm1 } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nexport const expm1GradConfig = {\n kernelName: Expm1,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, exp(x)) };\n }\n};\n//# sourceMappingURL=Expm1_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Floor } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const floorGradConfig = {\n kernelName: Floor,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Floor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FloorDiv } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const floorDivGradConfig = {\n kernelName: FloorDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=FloorDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { FusedBatchNorm } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { rsqrt } from '../ops/rsqrt';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { tile } from '../ops/tile';\nexport const fusedBatchNormGradConfig = {\n kernelName: FusedBatchNorm,\n inputsToSave: ['x', 'mean', 'variance', 'scale'],\n gradFunc: (dy, saved, attrs) => {\n const { varianceEpsilon } = attrs;\n const [x, mean, variance, scale] = saved;\n const scaleValue = scale == null ? scalar(1) : scale;\n const reductionAxes = getReductionAxes(mean.shape, x.shape);\n const tileShape = [];\n if (mean.rank === 1) {\n for (let i = 0; i < x.shape.length - 1; ++i) {\n tileShape.push(x.shape[i]);\n }\n tileShape.push(1);\n }\n const xMinusMean = sub(x, mean);\n const dyTimesScaleValue = mul(dy, scaleValue);\n const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon)));\n const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5));\n const derX = () => {\n if (mean.rank === 1) {\n return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean.shape[0]]), tileShape)), scaleValue), x.shape);\n }\n else {\n return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape);\n }\n };\n const derMean = () => {\n let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue);\n if (mean.rank === 1) {\n meanDer = sum(meanDer, reductionAxes);\n }\n return reshape(meanDer, mean.shape);\n };\n const derVariance = () => {\n let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue);\n if (mean.rank === 1) {\n varianceDer = sum(varianceDer, reductionAxes);\n }\n return reshape(varianceDer, mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance);\n let scaleDer = mul(dy, xMinusMean2TimesRsqrt);\n if (mean.rank === 1) {\n scaleDer = sum(scaleDer, reductionAxes);\n }\n return reshape(scaleDer, mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if (mean.rank === 1) {\n offsetDer = sum(offsetDer, reductionAxes);\n }\n return reshape(offsetDer, mean.shape);\n };\n return {\n x: derX,\n mean: derMean,\n variance: derVariance,\n scale: derScale,\n offset: derOffset\n };\n }\n};\n//# sourceMappingURL=FusedBatchNorm_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GatherV2 } from '../kernel_names';\nimport { getUndoAxesPermutation } from '../ops/axis_util';\nimport { reshape } from '../ops/reshape';\nimport { transpose } from '../ops/transpose';\nimport { unsortedSegmentSum } from '../ops/unsorted_segment_sum';\nimport { parseAxisParam } from '../util';\nexport const gatherGradConfig = {\n kernelName: GatherV2,\n inputsToSave: ['x', 'indices'],\n gradFunc: (dy, saved, attrs) => {\n const [x, indices] = saved;\n const { axis } = attrs;\n const parsedAxis = parseAxisParam(axis, x.shape)[0];\n const derX = () => {\n const paramsShape = x.shape;\n const indicesSize = indices.size;\n const outerShape = paramsShape.slice(0, parsedAxis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n const values = reshape(dy, valuesShape);\n const reshapedIndices = reshape(indices, [indicesSize]);\n const transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = transpose(values, transposeDims);\n let paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, x.shape[parsedAxis]);\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = transpose(paramsGrad, invertTransposeDims);\n return paramsGrad;\n };\n return { x: derX, indices: () => indices };\n }\n};\nfunction arrayRange(start, stop) {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\nfunction arrayConcat(arrays) {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n//# sourceMappingURL=GatherV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { GreaterEqual } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const greaterEqualGradConfig = {\n kernelName: GreaterEqual,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n return { a: () => zerosLike(a), b: () => zerosLike(b) };\n }\n};\n//# sourceMappingURL=GreaterEqual_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Identity } from '../kernel_names';\nimport { cast } from '../ops/cast';\nexport const identityGradConfig = {\n kernelName: Identity,\n gradFunc: (dy) => {\n return { x: () => cast(dy, 'float32') };\n }\n};\n//# sourceMappingURL=Identity_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsFinite } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isFiniteGradConfig = {\n kernelName: IsFinite,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsFinite_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsInf } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isInfGradConfig = {\n kernelName: IsInf,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsInf_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { IsNan } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const isNanGradConfig = {\n kernelName: IsNan,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=IsNan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LeakyRelu } from '../kernel_names';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { where } from '../ops/where';\nexport const leakyReluGradConfig = {\n kernelName: LeakyRelu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { alpha } = attrs;\n const mask = greater(x, 0);\n // Returns `gradients * (features > 0) + alpha * gradients * (features <=\n // 0)`.\n return { x: () => where(mask, dy, mul(dy, alpha)) };\n }\n};\n//# sourceMappingURL=LeakyRelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log1p } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { div } from '../ops/div';\nexport const log1pGradConfig = {\n kernelName: Log1p,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, add(x, 1)) };\n }\n};\n//# sourceMappingURL=Log1p_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Log } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nexport const logGradConfig = {\n kernelName: Log,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, cast(x, 'float32')) };\n }\n};\n//# sourceMappingURL=Log_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LogSoftmax } from '../kernel_names';\nimport { exp } from '../ops/exp';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const logSoftmaxGradConfig = {\n kernelName: LogSoftmax,\n inputsToSave: [],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [value] = saved;\n const { axis } = attrs;\n return {\n logits: () => {\n const keepDims = true;\n const softmax = exp(value);\n return sub(dy, mul(sum(dy, axis, keepDims), softmax));\n }\n };\n }\n};\n//# sourceMappingURL=LogSoftmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { LRNGrad } from '../kernel_names';\nimport { op } from './operation';\nfunction localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) {\n const inputs = { x, y, dy };\n const attrs = { depthRadius, bias, alpha, beta };\n return ENGINE.runKernel(LRNGrad, inputs, attrs);\n}\nexport const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ });\n//# sourceMappingURL=local_response_normalization_backprop.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { LRN } from '../kernel_names';\nimport { localResponseNormalizationBackprop } from '../ops/local_response_normalization_backprop';\nexport const lrnGradConfig = {\n kernelName: LRN,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { depthRadius, bias, alpha, beta } = attrs;\n return {\n x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta)\n };\n }\n};\n//# sourceMappingURL=LRN_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport * as axis_util from '../ops/axis_util';\nimport { cast } from '../ops/cast';\nimport { equal } from '../ops/equal';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\n/**\n * Gradient helper function for the min and max operations.\n */\nexport function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}\n//# sourceMappingURL=min_max_grad_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Max } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const maxGradConfig = {\n kernelName: Max,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const maxAttrs = attrs;\n const { reductionIndices } = maxAttrs;\n const x = saved[0];\n const y = saved[1];\n const origAxes = util.parseAxisParam(reductionIndices, x.shape);\n const maxGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return maxGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Max_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Maximum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { less } from '../ops/less';\nimport { mul } from '../ops/mul';\nexport const maximumGradConfig = {\n kernelName: Maximum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(greaterEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(less(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Maximum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPool3DGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\nimport { reshape } from './reshape';\n/**\n * Computes the backprop of a 3d max pool.\n *\n * @param dy The dy error, of rank 5 of shape\n * [batchSize, depth, height, width, channels].\n * assumed.\n * @param input The original input image, of rank 5 or rank 4 of shape\n * [batchSize, depth, height, width, channels].\n * @param output The original output image, of rank 5 of shape\n * [batchSize, outDepth, outHeight, outWidth, channels].\n * @param filterSize The filter size:\n * `[filterDepth, filterHeight, filterWidth]`.\n * `filterSize` is a single number,\n * then `filterDepth == filterHeight == filterWidth`.\n * @param strides The strides of the pooling:\n * `[strideDepth, strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPool3dGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPool3dGrad');\n const $input = convertToTensor(input, 'input', 'maxPool3dGrad');\n const $output = convertToTensor(output, 'output', 'maxPool3dGrad');\n let dy5D = $dy;\n let input5D = $input;\n let output5D = $output;\n let reshapedTo5D = false;\n if ($input.rank === 4) {\n reshapedTo5D = true;\n dy5D = reshape($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]);\n input5D = reshape($input, [\n 1, $input.shape[0], $input.shape[1], $input.shape[2], $input.shape[3]\n ]);\n output5D = reshape($output, [\n 1, $output.shape[0], $output.shape[1], $output.shape[2], $output.shape[3]\n ]);\n }\n util.assert(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ` +\n `${dy5D.rank}.`);\n util.assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ` +\n `${input5D.rank}.`);\n util.assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ` +\n `${output5D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPool3dGrad: pad must be an integer when ` +\n `using, dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: dy5D, input: input5D, output: output5D };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs);\n if (reshapedTo5D) {\n return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);\n }\n return res;\n}\nexport const maxPool3dGrad = op({ maxPool3dGrad_ });\n//# sourceMappingURL=max_pool_3d_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool3D } from '../kernel_names';\nimport { maxPool3dGrad } from '../ops/max_pool_3d_grad';\nexport const maxPool3DGradConfig = {\n kernelName: MaxPool3D,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad, dimRoundingMode } = attrs;\n return {\n x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad, dimRoundingMode)\n };\n }\n};\n//# sourceMappingURL=MaxPool3D_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { MaxPoolGrad } from '../kernel_names';\nimport { convertToTensor } from '../tensor_util_env';\nimport * as util from '../util';\nimport { op } from './operation';\n/**\n * Computes the backprop of a 2D max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size: `[filterHeight, filterWidth]`. If\n * `filterSize` is a single number, then `filterHeight == filterWidth`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If\n * `strides` is a single number, then `strideHeight == strideWidth`.\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is\n * provided, it will default to truncate.\n */\nfunction maxPoolGrad_(dy, input, output, filterSize, strides, pad, dimRoundingMode) {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolGrad');\n const $input = convertToTensor(input, 'input', 'maxPoolGrad');\n const $output = convertToTensor(output, 'output', 'maxPoolGrad');\n util.assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy ` +\n `(${$dy.rank})`);\n util.assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(util.isInt(pad), () => `Error in maxPoolGrad: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const inputs = { dy: $dy, input: $input, output: $output };\n const attrs = { filterSize, strides, pad, dimRoundingMode };\n // tslint:disable-next-line: no-unnecessary-type-assertion\n return ENGINE.runKernel(MaxPoolGrad, inputs, attrs);\n}\nexport const maxPoolGrad = op({ maxPoolGrad_ });\n//# sourceMappingURL=max_pool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MaxPool } from '../kernel_names';\nimport { maxPoolGrad } from '../ops/max_pool_grad';\nexport const maxPoolGradConfig = {\n kernelName: MaxPool,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [x, y] = saved;\n const { filterSize, strides, pad } = attrs;\n return {\n x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad)\n };\n }\n};\n//# sourceMappingURL=MaxPool_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mean } from '../kernel_names';\nimport { computeOutAndReduceShapes } from '../ops/axis_util';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport * as util from '../util';\nexport const meanGradConfig = {\n kernelName: Mean,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { axis } = attrs;\n const axes = util.parseAxisParam(axis, x.shape);\n const shapes = computeOutAndReduceShapes(x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n const derX = () => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const res = div(mul(expandedDy, ones(x.shape, 'float32')), reduceSize);\n return res;\n };\n return { x: derX };\n }\n};\n//# sourceMappingURL=Mean_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Min } from '../kernel_names';\nimport * as util from '../util';\nimport { gradForMinAndMax } from './min_max_grad_util';\nexport const minGradConfig = {\n kernelName: Min,\n inputsToSave: ['x'],\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const minAttrs = attrs;\n const { axis } = minAttrs;\n const [x, y] = saved;\n const origAxes = util.parseAxisParam(axis, x.shape);\n const minGrad = gradForMinAndMax(dy, y, x, origAxes);\n return {\n x: () => {\n return minGrad['x']();\n }\n };\n }\n};\n//# sourceMappingURL=Min_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Minimum } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nexport const minimumGradConfig = {\n kernelName: Minimum,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const derA = () => mul(dy, cast(lessEqual(a, b), 'float32'));\n const derB = () => mul(dy, cast(greater(a, b), 'float32'));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Minimum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { MirrorPad } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const mirrorPadGradConfig = {\n kernelName: MirrorPad,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=MirrorPad_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Mod } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { div } from '../ops/div';\nimport { floor } from '../ops/floor';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const modGradConfig = {\n kernelName: Mod,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(dy, reduceAxes), a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = mul(dy, neg(floor(div(a, b))));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Mod_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Multiply } from '../kernel_names';\nimport { assertAndGetBroadcastShape, getReductionAxes } from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const multiplyGradConfig = {\n kernelName: Multiply,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = mul(dy, cast(b, 'float32'));\n const reduceAxes = getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = mul(dy, cast(a, 'float32'));\n const reduceAxes = getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), b.shape);\n }\n return res;\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Multiply_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Neg } from '../kernel_names';\nimport { neg } from '../ops/neg';\nexport const negGradConfig = {\n kernelName: Neg,\n gradFunc: (dy) => {\n return { x: () => neg(dy) };\n }\n};\n//# sourceMappingURL=Neg_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OneHot } from '../kernel_names';\nimport { zeros } from '../ops/zeros';\nexport const oneHotGradConfig = {\n kernelName: OneHot,\n inputsToSave: ['indices'],\n gradFunc: (dy, saved) => {\n const indices = saved[0];\n return { indices: () => zeros(indices.shape, 'float32') };\n }\n};\n//# sourceMappingURL=OneHot_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { OnesLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const onesLikeGradConfig = {\n kernelName: OnesLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=OnesLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pack } from '../kernel_names';\nimport { unstack } from '../ops/unstack';\nexport const packGradConfig = {\n kernelName: Pack,\n saveAllInputs: true,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n const derTensors = unstack(dy, axis);\n return derTensors.map(t => () => t);\n }\n};\n//# sourceMappingURL=Pack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { PadV2 } from '../kernel_names';\nimport { slice } from '../ops/slice';\nexport const padV2GradConfig = {\n kernelName: PadV2,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const x = saved[0];\n const { paddings } = attrs;\n const begin = paddings.map(p => p[0]);\n return { x: () => slice(dy, begin, x.shape) };\n }\n};\n//# sourceMappingURL=PadV2_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Pow } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { greater } from '../ops/greater';\nimport { log } from '../ops/log';\nimport { mul } from '../ops/mul';\nimport { pow } from '../ops/pow';\nimport { reshape } from '../ops/reshape';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const powGradConfig = {\n kernelName: Pow,\n inputsToSave: ['a', 'b'],\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [a, b, y] = saved;\n const base = a;\n const exp = b;\n const outShape = broadcast_util.assertAndGetBroadcastShape(base.shape, exp.shape);\n const derBase = () => {\n const expFloat = cast(exp, 'float32');\n let res = mul(dy, mul(expFloat, pow(base, sub(expFloat, scalar(1)))));\n const reduceAxes = broadcast_util.getReductionAxes(base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, base.shape);\n };\n const derExp = () => {\n const condition = greater(base, 0);\n const logBase = where(condition, log(base), zerosLike(base));\n let res = mul(dy, mul(y, logBase));\n const reduceAxes = broadcast_util.getReductionAxes(exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, exp.shape);\n };\n return { a: derBase, b: derExp };\n }\n};\n//# sourceMappingURL=Pow_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Prelu } from '../kernel_names';\nimport { getReductionAxes } from '../ops/broadcast_util';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const preluGradConfig = {\n kernelName: Prelu,\n inputsToSave: ['x', 'alpha'],\n gradFunc: (dy, saved) => {\n const [x, alpha] = saved;\n const mask = greater(x, 0);\n return {\n x: () => where(mask, dy, mul(dy, alpha)),\n alpha: () => {\n let res = where(mask, zerosLike(dy), mul(dy, x));\n const reduceAxes = getReductionAxes(alpha.shape, dy.shape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, alpha.shape);\n }\n };\n }\n};\n//# sourceMappingURL=Prelu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { RealDiv } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { square } from '../ops/square';\nimport { sum } from '../ops/sum';\nexport const divGradConfig = {\n kernelName: RealDiv,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n const res = div(dy, cast(b, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n return reshape(sum(res, reduceAxes), a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = mul(dy, cast(a, 'float32'));\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = reshape(sum(res, reduceAxes), b.shape);\n }\n const tmp = square(b);\n return neg(div(res, cast(tmp, 'float32')));\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=RealDiv_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reciprocal } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { neg } from '../ops/neg';\nimport { square } from '../ops/square';\nexport const reciprocalGradConfig = {\n kernelName: Reciprocal,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, neg(square(x))) };\n }\n};\n//# sourceMappingURL=Reciprocal_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu6 } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { lessEqual } from '../ops/less_equal';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const relu6GradConfig = {\n kernelName: Relu6,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n const mask = mul(lessEqual(x, 6), step(x));\n return { x: () => mul(dy, cast(mask, 'float32')) };\n }\n};\n//# sourceMappingURL=Relu6_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Relu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nimport { step } from '../ops/step';\nexport const reluGradConfig = {\n kernelName: Relu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, cast(step(x), 'float32')) };\n }\n};\n//# sourceMappingURL=Relu_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Reshape } from '../kernel_names';\nimport { reshape } from '../ops/reshape';\nexport const reshapeGradConfig = {\n kernelName: Reshape,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => reshape(dy, x.shape) };\n }\n};\n//# sourceMappingURL=Reshape_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeBilinear, ResizeBilinearGrad } from '../kernel_names';\nexport const resizeBilinearGradConfig = {\n kernelName: ResizeBilinear,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeBilinearGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeBilinear_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ENGINE } from '../engine';\nimport { ResizeNearestNeighbor, ResizeNearestNeighborGrad } from '../kernel_names';\nexport const resizeNearestNeighborGradConfig = {\n kernelName: ResizeNearestNeighbor,\n inputsToSave: ['images'],\n gradFunc: (dy, saved, attrs) => {\n const [images] = saved;\n const inputs = { dy, images };\n const imagesDer = () => \n // tslint:disable-next-line: no-unnecessary-type-assertion\n ENGINE.runKernel(ResizeNearestNeighborGrad, inputs, attrs);\n return { images: imagesDer };\n }\n};\n//# sourceMappingURL=ResizeNearestNeighbor_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Reverse } from '../kernel_names';\nimport { reverse } from '../ops/reverse';\nimport { parseAxisParam } from '../util';\nexport const reverseGradConfig = {\n kernelName: Reverse,\n gradFunc: (dy, saved, attrs) => {\n const { dims } = attrs;\n const axes = parseAxisParam(dims, dy.shape);\n return { x: () => reverse(dy, axes) };\n }\n};\n//# sourceMappingURL=Reverse_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Round } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const roundGradConfig = {\n kernelName: Round,\n gradFunc: (dy) => {\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Round_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Rsqrt } from '../kernel_names';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { neg } from '../ops/neg';\nimport { pow } from '../ops/pow';\nexport const rsqrtGradConfig = {\n kernelName: Rsqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => neg(div(dy, mul(pow(x, 1.5), 2))) };\n }\n};\n//# sourceMappingURL=Rsqrt_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Select } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { logicalNot } from '../ops/logical_not';\nimport { mul } from '../ops/mul';\nimport { zerosLike } from '../ops/zeros_like';\nexport const selectGradConfig = {\n kernelName: Select,\n inputsToSave: ['condition'],\n gradFunc: (dy, saved) => {\n const [condition] = saved;\n return {\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n condition: () => cast(zerosLike(condition), 'float32'),\n t: () => mul(dy, cast(condition, dy.dtype)),\n e: () => mul(dy, cast(logicalNot(condition), dy.dtype))\n };\n }\n};\n//# sourceMappingURL=Select_grad.js.map","/**\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 */\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n//# sourceMappingURL=selu_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Selu } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { exp } from '../ops/exp';\nimport { greater } from '../ops/greater';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { SELU_SCALE, SELU_SCALEALPHA } from '../ops/selu_util';\nimport { where } from '../ops/where';\nexport const seluGradConfig = {\n kernelName: Selu,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return {\n x: () => {\n const mask = greater(x, scalar(0));\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n const greaterThanZeroDer = mul(dy, scale);\n const lessEqualZeroDer = mul(mul(dy, scaleAlpha), exp(cast(x, 'float32')));\n return where(mask, greaterThanZeroDer, lessEqualZeroDer);\n }\n };\n }\n};\n//# sourceMappingURL=Selu_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sigmoid } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const sigmoidGradConfig = {\n kernelName: Sigmoid,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(dy, mul(y, sub(scalar(1), y))) };\n }\n};\n//# sourceMappingURL=Sigmoid_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sign } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const signGradConfig = {\n kernelName: Sign,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Sign_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sin } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cos } from '../ops/cos';\nimport { mul } from '../ops/mul';\nexport const sinGradConfig = {\n kernelName: Sin,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cos(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sin_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sinh } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { cosh } from '../ops/cosh';\nimport { mul } from '../ops/mul';\nexport const sinhGradConfig = {\n kernelName: Sinh,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(cosh(cast(x, 'float32')), dy) };\n }\n};\n//# sourceMappingURL=Sinh_grad.js.map","/**\n * @license\n * Copyright 2017 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 */\nimport * as util from '../util';\nexport function assertParamsValid(input, begin, size) {\n const inputRank = input.shape.length;\n util.assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${inputRank}).`);\n util.assert(inputRank === size.length, () => `Error in slice${inputRank}D: Length of size ${size} must ` +\n `match the rank of the array (${inputRank}).`);\n for (let i = 0; i < inputRank; ++i) {\n util.assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`);\n }\n}\n/** Converts a binary mask to an array of axes. Used in stridedSlice(). */\nexport function maskToAxes(mask) {\n const axes = [];\n let axis = 0;\n while (mask > 0) {\n if (mask & 1) {\n axes.push(axis);\n }\n mask /= 2;\n axis++;\n }\n return axes;\n}\n/** Computes the output shape given the strided slice params. */\nexport function computeOutShape(begin, end, strides) {\n const size = [];\n for (let axis = 0; axis < begin.length; axis++) {\n size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]);\n }\n return size;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stride value. Otherwise, insert.\nexport function stridesWithElidedDims(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) {\n const newStrides = [...strides];\n for (let i = newStrides.length; i < inputShape.length; i++) {\n newStrides.push(1);\n }\n for (let i = 0; i < numElidedAxes; i++) {\n if (i === 0) {\n newStrides[ellipsisInsertionIndex] = 1;\n }\n else {\n newStrides.splice(ellipsisInsertionIndex, 0 /* num elements to delete */, 1 /* element to add */);\n newStrides.pop();\n }\n }\n return newStrides;\n}\nfunction unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) {\n if (normalizedAxis <= ellipsisInsertionIndex) {\n return normalizedAxis;\n }\n return normalizedAxis - (numElidedAxes - 1);\n}\nfunction getElidedAxes(numElidedAxes, ellipsisInsertionIndex) {\n const elidedAxes = [];\n for (let i = 0; i < numElidedAxes; i++) {\n elidedAxes.push(ellipsisInsertionIndex + i);\n }\n return elidedAxes;\n}\n// Normalize the start, end and strides.\nexport function getNormalizedAxes(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) {\n const inputRank = inputShape.length;\n let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank);\n if (ellipsisAxes.length && numInterpolatedAxes > 0) {\n const fullIndex = ellipsisAxes[0];\n // The ellipsis applies to the masked index as well as any dimensions\n // that are interpolated.\n const numElidedAxes = numInterpolatedAxes + 1;\n normalizedBegin = startIndicesWithElidedDims(beginMask, fullIndex, numElidedAxes, begin, inputShape);\n normalizedEnd = stopIndicesWithElidedDims(endMask, fullIndex, numElidedAxes, end, inputShape);\n normalizedStrides =\n stridesWithElidedDims(strides, fullIndex, numElidedAxes, inputShape);\n }\n else {\n for (let axis = 0; axis < inputRank; axis++) {\n normalizedBegin[axis] = startForAxis(beginMask, begin, strides, inputShape, axis, ellipsisMask);\n normalizedEnd[axis] =\n stopForAxis(endMask, end, strides, inputShape, axis, ellipsisMask);\n normalizedStrides[axis] = stridesForAxis(strides, axis, ellipsisMask);\n }\n }\n return {\n begin: normalizedBegin,\n end: normalizedEnd,\n strides: normalizedStrides\n };\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current start value. Otherwise, insert.\nexport function startIndicesWithElidedDims(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = 0;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalBegin[originalAxis];\n if (beginMask & 1 << originalAxis) {\n originalValue = 0;\n }\n newIndices[axis] = originalValue;\n }\n }\n return newIndices;\n}\n// Creates full selection at the elided dimensions. If the dimension matches\n// the ellipsis mask, override the current stop value. Otherwise, insert.\nexport function stopIndicesWithElidedDims(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) {\n const newIndices = [...inputShape];\n const elidedAxes = getElidedAxes(numElidedAxes, ellipsisInsertionIndex);\n for (let axis = 0; axis < newIndices.length; axis++) {\n if (elidedAxes.indexOf(axis) > -1) {\n newIndices[axis] = Number.MAX_SAFE_INTEGER;\n }\n else {\n const originalAxis = unnormalizeAxis(ellipsisInsertionIndex, numElidedAxes, axis);\n let originalValue = originalEnd[originalAxis];\n if (endMask & 1 << originalAxis) {\n originalValue = Number.MAX_SAFE_INTEGER;\n }\n newIndices[axis] = originalValue;\n }\n }\n for (let i = 0; i < newIndices.length; i++) {\n // Handle negative indices\n const axisSize = inputShape[i];\n if (newIndices[i] < 0) {\n newIndices[i] += axisSize;\n }\n newIndices[i] = util.clamp(0, newIndices[i], inputShape[i]);\n }\n return newIndices;\n}\nexport function stridesForAxis(strides, axis, ellipsisMask) {\n let stride = strides[axis];\n if (ellipsisMask & (1 << axis) || stride == null) {\n stride = 1;\n }\n return stride;\n}\nexport function startForAxis(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let start = startIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or the begin index is not set\n // for the axis.\n if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) {\n if (stride > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n return start;\n}\nexport function stopForAxis(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) {\n // Begin with the specified index\n let stop = stopIndices[axis];\n const stride = strides[axis] || 1;\n // Check the axis bit from right of masked axes, or if the stop index is not\n // set for this axis.\n if (endMask & (1 << axis) || ellipsisMask & (1 << axis) || stop == null) {\n if (stride > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n }\n else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (stride > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n }\n else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n return stop;\n}\n/**\n * Returns true if the slice occupies a continous set of elements in the\n * 'flat' space.\n */\nexport function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}\nexport function computeFlatOffset(begin, strides) {\n let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1;\n for (let i = 0; i < begin.length - 1; i++) {\n flatOffset += begin[i] * strides[i];\n }\n return flatOffset;\n}\nexport function parseSliceParams(x, begin, size) {\n // The following logic allows for more ergonomic calls.\n let begin_;\n const xRank = x.shape.length;\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array(xRank - 1).fill(0)];\n }\n else if (begin.length < xRank) {\n begin_ = begin.concat(new Array(xRank - begin.length).fill(0));\n }\n else {\n begin_ = begin.slice();\n }\n begin_.forEach(d => {\n util.assert(d !== -1, () => 'slice() does not support negative begin indexing.');\n });\n let size_;\n if (size == null) {\n size_ = new Array(xRank).fill(-1);\n }\n else if (typeof size === 'number') {\n size_ = [size, ...new Array(xRank - 1).fill(-1)];\n }\n else if (size.length < xRank) {\n size_ = size.concat(new Array(xRank - size.length).fill(-1));\n }\n else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n }\n else {\n util.assert(d === -1, () => `Negative size values should be exactly -1 but got ` +\n `${d} for the slice() size at index ${i}.`);\n return x.shape[i] - begin_[i];\n }\n });\n return [begin_, size_];\n}\nexport function sliceInfo(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) {\n // make a copy because it may be modified further down.\n let $begin = begin.slice();\n let $end = end.slice();\n let $strides = strides;\n if (strides == null) {\n $strides = new Array($begin.length);\n }\n const ellipsisAxes = maskToAxes(ellipsisMask);\n if (ellipsisAxes.length > 1) {\n throw new Error('Multiple ellipses in slice is not allowed.');\n }\n if (ellipsisMask !== 0 && newAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.');\n }\n if (ellipsisMask !== 0 && shrinkAxisMask !== 0) {\n throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.');\n }\n const numInterpolatedAxes = xShape.length - $begin.length;\n // Expand the dims of x based on the newAxisMask.\n const expandAxes = maskToAxes(newAxisMask);\n const newShape = xShape.slice();\n expandAxes.forEach(axis => {\n $begin[axis] = 0;\n $end[axis] = 1;\n newShape.splice(axis, 0, 1);\n });\n const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask);\n $begin = normalizedBegin;\n $end = normalizedEnd;\n $strides = normalizedStrides;\n const shrinkAxes = maskToAxes(shrinkAxisMask);\n // Adjust the ends based on the shrink mask.\n shrinkAxes.forEach(axis => {\n $end[axis] = $begin[axis] + 1;\n $strides[axis] = 1;\n });\n // Figure out the output shape.\n const size = computeOutShape($begin, $end, $strides);\n // Remove the axes based on shrinkMask.\n const outShape = size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1);\n const nonStrided = $strides.every(v => v === 1);\n return { nonStrided, $begin, $end, $strides, size, newShape, outShape };\n}\n//# sourceMappingURL=slice_util.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Slice } from '../kernel_names';\nimport { pad } from '../ops/pad';\nimport { parseSliceParams } from '../ops/slice_util';\nexport const sliceGradConfig = {\n kernelName: Slice,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { begin, size } = attrs;\n const inputShape = x.shape;\n const [begin_, size_] = parseSliceParams(x, begin, size);\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return { x: () => pad(dy, paddings) };\n }\n};\n//# sourceMappingURL=Slice_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softmax } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sub } from '../ops/sub';\nimport { sum } from '../ops/sum';\nexport const softmaxGradConfig = {\n kernelName: Softmax,\n outputsToSave: [true],\n gradFunc: (dy, saved, attrs) => {\n const [y] = saved;\n const { dim } = attrs;\n const keepDims = true;\n const dyTimesY = mul(dy, y);\n return {\n logits: () => sub(dyTimesY, mul(sum(dyTimesY, [dim], keepDims), y))\n };\n }\n};\n//# sourceMappingURL=Softmax_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Softplus } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { sigmoid } from '../ops/sigmoid';\nexport const softplusGradConfig = {\n kernelName: Softplus,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, sigmoid(x)) };\n }\n};\n//# sourceMappingURL=Softplus_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SpaceToBatchND } from '../kernel_names';\nimport { batchToSpaceND } from '../ops/batch_to_space_nd';\nexport const spaceToBatchNDGradConfig = {\n kernelName: SpaceToBatchND,\n gradFunc: (dy, saved, attrs) => {\n const { blockShape, paddings } = attrs;\n return { x: () => batchToSpaceND(dy, blockShape, paddings) };\n }\n};\n//# sourceMappingURL=SpaceToBatchND_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SplitV } from '../kernel_names';\nimport { concat } from '../ops/concat';\nexport const splitVGradConfig = {\n kernelName: SplitV,\n gradFunc: (dy, saved, attrs) => {\n const { axis } = attrs;\n return { x: () => concat(dy, axis) };\n }\n};\n//# sourceMappingURL=SplitV_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sqrt } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { div } from '../ops/div';\nimport { mul } from '../ops/mul';\nimport { sqrt } from '../ops/sqrt';\nexport const sqrtGradConfig = {\n kernelName: Sqrt,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, mul(sqrt(cast(x, 'float32')), 2)) };\n }\n};\n//# sourceMappingURL=Sqrt_grad.js.map","/**\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 */\nimport { Square } from '../kernel_names';\nimport { cast } from '../ops/cast';\nimport { mul } from '../ops/mul';\nexport const squareGradConfig = {\n kernelName: Square,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => mul(dy, mul(cast(x, 'float32'), 2)) };\n }\n};\n//# sourceMappingURL=Square_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { SquaredDifference } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { sub } from '../ops/sub';\nexport const squaredDifferenceGradConfig = {\n kernelName: SquaredDifference,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const two = scalar(2);\n const derA = () => mul(dy, mul(two, sub(a, b)));\n const derB = () => mul(dy, mul(two, sub(b, a)));\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=SquaredDifference_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Step } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const stepGradConfig = {\n kernelName: Step,\n gradFunc: (dy) => {\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=Step_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Sub } from '../kernel_names';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport { neg } from '../ops/neg';\nimport { reshape } from '../ops/reshape';\nimport { sum } from '../ops/sum';\nexport const subGradConfig = {\n kernelName: Sub,\n inputsToSave: ['a', 'b'],\n gradFunc: (dy, saved) => {\n const [a, b] = saved;\n const outShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(res, a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = sum(res, reduceAxes);\n }\n return reshape(neg(res), b.shape);\n };\n return { a: derA, b: derB };\n }\n};\n//# sourceMappingURL=Sub_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Sum } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { ones } from '../ops/ones';\nimport { reshape } from '../ops/reshape';\nimport { parseAxisParam } from '../util';\nexport const sumGradConfig = {\n kernelName: Sum,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const expandedDyShape = x.shape.slice();\n const { axis } = attrs;\n const axes = parseAxisParam(axis, x.shape);\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = reshape(dy, expandedDyShape);\n const derX = mul(expandedDy, ones(x.shape, 'float32'));\n return { x: () => derX };\n }\n};\n//# sourceMappingURL=Sum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tan } from '../kernel_names';\nimport { cos } from '../ops/cos';\nimport { div } from '../ops/div';\nimport { square } from '../ops/square';\nexport const tanGradConfig = {\n kernelName: Tan,\n inputsToSave: ['x'],\n gradFunc: (dy, saved) => {\n const [x] = saved;\n return { x: () => div(dy, square(cos(x))) };\n }\n};\n//# sourceMappingURL=Tan_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tanh } from '../kernel_names';\nimport { mul } from '../ops/mul';\nimport { scalar } from '../ops/scalar';\nimport { square } from '../ops/square';\nimport { sub } from '../ops/sub';\nexport const tanhGradConfig = {\n kernelName: Tanh,\n outputsToSave: [true],\n gradFunc: (dy, saved) => {\n const [y] = saved;\n return { x: () => mul(sub(scalar(1), square(y)), dy) };\n }\n};\n//# sourceMappingURL=Tanh_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Tile } from '../kernel_names';\nimport { add } from '../ops/add';\nimport { slice } from '../ops/slice';\nimport { zerosLike } from '../ops/zeros_like';\nexport const tileGradConfig = {\n kernelName: Tile,\n inputsToSave: ['x'],\n gradFunc: (dy, saved, attrs) => {\n const [x] = saved;\n const { reps } = attrs;\n const derX = () => {\n let xGrad = zerosLike(x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if (x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]]));\n }\n }\n else if (x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [\n x.shape[0], x.shape[1]\n ]));\n }\n }\n }\n else if (x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad =\n add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]]));\n }\n }\n }\n }\n else if (x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad =\n add(xGrad, slice(dy, [\n i * x.shape[0], j * x.shape[1], k * x.shape[2],\n l * x.shape[3]\n ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]]));\n }\n }\n }\n }\n }\n else {\n throw new Error(`Gradient for tile operation is not implemented for rank-` +\n `${x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return { x: derX };\n },\n};\n//# sourceMappingURL=Tile_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { Transpose } from '../kernel_names';\nimport * as axis_util from '../ops/axis_util';\nimport { transpose } from '../ops/transpose';\nexport const transposeGradConfig = {\n kernelName: Transpose,\n gradFunc: (dy, saved, attrs) => {\n const transposeAttrs = attrs;\n const { perm } = transposeAttrs;\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return { x: () => transpose(dy, undoPerm) };\n }\n};\n//# sourceMappingURL=Transpose_grad.js.map","/**\n * @license\n * Copyright 2020 Google Inc. 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 */\nimport { Unpack } from '../kernel_names';\nimport { stack } from '../ops/stack';\nexport const unpackGradConfig = {\n kernelName: Unpack,\n gradFunc: (dy, saved, attrs) => {\n const unpackAttrs = attrs;\n const { axis } = unpackAttrs;\n return { value: () => stack(dy, axis) };\n }\n};\n//# sourceMappingURL=Unpack_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { UnsortedSegmentSum } from '../kernel_names';\nimport { expandDims } from '../ops/expand_dims';\nimport { gather } from '../ops/gather';\nimport { greaterEqual } from '../ops/greater_equal';\nimport { logicalAnd } from '../ops/logical_and';\nimport { maximum } from '../ops/maximum';\nimport { ones } from '../ops/ones';\nimport { scalar } from '../ops/scalar';\nimport { where } from '../ops/where';\nimport { zerosLike } from '../ops/zeros_like';\nexport const unsortedSegmentSumGradConfig = {\n kernelName: UnsortedSegmentSum,\n inputsToSave: ['segmentIds'],\n gradFunc: (dy, saved) => {\n const [segmentIds] = saved;\n const derX = () => {\n return gatherDropNegatives(dy, segmentIds);\n };\n return { x: derX };\n }\n};\nfunction gatherDropNegatives(x, indices) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n//# sourceMappingURL=UnsortedSegmentSum_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { ZerosLike } from '../kernel_names';\nimport { zerosLike } from '../ops/zeros_like';\nexport const zerosLikeGradConfig = {\n kernelName: ZerosLike,\n gradFunc: (dy) => {\n return { x: () => zerosLike(dy) };\n }\n};\n//# sourceMappingURL=ZerosLike_grad.js.map","/**\n * @license\n * Copyright 2020 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 */\nimport { absGradConfig } from './gradients/Abs_grad';\nimport { acosGradConfig } from './gradients/Acos_grad';\nimport { acoshGradConfig } from './gradients/Acosh_grad';\nimport { addGradConfig } from './gradients/Add_grad';\nimport { addNGradConfig } from './gradients/AddN_grad';\nimport { argMaxGradConfig } from './gradients/ArgMax_grad';\nimport { argMinGradConfig } from './gradients/ArgMin_grad';\nimport { asinGradConfig } from './gradients/Asin_grad';\nimport { asinhGradConfig } from './gradients/Asinh_grad';\nimport { atan2GradConfig } from './gradients/Atan2_grad';\nimport { atanGradConfig } from './gradients/Atan_grad';\nimport { atanhGradConfig } from './gradients/Atanh_grad';\nimport { avgPool3DGradConfig } from './gradients/AvgPool3D_grad';\nimport { avgPoolGradConfig } from './gradients/AvgPool_grad';\nimport { batchMatMulGradConfig } from './gradients/BatchMatMul_grad';\nimport { batchToSpaceNDGradConfig } from './gradients/BatchToSpaceND_grad';\nimport { broadcastToGradConfig } from './gradients/BroadcastTo_grad';\nimport { castGradConfig } from './gradients/Cast_grad';\nimport { ceilGradConfig } from './gradients/Ceil_grad';\nimport { clipByValueGradConfig } from './gradients/ClipByValue_grad';\nimport { complexAbsGradConfig } from './gradients/ComplexAbs_grad';\nimport { concatGradConfig } from './gradients/Concat_grad';\nimport { conv2DGradConfig } from './gradients/Conv2D_grad';\nimport { conv2DBackpropInputGradConfig } from './gradients/Conv2DBackpropInput_grad';\nimport { conv3DGradConfig } from './gradients/Conv3D_grad';\nimport { cosGradConfig } from './gradients/Cos_grad';\nimport { coshGradConfig } from './gradients/Cosh_grad';\nimport { cumsumGradConfig } from './gradients/Cumsum_grad';\nimport { depthwiseConv2dNativeGradConfig } from './gradients/DepthwiseConv2dNative_grad';\nimport { dilation2dGradConfig } from './gradients/Dilation2D_grad';\nimport { eluGradConfig } from './gradients/Elu_grad';\nimport { erfGradConfig } from './gradients/Erf_grad';\nimport { expGradConfig } from './gradients/Exp_grad';\nimport { expandDimsGradConfig } from './gradients/ExpandDims_grad';\nimport { expm1GradConfig } from './gradients/Expm1_grad';\nimport { floorGradConfig } from './gradients/Floor_grad';\nimport { floorDivGradConfig } from './gradients/FloorDiv_grad';\nimport { fusedBatchNormGradConfig } from './gradients/FusedBatchNorm_grad';\nimport { gatherGradConfig } from './gradients/GatherV2_grad';\nimport { greaterEqualGradConfig } from './gradients/GreaterEqual_grad';\nimport { identityGradConfig } from './gradients/Identity_grad';\nimport { isFiniteGradConfig } from './gradients/IsFinite_grad';\nimport { isInfGradConfig } from './gradients/IsInf_grad';\nimport { isNanGradConfig } from './gradients/IsNan_grad';\nimport { leakyReluGradConfig } from './gradients/LeakyRelu_grad';\nimport { log1pGradConfig } from './gradients/Log1p_grad';\nimport { logGradConfig } from './gradients/Log_grad';\nimport { logSoftmaxGradConfig } from './gradients/LogSoftmax_grad';\nimport { lrnGradConfig } from './gradients/LRN_grad';\nimport { maxGradConfig } from './gradients/Max_grad';\nimport { maximumGradConfig } from './gradients/Maximum_grad';\nimport { maxPool3DGradConfig } from './gradients/MaxPool3D_grad';\nimport { maxPoolGradConfig } from './gradients/MaxPool_grad';\nimport { meanGradConfig } from './gradients/Mean_grad';\nimport { minGradConfig } from './gradients/Min_grad';\nimport { minimumGradConfig } from './gradients/Minimum_grad';\nimport { mirrorPadGradConfig } from './gradients/MirrorPad_grad';\nimport { modGradConfig } from './gradients/Mod_grad';\nimport { multiplyGradConfig } from './gradients/Multiply_grad';\nimport { negGradConfig } from './gradients/Neg_grad';\nimport { oneHotGradConfig } from './gradients/OneHot_grad';\nimport { onesLikeGradConfig } from './gradients/OnesLike_grad';\nimport { packGradConfig } from './gradients/Pack_grad';\nimport { padV2GradConfig } from './gradients/PadV2_grad';\nimport { powGradConfig } from './gradients/Pow_grad';\nimport { preluGradConfig } from './gradients/Prelu_grad';\nimport { divGradConfig } from './gradients/RealDiv_grad';\nimport { reciprocalGradConfig } from './gradients/Reciprocal_grad';\nimport { relu6GradConfig } from './gradients/Relu6_grad';\nimport { reluGradConfig } from './gradients/Relu_grad';\nimport { reshapeGradConfig } from './gradients/Reshape_grad';\nimport { resizeBilinearGradConfig } from './gradients/ResizeBilinear_grad';\nimport { resizeNearestNeighborGradConfig } from './gradients/ResizeNearestNeighbor_grad';\nimport { reverseGradConfig } from './gradients/Reverse_grad';\nimport { roundGradConfig } from './gradients/Round_grad';\nimport { rsqrtGradConfig } from './gradients/Rsqrt_grad';\nimport { selectGradConfig } from './gradients/Select_grad';\nimport { seluGradConfig } from './gradients/Selu_grad';\nimport { sigmoidGradConfig } from './gradients/Sigmoid_grad';\nimport { signGradConfig } from './gradients/Sign_grad';\nimport { sinGradConfig } from './gradients/Sin_grad';\nimport { sinhGradConfig } from './gradients/Sinh_grad';\nimport { sliceGradConfig } from './gradients/Slice_grad';\nimport { softmaxGradConfig } from './gradients/Softmax_grad';\nimport { softplusGradConfig } from './gradients/Softplus_grad';\nimport { spaceToBatchNDGradConfig } from './gradients/SpaceToBatchND_grad';\nimport { splitVGradConfig } from './gradients/SplitV_grad';\nimport { sqrtGradConfig } from './gradients/Sqrt_grad';\nimport { squareGradConfig } from './gradients/Square_grad';\nimport { squaredDifferenceGradConfig } from './gradients/SquaredDifference_grad';\nimport { stepGradConfig } from './gradients/Step_grad';\nimport { subGradConfig } from './gradients/Sub_grad';\nimport { sumGradConfig } from './gradients/Sum_grad';\nimport { tanGradConfig } from './gradients/Tan_grad';\nimport { tanhGradConfig } from './gradients/Tanh_grad';\nimport { tileGradConfig } from './gradients/Tile_grad';\nimport { transposeGradConfig } from './gradients/Transpose_grad';\nimport { unpackGradConfig } from './gradients/Unpack_grad';\nimport { unsortedSegmentSumGradConfig } from './gradients/UnsortedSegmentSum_grad';\nimport { zerosLikeGradConfig } from './gradients/ZerosLike_grad';\nimport { registerGradient } from './kernel_registry';\n// Export all kernel configs here so that the package can auto register them\nconst gradConfigs = [\n absGradConfig,\n acosGradConfig,\n acoshGradConfig,\n addGradConfig,\n addNGradConfig,\n argMaxGradConfig,\n argMinGradConfig,\n asinGradConfig,\n asinhGradConfig,\n atan2GradConfig,\n atanGradConfig,\n atanhGradConfig,\n avgPool3DGradConfig,\n avgPoolGradConfig,\n batchMatMulGradConfig,\n batchToSpaceNDGradConfig,\n broadcastToGradConfig,\n castGradConfig,\n ceilGradConfig,\n clipByValueGradConfig,\n complexAbsGradConfig,\n concatGradConfig,\n conv2DBackpropInputGradConfig,\n conv2DGradConfig,\n conv3DGradConfig,\n cosGradConfig,\n coshGradConfig,\n cumsumGradConfig,\n depthwiseConv2dNativeGradConfig,\n dilation2dGradConfig,\n divGradConfig,\n eluGradConfig,\n erfGradConfig,\n expGradConfig,\n expandDimsGradConfig,\n expm1GradConfig,\n floorDivGradConfig,\n floorGradConfig,\n fusedBatchNormGradConfig,\n gatherGradConfig,\n greaterEqualGradConfig,\n identityGradConfig,\n isFiniteGradConfig,\n isInfGradConfig,\n isNanGradConfig,\n leakyReluGradConfig,\n log1pGradConfig,\n logGradConfig,\n logSoftmaxGradConfig,\n lrnGradConfig,\n maxGradConfig,\n maxGradConfig,\n maximumGradConfig,\n maxPool3DGradConfig,\n maxPoolGradConfig,\n meanGradConfig,\n minGradConfig,\n minimumGradConfig,\n mirrorPadGradConfig,\n modGradConfig,\n multiplyGradConfig,\n negGradConfig,\n oneHotGradConfig,\n onesLikeGradConfig,\n packGradConfig,\n padV2GradConfig,\n padV2GradConfig,\n powGradConfig,\n preluGradConfig,\n reciprocalGradConfig,\n relu6GradConfig,\n reluGradConfig,\n reshapeGradConfig,\n resizeBilinearGradConfig,\n resizeNearestNeighborGradConfig,\n reverseGradConfig,\n roundGradConfig,\n rsqrtGradConfig,\n selectGradConfig,\n seluGradConfig,\n sigmoidGradConfig,\n signGradConfig,\n sinGradConfig,\n sinhGradConfig,\n sliceGradConfig,\n softmaxGradConfig,\n softplusGradConfig,\n spaceToBatchNDGradConfig,\n spaceToBatchNDGradConfig,\n splitVGradConfig,\n splitVGradConfig,\n sqrtGradConfig,\n squaredDifferenceGradConfig,\n squareGradConfig,\n stepGradConfig,\n subGradConfig,\n sumGradConfig,\n tanGradConfig,\n tanhGradConfig,\n tileGradConfig,\n transposeGradConfig,\n unpackGradConfig,\n unsortedSegmentSumGradConfig,\n zerosLikeGradConfig\n];\nfor (const gradientConfig of gradConfigs) {\n registerGradient(gradientConfig);\n}\n//# sourceMappingURL=register_all_gradients.js.map","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {backend} from '@tensorflow/tfjs-core';\nimport {DataFormat} from '../keras_format/common';\n\nlet _epsilon: number;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n if (_epsilon == null) {\n _epsilon = backend().epsilon();\n }\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport {epsilon} from './backend/common';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n *\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormArgs {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class MaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(args: MaxNormArgs) {\n super();\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.registerClass(MaxNorm);\n\nexport interface UnitNormArgs {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\nexport class UnitNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(args: UnitNormArgs) {\n super();\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.registerClass(UnitNorm);\n\nexport class NonNeg extends Constraint {\n /** @nocollapse */\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.registerClass(NonNeg);\n\nexport interface MinMaxNormArgs {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n /** @nocollapse */\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(args: MinMaxNormArgs) {\n super();\n this.minValue =\n args.minValue != null ? args.minValue : this.defaultMinValue;\n this.maxValue =\n args.maxValue != null ? args.maxValue : this.defaultMaxValue;\n this.rate = args.rate != null ? args.rate : this.defaultRate;\n this.axis = args.axis != null ? args.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(1.0 - this.rate, norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.registerClass(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints';\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Constraints',namespace: 'constraints'}\n */\nexport function maxNorm(args: MaxNormArgs): Constraint {\n return new MaxNorm(args);\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function unitNorm(args: UnitNormArgs): Constraint {\n return new UnitNorm(args);\n}\n\n/**\n * Constains the weight to be non-negative.\n *\n * @doc {heading: 'Constraints', namespace: 'constraints'}\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/** @doc {heading: 'Constraints', namespace: 'constraints'} */\nexport function minMaxNorm(config: MinMaxNormArgs): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492)\n/** @docalias (null | number)[] */\nexport type Shape = Array;\n\n// The tfjs-core version of DataType must stay synced with this.\nexport type DataType = 'float32'|'int32'|'bool'|'complex64'|'string';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\n\nexport type InterpolationFormat = 'nearest'|'bilinear';\nexport const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear'];\n// These constants have a snake vs. camel distinction.\nexport type DataFormatSerialization = 'channels_first'|'channels_last';\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\n\n/** @docinline */\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\n\n/** @docinline */\nexport type SampleWeightMode = 'temporal';\nexport const VALID_SAMPLE_WEIGHT_MODES = ['temporal'];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common';\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\nexport function checkInterpolationFormat(value?: string): void {\n checkStringTypeUnionValue(\n VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value);\n}\n\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = `${scopedName}_${index}`;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return !!name.match(tensorNameRegex);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\nimport {checkDataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {HasShape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: tfc.DataType): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten a Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n case 5:\n return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4]\n ]);\n case 6:\n return tfc.slice(array, [start, 0, 0, 0, 0, 0], [\n size, array.shape[1], array.shape[2], array.shape[3], array.shape[4],\n array.shape[5]\n ]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `tf.Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `tf.Tensor` to concatenate.\n * @param b The 2nd `tf.Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n `concatAlongFirstAxis() received an unsupported ` +\n `tensor rank: ${a.rank}`);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation:\n *\n * For N dimensions it is a sum product over the last axis of x and the\n * second-to-last of y:\n *\n * @param a A tensor of at least rank 2.\n * @param b A tensor of at least rank 2.\n * @param activation (optional) A string identifying the activation\n * function.\n * @return Result of the dot operation.\n */\nexport function dot(\n a: Tensor, b: Tensor, activation?: tfc.fused.Activation,\n bias?: Tensor): Tensor {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new NotImplementedError(\n `dot requires both inputs to be rank >= 2` +\n ` but got x shape = ${a.shape} and y shape = ${b.shape}`);\n }\n if (b.rank >= 3) {\n const xLastDim = a.shape.slice(-1)[0];\n const ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new NotImplementedError(\n `If rank y >= 3, then the second last dim` +\n ` of y must equal the last dim of x but got x shape = ${\n a.shape} and ` +\n ` y shape = ${b.shape}`);\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n const transposeA = false;\n const transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a,\n b: b as Tensor2D,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n });\n } else {\n // Reshape x into the analogous 2D Tensor.\n const aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n const aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n const bShape = b.shape.slice();\n const bLastDim = bShape.pop();\n const ySecondLastDim = bShape.pop();\n const yOtherDims = [...bShape, bLastDim];\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n const perm = Array.from({length: b.rank}, (_, i) => {\n if (i === 0) {\n return b.rank - 2;\n } else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n const outputShape = [...aFirstDims, ...yOtherDims];\n const transposeA = false;\n const transposeB = false;\n return tfc.fused\n .matMul({\n a,\n b,\n transposeA,\n transposeB,\n bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null,\n activation\n })\n .reshape(outputShape);\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `tf.Tensor` that are === 0 are mapped to 0.\n * Elements of the input `tf.Tensor` that are > 0 are mapped to 1.\n * Elements of the input `tf.Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `tf.Tensor`.\n * @return The sign `tf.Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(-1, onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mul(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic\n * conversion to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a);\n });\n}\n\n/**\n * Reshapes bias tensor according to rank of x.\n */\nfunction reshapeBias(xRank: number, bias: Tensor, dataFormat: string) {\n const biasShape = bias.shape;\n\n if (bias.rank !== 1 && bias.rank !== xRank) {\n throw new ValueError(\n `Unexpected bias dimensions: ${bias.rank}` +\n `; expected it to be 1 or ${xRank}`);\n }\n\n if (xRank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1, 1]);\n } else {\n return bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1, 1]);\n } else {\n return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n return bias.reshape([1, biasShape[0], 1]);\n } else {\n return bias.reshape([1, biasShape[1], biasShape[0]]);\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n return bias.reshape([1, 1, biasShape[0]]);\n } else {\n return bias.reshape([1].concat(biasShape));\n }\n }\n } else if (xRank < 3) {\n return bias;\n }\n throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`);\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n return x.add(reshapeBias(x.rank, bias, dataFormat));\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.abs(x).add(1)));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`. Optional.\n * @param seed random seed to ensure determinism. Optional.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => tfc.dropout(x, level, noiseShape, seed));\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(.5, tfc.mul(.2, x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training`\n * boolean flag here, because there is no such thing in the TF.js imperative\n * backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {BaseSerialization} from './types';\n\n// TODO(soergel): Move the CamelCase versions back out of keras_format\n// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic?\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\n\n// These constants have a snake vs. camel distinction.\nexport type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg';\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform'|'truncatedNormal';\nexport const VALID_DISTRIBUTION_VALUES =\n ['normal', 'uniform', 'truncatedNormal'];\n// These constants have a snake vs. camel distinction.\nexport type DistributionSerialization = 'normal'|'uniform'|'truncated_normal';\n\nexport type ZerosSerialization = BaseSerialization<'Zeros', {}>;\n\nexport type OnesSerialization = BaseSerialization<'Ones', {}>;\n\nexport type ConstantConfig = {\n value: number;\n};\n\nexport type ConstantSerialization =\n BaseSerialization<'Constant', ConstantConfig>;\n\nexport type RandomNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type RandomNormalSerialization =\n BaseSerialization<'RandomNormal', RandomNormalConfig>;\n\nexport type RandomUniformConfig = {\n minval?: number;\n maxval?: number;\n seed?: number;\n};\n\nexport type RandomUniformSerialization =\n BaseSerialization<'RandomUniform', RandomUniformConfig>;\n\nexport type TruncatedNormalConfig = {\n mean?: number;\n stddev?: number;\n seed?: number;\n};\n\nexport type TruncatedNormalSerialization =\n BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>;\n\nexport type VarianceScalingConfig = {\n scale?: number;\n\n mode?: FanModeSerialization;\n distribution?: DistributionSerialization;\n seed?: number;\n};\n\nexport type VarianceScalingSerialization =\n BaseSerialization<'VarianceScaling', VarianceScalingConfig>;\n\nexport type OrthogonalConfig = {\n seed?: number;\n gain?: number;\n};\n\nexport type OrthogonalSerialization =\n BaseSerialization<'Orthogonal', OrthogonalConfig>;\n\nexport type IdentityConfig = {\n gain?: number;\n};\n\nexport type IdentitySerialization =\n BaseSerialization<'Identity', IdentityConfig>;\n\n// Update initializerClassNames below in concert with this.\nexport type InitializerSerialization = ZerosSerialization|OnesSerialization|\n ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization|\n TruncatedNormalSerialization|IdentitySerialization|\n VarianceScalingSerialization|OrthogonalSerialization;\n\nexport type InitializerClassName = InitializerSerialization['class_name'];\n\n// We can't easily extract a string[] from the string union type, but we can\n// recapitulate the list, enforcing at compile time that the values are valid\n// and that we have the right number of them.\n\n/**\n * A string array of valid Initializer class names.\n *\n * This is guaranteed to match the `InitializerClassName` union type.\n */\nexport const initializerClassNames: InitializerClassName[] = [\n 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform',\n 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity'\n];\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {DataFormat, Shape} from './keras_format/common';\nimport {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport class Zeros extends Initializer {\n /** @nocollapse */\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.registerClass(Zeros);\n\nexport class Ones extends Initializer {\n /** @nocollapse */\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.registerClass(Ones);\n\nexport interface ConstantArgs {\n /** The value for each element in the variable. */\n value: number;\n}\n\nexport class Constant extends Initializer {\n /** @nocollapse */\n static className = 'Constant';\n private value: number;\n constructor(args: ConstantArgs) {\n super();\n if (typeof args !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${args}`);\n }\n if (args.value === undefined) {\n throw new ValueError(`config must have value set but got ${args}`);\n }\n this.value = args.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.registerClass(Constant);\n\nexport interface RandomUniformArgs {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomUniform extends Initializer {\n /** @nocollapse */\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(args: RandomUniformArgs) {\n super();\n this.minval = args.minval || this.DEFAULT_MINVAL;\n this.maxval = args.maxval || this.DEFAULT_MAXVAL;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.registerClass(RandomUniform);\n\nexport interface RandomNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class RandomNormal extends Initializer {\n /** @nocollapse */\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: RandomNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(RandomNormal);\n\nexport interface TruncatedNormalArgs {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\nexport class TruncatedNormal extends Initializer {\n /** @nocollapse */\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(args: TruncatedNormalArgs) {\n super();\n this.mean = args.mean || this.DEFAULT_MEAN;\n this.stddev = args.stddev || this.DEFAULT_STDDEV;\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.registerClass(TruncatedNormal);\n\nexport interface IdentityArgs {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\nexport class Identity extends Initializer {\n /** @nocollapse */\n static className = 'Identity';\n private gain: number;\n constructor(args: IdentityArgs) {\n super();\n this.gain = args.gain != null ? args.gain : 1.0;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain};\n }\n}\nserialization.registerClass(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingArgs {\n /** Scaling factor (positive float). */\n scale?: number;\n\n /** Fanning mode for inputs and outputs. */\n mode?: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution?: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class VarianceScaling extends Initializer {\n /** @nocollapse */\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(args: VarianceScalingArgs) {\n super();\n if (args.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${args.scale}`);\n }\n this.scale = args.scale == null ? 1.0 : args.scale;\n this.mode = args.mode == null ? 'fanIn' : args.mode;\n checkFanMode(this.mode);\n this.distribution =\n args.distribution == null ? 'normal' : args.distribution;\n checkDistribution(this.distribution);\n this.seed = args.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType ${dtype}.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.registerClass(VarianceScaling);\n\nexport interface SeedOnlyInitializerArgs {\n /** Random number generator seed. */\n seed?: number;\n}\n\nexport class GlorotUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotUniform';\n\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotUniform);\n\nexport class GlorotNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'GlorotNormal';\n\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(GlorotNormal);\n\nexport class HeNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeNormal);\n\nexport class HeUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'HeUniform';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(HeUniform);\n\nexport class LeCunNormal extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunNormal);\n\nexport class LeCunUniform extends VarianceScaling {\n /** @nocollapse */\n static className = 'LeCunNormal';\n\n constructor(args?: SeedOnlyInitializerArgs) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'uniform',\n seed: args == null ? null : args.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\nserialization.registerClass(LeCunUniform);\n\nexport interface OrthogonalArgs extends SeedOnlyInitializerArgs {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\nexport class Orthogonal extends Initializer {\n /** @nocollapse */\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(args?: OrthogonalArgs) {\n super();\n this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain;\n this.seed = args.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length < 2) {\n throw new NotImplementedError('Shape must be at least 2D.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(this.gain, q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.registerClass(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier =\n 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'|\n 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'heUniform': 'HeUniform',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'leCunUniform': 'LeCunUniform',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'HeUniform') {\n return new HeUniform();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else if (className === 'LeCunUniform') {\n return new LeCunUniform();\n } else {\n const config: serialization.ConfigDict = {};\n config['className'] = className;\n config['config'] = {};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers';\n\n/**\n * Initializer that generates tensors initialized to 0.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * Initializer that generates tensors initialized to 1.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function constant(args: ConstantArgs): Initializer {\n return new Constant(args);\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomUniform(args: RandomUniformArgs): Initializer {\n return new RandomUniform(args);\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function randomNormal(args: RandomNormalArgs): Initializer {\n return new RandomNormal(args);\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function truncatedNormal(args: TruncatedNormalArgs): Initializer {\n return new TruncatedNormal(args);\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function identity(args: IdentityArgs): Initializer {\n return new Identity(args);\n}\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function varianceScaling(config: VarianceScalingArgs): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotUniform(args);\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function glorotNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new GlorotNormal(args);\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function heNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new HeNormal(args);\n}\n\n/**\n * He uniform initializer.\n *\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / fan_in)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n *\n * @doc {heading: 'Initializers',namespace: 'initializers'}\n */\nexport function heUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new HeUniform(args);\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunNormal(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunNormal(args);\n}\n\n/**\n * LeCun uniform initializer.\n *\n * It draws samples from a uniform distribution in the interval\n * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`,\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function leCunUniform(args: SeedOnlyInitializerArgs): Initializer {\n return new LeCunUniform(args);\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n *\n * @doc {heading: 'Initializers', namespace: 'initializers'}\n */\nexport function orthogonal(args: OrthogonalArgs): Initializer {\n return new Orthogonal(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\n/**\n * An ID to track `tf.SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {getInitializer, Initializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecArgs {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(args: InputSpecArgs) {\n this.dtype = args.dtype;\n this.shape = args.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (args.shape != null) {\n this.ndim = args.shape.length;\n } else {\n this.ndim = args.ndim;\n }\n this.maxNDim = args.maxNDim;\n this.minNDim = args.minNDim;\n this.axes = args.axes || {};\n }\n}\n\n/**\n * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `tf.LayersModel` and the input data's shape, but not values are known.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeArgs {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\n/**\n * The type of the return value of Layer.dispose() and Container.dispose().\n */\nexport interface DisposeResult {\n /**\n * Reference count after the dispose call.\n */\n refCountAfterDispose: number;\n\n /**\n * Number of variables dispose in this dispose call.\n */\n numDisposedVariables: number;\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n args: NodeArgs,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = args.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = args.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = args.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = args.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = args.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = args.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = args.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = args.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = args.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = args.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of args.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n args.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport declare interface LayerArgs {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specified,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /**\n * Whether the weights of this layer are updatable by `fit`.\n * Defaults to true.\n */\n trainable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `tf.LayersModel`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n *\n * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'}\n */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n protected trainable_: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n protected _refCount: number|null;\n\n // A flag for whether fast (i.e., all-zero) weight initialization is to\n // be used during `build()` call. This speeds up weight initialization\n // by saving unnecessary calls to expensive initializers in cases where\n // the initialized values will be overwritten by loaded weight values\n // during model loading.\n private fastWeightInitDuringBuild: boolean;\n\n constructor(args: LayerArgs = {}) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = args.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable_ = args.trainable == null ? true : args.trainable;\n\n if (args.inputShape != null || args.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (args.batchInputShape != null) {\n batchInputShape = args.batchInputShape;\n } else if (args.inputShape != null) {\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n batchInputShape = [batchSize].concat(args.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = args.dtype;\n if (dtype == null) {\n dtype = args.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (args.weights != null) {\n this.initialWeights = args.weights;\n } else {\n this.initialWeights = null;\n }\n\n // The value of `_refCount` is initialized to null. When the layer is used\n // in a symbolic way for the first time, it will be set to 1.\n this._refCount = null;\n\n this.fastWeightInitDuringBuild = false;\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this._trainableWeights.forEach(w => w.trainable = trainable);\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable_) {\n return this._trainableWeights.filter(w => w.trainable);\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights.filter(w => !w.trainable)\n .concat(this._nonTrainableWeights);\n } else {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Reset the states of the layer.\n *\n * This method of the base Layer class is essentially a no-op.\n * Subclasses that are stateful (e.g., stateful RNNs) should override this\n * method.\n */\n resetStates(): void {\n if (!this.stateful) {\n throw new Error(\n 'Cannot call the resetStates() method of a non-stateful Layer ' +\n 'object.');\n }\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n `found shape=${x.shape}.`);\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `tf.Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `tf.SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `tf.SymbolicTensor`s are typically used during the\n * building of non-`tf.Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n // Porting Note: This is a replacement for __call__() in Python.\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n this.assertNotDisposed();\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n\n if (this._refCount === null && noneAreSymbolic) {\n // The first use of this layer is a non-symbolic call, set ref count\n // to 1 so the Layer can be properly disposed if its dispose() method\n // is called.\n this._refCount = 1;\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n this._refCount++;\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"output shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `tf.Tensor`s.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n\n if (this.fastWeightInitDuringBuild) {\n initializer = getInitializer('zeros');\n }\n const initValue = initializer.apply(shape, dtype);\n const weight =\n new LayerVariable(initValue, dtype, name, trainable, constraint);\n initValue.dispose();\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Set the fast-weight-initialization flag.\n *\n * In cases where the initialized weight values will be immediately\n * overwritten by loaded weight values during model loading, setting\n * the flag to `true` saves unnecessary calls to potentially expensive\n * initializers and speeds up the loading process.\n *\n * @param value Target value of the flag.\n */\n setFastWeightInitDuringBuild(value: boolean) {\n this.fastWeightInitDuringBuild = value;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking, ` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n\n /**\n * Dispose the weight variables that this Layer instance holds.\n *\n * @returns {number} Number of disposed variables.\n */\n protected disposeWeights(): number {\n this.weights.forEach(weight => weight.dispose());\n return this.weights.length;\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Layer '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose layer's weights.\n *\n * This method decrease the reference count of the Layer object by 1.\n *\n * A Layer is reference-counted. Its reference count is incremented by 1\n * the first item its `apply()` method is called and when it becomes a part\n * of a new `Node` (through calling the `apply()`) method on a\n * `tf.SymbolicTensor`).\n *\n * If the reference count of a Layer becomes 0, all the weights will be\n * disposed and the underlying memory (e.g., the textures allocated in WebGL)\n * will be freed.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * weights of the Layer will *not* be disposed.\n *\n * After a Layer is disposed, it cannot be used in calls such as `apply()`,\n * `getWeights()` or `setWeights()` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the Container after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the layer has already\n * been disposed.\n *\n * @doc {heading: 'Models', 'subheading': 'Classes'}\n */\n dispose(): DisposeResult {\n if (!this.built) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been ` +\n `built yet.`);\n }\n\n if (this._refCount === null) {\n throw new Error(\n `Cannot dispose Layer ${this.name} because it has not been used ` +\n `yet.`);\n }\n\n this.assertNotDisposed();\n\n let numDisposedVariables = 0;\n if (--this._refCount === 0) {\n numDisposedVariables = this.disposeWeights();\n }\n\n return {refCountAfterDispose: this._refCount, numDisposedVariables};\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `tf.Tensor`s or\n * `tf.SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\n\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport declare interface InputLayerArgs {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\nexport class InputLayer extends Layer {\n /** @nocollapse */\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(args: InputLayerArgs) {\n super({\n dtype: args.dtype,\n name: args.name != null ? args.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (args.batchSize == null) {\n args.batchSize = null;\n }\n if (args.sparse == null) {\n args.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = args.sparse;\n\n if (args.inputShape != null && args.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = args.batchInputShape;\n if (batchInputShape == null) {\n if (args.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [args.batchSize].concat(args.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (args.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is ' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = args.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n dispose(): DisposeResult {\n // dispose() for InputLayer is overridden as no-op.\n return {refCountAfterDispose: this._refCount, numDisposedVariables: 0};\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.registerClass(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n if (promises.length > 0) {\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n }\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in\n * places where the values can be `tf.Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Container} from './engine/container';\nimport {ValueError} from './errors';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\n/** How often to yield to the main thread when training (in ms). */\nexport const DEFAULT_YIELD_EVERY_MS = 125;\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\nexport type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number;\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // LayersModel needs to call Callback.setModel(), but cannot actually depend\n // on Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way LayersModel can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a\n // LayersModel.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every LayersModel.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = 0;\n }\n const total: Scalar =\n tidy(() => add((this.totals[key]), mul(value, batchSize)));\n this.totals[key] = total;\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n const log: Scalar = mul(div(1, this.seen), this.totals[key]);\n logs[key] = log;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object\n * gets returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackArgs {\n onTrainBegin?: (logs?: Logs) => void | Promise;\n onTrainEnd?: (logs?: Logs) => void | Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => void | Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => void | Promise;\n onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => void | Promise;\n protected readonly trainEnd: (logs?: Logs) => void | Promise;\n protected readonly epochBegin:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly epochEnd:\n (epoch: number, logs?: Logs) => void | Promise;\n protected readonly batchBegin:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly batchEnd:\n (batch: number, logs?: Logs) => void | Promise;\n protected readonly yield:\n (epoch: number, batch: number, logs: Logs) => void | Promise;\n\n private yieldEvery: YieldEveryOptions;\n private currentEpoch = 0;\n\n constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) {\n super();\n this.yieldEvery = yieldEvery || 'auto';\n if (this.yieldEvery === 'auto') {\n this.yieldEvery = DEFAULT_YIELD_EVERY_MS;\n }\n if (this.yieldEvery === 'never' && args.onYield != null) {\n throw new Error(\n 'yieldEvery is `never` but you provided an `onYield` callback. ' +\n 'Either change `yieldEvery` or remove the callback');\n }\n if (util.isNumber(this.yieldEvery)) {\n // Decorate `maybeWait` so it will be called at most once every\n // `yieldEvery` ms.\n this.maybeWait = generic_utils.debounce(\n this.maybeWait.bind(this), this.yieldEvery as number);\n }\n this.trainBegin = args.onTrainBegin;\n this.trainEnd = args.onTrainEnd;\n this.epochBegin = args.onEpochBegin;\n this.epochEnd = args.onEpochEnd;\n this.batchBegin = args.onBatchBegin;\n this.batchEnd = args.onBatchEnd;\n this.yield = args.onYield;\n }\n\n async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) {\n const ps: Array> = [];\n if (this.yield != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.yield(epoch, batch, logs as Logs));\n }\n ps.push(nextFrame());\n await Promise.all(ps);\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n this.currentEpoch = epoch;\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.epochEnd(epoch, logs as Logs));\n }\n if (this.yieldEvery === 'epoch') {\n ps.push(nextFrame());\n }\n await Promise.all(ps);\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n const ps: Array> = [];\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n ps.push(this.batchEnd(batch, logs as Logs));\n }\n if (this.yieldEvery === 'batch') {\n ps.push(nextFrame());\n } else if (util.isNumber(this.yieldEvery)) {\n ps.push(this.maybeWait(this.currentEpoch, batch, logs));\n }\n await Promise.all(ps);\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(\n callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs|\n CustomCallbackArgs[],\n yieldEvery: YieldEveryOptions): BaseCallback[] {\n if (callbacks == null) {\n callbacks = {} as BaseCallback;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackArgs[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig, yieldEvery));\n}\n\nexport declare type BaseCallbackConstructor = {\n new (): BaseCallback\n};\n\n/**\n * A global registry for callback constructors to be used during\n * LayersModel.fit().\n */\nexport class CallbackConstructorRegistry {\n private static constructors:\n {[verbosityLevel: number]: BaseCallbackConstructor[]} = {};\n\n /**\n * Blocks public access to constructor.\n */\n private constructor() {}\n\n /**\n * Register a tf.LayersModel.fit() callback constructor.\n *\n * The registered callback constructor will be used to instantiate\n * callbacks for every tf.LayersModel.fit() call afterwards.\n *\n * @param verbosityLevel Level of verbosity at which the `callbackConstructor`\n * is to be reigstered.\n * @param callbackConstructor A no-arg constructor for `tf.Callback`.\n * @throws Error, if the same callbackConstructor has been registered before,\n * either at the same or a different `verbosityLevel`.\n */\n static registerCallbackConstructor(\n verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) {\n util.assert(\n verbosityLevel >= 0 && Number.isInteger(verbosityLevel),\n () => `Verbosity level is expected to be an integer >= 0, ` +\n `but got ${verbosityLevel}`);\n CallbackConstructorRegistry.checkForDuplicate(callbackConstructor);\n if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) {\n CallbackConstructorRegistry.constructors[verbosityLevel] = [];\n }\n CallbackConstructorRegistry.constructors[verbosityLevel].push(\n callbackConstructor);\n }\n\n private static checkForDuplicate(callbackConstructor:\n BaseCallbackConstructor) {\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const constructors = CallbackConstructorRegistry.constructors[+levelName];\n constructors.forEach(ctor => {\n if (ctor === callbackConstructor) {\n throw new ValueError('Duplicate callback constructor.');\n }\n });\n }\n }\n\n /**\n * Clear all registered callback constructors.\n */\n protected static clear() {\n CallbackConstructorRegistry.constructors = {};\n }\n\n /**\n * Create callbacks using the registered callback constructors.\n *\n * Given `verbosityLevel`, all constructors registered at that level or above\n * will be called and the instantiated callbacks will be used.\n *\n * @param verbosityLevel: Level of verbosity.\n */\n static createCallbacks(verbosityLevel: number): BaseCallback[] {\n const constructors: BaseCallbackConstructor[] = [];\n for (const levelName in CallbackConstructorRegistry.constructors) {\n const level = +levelName;\n if (verbosityLevel >= level) {\n constructors.push(...CallbackConstructorRegistry.constructors[level]);\n }\n }\n return constructors.map(ctor => new ctor());\n }\n}\n\nexport function configureCallbacks(\n callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,\n initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,\n batchSize: number, doValidation: boolean,\n callbackMetrics: string[]): {callbackList: CallbackList, history: History} {\n const history = new History();\n const actualCallbacks: BaseCallback[] = [\n new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)\n ];\n if (callbacks != null) {\n actualCallbacks.push(...callbacks);\n }\n actualCallbacks.push(history);\n const callbackList = new CallbackList(actualCallbacks);\n\n // TODO(cais): Figure out when this LayersModel instance can have a\n // dynamically\n // set property called 'callback_model' as in PyKeras.\n\n callbackList.setParams({\n epochs,\n initialEpoch,\n samples: numTrainSamples,\n steps: stepsPerEpoch,\n batchSize,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n return {callbackList, history};\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config dict of the form {class_name: str, config: dict}\n * @param customObjects dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns Layer instance (may be LayersModel, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer', fastWeightInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n if (x.dtype !== 'float32') {\n x = x.asType('float32');\n }\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.fill(squareSum.shape, epsilon());\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(100, tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(1, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(1, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1);\n return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = Math.log(2);\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param labels The labels.\n * @param logits The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n labels: Tensor, logits: Tensor): Tensor {\n if (!util.arraysEqual(labels.shape, logits.shape)) {\n throw new ValueError(\n `logits and labels must have the same shape, but got shapes ` +\n `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`);\n }\n return tidy(() => {\n // The logistic loss formula from above is\n // x - x * z + log(1 + exp(-x))\n // For x < 0, a more numerically stable formula is\n // -x * z + log(1 + exp(x))\n // Note that these two expressions can be combined into the following:\n // max(x, 0) - x * z + log(1 + exp(-abs(x)))\n const reluLogits = logits.relu();\n const negAbsLogits = logits.abs().neg();\n return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p());\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(1, y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(epsilon(), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\nexport const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n};\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n let errMsg = `Unknown loss ${identifierOrFn}`;\n if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) {\n errMsg = `Unknown loss ${identifierOrFn}. ` +\n 'Use \"categoricalCrossentropy\" as the string name for ' +\n 'tf.losses.softmaxCrossEntropy';\n }\n throw new ValueError(errMsg);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {lossesMap} from './losses';\nimport {LossOrMetricFn} from './types';\nimport * as util from './utils/generic_utils';\n\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(.5, tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\nfunction truePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nfunction falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32');\n });\n}\n\nfunction falsePositives(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32');\n });\n}\n\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fp = falsePositives(yTrue, yPred);\n\n const denominator = tp.add(fp);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const tp = truePositives(yTrue, yPred);\n const fn = falseNegatives(yTrue, yPred);\n\n const denominator = tp.add(fn);\n\n return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0)\n .cast('float32');\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n if (yTrue.rank === yPred.rank) {\n yTrue = yTrue.squeeze([yTrue.rank - 1]);\n }\n yPred = yPred.argMax(-1);\n if (yPred.dtype !== yTrue.dtype) {\n yPred = yPred.asType(yTrue.dtype);\n }\n return tfc.equal(yTrue, yPred).asType('float32');\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n precision,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine\n};\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n\n/**\n * Get the shortcut function name.\n *\n * If the fn name is a string,\n * directly return the string name.\n * If the function is included in metricsMap or lossesMap,\n * return key of the map.\n * - If the function relative to multiple keys,\n * return the first found key as the function name.\n * - If the function exists in both lossesMap and metricsMap,\n * search lossesMap first.\n * If the function is not included in metricsMap or lossesMap,\n * return the function name.\n *\n * @param fn loss function, metric function, or short cut name.\n * @returns Loss or Metric name in string.\n */\nexport function getLossOrMetricName(fn: string|LossOrMetricFn): string {\n util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`);\n if (typeof fn === 'string') {\n return fn;\n } else {\n let fnName;\n for (const key of Object.keys(lossesMap)) {\n if (lossesMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n for (const key of Object.keys(metricsMap)) {\n if (metricsMap[key] === fn) {\n fnName = key;\n break;\n }\n }\n if (fnName !== undefined) {\n return fnName;\n }\n return (fn as Function).name;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\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","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\nimport {toList} from '../utils/generic_utils';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // a. If types match, return val tensor as is.\n return val;\n }\n try {\n // b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n private id2Mask: {[id: number]: Tensor} = {};\n private name2Id: {[name: string]: number} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n *\n * @param key The key of the feed.\n * @param value The value of the tensor feed.\n * @param mask The value of the mask feed (optional).\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n this.name2Id[key.name] = key.id;\n if (mask != null) {\n this.id2Mask[key.id] = mask;\n }\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get all the SymbolicTensor available in this FeedDict.\n */\n names(): string[] {\n return Object.keys(this.name2Id);\n }\n\n /**\n * Get the feed value for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Value[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Value[id];\n }\n }\n\n /**\n * Get the feed mask for given key.\n * @param key The SymbolicTensor, or its name (as a string), of which the\n * value is sought.\n * @returns If `key` exists, the corresponding feed mask.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getMask(key: SymbolicTensor|string): Tensor {\n if (key instanceof SymbolicTensor) {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${key.name}`);\n } else {\n return this.id2Mask[key.id];\n }\n } else {\n const id = this.name2Id[key];\n if (id == null) {\n throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`);\n }\n return this.id2Mask[id];\n }\n }\n\n /** Dispose all mask Tensors held by this object. */\n disposeMasks() {\n if (this.id2Mask != null) {\n dispose(this.id2Mask);\n }\n }\n}\n\n// Cache for topologically sorted SymbolicTensors for given execution\n// targets (i.e., fetches).\nconst cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {};\n\n// Cache for recipient count maps for given execution targets (i.e., fetches).\nconst cachedRecipientCounts:\n {[concatFetchNames: string]: {[fetchName: string]: number}} = {};\n\n/**\n * Interface for the optional object used for probing the memory\n * usage and other statistics during execution.\n */\nexport interface ExecutionProbe {\n /**\n * Maximum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n maxNumTensors?: number;\n\n /**\n * Minimum number of tensors that exist during all steps of the\n * execution. Tensor counts are measured at the beginning of every\n * step.\n */\n minNumTensors?: number;\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the\n * inputs obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @param probe: A probe object (of interface `ExecutionProbe`) used for\n * testing memory footprint of `execute` calls.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs, probe?: ExecutionProbe): Tensor|\n Tensor[]|[Tensor | Tensor[]] {\n const training: boolean = kwargs == null ? false : kwargs['training'];\n\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputNames = fetchArray.map(t => t.name);\n const finalOutputs: Tensor[] = [];\n const feedNames = feedDict.names();\n for (const outputName of outputNames) {\n if (feedNames.indexOf(outputName) !== -1) {\n finalOutputs.push(feedDict.getValue(outputName));\n } else {\n finalOutputs.push(null);\n }\n }\n\n if (probe != null) {\n // For optional probing of memory footprint during execution.\n probe.maxNumTensors = -Infinity;\n probe.minNumTensors = Infinity;\n }\n\n // Check cache.\n const fetchAndFeedKey =\n outputNames.join(',') + '|' + feedDict.names().join(',');\n let sorted: SymbolicTensor[];\n let recipientCounts: {[fetchName: string]: number};\n if (cachedSorted[fetchAndFeedKey] == null) {\n // Cache doesn't contain the desired combination of fetches. Compute\n // topological sort for the combination for the first time.\n const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict);\n sorted = out.sorted;\n recipientCounts = out.recipientCounts;\n\n // Store results in cache for future use.\n cachedSorted[fetchAndFeedKey] = sorted;\n cachedRecipientCounts[fetchAndFeedKey] = recipientCounts;\n }\n sorted = cachedSorted[fetchAndFeedKey];\n recipientCounts = {};\n if (!training) {\n Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]);\n }\n\n const internalFeedDict = new FeedDict(feedDict);\n\n // Start iterative execution on the topologically-sorted SymbolicTensors.\n for (let i = 0; i < sorted.length; ++i) {\n if (probe != null) {\n // For optional probing of memory usage during execution.\n const numTensors = memory().numTensors;\n if (numTensors > probe.maxNumTensors) {\n probe.maxNumTensors = numTensors;\n }\n if (numTensors < probe.minNumTensors) {\n probe.minNumTensors = numTensors;\n }\n }\n\n const symbolic = sorted[i];\n const srcLayer = symbolic.sourceLayer;\n if (srcLayer instanceof InputLayer) {\n continue;\n }\n const inputValues: Tensor[] = [];\n const inputMasks: Tensor[] = [];\n const tensorsToDispose: Tensor[] = [];\n\n let maskExists = false;\n for (const input of symbolic.inputs) {\n const value = internalFeedDict.getValue(input);\n const mask = internalFeedDict.getMask(input);\n inputValues.push(value);\n inputMasks.push(mask);\n if (mask != null) {\n maskExists = true;\n }\n if (!training) {\n recipientCounts[input.name]--;\n if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) &&\n outputNames.indexOf(input.name) === -1 && !value.isDisposed &&\n input.sourceLayer.stateful !== true) {\n tensorsToDispose.push(value);\n }\n }\n }\n\n if (maskExists) {\n kwargs = kwargs || {};\n kwargs['mask'] = inputMasks[0];\n }\n const outputTensors =\n toList(srcLayer.apply(inputValues, kwargs)) as Tensor[];\n let outputMask: Tensor|Tensor[] = null;\n if (srcLayer.supportsMasking) {\n outputMask = srcLayer.computeMask(inputValues, inputMasks);\n }\n const layerOutputs = getNodeOutputs(symbolic);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) {\n internalFeedDict.add(\n outputSymbolicTensors[i], outputTensors[i],\n Array.isArray(outputMask) ? outputMask[0] : outputMask);\n }\n const index = outputNames.indexOf(outputSymbolicTensors[i].name);\n if (index !== -1) {\n finalOutputs[index] = outputTensors[i];\n }\n }\n\n if (!training) {\n // Clean up Tensors that are no longer needed.\n dispose(tensorsToDispose);\n }\n }\n // NOTE(cais): Unlike intermediate tensors, we don't discard mask\n // tensors as we go, because these tensors are sometimes passed over a\n // series of mutliple layers, i.e., not obeying the immediate input\n // relations in the graph. If this becomes a memory-usage concern,\n // we can improve this in the future.\n internalFeedDict.disposeMasks();\n\n return arrayFetches ? finalOutputs : finalOutputs[0];\n}\n\ntype RecipientCounts = {\n [fetchName: string]: number\n};\n\nexport type RecipientMap = {\n [fetchName: string]: Set;\n};\n\n/**\n * Sort the `SymbolicTensor`s topologically, for an array of fetches.\n *\n * This function calls getTopologicalSortAndRecipientCountsForOneFetch and\n * merges their results.\n *\n * @param fetch The array of fetches requested. Must be a non-empty array.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`.\n */\nfunction getTopologicalSortAndRecipientCounts(\n fetches: SymbolicTensor[], feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} {\n util.assert(\n fetches != null && fetches.length > 0,\n () => `Expected at least one fetch, got none`);\n\n let finalSorted: SymbolicTensor[] = [];\n let finalRecipientMap: RecipientMap = {};\n if (fetches.length === 1) {\n // Special-casing 1 fetch for efficiency.\n const out =\n getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict);\n finalSorted = out.sorted;\n finalRecipientMap = out.recipientMap;\n } else {\n const visited = new Set();\n for (const fetch of fetches) {\n const {sorted, recipientMap} =\n getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict);\n\n // Merge sorted SymbolicTensor Arrays.\n for (const symbolicTensor of sorted) {\n if (!visited.has(symbolicTensor.name)) {\n finalSorted.push(symbolicTensor);\n visited.add(symbolicTensor.name);\n }\n }\n\n // Merge recipient maps.\n for (const name in recipientMap) {\n if (finalRecipientMap[name] == null) {\n finalRecipientMap[name] = new Set();\n }\n recipientMap[name].forEach(\n recipient => finalRecipientMap[name].add(recipient));\n }\n }\n }\n return {\n sorted: finalSorted,\n recipientCounts: recipientMap2Counts(finalRecipientMap)\n };\n}\n\nfunction recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts {\n const recipientCounts: RecipientCounts = {};\n for (const name in recipientMap) {\n recipientCounts[name] = recipientMap[name].size;\n }\n return recipientCounts;\n}\n\n/**\n * Sort the `SymbolicTensor`s topologically, for a single fetch.\n *\n * This helper function processes the upstream SymbolicTensors of a single\n * fetch.\n *\n * @param fetch The single fetch requested.\n * @param feedDict The dictionary of fed values.\n * @returns sorted: Topologically-sorted array of SymbolicTensors.\n * recipientMap: Recipient names for all SymbolicTensors in `sorted`.\n */\nexport function getTopologicalSortAndRecipientCountsForOneFetch(\n fetch: SymbolicTensor, feedDict: FeedDict):\n {sorted: SymbolicTensor[], recipientMap: RecipientMap} {\n const visited = new Set();\n const sorted: SymbolicTensor[] = [];\n const recipientMap: RecipientMap = {};\n\n // Put keys of the feedDict into visited first, so they don't have to be\n // walked. This is needed in case where there are feeds for intermediate\n // SymbolicTensors of the graph.\n for (const key of feedDict.names()) {\n visited.add(key);\n }\n\n const stack: SymbolicTensor[] = [];\n const marks: number[] = [];\n\n // Initial population of stack and marks.\n stack.push(fetch);\n\n while (stack.length > 0) {\n const top = stack[stack.length - 1];\n if (visited.has(top.name)) {\n stack.pop();\n continue;\n }\n const topIsMarked = marks[marks.length - 1] === stack.length - 1;\n if (top.inputs.length === 0 || topIsMarked) {\n // Input SymbolicTensor or all children have been visited.\n stack.pop();\n sorted.push(top);\n visited.add(top.name);\n if (topIsMarked) {\n marks.pop();\n }\n } else {\n // A non-input SymbolicTensor whose upstream SymbolicTensors haven't\n // been visited yet. Push them onto the stack.\n marks.push(stack.length - 1);\n for (const input of top.inputs) {\n // Increment the recipient count. Note that this needs to happen\n // regardless of whether the SymbolicTensor has been visited before.\n if (recipientMap[input.name] == null) {\n recipientMap[input.name] = new Set();\n }\n recipientMap[input.name].add(top.name);\n\n if (visited.has(input.name)) {\n continue; // Avoid repeated visits to the same SymbolicTensor.\n }\n stack.push(input);\n }\n }\n }\n return {sorted, recipientMap};\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\nimport {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {TensorKeyWithArgsArray} from '../keras_format/node_config';\nimport {PyJsonDict} from '../keras_format/types';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {execute, FeedDict} from './executor';\nimport {InputLayer} from './input_layer';\nimport {DisposeResult, Layer, Node, SymbolicTensor} from './topology';\n\n/** Constructor config for Container. */\nexport interface ContainerArgs {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A LayersModel\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n internalContainerRefs: Container[];\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(args: ContainerArgs) {\n // No args passed to super's constructor.\n super({});\n this.name = args.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable_ = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(args.inputs)) {\n this.inputs = args.inputs.slice();\n } else {\n this.inputs = [args.inputs];\n }\n if (Array.isArray(args.outputs)) {\n this.outputs = args.outputs.slice();\n } else {\n this.outputs = [args.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n `${this.inputs.map(x => x.name)}`);\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n `${this.outputs.map(x => x.name)}`);\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n /*\n References to container layers that were constructed internally. We need\n these to properly dispose of tensors from nested containers.\n */\n this.internalContainerRefs = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a LayersModel must be InputLayer objects. ' +\n `Received inputs: ${args.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n if (layer instanceof Container) {\n this.internalContainerRefs.push(layer);\n }\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n this._refCount = 1; // The ref count of a container always start at 1.\n }\n\n protected assertNotDisposed() {\n if (this._refCount === 0) {\n throw new Error(`Container '${this.name}' is already disposed.`);\n }\n }\n\n /**\n * Attempt to dispose a LayersModel's weights.\n *\n * This method decrease the reference count of the LayersModel object by 1.\n *\n * A LayersModel is reference-counted. Its reference count is incremented by 1\n * when it is first constructed and when it is used as a Layer of another\n * LayersModel.\n *\n * If the reference count of a LayersModel becomes 0, the `dispose` method of\n * all its constituent `Layer`s will be called.\n *\n * Note: If the reference count is greater than 0 after the decrement, the\n * `dispose` method of its constituent `Layer`s will *not* be called.\n *\n * After a LayersModel is disposed, it cannot be used in calls such as\n * 'predict`, `evaluate` or `fit` anymore.\n *\n * @returns A DisposeResult Object with the following fields:\n * - refCountAfterDispose: The reference count of the LayersModel after this\n * `dispose()` call.\n * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed\n * during this `dispose()` call.\n * @throws {Error} If the layer is not built yet, or if the LayersModel has\n * already been disposed.\n */\n dispose(): DisposeResult {\n this.assertNotDisposed();\n const result:\n DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0};\n if (--this._refCount === 0) {\n for (const layer of this.layers) {\n result.numDisposedVariables += layer.dispose().numDisposedVariables;\n }\n\n // Call dispose on each internally created container layer again to ensure\n // their refCounts hit zero and their tensors are subsequently deleted.\n for (const container of this.internalContainerRefs) {\n result.numDisposedVariables += container.dispose().numDisposedVariables;\n }\n }\n result.refCountAfterDispose = this._refCount;\n return result;\n }\n\n get trainable() {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.layers.forEach(layer => {\n // tslint:disable-next-line:no-any\n ((layer as any)._trainableWeights as LayerVariable[])\n .forEach(w => w.trainable = trainable);\n });\n this.trainable_ = trainable;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weights A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `tf.Tensor` objects.\n * @param strict Require that the provided weights exactly match those\n * required by the container. Default: `true`. Passing `false` means that\n * extra weights and missing weights will be silently ignored.\n */\n loadWeights(weights: NamedTensorMap, strict = true) {\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of this.layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n // TF 2.2.0 added cell name to the weight name in the format of\n // layer_name/cell_name/weight_name, we need to remove\n // the inner cell name.\n let validatedName = name;\n if (nameToWeight[name] == null) {\n const tokens = name.split('/');\n const shortenNameArray =\n tokens.slice(0, -2).concat([tokens[tokens.length - 1]]);\n validatedName = shortenNameArray.join('/');\n }\n if (nameToWeight[validatedName] != null) {\n weightValueTuples.push([nameToWeight[validatedName], weights[name]]);\n } else if (strict) {\n throw new ValueError(\n `Provided weight data has no target variable: ${name}`);\n }\n delete nameToWeight[validatedName];\n }\n\n if (strict) {\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${\n totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n }\n\n batchSetValue(weightValueTuples);\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns LayersModel config with Keras version information added.\n */\n protected updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {};\n modelConfig['className'] = this.getClassName();\n modelConfig['config'] = theConfig;\n modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`;\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n modelConfig['backend'] = 'TensorFlow.js';\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|PyJsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n const feedDict = new FeedDict();\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs['mask'] == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'LayersModel invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['LayersModel']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex == null) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n const dict: serialization.ConfigDict = {};\n dict['name'] = layer.name;\n dict['className'] = layerClassName;\n dict['config'] = layerConfig;\n dict['inboundNodes'] = filteredInboundNodes;\n layerConfigs.push(dict);\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a LayersModel from its config (output of `get_config()`).\n * @param cls the class to create\n * @param config LayersModel config dictionary.\n * @param customObjects An optional dictionary of custom objects.\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns A LayersModel instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0];\n const inboundNodeIndex = inputData[1];\n const inboundTensorIndex = inputData[2];\n\n kwargs = inputData[3] == null ?\n {} :\n inputData[3] as serialization.ConfigDict;\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData['name'] as string;\n // Instantiate layer.\n const layer =\n deserializeLayer(\n layerData,\n config['customObjects'] != null ?\n config['customObjects'] as serialization.ConfigDict :\n {}) as Layer;\n layer.setFastWeightInitDuringBuild(fastWeightInit);\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData['inboundNodes'] as TensorKeyWithArgsArray[][];\n inboundNodesData.forEach(nodeData => {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n });\n }\n\n // First, we create all layers and enqueue nodes to be processed.\n const name = config['name'];\n const layersFromConfig = config['layers'] as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData['name'] as string];\n if (layer.name in unprocessedNodes) {\n const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name];\n delete unprocessedNodes[layer.name];\n for (const nodeData of currentUnprocessedNodesForLayer) {\n processNode(layer, nodeData);\n }\n }\n }\n }\n\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config['inputLayers'] as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config['outputLayers'] as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reset the state of all stateful constituent layers (if any).\n *\n * Examples of stateful layers include RNN layers whose `stateful` property\n * is set as `true`.\n */\n resetStates() {\n tidy(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core';\n\n/**\n * For multi-class classification problems, this object is designed to store a\n * mapping from class index to the \"weight\" of the class, where higher weighted\n * classes have larger impact on loss, accuracy, and other metrics.\n *\n * This is useful for cases in which you want the model to \"pay more attention\"\n * to examples from an under-represented class, e.g., in unbalanced datasets.\n */\nexport type ClassWeight = {\n [classIndex: number]: number\n};\n\n/**\n * Class weighting for a model with multiple outputs.\n *\n * This object maps each output name to a class-weighting object.\n */\nexport type ClassWeightMap = {\n [outputName: string]: ClassWeight\n};\n\nfunction standardizeSampleOrClassWeights(\n xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[],\n weightType: 'sampleWeight'|'classWeight'): ClassWeight[] {\n const numOutputs = outputNames.length;\n if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) {\n return outputNames.map(name => null);\n }\n if (numOutputs === 1) {\n if (Array.isArray(xWeight) && xWeight.length === 1) {\n return xWeight;\n } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) {\n return [(xWeight as ClassWeightMap)[outputNames[0]]];\n } else {\n return [xWeight as ClassWeight];\n }\n }\n if (Array.isArray(xWeight)) {\n if (xWeight.length !== numOutputs) {\n throw new Error(\n `Provided ${weightType} is an array of ${xWeight.length} ` +\n `element(s), but the model has ${numOutputs} outputs. ` +\n `Make sure a set of weights is provided for each model output.`);\n }\n return xWeight;\n } else if (\n typeof xWeight === 'object' && Object.keys(xWeight).length > 0 &&\n typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] ===\n 'object') {\n const output: ClassWeight[] = [];\n outputNames.forEach(outputName => {\n if (outputName in xWeight) {\n output.push((xWeight as ClassWeightMap)[outputName]);\n } else {\n output.push(null);\n }\n });\n return output;\n } else {\n throw new Error(\n `The model has multiple (${numOutputs}) outputs, ` +\n `so ${weightType} must be either an array with ` +\n `${numOutputs} elements or an object with ${outputNames} keys. ` +\n `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`);\n }\n}\n\n/**\n * Standardize class weighting objects.\n *\n * This function takes a single class-weighting object, an array of them,\n * or a map from output name to class-weighting object. It compares it to the\n * output name(s) of the model, base on which it outputs an array of\n * class-weighting objects of which the length matches the number of outputs.\n *\n * @param classWeight Input class-weighting object(s).\n * @param outputNames All output name(s) of the model.\n * @return An array of class-weighting objects. The length of the array matches\n * the model's number of outputs.\n */\nexport function standardizeClassWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'classWeight');\n}\n\nexport function standardizeSampleWeights(\n classWeight: ClassWeight|ClassWeight[]|ClassWeightMap,\n outputNames: string[]): ClassWeight[] {\n return standardizeSampleOrClassWeights(\n classWeight, outputNames, 'sampleWeight');\n}\n\n/**\n * Standardize by-sample and/or by-class weights for training.\n *\n * Note that this function operates on one model output at a time. For a model\n * with multiple outputs, you must call this function multiple times.\n *\n * @param y The target tensor that the by-sample and/or by-class weight is for.\n * The values of y are assumed to encode the classes, either directly\n * as an integer index, or as one-hot encoding.\n * @param sampleWeight By-sample weights.\n * @param classWeight By-class weights: an object mapping class indices\n * (integers) to a weight (float) to apply to the model's loss for the\n * samples from this class during training. This can be useful to tell the\n * model to \"pay more attention\" to samples from an under-represented class.\n * @param sampleWeightMode The mode for the sample weights.\n * @return A Promise of weight tensor, of which the size of the first dimension\n * matches that of `y`.\n */\nexport async function standardizeWeights(\n y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight,\n sampleWeightMode?: 'temporal'): Promise {\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n\n if (classWeight != null) {\n // Apply class weights per sample.\n const yClasses: Tensor1D = tidy(() => {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone() as Tensor1D;\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n const axis = 1;\n return y.argMax(axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n } else {\n throw new Error(\n `Encountered unexpected last-dimension size (${y.shape[1]}) ` +\n `during handling of class weights. The size is expected to be ` +\n `>= 1.`);\n }\n } else {\n throw new Error(\n `Unexpected rank of target (y) tensor (${y.rank}) during ` +\n `handling of class weights. The rank is expected to be 1 or 2.`);\n }\n });\n\n const yClassIndices = Array.from(await yClasses.data());\n dispose(yClasses);\n const classSampleWeight: number[] = [];\n yClassIndices.forEach(classIndex => {\n if (classWeight[classIndex] == null) {\n throw new Error(\n `classWeight must contain all classes in the training data. ` +\n `The class ${classIndex} exists in the data but not in ` +\n `classWeight`);\n } else {\n classSampleWeight.push(classWeight[classIndex]);\n }\n });\n\n return tensor1d(classSampleWeight, 'float32');\n } else {\n return null;\n }\n}\n\n/**\n * Apply per-sample weights on the loss values from a number of samples.\n *\n * @param losses Loss tensor of shape `[batchSize]`.\n * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`.\n * @returns Tensor of the same shape as`losses`.\n */\nexport function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) {\n return mul(losses, sampleWeights);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using TensorFlow.js datasets.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar} from '@tensorflow/tfjs-core';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {TensorOrArrayOrMap} from '../types';\nimport {singletonOrArray, toList} from '../utils/generic_utils';\n\nimport {Dataset, LazyIterator} from './dataset_stub';\nimport {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Interface for configuring model training based on a dataset object.\n */\nexport interface ModelFitDatasetArgs {\n /**\n * (Optional) Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. It should\n * typically be equal to the number of samples of your dataset divided by\n * the batch size, so that `fitDataset`() call can utilize the entire dataset.\n * If it is not provided, use `done` return value in `iterator.next()` as\n * signal to finish an epoch.\n */\n batchesPerEpoch?: number;\n\n /**\n * Integer number of times to iterate over the training dataset.\n */\n epochs: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be any of the following:\n *\n * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`,\n * an array of Tensors, or a map of string to Tensor.\n * - Similarly, an array ` [xVal, yVal, valSampleWeights]`\n * (not implemented yet).\n * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`,\n * where `xs` and `ys` are the feature and label tensors, respectively.\n *\n * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be\n * sliced into batches during validation, using the parameter\n * `validationBatchSize` (which defaults to 32). The entirety of the\n * `tf.Tensor` objects will be used in the validation.\n *\n * If `validationData` is a dataset object, and the `validationBatches`\n * parameter is specified, the validation will use `validationBatches` batches\n * drawn from the dataset object. If `validationBatches` parameter is not\n * specified, the validation will stop when the dataset is exhausted.\n *\n * The model will not be trained on this data.\n */\n validationData?: [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset;\n\n /**\n * Optional batch size for validation.\n *\n * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not\n * a dataset object.\n *\n * If not specified, its value defaults to 32.\n */\n validationBatchSize?: number;\n\n /**\n * (Optional) Only relevant if `validationData` is specified and is a dataset\n * object.\n *\n * Total number of batches of samples to draw from `validationData` for\n * validation purpose before stopping at the end of every epoch. If not\n * specified, `evaluateDataset` will use `iterator.next().done` as signal to\n * stop validation.\n */\n validationBatches?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - a `number`: Will yield every `number` milliseconds.\n * - `'never'`: never yield. (But yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n}\n\nexport interface FitDatasetElement {\n xs: TensorOrArrayOrMap;\n ys: TensorOrArrayOrMap;\n}\n\n/**\n * Interface for configuring model evaluation based on a dataset object.\n */\nexport interface ModelEvaluateDatasetArgs {\n /**\n * Number of batches to draw from the dataset object before ending the\n * evaluation.\n */\n batches?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n}\n\n// Default batch size used during tensor-based validation.\nconst DEFAULT_VALIDATION_BATCH_SIZE = 32;\n\n/**\n * Standardize the output of a dataset iterator for use by\n * LayersModel.fitDataset().\n *\n * @param model: A `tf.LayersModel` object.\n * @param iteratorOut The output of a dataset iterator. It is required to be\n * an object of the form `{xs: TensorOrArrayOrMap, ys:\n * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`,\n * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s.\n * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s\n * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided\n * as a map, the order in the resulting array is taken from the `inputNames`\n * and `outputNames` of the model.\n */\nfunction standardizeDataIteratorOutput(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} {\n let xs: TensorOrArrayOrMap;\n let ys: TensorOrArrayOrMap;\n\n const iteratorOutObj = iteratorOut as FitDatasetElement;\n xs = iteratorOutObj['xs'];\n ys = iteratorOutObj['ys'];\n tfc.util.assert(\n xs != null && ys != null,\n () => 'A Dataset iterator for fitDataset() is expected to generate ' +\n 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' +\n 'values may be `tf.Tensor`, an array of Tensors, or a map of ' +\n 'string to Tensor. The provided Dataset instead generates ' +\n `${iteratorOut}`);\n\n const flattenedXs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('input', model.inputNames, xs);\n const flattenedYs: tfc.Tensor[] =\n flattenTensorOrArrayOrMap('output', model.outputNames, ys);\n\n const batchSize: number = flattenedXs[0].shape[0];\n\n tfc.util.assert(\n flattenedXs.length === model.inputs.length,\n () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` +\n `provides ${flattenedXs.length} inputs. (Expected input keys: ` +\n `${JSON.stringify(model.inputNames)})`);\n\n tfc.util.assert(\n flattenedYs.length === model.outputs.length,\n () =>\n `LayersModel has ${model.outputs.length} outputs, but the dataset ` +\n `provides ${flattenedYs.length} outputs. (Expected output keys: ` +\n `${JSON.stringify(model.outputNames)})`);\n\n for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) {\n tfc.util.assert(\n flattenedXs[xIndex].shape[0] === batchSize,\n () => `Batch size mismatch: input ` +\n `${model.inputNames[xIndex]} has ${\n flattenedXs[xIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) {\n tfc.util.assert(\n flattenedYs[yIndex].shape[0] === batchSize,\n () => `Batch size mismatch: output ` +\n `${model.outputNames[yIndex]} has ${\n flattenedYs[yIndex].shape[0]}; ` +\n `expected ${batchSize} based on input ${model.inputNames[0]}.`);\n }\n\n return {xs: flattenedXs, ys: flattenedYs};\n}\n\nfunction flattenTensorOrArrayOrMap(\n inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) {\n if (values instanceof tfc.Tensor) {\n return [values];\n } else if (Array.isArray(values)) {\n tfc.util.assert(\n values.length === names.length,\n () => `Received an array of ${values.length} Tensors, but expected ${\n names.length} to match the ${inputOrOutput} keys ${names}.`);\n return values;\n } else {\n const result: tfc.Tensor[] = [];\n // Check that all the required keys are available.\n for (const name of names) {\n if (values[name] == null) {\n throw new ValueError(\n `The feature data generated by the dataset lacks the required ` +\n `${inputOrOutput} key '${name}'.`);\n }\n result.push(values[name]);\n }\n return result;\n }\n}\n\nfunction standardizeTensorValidationData(\n data:\n [\n tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[]\n ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]]):\n {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} {\n if (data.length === 3) {\n throw new NotImplementedError(\n 'Validation with sample weights is not implemented yet.');\n }\n return {xs: data[0], ys: data[1]};\n}\n\nexport async function fitDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset,\n args: ModelFitDatasetArgs): Promise {\n const hasBatchesPerEpoch = args.batchesPerEpoch != null;\n tfc.util.assert(\n model.optimizer != null,\n () => 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileConfig).');\n\n tfc.util.assert(\n args != null,\n () => `For fitDataset(), the 2nd argument (config) is required, ` +\n `but it is not provided in this call.`);\n tfc.util.assert(\n args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs),\n () => `For fitDataset(), config.epochs is expected to be a positive ` +\n `integer, but got ${args.epochs}`);\n tfc.util.assert(\n !hasBatchesPerEpoch ||\n (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)),\n () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` +\n `positive integer if specified, but got ${args.batchesPerEpoch}`);\n tfc.util.assert(\n // tslint:disable-next-line:no-any\n (args as any)['validationSplit'] == null,\n () => '`validationSplit` is not supported by `fitDataset()`. ' +\n 'Use validationData instead.');\n\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n\n try {\n const doValidation = args.validationData != null;\n let valXs: tfc.Tensor|tfc.Tensor[];\n let valYs: tfc.Tensor|tfc.Tensor[];\n if (doValidation) {\n if (isDatasetObject(args.validationData)) {\n tfc.util.assert(\n args.validationBatches == null ||\n (args.validationBatches > 0 &&\n Number.isInteger(args.validationBatches)),\n () => `For fitDataset() with dataset-based validation, ` +\n `config.validationBatches is expected not to be provided, ` +\n `or to be a positive integer, ` +\n `but got ${args.validationBatches}`);\n } else {\n const validationData = standardizeTensorValidationData(\n args.validationData as\n [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] |\n [\n tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[],\n tfc.Tensor | tfc.Tensor[]\n ]);\n valXs = validationData.xs;\n valYs = validationData.ys;\n }\n }\n\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let callbackMetrics: string[];\n if (doValidation) {\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const verbose = args.verbose == null ? 1 : args.verbose;\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, args.epochs, null, null,\n getStepsPerEpoch(dataset, args),\n null, // Batch size determined by the dataset itself.\n doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n let epoch = args.initialEpoch == null ? 0 : args.initialEpoch;\n\n let dataIterator = await dataset.iterator();\n while (epoch < args.epochs) {\n const epochLogs: UnresolvedLogs = {};\n await callbackList.onEpochBegin(epoch);\n let stepsDone = 0;\n let batchIndex = 0;\n if (!hasBatchesPerEpoch) {\n dataIterator = await dataset.iterator();\n }\n while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) {\n const iteratorOut = await dataIterator.next();\n\n // If `batchesPerEpoch` is specified, the dataset should not be\n // exhausted until all epoches are done.\n if (hasBatchesPerEpoch && iteratorOut.done) {\n console.warn(\n 'You provided `batchesPerEpoch` as ' +\n `${args.batchesPerEpoch}, ` +\n 'but your dataset iterator ran out of data after ' +\n `${stepsDone} batches; ` +\n 'interrupting training. Make sure that your ' +\n 'dataset can generate at least `batchesPerEpoch * epochs` ' +\n 'batches (in this case, ' +\n `${args.batchesPerEpoch * args.epochs} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n break;\n }\n\n if (iteratorOut.value != null) {\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const batchLogs: UnresolvedLogs = {};\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = xs[0].shape[0];\n\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n const sampleWeights: tfc.Tensor[] = [];\n if (args.classWeight != null) {\n const standardClassWeights =\n standardizeClassWeights(args.classWeight, model.outputNames);\n for (let i = 0; i < standardClassWeights.length; ++i) {\n sampleWeights.push(await standardizeWeights(\n ys[i], null, standardClassWeights[i]));\n }\n }\n\n // Train on batch.\n const ins = xs.concat(ys).concat(sampleWeights);\n const outs = trainFunction(ins);\n tfc.dispose(ins);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n }\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n batchIndex++;\n stepsDone++;\n }\n\n if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch :\n iteratorOut.done) {\n // Epoch finished. Perform validation.\n if (doValidation) {\n let valOuts: tfc.Scalar[];\n if (isDatasetObject(args.validationData)) {\n valOuts = toList(await model.evaluateDataset(\n args.validationData, {batches: args.validationBatches}));\n } else {\n valOuts = toList(model.evaluate(valXs, valYs, {\n batchSize: args.validationBatchSize == null ?\n DEFAULT_VALIDATION_BATCH_SIZE :\n args.validationBatchSize,\n verbose: 0\n }));\n }\n for (let i = 0; i < model.metricsNames.length; ++i) {\n epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i];\n }\n }\n // Call `break` to exit one epoch lopp after validation is done. If\n // config.batchesPerEpoch is specified, an epoch while loop will\n // stop when `stepsDone >= config.batchesPerEpoch`. When\n // config.batchesPerEpoch is not provided, the following `break` is\n // required to exit the while lopp after dataset is exhausted.\n break;\n }\n\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onEpochEnd(epoch, epochLogs);\n epoch++;\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n await model.history.syncData();\n return model.history;\n } finally {\n model.isTraining = false;\n }\n}\n\n/** Helper function that determines number of steps (batches) per epoch. */\nfunction getStepsPerEpoch(\n dataset: Dataset, args: ModelFitDatasetArgs): number {\n // Attempt to determine # of batches in an epoch.\n let stepsPerEpoch: number = null;\n if (args.batchesPerEpoch != null) {\n stepsPerEpoch = args.batchesPerEpoch;\n } else if (Number.isFinite(dataset.size)) {\n stepsPerEpoch = dataset.size;\n }\n return stepsPerEpoch;\n}\n\n// Check if provided object is a Dataset object by checking its .iterator\n// element.\nfunction isDatasetObject(\n dataset:\n [\n TensorOrArrayOrMap, TensorOrArrayOrMap\n ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|\n Dataset): boolean {\n return (typeof (dataset as Dataset).iterator === 'function');\n}\n\n// Check if provided object is a LazyIterator object by checking it's .next\n// element.\nfunction isLazyIteratorObject(iterator: Dataset|\n LazyIterator): boolean {\n return (typeof (iterator as LazyIterator).next === 'function');\n}\n\nexport async function evaluateDataset(\n // Type `model` as `any` here to avoid circular dependency w/\n // training.ts.\n // tslint:disable-next-line:no-any\n model: any, dataset: Dataset|LazyIterator,\n args: ModelEvaluateDatasetArgs): Promise {\n args = args || {};\n const hasBatches = args.batches != null;\n const f = model.testFunction;\n let outs: tfc.Scalar[] = [];\n if (args.verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n\n tfc.util.assert(\n !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)),\n () => 'Test loop expects `batches` to be a positive integer, but ' +\n `received ${JSON.stringify(args.batches)}`);\n const dataIterator = isLazyIteratorObject(dataset) ?\n dataset as LazyIterator:\n await (dataset as Dataset).iterator();\n // Keeps track of number of examples used in this evaluation.\n let numExamples = 0;\n let batch = 0;\n\n while (hasBatches ? batch < args.batches : true) {\n const iteratorOut = await dataIterator.next();\n outs = tfc.tidy(() => {\n if (iteratorOut.value) {\n // TODO(cais): Once real dataset is available, use\n // `map(x => standardizeDataIteratorOutput(model, x).map(f)`.\n const {xs, ys} =\n standardizeDataIteratorOutput(model, iteratorOut.value);\n const xsAndYs = xs.concat(ys);\n const batchOuts = tfc.tidy(() => f(xsAndYs));\n tfc.dispose(xsAndYs);\n\n if (batch === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n\n const batchSize = xsAndYs[0].shape[0];\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n const oldScalar = outs[i];\n outs[i] =\n tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut)));\n if (batch > 0) {\n tfc.dispose(oldScalar);\n }\n }\n tfc.dispose(batchOuts);\n numExamples += batchSize;\n\n ++batch;\n }\n return outs;\n });\n\n if (iteratorOut.done) {\n if (hasBatches) {\n console.warn(\n 'Your dataset iterator ran out of data during evaluateDataset(). ' +\n 'Interrupting evalution. Make sure that your ' +\n 'dataset can generate at least `batches` ' +\n `batches (in this case, ${args.batches} batches). ` +\n 'You may need to use the repeat() function when building ' +\n 'your dataset.');\n }\n break;\n }\n }\n\n for (let i = 0; i < outs.length; ++i) {\n const oldScalar = outs[i];\n outs[i] = tfc.div(outs[i], numExamples);\n tfc.dispose(oldScalar);\n }\n\n return singletonOrArray(outs);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Interfaces and methods for training models using tf.Tensor objects.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend';\nimport {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport {range} from '../utils/math_utils';\nimport {ClassWeight, ClassWeightMap} from './training_utils';\n\n/**\n * Interface configuration model training based on data as `tf.Tensor`s.\n */\nexport interface ModelFitArgs {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /**\n * Integer number of times to iterate over the training data arrays.\n */\n epochs?: number;\n\n /**\n * Verbosity level.\n *\n * Expected to be 0, 1, or 2. Default: 1.\n *\n * 0 - No printed message during fit() call.\n * 1 - In Node.js (tfjs-node), prints the progress bar, together with\n * real-time updates of loss and metric values and training speed.\n * In the browser: no action. This is the default.\n * 2 - Not implemented yet.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can have one or more of the following callbacks:\n * - `onTrainBegin(logs)`: called when training starts.\n * - `onTrainEnd(logs)`: called when training ends.\n * - `onEpochBegin(epoch, logs)`: called at the start of every epoch.\n * - `onEpochEnd(epoch, logs)`: called at the end of every epoch.\n * - `onBatchBegin(batch, logs)`: called at the start of every batch.\n * - `onBatchEnd(batch, logs)`: called at the end of every batch.\n * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds\n * with the current epoch, batch and logs. The logs are the same\n * as in `onBatchEnd()`. Note that `onYield` can skip batches or\n * epochs. See also docs for `yieldEvery` below.\n */\n callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional object mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n *\n * If the model has multiple outputs, a class weight can be specified for\n * each of the outputs by setting this field an array of weight object\n * or a object that maps model output names (e.g., `model.outputNames[0]`)\n * to weight objects.\n */\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap;\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run). When this is used, `epochs` is the index of the \"final epoch\".\n * The model is not trained for a number of iterations given by `epochs`,\n * but merely until the epoch of index `epochs` is reached.\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n * Configures the frequency of yielding the main thread to other tasks.\n *\n * In the browser environment, yielding the main thread can improve the\n * responsiveness of the page during training. In the Node.js environment,\n * it can ensure tasks queued in the event loop can be handled in a timely\n * manner.\n *\n * The value can be one of the following:\n * - `'auto'`: The yielding happens at a certain frame rate (currently set\n * at 125ms). This is the default.\n * - `'batch'`: yield every batch.\n * - `'epoch'`: yield every epoch.\n * - any `number`: yield every `number` milliseconds.\n * - `'never'`: never yield. (yielding can still happen through `await\n * nextFrame()` calls in custom callbacks.)\n */\n yieldEvery?: YieldEveryOptions;\n}\n\nexport function checkBatchSize(batchSize: number) {\n tfc.util.assert(\n batchSize > 0 && Number.isInteger(batchSize),\n () => `batchSize is required to be a positive integer, but got ${\n batchSize}`);\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `tf.Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nexport function sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice a Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.\n * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown. Default : 32.\n * @param epochs Number of times to iterate over the data. Default : 1.\n * @param verbose Verbosity mode: 0, 1, or 2. Default: 1.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch. Default : true.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run). Default : 0.\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\nasync function fitLoop(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[],\n outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n if (verbose == null) {\n verbose = 1;\n }\n\n const {callbackList, history} = configureCallbacks(\n callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch,\n batchSize, doValidation, callbackMetrics);\n callbackList.setModel(model);\n model.history = history;\n await callbackList.onTrainBegin();\n model.stopTraining_ = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError('batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = model.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (model.stopTraining_) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (model.stopTraining_) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await model.history.syncData();\n return model.history;\n}\n\nexport async function fitTensors(\n // Type `model` as `any` here to avoid circular dependency w/ training.ts.\n // tslint:disable-next-line:no-any\n model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (model.isTraining) {\n throw new Error(\n 'Cannot start training because another fit() call is ongoing.');\n }\n model.isTraining = true;\n let inputs: Tensor[];\n let targets: Tensor[];\n let inputValX: Tensor|Tensor[];\n let inputValY: Tensor|Tensor[];\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let sampleWeights: Tensor[];\n try {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // Validate user data.\n // TODO(cais): Support sampleWeight.\n const checkBatchAxis = false;\n const standardizedOuts =\n await model.standardizeUserData(\n x, y, args.sampleWeight, args.classWeight, checkBatchAxis,\n batchSize) as [Tensor[], Tensor[], Tensor[]];\n inputs = standardizedOuts[0];\n targets = standardizedOuts[1];\n sampleWeights = standardizedOuts[2];\n\n // Prepare validation data.\n let doValidation = false;\n let valIns: Tensor[];\n if (args.validationData != null && args.validationData.length > 0) {\n doValidation = true;\n if (args.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n inputValX = args.validationData[0];\n inputValY = args.validationData[1];\n } else if (args.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${args.validationData} is invalid.`);\n }\n\n const checkBatchAxis = true;\n const valStandardized =\n await model.standardizeUserData(\n inputValX, inputValY, null, /** Unused sample weights. */\n null, /** Unused class weights. */\n checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]];\n valX = valStandardized[0];\n valY = valStandardized[1];\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n args.validationSplit != null && args.validationSplit > 0 &&\n args.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always a Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - args.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (args.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets).concat(sampleWeights);\n\n model.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from\n // Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the\n // training process. Instead, we define a function that performs the\n // training action. In PyKeras, the data (inputs and targets) are fed\n // through graph placeholders. In tfjs-layers, the data are fed as\n // function arguments. Since the function are defined below in the\n // scope, we don't have equivalents of PyKeras's\n // `_make_train_funciton`.\n const trainFunction = model.makeTrainFunction();\n const outLabels = model.getDedupedMetricsNames() as string[];\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n model.makeTestFunction();\n valFunction = model.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery);\n const out = await fitLoop(\n model, trainFunction, ins, outLabels, batchSize, args.epochs,\n args.verbose, callbacks, valFunction, valIns, args.shuffle,\n callbackMetrics, args.initialEpoch, null, null);\n return out;\n } finally {\n model.isTraining = false;\n // Memory clean up.\n disposeNewTensors(inputs, x);\n disposeNewTensors(targets, y);\n disposeNewTensors(valX as Tensor[], inputValX);\n disposeNewTensors(valY as Tensor[], inputValY);\n if (sampleWeights != null) {\n tfc.dispose(sampleWeights);\n }\n }\n // TODO(cais): Add value to outLabels.\n}\n\n/**\n * Ensure tensors all have a rank of at least 2.\n *\n * If a tensor has a rank of 1, it is dimension-expanded to rank 2.\n * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown.\n */\nexport function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] {\n const outs: Tensor[] = [];\n if (tensors instanceof Tensor) {\n tensors = [tensors];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < tensors.length; ++i) {\n const tensor = tensors[i];\n if (tensor.rank === 1) {\n outs.push(expandDims(tensor, 1));\n } else if (tensor.rank === 0) {\n throw new Error(\n 'Expected tensor to be at least 1D, but received a 0D tensor ' +\n '(scalar).');\n } else {\n outs.push(tensor);\n }\n }\n return outs;\n}\n\n/**\n * Compare a set of tensors with a reference (old) set, discard the ones\n * in the new set that are not present in the reference set.\n *\n * This method is used for memory clenaup during calls such as\n * LayersModel.fit().\n *\n * @param tensors New set which may contain Tensors not present in\n * `refTensors`.\n * @param refTensors Reference Tensor set.\n */\n// TODO(cais, kangyizhang): Deduplicate with tfjs-data.\nexport function disposeNewTensors(\n tensors: Tensor|Tensor[]|{[inputName: string]: Tensor},\n refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void {\n if (tensors == null) {\n return;\n }\n const oldTensorIds: number[] = [];\n if (refTensors instanceof Tensor) {\n oldTensorIds.push(refTensors.id);\n } else if (Array.isArray(refTensors)) {\n refTensors.forEach(t => oldTensorIds.push(t.id));\n } else if (refTensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in refTensors) {\n const oldTensor = refTensors[name];\n oldTensorIds.push(oldTensor.id);\n }\n }\n\n const tensorsToDispose: Tensor[] = [];\n if (tensors instanceof Tensor) {\n if (oldTensorIds.indexOf(tensors.id) === -1) {\n tensorsToDispose.push(tensors);\n }\n } else if (Array.isArray(tensors)) {\n tensors.forEach(t => {\n if (oldTensorIds.indexOf(t.id) === -1) {\n tensorsToDispose.push(t);\n }\n });\n } else if (tensors != null) {\n // `oldTensors` is a map from string name to Tensor.\n for (const name in tensors) {\n const tensor = tensors[name];\n if (oldTensorIds.indexOf(tensor.id) === -1) {\n tensorsToDispose.push(tensor);\n }\n }\n }\n\n tensorsToDispose.forEach(t => {\n if (!t.isDisposed) {\n t.dispose();\n }\n });\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {History, ModelLoggingVerbosity} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {LossIdentifier} from '../keras_format/loss_config';\nimport {OptimizerSerialization} from '../keras_format/optimizer_config';\nimport {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config';\nimport {deserialize} from '../layers/serialization';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensor} from '../types';\nimport {checkUserDefinedMetadata} from '../user_defined_metadata';\nimport {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {convertPythonicToTs} from '../utils/serialization_utils';\nimport {LayerVariable} from '../variables';\nimport {version} from '../version';\n\nimport {Container, ContainerArgs} from './container';\nimport {Dataset} from './dataset_stub';\nimport {execute, FeedDict} from './executor';\nimport {DisposeResult, SymbolicTensor} from './topology';\nimport {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset';\nimport {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors';\nimport {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils';\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n arrays = ensureTensorsRank2OrHigher(arrays);\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `tf.Tensor`s for inputs.\n * @param targets `Array` of `tf.Tensor`s for targets.\n * @param weights Optional `Array` of `tf.Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `tf.Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An shortcut strings name, metric function, `Array` or dict\n * (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: incompatible metrics format.\n */\nexport function collectMetrics(\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn},\n outputNames: string[]): Array> {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n\n let wrappedMetrics: Array|\n {[outputName: string]: string | LossOrMetricFn};\n if (typeof metrics === 'string' || typeof metrics === 'function') {\n wrappedMetrics = [metrics];\n } else if (Array.isArray(metrics) || typeof metrics === 'object') {\n wrappedMetrics = metrics as Array|\n {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn};\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an string,' +\n `function, Array, or Object, found: ${metrics}`);\n }\n\n if (Array.isArray(wrappedMetrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(\n name => wrappedMetrics as Array);\n } else {\n // In this case, metrics is a dict.\n const nestedMetrics: Array> = [];\n for (const name of outputNames) {\n let outputMetrics: string|LossOrMetricFn|Array =\n wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics);\n }\n return nestedMetrics;\n }\n}\n\nexport interface ModelEvaluateArgs {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Configuration for calls to `LayersModel.compile()`.\n */\nexport interface ModelCompileArgs {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\nconst LAYERS_MODEL_FORMAT_NAME = 'layers-model';\n\n/**\n * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods\n * for training, evaluation, prediction and saving.\n *\n * `tf.LayersModel` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`.\n *\n * See also:\n * `tf.Sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class LayersModel extends Container implements tfc.InferenceModel {\n // The class name is 'Model' rather than 'LayersModel' for backwards\n // compatibility since this class name shows up in the serialization format.\n /** @nocollapse */\n static className = 'Model';\n protected optimizer_: Optimizer;\n // Whether the model instance owns the optimizer: `true` if and only if\n // `optimizer` is created from a string parameter during `compile()` call.\n protected isOptimizerOwned: boolean;\n\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n protected stopTraining_: boolean;\n protected isTraining: boolean;\n\n metrics: string|LossOrMetricFn|Array|\n {[outputName: string]: string | LossOrMetricFn};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the\n // LayersModel a metric belongs to. This is unlike `metrics_tensors` in\n // PyKeras, which is a `list` of symbolic tensors, each of which has\n // implicit \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n // User defind metadata (if any).\n private userDefinedMetadata: {};\n\n constructor(args: ContainerArgs) {\n super(args);\n this.isTraining = false;\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param args a `ModelCompileArgs` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n compile(args: ModelCompileArgs): void {\n if (args.loss == null) {\n args.loss = [];\n }\n this.loss = args.loss;\n\n if (typeof args.optimizer === 'string') {\n this.optimizer_ = optimizers.getOptimizer(args.optimizer);\n this.isOptimizerOwned = true;\n } else {\n if (!(args.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer_ = args.optimizer;\n this.isOptimizerOwned = false;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(args.loss) && typeof args.loss !== 'string' &&\n typeof args.loss !== 'function') {\n args.loss = args.loss as {[outputName: string]: string};\n for (const name in args.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". ` +\n `Only expected the following keys: ${this.outputNames}`);\n }\n }\n for (const name of this.outputNames) {\n if (args.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(args.loss[name]));\n }\n } else if (Array.isArray(args.loss)) {\n if (args.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${args.loss}.`);\n }\n const theLosses = args.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(args.loss);\n this.outputs.forEach(_ => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = args.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(args.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: Array) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (typeof metric === 'string' &&\n ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName =\n metricNamePrefix + Metrics.getLossOrMetricName(metric);\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n protected checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateArgs`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const checkBatchAxis = true;\n const standardizedOuts =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n try {\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element\n // of the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, args.verbose, args.steps);\n return singletonOrArray(testOuts);\n } finally {\n disposeNewTensors(standardizedOuts[0], x);\n disposeNewTensors(standardizedOuts[1], y);\n }\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs):\n Promise {\n this.makeTestFunction();\n return evaluateDataset(this, dataset, args);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `tf.Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before\n * declaring loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute internal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames =\n (outputsIsArray ? outputs as string[] : [outputs as string]);\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs];\n }\n if (Array.isArray(inputs)) {\n if (inputs.length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${inputs.length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], inputs[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = inputs[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] =\n Array.isArray(layer.output) ? layer.output : [layer.output];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of\n * `tf.Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outsBatches: Tensor[][] = this.outputs.map(output => []);\n\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut));\n }\n return singletonOrArray(\n outsBatches.map(batches => tfc.concat(batches, 0)));\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param args A `ModelPredictArgs` object containing optional fields.\n *\n * @return Prediction results as a `tf.Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n const xsRank2OrHigher = ensureTensorsRank2OrHigher(x);\n checkInputData(\n xsRank2OrHigher, this.inputNames, this.feedInputShapes, false);\n try {\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = args.batchSize == null ? 32 : args.batchSize;\n checkBatchSize(batchSize);\n return this.predictLoop(xsRank2OrHigher, batchSize);\n } finally {\n disposeNewTensors(xsRank2OrHigher, x);\n }\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as a Tensor (for models with exactly one\n * input) or an array of Tensors (for models with more than one input).\n * @return Tensor(s) of predictions\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = (Array.isArray(x) ? x[0] : x).shape[0];\n return this.predictLoop(x, batchSize);\n }\n\n protected standardizeUserDataXY(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer_ == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'LayersModel.compile(modelCompileArgs).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input');\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target');\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n return [x, y];\n }\n\n protected async standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor},\n classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap,\n checkBatchAxis = true,\n batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> {\n const [standardXs, standardYs] =\n this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize);\n // TODO(cais): Handle sampleWeights.\n if (sampleWeight != null) {\n throw new Error('sample weight is not supported yet.');\n }\n\n let standardSampleWeights: Tensor[] = null;\n if (classWeight != null) {\n const classWeights =\n standardizeClassWeights(classWeight, this.outputNames);\n standardSampleWeights = [];\n for (let i = 0; i < classWeights.length; ++i) {\n standardSampleWeights.push(\n await standardizeWeights(standardYs[i], null, classWeights[i]));\n }\n }\n\n // TODO(cais): Deal with the case of model.stateful == true.\n return [standardXs, standardYs, standardSampleWeights];\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before\n * declaring test finished. Ignored with the default value of `null` /\n * `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(scalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut));\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], numSamples);\n }\n }\n return outs;\n });\n }\n\n protected getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer\n // shared among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n /**\n * Creates a function that performs the following actions:\n *\n * 1. computes the losses\n * 2. sums them to get the total loss\n * 3. call the optimizer computes the gradients of the LayersModel's\n * trainable weights w.r.t. the total loss and update the variables\n * 4. calculates the metrics\n * 5. returns the values of the losses and metrics.\n */\n protected makeTrainFunction(): (data: Tensor[]) => Scalar[] {\n return (data: Tensor[]) => {\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const sampleWeights = data.slice(\n this.inputs.length + this.outputs.length,\n this.inputs.length + this.outputs.length * 2);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the\n // inputs. This function is used for obtaining gradients through\n // backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n let loss = lossFunction(targets[i], outputs[i]);\n if (sampleWeights[i] != null) {\n loss = computeWeightedLoss(loss, sampleWeights[i]);\n }\n\n // TODO(cais): push Scalar instead.\n const meanLoss: Scalar = tfc.mean(loss);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n let weightedMetric: Scalar;\n\n if (this.outputs.length > 1 && i < this.outputs.length) {\n weightedMetric = lossValues[i];\n } else {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n weightedMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n }\n\n tfc.keep(weightedMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(weightedMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer_.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n }\n\n /**\n * Create a function which, when invoked with an array of `tf.Tensor`s as a\n * batch of inputs, returns the prespecified loss and metrics of the model\n * under the batch of input data.\n */\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i]));\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a\n * dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you\n * can also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named,\n * you can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input\n * data and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n return fitTensors(this, x, y, args);\n }\n\n // TODO(cais): Add code snippet below when it's possible to instantiate\n // actual dataset objects.\n /**\n * Trains the model using a dataset object.\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for training. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs.\n * Of the two items in the array, the first is the input feature(s) and\n * the second is the output target(s).\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n return fitDataset(this, dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n // TODO(cais): Support sampleWeight and classWeight.\n // TODO(cais): Support Dataset objects.\n const standardizeOut = await this.standardizeUserData(x, y);\n const inputs = standardizeOut[0];\n const targets = standardizeOut[1];\n const trainFunction = this.makeTrainFunction();\n const losses = trainFunction(inputs.concat(targets));\n const lossValues: number[] = [];\n for (const loss of losses) {\n const v = await loss.data();\n lossValues.push(v[0]);\n }\n tfc.dispose(losses);\n return singletonOrArray(lossValues);\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] {\n const namedWeights: NamedTensor[] = [];\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights.push(\n {name: weights[i].originalName, tensor: weightValues[i]});\n }\n return namedWeights;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const input = tf.input({shape: [10]});\n * const output = tf.layers.dense({units: 1}).apply(input);\n * const model = tf.model({inputs: [input], outputs: [output]});\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10\n * values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n this.stopTraining_ = stop;\n }\n\n get stopTraining(): boolean {\n return this.stopTraining_;\n }\n\n get optimizer(): Optimizer {\n return this.optimizer_;\n }\n\n set optimizer(optimizer: Optimizer) {\n if (this.optimizer_ !== optimizer) {\n this.optimizer_ = optimizer;\n this.isOptimizerOwned = false;\n }\n }\n\n dispose(): DisposeResult {\n const result = super.dispose();\n if (result.refCountAfterDispose === 0 && this.optimizer != null &&\n this.isOptimizerOwned) {\n const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors;\n this.optimizer_.dispose();\n result.numDisposedVariables +=\n numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors;\n }\n return result;\n }\n\n private getLossIdentifiers(): LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier} {\n let lossNames: LossIdentifier|LossIdentifier[]|\n {[outputName: string]: LossIdentifier};\n if (typeof this.loss === 'string') {\n lossNames = toSnakeCase(this.loss) as LossIdentifier;\n } else if (Array.isArray(this.loss)) {\n for (const loss of this.loss) {\n if (typeof loss !== 'string') {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as\n LossIdentifier[];\n } else {\n const outputNames = Object.keys(this.loss);\n lossNames = {} as {[outputName: string]: LossIdentifier};\n const losses =\n this.loss as {[outputName: string]: LossOrMetricFn | string};\n for (const outputName of outputNames) {\n if (typeof losses[outputName] === 'string') {\n lossNames[outputName] =\n toSnakeCase(losses[outputName] as string) as LossIdentifier;\n } else {\n throw new Error('Serialization of non-string loss is not supported.');\n }\n }\n }\n return lossNames;\n }\n\n private getMetricIdentifiers(): MetricsIdentifier[]|\n {[key: string]: MetricsIdentifier} {\n if (typeof this.metrics === 'string' ||\n typeof this.metrics === 'function') {\n return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))];\n } else if (Array.isArray(this.metrics)) {\n return this.metrics.map(\n metric => toSnakeCase(Metrics.getLossOrMetricName(metric)));\n } else {\n const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {};\n for (const key in this.metrics) {\n metricsIdentifiers[key] =\n toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key]));\n }\n return metricsIdentifiers;\n }\n }\n\n protected getTrainingConfig(): TrainingConfig {\n return {\n loss: this.getLossIdentifiers(),\n metrics: this.getMetricIdentifiers(),\n optimizer_config: {\n class_name: this.optimizer.getClassName(),\n config: this.optimizer.getConfig()\n } as OptimizerSerialization\n };\n // TODO(cais): Add weight_metrics when they are supported.\n // TODO(cais): Add sample_weight_mode when it's supported.\n // TODO(cais): Add loss_weights when it's supported.\n }\n\n loadTrainingConfig(trainingConfig: TrainingConfig) {\n if (trainingConfig.weighted_metrics != null) {\n throw new Error('Loading weight_metrics is not supported yet.');\n }\n if (trainingConfig.loss_weights != null) {\n throw new Error('Loading loss_weights is not supported yet.');\n }\n if (trainingConfig.sample_weight_mode != null) {\n throw new Error('Loading sample_weight_mode is not supported yet.');\n }\n\n const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as\n serialization.ConfigDict;\n const optimizer = deserialize(tsConfig) as Optimizer;\n\n let loss;\n if (typeof trainingConfig.loss === 'string') {\n loss = toCamelCase(trainingConfig.loss);\n } else if (Array.isArray(trainingConfig.loss)) {\n loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry));\n } else if (trainingConfig.loss != null) {\n loss = {} as {[outputName: string]: LossIdentifier};\n for (const key in trainingConfig.loss) {\n loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier;\n }\n }\n\n let metrics;\n if (Array.isArray(trainingConfig.metrics)) {\n metrics = trainingConfig.metrics.map(metric => toCamelCase(metric));\n } else if (trainingConfig.metrics != null) {\n metrics = {} as {[outputName: string]: MetricsIdentifier};\n for (const key in trainingConfig.metrics) {\n metrics[key] = toCamelCase(trainingConfig.metrics[key]);\n }\n }\n\n this.compile({loss, metrics, optimizer});\n }\n\n /**\n * Save the configuration and/or weights of the LayersModel.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or\n * transmission of serialized data (\"artifacts\") that represent the\n * model's topology and weights onto or via a specific medium, such as\n * file downloads, local storage, IndexedDB in the web browser and HTTP\n * requests to a server. TensorFlow.js provides `IOHandler`\n * implementations for a number of frequently used saving mediums, such as\n * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io`\n * for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s\n * as URL-like string shortcuts, such as 'localstorage://' and\n * 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from\n * browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.http` for more details\n * including specifying request parameters and implementation of the\n * server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of\n * the saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'LayersModel.save() cannot proceed because the IOHandler ' +\n 'provided does not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n const modelArtifacts: io.ModelArtifacts = {\n modelTopology: modelConfig,\n format: LAYERS_MODEL_FORMAT_NAME,\n generatedBy: `TensorFlow.js tfjs-layers v${version}`,\n convertedBy: null,\n };\n\n const includeOptimizer = config == null ? false : config.includeOptimizer;\n if (includeOptimizer && this.optimizer != null) {\n modelArtifacts.trainingConfig = this.getTrainingConfig();\n const weightType = 'optimizer';\n const {data: optimizerWeightData, specs: optimizerWeightSpecs} =\n await io.encodeWeights(await this.optimizer.getWeights(), weightType);\n weightDataAndSpecs.specs.push(...optimizerWeightSpecs);\n weightDataAndSpecs.data = io.concatenateArrayBuffers(\n [weightDataAndSpecs.data, optimizerWeightData]);\n }\n\n if (this.userDefinedMetadata != null) {\n // Check serialized size of user-defined metadata.\n const checkSize = true;\n checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize);\n modelArtifacts.userDefinedMetadata = this.userDefinedMetadata;\n }\n\n modelArtifacts.weightData = weightDataAndSpecs.data;\n modelArtifacts.weightSpecs = weightDataAndSpecs.specs;\n return handlerOrURL.save(modelArtifacts);\n }\n\n /**\n * Set user-defined metadata.\n *\n * The set metadata will be serialized together with the topology\n * and weights of the model during `save()` calls.\n *\n * @param setUserDefinedMetadata\n */\n setUserDefinedMetadata(userDefinedMetadata: {}): void {\n checkUserDefinedMetadata(userDefinedMetadata, this.name);\n this.userDefinedMetadata = userDefinedMetadata;\n }\n\n /**\n * Get user-defined metadata.\n *\n * The metadata is supplied via one of the two routes:\n * 1. By calling `setUserDefinedMetadata()`.\n * 2. Loaded during model loading (if the model is constructed\n * via `tf.loadLayersModel()`.)\n *\n * If no user-defined metadata is available from either of the\n * two routes, this function will return `undefined`.\n */\n getUserDefinedMetadata(): {} {\n return this.userDefinedMetadata;\n }\n}\nserialization.registerClass(LayersModel);\n\n/**\n * A `tf.Functional` is an alias to `tf.LayersModel`.\n *\n * See also:\n * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Functional extends LayersModel {\n static className = 'Functional';\n}\nserialization.registerClass(Functional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\nimport {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Dataset} from './engine/dataset_stub';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training';\nimport {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset';\nimport {ModelFitArgs} from './engine/training_tensors';\nimport {NotImplementedError, RuntimeError, ValueError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {TrainingConfig} from './keras_format/training_config';\nimport {PyJsonDict} from './keras_format/types';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensor} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n *\n * ```js\n * // This example shows how to serialize a model using `toJSON()` and\n * // deserialize it as another model using `tf.models.modelFromJSON()`.\n * // Note: this example serializes and deserializes only the topology\n * // of the model; the weights of the loaded model will be different\n * // from those of the the original model, due to random weight\n * // initialization.\n * // To load the topology and weights of a model, use `tf.loadLayersModel()`.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4}));\n * // Serialize `model1` as a JSON object.\n * const model1JSON = model1.toJSON(null, false);\n * model1.summary();\n *\n * const model2 = await tf.models.modelFromJSON(model1JSON);\n * model2.summary();\n * ```\n *\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration. It can also be only the topology JSON of the\n * model, in which case the weights will not be loaded.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict,\n customObjects?: serialization.ConfigDict): Promise {\n if (!('modelTopology' in modelAndWeightsConfig)) {\n modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig};\n }\n modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig;\n\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as LayersModel;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues = await io.loadWeights(\n modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName));\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n model.loadWeights(uniqueWeightValues);\n // Dispose temporary weight values.\n dispose(weightValues);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: PyJsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictArgs {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A progress callback of the form:\n * `(fraction: number) => void`. This callback can be used to monitor the\n * model-loading process.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n */\nexport async function loadLayersModelInternal(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler, options);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n // TODO(cais): Reformat the args into a single `LoadOptions` once the core\n // is refactored.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler, options));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n *\n * @param handler The instance of `IOHandler` to be used during the model\n * loading.\n * @param customObjects Any optional custom objects to be used during model\n * loading.\n * @param strict Whether the weight loading will be done in strict mode.\n * Default: `true`.\n */\nexport async function loadLayersModelFromIOHandler(\n handler: io.IOHandler, customObjects?: serialization.ConfigDict,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as PyJsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as PyJsonDict;\n }\n\n const strict = options.strict == null ? true : options.strict;\n // If weights are provided and the weight-loading mode is strict, use\n // fast weight initialization. This skips costly initializers such as\n // 'orthogonal' and saves unnecessary computation in cases where\n // the initialized weight values will immediately be overwritten by\n // loaded weight values.\n const fastWeightInit =\n artifacts.weightData != null && artifacts.weightSpecs != null && strict;\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects, fastWeightInit) as LayersModel;\n\n const trainingConfig = artifacts.trainingConfig as TrainingConfig;\n if (trainingConfig != null) {\n model.loadTrainingConfig(trainingConfig);\n }\n if (artifacts.userDefinedMetadata != null) {\n model.setUserDefinedMetadata(artifacts.userDefinedMetadata);\n }\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'LayersModel artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights(\n artifacts.weightData, artifacts.weightSpecs);\n model.loadWeights(modelWeights, strict);\n\n if (model.optimizer != null && optimizerWeights.length > 0) {\n await model.optimizer.setWeights(optimizerWeights);\n }\n\n // Dispose temporary weight values.\n dispose(modelWeights);\n dispose(optimizerWeights.map(w => w.tensor));\n }\n return model;\n}\n\nfunction decodeModelAndOptimizerWeights(\n buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]):\n {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} {\n const name2Tensor = io.decodeWeights(buffer, specs);\n const modelWeights: NamedTensorMap = {};\n const optimizerWeights: NamedTensor[] = [];\n specs.forEach(spec => {\n if (spec.group === 'optimizer') {\n optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]});\n } else {\n modelWeights[spec.name] = name2Tensor[spec.name];\n }\n });\n return {modelWeights, optimizerWeights};\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialArgs {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `tf.sequential` is a factory function that creates an instance of\n * `tf.Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\nexport class Sequential extends LayersModel {\n /** @nocollapse */\n static className = 'Sequential';\n private model: LayersModel;\n constructor(args?: SequentialArgs) {\n super({inputs: [], outputs: []});\n args = args || {};\n\n this.trainable = true;\n this.built = false;\n\n // Set model name.\n this.name = (args.name != null) ? args.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (args.layers != null) {\n for (const layer of args.layers) {\n this.add(layer);\n }\n }\n }\n\n // Helper function to Sequential.add Throws if the new output shape will be\n // invalid.\n private checkShape(layer: Layer) {\n const shape = layer.inboundNodes[0].outputTensors[0].shape;\n if (shape.some(x => x < 0)) {\n throw new ValueError(\n 'Negative dimension size caused by adding layer ' +\n `${layer.name} with input shape [` +\n `${layer.inboundNodes[0].inputTensors[0].shape}]`);\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its\n * input shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof LayersModel;\n let modelLayer: LayersModel;\n if (isLayerModelInstance) {\n modelLayer = layer as LayersModel;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. LayersModel received layer ${\n layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.checkShape(layer);\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new LayersModel({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the\n * model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the\n * model has multiple inputs.\n * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the\n * model has multiple outputs.\n * @param args A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n args: ModelEvaluateArgs = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, args);\n }\n\n // TODO(cais): Add code snippet below once real dataset objects are\n // available.\n /**\n * Evaluate model using a dataset object.\n *\n * Note: Unlike `evaluate()`, this method is asynchronous (`async`);\n *\n * @param dataset A dataset object. Its `iterator()` method is expected\n * to generate a dataset iterator object, the `next()` method of which\n * is expected to produce data batches for evaluation. The return value\n * of the `next()` call ought to contain a boolean `done` field and a\n * `value` field. The `value` field is expected to be an array of two\n * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former\n * case is for models with exactly one input and one output (e.g..\n * a sequential model). The latter case is for models with multiple\n * inputs and/or multiple outputs. Of the two items in the array, the\n * first is the input feature(s) and the second is the output target(s).\n * @param args A configuration object for the dataset-based evaluation.\n * @returns Loss and metric values as an Array of `Scalar` objects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluateDataset(dataset, args);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `tf.Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, args);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as a Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `LayersModel.compile`.\n *\n * @param args\n */\n compile(args: ModelCompileArgs): void {\n this.build();\n this.model.compile(args);\n this.optimizer_ = this.model.optimizer;\n // tslint:disable-next-line:no-any\n this.isOptimizerOwned = (this.model as any).isOptimizerOwned;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n get optimizer(): Optimizer {\n return this.model == null ? undefined : this.model.optimizer;\n }\n\n set optimizer(optimizer: Optimizer) {\n this.model.optimizer = optimizer;\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the\n * model has multiple inputs. If all inputs in the model are named, you can\n * also pass a dictionary mapping input names to `tf.Tensor`s.\n * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if\n * the model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `tf.Tensor`s.\n * @param args A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n args: ModelFitArgs = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, args);\n }\n\n /**\n * Trains the model using a dataset object.\n *\n * ```js\n * const xArray = [\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * [1, 1, 1, 1, 1, 1, 1, 1, 1],\n * ];\n * const yArray = [1, 1, 1, 1];\n * // Create a dataset from the JavaScript array.\n * const xDataset = tf.data.array(xArray);\n * const yDataset = tf.data.array(yArray);\n * // Zip combines the `x` and `y` Datasets into a single Dataset, the\n * // iterator of which will return an object containing of two tensors,\n * // corresponding to `x` and `y`. The call to `batch(4)` will bundle\n * // four such samples into a single object, with the same keys now pointing\n * // to tensors that hold 4 examples, organized along the batch dimension.\n * // The call to `shuffle(4)` causes each iteration through the dataset to\n * // happen in a different order. The size of the shuffle window is 4.\n * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset})\n * .batch(4)\n * .shuffle(4);\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [9]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fitDataset(xyDataset, {\n * epochs: 4,\n * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)}\n * });\n * ```\n *\n * @param dataset A dataset object. Its `iterator()` method is expected to\n * generate a dataset iterator object, the `next()` method of which is\n * expected to produce data batches for evaluation. The return value of the\n * `next()` call ought to contain a boolean `done` field and a `value`\n * field.\n *\n * The `value` field is expected to be an object of with fields\n * `xs` and `ys`, which point to the feature tensor and the target tensor,\n * respectively. This case is for models with exactly one input and one\n * output (e.g.. a sequential model). For example:\n * ```js\n * {value: {xs: xsTensor, ys: ysTensor}, done: false}\n * ```\n *\n * If the model has multiple inputs, the `xs` field of `value` should\n * be an object mapping input names to their respective feature tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: {\n * input_1: xsTensor1,\n * input_2: xsTensor2\n * },\n * ys: ysTensor\n * },\n * done: false\n * }\n * ```\n * If the model has multiple outputs, the `ys` field of `value` should\n * be an object mapping output names to their respective target tensors.\n * For example:\n * ```js\n * {\n * value: {\n * xs: xsTensor,\n * ys: {\n * output_1: ysTensor1,\n * output_2: ysTensor2\n * },\n * },\n * done: false\n * }\n * ```\n * @param args A `ModelFitDatasetArgs`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true}\n */\n async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs):\n Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fitDataset(dataset, args);\n }\n\n /**\n * Runs a single gradient update on a single batch of data.\n *\n * This method differs from `fit()` and `fitDataset()` in the following\n * regards:\n * - It operates on exactly one batch of data.\n * - It returns only the loss and matric values, instead of\n * returning the batch-by-batch loss and metric values.\n * - It doesn't support fine-grained options such as verbosity and\n * callbacks.\n *\n * @param x Input data. It could be one of the following:\n * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has\n * multiple inputs).\n * - An Object mapping input names to corresponding `tf.Tensor` (if the\n * model has named inputs).\n * @param y Target darta. It could be either a `tf.Tensor` a multiple\n * `tf.Tensor`s. It should be consistent with `x`.\n * @returns Training loss or losses (in case the model has\n * multiple outputs), along with metrics (if any), as numbers.\n *\n * @doc {heading: 'Models', subheading: 'Classes'}\n */\n async trainOnBatch(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): Promise {\n return this.model.trainOnBatch(x, y);\n }\n\n /* See parent class for JsDoc */\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict,\n fastWeightInit = false): T {\n let configArray: serialization.ConfigDictArray;\n let extraModelConfig: serialization.ConfigDict = {};\n if (config instanceof Array) {\n if (!(config[0].className != null) ||\n config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n configArray = config;\n } else {\n util.assert(\n config['layers'] != null,\n () =>\n `When the config data for a Sequential model is not an Array, ` +\n `it must be an Object that contains the 'layers' field.`);\n configArray = config['layers'] as serialization.ConfigDictArray;\n delete config['layers'];\n extraModelConfig = config;\n }\n\n const model = new cls(extraModelConfig);\n if (!(model instanceof Sequential)) {\n throw new NotImplementedError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n for (const conf of configArray) {\n const customObjects: serialization.ConfigDict = undefined;\n const layer = deserialize(\n conf as serialization.ConfigDict, customObjects,\n fastWeightInit) as Layer;\n if (fastWeightInit) {\n layer.setFastWeightInitDuringBuild(true);\n }\n model.add(layer);\n }\n return model;\n }\n\n /**\n * Setter used for force stopping of LayersModel.fit() (i.e., training).\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [10]}));\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n * const xs = tf.ones([8, 10]);\n * const ys = tf.zeros([8, 1]);\n *\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * if (epoch === 2) {\n * model.stopTraining = true;\n * }\n * }\n * }\n * });\n *\n * // There should be only 3 values in the loss array, instead of 10 values,\n * // due to the stopping after 3 epochs.\n * console.log(history.history.loss);\n * ```\n */\n set stopTraining(stop: boolean) {\n // TODO(cais): When refactoring to remove the composition pattern happens,\n // remove this method overriding.\n if (this.model == null) {\n throw new ValueError(\n 'Cannot set the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n this.model.stopTraining = stop;\n }\n\n get stopTraining(): boolean {\n if (this.model == null) {\n throw new ValueError(\n 'Cannot get the stopTraining property of a sequential model before ' +\n 'it is compiled.');\n }\n return this.model.stopTraining;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const layers: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n const dict: serialization.ConfigDict = {};\n dict['className'] = layer.getClassName();\n dict['config'] = layer.getConfig();\n layers.push(dict);\n }\n return {name: this.name, layers};\n }\n}\nserialization.registerClass(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks';\nimport {ContainerArgs} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {LayersModel} from './engine/training';\nimport {loadLayersModelInternal, Sequential, SequentialArgs} from './models';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// LayersModel and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.model` is more generic, supporting an arbitrary graph (without\n * cycles) of layers. `tf.sequential` is less generic and supports only a linear\n * stack of layers.\n *\n * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `tf.sequential`, `tf.loadLayersModel`.\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function model(args: ContainerArgs): LayersModel {\n return new LayersModel(args);\n}\n\n/**\n * Creates a `tf.Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a `tf.Sequential` model should have\n * a defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `tf.model` and `tf.sequential` is that\n * `tf.sequential` is less generic, supporting only a linear stack of layers.\n * `tf.model` is more generic and supports an arbitrary graph (without\n * cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `tf.Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Models', subheading: 'Creation'}\n */\nexport function sequential(config?: SequentialArgs): Sequential {\n return new Sequential(config);\n}\n\n/**\n * Load a model composed of Layer objects, including its topology and optionally\n * weights. See the Tutorial named \"How to import a Keras Model\" for usage\n * examples.\n *\n * This method is applicable to:\n *\n * 1. Models created with the `tf.layers.*`, `tf.sequential`, and\n * `tf.model` APIs of TensorFlow.js and later saved with the\n * `tf.LayersModel.save` method.\n * 2. Models converted from Keras or TensorFlow tf.keras using the\n * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter).\n *\n * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted\n * forms. For those models, use `tf.loadGraphModel`.\n *\n * Example 1. Load a model from an HTTP server.\n *\n * ```js\n * const model = await tf.loadLayersModel(\n * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json');\n * model.summary();\n * ```\n *\n * Example 2: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 4. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadLayersModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. For file://\n * (tfjs-node-only), http:// and https:// schemas, the path can be\n * either absolute or relative.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n * @param options Optional configuration arguments for the model loading,\n * including:\n * - `strict`: Require that the provided weights exactly match those required\n * by the layers. Default true. Passing false means that both extra\n * weights and missing weights will be silently ignored.\n * - `onProgress`: A function of the signature `(fraction: number) => void',\n * that can be used as the progress callback for the model loading.\n * @returns A `Promise` of `tf.LayersModel`, with the topology and weights\n * loaded.\n *\n * @doc {heading: 'Models', subheading: 'Loading'}\n */\nexport function loadLayersModel(\n pathOrIOHandler: string|io.IOHandler,\n options?: io.LoadOptions): Promise {\n if (options == null) {\n options = {};\n }\n return loadLayersModelInternal(pathOrIOHandler, options);\n}\n\n/**\n * Used to instantiate an input to a model as a `tf.SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n *\n * @doc {heading: 'Models', subheading: 'Inputs'}\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n\nexport function registerCallbackConstructor(\n verbosityLevel: number,\n callbackConstructor: BaseCallbackConstructor): void {\n CallbackConstructorRegistry.registerCallbackConstructor(\n verbosityLevel, callbackConstructor);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {ActivationIdentifier} from './keras_format/activation_config';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n /** @nocollapse */\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.registerClass(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n /** @nocollapse */\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.registerClass(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n /** @nocollapse */\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.registerClass(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n /** @nocollapse */\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(6.0, tfc.relu(x)));\n }\n}\nserialization.registerClass(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n /** @nocollapse */\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.registerClass(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.registerClass(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n /** @nocollapse */\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.registerClass(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n /** @nocollapse */\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.registerClass(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n /** @nocollapse */\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.registerClass(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n /** @nocollapse */\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.registerClass(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n /** @nocollapse */\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.registerClass(Softmax);\n\n/**\n * Log softmax activation function\n */\nexport class LogSoftmax extends Activation {\n /** @nocollapse */\n static readonly className = 'logSoftmax';\n /**\n * Calculate the activation function of log softmax:\n * log( exp(x_i) / sum(exp(x)) )\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.logSoftmax(x, axis);\n }\n}\nserialization.registerClass(LogSoftmax);\n\n/**\n * Swish activation function\n */\nexport class Swish extends Activation {\n /** @nocollapse */\n static readonly className = 'swish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param alpha Scaling factor for the sigmoid function.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x));\n }\n}\nserialization.registerClass(Swish);\n\n/**\n * Mish activation function\n */\nexport class Mish extends Activation {\n /** @nocollapse */\n static readonly className = 'mish';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @returns a Tensor of the same shape as x\n */\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x))));\n }\n}\nserialization.registerClass(Mish);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config: serialization.ConfigDict = {};\n config['className'] = 'linear';\n config['config'] = {};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config: serialization.ConfigDict = {};\n config['className'] = identifier;\n config['config'] = {};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n\nfunction assertObjectArgs(args: L1Args | L2Args | L1L2Args): void {\n if (args != null && typeof args !== 'object') {\n throw new Error(\n `Argument to L1L2 regularizer's constructor is expected to be an ` +\n `object, but received: ${args}`);\n }\n}\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Args {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Args {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\nexport class L1L2 extends Regularizer {\n /** @nocollapse */\n static className = 'L1L2';\n\n private readonly l1: number;\n private readonly l2: number;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(args?: L1L2Args) {\n super();\n\n assertObjectArgs(args);\n\n this.l1 = args == null || args.l1 == null ? 0.01 : args.l1;\n this.l2 = args == null || args.l2 == null ? 0.01 : args.l2;\n this.hasL1 = this.l1 !== 0;\n this.hasL2 = this.l2 !== 0;\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1, 'l2': this.l2};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config['l1'] as number, l2: config['l2'] as number});\n }\n}\nserialization.registerClass(L1L2);\n\nexport function l1(args?: L1Args) {\n assertObjectArgs(args);\n return new L1L2({l1: args != null ? args.l1 : null, l2: 0});\n}\n\nexport function l2(args: L2Args) {\n assertObjectArgs(args);\n return new L1L2({l2: args != null ? args.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Constraint, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface ReLULayerArgs extends LayerArgs {\n /**\n * Float, the maximum output value.\n */\n maxValue?: number;\n}\n\nexport class ReLU extends Layer {\n /** @nocollapse */\n static className = 'ReLU';\n maxValue: number;\n\n constructor(args?: ReLULayerArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maxValue = args.maxValue;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n let output = relu(inputs);\n if (this.maxValue != null) {\n output = clipByValue(output, 0, this.maxValue);\n }\n return output;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {maxValue: this.maxValue};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ReLU);\n\nexport declare interface LeakyReLULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\nexport class LeakyReLU extends Layer {\n /** @nocollapse */\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(args?: LeakyReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LeakyReLU);\n\nexport declare interface PReLULayerArgs extends LayerArgs {\n /**\n * Initializer for the learnable alpha.\n */\n alphaInitializer?: Initializer|InitializerIdentifier;\n\n /**\n * Regularizer for the learnable alpha.\n */\n alphaRegularizer?: Regularizer;\n\n /**\n * Constraint for the learnable alpha.\n */\n alphaConstraint?: Constraint;\n\n /**\n * The axes along which to share learnable parameters for the activation\n * function. For example, if the incoming feature maps are from a 2D\n * convolution with output shape `[numExamples, height, width, channels]`,\n * and you wish to share parameters across space (height and width) so that\n * each filter channels has only one set of parameters, set\n * `shared_axes: [1, 2]`.\n */\n sharedAxes?: number|number[];\n}\n\nexport class PReLU extends Layer {\n /** @nocollapse */\n static className = 'PReLU';\n private readonly alphaInitializer: Initializer;\n private readonly alphaRegularizer: Regularizer;\n private readonly alphaConstraint: Constraint;\n private readonly sharedAxes: number[];\n private alpha: LayerVariable;\n\n readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args?: PReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.supportsMasking = true;\n this.alphaInitializer =\n getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER);\n this.alphaRegularizer = getRegularizer(args.alphaRegularizer);\n this.alphaConstraint = getConstraint(args.alphaConstraint);\n if (args.sharedAxes == null) {\n this.sharedAxes = null;\n } else if (Array.isArray(args.sharedAxes)) {\n this.sharedAxes = args.sharedAxes;\n } else if (typeof args.sharedAxes === 'number') {\n this.sharedAxes = [args.sharedAxes];\n } else {\n throw new ValueError(\n `Expected sharedAxes to be a number or an array of numbers, ` +\n `but got ${args.sharedAxes}`);\n }\n }\n\n build(inputShape: Shape|Shape[]) {\n inputShape = getExactlyOneShape(inputShape);\n const paramShape: Shape = inputShape.slice(1);\n if (this.sharedAxes != null) {\n for (const i of this.sharedAxes) {\n paramShape[i - 1] = 1;\n }\n }\n this.alpha = this.addWeight(\n 'alpha', paramShape, 'float32', this.alphaInitializer,\n this.alphaRegularizer, true, this.alphaConstraint);\n // Set input spec.\n const axes: {[axis: number]: number} = {};\n if (this.sharedAxes != null) {\n for (let i = 1; i < inputShape.length; ++i) {\n axes[i] = inputShape[i];\n }\n }\n this.inputSpec = [new InputSpec({\n ndim: inputShape.length,\n axes,\n })];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n inputs = getExactlyOneTensor(inputs);\n return prelu(inputs, this.alpha.read());\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n alphaInitializer: serializeInitializer(this.alphaInitializer),\n alphaRegularizer: serializeRegularizer(this.alphaRegularizer),\n alphaConstraint: serializeConstraint(this.alphaConstraint),\n sharedAxes: this.sharedAxes\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(PReLU);\n\nexport declare interface ELULayerArgs extends LayerArgs {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\nexport class ELU extends Layer {\n /** @nocollapse */\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(args?: ELULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${args.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ELU);\n\nexport declare interface ThresholdedReLULayerArgs extends LayerArgs {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\nexport class ThresholdedReLU extends Layer {\n /** @nocollapse */\n static className = 'ThresholdedReLU';\n readonly theta: number;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(args?: ThresholdedReLULayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n\n this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.theta), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ThresholdedReLU);\n\nexport declare interface SoftmaxLayerArgs extends LayerArgs {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\nexport class Softmax extends Layer {\n /** @nocollapse */\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(args?: SoftmaxLayerArgs) {\n super(args == null ? {} : args);\n if (args == null) {\n args = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * Transpose and cast the input before the conv3d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv3DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBiasActivation(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias and optional activation.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBiasActivation(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number],\n activation: fused.Activation = null): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` +\n `but received ${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.fused.conv2d({\n x: y as Tensor3D | Tensor4D,\n filter: kernel as Tensor4D,\n strides: strides as [number, number],\n pad: padding === 'same' ? 'same' : 'valid',\n dilations: dilationRate,\n dataFormat: 'NHWC',\n bias,\n activation\n });\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n/**\n * 3D Convolution.\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 3D convolution.\n */\nexport function conv3d(\n x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv3dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 3D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv3d`, except the added `bias`.\n */\nexport function conv3dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 4 && x.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects input to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 4 && kernel.rank !== 5) {\n throw new ValueError(\n `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv3DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv3dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv3d(\n y as Tensor4D | tfc.Tensor,\n kernel as tfc.Tensor, strides as [number, number, number],\n padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]);\n }\n return y;\n });\n}\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport declare interface BaseConvLayerArgs extends LayerArgs {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number]|[number, number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D,\n * Conv3D).\n */\nexport declare interface ConvLayerArgs extends BaseConvLayerArgs {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, args: BaseConvLayerArgs) {\n super(args as LayerArgs);\n BaseConv.verifyArgs(args);\n this.rank = rank;\n generic_utils.assertPositiveInteger(this.rank, 'rank');\n if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1, 2, or 3 (${\n this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n args.strides == null ? 1 : args.strides, rank, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.dilationRate = normalizeArray(\n args.dilationRate == null ? 1 : args.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n } else if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n } else if (this.rank === 3) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate =\n [this.dilationRate, this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 3) {\n throw new ValueError(\n `dilationRate must be a number or array of three numbers for 3D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyArgs(args: BaseConvLayerArgs) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in args, `required key 'kernelSize' not in config`);\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 3)) {\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1, 2, or 3, but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, args: ConvLayerArgs) {\n super(rank, args as BaseConvLayerArgs);\n Conv.verifyArgs(args);\n this.filters = args.filters;\n generic_utils.assertPositiveInteger(this.filters, 'filters');\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n const fusedActivationName = generic_utils.mapActivationToFusedKernel(\n this.activation.getClassName());\n\n if (fusedActivationName != null && this.rank === 2) {\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number],\n fusedActivationName);\n } else {\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBiasActivation(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n outputs = conv3dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number, number]);\n } else {\n throw new NotImplementedError(\n 'convolutions greater than 3D are not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n }\n\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // Check config.filters type, shape, and value.\n if (!('filters' in args) || typeof args.filters !== 'number' ||\n args.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(args.filters)}`);\n }\n }\n}\n\nexport class Conv2D extends Conv {\n /** @nocollapse */\n static className = 'Conv2D';\n constructor(args: ConvLayerArgs) {\n super(2, args);\n Conv2D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof args.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 2)) {\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv2D);\n\nexport class Conv3D extends Conv {\n /** @nocollapse */\n static className = 'Conv3D';\n constructor(args: ConvLayerArgs) {\n super(3, args);\n Conv3D.verifyArgs(args);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number') {\n if (!(Array.isArray(args.kernelSize) &&\n (args.kernelSize.length === 1 || args.kernelSize.length === 3))) {\n throw new ValueError(\n `Conv3D expects config.kernelSize to be number or` +\n ` [number, number, number], but received ${\n JSON.stringify(args.kernelSize)}.`);\n }\n }\n }\n}\nserialization.registerClass(Conv3D);\n\nexport class Conv2DTranspose extends Conv2D {\n /** @nocollapse */\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]);\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv2DTranspose);\n\nexport class Conv3DTranspose extends Conv3D {\n /** @nocollapse */\n static className = 'Conv3DTranspose';\n inputSpec: InputSpec[];\n\n constructor(args: ConvLayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 5})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv3DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 5) {\n throw new ValueError(\n 'Input should have rank 5; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 5) {\n throw new ValueError(\n `Conv3DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n let dAxis: number;\n\n if (this.dataFormat === 'channelsFirst') {\n dAxis = 2;\n hAxis = 3;\n wAxis = 4;\n } else {\n dAxis = 1;\n hAxis = 2;\n wAxis = 3;\n }\n\n const depth = inputShape[dAxis];\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n // Infer the dynamic output shape.\n const outDepth = deconvLength(depth, strideD, kernelD, this.padding);\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Same as `conv2dTranspose`. We always assumes channelsLast.\n const outputShape: [number, number, number, number, number] =\n [batchSize, outDepth, outHeight, outWidth, this.filters];\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 4, 1]);\n }\n let outputs = tfc.conv3dTranspose(\n input as Tensor5D, this.kernel.read() as Tensor5D, outputShape,\n this.strides as [number, number, number],\n this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]);\n }\n\n if (this.bias !== null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D;\n }\n if (this.activation !== null) {\n outputs = this.activation.apply(outputs) as Tensor5D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let depthAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n depthAxis = 2;\n heightAxis = 3;\n widthAxis = 4;\n } else {\n channelAxis = 4;\n depthAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n }\n\n const kernelD = this.kernelSize[0];\n const kernelH = this.kernelSize[1];\n const kernelW = this.kernelSize[2];\n const strideD = this.strides[0];\n const strideH = this.strides[1];\n const strideW = this.strides[2];\n\n outputShape[channelAxis] = this.filters;\n outputShape[depthAxis] =\n deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding);\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.registerClass(Conv3DTranspose);\n\nexport declare interface SeparableConvLayerArgs extends ConvLayerArgs {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\nexport class SeparableConv extends Conv {\n /** @nocollapse */\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerArgs) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\nexport class SeparableConv2D extends SeparableConv {\n /** @nocollapse */\n static className = 'SeparableConv2D';\n constructor(args?: SeparableConvLayerArgs) {\n super(2, args);\n }\n}\nserialization.registerClass(SeparableConv2D);\n\nexport class Conv1D extends Conv {\n /** @nocollapse */\n static className = 'Conv1D';\n constructor(args: ConvLayerArgs) {\n super(1, args);\n Conv1D.verifyArgs(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n protected static verifyArgs(args: ConvLayerArgs) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof args.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n args.kernelSize, 'number', 1, 1)) {\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(args.kernelSize)}.`);\n }\n }\n}\nserialization.registerClass(Conv1D);\n\nexport declare interface Cropping2DLayerArgs extends LayerArgs {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape\n * `(batch, channels, ...)`\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class Cropping2D extends Layer {\n /** @nocollapse */\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Cropping2DLayerArgs) {\n super(args);\n if (typeof args.cropping === 'number') {\n this.cropping =\n [[args.cropping, args.cropping], [args.cropping, args.cropping]];\n } else if (typeof args.cropping[0] === 'number') {\n this.cropping = [\n [args.cropping[0], args.cropping[0]],\n [args.cropping[1] as number, args.cropping[1] as number]\n ];\n } else {\n this.cropping = args.cropping as [[number, number], [number, number]];\n }\n this.dataFormat =\n args.dataFormat === undefined ? 'channelsLast' : args.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[3] - this.cropping[1][0] - this.cropping[1][1]\n ];\n } else {\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Cropping2D);\n\nexport declare interface UpSampling2DLayerArgs extends LayerArgs {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n /**\n * The interpolation mechanism, one of `\"nearest\"` or `\"bilinear\"`, default\n * to `\"nearest\"`.\n */\n interpolation?: InterpolationFormat;\n}\n\nexport class UpSampling2D extends Layer {\n /** @nocollapse */\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n protected readonly interpolation: InterpolationFormat;\n\n constructor(args: UpSampling2DLayerArgs) {\n super(args);\n this.inputSpec = [{ndim: 4}];\n this.size = args.size == null ? this.DEFAULT_SIZE : args.size;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.interpolation =\n args.interpolation == null ? 'nearest' : args.interpolation;\n checkInterpolationFormat(this.interpolation);\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n\n const resized = this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return this.interpolation === 'nearest' ?\n input.resizeNearestNeighbor([height, width]) :\n input.resizeBilinear([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional';\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class DepthwiseConv2D extends BaseConv {\n /** @nocollapse */\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(args: DepthwiseConv2DLayerArgs) {\n super(2, args as ConvLayerArgs);\n this.depthMultiplier =\n args.depthMultiplier == null ? 1 : args.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(args.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.registerClass(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction} from '../types';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\nimport {deserialize} from './serialization';\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param needPerStepOutputs Whether the per-step outputs are to be\n * concatenated into a single tensor and returned (as the second return\n * value). Default: `false`. This arg is included so that the relatively\n * expensive concatenation of the stepwise outputs can be omitted unless\n * the stepwise outputs need to be kept (e.g., for an LSTM layer of which\n * `returnSequence` is `true`.)\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`. This return value is provided if and only if the\n * `needPerStepOutputs` is set as `true`. If it is set as `false`, this\n * return value will be `undefined`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] {\n return tfc.tidy(() => {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (mask != null) {\n mask = mask.asType('bool').asType('float32');\n if (mask.rank === ndim - 1) {\n mask = tfc.expandDims(mask, -1);\n }\n mask = tfc.transpose(mask, axes);\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n if (mask != null) {\n mask = tfc.reverse(mask, 0);\n }\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n\n const perStepOutputs: Tensor[] = [];\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n const perStepInputs = tfc.unstack(inputs);\n let perStepMasks: Tensor[];\n if (mask != null) {\n perStepMasks = tfc.unstack(mask);\n }\n\n for (let t = 0; t < timeSteps; ++t) {\n const currentInput = perStepInputs[t];\n const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states));\n\n if (mask == null) {\n lastOutput = stepOutputs[0];\n states = stepOutputs[1];\n } else {\n const maskedOutputs = tfc.tidy(() => {\n const stepMask = perStepMasks[t];\n const negStepMask = tfc.onesLike(stepMask).sub(stepMask);\n // TODO(cais): Would tfc.where() be better for performance?\n const output =\n stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask));\n const newStates = states.map((state, i) => {\n return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask));\n });\n return {output, newStates};\n });\n lastOutput = maskedOutputs.output;\n states = maskedOutputs.newStates;\n }\n\n if (needPerStepOutputs) {\n perStepOutputs.push(lastOutput);\n }\n }\n let outputs: Tensor;\n if (needPerStepOutputs) {\n const axis = 1;\n outputs = tfc.stack(perStepOutputs, axis);\n }\n return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]];\n });\n}\n\nexport declare interface BaseRNNLayerArgs extends LayerArgs {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n *\n * You can set RNN layers to be \"stateful\", which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable \"statefulness\":\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * - if sequential model:\n * `batchInputShape: [...]` to the first layer in your model.\n * - else for functional model with 1 or more Input layers:\n * `batchShape: [...]` to all the first layers in your model.\n * This is the expected shape of your inputs\n * *including the batch size*.\n * It should be a tuple of integers, e.g., `[32, 10, 100]`.\n * - specify `shuffle: false` when calling `LayersModel.fit()`.\n *\n * To reset the state of your model, call `resetStates()` on either the\n * specific layer or on the entire model.\n */\n stateful?: boolean;\n // TODO(cais): Explore whether we can warn users when they fail to set\n // `shuffle: false` when training a model consisting of stateful RNNs\n // and any stateful Layers in general.\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\nexport class RNN extends Layer {\n /** @nocollapse */\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n protected states_: Tensor[];\n\n // NOTE(cais): For stateful RNNs, the old states cannot be disposed right\n // away when new states are set, because the old states may need to be used\n // later for backpropagation through time (BPTT) and other purposes. So we\n // keep them here for final disposal when the state is reset completely\n // (i.e., through no-arg call to `resetStates()`).\n protected keptStates: Tensor[][];\n\n private numConstants: number;\n\n constructor(args: RNNLayerArgs) {\n super(args);\n let cell: RNNCell;\n if (args.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(args.cell)) {\n cell = new StackedRNNCells({cells: args.cell});\n } else {\n cell = args.cell;\n }\n if (cell.stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n args.returnSequences == null ? false : args.returnSequences;\n this.returnState = args.returnState == null ? false : args.returnState;\n this.goBackwards = args.goBackwards == null ? false : args.goBackwards;\n this._stateful = args.stateful == null ? false : args.stateful;\n this.unroll = args.unroll == null ? false : args.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states_ = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n\n this.keptStates = [];\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states_;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states_ = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tfc.tidy(() => {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n const outputMask = this.returnSequences ? mask : null;\n\n if (this.returnState) {\n const stateMask = this.states.map(s => null);\n return [outputMask].concat(stateMask);\n } else {\n return outputMask;\n }\n });\n }\n\n /**\n * Get the current state tensors of the RNN.\n *\n * If the state hasn't been set, return an array of `null`s of the correct\n * length.\n */\n get states(): Tensor[] {\n if (this.states_ == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n const output: Tensor[] = [];\n for (let i = 0; i < numStates; ++i) {\n output.push(null);\n }\n return output;\n } else {\n return this.states_;\n }\n }\n\n set states(s: Tensor[]) {\n this.states_ = s;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape.slice(2);\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray(this.cell.stateSize)) {\n stateSize = this.cell.stateSize;\n } else {\n stateSize = [this.cell.stateSize];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n this.resetStates();\n }\n }\n\n /**\n * Reset the state tensors of the RNN.\n *\n * If the `states` argument is `undefined` or `null`, will set the\n * state tensor(s) of the RNN to all-zero tensors of the appropriate\n * shape(s).\n *\n * If `states` is provided, will set the state tensors of the RNN to its\n * value.\n *\n * @param states Optional externally-provided initial states.\n * @param training Whether this call is done during training. For stateful\n * RNNs, this affects whether the old states are kept or discarded. In\n * particular, if `training` is `true`, the old states will be kept so\n * that subsequent backpropgataion through time (BPTT) may work properly.\n * Else, the old states will be discarded.\n */\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states_ == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training === true) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states_[index] = value;\n }\n }\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify\n // the input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'] as Tensor;\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n initialState = this.states_;\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `tf.Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, mask, null,\n this.unroll, this.returnSequences);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n this.resetStates(states, training);\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.cell != null) {\n this.cell.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n\n if (this.numConstants != null) {\n config['numConstants'] = this.numConstants;\n }\n\n const cellConfig = this.cell.getConfig();\n\n if (this.getClassName() === RNN.className) {\n config['cell'] = {\n 'className': this.cell.getClassName(),\n 'config': cellConfig,\n } as serialization.ConfigDictValue;\n }\n\n // this order is necessary, to prevent cell name from replacing layer name\n return {...cellConfig, ...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cellConfig = config['cell'] as serialization.ConfigDict;\n const cell = deserialize(cellConfig, customObjects) as RNNCell;\n return new cls(Object.assign(config, {cell}));\n }\n}\nserialization.registerClass(RNN);\n\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/**\n * An RNNCell layer.\n *\n * @doc {heading: 'Layers', subheading: 'Classes'}\n */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n // See\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error\n public abstract stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport declare interface SimpleRNNCellLayerArgs extends LayerArgs {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\nexport class SimpleRNNCell extends RNNCell {\n /** @nocollapse */\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(args: SimpleRNNCellLayerArgs) {\n super(args);\n this.units = args.units;\n assertPositiveInteger(this.units, `units`);\n this.activation = getActivation(\n args.activation == null ? this.DEFAULT_ACTIVATION : args.activation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training\n }) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(prevOutput),\n rate: this.recurrentDropout,\n training\n }) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(SimpleRNNCell);\n\nexport declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer subtypes.\n */\nexport declare interface RNNLayerArgs extends BaseRNNLayerArgs {\n cell: RNNCell|RNNCell[];\n}\n\nexport class SimpleRNN extends RNN {\n /** @nocollapse */\n static className = 'SimpleRNN';\n constructor(args: SimpleRNNLayerArgs) {\n args.cell = new SimpleRNNCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls(config);\n }\n}\nserialization.registerClass(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n\n /**\n * GRU convention (whether to apply reset gate after or before matrix\n * multiplication). false = \"before\", true = \"after\" (only false is\n * supported).\n */\n resetAfter?: boolean;\n}\n\nexport class GRUCell extends RNNCell {\n /** @nocollapse */\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: GRUCellLayerArgs) {\n super(args);\n if (args.resetAfter) {\n throw new ValueError(\n `GRUCell does not support reset_after parameter set to true.`);\n }\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2, regardless of the actual value of\n // config.implementation.\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 3\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 3\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n\n const recurrentKernelValue = this.recurrentKernel.read();\n const [rk1, rk2] = tfc.split(\n recurrentKernelValue, [2 * this.units, this.units],\n recurrentKernelValue.rank - 1);\n const matrixInner = K.dot(hTMinus1, rk1);\n\n const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1);\n const [recurrentZ, recurrentR] =\n tfc.split(matrixInner, 2, matrixInner.rank - 1);\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2);\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n\n const h =\n tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n resetAfter: false\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface GRULayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class GRU extends RNN {\n /** @nocollapse */\n static className = 'GRU';\n constructor(args: GRULayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new GRUCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this configuration field.\n */\n implementation?: number;\n}\n\nexport class LSTMCell extends RNNCell {\n /** @nocollapse */\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(args: LSTMCellLayerArgs) {\n super(args);\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(\n args.activation === undefined ? this.DEFAULT_ACTIVATION :\n args.activation);\n this.recurrentActivation = getActivation(\n args.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n args.recurrentActivation);\n this.useBias = args.useBias == null ? true : args.useBias;\n\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = args.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.recurrentConstraint = getConstraint(args.recurrentConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, args.recurrentDropout == null ? 0 : args.recurrentDropout])\n ]);\n this.implementation = args.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(inputs as Tensor),\n rate: this.dropout,\n training,\n count: 4\n }) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: 4\n }) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n // Note: For superior performance, TensorFlow.js always uses\n // implementation 2 regardless of the actual value of\n // config.implementation.\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n\n return {...baseConfig, ...config};\n }\n}\nserialization.registerClass(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport declare interface LSTMLayerArgs extends SimpleRNNLayerArgs {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigmoid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n *\n * Note: For superior performance, TensorFlow.js always uses implementation\n * 2, regardless of the actual value of this config field.\n */\n implementation?: number;\n}\n\nexport class LSTM extends RNN {\n /** @nocollapse */\n static className = 'LSTM';\n constructor(args: LSTMLayerArgs) {\n if (args.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n args.cell = new LSTMCell(args);\n super(args as RNNLayerArgs);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.registerClass(LSTM);\n\nexport declare interface StackedRNNCellsArgs extends LayerArgs {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\nexport class StackedRNNCells extends RNNCell {\n /** @nocollapse */\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(args: StackedRNNCellsArgs) {\n super(args);\n this.cells = args.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n this.cells.forEach((cell, i) => {\n nameScope(`RNNCell_${i}`, () => {\n // TODO(cais): Take care of input constants.\n\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim] as Shape;\n });\n });\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const baseConfig = super.getConfig();\n\n const getCellConfig = (cell: RNNCell) => {\n return {\n 'className': cell.getClassName(),\n 'config': cell.getConfig(),\n };\n };\n\n const cellConfigs = this.cells.map(getCellConfig);\n\n const config = {'cells': cellConfigs};\n\n return {...baseConfig, ...config};\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `tf.Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `tf.Tensor`s with shapes and types matching\n * the output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.registerClass(StackedRNNCells);\n\nexport function generateDropoutMask(args: {\n ones: () => tfc.Tensor,\n rate: number,\n training?: boolean,\n count?: number,\n}): tfc.Tensor|tfc.Tensor[] {\n const {ones, rate, training = false, count = 1} = args;\n\n const droppedInputs = () => K.dropout(ones(), rate);\n\n const createMask = () => K.inTrainPhase(droppedInputs, ones, training);\n\n // just in case count is provided with null or undefined\n if (!count || count <= 1) {\n return tfc.keep(createMask().clone());\n }\n\n const masks = Array(count).fill(undefined).map(createMask);\n\n return masks.map(m => tfc.keep(m.clone()));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, util} from '@tensorflow/tfjs-core';\n\nimport {Activation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode} from '../common';\nimport {Constraint} from '../constraints';\nimport {InputSpec} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {convOutputLength, normalizeArray} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\nimport {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent';\n\ndeclare interface ConvRNN2DCellArgs extends\n Omit {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two or three integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n}\n\nabstract class ConvRNN2DCell extends RNNCell {\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n}\n\ndeclare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs,\n ConvRNN2DCellArgs {}\n\n/**\n * Base class for convolutional-recurrent layers.\n */\nclass ConvRNN2D extends RNN {\n /** @nocollapse */\n static className = 'ConvRNN2D';\n\n readonly cell: ConvRNN2DCell;\n\n constructor(args: ConvRNN2DLayerArgs) {\n if (args.unroll) {\n throw new NotImplementedError(\n 'Unrolling is not possible with convolutional RNNs.');\n }\n\n if (Array.isArray(args.cell)) {\n throw new NotImplementedError(\n 'It is not possible at the moment to stack convolutional cells.');\n }\n\n super(args as RNNLayerArgs);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n\n this.cell.dropoutMask = null;\n }\n\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n\n this.cell.recurrentDropoutMask = null;\n }\n\n if (kwargs && kwargs['constants']) {\n throw new ValueError('ConvRNN2D cell does not support constants');\n }\n\n const mask = kwargs == null ? null : kwargs['mask'];\n\n const training = kwargs == null ? null : kwargs['training'];\n\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n computeOutputShape(inputShape: Shape): Shape|Shape[] {\n let outShape: Shape = this.computeSingleOutputShape(inputShape);\n\n if (!this.returnSequences) {\n outShape = [outShape[0], ...outShape.slice(2)];\n }\n\n if (this.returnState) {\n outShape =\n [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])];\n }\n\n return outShape;\n }\n\n getInitialState(inputs: tfc.Tensor): tfc.Tensor[] {\n return tfc.tidy(() => {\n const {stateSize} = this.cell;\n\n const inputShape = inputs.shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const initialState = tfc.zeros(stateShape);\n\n if (Array.isArray(stateSize)) {\n return Array(stateSize.length).fill(initialState);\n }\n\n return [initialState];\n });\n }\n\n resetStates(states?: Tensor|Tensor[], training = false): void {\n tfc.tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetStates() on an RNN Layer that is not stateful.');\n }\n\n const inputShape = this.inputSpec[0].shape;\n\n const outputShape = this.computeSingleOutputShape(inputShape);\n\n const stateShape = [outputShape[0], ...outputShape.slice(2)];\n\n const batchSize = inputShape[0];\n\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n\n // Initialize state if null.\n if (this.getStates() == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_ = [tfc.zeros(stateShape)];\n }\n } else if (states == null) {\n // Dispose old state tensors.\n tfc.dispose(this.states_);\n\n // For stateful RNNs, fully dispose kept old states.\n if (this.keptStates != null) {\n tfc.dispose(this.keptStates);\n this.keptStates = [];\n }\n\n if (Array.isArray(this.cell.stateSize)) {\n this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape));\n } else {\n this.states_[0] = tfc.zeros(stateShape);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n\n if (states.length !== this.states_.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states_.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n\n if (training) {\n // Store old state tensors for complete disposal later, i.e., during\n // the next no-arg call to this method. We do not dispose the old\n // states immediately because that BPTT (among other things) require\n // them.\n this.keptStates.push(this.states_.slice());\n } else {\n tfc.dispose(this.states_);\n }\n\n for (let index = 0; index < this.states_.length; ++index) {\n const value = states[index];\n\n const expectedShape = stateShape;\n\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n\n this.states_[index] = value;\n }\n }\n\n this.states_ = this.states_.map(state => tfc.keep(state.clone()));\n });\n }\n\n protected computeSingleOutputShape(inputShape: Shape): Shape {\n const {dataFormat, filters, kernelSize, padding, strides, dilationRate} =\n this.cell;\n\n const isChannelsFirst = dataFormat === 'channelsFirst';\n\n const h = inputShape[isChannelsFirst ? 3 : 2];\n const w = inputShape[isChannelsFirst ? 4 : 3];\n\n const hOut = convOutputLength(\n h, kernelSize[0], padding, strides[0], dilationRate[0]);\n const wOut = convOutputLength(\n w, kernelSize[1], padding, strides[1], dilationRate[1]);\n\n const outShape: Shape = [\n ...inputShape.slice(0, 2),\n ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters])\n ];\n\n return outShape;\n }\n}\n\nexport declare interface ConvLSTM2DCellArgs extends\n Omit, ConvRNN2DCellArgs {}\n\nexport class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {\n /** @nocollapse */\n static className = 'ConvLSTM2DCell';\n\n readonly filters: number;\n readonly kernelSize: number[];\n readonly strides: number[];\n readonly padding: PaddingMode;\n readonly dataFormat: DataFormat;\n readonly dilationRate: number[];\n\n constructor(args: ConvLSTM2DCellArgs) {\n const {\n filters,\n kernelSize,\n strides,\n padding,\n dataFormat,\n dilationRate,\n } = args;\n\n super({...args, units: filters});\n\n this.filters = filters;\n assertPositiveInteger(this.filters, 'filters');\n\n this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');\n this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));\n\n this.strides = normalizeArray(strides || 1, 2, 'strides');\n this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));\n\n this.padding = padding || 'valid';\n checkPaddingMode(this.padding);\n\n this.dataFormat = dataFormat || 'channelsLast';\n checkDataFormat(this.dataFormat);\n\n this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');\n this.dilationRate.forEach(\n rate => assertPositiveInteger(rate, 'dilationRate'));\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n\n const inputDim = inputShape[channelAxis];\n\n const numOfKernels = 4;\n\n const kernelShape =\n this.kernelSize.concat([inputDim, this.filters * numOfKernels]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n\n const recurrentKernelShape =\n this.kernelSize.concat([this.filters, this.filters * numOfKernels]);\n\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', recurrentKernelShape, null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n\n if (this.useBias) {\n let biasInitializer: Initializer;\n\n if (this.unitForgetBias) {\n const init = this.biasInitializer;\n\n const filters = this.filters;\n\n biasInitializer = new (class CustomInit extends Initializer {\n /** @nocollapse */\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): tfc.Tensor {\n const biasI = init.apply([filters]);\n const biasF = tfc.ones([filters]);\n const biasCAndO = init.apply([filters * 2]);\n return K.concatenate([biasI, biasF, biasCAndO]);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n\n this.bias = this.addWeight(\n 'bias', [this.filters * numOfKernels], null, biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.built = true;\n }\n\n call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] {\n return tfc.tidy(() => {\n if (inputs.length !== 3) {\n throw new ValueError(\n `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] || false;\n\n const x = inputs[0]; // Current input\n const hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n\n const numOfKernels = 4;\n\n type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(x),\n rate: this.dropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const dropoutMask = this.dropoutMask as DropoutMasks;\n\n const applyDropout =\n (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => {\n if (!mask || !mask[index]) {\n return x;\n }\n\n return tfc.mul(mask[index], x);\n };\n\n let xI = applyDropout(x, dropoutMask, 0);\n let xF = applyDropout(x, dropoutMask, 1);\n let xC = applyDropout(x, dropoutMask, 2);\n let xO = applyDropout(x, dropoutMask, 3);\n\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask = generateDropoutMask({\n ones: () => tfc.onesLike(hTMinus1),\n rate: this.recurrentDropout,\n training,\n count: numOfKernels\n }) as tfc.Tensor[];\n }\n\n const recDropoutMask = this.recurrentDropoutMask as DropoutMasks;\n\n let hI = applyDropout(hTMinus1, recDropoutMask, 0);\n let hF = applyDropout(hTMinus1, recDropoutMask, 1);\n let hC = applyDropout(hTMinus1, recDropoutMask, 2);\n let hO = applyDropout(hTMinus1, recDropoutMask, 3);\n\n const kernelChannelAxis = 3;\n\n const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] =\n tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis);\n\n const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ?\n tfc.split(this.bias.read(), numOfKernels) :\n [null, null, null, null];\n\n xI = this.inputConv(xI, kernelI, biasI, this.padding);\n xF = this.inputConv(xF, kernelF, biasF, this.padding);\n xC = this.inputConv(xC, kernelC, biasC, this.padding);\n xO = this.inputConv(xO, kernelO, biasO, this.padding);\n\n const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] =\n tfc.split(\n this.recurrentKernel.read(), numOfKernels, kernelChannelAxis);\n\n hI = this.recurrentConv(hI, recKernelI);\n hF = this.recurrentConv(hF, recKernelF);\n hC = this.recurrentConv(hC, recKernelC);\n hO = this.recurrentConv(hO, recKernelO);\n\n const i = this.recurrentActivation.apply(tfc.add(xI, hI));\n const f = this.recurrentActivation.apply(tfc.add(xF, hF));\n const c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(i, this.activation.apply(tfc.add(xC, hC))));\n const h = tfc.mul(\n this.recurrentActivation.apply(tfc.add(xO, hO)),\n this.activation.apply(c));\n\n return [h, h, c];\n });\n }\n\n getConfig(): tfc.serialization.ConfigDict {\n const {'units': _, ...baseConfig} = super.getConfig();\n\n const config: tfc.serialization.ConfigDict = {\n filters: this.filters,\n kernelSize: this.kernelSize,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n strides: this.strides,\n };\n\n return {...baseConfig, ...config};\n }\n\n inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) {\n const out = tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number],\n (padding || 'valid') as 'same' | 'valid',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC',\n this.dilationRate as [number, number]);\n\n if (b) {\n return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D;\n }\n\n return out;\n }\n\n recurrentConv(x: Tensor, w: Tensor) {\n const strides = 1;\n\n return tfc.conv2d(\n x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same',\n this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC');\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2DCell);\n\nexport declare interface ConvLSTM2DArgs extends\n Omit, ConvRNN2DLayerArgs {}\n\nexport class ConvLSTM2D extends ConvRNN2D {\n /** @nocollapse */\n static className = 'ConvLSTM2D';\n\n constructor(args: ConvLSTM2DArgs) {\n const cell = new ConvLSTM2DCell(args);\n\n super({...args, cell} as ConvRNN2DLayerArgs);\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: tfc.serialization.SerializableConstructor,\n config: tfc.serialization.ConfigDict): T {\n return new cls(config);\n }\n}\n\ntfc.serialization.registerClass(ConvLSTM2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core';\n\nimport {Activation as ActivationFn, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {ActivationIdentifier} from '../keras_format/activation_config';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {LayerConfig} from '../keras_format/topology_config';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils';\nimport {arrayProd, range} from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface DropoutLayerArgs extends LayerArgs {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class Dropout extends Layer {\n /** @nocollapse */\n static className = 'Dropout';\n private readonly rate: number;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(args: DropoutLayerArgs) {\n super(args);\n this.rate = Math.max(Math.min(args.rate, 1), 0);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = args.noiseShape;\n this.seed = args.seed;\n this.supportsMasking = true;\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output = K.inTrainPhase(\n () => K.dropout(input, this.rate, noiseShape, this.seed),\n () => input, training);\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n dispose(): DisposeResult {\n return super.dispose();\n }\n}\nserialization.registerClass(Dropout);\n\nexport declare interface DenseLayerArgs extends LayerArgs {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport interface SpatialDropout1DLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\nexport class SpatialDropout1D extends Dropout {\n /** @nocollapse */\n static className = 'SpatialDropout1D';\n\n constructor(args: SpatialDropout1DLayerConfig) {\n super(args);\n this.inputSpec = [{ndim: 3}];\n }\n\n protected getNoiseShape(input: Tensor): Shape {\n const inputShape = input.shape;\n return [inputShape[0], 1, inputShape[2]];\n }\n}\nserialization.registerClass(SpatialDropout1D);\n\nexport class Dense extends Layer {\n /** @nocollapse */\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(args: DenseLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null &&\n args.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n this.batchInputShape = [batchSize, args.inputDim];\n }\n\n this.units = args.units;\n assertPositiveInteger(this.units, 'units');\n this.activation = getActivation(args.activation);\n if (args.useBias != null) {\n this.useBias = args.useBias;\n }\n this.kernelInitializer = getInitializer(\n args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(args.kernelConstraint);\n this.biasConstraint = getConstraint(args.biasConstraint);\n this.kernelRegularizer = getRegularizer(args.kernelRegularizer);\n this.biasRegularizer = getRegularizer(args.biasRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.supportsMasking = true;\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n const fusedActivationName =\n mapActivationToFusedKernel(this.activation.getClassName());\n let output: Tensor;\n\n if (fusedActivationName != null) {\n output = K.dot(\n input, this.kernel.read(), fusedActivationName,\n this.bias ? this.bias.read() : null);\n } else {\n output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n }\n\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dense);\n\nexport declare interface FlattenLayerArgs extends LayerArgs {\n /** Image data format: channeLast (default) or channelFirst. */\n dataFormat?: DataFormat;\n}\n\nexport class Flatten extends Layer {\n private dataFormat: DataFormat;\n\n /** @nocollapse */\n static className = 'Flatten';\n constructor(args?: FlattenLayerArgs) {\n args = args || {};\n super(args);\n this.inputSpec = [{minNDim: 3}];\n this.dataFormat = args.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n\n let input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsFirst' && input.rank > 1) {\n const permutation: number[] = [0];\n for (let i = 2; i < input.rank; ++i) {\n permutation.push(i);\n }\n permutation.push(1);\n input = input.transpose(permutation);\n }\n\n return K.batchFlatten(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {};\n if (this.dataFormat != null) {\n config['dataFormat'] = this.dataFormat;\n }\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Flatten);\n\nexport declare interface ActivationLayerArgs extends LayerArgs {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\nexport class Activation extends Layer {\n /** @nocollapse */\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(args: ActivationLayerArgs) {\n super(args);\n this.supportsMasking = true;\n this.activation = getActivation(args.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Activation);\n\nexport declare interface ReshapeLayerArgs extends LayerArgs {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport declare interface RepeatVectorLayerArgs extends LayerArgs {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\nexport class RepeatVector extends Layer {\n /** @nocollapse */\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(args: RepeatVectorLayerArgs) {\n super(args);\n this.n = args.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(RepeatVector);\n\nexport class Reshape extends Layer {\n /** @nocollapse */\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(args: ReshapeLayerArgs) {\n super(args);\n this.targetShape = args.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Reshape);\n\nexport declare interface PermuteLayerArgs extends LayerArgs {\n /**\n * Array of integers. Permutation pattern. Does not include the\n * sample (batch) dimension. Index starts at 1.\n * For instance, `[2, 1]` permutes the first and second dimensions\n * of the input.\n */\n dims: number[];\n}\n\nexport class Permute extends Layer {\n /** @nocollapse */\n static className = 'Permute';\n readonly dims: number[];\n private readonly dimsIncludingBatch: number[];\n\n constructor(args: PermuteLayerArgs) {\n super(args);\n if (args.dims == null) {\n throw new Error(\n 'Required configuration field `dims` is missing during Permute ' +\n 'constructor call.');\n }\n if (!Array.isArray(args.dims)) {\n throw new Error(\n 'Permute constructor requires `dims` to be an Array, but received ' +\n `${args.dims} instead.`);\n }\n\n // Check the validity of the permutation indices.\n const expectedSortedIndices = range(1, args.dims.length + 1);\n if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) {\n throw new Error(\n 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) +\n ' `dims` must contain consecutive integers starting from 1.');\n }\n\n this.dims = args.dims;\n this.dimsIncludingBatch = [0].concat(this.dims);\n this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n this.dims.forEach((dim: number, i: number) => {\n outputShape[i + 1] = (inputShape as Shape)[dim];\n });\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n dims: this.dims,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Permute);\n\nexport declare interface MaskingArgs extends LayerArgs {\n /**\n * Masking Value. Defaults to `0.0`.\n */\n maskValue?: number;\n}\n\nexport class Masking extends Layer {\n /** @nocollapse */\n static className = 'Masking';\n maskValue: number;\n\n constructor(args?: MaskingArgs) {\n super(args == null ? {} : args);\n this.supportsMasking = true;\n if (args != null) {\n this.maskValue = args.maskValue == null ? 0 : args.maskValue;\n } else {\n this.maskValue = 0;\n }\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig() {\n const baseConfig = super.getConfig();\n const config = {maskValue: this.maskValue};\n Object.assign(config, baseConfig);\n return config;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n return any(notEqual(input, this.maskValue), axis);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const axis = -1;\n const keepDims = true;\n const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims);\n const output = input.mul(booleanMask.asType(input.dtype));\n return output;\n });\n }\n}\nserialization.registerClass(Masking);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nexport declare interface EmbeddingLayerArgs extends LayerArgs {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\nexport class Embedding extends Layer {\n /** @nocollapse */\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(args: EmbeddingLayerArgs) {\n super(args);\n if (args.batchInputShape == null && args.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (args.batchSize != null) {\n batchSize = args.batchSize;\n }\n if (args.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(args.inputLength));\n }\n }\n this.inputDim = args.inputDim;\n generic_utils.assertPositiveInteger(this.inputDim, 'inputDim');\n this.outputDim = args.outputDim;\n generic_utils.assertPositiveInteger(this.outputDim, 'outputDim');\n this.embeddingsInitializer = getInitializer(\n args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(args.activityRegularizer);\n this.embeddingsConstraint = getConstraint(args.embeddingsConstraint);\n this.maskZero = args.maskZero;\n this.supportsMasking = args.maskZero;\n this.inputLength = args.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tidy(() => {\n if (!this.maskZero) {\n return null;\n } else {\n inputs = getExactlyOneTensor(inputs);\n return notEqual(inputs, zerosLike(inputs));\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\nimport {l2Normalize} from '../losses';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(args?: LayerArgs) {\n super(args || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return tfc.tidy(() => {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an Array');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an Array');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `The Array 'inputs' and 'mask' are expected to have the same ` +\n `length, but have different lengths ` +\n `(${inputs.length} vs ${mask.length})`);\n }\n if (mask.every(m => m == null)) {\n return null;\n }\n mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0));\n let output = mask[0];\n for (let i = 1; i < mask.length - 1; ++i) {\n output = tfc.logicalAnd(output, mask[i]);\n }\n return output;\n });\n }\n}\n\nexport class Add extends Merge {\n /** @nocollapse */\n static className = 'Add';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Add(config);\n }\n}\n\nexport class Multiply extends Merge {\n /** @nocollapse */\n static className = 'Multiply';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.mul(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\nexport class Average extends Merge {\n /** @nocollapse */\n static className = 'Average';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0].clone();\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.add(output, inputs[i]);\n }\n return tfc.mul(1 / inputs.length, output);\n });\n }\n}\nserialization.registerClass(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Average(config);\n }\n}\n\nexport class Maximum extends Merge {\n /** @nocollapse */\n static className = 'Maximum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\nexport class Minimum extends Merge {\n /** @nocollapse */\n static className = 'Minimum';\n constructor(args?: LayerArgs) {\n super(args);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.registerClass(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport declare interface ConcatenateLayerArgs extends LayerArgs {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\nexport class Concatenate extends Merge {\n /** @nocollapse */\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(args?: ConcatenateLayerArgs) {\n super(args);\n if (args == null) {\n args = {};\n }\n this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n if (mask == null) {\n return null;\n }\n if (!Array.isArray(mask)) {\n throw new ValueError('`mask` should be an array for Concatenate');\n }\n if (!Array.isArray(inputs)) {\n throw new ValueError('`inputs` should be an array for Concatenate');\n }\n if (mask.length !== inputs.length) {\n throw new ValueError(\n `Mismatch in the length of mask (${mask.length}) ` +\n `and the legnth of inputs (${inputs.length})`);\n }\n return tfc.tidy(() => {\n let allNullMasks = true;\n mask.forEach(m => {\n if (m != null) {\n allNullMasks = false;\n return;\n }\n });\n if (allNullMasks) {\n return null;\n }\n const outputMasks: Tensor[] = [];\n for (let i = 0; i < inputs.length; ++i) {\n if (mask[i] == null) {\n // Input is unmasked. Append all 1's to masks.\n outputMasks.push(tfc.onesLike(inputs[i]).asType('bool'));\n } else if (mask[i].rank < inputs[i].rank) {\n // Mask is smaller than the input, expand it.\n outputMasks.push(tfc.expandDims(mask[i], -1));\n } else {\n outputMasks.push(mask[i]);\n }\n }\n const concatenatedMasks = tfc.concat(outputMasks, this.axis);\n return tfc.all(concatenatedMasks, -1, false);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `tf.Tensor` as the result of the computation. For\n * example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config) as SymbolicTensor | Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\nexport declare interface DotLayerArgs extends LayerArgs {\n /**\n * Axis or axes along which the dot product will be taken.\n *\n * Integer or an Array of integers.\n */\n axes: number|[number, number];\n\n /**\n * Whether to L2-normalize samples along the dot product axis\n * before taking the dot product.\n *\n * If set to `true`, the output of the dot product isthe cosine\n * proximity between the two samples.\n */\n normalize?: boolean;\n}\n\n/**\n * Interpretable potentially negative axis index.\n *\n * For example, given axis = -1, and dim = 3, this function will return 2.\n *\n * @param axis The axis index, may be a positive, zero or negative integer.\n * @param dim Total number of dimensions, a positive integer.\n * @returns A non-negative axis index equivalent to the input `axis`.\n */\nfunction interpretAxis(axis: number, dim: number): number {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}\n\nfunction batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor {\n if (x.shape.length > 3 || y.shape.length > 3) {\n throw new NotImplementedError(\n 'batchDot is not implemented for tensors of 4D or higher rank yet');\n }\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of x to be >= 2, ` +\n `but got ${x.shape.length}`);\n tfc.util.assert(\n x.shape.length >= 2,\n () => `batchDot requires the rank of y to be >= 2, ` +\n `but got ${y.shape.length}`);\n\n if (typeof axes === 'number') {\n axes = [axes, axes];\n }\n\n if (x.dtype === 'complex64' || y.dtype === 'complex64') {\n throw new NotImplementedError(\n 'batchDot is not implemented for complex64-type Tensors yet.');\n }\n\n const xNDim = x.shape.length;\n const yNDim = y.shape.length;\n if (axes == null) {\n // Behave like batchMatmul by default.\n axes = [xNDim - 1, yNDim - 2];\n }\n const axesArray = axes as [number, number];\n\n return tfc.tidy(() => {\n let diff: number;\n if (xNDim > yNDim) {\n diff = xNDim - yNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n y = y.reshape(y.shape.concat(diffShape));\n } else if (yNDim > xNDim) {\n diff = yNDim - xNDim;\n const diffShape: Shape = [];\n for (let i = 0; i < diff; ++i) {\n diffShape.push(1);\n }\n x = x.reshape(x.shape.concat(diffShape));\n } else {\n diff = 0;\n }\n\n let out: Tensor;\n if (x.shape.length === 2 && y.shape.length === 2) {\n if (axesArray[0] === axesArray[1]) {\n out = x.mul(y).sum(axesArray[0]);\n } else {\n out = x.transpose([1, 0]).mul(y).sum(axesArray[1]);\n }\n } else {\n const adjX = axesArray[0] !== x.shape.length - 1;\n const adjY = axesArray[1] === y.shape.length - 1;\n out = x.matMul(y, adjX, adjY);\n }\n\n if (diff > 0) {\n let idx: number;\n if (xNDim > yNDim) {\n idx = xNDim + yNDim - 3;\n } else {\n idx = xNDim - 1;\n }\n const squeezeAxes: number[] = [];\n for (let i = idx; i < idx + diff; ++i) {\n squeezeAxes.push(i);\n }\n out = out.squeeze(squeezeAxes);\n }\n if (out.shape.length === 1) {\n out = out.expandDims(1);\n }\n return out;\n });\n}\n\nexport class Dot extends Merge {\n /** @nocollapse */\n static className = 'Dot';\n\n private axes: number|[number, number];\n private normalize: boolean;\n\n constructor(args: DotLayerArgs) {\n super(args);\n this.axes = args.axes;\n this.normalize = args.normalize == null ? false : args.normalize;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = inputShape[0] as Shape;\n const shape2 = inputShape[1] as Shape;\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n if (shape1[axes[0]] !== shape2[axes[1]]) {\n throw new ValueError(\n `Dimension incompatibility: ` +\n `${shape1[axes[0]]} !== ${shape2[axes[1]]}`);\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n if (inputs.length !== 2) {\n throw new ValueError(\n 'A `Dot` layer must be called on exactly 2 inputs, ' +\n `but received ${inputs.length} input(s).`);\n }\n\n let x1 = inputs[0];\n let x2 = inputs[1];\n let axes: [number, number];\n if (!Array.isArray(this.axes)) {\n axes = [\n interpretAxis(this.axes, x1.shape.length),\n interpretAxis(this.axes, x2.shape.length)\n ];\n } else {\n axes = this.axes.map(\n (axis, i) => interpretAxis(\n axis, inputs[i].shape.length)) as [number, number];\n }\n if (this.normalize) {\n x1 = l2Normalize(x1, axes[0]);\n x2 = l2Normalize(x2, axes[1]);\n }\n return batchDot(x1, x2, axes);\n }\n\n private interpretAxes(shape1: Shape, shape2: Shape): number[] {\n let axes: number[];\n if (!Array.isArray(this.axes)) {\n // `this.axes` is a single integer.\n axes = [\n interpretAxis(this.axes, shape1.length),\n interpretAxis(this.axes, shape2.length)\n ];\n } else {\n // `this.axes` is an Array of integers.\n axes = this.axes;\n }\n return axes;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n tfc.util.assert(\n Array.isArray(inputShape) && inputShape.length === 2 &&\n Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]),\n () => 'A `Dot` layer should be called on a list of exactly 2 inputs.');\n const shape1 = (inputShape[0] as Shape).slice();\n const shape2 = (inputShape[1] as Shape).slice();\n if (shape1.length > 3 || shape2.length > 3) {\n throw new NotImplementedError(\n 'Dot layer does not support tensors of 4D or higher rank yet.');\n }\n\n const axes = this.interpretAxes(shape1, shape2);\n shape1.splice(axes[0], 1);\n shape2.splice(axes[1], 1);\n shape2.splice(0, 1);\n const outputShape = shape1.concat(shape2);\n if (outputShape.length === 1) {\n outputShape.push(1);\n }\n return outputShape;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n return null;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axes': this.axes,\n 'normalize': this.normalize\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(Dot);\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Use of this source code is governed by an MIT-style\r\n * license that can be found in the LICENSE file or at\r\n * https://opensource.org/licenses/MIT.\r\n * =============================================================================\r\n */\r\n\r\n/**\r\n * TensorFlow.js Layers: Noise Layers.\r\n */\r\n\r\nimport {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\r\n\r\nimport * as K from '../backend/tfjs_backend';\r\nimport {Layer, LayerArgs} from '../engine/topology';\r\nimport {Shape} from '../keras_format/common';\r\nimport {Kwargs} from '../types';\r\nimport {getExactlyOneTensor} from '../utils/types_utils';\r\n\r\nexport declare interface GaussianNoiseArgs extends LayerArgs {\r\n /** Standard Deviation. */\r\n stddev: number;\r\n}\r\n\r\nexport class GaussianNoise extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianNoise';\r\n readonly stddev: number;\r\n\r\n constructor(args: GaussianNoiseArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.stddev = args.stddev;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {stddev: this.stddev};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n const noised = () =>\r\n K.randomNormal(input.shape, 0, this.stddev).add(input);\r\n const output =\r\n K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n return output;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianNoise);\r\n\r\nexport declare interface GaussianDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n}\r\n\r\nexport class GaussianDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'GaussianDropout';\r\n readonly rate: number;\r\n\r\n constructor(args: GaussianDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n this.invokeCallHook(inputs, kwargs);\r\n const input = getExactlyOneTensor(inputs);\r\n if (this.rate > 0 && this.rate < 1) {\r\n const noised = () => {\r\n const stddev = Math.sqrt(this.rate / (1 - this.rate));\r\n return input.mul(K.randomNormal(input.shape, 1, stddev));\r\n };\r\n return K.inTrainPhase(noised, () => input, kwargs['training'] || false);\r\n }\r\n return input;\r\n });\r\n }\r\n}\r\nserialization.registerClass(GaussianDropout);\r\n\r\nexport declare interface AlphaDropoutArgs extends LayerArgs {\r\n /** drop probability. */\r\n rate: number;\r\n /**\r\n * A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n */\r\n noiseShape?: Shape;\r\n}\r\n\r\n/**\r\n * Applies Alpha Dropout to the input.\r\n *\r\n * As it is a regularization layer, it is only active at training time.\r\n *\r\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\r\n * to their original values, in order to ensure the self-normalizing property\r\n * even after this dropout.\r\n * Alpha Dropout fits well to Scaled Exponential Linear Units\r\n * by randomly setting activations to the negative saturation value.\r\n *\r\n * Arguments:\r\n * - `rate`: float, drop probability (as with `Dropout`).\r\n * The multiplicative noise will have\r\n * standard deviation `sqrt(rate / (1 - rate))`.\r\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\r\n * shape for randomly generated keep/drop flags.\r\n *\r\n * Input shape:\r\n * Arbitrary. Use the keyword argument `inputShape`\r\n * (tuple of integers, does not include the samples axis)\r\n * when using this layer as the first layer in a model.\r\n *\r\n * Output shape:\r\n * Same shape as input.\r\n *\r\n * References:\r\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\r\n */\r\nexport class AlphaDropout extends Layer {\r\n /** @nocollapse */\r\n static className = 'AlphaDropout';\r\n readonly rate: number;\r\n readonly noiseShape: Shape;\r\n\r\n constructor(args: AlphaDropoutArgs) {\r\n super(args);\r\n this.supportsMasking = true;\r\n this.rate = args.rate;\r\n this.noiseShape = args.noiseShape;\r\n }\r\n\r\n _getNoiseShape(inputs: Tensor|Tensor[]) {\r\n return this.noiseShape || getExactlyOneTensor(inputs).shape;\r\n }\r\n\r\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\r\n return inputShape;\r\n }\r\n\r\n getConfig() {\r\n const baseConfig = super.getConfig();\r\n const config = {rate: this.rate};\r\n Object.assign(config, baseConfig);\r\n return config;\r\n }\r\n\r\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\r\n return tidy(() => {\r\n if (this.rate < 1 && this.rate > 0) {\r\n const noiseShape = this._getNoiseShape(inputs);\r\n\r\n const droppedInputs = () => {\r\n const input = getExactlyOneTensor(inputs);\r\n\r\n const alpha = 1.6732632423543772848170429916717;\r\n const scale = 1.0507009873554804934193349852946;\r\n\r\n const alphaP = -alpha * scale;\r\n\r\n let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate);\r\n\r\n keptIdx = K.cast(keptIdx, 'float32'); // get default dtype.\r\n\r\n // Get affine transformation params.\r\n const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5;\r\n const b = -a * alphaP * this.rate;\r\n\r\n // Apply mask.\r\n const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP));\r\n\r\n return x.mul(a).add(b);\r\n };\r\n return K.inTrainPhase(\r\n droppedInputs, () => getExactlyOneTensor(inputs),\r\n kwargs['training'] || false);\r\n }\r\n return inputs;\r\n });\r\n }\r\n}\r\nserialization.registerClass(AlphaDropout);\r\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {Shape} from '../keras_format/common';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNorm2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D,\n gamma as Tensor2D | Tensor1D, epsilon);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNorm3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D,\n gamma as Tensor3D | Tensor1D, epsilon);\n } else if (x.rank === 4) {\n out = tfc.batchNorm4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D,\n gamma as Tensor4D | Tensor1D, epsilon);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implemented for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport declare interface BatchNormalizationLayerArgs extends LayerArgs {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class BatchNormalization extends Layer {\n /** @nocollapse */\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n\n constructor(args?: BatchNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.supportsMasking = true;\n this.axis = args.axis == null ? -1 : args.axis;\n this.momentum = args.momentum == null ? 0.99 : args.momentum;\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(args.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(args.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(args.betaConstraint);\n this.gammaConstraint = getConstraint(args.gammaConstraint);\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n const doMovingAverage =\n (variable: LayerVariable, value: Tensor, momentum: number): void => {\n tfc.tidy(() => {\n const decay = 1 - momentum;\n const origValue = variable.read();\n const updateDelta = origValue.sub(value).mul(decay);\n variable.write(origValue.sub(updateDelta));\n });\n };\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n doMovingAverage(this.movingMean, mean, this.momentum);\n doMovingAverage(this.movingVariance, variance, this.momentum);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(BatchNormalization);\n\nexport interface LayerNormalizationLayerArgs extends LayerArgs {\n /**\n * The axis or axes that should be normalized (typically, the feature axis.)\n * Defaults to -1 (the last axis.)\n */\n axis?: number|number[];\n\n /**\n * A small positive float added to variance to avoid divison by zero.\n * Defaults to 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Default: `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply output by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear, this can be disabled since scaling will\n * be done by the next layer.\n * Default: `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Default: `'zeros'`.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Default: `'ones'`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /** Regularizer for the beta weight. */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /** Regularizer for the gamma weight. */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\nexport class LayerNormalization extends Layer {\n /** @nocollapse */\n static className = 'LayerNormalization';\n\n private axis: number|number[];\n readonly epsilon: number;\n readonly center: boolean;\n readonly scale: boolean;\n readonly betaInitializer: Initializer;\n readonly gammaInitializer: Initializer;\n readonly betaRegularizer: Regularizer;\n readonly gammaRegularizer: Regularizer;\n\n private gamma: LayerVariable;\n private beta: LayerVariable;\n\n constructor(args?: LayerNormalizationLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.axis = args.axis == null ? -1 : args.axis;\n if (typeof this.axis === 'number') {\n if (!Number.isInteger(this.axis)) {\n throw new Error(\n `Expected axis to be an integer, but received ${this.axis}`);\n }\n } else if (Array.isArray(this.axis)) {\n for (const axis of this.axis) {\n if (!Number.isInteger(axis)) {\n throw new Error(\n `Expected axis to be an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n }\n } else {\n throw new Error(\n `Expected axis to be an integer or an array of integers, ` +\n `but received ${JSON.stringify(this.axis)}`);\n }\n\n this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;\n this.center = args.center == null ? true : args.center;\n this.scale = args.scale == null ? true : args.scale;\n this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');\n this.betaRegularizer = getRegularizer(args.betaRegularizer);\n this.gammaRegularizer = getRegularizer(args.gammaRegularizer);\n\n this.supportsMasking = true;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const nDims = inputShape.length;\n\n // Convert axis to array and resolve negatives.\n if (typeof this.axis === 'number') {\n this.axis = [this.axis];\n }\n for (let i = 0; i < this.axis.length; ++i) {\n if (this.axis[i] < 0) {\n this.axis[i] += nDims;\n }\n }\n\n // Further validate axes.\n for (const axis of this.axis) {\n if (axis < 0 || axis >= nDims) {\n throw new Error(`Invalid axis: ${axis}`);\n }\n }\n if (this.axis.length !== generic_utils.unique(this.axis).length) {\n throw new Error(`Found duplicate axes in: ${this.axis}`);\n }\n\n const paramShape = this.axis.map(axis => inputShape[axis]) as number[];\n\n const trainable = true;\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', paramShape, 'float32', this.gammaInitializer,\n this.gammaRegularizer, trainable);\n } else {\n this.gamma = null;\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', paramShape, 'float32', this.betaInitializer,\n this.betaRegularizer, trainable);\n } else {\n this.beta = null;\n }\n\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const nDims = inputShape.length;\n\n return tidy(() => {\n const keepDims = true;\n let {mean, variance} = moments(input, this.axis, keepDims);\n const broadcastShape = generic_utils.pyListRepeat(1, nDims);\n for (const dim of this.axis as number[]) {\n broadcastShape[dim] = inputShape[dim];\n }\n\n const broadcast = (v: Tensor) => {\n if (v != null && v.shape.length !== nDims &&\n this.axis !== [nDims - 1]) {\n return v.reshape(broadcastShape);\n } else {\n return v;\n }\n };\n\n let scale = broadcast(this.gamma.read());\n let offset = broadcast(this.beta.read());\n\n // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below\n // is a workaround for the limitation of core's batchNormalization?d don't\n // support broadcasting in their gradients. In addition, the tiling is\n // necessary to ensure correctness on the browser CPU backend regardless\n // of forward or backward computation. Remove this workaround once the\n // limitation is addressed. See .\n const momentsTiling: number[] = [];\n const scaleOffsetTiling: number[] = [];\n for (let i = 0; i < nDims; ++i) {\n if ((this.axis as number[]).indexOf(i) !== -1) {\n momentsTiling.push(inputShape[i]);\n scaleOffsetTiling.push(1);\n } else {\n momentsTiling.push(1);\n scaleOffsetTiling.push(inputShape[i]);\n }\n }\n mean = mean.tile(momentsTiling);\n variance = variance.tile(momentsTiling);\n scale = scale.tile(scaleOffsetTiling);\n offset = offset.tile(scaleOffsetTiling);\n\n return batchNormalization(\n input, mean, variance, offset, scale, this.epsilon);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(LayerNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {InputSpec, Layer, LayerArgs} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {DataFormat, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `tf.Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `tf.Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `tf.Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport declare interface ZeroPadding2DLayerArgs extends LayerArgs {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\nexport class ZeroPadding2D extends Layer {\n /** @nocollapse */\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(args?: ZeroPadding2DLayerArgs) {\n if (args == null) {\n args = {};\n }\n super(args);\n\n this.dataFormat =\n args.dataFormat == null ? imageDataFormat() : args.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (args.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof args.padding === 'number') {\n this.padding =\n [[args.padding, args.padding], [args.padding, args.padding]];\n } else {\n args.padding = args.padding;\n if (args.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${args.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof args.padding[0] === 'number') {\n heightPadding = [args.padding[0], args.padding[0]];\n widthPadding = [args.padding[1] as number, args.padding[1] as number];\n } else {\n args.padding = args.padding as [[number, number], [number, number]];\n\n if (args.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${args.padding[0].length} array.`);\n }\n heightPadding = args.padding[0] as [number, number];\n\n if (args.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${args.padding[1].length} array.`);\n }\n widthPadding = args.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.registerClass(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerArgs} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {assertPositiveInteger} from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput, preprocessConv3DInput} from './convolutional';\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n/**\n * 3D pooling.\n * @param x\n * @param poolSize. Default to [1, 1, 1].\n * @param strides strides. Defaults to [1, 1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 3D pooling.\n */\nexport function pool3d(\n x: Tensor5D, poolSize: [number, number, number],\n strides?: [number, number, number], padding?: PaddingMode,\n dataFormat?: DataFormat, poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // x is NDHWC after preprocessing.\n x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D;\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n y = tfc.maxPool3d(x, poolSize, strides, paddingString);\n } else { // 'avg'\n y = tfc.avgPool3d(x, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW.\n }\n return y;\n });\n}\n\nexport declare interface Pooling1DLayerArgs extends LayerArgs {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number|[number];\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number];\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param args Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(args: Pooling1DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = 2;\n }\n super(args);\n if (typeof args.poolSize === 'number') {\n this.poolSize = [args.poolSize];\n } else if (\n Array.isArray(args.poolSize) &&\n (args.poolSize as number[]).length === 1 &&\n typeof (args.poolSize as number[])[0] === 'number') {\n this.poolSize = args.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.poolSize)}`);\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof args.strides === 'number') {\n this.strides = [args.strides];\n } else if (\n Array.isArray(args.strides) &&\n (args.strides as number[]).length === 1 &&\n typeof (args.strides as number[])[0] === 'number') {\n this.strides = args.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(args.strides)}`);\n }\n }\n assertPositiveInteger(this.strides, 'strides');\n\n this.padding = args.padding == null ? 'valid' : args.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'MaxPooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling1D);\n\nexport class AveragePooling1D extends Pooling1D {\n /** @nocollapse */\n static className = 'AveragePooling1D';\n constructor(args: Pooling1DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling1D);\n\nexport declare interface Pooling2DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling2DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'MaxPooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling2D);\n\nexport class AveragePooling2D extends Pooling2D {\n /** @nocollapse */\n static className = 'AveragePooling2D';\n constructor(args: Pooling2DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling2D);\n\nexport declare interface Pooling3DLayerArgs extends LayerArgs {\n /**\n * Factors by which to downscale in each dimension [depth, height, width].\n * Expects an integer or an array of 3 integers.\n *\n * For example, `[2, 2, 2]` will halve the input in three dimensions.\n * If only one integer is specified, the same window length\n * will be used for all dimensions.\n */\n poolSize?: number|[number, number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 3 integers. Integer, tuple of 3 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 3D layers.\n */\nexport abstract class Pooling3D extends Layer {\n protected readonly poolSize: [number, number, number];\n protected readonly strides: [number, number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(args: Pooling3DLayerArgs) {\n if (args.poolSize == null) {\n args.poolSize = [2, 2, 2];\n }\n super(args);\n this.poolSize = Array.isArray(args.poolSize) ?\n args.poolSize :\n [args.poolSize, args.poolSize, args.poolSize];\n if (args.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(args.strides)) {\n if (args.strides.length !== 3) {\n throw new ValueError(\n `If the strides property of a 3D pooling layer is an Array, ` +\n `it is expected to have a length of 3, but received length ` +\n `${args.strides.length}.`);\n }\n this.strides = args.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [args.strides, args.strides, args.strides];\n }\n assertPositiveInteger(this.poolSize, 'poolSize');\n assertPositiveInteger(this.strides, 'strides');\n this.padding = args.padding == null ? 'valid' : args.padding;\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 5})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let depths =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3];\n depths = convOutputLength(\n depths, this.poolSize[0], this.padding, this.strides[0]);\n rows =\n convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]);\n cols =\n convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], depths, rows, cols];\n } else {\n return [inputShape[0], depths, rows, cols, inputShape[4]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class MaxPooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'MaxPooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.registerClass(MaxPooling3D);\n\nexport class AveragePooling3D extends Pooling3D {\n /** @nocollapse */\n static className = 'AveragePooling3D';\n constructor(args: Pooling3DLayerArgs) {\n super(args);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number, number],\n strides: [number, number, number], padding: PaddingMode,\n dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool3d(\n inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.registerClass(AveragePooling3D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(args: LayerArgs) {\n super(args);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling1D';\n constructor(args?: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling1D);\n\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling1D';\n constructor(args: LayerArgs) {\n super(args || {});\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling1D);\n\nexport declare interface GlobalPooling2DLayerArgs extends LayerArgs {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(args: GlobalPooling2DLayerArgs) {\n super(args);\n this.dataFormat =\n args.dataFormat == null ? 'channelsLast' : args.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalAveragePooling2D);\n\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n /** @nocollapse */\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.registerClass(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common';\nimport {Kwargs} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\nexport declare interface WrapperLayerArgs extends LayerArgs {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(args: WrapperLayerArgs) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(args);\n this.layer = args.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.layer != null) {\n this.layer.setFastWeightInitDuringBuild(value);\n }\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\nexport class TimeDistributed extends Wrapper {\n /** @nocollapse */\n static className = 'TimeDistributed';\n constructor(args: WrapperLayerArgs) {\n super(args);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n // NOTE(cais): `layer.call` may return a length-1 array of Tensor in\n // some cases (e.g., `layer` is a `Sequential` instance), which is\n // why `getExactlyOneTensor` is used below.\n const output = getExactlyOneTensor(this.layer.call(inputs, kwargs));\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false /* goBackwards */, null /* mask */,\n null /* constants */, false /* unroll */,\n true /* needPerStepOutputs */);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n\n // TODO(cais): Implement detailed computeMask() logic.\n}\nserialization.registerClass(TimeDistributed);\n\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport declare interface BidirectionalLayerArgs extends WrapperLayerArgs {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are\n * combined. If `null` or `undefined`, the output will not be\n * combined, they will be returned as an `Array`.\n *\n * If `undefined` (i.e., not provided), defaults to `'concat'`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nconst DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat';\n\nexport class Bidirectional extends Wrapper {\n /** @nocollapse */\n static className = 'Bidirectional';\n mergeMode: BidirectionalMergeMode;\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(args: BidirectionalLayerArgs) {\n super(args);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call\n // `getConfig()` followed by `deserialize()`. Without this cloning,\n // the layer names saved during serialization will incorrectly contain\n // the 'forward_' prefix. In Python Keras, this is done using\n // `copy.copy` (shallow copy), which does not have a simple equivalent\n // in JavaScript. JavaScript's `Object.assign()` does not copy\n // methods.\n const layerConfig = args.layer.getConfig();\n const forwDict: serialization.ConfigDict = {};\n forwDict['className'] = args.layer.getClassName();\n forwDict['config'] = layerConfig;\n this.forwardLayer = deserialize(forwDict) as RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n const backDict: serialization.ConfigDict = {};\n backDict['className'] = args.layer.getClassName();\n backDict['config'] = layerConfig;\n this.backwardLayer = deserialize(backDict) as RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n\n this.mergeMode = args.mergeMode === undefined ?\n DEFAULT_BIDIRECTIONAL_MERGE_MODE :\n args.mergeMode;\n checkBidirectionalMergeMode(this.mergeMode);\n if (args.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = args.layer.stateful;\n this.returnSequences = args.layer.returnSequences;\n this.returnState = args.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = args.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to\n // this method differ in how the initial states are passed. For\n // symbolic calls, the initial states are passed in the first arg, as\n // an Array of SymbolicTensors; for non-symbolic calls, they are\n // passed in the second arg as a part of the kwargs. Hence the need to\n // temporarily modify inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.backwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = y.slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (Array.isArray(mask)) {\n mask = mask[0];\n }\n let outputMask: Tensor|Tensor[];\n if (this.returnSequences) {\n if (this.mergeMode == null) {\n outputMask = [mask, mask];\n } else {\n outputMask = mask;\n }\n } else {\n if (this.mergeMode == null) {\n outputMask = [null, null];\n } else {\n outputMask = null;\n }\n }\n if (this.returnState) {\n const states = this.forwardLayer.states;\n const stateMask: Tensor[] = states.map(state => null);\n if (Array.isArray(outputMask)) {\n return outputMask.concat(stateMask).concat(stateMask);\n } else {\n return [outputMask].concat(stateMask).concat(stateMask);\n }\n } else {\n return outputMask;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n setFastWeightInitDuringBuild(value: boolean) {\n super.setFastWeightInitDuringBuild(value);\n if (this.forwardLayer != null) {\n this.forwardLayer.setFastWeightInitDuringBuild(value);\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.setFastWeightInitDuringBuild(value);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n /** @nocollapse */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.registerClass(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {InputLayer, InputLayerArgs} from './engine/input_layer';\nimport {Layer, LayerArgs} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';\nimport {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';\nimport {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerArgs} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge';\nimport {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise';\nimport {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers';\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * An input layer is an entry point into a `tf.LayersModel`.\n *\n * `InputLayer` is generated automatically for `tf.Sequential`` models by\n * specifying the `inputshape` or `batchInputShape` for the first layer. It\n * should not be specified explicitly. However, it can be useful sometimes,\n * e.g., when constructing a sequential model from a subset of another\n * sequential model's layers. Like the code snippet below shows.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const model1 = tf.sequential();\n * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'}));\n * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n * model1.summary();\n * model1.predict(tf.zeros([1, 4])).print();\n *\n * // Construct another model, reusing the second layer of `model1` while\n * // not using the first layer of `model1`. Note that you cannot add the second\n * // layer of `model` directly as the first layer of the new sequential model,\n * // because doing so will lead to an error related to the fact that the layer\n * // is not an input layer. Instead, you need to create an `inputLayer` and add\n * // it to the new sequential model before adding the reused layer.\n * const model2 = tf.sequential();\n * // Use an inputShape that matches the input shape of `model1`'s second\n * // layer.\n * model2.add(tf.layers.inputLayer({inputShape: [3]}));\n * model2.add(model1.layers[1]);\n * model2.summary();\n * model2.predict(tf.zeros([1, 3])).print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'}\n */\nexport function inputLayer(args: InputLayerArgs) {\n return new InputLayer(args);\n}\n\n// Advanced Activation Layers.\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function elu(args?: ELULayerArgs) {\n return new ELU(args);\n}\n\n/**\n * Rectified Linear Unit activation function.\n *\n * Input shape:\n * Arbitrary. Use the config field `inputShape` (Array of integers, does\n * not include the sample axis) when using this layer as the first layer\n * in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function reLU(args?: ReLULayerArgs) {\n return new ReLU(args);\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function leakyReLU(args?: LeakyReLULayerArgs) {\n return new LeakyReLU(args);\n}\n\n/**\n * Parameterized version of a leaky rectified linear unit.\n *\n * It follows\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n * wherein `alpha` is a trainable weight.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function prelu(args?: PReLULayerArgs) {\n return new PReLU(args);\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function softmax(args?: SoftmaxLayerArgs) {\n return new Softmax(args);\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n *\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers'\n * }\n */\nexport function thresholdedReLU(args?: ThresholdedReLULayerArgs) {\n return new ThresholdedReLU(args);\n}\n\n// Convolutional Layers.\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv1d(args: ConvLayerArgs) {\n return new Conv1D(args);\n}\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2d(args: ConvLayerArgs) {\n return new Conv2D(args);\n}\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv2dTranspose(args: ConvLayerArgs) {\n return new Conv2DTranspose(args);\n}\n\n/**\n * 3D convolution layer (e.g. spatial convolution over volumes).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes\n * in `dataFormat='channelsLast'`.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function conv3d(args: ConvLayerArgs) {\n return new Conv3D(args);\n}\n\nexport function conv3dTranspose(args: ConvLayerArgs): Layer {\n return new Conv3DTranspose(args);\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function separableConv2d(args: SeparableConvLayerArgs) {\n return new SeparableConv2D(args);\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function cropping2D(args: Cropping2DLayerArgs) {\n return new Cropping2D(args);\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function upSampling2d(args: UpSampling2DLayerArgs) {\n return new UpSampling2D(args);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n *\n * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'}\n */\nexport function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) {\n return new DepthwiseConv2D(args);\n}\n\n// Basic Layers.\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function activation(args: ActivationLayerArgs) {\n return new Activation(args);\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dense(args: DenseLayerArgs) {\n return new Dense(args);\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function dropout(args: DropoutLayerArgs) {\n return new Dropout(args);\n}\n\n/**\n * Spatial 1D version of Dropout.\n *\n * This Layer type performs the same function as the Dropout layer, but it drops\n * entire 1D feature maps instead of individual elements. For example, if an\n * input example consists of 3 timesteps and the feature map for each timestep\n * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps\n * of the 1st timesteps and 2nd timesteps completely while sparing all feature\n * elements of the 3rd timestep.\n *\n * If adjacent frames (timesteps) are strongly correlated (as is normally the\n * case in early convolution layers), regular dropout will not regularize the\n * activation and will otherwise just result in merely an effective learning\n * rate decrease. In this case, `spatialDropout1d` will help promote\n * independence among feature maps and should be used instead.\n *\n * **Arguments:**\n * rate: A floating-point number >=0 and <=1. Fraction of the input elements\n * to drop.\n *\n * **Input shape:**\n * 3D tensor with shape `(samples, timesteps, channels)`.\n *\n * **Output shape:**\n * Same as the input shape.\n *\n * References:\n * - [Efficient Object Localization Using Convolutional\n * Networks](https://arxiv.org/abs/1411.4280)\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function spatialDropout1d(args: SpatialDropout1DLayerConfig) {\n return new SpatialDropout1D(args);\n}\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function flatten(args?: FlattenLayerArgs) {\n return new Flatten(args);\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function repeatVector(args: RepeatVectorLayerArgs) {\n return new RepeatVector(args);\n}\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary, although all dimensions in the input shape must be fixed.\n * Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function reshape(args: ReshapeLayerArgs) {\n return new Reshape(args);\n}\n\n/**\n * Permutes the dimensions of the input according to a given pattern.\n *\n * Useful for, e.g., connecting RNNs and convnets together.\n *\n * Example:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.permute({\n * dims: [2, 1],\n * inputShape: [10, 64]\n * }));\n * console.log(model.outputShape);\n * // Now model's output shape is [null, 64, 10], where null is the\n * // unpermuted sample (batch) dimension.\n * ```\n *\n * Input shape:\n * Arbitrary. Use the configuration field `inputShape` when using this\n * layer as the first layer in a model.\n *\n * Output shape:\n * Same rank as the input shape, but with the dimensions re-ordered (i.e.,\n * permuted) according to the `dims` configuration of this layer.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function permute(args: PermuteLayerArgs) {\n return new Permute(args);\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n *\n * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'}\n */\nexport function embedding(args: EmbeddingLayerArgs) {\n return new Embedding(args);\n}\n\n// Merge Layers.\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function add(args?: LayerArgs) {\n return new Add(args);\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function average(args?: LayerArgs) {\n return new Average(args);\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function concatenate(args?: ConcatenateLayerArgs) {\n return new Concatenate(args);\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function maximum(args?: LayerArgs) {\n return new Maximum(args);\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function minimum(args?: LayerArgs) {\n return new Minimum(args);\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function multiply(args?: LayerArgs) {\n return new Multiply(args);\n}\n\n/**\n * Layer that computes a dot product between samples in two tensors.\n *\n * E.g., if applied to a list of two tensors `a` and `b` both of shape\n * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`,\n * where each entry at index `[i, 0]` will be the dot product between\n * `a[i, :]` and `b[i, :]`.\n *\n * Example:\n *\n * ```js\n * const dotLayer = tf.layers.dot({axes: -1});\n * const x1 = tf.tensor2d([[10, 20], [30, 40]]);\n * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]);\n *\n * // Invoke the layer's apply() method in eager (imperative) mode.\n * const y = dotLayer.apply([x1, x2]);\n * y.print();\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}\n */\nexport function dot(args: DotLayerArgs) {\n return new Dot(args);\n}\n\n// Normalization Layers.\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function batchNormalization(args?: BatchNormalizationLayerArgs) {\n return new BatchNormalization(args);\n}\n\n/**\n * Layer-normalization layer (Ba et al., 2016).\n *\n * Normalizes the activations of the previous layer for each given example in a\n * batch independently, instead of across a batch like in `batchNormalization`.\n * In other words, this layer applies a transformation that maintanis the mean\n * activation within each example close to0 and activation variance close to 1.\n *\n * Input shape:\n * Arbitrary. Use the argument `inputShape` when using this layer as the first\n * layer in a model.\n *\n * Output shape:\n * Same as input.\n *\n * References:\n * - [Layer Normalization](https://arxiv.org/abs/1607.06450)\n *\n * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'}\n */\nexport function layerNormalization(args?: LayerNormalizationLayerArgs) {\n return new LayerNormalization(args);\n}\n\n// Padding Layers.\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n *\n * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'}\n */\nexport function zeroPadding2d(args?: ZeroPadding2DLayerArgs) {\n return new ZeroPadding2D(args);\n}\n\n// Pooling Layers.\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling1d(args: Pooling1DLayerArgs) {\n return new AveragePooling1D(args);\n}\nexport function avgPool1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(args: Pooling1DLayerArgs) {\n return averagePooling1d(args);\n}\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling2d(args: Pooling2DLayerArgs) {\n return new AveragePooling2D(args);\n}\nexport function avgPool2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(args: Pooling2DLayerArgs) {\n return averagePooling2d(args);\n}\n\n/**\n * Average pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 4D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function averagePooling3d(args: Pooling3DLayerArgs) {\n return new AveragePooling3D(args);\n}\nexport function avgPool3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling3d(args: Pooling3DLayerArgs) {\n return averagePooling3d(args);\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling1d(args?: LayerArgs) {\n return new GlobalAveragePooling1D(args);\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalAveragePooling2D(args);\n}\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling1d(args?: LayerArgs) {\n return new GlobalMaxPooling1D(args);\n}\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) {\n return new GlobalMaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling1d(args: Pooling1DLayerArgs) {\n return new MaxPooling1D(args);\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling2d(args: Pooling2DLayerArgs) {\n return new MaxPooling2D(args);\n}\n\n/**\n * Max pooling operation for 3D data.\n *\n * Input shape\n * - If `dataFormat === channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, depths, rows, cols, channels]`\n * - If `dataFormat === channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, depths, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=channelsLast`:\n * 5D tensor with shape:\n * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]`\n * - If `dataFormat=channelsFirst`:\n * 5D tensor with shape:\n * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]`\n *\n * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'}\n */\nexport function maxPooling3d(args: Pooling3DLayerArgs) {\n return new MaxPooling3D(args);\n}\n\n// Recurrent Layers.\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gru(args: GRULayerArgs) {\n return new GRU(args);\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function gruCell(args: GRUCellLayerArgs) {\n return new GRUCell(args);\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstm(args: LSTMLayerArgs) {\n return new LSTM(args);\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function lstmCell(args: LSTMCellLayerArgs) {\n return new LSTMCell(args);\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNN(args: SimpleRNNLayerArgs) {\n return new SimpleRNN(args);\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function simpleRNNCell(args: SimpleRNNCellLayerArgs) {\n return new SimpleRNNCell(args);\n}\n\n/**\n * Convolutional LSTM layer - Xingjian Shi 2015.\n *\n * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However,\n * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D`\n * operates on a sequence of inputs. The shape of the input (not including the\n * first, batch dimension) needs to be 4-D, with the first dimension being time\n * steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const batchSize = 4;\n * const sequenceLength = 2;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [batchSize, sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const layer = tf.layers.convLstm2d({filters, kernelSize});\n *\n * const output = layer.apply(input);\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2d(args: ConvLSTM2DArgs) {\n return new ConvLSTM2D(args);\n}\n\n/**\n * Cell class for `ConvLSTM2D`.\n *\n * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in\n * that its `call` method takes the input data of only a single time step and\n * returns the cell's output at the time step, while `ConvLSTM2D` takes the\n * input data over a number of time steps. For example:\n *\n * ```js\n * const filters = 3;\n * const kernelSize = 3;\n *\n * const sequenceLength = 1;\n * const size = 5;\n * const channels = 3;\n *\n * const inputShape = [sequenceLength, size, size, channels];\n * const input = tf.ones(inputShape);\n *\n * const cell = tf.layers.convLstm2dCell({filters, kernelSize});\n *\n * cell.build(input.shape);\n *\n * const outputSize = size - kernelSize + 1;\n * const outShape = [sequenceLength, outputSize, outputSize, filters];\n *\n * const initialH = tf.zeros(outShape);\n * const initialC = tf.zeros(outShape);\n *\n * const [o, h, c] = cell.call([input, initialH, initialC], {});\n * ```\n */\n/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */\nexport function convLstm2dCell(args: ConvLSTM2DCellArgs) {\n return new ConvLSTM2DCell(args);\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.resetStates()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function rnn(args: RNNLayerArgs) {\n return new RNN(args);\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n *\n * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}\n */\nexport function stackedRNNCells(args: StackedRNNCellsArgs){\n return new StackedRNNCells(args);\n}\n\n// Wrapper Layers.\n\n/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */\nexport function bidirectional(args: BidirectionalLayerArgs) {\n return new Bidirectional(args);\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'}\n */\nexport function timeDistributed(args: WrapperLayerArgs) {\n return new TimeDistributed(args);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, RNN, RNNCell, input /* alias for tf.input */};\n\n/**\n * Apply additive zero-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * This is useful to mitigate overfitting\n * (you could see it as a form of random data augmentation).\n * Gaussian Noise (GS) is a natural choice as corruption process\n * for real valued inputs.\n *\n * # Arguments\n * stddev: float, standard deviation of the noise distribution.\n *\n * # Input shape\n * Arbitrary. Use the keyword argument `input_shape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * # Output shape\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianNoise(args: GaussianNoiseArgs) {\n return new GaussianNoise(args);\n}\n\n/**\n * Apply multiplicative 1-centered Gaussian noise.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](\n * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function gaussianDropout(args: GaussianDropoutArgs) {\n return new GaussianDropout(args);\n}\n\n/**\n * Applies Alpha Dropout to the input.\n *\n * As it is a regularization layer, it is only active at training time.\n *\n * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs\n * to their original values, in order to ensure the self-normalizing property\n * even after this dropout.\n * Alpha Dropout fits well to Scaled Exponential Linear Units\n * by randomly setting activations to the negative saturation value.\n *\n * Arguments:\n * - `rate`: float, drop probability (as with `Dropout`).\n * The multiplicative noise will have\n * standard deviation `sqrt(rate / (1 - rate))`.\n * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the\n * shape for randomly generated keep/drop flags.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n *\n * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'}\n */\nexport function alphaDropout(args: AlphaDropoutArgs) {\n return new AlphaDropout(args);\n}\n\n/**\n * Masks a sequence by using a mask value to skip timesteps.\n *\n * If all features for a given sample timestep are equal to `mask_value`,\n * then the sample timestep will be masked (skipped) in all downstream layers\n * (as long as they support masking).\n *\n * If any downstream layer does not support masking yet receives such\n * an input mask, an exception will be raised.\n *\n * Arguments:\n * - `maskValue`: Either None or mask value to skip.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape`\n * (tuple of integers, does not include the samples axis)\n * when using this layer as the first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'}\n */\nexport function masking(args?: MaskingArgs) {\n return new Masking(args);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0], [1], [1], [1]]);\n * const y = tf.tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * Sparse categorical accuracy metric function.\n *\n * Example:\n * ```js\n *\n * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]);\n * const yPred = tf.tensor2d(\n * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]);\n * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred);\n * crossentropy.print();\n * ```\n *\n * @param yTrue True labels: indices.\n * @param yPred Predicted probabilities or logits.\n * @returns Accuracy tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.sparseCategoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * Computes the precision of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const precision = tf.metrics.precision(x, y);\n * precision.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Precision Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function precision(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.precision(yTrue, yPred);\n}\n\n/**\n * Computes the recall of the predictions with respect to the labels.\n *\n * Example:\n * ```js\n * const x = tf.tensor2d(\n * [\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [1, 0, 0, 0],\n * [0, 0, 1, 0]\n * ]\n * );\n *\n * const y = tf.tensor2d(\n * [\n * [0, 0, 1, 0],\n * [0, 1, 0, 0],\n * [0, 0, 0, 1],\n * [0, 1, 0, 0],\n * [0, 1, 0, 0]\n * ]\n * );\n *\n * const recall = tf.metrics.recall(x, y);\n * recall.print();\n * ```\n *\n * @param yTrue The ground truth values. Expected to be contain only 0-1 values.\n * @param yPred The predicted values. Expected to be contain only 0-1 values.\n * @return Recall Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function recall(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.recall(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n *\n * @doc {heading: 'Metrics', namespace: 'metrics'}\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nexport {modelFromJSON} from './models';\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers';\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1l2(config?: L1L2Args): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param args l1 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l1(config?: L1Args): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param args l2 config.\n *\n * @doc {heading: 'Regularizers', namespace: 'regularizers'}\n */\nexport function l2(config?: L2Args): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {LayersModel} from './engine/training';\nimport {NotImplementedError} from './errors';\nimport {Logs, resolveScalarsInLogs} from './logs';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: LayersModel = null;\n\n setModel(model: Container): void {\n if (!(model instanceof LayersModel)) {\n throw new Error('model must be a LayersModel, not some other Container');\n }\n this.model = model;\n }\n}\n\nexport interface EarlyStoppingCallbackArgs {\n /**\n * Quantity to be monitored.\n *\n * Defaults to 'val_loss'.\n */\n monitor?: string;\n\n /**\n * Minimum change in the monitored quantity to qualify as improvement,\n * i.e., an absolute change of less than `minDelta` will count as no\n * improvement.\n *\n * Defaults to 0.\n */\n minDelta?: number;\n\n /**\n * Number of epochs with no improvement after which training will be stopped.\n *\n * Defaults to 0.\n */\n patience?: number;\n\n /** Verbosity mode. */\n verbose?: number;\n\n /**\n * Mode: one of 'min', 'max', and 'auto'.\n * - In 'min' mode, training will be stopped when the quantity monitored has\n * stopped decreasing.\n * - In 'max' mode, training will be stopped when the quantity monitored has\n * stopped increasing.\n * - In 'auto' mode, the direction is inferred automatically from the name of\n * the monitored quantity.\n *\n * Defaults to 'auto'.\n */\n mode?: 'auto'|'min'|'max';\n\n /**\n * Baseline value of the monitored quantity.\n *\n * If specified, training will be stopped if the model doesn't show\n * improvement over the baseline.\n */\n baseline?: number;\n\n /**\n * Whether to restore model weights from the epoch with the best value\n * of the monitored quantity. If `False`, the model weights obtained at the\n * at the last step of training are used.\n *\n * **`True` is not supported yet.**\n */\n restoreBestWeights?: boolean;\n}\n\nfunction less(currVal: number, prevVal: number) {\n return currVal < prevVal;\n}\n\nfunction greater(currVal: number, prevVal: number) {\n return currVal > prevVal;\n}\n\n/**\n * A Callback that stops training when a monitored quantity has stopped\n * improving.\n */\nexport class EarlyStopping extends Callback {\n protected readonly monitor: string;\n protected readonly minDelta: number;\n protected readonly patience: number;\n protected readonly baseline: number;\n protected readonly verbose: number;\n protected readonly mode: 'auto'|'min'|'max';\n\n protected monitorFunc: (currVal: number, prevVal: number) => boolean;\n\n private wait: number;\n private stoppedEpoch: number;\n private best: number;\n\n constructor(args?: EarlyStoppingCallbackArgs) {\n super();\n if (args == null) {\n args = {};\n }\n if (args.restoreBestWeights) {\n throw new NotImplementedError(\n 'restoreBestWeights = True is not implemented in EarlyStopping yet.');\n }\n\n this.monitor = args.monitor || 'val_loss';\n this.minDelta = Math.abs(args.minDelta || 0);\n this.patience = args.patience || 0;\n this.verbose = args.verbose || 0;\n this.mode = args.mode || 'auto';\n this.baseline = args.baseline;\n\n if (['auto', 'min', 'max'].indexOf(this.mode) === -1) {\n console.warn(\n `EarlyStopping mode '${this.mode}' is invalid. ` +\n `Falling back to mode 'auto'.`);\n this.mode = 'auto';\n }\n\n if (this.mode === 'min') {\n this.monitorFunc = less;\n } else if (this.mode === 'max') {\n this.monitorFunc = greater;\n } else {\n // For mode === 'auto'.\n if (this.monitor.indexOf('acc') !== -1) {\n this.monitorFunc = greater;\n } else {\n this.monitorFunc = less;\n }\n }\n\n if (this.monitorFunc === less) {\n this.minDelta *= -1;\n }\n }\n\n async onTrainBegin(logs?: Logs) {\n this.wait = 0;\n this.stoppedEpoch = 0;\n if (this.baseline != null) {\n this.best = this.baseline;\n } else {\n this.best = this.monitorFunc === less ? Infinity : -Infinity;\n }\n }\n\n async onEpochEnd(epoch: number, logs?: Logs) {\n await resolveScalarsInLogs(logs);\n const current = this.getMonitorValue(logs);\n if (current == null) {\n return;\n }\n\n if (this.monitorFunc(current - this.minDelta, this.best)) {\n this.best = current;\n this.wait = 0;\n // TODO(cais): Logic for restoreBestWeights.\n } else {\n this.wait++;\n if (this.wait >= this.patience) {\n this.stoppedEpoch = epoch;\n this.model.stopTraining = true;\n }\n // TODO(cais): Logic for restoreBestWeights.\n }\n }\n\n async onTrainEnd(logs?: Logs) {\n if (this.stoppedEpoch > 0 && this.verbose) {\n console.log(`Epoch ${this.stoppedEpoch}: early stopping.`);\n }\n }\n\n private getMonitorValue(logs: Logs) {\n if (logs == null) {\n logs = {};\n }\n const monitorValue = logs[this.monitor];\n if (monitorValue == null) {\n console.warn(\n `Metric for EarlyStopping ${this.monitor} is not available. ` +\n `Available metrics are: ${Object.keys(logs)}`);\n }\n return monitorValue;\n }\n}\n\n/**\n * Factory function for a Callback that stops training when a monitored\n * quantity has stopped improving.\n *\n * Early stopping is a type of regularization, and protects model against\n * overfitting.\n *\n * The following example based on fake data illustrates how this callback\n * can be used during `tf.LayersModel.fit()`:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * units: 3,\n * activation: 'softmax',\n * kernelInitializer: 'ones',\n * inputShape: [2]\n * }));\n * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]);\n * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]);\n * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]);\n * model.compile(\n * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']});\n *\n * // Without the EarlyStopping callback, the val_acc value would be:\n * // 0.5, 0.5, 0.5, 0.5, ...\n * // With val_acc being monitored, training should stop after the 2nd epoch.\n * const history = await model.fit(xs, ys, {\n * epochs: 10,\n * validationData: [xsVal, ysVal],\n * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'})\n * });\n *\n * // Expect to see a length-2 array.\n * console.log(history.history.val_acc);\n * ```\n *\n * @doc {\n * heading: 'Callbacks',\n * namespace: 'callbacks'\n * }\n */\nexport function earlyStopping(args?: EarlyStoppingCallbackArgs) {\n return new EarlyStopping(args);\n}\n\nexport const callbacks = {earlyStopping};\n"],"names":["base.flatten","base.checkConversionForErrors","util.now","util.rightPad","util.arraysEqual","util.sizeFromShape","util.decodeString","util.assert","util.isString","util.encodeString","util.bytesPerElement","util.makeZerosTypedArray","util.isFunction","add","util.isValidDtype","conv_util.eitherStridesOrDilationsAreOne","util.isInt","util.assertShapesMatch","isFinite","isNaN","ones","conv_util.computePool2DInfo","round","axis_util.expandShapeToKeepDim","broadcast_util.assertAndGetBroadcastShape","broadcast_util.getReductionAxes","conv_util.tupleValuesAreOne","util.parseAxisParam","axis_util.getUndoAxesPermutation","backend","tslib_1.__extends","assert","unique","util","tidy","tfc.sqrt","tfc.sum","tfc.mul","serialization","tfc.clipByValue","tfc.div","tfc.add","tfc.relu","tensor1d","min","tfc.min","max","tfc.max","cast","expandDims","tile","flatten","math_utils.arrayProd","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.slice","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","tfc.randomNormal","dot","tfc.fused","gather","tfc.gather","square","elu","tfc.elu","tfc.abs","tfc.dropout","zeros","mul","scalar","randomUniform","K.randomNormal","truncatedNormal","eye","Identity","linalg","randomNormal","tfc.variable","generic_utils.toSnakeCase","generic_utils.singletonOrArray","generic_utils.toList","variable_utils.countParamsInWeights","types_utils.normalizeShapeList","dispose","div","keep","generic_utils.debounce","nextFrame","K.square","tfc.fill","tfc.maximum","tfc.mean","tfc.sub","tfc.log","tfc.softplus","tfc.softmax","tfc.neg","tfc.floor","K.flatten","tfc.oneHot","tfc.onesLike","K.cast","tfc.greater","tfc.equal","tfc.argMax","tfc.logicalAnd","tfc.where","binaryCrossentropy","lossBinaryCrossentropy","categoricalCrossentropy","categoricalCrossentropyLoss","sparseCategoricalCrossentropy","sparseCategoricalCrossentropyLoss","get","train","generic_utils.toCamelCase","memory","generic_utils.unique","generic_utils.assert","generic_utils.reverseNumberCompare","layersVersion","generic_utils.pyListRepeat","deserializeLayer","generic_utils.isObjectEmpty","tfc.util","tfc.Tensor","tfc.dispose","tfc.keep","tfc.tidy","Tensor","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","optimizers.getOptimizer","Optimizer","losses.get","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","Metrics.get","Metrics.getLossOrMetricName","K.sliceAlongFirstAxis","tfc.memory","io","K.elu","Elu","tfc.selu","Selu","Relu","tfc.minimum","Relu6","tfc.sigmoid","Sigmoid","K.hardSigmoid","Softplus","K.softsign","tfc.tanh","Tanh","Softmax","tfc.logSoftmax","LogSoftmax","sum","abs","relu","clipByValue","leakyRelu","prelu","softmaxActivation","tfc.transpose","tfc.conv1d","K.biasAdd","tfc.conv3d","generic_utils.assertPositiveInteger","generic_utils.checkArrayTypeAndLength","generic_utils.mapActivationToFusedKernel","Conv2D","Conv3D","tfc.conv2dTranspose","tfc.conv3dTranspose","tfc.separableConv2d","K.sliceAlongAxis","depthwiseConv2d","tfc.depthwiseConv2d","math_utils.range","tfc.expandDims","tfc.reverse","tfc.unstack","tfc.stack","tfc.zeros","K.expandDims","K.tile","math_utils.min","math_utils.max","K.dot","K.concatAlongFirstAxis","K.dropout","K.inTrainPhase","tfc.ones","K.concatenate","tfc.conv2d","tfc.serialization","tslib_1.__assign","K.batchFlatten","Activation","K.repeat","Reshape","transpose","any","notEqual","zerosLike","K.gather","mathUtils.max","mathUtils.arrayProd","mathUtils.range","Add","Multiply","Maximum","Minimum","tfc.all","greaterEqual","tfc.batchNorm2d","tfc.batchNorm3d","tfc.batchNorm4d","tfc.moments","tfc.pad","tfc.maxPool","tfc.avgPool","tfc.maxPool3d","tfc.avgPool3d","tfc.squeeze","generic_utils.checkStringTypeUnionValue","softmax","conv1d","conv2d","conv2dTranspose","separableConv2d","dropout","reshape","concatenate","maximum","minimum","batchNormalization","rnn","binaryAccuracy","metrics.binaryAccuracy","metrics.binaryCrossentropy","sparseCategoricalAccuracy","metrics.sparseCategoricalAccuracy","categoricalAccuracy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","precision","metrics.precision","recall","metrics.recall","cosineProximity","losses.cosineProximity","meanAbsoluteError","losses.meanAbsoluteError","meanAbsolutePercentageError","losses.meanAbsolutePercentageError","MAPE","mape","meanSquaredError","MSE","mse","l1","regularizers.l1","l2","regularizers.l2","less","greater"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,IAAI,CAAC;AA8BpC;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,CAAC;AAC3B,IAAI,QAAQ,CAAC,MAAM,EAAE;AACrB,QAAQ,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC7C,KAAK;AACL,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAC3C,KAAK;AACL,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,IAAI,CAAC,CAAC,EAAE;AACZ,QAAQ,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACzC,KAAK;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AAC;;ACtCnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA+PA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,CAAC,EAAE;AACvB,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC;;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,CAAC,EAAE;AACjB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAC9C,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AACM,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;ACtC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,CAAC,EAAE;AACtB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;AACnD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ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UAAU,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC;;ACrC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,CAAC,EAAE;AAClB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC/C,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AACM,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;;ACtCjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,CAAC,EAAE;AACnB,IAAI,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7B,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AACM,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;;ACtCnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;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;AACA;AACA;AAC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,IAAI,IAAI,EAAE;YAChB,IAAI,GAAG,EAAE,CAAC;SACX;QACD,IAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,OAAO,CAAC,IAAI,CACR,8BAA4B,IAAI,CAAC,OAAO,wBAAqB;iBAC7D,4BAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAG,CAAA,CAAC,CAAC;SACpD;QACD,OAAO,YAAY,CAAC;KACrB;IACH,oBAAC;AAAD,CAzGA,CAAmC,QAAQ,GAyG1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2CgB,aAAa,CAAC,IAAgC;IAC5D,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;IAEY,SAAS,GAAG,EAAC,aAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tsconfig.tsbuildinfo b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tsconfig.tsbuildinfo deleted file mode 100644 index aac5518a4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1,46061 +0,0 @@ -{ - "program": { - "fileInfos": { - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es5.d.ts": { - "version": "1f753cee573dea40df8a9dc873fef5566957b19ad513874f6643d8dfb14842d0", - "signature": "1f753cee573dea40df8a9dc873fef5566957b19ad513874f6643d8dfb14842d0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.d.ts": { - "version": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96", - "signature": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2016.d.ts": { - "version": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1", - "signature": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.d.ts": { - "version": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743", - "signature": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.d.ts": { - "version": "2edd3ddf436ef8e12df876dcae4ecd6a8748577944c477bf4b20d5596e0c9843", - "signature": "2edd3ddf436ef8e12df876dcae4ecd6a8748577944c477bf4b20d5596e0c9843" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.dom.d.ts": { - "version": "973df4e41aea3780ce77073777d37dd5896f684124f4c42409f3a832133837a4", - "signature": "973df4e41aea3780ce77073777d37dd5896f684124f4c42409f3a832133837a4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.core.d.ts": { - "version": "2a0390a665763bcc90f0670e43c587928d8fefe2a94a11209c1e22cba7b09f52", - "signature": "2a0390a665763bcc90f0670e43c587928d8fefe2a94a11209c1e22cba7b09f52" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.collection.d.ts": { - "version": "dd94d8ef48c562389eb58af8df3a3a34d11367f7c818192aa5f16470d469e3f0", - "signature": "dd94d8ef48c562389eb58af8df3a3a34d11367f7c818192aa5f16470d469e3f0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.generator.d.ts": { - "version": "828413486bdcaa342558e8e4570b1b287b776cb61b4b70b0214bd10c5d9a94c3", - "signature": "828413486bdcaa342558e8e4570b1b287b776cb61b4b70b0214bd10c5d9a94c3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.iterable.d.ts": { - "version": "6c9f73334f8bf47aea685ca5b46a8f7e992a223e96fbceb030f26a4d2324ba21", - "signature": "6c9f73334f8bf47aea685ca5b46a8f7e992a223e96fbceb030f26a4d2324ba21" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.promise.d.ts": { - "version": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2", - "signature": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.proxy.d.ts": { - "version": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe", - "signature": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.reflect.d.ts": { - "version": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976", - "signature": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.symbol.d.ts": { - "version": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230", - "signature": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { - "version": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303", - "signature": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2016.array.include.d.ts": { - "version": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0", - "signature": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.object.d.ts": { - "version": "ff8ad203e83338289b0f5defc1a5b5c253fb7d251b464db497383f915a0df3f4", - "signature": "ff8ad203e83338289b0f5defc1a5b5c253fb7d251b464db497383f915a0df3f4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { - "version": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f", - "signature": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.string.d.ts": { - "version": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c", - "signature": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.intl.d.ts": { - "version": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6", - "signature": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { - "version": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46", - "signature": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": { - "version": "42102aaeb1bfec213be1e9777466a6d551eeba8567fed18c0cdbca8c35e3c6e4", - "signature": "42102aaeb1bfec213be1e9777466a6d551eeba8567fed18c0cdbca8c35e3c6e4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.intl.d.ts": { - "version": "1b820b57379c726f94af50cd60053674af53ff9d079c1563cc70071e8b757dd0", - "signature": "1b820b57379c726f94af50cd60053674af53ff9d079c1563cc70071e8b757dd0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.promise.d.ts": { - "version": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62", - "signature": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.regexp.d.ts": { - "version": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8", - "signature": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.esnext.intl.d.ts": { - "version": "f6e0c89daaf72eac38dfb1d5ef0972183f7f26a68da15bfe5bcb7cfccf0c7db8", - "signature": "f6e0c89daaf72eac38dfb1d5ef0972183f7f26a68da15bfe5bcb7cfccf0c7db8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.esnext.bigint.d.ts": { - "version": "63b66918290d794f73832a6d0325be5026236674fe8c0cb0b68d162000d7bbe8", - "signature": "63b66918290d794f73832a6d0325be5026236674fe8c0cb0b68d162000d7bbe8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts": { - "version": "46aa64ffc74a2023fc61676fe443f427674b35c9f5202fdc12925a58b0f96881", - "signature": "46aa64ffc74a2023fc61676fe443f427674b35c9f5202fdc12925a58b0f96881" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": { - "version": "9c6270c22ed2fd502944edb4c73c4f9f6fb099f3dffc261742af0fbaf0c298e5", - "signature": "9c6270c22ed2fd502944edb4c73c4f9f6fb099f3dffc261742af0fbaf0c298e5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": { - "version": "bd755aadfff454a975ca3d84762a238443317440a739ad72d461c9dcc20d6315", - "signature": "bd755aadfff454a975ca3d84762a238443317440a739ad72d461c9dcc20d6315" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts": { - "version": "46eb8555f7562d27f0284e187c66375dfa466565f5a024540c3633c4b6c45ade", - "signature": "46eb8555f7562d27f0284e187c66375dfa466565f5a024540c3633c4b6c45ade" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": { - "version": "37886fa4c9c0b9e8f4e29ad4dcf2c2e6b650d500c5c177549ddd523a13f40299", - "signature": "37886fa4c9c0b9e8f4e29ad4dcf2c2e6b650d500c5c177549ddd523a13f40299" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": { - "version": "166ff3d6766067f70bb4a94d4cf7a309084089492a6c8ac6005f0431b7491980", - "signature": "166ff3d6766067f70bb4a94d4cf7a309084089492a6c8ac6005f0431b7491980" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": { - "version": "83d637d2b47af0be47ab3b047c62c1d58a7d30683a2620a775c9c155c56ca8bd", - "signature": "83d637d2b47af0be47ab3b047c62c1d58a7d30683a2620a775c9c155c56ca8bd" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": { - "version": "9ca6d52be56e7b1719c96e6823f8e03e5176b313cde1b1c37ea5569ecb2911ee", - "signature": "9ca6d52be56e7b1719c96e6823f8e03e5176b313cde1b1c37ea5569ecb2911ee" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": { - "version": "7ad65c44d024034a29b45f0fb1cd82027f765df4ad91a836edb13019c7cc05a9", - "signature": "7ad65c44d024034a29b45f0fb1cd82027f765df4ad91a836edb13019c7cc05a9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": { - "version": "5d4bce83c8c039b4323b388891f3faf85fb03c4b32badf3c04755edbd1308374", - "signature": "5d4bce83c8c039b4323b388891f3faf85fb03c4b32badf3c04755edbd1308374" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": { - "version": "3ee5f0b447d1dde52f0e1b45b17e07e059f85bf46cc883e0de1f7d22cf7e0157", - "signature": "3ee5f0b447d1dde52f0e1b45b17e07e059f85bf46cc883e0de1f7d22cf7e0157" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": { - "version": "de7baa577b8c83a6d4d6c5a32d882f2839dbabf7bb4a04675406307b403d5abc", - "signature": "de7baa577b8c83a6d4d6c5a32d882f2839dbabf7bb4a04675406307b403d5abc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": { - "version": "839d71de94b938163365c2402f68c8cd97527b77aa6bb4b16a7346bd04a70bc7", - "signature": "839d71de94b938163365c2402f68c8cd97527b77aa6bb4b16a7346bd04a70bc7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": { - "version": "e72298820cb11c7a6aae36b4e47b49859d9264b073d95266b814f93b5f718454", - "signature": "e72298820cb11c7a6aae36b4e47b49859d9264b073d95266b814f93b5f718454" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": { - "version": "99200727d5ba3db7d7ef5ae08581d09ab2cabafb08a79244c769eea33e9c6492", - "signature": "99200727d5ba3db7d7ef5ae08581d09ab2cabafb08a79244c769eea33e9c6492" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": { - "version": "98001c77050f27688a389a806fa7849f2315433af382b2f371a1a7fed0b292e0", - "signature": "98001c77050f27688a389a806fa7849f2315433af382b2f371a1a7fed0b292e0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": { - "version": "f812888e553ccf2d9408cd2d1c6aa98c978c577e1f5321df491f754ff11bc1e2", - "signature": "f812888e553ccf2d9408cd2d1c6aa98c978c577e1f5321df491f754ff11bc1e2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": { - "version": "05d0d19679586a95ac3d7859c26f27dd6bf3fcdb5f88adcab511b9c04eee8d26", - "signature": "05d0d19679586a95ac3d7859c26f27dd6bf3fcdb5f88adcab511b9c04eee8d26" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": { - "version": "af2ae3879b3a86e8a34d2c674e18b3a0bcb4504ce5b09636c31ec2f43017dc31", - "signature": "af2ae3879b3a86e8a34d2c674e18b3a0bcb4504ce5b09636c31ec2f43017dc31" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": { - "version": "f1882e3746a788d1f414cd87c1c0033dfb40debc11b80b492550652f023321bf", - "signature": "f1882e3746a788d1f414cd87c1c0033dfb40debc11b80b492550652f023321bf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": { - "version": "744647b3ddeec13aa5f2661a9bf5e072ddaf6c064dfcc2416b8ed3c8aa1ee5f2", - "signature": "744647b3ddeec13aa5f2661a9bf5e072ddaf6c064dfcc2416b8ed3c8aa1ee5f2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": { - "version": "387563640750ecfdd8b56b586b4b0798ce18da1f2a8afe844dbf1c462b88aea8", - "signature": "387563640750ecfdd8b56b586b4b0798ce18da1f2a8afe844dbf1c462b88aea8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": { - "version": "46947a1ecdb3edf95d8b9a57efc4e9ca39a1477997dfe198e4ffa80a256506ae", - "signature": "46947a1ecdb3edf95d8b9a57efc4e9ca39a1477997dfe198e4ffa80a256506ae" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": { - "version": "50fe9645e4eba88752608b6aefd21c7347f7a9abccb15e4fef4c9b6a413e2fcc", - "signature": "50fe9645e4eba88752608b6aefd21c7347f7a9abccb15e4fef4c9b6a413e2fcc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": { - "version": "bd9f822fd8e9f16d0603dadce0a6ea05983d0fea785cb602cea1386f9666978b", - "signature": "bd9f822fd8e9f16d0603dadce0a6ea05983d0fea785cb602cea1386f9666978b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": { - "version": "d51a44d1afcfd4638aaab82384847e5b88da7b73746e5ffe319f2718cfa91216", - "signature": "d51a44d1afcfd4638aaab82384847e5b88da7b73746e5ffe319f2718cfa91216" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": { - "version": "2360ed10ebccb78f8bb6ec31383706be73cac17e1461d282daff4d7ef3a3b0ff", - "signature": "2360ed10ebccb78f8bb6ec31383706be73cac17e1461d282daff4d7ef3a3b0ff" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": { - "version": "39cdbc5ab4bd5857ef31c1da13cdce3360f78800d018322e8a2f3c653d4bb85b", - "signature": "39cdbc5ab4bd5857ef31c1da13cdce3360f78800d018322e8a2f3c653d4bb85b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": { - "version": "87364ce9c2a44e0f2efee198c622af5fb8a2e16093ca3b1f25577a6dd9e6f6fb", - "signature": "87364ce9c2a44e0f2efee198c622af5fb8a2e16093ca3b1f25577a6dd9e6f6fb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": { - "version": "3855c1a5dd5d4c2b26af99030d2812981d3952e23c55f2327cd393e2d082fe23", - "signature": "3855c1a5dd5d4c2b26af99030d2812981d3952e23c55f2327cd393e2d082fe23" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts": { - "version": "6fbfb7e78de77b645bd9c40030c07abe7647d001e7f0c069bb7a33e6f9f31b1a", - "signature": "6fbfb7e78de77b645bd9c40030c07abe7647d001e7f0c069bb7a33e6f9f31b1a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": { - "version": "4a05690f4f0f7ecf0bf9fd9847833f0c75a209835f156efe184efa4b2954aad8", - "signature": "4a05690f4f0f7ecf0bf9fd9847833f0c75a209835f156efe184efa4b2954aad8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": { - "version": "3e6823951be7cd1589ea8f439803ffd5db6066012e6f1009e580dd64e5ceef44", - "signature": "3e6823951be7cd1589ea8f439803ffd5db6066012e6f1009e580dd64e5ceef44" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": { - "version": "71a759231eaed7da76deaeec72584243dd03b3b2fa2ede30cb628ba0b624e901", - "signature": "71a759231eaed7da76deaeec72584243dd03b3b2fa2ede30cb628ba0b624e901" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": { - "version": "1dccee149020f2e3cc35ae782c6e6d97a5edaf1e87002a5a7bd15474e9e1a554", - "signature": "1dccee149020f2e3cc35ae782c6e6d97a5edaf1e87002a5a7bd15474e9e1a554" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/version.d.ts": { - "version": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": { - "version": "3ad2f8df17e95c8e942a08c6877044f2cce4a018190e458ba1bc5f11c3fa9e76", - "signature": "3ad2f8df17e95c8e942a08c6877044f2cce4a018190e458ba1bc5f11c3fa9e76" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": { - "version": "7d5ee92406c6d72cad7eeb5d2cbc179185470eb9c7facb460c1c1c074a06118f", - "signature": "7d5ee92406c6d72cad7eeb5d2cbc179185470eb9c7facb460c1c1c074a06118f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": { - "version": "b7cc9c8939f0f9a10c9bfa0bfb7089ed048a93453c7e6c0a358263fddf914b8d", - "signature": "b7cc9c8939f0f9a10c9bfa0bfb7089ed048a93453c7e6c0a358263fddf914b8d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": { - "version": "bbe6bf6957271a185e1e3d8277c7a428b19bd9c9ec0dc804019e475609c90ecf", - "signature": "bbe6bf6957271a185e1e3d8277c7a428b19bd9c9ec0dc804019e475609c90ecf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": { - "version": "a271e976d69e21ab7cb6c221aa87ee6075e4efe7ede0b300a34f26d1425e2a6d", - "signature": "a271e976d69e21ab7cb6c221aa87ee6075e4efe7ede0b300a34f26d1425e2a6d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": { - "version": "a526cbdb8a9d4f6a7a9755922c85d5a8feeae49e476db26d50cd0cbd217b3a75", - "signature": "a526cbdb8a9d4f6a7a9755922c85d5a8feeae49e476db26d50cd0cbd217b3a75" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": { - "version": "9d99cfcec5c201212c1160bb8f7d0f931a618b917ca3e468bcc8613b6d571565", - "signature": "9d99cfcec5c201212c1160bb8f7d0f931a618b917ca3e468bcc8613b6d571565" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": { - "version": "fe9c3f5a65501accc1253a86e1547111a23fee26396ac24c1e02d1d606b7b296", - "signature": "fe9c3f5a65501accc1253a86e1547111a23fee26396ac24c1e02d1d606b7b296" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": { - "version": "9e9e810595867a84fa0ef7e72a53bb4d9895f09640b972263729eef7bba93101", - "signature": "9e9e810595867a84fa0ef7e72a53bb4d9895f09640b972263729eef7bba93101" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": { - "version": "8b529d7700246abd74c27e726f25208c90099cbe8a6223e274a897e5cde09168", - "signature": "8b529d7700246abd74c27e726f25208c90099cbe8a6223e274a897e5cde09168" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": { - "version": "1c5d6481a5edaa76aed6044202de7839a6969c20c87ad39796d93da9ac313eac", - "signature": "1c5d6481a5edaa76aed6044202de7839a6969c20c87ad39796d93da9ac313eac" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": { - "version": "c06f17c10437887aacbeefea50ade0a2bf1827e9aca3ccb8bdf5ad8d2bab8f8e", - "signature": "c06f17c10437887aacbeefea50ade0a2bf1827e9aca3ccb8bdf5ad8d2bab8f8e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": { - "version": "16255eefce61ab566f106c8644f9379a2994293ef9eec51b9b9ecfbf5e0474b6", - "signature": "16255eefce61ab566f106c8644f9379a2994293ef9eec51b9b9ecfbf5e0474b6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": { - "version": "70e9b3d95493df68655cbc2269d625ef13d95c2bf61011497df857319063a533", - "signature": "70e9b3d95493df68655cbc2269d625ef13d95c2bf61011497df857319063a533" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": { - "version": "41aee4b49ff23d473076865f29ce1a5f699804bbf1af38780db1b92bcbaec0b7", - "signature": "41aee4b49ff23d473076865f29ce1a5f699804bbf1af38780db1b92bcbaec0b7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": { - "version": "c30164e2cd8babba16cad34d0cede15e7ffc592fc6500357b9003591330fa387", - "signature": "c30164e2cd8babba16cad34d0cede15e7ffc592fc6500357b9003591330fa387" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": { - "version": "1756398317f965b0b480dee48b19009c1fd9f4a7c3403f3a45e37619e649c726", - "signature": "1756398317f965b0b480dee48b19009c1fd9f4a7c3403f3a45e37619e649c726" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": { - "version": "22049afccdb7f88e4ee8d98003c9470634b2cbeb844c369de7d7f98bce498ce1", - "signature": "22049afccdb7f88e4ee8d98003c9470634b2cbeb844c369de7d7f98bce498ce1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": { - "version": "c5d41708554b67eaf4d5afb66b281d89192466129ae84aad5efcc026defe310a", - "signature": "c5d41708554b67eaf4d5afb66b281d89192466129ae84aad5efcc026defe310a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": { - "version": "6705de067a5dcaaf5774ac8e4e58fe2096b873133d4c8288af005dce6346fbc9", - "signature": "6705de067a5dcaaf5774ac8e4e58fe2096b873133d4c8288af005dce6346fbc9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": { - "version": "fa35fc2d299ae5a21efb116b1d6e3a8dcb94e5ccd1599282491442d9224b84c9", - "signature": "fa35fc2d299ae5a21efb116b1d6e3a8dcb94e5ccd1599282491442d9224b84c9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": { - "version": "5eebeacdef0d21c0826bee2f245bb2c176c4a865581cd6cfa0e5da896be588d5", - "signature": "5eebeacdef0d21c0826bee2f245bb2c176c4a865581cd6cfa0e5da896be588d5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": { - "version": "339f35c841141467b641e173bb2870c353ef41b9864b6b5437d22b47b43aedbc", - "signature": "339f35c841141467b641e173bb2870c353ef41b9864b6b5437d22b47b43aedbc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": { - "version": "4779f347053b580e22586d955898d393f8790f0e1612e608ae3f53d3ec67cd98", - "signature": "4779f347053b580e22586d955898d393f8790f0e1612e608ae3f53d3ec67cd98" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": { - "version": "cb7c2a998a0a8205b702a71ddaaf64c8693a54b3f381c089c0f085b59634ca89", - "signature": "cb7c2a998a0a8205b702a71ddaaf64c8693a54b3f381c089c0f085b59634ca89" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": { - "version": "bd35a19b9b71b2e7c3e1f5f619fb1c75955223bd32f5a9e1478e208377a17525", - "signature": "bd35a19b9b71b2e7c3e1f5f619fb1c75955223bd32f5a9e1478e208377a17525" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": { - "version": "ffa4d5d173432ca8701eaa7635a02803d470e81e0b352bc82bf26100fa1f1067", - "signature": "ffa4d5d173432ca8701eaa7635a02803d470e81e0b352bc82bf26100fa1f1067" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": { - "version": "894504eb4eb70a3166a70257958965778d83c6a37936d0750f4faff297b1142b", - "signature": "894504eb4eb70a3166a70257958965778d83c6a37936d0750f4faff297b1142b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": { - "version": "7e3c55b68d42b5f39d32e067713cc85e4ae7116effa9e447e31cc00506ebf963", - "signature": "7e3c55b68d42b5f39d32e067713cc85e4ae7116effa9e447e31cc00506ebf963" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": { - "version": "d3ec33f64f7fbc36fd90e1c99033355fd07692315cbe929370912b6c5d16be5c", - "signature": "d3ec33f64f7fbc36fd90e1c99033355fd07692315cbe929370912b6c5d16be5c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": { - "version": "6357cdab9aea5171cda9cc358bb3ddbb07e0b032ced4f613c65eb40b946c0b5b", - "signature": "6357cdab9aea5171cda9cc358bb3ddbb07e0b032ced4f613c65eb40b946c0b5b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": { - "version": "5b4cc9623078814ec76d1b5963732795832004e051a615f8cb7687ab6eed6617", - "signature": "5b4cc9623078814ec76d1b5963732795832004e051a615f8cb7687ab6eed6617" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": { - "version": "827e6bbc08cb73b35752331a18ff6692aaa22b564be9498b8e137a80e25c6c31", - "signature": "827e6bbc08cb73b35752331a18ff6692aaa22b564be9498b8e137a80e25c6c31" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": { - "version": "569161c1629b6e22081a2e5f2551e6bc50243ebe3246bf6342916b1ceffa0b69", - "signature": "569161c1629b6e22081a2e5f2551e6bc50243ebe3246bf6342916b1ceffa0b69" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": { - "version": "cae32150a86f1cd3e202e9b9033ae4e8203d0b36e207fc61017060213f1d830f", - "signature": "cae32150a86f1cd3e202e9b9033ae4e8203d0b36e207fc61017060213f1d830f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": { - "version": "901cb6f2c15e727dd5a4de0dfb07947abd1ae45954fde1678ca91f40ff561d9d", - "signature": "901cb6f2c15e727dd5a4de0dfb07947abd1ae45954fde1678ca91f40ff561d9d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": { - "version": "aac14cd580be19a56a1b5fad155234e80b38a258fa3b226ae9a0fa17cad9fee6", - "signature": "aac14cd580be19a56a1b5fad155234e80b38a258fa3b226ae9a0fa17cad9fee6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": { - "version": "194a8e7094c100be87a02adbc417bc5b3f42cbcbc937addc374bc0469af5cf5c", - "signature": "194a8e7094c100be87a02adbc417bc5b3f42cbcbc937addc374bc0469af5cf5c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": { - "version": "6b10cddafdca8e194cec8dc221edc207841565c51f27398b53b9999a8e102dc9", - "signature": "6b10cddafdca8e194cec8dc221edc207841565c51f27398b53b9999a8e102dc9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": { - "version": "8e18ec88d94bcc4df19667abda6d7c71c50c7e096fb13c26cc01636b4c91acca", - "signature": "8e18ec88d94bcc4df19667abda6d7c71c50c7e096fb13c26cc01636b4c91acca" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": { - "version": "47e9925a0bda0783ed82ca50178ca9124bbf1c59eb022b875914faabc68bbceb", - "signature": "47e9925a0bda0783ed82ca50178ca9124bbf1c59eb022b875914faabc68bbceb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": { - "version": "c6df7049fbfd24716b3ab81373da8113e8b207aa1260704772e0e0352af058b5", - "signature": "c6df7049fbfd24716b3ab81373da8113e8b207aa1260704772e0e0352af058b5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": { - "version": "79a59d49d7e1d1e6671f6dedfe2d1c01a72b22622c2deffa65f107c4ffc6bb8a", - "signature": "79a59d49d7e1d1e6671f6dedfe2d1c01a72b22622c2deffa65f107c4ffc6bb8a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": { - "version": "668d5ce1b96bbadb9574109bd09a8947b373e7c0b1261e8f3a591a842f9535ec", - "signature": "668d5ce1b96bbadb9574109bd09a8947b373e7c0b1261e8f3a591a842f9535ec" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts": { - "version": "7797f67cf7ea748c3d89c4bf68e47329de863c45ac1b4a8babf93ef340211c03", - "signature": "7797f67cf7ea748c3d89c4bf68e47329de863c45ac1b4a8babf93ef340211c03" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": { - "version": "1a6dbdf9a3282648e5b69803930bc17ae48d30602bd0343fb233842e2c5ec13d", - "signature": "1a6dbdf9a3282648e5b69803930bc17ae48d30602bd0343fb233842e2c5ec13d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": { - "version": "8596a7a142dea1bea54e04807798732c0f32c06e5c8db961679ad36a45de87c4", - "signature": "8596a7a142dea1bea54e04807798732c0f32c06e5c8db961679ad36a45de87c4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": { - "version": "91428bd4c9e53e80926399a471083fca8a3aefcc246b1ec32ea7ad6f566ee04f", - "signature": "91428bd4c9e53e80926399a471083fca8a3aefcc246b1ec32ea7ad6f566ee04f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": { - "version": "e23d3e950518660f9c1ff36f8c602680b8ca6a296d2b88a5877e91a15d155c3c", - "signature": "e23d3e950518660f9c1ff36f8c602680b8ca6a296d2b88a5877e91a15d155c3c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": { - "version": "f0a4ed7088f531861c37d8e28a68f6151f0f66858c0ad7475e492fdff1ce59c2", - "signature": "f0a4ed7088f531861c37d8e28a68f6151f0f66858c0ad7475e492fdff1ce59c2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": { - "version": "ec8ae98ff590c7141fa1a4ad5c0b14785d72df2ed3b4f6bbda0b2d580e6bafd6", - "signature": "ec8ae98ff590c7141fa1a4ad5c0b14785d72df2ed3b4f6bbda0b2d580e6bafd6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": { - "version": "663c3c4217f491c54399fd7264bf1659c06c5bc81c0afaddf9fb3fc85bc1afb8", - "signature": "663c3c4217f491c54399fd7264bf1659c06c5bc81c0afaddf9fb3fc85bc1afb8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": { - "version": "7712abbb1c799ffe2ea2ffe2775bee5035269946782d1b6d47133d70d37f760d", - "signature": "7712abbb1c799ffe2ea2ffe2775bee5035269946782d1b6d47133d70d37f760d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": { - "version": "875b34fb02921f1da3fd8a0aa8af6748403ba5b99d18533b231b6192c1ffa06e", - "signature": "875b34fb02921f1da3fd8a0aa8af6748403ba5b99d18533b231b6192c1ffa06e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": { - "version": "fb131aa84671acc5be60d18087cc561b05c8e76aae83d7ff0d3874edc587eca1", - "signature": "fb131aa84671acc5be60d18087cc561b05c8e76aae83d7ff0d3874edc587eca1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": { - "version": "8984dc4755bd4fe87b07e024cb17cd89829feed1bc67309e32087e67f688b1b0", - "signature": "8984dc4755bd4fe87b07e024cb17cd89829feed1bc67309e32087e67f688b1b0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": { - "version": "72d01272d1d9a552ef5f9217c7f1645eef0fab09bc4552884260dd73999662af", - "signature": "72d01272d1d9a552ef5f9217c7f1645eef0fab09bc4552884260dd73999662af" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": { - "version": "1cfa001ae9518c1d0337b2c4a32ef85c41ca9578b6e149d925eb2c030be4ae80", - "signature": "1cfa001ae9518c1d0337b2c4a32ef85c41ca9578b6e149d925eb2c030be4ae80" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": { - "version": "824b7ffebbb8111dfa95e4967916ab829c6c9bca9d68b159b61774dcd341a648", - "signature": "824b7ffebbb8111dfa95e4967916ab829c6c9bca9d68b159b61774dcd341a648" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": { - "version": "ebb83385012262cb8dfa03c27b27de50553d3b4d2dfc95d246a131a8a58c6b9f", - "signature": "ebb83385012262cb8dfa03c27b27de50553d3b4d2dfc95d246a131a8a58c6b9f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": { - "version": "6dcfc441590a142aaa7be977184369e815ee90087edda9d07e19aeb2235853a8", - "signature": "6dcfc441590a142aaa7be977184369e815ee90087edda9d07e19aeb2235853a8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": { - "version": "d88ed767104aa99dff1dd1bc8f6d6d37af212bdca3588440d4f61ca9fe626ea4", - "signature": "d88ed767104aa99dff1dd1bc8f6d6d37af212bdca3588440d4f61ca9fe626ea4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": { - "version": "1780577c9491f3a2aeccdf4a88c07a284264a4b8590a732d3ef7f726c6058795", - "signature": "1780577c9491f3a2aeccdf4a88c07a284264a4b8590a732d3ef7f726c6058795" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": { - "version": "cc6e1ce514759a6c6ce4fe2967236f878a64b6255bb4f6ee286ac180ece01507", - "signature": "cc6e1ce514759a6c6ce4fe2967236f878a64b6255bb4f6ee286ac180ece01507" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": { - "version": "8e832f1f5d4a6577670922b6668d13f247d4ce7d6d6a3b71a2da59d20b7bf8dd", - "signature": "8e832f1f5d4a6577670922b6668d13f247d4ce7d6d6a3b71a2da59d20b7bf8dd" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": { - "version": "d2b258cc70d8f3dd4e005333df31bf080d4ab5a0e2faf07be755c8fd13d4a816", - "signature": "d2b258cc70d8f3dd4e005333df31bf080d4ab5a0e2faf07be755c8fd13d4a816" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": { - "version": "4222d1f1d996ad0b3015b48a5fa8135ba0b879ae259a9ad36d9efd46fa517d32", - "signature": "4222d1f1d996ad0b3015b48a5fa8135ba0b879ae259a9ad36d9efd46fa517d32" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": { - "version": "42a740be26ba9fe4363692a71ae8f7dc0238ee788d4710b4752f761a6fa687ef", - "signature": "42a740be26ba9fe4363692a71ae8f7dc0238ee788d4710b4752f761a6fa687ef" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": { - "version": "e726f54782f4907b65d6221cc70c3059a0b0c9f4d268d7c5839852a5ef3b602f", - "signature": "e726f54782f4907b65d6221cc70c3059a0b0c9f4d268d7c5839852a5ef3b602f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": { - "version": "cb1ffe61516790216eaa7159d1a6fd67bf7be3ddc8fdb6b363c1bcf21f7e08d4", - "signature": "cb1ffe61516790216eaa7159d1a6fd67bf7be3ddc8fdb6b363c1bcf21f7e08d4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": { - "version": "379034b8279605f9da9812e64ba7fed5255e60283301061b7eb483fe126c336a", - "signature": "379034b8279605f9da9812e64ba7fed5255e60283301061b7eb483fe126c336a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": { - "version": "cdaff7682592fd3369e8cf469c7bd8008fae74ad52f342a89c2783e08825a096", - "signature": "cdaff7682592fd3369e8cf469c7bd8008fae74ad52f342a89c2783e08825a096" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": { - "version": "066e4314ca2638dc25433297482a2abfe178af3a472f03b2ebde5240dd833f27", - "signature": "066e4314ca2638dc25433297482a2abfe178af3a472f03b2ebde5240dd833f27" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": { - "version": "42a1203441188acfe6b7dd3fbd25b969ee81f9540730d6c17f1b389881900bb5", - "signature": "42a1203441188acfe6b7dd3fbd25b969ee81f9540730d6c17f1b389881900bb5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": { - "version": "b2e4131104512db5eed7a93ad5dad2e3d4cc4e3d55e938aaaec58d4f23558d91", - "signature": "b2e4131104512db5eed7a93ad5dad2e3d4cc4e3d55e938aaaec58d4f23558d91" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": { - "version": "3c16d2e404e4cfd0d73f1a81f9fe283360687f5e27a68187f3b6c38facb4e481", - "signature": "3c16d2e404e4cfd0d73f1a81f9fe283360687f5e27a68187f3b6c38facb4e481" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": { - "version": "ba97f4a93db0f07b6bc41dda3190125f18e18268d505e5e3d6edcefcdce015f1", - "signature": "ba97f4a93db0f07b6bc41dda3190125f18e18268d505e5e3d6edcefcdce015f1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": { - "version": "744be6da3fe8830a7b7c258ddb898dae49f1ec04b0a5d00cb5742509cb0acfe5", - "signature": "744be6da3fe8830a7b7c258ddb898dae49f1ec04b0a5d00cb5742509cb0acfe5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": { - "version": "baa1a420a9bbb0e9a0943159e7d9efcb11cfbdcd93fc11a0e2eedf07daf2abc5", - "signature": "baa1a420a9bbb0e9a0943159e7d9efcb11cfbdcd93fc11a0e2eedf07daf2abc5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": { - "version": "23ac3138bb0a278db32d791ee4b518294ba175729df13ea4483a9161612882b5", - "signature": "23ac3138bb0a278db32d791ee4b518294ba175729df13ea4483a9161612882b5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": { - "version": "06cff0171cc90c909e85138ae31872a0a816a8daed69b3cb5049a6e65ed3ba97", - "signature": "06cff0171cc90c909e85138ae31872a0a816a8daed69b3cb5049a6e65ed3ba97" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": { - "version": "368983493cf721eb101a702dd38dd03084ccd3f3270bfabdbd500e1d28bd4bb7", - "signature": "368983493cf721eb101a702dd38dd03084ccd3f3270bfabdbd500e1d28bd4bb7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": { - "version": "78e4622dc5567296ced4d1461f3ea2797199ce7ebc5d98139b6ebeb218e5cce1", - "signature": "78e4622dc5567296ced4d1461f3ea2797199ce7ebc5d98139b6ebeb218e5cce1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": { - "version": "286749c3b87f1cce55c0c2cc5fe151dc259ba28c67b725f4f0227ef5d63619ee", - "signature": "286749c3b87f1cce55c0c2cc5fe151dc259ba28c67b725f4f0227ef5d63619ee" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": { - "version": "f888fd86a4e579950d9bd2c8a23aa09c0d7fad4b3a67d033b7ba18c71b3390ea", - "signature": "f888fd86a4e579950d9bd2c8a23aa09c0d7fad4b3a67d033b7ba18c71b3390ea" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": { - "version": "ebc24e879d7398024f1ba998b9deba1a6136b04064365aa3259ee0901659c8d3", - "signature": "ebc24e879d7398024f1ba998b9deba1a6136b04064365aa3259ee0901659c8d3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": { - "version": "4f9cd4ef48f1b0a9b6e0e285fcb04538433251c80b112103963dd001baee6f75", - "signature": "4f9cd4ef48f1b0a9b6e0e285fcb04538433251c80b112103963dd001baee6f75" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": { - "version": "af40b15084aa592c493c4acfd14f6cec29413be167acab49d38d260659752878", - "signature": "af40b15084aa592c493c4acfd14f6cec29413be167acab49d38d260659752878" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": { - "version": "4c1a3ca35ed1621c48cbcda0a4da6e3cecde825e3e674b2f4784aa4bf854698f", - "signature": "4c1a3ca35ed1621c48cbcda0a4da6e3cecde825e3e674b2f4784aa4bf854698f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": { - "version": "dab0057b7b8848c8eb82916adafe6c5f3bcb7663967fdf315cf56c46bd9a7057", - "signature": "dab0057b7b8848c8eb82916adafe6c5f3bcb7663967fdf315cf56c46bd9a7057" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": { - "version": "561ad70cac8d1db528b0dd915cebd5218b953a1aab250a0a3a3f961fe014e230", - "signature": "561ad70cac8d1db528b0dd915cebd5218b953a1aab250a0a3a3f961fe014e230" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": { - "version": "011e1e8c0ec904dee10949f2a0ab5894c425dbb6451c13fe86838820d3667004", - "signature": "011e1e8c0ec904dee10949f2a0ab5894c425dbb6451c13fe86838820d3667004" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": { - "version": "8e5f8394da4118e380e9cd16e779282b050da57c48b335dc7190a72a1bc2694a", - "signature": "8e5f8394da4118e380e9cd16e779282b050da57c48b335dc7190a72a1bc2694a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": { - "version": "364f253cd5305be0242d5033549adaad4dfbef54e5d5a6ab47d6dd70d9dca90c", - "signature": "364f253cd5305be0242d5033549adaad4dfbef54e5d5a6ab47d6dd70d9dca90c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": { - "version": "d0365fd9f98f0eb2795f1f1047a3fc45102cb187b89ec656a71e2eb7de42c985", - "signature": "d0365fd9f98f0eb2795f1f1047a3fc45102cb187b89ec656a71e2eb7de42c985" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": { - "version": "69f4f666d06fd4f45200530d787add6c599d97b0cd21fde2540c49125598f200", - "signature": "69f4f666d06fd4f45200530d787add6c599d97b0cd21fde2540c49125598f200" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": { - "version": "4dfde4033f71c7220a3b138e995cace7a0885fbc35abe15766f9ca7c7c9d8418", - "signature": "4dfde4033f71c7220a3b138e995cace7a0885fbc35abe15766f9ca7c7c9d8418" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": { - "version": "850dc81d0a5553866f5cddd34458f957292ac1d4eb48b92c2f2fa8a67fb70389", - "signature": "850dc81d0a5553866f5cddd34458f957292ac1d4eb48b92c2f2fa8a67fb70389" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": { - "version": "a8574338c328285539f999a2ec5def0ae4c0dfaf44019418b62b6cdde91500ac", - "signature": "a8574338c328285539f999a2ec5def0ae4c0dfaf44019418b62b6cdde91500ac" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": { - "version": "e00dc8e8276e9043fd7de97fbe071b754da3865646577fe08f0734e77bb03cc0", - "signature": "e00dc8e8276e9043fd7de97fbe071b754da3865646577fe08f0734e77bb03cc0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": { - "version": "d108ba371b6ea1ceac47680f5b351797723f76b829e63b6568e597adbde49707", - "signature": "d108ba371b6ea1ceac47680f5b351797723f76b829e63b6568e597adbde49707" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": { - "version": "0d22fbb779a85d2d2114e2477cdb45e242bd28168bf2199327d30269ffc3a61f", - "signature": "0d22fbb779a85d2d2114e2477cdb45e242bd28168bf2199327d30269ffc3a61f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": { - "version": "8889652d8c2e86303c5325b5428abf98e4eaa6367ddb7eb6fb6996fe10093ab4", - "signature": "8889652d8c2e86303c5325b5428abf98e4eaa6367ddb7eb6fb6996fe10093ab4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": { - "version": "c77837ff406cd4d525d0d98329af3989f653f8a87abbcfc1dbe2cd4ba3d8b378", - "signature": "c77837ff406cd4d525d0d98329af3989f653f8a87abbcfc1dbe2cd4ba3d8b378" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": { - "version": "7ea8082c2b75c74d87c52b5cd9cec64fb67ddb44eea801b2b879c44549dcceed", - "signature": "7ea8082c2b75c74d87c52b5cd9cec64fb67ddb44eea801b2b879c44549dcceed" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": { - "version": "0fb1cc243f0ba9e1e8d9a8bbeb2302bf8820432120e0ed7689e1dfff203113d2", - "signature": "0fb1cc243f0ba9e1e8d9a8bbeb2302bf8820432120e0ed7689e1dfff203113d2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": { - "version": "e19ed70d4cd396a5b432104090e26d94e620ef03a7675e0120978a9b0c91bec5", - "signature": "e19ed70d4cd396a5b432104090e26d94e620ef03a7675e0120978a9b0c91bec5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": { - "version": "7845d766a8ee4bca373e30c89de2ccf608339342b510f799ba66d9fd0536a766", - "signature": "7845d766a8ee4bca373e30c89de2ccf608339342b510f799ba66d9fd0536a766" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": { - "version": "df2ecfd53876192b22b74707b40384d8ec8778064f1552977eff479cb71b2de1", - "signature": "df2ecfd53876192b22b74707b40384d8ec8778064f1552977eff479cb71b2de1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": { - "version": "117c002184b040063a5e77f289888f90c015947084a03f56bcb8ea404e33d881", - "signature": "117c002184b040063a5e77f289888f90c015947084a03f56bcb8ea404e33d881" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": { - "version": "f89452d3ca3aea0f65469f61a401d0e397e036583cff57daee99daf392bfa584", - "signature": "f89452d3ca3aea0f65469f61a401d0e397e036583cff57daee99daf392bfa584" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": { - "version": "6e059447d70226f3ff83431c714afdf5d9238a8d88c74a503157ad162266428c", - "signature": "6e059447d70226f3ff83431c714afdf5d9238a8d88c74a503157ad162266428c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": { - "version": "0a134facc6d1974de3b9b64e85d6935c9315e3ec1267739bb26fba253705ff0d", - "signature": "0a134facc6d1974de3b9b64e85d6935c9315e3ec1267739bb26fba253705ff0d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": { - "version": "1a2c39566cd0bb39c9e6e74e2101ff18d3828051dc04fb7d015be6a08b2b2b29", - "signature": "1a2c39566cd0bb39c9e6e74e2101ff18d3828051dc04fb7d015be6a08b2b2b29" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": { - "version": "5b7f73bf80fc4283fdf43143151ffb1fa658f22e34ab8f93e4107181419e8ab5", - "signature": "5b7f73bf80fc4283fdf43143151ffb1fa658f22e34ab8f93e4107181419e8ab5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": { - "version": "b9804589d8afc30f545603ddec740427fb4d80bee166165c2fde48a670719284", - "signature": "b9804589d8afc30f545603ddec740427fb4d80bee166165c2fde48a670719284" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": { - "version": "76fd6ed523095c41b1da8efd70c2d58539a02f77cc0d0b5d42c8d30f191da7df", - "signature": "76fd6ed523095c41b1da8efd70c2d58539a02f77cc0d0b5d42c8d30f191da7df" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": { - "version": "1da4af676a459cb50d772e6675e33d36269a3444d065b6908acc1bd6b77cfb6c", - "signature": "1da4af676a459cb50d772e6675e33d36269a3444d065b6908acc1bd6b77cfb6c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": { - "version": "7eeabe859314746c755608e4c1c71da620d27507ccfcbd589151477671a19a76", - "signature": "7eeabe859314746c755608e4c1c71da620d27507ccfcbd589151477671a19a76" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": { - "version": "fc43d2f2123d5a62892df7b9108983b2b277f2c01e47c344bcf2a5c6c25c8186", - "signature": "fc43d2f2123d5a62892df7b9108983b2b277f2c01e47c344bcf2a5c6c25c8186" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": { - "version": "0fae9518384676c37c2db3d56d2d11d8cc82ba24fec06ff1b2246134dbff8784", - "signature": "0fae9518384676c37c2db3d56d2d11d8cc82ba24fec06ff1b2246134dbff8784" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": { - "version": "ba2503f2b408d516d8cbc4d421f3101c08efa408f684519e386a2493391f3627", - "signature": "ba2503f2b408d516d8cbc4d421f3101c08efa408f684519e386a2493391f3627" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": { - "version": "bc6e94b1c8442ca2f06e132af407e836972ab362eae2ae98b2db4f96f92d6f92", - "signature": "bc6e94b1c8442ca2f06e132af407e836972ab362eae2ae98b2db4f96f92d6f92" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": { - "version": "46563e1ebd360cd48248be7ced7448dd31789c65f82014c35b223ae26efc4267", - "signature": "46563e1ebd360cd48248be7ced7448dd31789c65f82014c35b223ae26efc4267" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": { - "version": "7863605292a1ee363f3c3783be9600cbffd63c2be91c0ab555bc0f6984144552", - "signature": "7863605292a1ee363f3c3783be9600cbffd63c2be91c0ab555bc0f6984144552" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": { - "version": "620ccf1fc2ff093d596c2c930f31dd5edbde974b050ee593cc4f142c9bdffc7f", - "signature": "620ccf1fc2ff093d596c2c930f31dd5edbde974b050ee593cc4f142c9bdffc7f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": { - "version": "cf3fae0259d8bd8ae326c36ed0ab3d358bc0c311620e6b3a8fadd663c5beb092", - "signature": "cf3fae0259d8bd8ae326c36ed0ab3d358bc0c311620e6b3a8fadd663c5beb092" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": { - "version": "9a6ff8adde50ff44c819348c523638978fbc8c82a5d0bd13dc7378a2cc7d7606", - "signature": "9a6ff8adde50ff44c819348c523638978fbc8c82a5d0bd13dc7378a2cc7d7606" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": { - "version": "d91163311c397198dcf18d8ed591c0f88836141fcc6097bb6e3e62e721183e94", - "signature": "d91163311c397198dcf18d8ed591c0f88836141fcc6097bb6e3e62e721183e94" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": { - "version": "752421ffbebb494e93d6ece8d23f3b24c1ba4231aa1b35d63c88aaff19c69152", - "signature": "752421ffbebb494e93d6ece8d23f3b24c1ba4231aa1b35d63c88aaff19c69152" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": { - "version": "8ea1e30398c31506633ee77e955bedb696c3440b034aabe22b08413ea896a796", - "signature": "8ea1e30398c31506633ee77e955bedb696c3440b034aabe22b08413ea896a796" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": { - "version": "e57c98f7b795094b2ec1c8c597aeeeaba591b8246c7f6c61cbbb5006aa8b84c7", - "signature": "e57c98f7b795094b2ec1c8c597aeeeaba591b8246c7f6c61cbbb5006aa8b84c7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": { - "version": "6a28862cba14c3ff4489be7f395981ee0f87118ab7826ad7991ae0c2cec9ff8f", - "signature": "6a28862cba14c3ff4489be7f395981ee0f87118ab7826ad7991ae0c2cec9ff8f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": { - "version": "d68518957f61c28b41af3d14302f69f0cf7ef391c120ab154f22f39217805267", - "signature": "d68518957f61c28b41af3d14302f69f0cf7ef391c120ab154f22f39217805267" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": { - "version": "0d9d5959e1baa43568430585f07b6bb7a1021c54ed181fbca9f6263942279a80", - "signature": "0d9d5959e1baa43568430585f07b6bb7a1021c54ed181fbca9f6263942279a80" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": { - "version": "d1d256ac11657d24fbec4d491f714969cb433b23784bc0d529489ce9d13daa8c", - "signature": "d1d256ac11657d24fbec4d491f714969cb433b23784bc0d529489ce9d13daa8c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": { - "version": "c6dfb0fdce1f5222ce8a5ae3f8fce443e30cdf98ab8a8ff6b59511564fd2ca3a", - "signature": "c6dfb0fdce1f5222ce8a5ae3f8fce443e30cdf98ab8a8ff6b59511564fd2ca3a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": { - "version": "dc4b0671d7a71af5ec32dd18595bd89f89e150c146c933275799e6f171e81549", - "signature": "dc4b0671d7a71af5ec32dd18595bd89f89e150c146c933275799e6f171e81549" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": { - "version": "b367e3c1acac161c852bcf2c1d317fcd481148450ad26cf165dc93777cfe3824", - "signature": "b367e3c1acac161c852bcf2c1d317fcd481148450ad26cf165dc93777cfe3824" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": { - "version": "9471b6911f9283f1277502d4cad5c94a2bd9f43b86700f3934a938d2c804281b", - "signature": "9471b6911f9283f1277502d4cad5c94a2bd9f43b86700f3934a938d2c804281b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": { - "version": "6dcfb44c67bda8e433c2234fcbc61013539167e0cb0e53da9116074bc8fe3d6c", - "signature": "6dcfb44c67bda8e433c2234fcbc61013539167e0cb0e53da9116074bc8fe3d6c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": { - "version": "1a453bd323f28633ded464f61bf601bddf28f7f51de8c344bf1d523e903f4c55", - "signature": "1a453bd323f28633ded464f61bf601bddf28f7f51de8c344bf1d523e903f4c55" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": { - "version": "0453b500489af97db08b9294884d743749f6e65c24d4ab40916db9cd7754603d", - "signature": "0453b500489af97db08b9294884d743749f6e65c24d4ab40916db9cd7754603d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": { - "version": "d08a516e69f76d2db65718dad54b7838b9cb50f1d00c9fdb04b6a5ebd1cb9dcf", - "signature": "d08a516e69f76d2db65718dad54b7838b9cb50f1d00c9fdb04b6a5ebd1cb9dcf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": { - "version": "e1d1b54bfebf2f3ec3fa7feabb91a2be43cc9999964316edb87dfa028fabc98b", - "signature": "e1d1b54bfebf2f3ec3fa7feabb91a2be43cc9999964316edb87dfa028fabc98b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": { - "version": "dcdc364deed98b55f65801c782abe862c573307c653806ee2262b0646a390f33", - "signature": "dcdc364deed98b55f65801c782abe862c573307c653806ee2262b0646a390f33" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": { - "version": "9f6f6e899e2284cfd18cca30a5b3e3c313a228f4423c95e74c6345cb9d704a20", - "signature": "9f6f6e899e2284cfd18cca30a5b3e3c313a228f4423c95e74c6345cb9d704a20" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": { - "version": "29cf2db15f23fb4e0e690ea895fcc4476782b9f024c4d3df3cf8e9cd7c78da0f", - "signature": "29cf2db15f23fb4e0e690ea895fcc4476782b9f024c4d3df3cf8e9cd7c78da0f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": { - "version": "fb722149e233d5e9b0d8e2bdeaf5892a4b8035592d907ba2469289d00c7d3362", - "signature": "fb722149e233d5e9b0d8e2bdeaf5892a4b8035592d907ba2469289d00c7d3362" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": { - "version": "d8181aee65ba90eea56aab03fca2ede7e19f1d57f561b2b794851750ae93edf4", - "signature": "d8181aee65ba90eea56aab03fca2ede7e19f1d57f561b2b794851750ae93edf4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": { - "version": "d123859260d588493c1689896a199d61051d5302eda1033123eaf3d341e74cea", - "signature": "d123859260d588493c1689896a199d61051d5302eda1033123eaf3d341e74cea" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": { - "version": "eb9dbbf3436a185f794d7df836925adabfd6ae3e4978a0414511b8b1f688e98a", - "signature": "eb9dbbf3436a185f794d7df836925adabfd6ae3e4978a0414511b8b1f688e98a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": { - "version": "90be5c0a88263271550227fc4e5fbfb57cd3826c6e21b26ca8a141c84be5943c", - "signature": "90be5c0a88263271550227fc4e5fbfb57cd3826c6e21b26ca8a141c84be5943c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": { - "version": "b4727ceb1a19163bf2359b7d92648301310a1c76e2914e1078b58bc07b5ef72b", - "signature": "b4727ceb1a19163bf2359b7d92648301310a1c76e2914e1078b58bc07b5ef72b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": { - "version": "c4f95b1e815479c01a5043f7a7962073c054033e4fa4f039ee2adfebedcffbed", - "signature": "c4f95b1e815479c01a5043f7a7962073c054033e4fa4f039ee2adfebedcffbed" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": { - "version": "510adfc55a51d2d6e08a6519e14f0ef123018d3711158ce4a9098e7637686488", - "signature": "510adfc55a51d2d6e08a6519e14f0ef123018d3711158ce4a9098e7637686488" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": { - "version": "4a25dadf5ec4b679dfc01f020c912d8567fc29cbcb0a110518a6a486c82320e9", - "signature": "4a25dadf5ec4b679dfc01f020c912d8567fc29cbcb0a110518a6a486c82320e9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": { - "version": "441cfa5bf8ca6671be8ef2f3becfc678a4afc01d6f886a4e94878e32298c3804", - "signature": "441cfa5bf8ca6671be8ef2f3becfc678a4afc01d6f886a4e94878e32298c3804" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": { - "version": "c47f21e1be455cdf4ed7a5e38c20d5be9e7c5f6f6e2ea37a01ad058b5f61fc97", - "signature": "c47f21e1be455cdf4ed7a5e38c20d5be9e7c5f6f6e2ea37a01ad058b5f61fc97" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": { - "version": "16b426a80cd98a1473d925e6f8d3bab679e94fdc2e5ecb5406f079343ab0533d", - "signature": "16b426a80cd98a1473d925e6f8d3bab679e94fdc2e5ecb5406f079343ab0533d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": { - "version": "096f66887dd48c8d4d820ca64e23909edbe893e16a6e427c620871ad2910a415", - "signature": "096f66887dd48c8d4d820ca64e23909edbe893e16a6e427c620871ad2910a415" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": { - "version": "8abc6aad380575ba975b33ced648af9e5cdad075e8b00f05b99dd041f37365f9", - "signature": "8abc6aad380575ba975b33ced648af9e5cdad075e8b00f05b99dd041f37365f9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": { - "version": "5ffc540e38b10ffb3f3d9ae54b8a976e3da4b350647b4886e1aa72c9d75e5701", - "signature": "5ffc540e38b10ffb3f3d9ae54b8a976e3da4b350647b4886e1aa72c9d75e5701" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": { - "version": "a93c1256a96a0d4e18b7a2cc65b3f8a0c0dcb23fbb4c7af6e1113877c404e3be", - "signature": "a93c1256a96a0d4e18b7a2cc65b3f8a0c0dcb23fbb4c7af6e1113877c404e3be" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": { - "version": "7c21938e95b0e582c769bc0db13267ac37bdf25ba04489ac374204c0f4fd84f9", - "signature": "7c21938e95b0e582c769bc0db13267ac37bdf25ba04489ac374204c0f4fd84f9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": { - "version": "ef6ee8b77a2bcfa8ed403459d47ac077421c93d128cdcb85d7d472073faaf3f1", - "signature": "ef6ee8b77a2bcfa8ed403459d47ac077421c93d128cdcb85d7d472073faaf3f1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": { - "version": "171b073b849566ea0b1164943edae39da2063914acf9bdacf759198714730b1e", - "signature": "171b073b849566ea0b1164943edae39da2063914acf9bdacf759198714730b1e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": { - "version": "877982ad86e55624cf0841b798faac8ff3bb29813f35a4ecd307168735620e91", - "signature": "877982ad86e55624cf0841b798faac8ff3bb29813f35a4ecd307168735620e91" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": { - "version": "be4b86fcf41f7c52ca0a1ede68dad397871f39bcffbd1db77fcd2871a6c1dc6d", - "signature": "be4b86fcf41f7c52ca0a1ede68dad397871f39bcffbd1db77fcd2871a6c1dc6d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": { - "version": "84666917c7f0565389877df2c91217174059ca45524a7dd9f86295edcb1f744e", - "signature": "84666917c7f0565389877df2c91217174059ca45524a7dd9f86295edcb1f744e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": { - "version": "fe3f6412d56a35ac5a448d5277b7a3314ab15167dd90fd76e7d6ed07f67f169a", - "signature": "fe3f6412d56a35ac5a448d5277b7a3314ab15167dd90fd76e7d6ed07f67f169a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": { - "version": "9edf485a02787a1b40395701070e7cdfc6bf35a45df9166ea932306b0cead0d4", - "signature": "9edf485a02787a1b40395701070e7cdfc6bf35a45df9166ea932306b0cead0d4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": { - "version": "1a0538b8ddc8044259ca51cd5d7e381a92298ffe47701520f2344f26eb153c8a", - "signature": "1a0538b8ddc8044259ca51cd5d7e381a92298ffe47701520f2344f26eb153c8a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": { - "version": "8ba196faf00666e17a0547aa0cbdf77974b399b1e05b52785e72393b86a82edf", - "signature": "8ba196faf00666e17a0547aa0cbdf77974b399b1e05b52785e72393b86a82edf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": { - "version": "7953df8a48a3d4f9f6bf4ebc3ca740796a86b4ffcd967745b0697252d965df95", - "signature": "7953df8a48a3d4f9f6bf4ebc3ca740796a86b4ffcd967745b0697252d965df95" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": { - "version": "3d2ae62f5defa9d62b6f7ddbca46ecd0ff80ce4df31ff0cec16200dbbaf51dfd", - "signature": "3d2ae62f5defa9d62b6f7ddbca46ecd0ff80ce4df31ff0cec16200dbbaf51dfd" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": { - "version": "acffecc16427ecf797219c0dfbede2e54be4211884e11aa552b93ed9667c23bf", - "signature": "acffecc16427ecf797219c0dfbede2e54be4211884e11aa552b93ed9667c23bf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": { - "version": "9d0e96d38bb0ec5ca7ecca26c61de4e9539e7ac764efd6ed5020b15a2ac78803", - "signature": "9d0e96d38bb0ec5ca7ecca26c61de4e9539e7ac764efd6ed5020b15a2ac78803" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": { - "version": "668eecae7c3d99776b032b229256ebd8a14ba89e8a06fc3fef705f6dea15bcea", - "signature": "668eecae7c3d99776b032b229256ebd8a14ba89e8a06fc3fef705f6dea15bcea" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": { - "version": "d357f738da0f93e6c49d1aace9db3566258d53dd7daf2e1c90a43127965f7631", - "signature": "d357f738da0f93e6c49d1aace9db3566258d53dd7daf2e1c90a43127965f7631" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": { - "version": "487ff9e2450ab931ba314a8d2dd51bd19fca70c95e30aef28c71c359e29c0733", - "signature": "487ff9e2450ab931ba314a8d2dd51bd19fca70c95e30aef28c71c359e29c0733" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": { - "version": "8032117fab1daf0eceffc5a9bd6f5e20de5b2972b20a0b032c47eafaa9c19c24", - "signature": "8032117fab1daf0eceffc5a9bd6f5e20de5b2972b20a0b032c47eafaa9c19c24" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": { - "version": "e1fc6040b74a8d6d04788dddc1d79e2aba43ea8a5db1699da0ae467fbbaa49c2", - "signature": "e1fc6040b74a8d6d04788dddc1d79e2aba43ea8a5db1699da0ae467fbbaa49c2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": { - "version": "09a9f7b161090a8f2153a2d7b7616b77506295abb5b86590be7a68245f8dc532", - "signature": "09a9f7b161090a8f2153a2d7b7616b77506295abb5b86590be7a68245f8dc532" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": { - "version": "d5650f0d75ce845539cf80614750fe1a14790e398588da1adcca6c5f53225b72", - "signature": "d5650f0d75ce845539cf80614750fe1a14790e398588da1adcca6c5f53225b72" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": { - "version": "c72c275a60c4b61b5740bcc56075b9d84a2469c9a24e3afa848f4ffc2904b108", - "signature": "c72c275a60c4b61b5740bcc56075b9d84a2469c9a24e3afa848f4ffc2904b108" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": { - "version": "7515ba30314cdbdbf5b15969e34ba49b080c32e918be6b9f613e2c0dae4b7751", - "signature": "7515ba30314cdbdbf5b15969e34ba49b080c32e918be6b9f613e2c0dae4b7751" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": { - "version": "cd79dfad796293ac51aa676353f060a8738d8ea6287259f62f323933fa1c634d", - "signature": "cd79dfad796293ac51aa676353f060a8738d8ea6287259f62f323933fa1c634d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": { - "version": "12e912f1e14d2104547e1f6646d681c5599cf0dcfaeb4581f4551d97e64c9d82", - "signature": "12e912f1e14d2104547e1f6646d681c5599cf0dcfaeb4581f4551d97e64c9d82" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": { - "version": "239b41f76844bec24ec8c2504f49c51932466736afe761bb6b8129338141b6a6", - "signature": "239b41f76844bec24ec8c2504f49c51932466736afe761bb6b8129338141b6a6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": { - "version": "730587b7e34bdcb172d5390f54bcefedceaf176cf639e988c6d00eeda5290f60", - "signature": "730587b7e34bdcb172d5390f54bcefedceaf176cf639e988c6d00eeda5290f60" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": { - "version": "169a345845855cf044b3328b61ab4f7ca62008193bb46271b64cbce075bb967a", - "signature": "169a345845855cf044b3328b61ab4f7ca62008193bb46271b64cbce075bb967a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": { - "version": "914b180923c6ac0f1426d6d5e1adaf44d8a8719c61d2be1cc8cc4e03031c5ecf", - "signature": "914b180923c6ac0f1426d6d5e1adaf44d8a8719c61d2be1cc8cc4e03031c5ecf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": { - "version": "e065920af631f891852e11918336d4f9dd1abe8ed9065c3ec338915dae3a089d", - "signature": "e065920af631f891852e11918336d4f9dd1abe8ed9065c3ec338915dae3a089d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": { - "version": "bb345be2a8aa098fa2de11f2cef824f9089da46db14043c70dcce54f17a305d7", - "signature": "bb345be2a8aa098fa2de11f2cef824f9089da46db14043c70dcce54f17a305d7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": { - "version": "91c55f2950e628414dc6e450cea9a2a198de55b58b3001ed28d9cee15956f926", - "signature": "91c55f2950e628414dc6e450cea9a2a198de55b58b3001ed28d9cee15956f926" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": { - "version": "855f37046c96ffe04be9b43fcb0268ff4cdc23c8e36f0d929f473316bd506211", - "signature": "855f37046c96ffe04be9b43fcb0268ff4cdc23c8e36f0d929f473316bd506211" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": { - "version": "3cad925712cc4d761fb82b269b1c9971100deecdaecbb9c59ae19a9cd395e9eb", - "signature": "3cad925712cc4d761fb82b269b1c9971100deecdaecbb9c59ae19a9cd395e9eb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": { - "version": "e2f9c30420b817a569a09754941a4287f30befc4e9750569d227f9fed5c7f52d", - "signature": "e2f9c30420b817a569a09754941a4287f30befc4e9750569d227f9fed5c7f52d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": { - "version": "939695ce06e5beae32d8f3030fef29b295f68c3d4648d49669b0e7e918688d03", - "signature": "939695ce06e5beae32d8f3030fef29b295f68c3d4648d49669b0e7e918688d03" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": { - "version": "3109329a6e15088af904ef2e55997e19bd715fec22a8a1fd8189fc599ac9edc6", - "signature": "3109329a6e15088af904ef2e55997e19bd715fec22a8a1fd8189fc599ac9edc6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": { - "version": "745cb240fa6421e309860efec3ccfcfd71f91ec85ce3a3ba19e2433340db020f", - "signature": "745cb240fa6421e309860efec3ccfcfd71f91ec85ce3a3ba19e2433340db020f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts": { - "version": "6b0e4d16e5a1c5922acb1a2491be705cb17dcfda9e0f73161351525c6bc882d0", - "signature": "6b0e4d16e5a1c5922acb1a2491be705cb17dcfda9e0f73161351525c6bc882d0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": { - "version": "5bee3d5a5c3d409c0b0499a561919ceab633700e43db3d2c736c08cbe6ffe155", - "signature": "5bee3d5a5c3d409c0b0499a561919ceab633700e43db3d2c736c08cbe6ffe155" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": { - "version": "d861031e2ba65a6420fe6b45ffe1c6429cdd5d7853f1ea2df9c9332f47857657", - "signature": "d861031e2ba65a6420fe6b45ffe1c6429cdd5d7853f1ea2df9c9332f47857657" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": { - "version": "ea344e18e1240cda6ccaa2e5fdaae72bb2c59e47b2127a4b2b48f57ecdb6ee3c", - "signature": "ea344e18e1240cda6ccaa2e5fdaae72bb2c59e47b2127a4b2b48f57ecdb6ee3c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": { - "version": "b18c0c0a05c7d0667611e45aa7566758adc37733dc258c33ea5fe8a14aea30a6", - "signature": "b18c0c0a05c7d0667611e45aa7566758adc37733dc258c33ea5fe8a14aea30a6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": { - "version": "fc52f3d4503d187ec72b139a7edb3c8ca6f5008980340752cb5d5078929626a4", - "signature": "fc52f3d4503d187ec72b139a7edb3c8ca6f5008980340752cb5d5078929626a4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts": { - "version": "716c36572e7674628608f36b0737fd42bfc15fd8928d3709843b4b62d40c2e2a", - "signature": "716c36572e7674628608f36b0737fd42bfc15fd8928d3709843b4b62d40c2e2a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": { - "version": "d4d550e3eeca8c2e63b243fc4db53f221779dfb47ed7ccbd0d34b5323387c1eb", - "signature": "d4d550e3eeca8c2e63b243fc4db53f221779dfb47ed7ccbd0d34b5323387c1eb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": { - "version": "f13a9198176221207dc3d36a4037e5c7cd2767b7a01e83e2c2eb1b76cdca058f", - "signature": "f13a9198176221207dc3d36a4037e5c7cd2767b7a01e83e2c2eb1b76cdca058f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": { - "version": "651d5fcefc312e1926762293a94e8f3b22db1e0ac5a7ca6afa02c51882066d1f", - "signature": "651d5fcefc312e1926762293a94e8f3b22db1e0ac5a7ca6afa02c51882066d1f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": { - "version": "d721b7b7e2bae3a00803c38f8b851e2175373a360f322f0abef543f5efb823b8", - "signature": "d721b7b7e2bae3a00803c38f8b851e2175373a360f322f0abef543f5efb823b8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": { - "version": "5d1be82088f6e2667de1c021cb2e98aa6d274b037508218154ed09f4640e3636", - "signature": "5d1be82088f6e2667de1c021cb2e98aa6d274b037508218154ed09f4640e3636" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts": { - "version": "12cd22576286346b71c41626c5f47390ebdcd3e9b3a6f05d3e3746545c3408b3", - "signature": "12cd22576286346b71c41626c5f47390ebdcd3e9b3a6f05d3e3746545c3408b3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts": { - "version": "e410475b6f69fc0f473f99ab7a9e9df36d9569c16ae59482c8f688d838210d68", - "signature": "e410475b6f69fc0f473f99ab7a9e9df36d9569c16ae59482c8f688d838210d68" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts": { - "version": "80733a15ee9be4c4a964458852fd4ffef0b641a4570405087cada03c8b0d1551", - "signature": "80733a15ee9be4c4a964458852fd4ffef0b641a4570405087cada03c8b0d1551" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts": { - "version": "230c2aa8ad0965b18748154b8831e3fff23585a34f9fbbc36f86fc39c788099d", - "signature": "230c2aa8ad0965b18748154b8831e3fff23585a34f9fbbc36f86fc39c788099d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": { - "version": "d3550a9b2c95a16636307e376b70dcd5f209af4084656c2681958ca0c94793db", - "signature": "d3550a9b2c95a16636307e376b70dcd5f209af4084656c2681958ca0c94793db" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts": { - "version": "5c59028ee83c45a9dece43db5b53d95d47dca13152682b5a29452ebe4255f008", - "signature": "5c59028ee83c45a9dece43db5b53d95d47dca13152682b5a29452ebe4255f008" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts": { - "version": "235838e05310e2a5c7eb1dee9e7d809de2f13f1ece6434b01e026632188e158b", - "signature": "235838e05310e2a5c7eb1dee9e7d809de2f13f1ece6434b01e026632188e158b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts": { - "version": "f65dbdf26605a07c546fdd00de6d02e1c958672791635511d64386ce5f4036a6", - "signature": "f65dbdf26605a07c546fdd00de6d02e1c958672791635511d64386ce5f4036a6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts": { - "version": "2745294bad1d9a1bc213c03aacc47f465f9a23474488253e9c8824ee18a01251", - "signature": "2745294bad1d9a1bc213c03aacc47f465f9a23474488253e9c8824ee18a01251" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts": { - "version": "0718d101018dfd11086a8ece97ce49a87bb784a576ae4901ce9c21a999f6c461", - "signature": "0718d101018dfd11086a8ece97ce49a87bb784a576ae4901ce9c21a999f6c461" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/log.d.ts": { - "version": "addda8d833e1739492f09a4cd1a64c98d42a05cf80a581458ea9cf27507a29f2", - "signature": "addda8d833e1739492f09a4cd1a64c98d42a05cf80a581458ea9cf27507a29f2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": { - "version": "d31befee43579fd7ef04043ceb5fad291f92e35e3f1574d5a2726a6e3626d4bd", - "signature": "d31befee43579fd7ef04043ceb5fad291f92e35e3f1574d5a2726a6e3626d4bd" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": { - "version": "b3ecac3b0623ac0c62e38777349e8886504d76182aa39bbc1a8cdc23b057ffb4", - "signature": "b3ecac3b0623ac0c62e38777349e8886504d76182aa39bbc1a8cdc23b057ffb4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": { - "version": "c222091a253aecbd9d0132320bd9ccd94fe916db113ddb47408ab010c4ff5a3c", - "signature": "c222091a253aecbd9d0132320bd9ccd94fe916db113ddb47408ab010c4ff5a3c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": { - "version": "43573c8ed9d06c7899ec3b95aff3860f026e77626ed9139264318acc01374aec", - "signature": "43573c8ed9d06c7899ec3b95aff3860f026e77626ed9139264318acc01374aec" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": { - "version": "f17dbc11f07d828c438e9f95b2a45bc7bd804eb01beb61ee0b39a26bbf348a9c", - "signature": "f17dbc11f07d828c438e9f95b2a45bc7bd804eb01beb61ee0b39a26bbf348a9c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts": { - "version": "f4d525c92f9aebb3b23cc749c1da5f6295622121dee85c29c2f680dd02f9e738", - "signature": "f4d525c92f9aebb3b23cc749c1da5f6295622121dee85c29c2f680dd02f9e738" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": { - "version": "3eabdaa394f886b46b851b3008f9d7c7c76484a7f99ec18d366a9df303f7f1c2", - "signature": "3eabdaa394f886b46b851b3008f9d7c7c76484a7f99ec18d366a9df303f7f1c2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": { - "version": "a0f16c0740e640a08bac78d3f901207281c8fdf72dcb04bba2003eedf6c1e98e", - "signature": "a0f16c0740e640a08bac78d3f901207281c8fdf72dcb04bba2003eedf6c1e98e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": { - "version": "db346ff36c2ad0955a83243b062dd6b30710bef47fcd4b95aeb92ec8d7c59df1", - "signature": "db346ff36c2ad0955a83243b062dd6b30710bef47fcd4b95aeb92ec8d7c59df1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": { - "version": "cb86cab04d650d7694859841a3635b139dcc3c4e561f35f84300092456220ed4", - "signature": "cb86cab04d650d7694859841a3635b139dcc3c4e561f35f84300092456220ed4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": { - "version": "854262aadff6afa8256dc68ec8546e063a3fba9a0a1e46caf9cd7b4cf16062fd", - "signature": "854262aadff6afa8256dc68ec8546e063a3fba9a0a1e46caf9cd7b4cf16062fd" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": { - "version": "94c1ffdcfc7ad35c3d5945f1720f04efdcbda5278a250fb509b5ce2c6685998d", - "signature": "94c1ffdcfc7ad35c3d5945f1720f04efdcbda5278a250fb509b5ce2c6685998d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts": { - "version": "49435f4e0d9c190df5da152207e3bfc59bd1cb381bce079ebe32c372b238e236", - "signature": "a50a69f78d4babe37a5ec952e6b0c30bf6a384114cd5e17c991de49b78ea6206" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts": { - "version": "8992c3b7139475fbc1c905dd2943afcb75a72d20f5200b5515cce33bc5d328bc", - "signature": "c6e4c4aef3936c8aefc72823a8b702689316a05eaae96e8c997f3f6a0420c16d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts": { - "version": "1f486ee7ff70ae08f0f0c225a0ff78a1c42619aad5c5460d00f231c640f085d1", - "signature": "d984b302b578a0a00085dac60d2db84999b4b5201f1d54879f9201ef62a5d330" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts": { - "version": "84994f33df87e1e0f32d4416bb660acc433fc0e54c82f4b0d87ec1a36b1e64bb", - "signature": "f6cea5bb1f9e8623b2433bb0bc9a67b45e84f543ba998a85effe81e0042bd8c1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts": { - "version": "7c0a3ab28be91fc449b4722da8753b3b08273f609a085a6dde979980d46a911c", - "signature": "37396f1d649b50855abd99b82bc1fe90e16ca8ad1b52cbeb618217b72a75ffe6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts": { - "version": "9ef8001dc542241fb7d8b3b31c6a18d01d1748e31ebb05d09356edbbe90117a1", - "signature": "34ce5df8f7794ae0894046947496cc8cf5ecaf74cc34223ab28cc5a10b39f158" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts": { - "version": "1adeb0eda8ae5395bc55c765c5fa850da29ae1fc6c2530278488d6ba05d5758e", - "signature": "1923b649e48cfaa35c506cef9120047b4354223f467d498fed01450b8add4d35" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts": { - "version": "173466836af25fb80e36a4721953b8c73af59376ec64cf410069ef44b6c65ec1", - "signature": "657b28f3a79de504c6a6c64483144457a7c37446dfc260bf6bb979f4d64dd11f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/utils.ts": { - "version": "13a75e0418426fea2235e5955a0f92441a9ab90698e35a2f2d4860e83a3c72d8", - "signature": "e58b12d5ddbf3f1cc1a83d3138b6550d96acdab2e722bcca132c28e571a5e0e9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts": { - "version": "5b78868c5b036c276a224842dc96fb4a989e4cfb82763af56f35a30e57bffe32", - "signature": "374e2bcf99e0bf6c7ffb0a96d8cf994dae33fbe472bf30cacc809f0a6d18be0c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts": { - "version": "604fad5a8691952a36c0fd90ecfcebf01ad7e4677b1306c6999cb828e2d62ff9", - "signature": "5e85f716c08c63809398cf214ed492105bbea748460a0f84b10fdee0abf22e31" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": { - "version": "df33db95c35009a6da8b26ddb2703ca7c99a98b373b283dfba13e5d088a9de65", - "signature": "df33db95c35009a6da8b26ddb2703ca7c99a98b373b283dfba13e5d088a9de65" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts": { - "version": "11cf65def6f68f23ffc657e010b0ae4ae6e33477f49d3f9abb40dcd9ba9e6936", - "signature": "cfb1a0a7e3851f4888fb7396951874e05ce55e2bee002837a00730d3a94aee9f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/activations_test.ts": { - "version": "b7824cc97834567e66e869f42d426203ad9f17755d3a55ecd9fa6beac47eefa0", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts": { - "version": "85b499cc3500e939ee16e57589a4f281c96533eaabcb5f8a25a5fa92f7c73b8f", - "signature": "ffb35132439282df7057cb7978e83e7c8c5ff3891058229682b125555700caa3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts": { - "version": "39360b383fdc8f6b296a54d4304bbb9569128e7f96e38898320ba0cd9d4ad68b", - "signature": "95bd11312f271b1383eb778e7d6c685c3f3885950b9de98fec42cdf7eb59195f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts": { - "version": "d4a53fd5d65a8f9cc8c5b44b9c6ca46480178114578ed2191bbcbbe3275bfe74", - "signature": "019e6cffe3806a22c28becce4fb26714556e5bc0d069327b04ddd9f12fe8edf5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts": { - "version": "d604934a6525cdea1aeb9dd361c3f4851b0af1897e99776f729f38d4224249bd", - "signature": "51ebe1821afcb1cf8be6cd7f502a491e5a1c5ba58d954517a6ab3acc333df9f3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts": { - "version": "eedb984546b2192f2c69e06ebf0b5e63187cd8904cd4b04d1d64baa4ebe4734e", - "signature": "abed054366eaa69766c551437dd284adabe71a8a5fd6797ac0270521ef474337" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts": { - "version": "2950eaddfb724ae292eae91e55d9f58a0584be97258867eca74755b93ca57331", - "signature": "1ee49902040a9b2133a99ab3f9960b5201fc7c068d7310d910c260308a2b7a20" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts": { - "version": "44de687e7658fe30757875e1bba5e42aeb32a19bfd27e95b68b7aa8811ff9dcc", - "signature": "12eb5457dfd312dbe85711798764f56cf1293f50e1bcad2e842911af0eda93b2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts": { - "version": "0707b3b4439e07ff380c05e9e1f31dfaa2870e3ee6b3722d0cdbb9fa787e86a2", - "signature": "a7fef58976fa46c076815ac2f6eec961504aaee76c44ca9b1854484505dbbfae" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts": { - "version": "c1de9d8f48a22c963515458c32125814760337a0b7e2b3157725c531609543f1", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts": { - "version": "6a8544dcd7a154b1f2ef7296d0882cd45c1e26c2450b4323e2b3874f369c73be", - "signature": "23d41051b54eac0bcb99d79b6899c1ffefb4ab145161486eca110266aef4e116" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts": { - "version": "70e16d9e75e2f2172858332058726dcc3fc5c98effea4a7d24891782052b2945", - "signature": "07c78deb0acd7e269cc8052e9f3605bdd359cdfd0824e1543466cc54d15cd1e1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts": { - "version": "fb67f020117db7f3c5a7ce2ac535c68eb8317a039a6d1a711e18ca2cc5ef4d27", - "signature": "c34e0487057009ff4d4eb22e0a6a30b0d3162cdc4c241916d00515ef24345f00" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts": { - "version": "e79d1dc15da6b40db07f941eec8449118f8aacaadc6e0f4e5d0e90773632f7a4", - "signature": "9de451fd152a743045fb19b99a87dd030dd177d09b26601fcc19bc32ae984442" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts": { - "version": "96525b6cd78017d6eedc17ec2179d4e94012d2f91597eed6c6f570c8fb5f1558", - "signature": "b6a4e291782a867bbce978ce3299e7c2aa0743c7f27c1182c33027ba4e206f38" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts": { - "version": "65fc39d7cb4d00e531198d7526760bce2a25018896f30c97298bdf8cc4caa5e7", - "signature": "9049f814d525b63c573f69a6fbd6703a24e94e66b52fcb82173fd74c15191824" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts": { - "version": "4740c9bc3dfe19fdfc0465f5bec5fa31b43747896c3291d785b5e191dd1cd47e", - "signature": "3329e3514c04051f327bf6265fd9a8873fb2f8d59784d8d49c90d2251d5a6344" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts": { - "version": "a9a29878fd41caaa54f5ffc4405544e750908beb84fb7910841a0616c49e27c4", - "signature": "62fc437bc676ff5b5725452ceedbcf24dd1bd87fd5749ba47ea2ee4d9b9d587d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts": { - "version": "4b4ca95afa3e3d82e0249fa80f3a3a671c072c6faaae01b3f31965c3dc896edd", - "signature": "842fd8488ab4856239369c713c5f7ea647b69930e2f4535e03bd0ec0c7779cf4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts": { - "version": "9135dde623bfc699c2d0418da8ece2125ebc6c425791969a4d2c8e39bd7a5e00", - "signature": "0cc2599102f2cc2de07c012e3dc789b6360a6218b9b293a56b52c822912dd518" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts": { - "version": "b97f4c14a981e191e07b30f427b2b9dbb8b5bb514c01de56108cae32bc271eff", - "signature": "39484844beb4411a5f4f719f8405e2538ab564ec6e99fc4d8aa3078ab0ef91ed" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts": { - "version": "341973e0c7e0b00adfd2f01a4e1d143510d3e79e2a5b9e948341fcd2db7bd5ed", - "signature": "cdd15b108d0459c73046179fdc61a846be55571aa99288b6a564ff2ad45e6337" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts": { - "version": "f96beeeb3cd972efb78902e9b24138cf3310eb3046c0ab8f8473fdd6d6793688", - "signature": "c625e69c4d9fcd7ccbba9d4c7b05e762bacb228d7b9c2bd81b568a43a28a40ce" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts": { - "version": "a9087089e705139bbd69fca32cb20607d885963cc5ced0d47115e99d01c0b2c2", - "signature": "2f5e0067c0a459335a185dbbdcbc16050e03bbb0a26890d206a5b38c14de4368" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts": { - "version": "684407cfc71c7028531459ed532c28a5d9e57355160ac75534725b4eae6fd773", - "signature": "59b773e42735ddfbc674307f95640982fe39936fc11bd119a039cf3fe805b98c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts": { - "version": "f4f6ff6bd9392f29931fa1c83bad36cb4eed6ba2ac3929c83f8215671a814036", - "signature": "0b2f344309340b8d664e810247d8dc7e5506f5b8b0ce368dc76d1bde8900eb17" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata.ts": { - "version": "bb1930097cac04f6553ef4095bfd5acdd59476dc6ccb62e6f5196ecf733cf86d", - "signature": "33098c3e2c240c04bd46957c8da59070db946d08b474fa7e9e3b391fadeb06e0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/layer_utils.ts": { - "version": "9d8f8c4281eec4d4a9c3ed6f95d11d5305fe412c2a9b049b6dfc5dba8adf3709", - "signature": "9bbcfdb34f5868b728bf25c0e20ee8de352488ceabee3dc4f758f017e455dc4a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts": { - "version": "3dc4deb63d1e2af6e8426b39d524497ba37cfa650fefc99d94e62cd6aa2bb773", - "signature": "8e29bc129920a15b27f18a20f8baa97c7c07354fa38463707d222aabedf12cd1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts": { - "version": "a75167ec0c11a16628b6d4659a65dd4fd6a55194d27aeef36a19175a7f6b82c9", - "signature": "78bc9b49195f835e1ebce92398d95f3c223abfb1a9111fd48ea87c6dbe784beb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts": { - "version": "6b823641c376df6cd8df77fc2a613629d9050cde9dbc9859e0ae8852247af91e", - "signature": "a3b7d9f5a786c8228d875631eb4f095603c6902aeef6667933b9efdd01654923" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts": { - "version": "ffd7fd46d3381bfb103ef71856b43c85a6d6b16607ae5711db547ab8c291cb9b", - "signature": "f5c9f98d98ba64d278c2a1c301ba2d71918a810f0bb6931df2f3ca2e0f1ebbbc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts": { - "version": "05bafc423ec84feecca6c0a91b84f0aa5a91926ace213088aad51ea8d508a575", - "signature": "8f8d534dd6d6b6cfdba4d32fcd81209c685748c2e15667b1c54a27b2677b970a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts": { - "version": "7e11717d36be35287650bb03314b6b4a115a77f163e57088715f06404b4db183", - "signature": "bfd897bf7c5579721431c6989b098fc17abb4976c093490270daf08296939415" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts": { - "version": "b28678f9dc94a0907482bb9fb4f0ee2fffcf8db9bf09e3f6ea974c015df235a3", - "signature": "b28678f9dc94a0907482bb9fb4f0ee2fffcf8db9bf09e3f6ea974c015df235a3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts": { - "version": "0b76b6e6c18dbb7234603933f37a7f5ac6736ea4dd2e0ccc3e5004b124c659bb", - "signature": "0b76b6e6c18dbb7234603933f37a7f5ac6736ea4dd2e0ccc3e5004b124c659bb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts": { - "version": "2d0783d228de75404515fc0bf44665dfe56db5c7f19aafb4368c47be1f1f654b", - "signature": "2d0783d228de75404515fc0bf44665dfe56db5c7f19aafb4368c47be1f1f654b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts": { - "version": "7a840f8288a2934649c3ca75e29468e36dc2698f52e14787d94de2906a488c06", - "signature": "7a840f8288a2934649c3ca75e29468e36dc2698f52e14787d94de2906a488c06" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts": { - "version": "5d3b7fc1908c6c99e4078b2122491135390e2cc8349e95f4f07cfdb30f43a586", - "signature": "5d3b7fc1908c6c99e4078b2122491135390e2cc8349e95f4f07cfdb30f43a586" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts": { - "version": "41756ce2a606193697beca3e7b5553461ddeda4e2bdc9e3c1b5ad1cab1417072", - "signature": "41756ce2a606193697beca3e7b5553461ddeda4e2bdc9e3c1b5ad1cab1417072" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts": { - "version": "707a64cb46c9e3ac7909675a44b953bffdbe5904865e59775302f209c5ed6180", - "signature": "707a64cb46c9e3ac7909675a44b953bffdbe5904865e59775302f209c5ed6180" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts": { - "version": "c6d77e019897390b3ad2fbd97daf900c6fbffe88ebce42d1f49ac81aee2807d7", - "signature": "c6d77e019897390b3ad2fbd97daf900c6fbffe88ebce42d1f49ac81aee2807d7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts": { - "version": "5c3e3ef570a5b5dcc6bae17439c690b951b93e6b329e352d6d5f788f49156dc9", - "signature": "5c3e3ef570a5b5dcc6bae17439c690b951b93e6b329e352d6d5f788f49156dc9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts": { - "version": "0f47f923f26e41b544caf773e12af695b0f980aa38a2f7d98ec716f0ce00f59d", - "signature": "0f47f923f26e41b544caf773e12af695b0f980aa38a2f7d98ec716f0ce00f59d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts": { - "version": "e04e3d5a231d017ea060a13baabe660333d1d80cc45ab156b420de465b19ae86", - "signature": "e04e3d5a231d017ea060a13baabe660333d1d80cc45ab156b420de465b19ae86" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts": { - "version": "e46b54c60484e5bf432bb0d87a79473489c7871bc13f2b06b3cbae58146f84cf", - "signature": "e46b54c60484e5bf432bb0d87a79473489c7871bc13f2b06b3cbae58146f84cf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts": { - "version": "8e7ee7dc1e3525dd66ba00eeab748683574179253a866302e09366052d95b19e", - "signature": "8e7ee7dc1e3525dd66ba00eeab748683574179253a866302e09366052d95b19e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts": { - "version": "41af233f925e97ebaafb6454abda5650e883c463a275b0e7e61aae384ff8bb3f", - "signature": "41af233f925e97ebaafb6454abda5650e883c463a275b0e7e61aae384ff8bb3f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts": { - "version": "7394e1dc1202799052c138bdae27834e090635b99da61e7919bd09e92f2e0704", - "signature": "7394e1dc1202799052c138bdae27834e090635b99da61e7919bd09e92f2e0704" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts": { - "version": "b402b2ed36326627fa21fe934391c40b13f518bda63bd4de89c2e89dd1a7a2f2", - "signature": "b402b2ed36326627fa21fe934391c40b13f518bda63bd4de89c2e89dd1a7a2f2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts": { - "version": "b5c38aee56fc5d77b0f565d9f4ebf49dca51678179e5a06d74bd81717bc847e7", - "signature": "b5c38aee56fc5d77b0f565d9f4ebf49dca51678179e5a06d74bd81717bc847e7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts": { - "version": "baded94bedb9d2f762eec3651c8f76d1adcbb537632329025e4f342d97cbed05", - "signature": "baded94bedb9d2f762eec3651c8f76d1adcbb537632329025e4f342d97cbed05" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts": { - "version": "da291d4418ed50e57c014d7278dc1aa91f2f445a59287b2c1aed4bd45d859fdc", - "signature": "da291d4418ed50e57c014d7278dc1aa91f2f445a59287b2c1aed4bd45d859fdc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts": { - "version": "4fba667e241cb56573cdfa7726bc1531f085c741b28961efafda00dbaa14cc29", - "signature": "4fba667e241cb56573cdfa7726bc1531f085c741b28961efafda00dbaa14cc29" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts": { - "version": "2d434c9f7a565e0be17877a426377fef4365c14c60d30a1ade77bd8866dffc3d", - "signature": "2d434c9f7a565e0be17877a426377fef4365c14c60d30a1ade77bd8866dffc3d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts": { - "version": "94a0f2e6943b25cf1b5770f84377e3095ac19cded7971c6fe7596c841ecf4a50", - "signature": "94a0f2e6943b25cf1b5770f84377e3095ac19cded7971c6fe7596c841ecf4a50" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts": { - "version": "a06beded28475be9ce3f272ed0fd48d40b5b7bcfb5559a0de0aa382f6765b8d9", - "signature": "a06beded28475be9ce3f272ed0fd48d40b5b7bcfb5559a0de0aa382f6765b8d9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts": { - "version": "2640b4581d911ae1f6ee767681ec3441ed7de3f2ef0c4d5a3f58af2127f6a79f", - "signature": "2640b4581d911ae1f6ee767681ec3441ed7de3f2ef0c4d5a3f58af2127f6a79f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts": { - "version": "224b65ceecc1b83554d09f8d55a26092ceda10505f2538b25707060351881fce", - "signature": "224b65ceecc1b83554d09f8d55a26092ceda10505f2538b25707060351881fce" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts": { - "version": "0fe6506a0a6cb545cbf5a7b9aea9dfec282d387b937c5f12f42689ad1c298906", - "signature": "0fe6506a0a6cb545cbf5a7b9aea9dfec282d387b937c5f12f42689ad1c298906" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts": { - "version": "5abab0d6c1c2c0e5407f6aa778c57c2118de2c8a37ae5fe4e0f5779f71468cd9", - "signature": "5abab0d6c1c2c0e5407f6aa778c57c2118de2c8a37ae5fe4e0f5779f71468cd9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts": { - "version": "f404e080e45aa5e01cac38e5a2492526a00e82f32dd409c3647b0715c0873f63", - "signature": "f404e080e45aa5e01cac38e5a2492526a00e82f32dd409c3647b0715c0873f63" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts": { - "version": "64594656407e68b3b66a88f04d9bada1234083980b865117243e49b279418b93", - "signature": "64594656407e68b3b66a88f04d9bada1234083980b865117243e49b279418b93" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts": { - "version": "577ec7e5daee209e489fbfd3d1303544d433b972ffad3db3380e0b788f5f3f30", - "signature": "577ec7e5daee209e489fbfd3d1303544d433b972ffad3db3380e0b788f5f3f30" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts": { - "version": "e117ae345965bba35ea9b304916b7136d08509fd164c75a16307b3392945e3ca", - "signature": "e117ae345965bba35ea9b304916b7136d08509fd164c75a16307b3392945e3ca" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts": { - "version": "627522c3a2f5d3d28846f906a785c3418292a7a9b661da2df39cb4d515347c03", - "signature": "627522c3a2f5d3d28846f906a785c3418292a7a9b661da2df39cb4d515347c03" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts": { - "version": "f5886b8fdbd4a0d9c76ef3d9e1a08ebc51f0eecc3e14f1a26323b7a25f875119", - "signature": "f5886b8fdbd4a0d9c76ef3d9e1a08ebc51f0eecc3e14f1a26323b7a25f875119" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts": { - "version": "ab741e92bce1a0fae1233d915958cf4b107077966f19624e66ea652e6b611318", - "signature": "ab741e92bce1a0fae1233d915958cf4b107077966f19624e66ea652e6b611318" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts": { - "version": "59a796ec6116f65ced00bad6ce08d32fd7267affad616d53194b065949703ae8", - "signature": "59a796ec6116f65ced00bad6ce08d32fd7267affad616d53194b065949703ae8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts": { - "version": "62a43ddf5be87ca4534dec330b010095be97a2b61a8e4b513fcf50005071cd13", - "signature": "62a43ddf5be87ca4534dec330b010095be97a2b61a8e4b513fcf50005071cd13" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts": { - "version": "e05eb6ff740bfa863c1386b9ee4bd0431003606c55a8e074b34230099f0474fe", - "signature": "e05eb6ff740bfa863c1386b9ee4bd0431003606c55a8e074b34230099f0474fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts": { - "version": "7344d19cb067c997a63c2c4434ea5d76ccf9eb9f692c0ad9de2ab222121dc8a3", - "signature": "7344d19cb067c997a63c2c4434ea5d76ccf9eb9f692c0ad9de2ab222121dc8a3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts": { - "version": "29f8ee1c9522db16621ce5907209065459289884201428829a7ec9e5f44fa318", - "signature": "29f8ee1c9522db16621ce5907209065459289884201428829a7ec9e5f44fa318" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts": { - "version": "b5589fdeb2e85c2cec211a313b898a45f73267bcc24379e1f178ce8b5b4f79f2", - "signature": "b5589fdeb2e85c2cec211a313b898a45f73267bcc24379e1f178ce8b5b4f79f2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts": { - "version": "d674f0b341cb7b4690bab25bfb4cf7ddcc8bedd7c74534bc22e84af323064b88", - "signature": "d674f0b341cb7b4690bab25bfb4cf7ddcc8bedd7c74534bc22e84af323064b88" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts": { - "version": "8ec5137b3e39301bc9166784ded698d2f8afbaadbd82897e4d1cb3194b847828", - "signature": "8ec5137b3e39301bc9166784ded698d2f8afbaadbd82897e4d1cb3194b847828" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts": { - "version": "aa4e576ed0d1b474c2e6f7fd28cdeb3ca1ff3467bd8fa213adbc6802790159d8", - "signature": "aa4e576ed0d1b474c2e6f7fd28cdeb3ca1ff3467bd8fa213adbc6802790159d8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts": { - "version": "0c763c430cbe64b4cc3381100b841365890f1bf65b63983a774ccae8e267f685", - "signature": "0c763c430cbe64b4cc3381100b841365890f1bf65b63983a774ccae8e267f685" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts": { - "version": "93078221e31cadc0135be4a019905b161123ddcbdebf13fc8b551ad52484e26e", - "signature": "93078221e31cadc0135be4a019905b161123ddcbdebf13fc8b551ad52484e26e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts": { - "version": "29a37e98da6e5e91d6f5690b130917b81e75845454b88609c13e0e26f47b8e2e", - "signature": "29a37e98da6e5e91d6f5690b130917b81e75845454b88609c13e0e26f47b8e2e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts": { - "version": "52b60fc034c73ad978be27b1914437ea62115470f8631a3b67b4bc95ea6daa99", - "signature": "52b60fc034c73ad978be27b1914437ea62115470f8631a3b67b4bc95ea6daa99" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts": { - "version": "99d0192cf76ae728af45d207880d577491361420ee2153efbd78a85f70e07ee2", - "signature": "99d0192cf76ae728af45d207880d577491361420ee2153efbd78a85f70e07ee2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts": { - "version": "0feb230522bd343ff75e14ca46900dadc76de026b40990dde48c74cfeb9be1b6", - "signature": "0feb230522bd343ff75e14ca46900dadc76de026b40990dde48c74cfeb9be1b6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts": { - "version": "e451bf3b454c7ebaffb89995a576678695377f83268162c9a225817297c8bb18", - "signature": "e451bf3b454c7ebaffb89995a576678695377f83268162c9a225817297c8bb18" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts": { - "version": "ead27cd7ddb2d61b994ef40de69af397980a4f1f1f2067c77411f0ea2f3933a3", - "signature": "ead27cd7ddb2d61b994ef40de69af397980a4f1f1f2067c77411f0ea2f3933a3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts": { - "version": "69aebdc2a0a9ec7cc3754f2c1bbc2e9f4ea7785932adc0be5b6ecde4a191c63f", - "signature": "69aebdc2a0a9ec7cc3754f2c1bbc2e9f4ea7785932adc0be5b6ecde4a191c63f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts": { - "version": "e81400a34e97b491d7bcf56ecfe1f42d03e470b9f2dac7a02c7720e46c46a0e3", - "signature": "e81400a34e97b491d7bcf56ecfe1f42d03e470b9f2dac7a02c7720e46c46a0e3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts": { - "version": "4649949aedb645f9af7456e991948befacc0ce2e170f819bbac550101719e19c", - "signature": "4649949aedb645f9af7456e991948befacc0ce2e170f819bbac550101719e19c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts": { - "version": "7b6d5ed248d6ffc88617d7e4e8ec8585ae28b318d54ca5462e18216754aaf253", - "signature": "7b6d5ed248d6ffc88617d7e4e8ec8585ae28b318d54ca5462e18216754aaf253" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts": { - "version": "ffcf04ddc0bfc91b43349ae505d6ab41d747a0341481bbae47c028169588013d", - "signature": "ffcf04ddc0bfc91b43349ae505d6ab41d747a0341481bbae47c028169588013d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts": { - "version": "0d0f351fa5b05b92bd5a4d325f8e2ac04d10b5a6ecc5d7d21adc60f09b32ed96", - "signature": "0d0f351fa5b05b92bd5a4d325f8e2ac04d10b5a6ecc5d7d21adc60f09b32ed96" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts": { - "version": "e7113ccc4fc62029360516e7b21b29e69c0b118ed3523a33d812b10965aa1797", - "signature": "e7113ccc4fc62029360516e7b21b29e69c0b118ed3523a33d812b10965aa1797" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts": { - "version": "f2b95b0f5d15c2b1089897d2b4a08e433512aa39826b58b94be58f62b3a45ec4", - "signature": "f2b95b0f5d15c2b1089897d2b4a08e433512aa39826b58b94be58f62b3a45ec4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts": { - "version": "1545c4a6f1aa5ad645ceff6a1772e92212fd906216ca47f4d05f8dfee1b5f90a", - "signature": "1545c4a6f1aa5ad645ceff6a1772e92212fd906216ca47f4d05f8dfee1b5f90a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts": { - "version": "c7051ff2ce9c59e13ed1e4fcf31e6fe8ce21bf05b9d19c84cd86d57e4f0b971c", - "signature": "c7051ff2ce9c59e13ed1e4fcf31e6fe8ce21bf05b9d19c84cd86d57e4f0b971c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts": { - "version": "90b44b844925017b6cf29bf853a4c1f0f391a2920cae317a148dc22f54134021", - "signature": "90b44b844925017b6cf29bf853a4c1f0f391a2920cae317a148dc22f54134021" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts": { - "version": "a60f107742f0305f58093d1d7b3151fae0123847795518af781cfcb19177ecb3", - "signature": "a60f107742f0305f58093d1d7b3151fae0123847795518af781cfcb19177ecb3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts": { - "version": "03bfd3dfc1759c33426d6c37e5f193302749e825d50227579484a7dcd3f66ba5", - "signature": "03bfd3dfc1759c33426d6c37e5f193302749e825d50227579484a7dcd3f66ba5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts": { - "version": "75f36d5c97e01cb5af06d5f0defa14c866639d45773b1d97b0d525627effc45c", - "signature": "75f36d5c97e01cb5af06d5f0defa14c866639d45773b1d97b0d525627effc45c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts": { - "version": "1b3fe97aaa9d875b812c25d2f7cc76772354951c82f0960bb1ec2db49f99f7e3", - "signature": "1b3fe97aaa9d875b812c25d2f7cc76772354951c82f0960bb1ec2db49f99f7e3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts": { - "version": "705a765c5e7161f24773613e19fd4400723fdf2349e3c8241a0f67ad9a8dcb0b", - "signature": "705a765c5e7161f24773613e19fd4400723fdf2349e3c8241a0f67ad9a8dcb0b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts": { - "version": "86a49a18394cfe2ab3d3070ee8d01375916f4cdf3f6d2ac15b1e92f47e022288", - "signature": "86a49a18394cfe2ab3d3070ee8d01375916f4cdf3f6d2ac15b1e92f47e022288" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts": { - "version": "d2d31b5b3299949c748d46932a00b7b7471000c8458faa9fdb3edcf09c431630", - "signature": "d2d31b5b3299949c748d46932a00b7b7471000c8458faa9fdb3edcf09c431630" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts": { - "version": "a35546b9fb5fb60d38ae3c89398a143cc44aadd913676461654763e60e04dc8e", - "signature": "a35546b9fb5fb60d38ae3c89398a143cc44aadd913676461654763e60e04dc8e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts": { - "version": "d4528fffdf41351275d8ad67d886465262ad46fbfb53a9e0d3a97fe55231b947", - "signature": "d4528fffdf41351275d8ad67d886465262ad46fbfb53a9e0d3a97fe55231b947" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts": { - "version": "d75444f51584eff6d8a798e5a9beba2a0273bae9f17dc4503066a1502aefed47", - "signature": "d75444f51584eff6d8a798e5a9beba2a0273bae9f17dc4503066a1502aefed47" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts": { - "version": "4b41cf9593e273fc86b3c83a30663acf9b314f84c3f0f017d8d7a78f5bc76994", - "signature": "4b41cf9593e273fc86b3c83a30663acf9b314f84c3f0f017d8d7a78f5bc76994" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts": { - "version": "c367d89486726480184ee7b89f61bcd601fc24b1d04c25788ade7dd2262e4d49", - "signature": "c367d89486726480184ee7b89f61bcd601fc24b1d04c25788ade7dd2262e4d49" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts": { - "version": "ccaa16e696ab25c20809d3c328b14352813505dc9b71f962b75f5a9b3342d657", - "signature": "ccaa16e696ab25c20809d3c328b14352813505dc9b71f962b75f5a9b3342d657" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts": { - "version": "820bc4a363c93d3db1402f9470d0e718c90b13fd432adcb465154ed563d48519", - "signature": "820bc4a363c93d3db1402f9470d0e718c90b13fd432adcb465154ed563d48519" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts": { - "version": "7b6c0dc19bae641f6cca411f7c22e8c399d3adc787f92d9d272ebaed652182ef", - "signature": "7b6c0dc19bae641f6cca411f7c22e8c399d3adc787f92d9d272ebaed652182ef" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts": { - "version": "5e2afe70451ae831ca5a6962e048798e3b4ebd857ea498b9edbae7b9066828e4", - "signature": "5e2afe70451ae831ca5a6962e048798e3b4ebd857ea498b9edbae7b9066828e4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts": { - "version": "54f1c9bb93d7bea980d96a3ca33cf7154a2967c0feae09ac42bed5b8996e2389", - "signature": "54f1c9bb93d7bea980d96a3ca33cf7154a2967c0feae09ac42bed5b8996e2389" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts": { - "version": "2ac230575ae9e574a8347ade7baf8ed335e1ce69ed7219db6b7850246f327b0b", - "signature": "2ac230575ae9e574a8347ade7baf8ed335e1ce69ed7219db6b7850246f327b0b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts": { - "version": "d3363f2bd66bdf3ab86076ae0b2d5374878a87bbbdb013aeed3c498963bfdf32", - "signature": "d3363f2bd66bdf3ab86076ae0b2d5374878a87bbbdb013aeed3c498963bfdf32" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts": { - "version": "a28095bf2ae73b8274caa8c20517bd1327bd7f58ae18033dcce35bfc4c75cd18", - "signature": "a28095bf2ae73b8274caa8c20517bd1327bd7f58ae18033dcce35bfc4c75cd18" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts": { - "version": "7740f35c932ea9af6c2449778ff0870b0575462af4f7db0c1e22714432f094b4", - "signature": "7740f35c932ea9af6c2449778ff0870b0575462af4f7db0c1e22714432f094b4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts": { - "version": "fe913ac7f58efaa407896d6fe7c5bc3ec813a0f0f470ce74db6f0481029fecb0", - "signature": "fe913ac7f58efaa407896d6fe7c5bc3ec813a0f0f470ce74db6f0481029fecb0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts": { - "version": "74618244ddd74212fbe259b4d653eec0089c0232f1d1015e18cf88900194676e", - "signature": "74618244ddd74212fbe259b4d653eec0089c0232f1d1015e18cf88900194676e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts": { - "version": "8a87cd36d736e6b72be0837c4027532015c4ecdeaddff146f53ca1bcec384b10", - "signature": "8a87cd36d736e6b72be0837c4027532015c4ecdeaddff146f53ca1bcec384b10" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts": { - "version": "36cdea2d84242a4eeb3f84b47dda43e824b3b1e388eb6cd5b06dd426c3060a3e", - "signature": "36cdea2d84242a4eeb3f84b47dda43e824b3b1e388eb6cd5b06dd426c3060a3e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts": { - "version": "60814d74adda12ca646322bdddd9e314453ae82c13077c8d11d0fd466ab955cb", - "signature": "60814d74adda12ca646322bdddd9e314453ae82c13077c8d11d0fd466ab955cb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts": { - "version": "e57a5fa985c4a8b3f3fbc8ef2d22fa5c80e6c9b6c3435b6d6fffef1b09da16af", - "signature": "e57a5fa985c4a8b3f3fbc8ef2d22fa5c80e6c9b6c3435b6d6fffef1b09da16af" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts": { - "version": "42c3c0af8830f74c3231c238575d99f5d0f74f2569b155697120b85d5f0d0825", - "signature": "42c3c0af8830f74c3231c238575d99f5d0f74f2569b155697120b85d5f0d0825" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts": { - "version": "ff4b88510ec85acd59ea0f73c3a3b8edcd4cc08e88042436bce21218f3989d42", - "signature": "ff4b88510ec85acd59ea0f73c3a3b8edcd4cc08e88042436bce21218f3989d42" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts": { - "version": "97adefaf51cf0a2058da410d423516b4040ab5bfd45f775e757f121986010e09", - "signature": "97adefaf51cf0a2058da410d423516b4040ab5bfd45f775e757f121986010e09" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts": { - "version": "a04e4ba23a00febe6a17c72f32177569a5f9d1ffb80cb66de73f1084b9c3e54b", - "signature": "a04e4ba23a00febe6a17c72f32177569a5f9d1ffb80cb66de73f1084b9c3e54b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts": { - "version": "d0a0de034b67cfa3aa780eb178ad37fedb420c89b251678df053988f6b88c659", - "signature": "d0a0de034b67cfa3aa780eb178ad37fedb420c89b251678df053988f6b88c659" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts": { - "version": "a2f7676f96b533e17b6412dc6d60d5f28fe4685ca73fa9193ab6929f528e7976", - "signature": "a2f7676f96b533e17b6412dc6d60d5f28fe4685ca73fa9193ab6929f528e7976" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts": { - "version": "3384a0f45e46ae337a999a0b0de3a03f423c45765d7cfc6252929871228e60af", - "signature": "3384a0f45e46ae337a999a0b0de3a03f423c45765d7cfc6252929871228e60af" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts": { - "version": "239e92c7aa585f545c54a19c875b015aa08e3bda587e3d07fbaf6bac17e801de", - "signature": "239e92c7aa585f545c54a19c875b015aa08e3bda587e3d07fbaf6bac17e801de" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts": { - "version": "1787614bc43bae7f09805dd53c7e498f148820a4a2dcfd97d0ec9473e8cf59ed", - "signature": "1787614bc43bae7f09805dd53c7e498f148820a4a2dcfd97d0ec9473e8cf59ed" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts": { - "version": "fb0297b3c4e3702030240a56045af1e94c900d2652502058dd3d3da16c8007ab", - "signature": "fb0297b3c4e3702030240a56045af1e94c900d2652502058dd3d3da16c8007ab" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts": { - "version": "665a031b3d213704da57baaa4991d9876e391618c0b3591f216966cf32303ec2", - "signature": "665a031b3d213704da57baaa4991d9876e391618c0b3591f216966cf32303ec2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts": { - "version": "d22b34cacb914f819de163118364f3cd9bc9ed58ae7c00bbdcaf503141985393", - "signature": "d22b34cacb914f819de163118364f3cd9bc9ed58ae7c00bbdcaf503141985393" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts": { - "version": "d755b8ff24488c70d38c7c83a74701b2140f4878dcf327dbf9fc6d532129aec5", - "signature": "d755b8ff24488c70d38c7c83a74701b2140f4878dcf327dbf9fc6d532129aec5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts": { - "version": "5cd264a62f4ce2cec0e314523fc2b0103ba638e109c6579d1255caa4176578b0", - "signature": "5cd264a62f4ce2cec0e314523fc2b0103ba638e109c6579d1255caa4176578b0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts": { - "version": "cda0b00867f45a6e658a7a89824e2bbba341943c967e24a27bf5b14e00ea5110", - "signature": "cda0b00867f45a6e658a7a89824e2bbba341943c967e24a27bf5b14e00ea5110" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts": { - "version": "ce3d38aafb67d18a96a325aa7f39559b1427d494699c7f77b824aea3b126a4da", - "signature": "ce3d38aafb67d18a96a325aa7f39559b1427d494699c7f77b824aea3b126a4da" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts": { - "version": "2064f60c6d4e615e2b177057b4fcd8599f0dd513e08bda81f42c402dcd735eda", - "signature": "2064f60c6d4e615e2b177057b4fcd8599f0dd513e08bda81f42c402dcd735eda" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts": { - "version": "c63bf4d47ab57f6628630ce90c1d7c5384d024ce4466d0b05251a366764ca071", - "signature": "c63bf4d47ab57f6628630ce90c1d7c5384d024ce4466d0b05251a366764ca071" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts": { - "version": "87526c8d2ea66d7f614d9176e706504eaf79069a060ca47ffcf4e3e18c1514f0", - "signature": "87526c8d2ea66d7f614d9176e706504eaf79069a060ca47ffcf4e3e18c1514f0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts": { - "version": "a77e46db52cce73c12592092c1d504f7976f9a7966f110b9ad542d785d386603", - "signature": "a77e46db52cce73c12592092c1d504f7976f9a7966f110b9ad542d785d386603" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts": { - "version": "adf31df26353d133b0fd933432484885847d475ad2476b6d20d7552fd2727f41", - "signature": "adf31df26353d133b0fd933432484885847d475ad2476b6d20d7552fd2727f41" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts": { - "version": "6b68651f3aef650adb32d254b8946ac9bd6f0601646cc601e9ec9e8309aa1038", - "signature": "6b68651f3aef650adb32d254b8946ac9bd6f0601646cc601e9ec9e8309aa1038" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts": { - "version": "904e2413975ba8a1d4e5f88de5a0ca83d05a91124c49c6701e67ffd528525dfb", - "signature": "904e2413975ba8a1d4e5f88de5a0ca83d05a91124c49c6701e67ffd528525dfb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts": { - "version": "6716399536fa8bb82ce7f36db9e0c3935c8b1447e726d2293955f86dbae328de", - "signature": "6716399536fa8bb82ce7f36db9e0c3935c8b1447e726d2293955f86dbae328de" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts": { - "version": "548500cda794ee0c9431ea36a771645545153b4fb4cf5026c99fe8dd38e860e6", - "signature": "548500cda794ee0c9431ea36a771645545153b4fb4cf5026c99fe8dd38e860e6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts": { - "version": "001955d07af2fd3b8b4085a60966062a4520605684779830651731f7cdc8bd1d", - "signature": "001955d07af2fd3b8b4085a60966062a4520605684779830651731f7cdc8bd1d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts": { - "version": "037799529e1a633b8239a297426ba2c9a95c618be9060cb20ff6874496cc8ab1", - "signature": "037799529e1a633b8239a297426ba2c9a95c618be9060cb20ff6874496cc8ab1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts": { - "version": "216398a079fcc484bf33ab7caa797f12c072cbb0c481a333a575a46455a2dd1f", - "signature": "216398a079fcc484bf33ab7caa797f12c072cbb0c481a333a575a46455a2dd1f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts": { - "version": "922959297e66494139d17f2f835f564436b1260ae4fddfc9ff38d24663fdfbb1", - "signature": "922959297e66494139d17f2f835f564436b1260ae4fddfc9ff38d24663fdfbb1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts": { - "version": "0ad2fe191c19b77c818f7846e5a0da6202cae6b404e33bf17512490001744d01", - "signature": "0ad2fe191c19b77c818f7846e5a0da6202cae6b404e33bf17512490001744d01" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts": { - "version": "b14c47456306ee20d8d1da7c0be0b0a083d9f19ee8d1a635ae052fcd36a88b56", - "signature": "b14c47456306ee20d8d1da7c0be0b0a083d9f19ee8d1a635ae052fcd36a88b56" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts": { - "version": "338fecdd99cc811817359a87728119b430f6b2e231646925d9708b5c56e34491", - "signature": "338fecdd99cc811817359a87728119b430f6b2e231646925d9708b5c56e34491" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts": { - "version": "f2695dfb6623668f79fd008dc919ca21598039b2e7d3a33f5cc5f7438f326542", - "signature": "f2695dfb6623668f79fd008dc919ca21598039b2e7d3a33f5cc5f7438f326542" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts": { - "version": "ec4eb5d192b3f0a1f1f124f63fdaf95c22b6157bbac26aa1203bc1daffe6229e", - "signature": "ec4eb5d192b3f0a1f1f124f63fdaf95c22b6157bbac26aa1203bc1daffe6229e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts": { - "version": "ca9defc8825c8b1653f88720ab267b9c0dbd54a702f5bc80c4a8c4dc6258f99e", - "signature": "ca9defc8825c8b1653f88720ab267b9c0dbd54a702f5bc80c4a8c4dc6258f99e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts": { - "version": "372f7457a84afab08d1f69dd3769cf531599e3acbf223a18b9bd15f9887a06cb", - "signature": "372f7457a84afab08d1f69dd3769cf531599e3acbf223a18b9bd15f9887a06cb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts": { - "version": "5e6e517e2c03660cefd1584d2057801150588abf7f4fc3de2a85ad0aa17a2635", - "signature": "5e6e517e2c03660cefd1584d2057801150588abf7f4fc3de2a85ad0aa17a2635" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts": { - "version": "790ad9af4881bae3a2cce255dc44b72459158551b2078fb3d766869757ca48b3", - "signature": "790ad9af4881bae3a2cce255dc44b72459158551b2078fb3d766869757ca48b3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts": { - "version": "3deca59aac6b3efb137aecf3a4b8c041176d2f9fa847867db232d7486737d7d1", - "signature": "3deca59aac6b3efb137aecf3a4b8c041176d2f9fa847867db232d7486737d7d1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts": { - "version": "e8341a7a9a4a83652b1c82e4af00087be0774e1e152454dcbde3ce03f4132a16", - "signature": "e8341a7a9a4a83652b1c82e4af00087be0774e1e152454dcbde3ce03f4132a16" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts": { - "version": "359f5b40d5b83ea06ae25f98d2f31a3eeaa6c0ee3a39155ffde901c9367c3e38", - "signature": "359f5b40d5b83ea06ae25f98d2f31a3eeaa6c0ee3a39155ffde901c9367c3e38" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts": { - "version": "7640f6355c6229c4f901a11c4013ee197ccd97d75bcb13774eb4c39e2338f9bc", - "signature": "7640f6355c6229c4f901a11c4013ee197ccd97d75bcb13774eb4c39e2338f9bc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts": { - "version": "f376f768e27cf86b4142ee1c3273c93a49001e593b193ba596057b3bae3e8d77", - "signature": "f376f768e27cf86b4142ee1c3273c93a49001e593b193ba596057b3bae3e8d77" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts": { - "version": "a985143237b711c3fcfb739045988f80145e58125e1cc677f17e9e6b7871f867", - "signature": "a985143237b711c3fcfb739045988f80145e58125e1cc677f17e9e6b7871f867" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts": { - "version": "47fad50fbf38be585a2724cbb09fd4046f1622b66545da47de80271a55346af1", - "signature": "47fad50fbf38be585a2724cbb09fd4046f1622b66545da47de80271a55346af1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts": { - "version": "3efcb41fa229f7fe89c023e993da4f677ca00be76eabb3125aeefc85eccdf8cc", - "signature": "3efcb41fa229f7fe89c023e993da4f677ca00be76eabb3125aeefc85eccdf8cc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts": { - "version": "c1c529fa54d6d23e44662a83ddab8d401bda340345e568726647128eb7393ebb", - "signature": "c1c529fa54d6d23e44662a83ddab8d401bda340345e568726647128eb7393ebb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts": { - "version": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", - "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts": { - "version": "045bf15215ba0ceaf918990c8d1dedbd8764a7c7310cfc360885eb9fa22cf1eb", - "signature": "6cc88e024cdcbab848f84e17a359434c200f85b0d99eadc6e06888a583760bb2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts": { - "version": "c529f2085c3327b956e0cd6541af3fdd31611298b2b482f109a8c5226572cd5f", - "signature": "d83c5ed3d013562fcaec6d14de940bdbaad6e058a3591ef34644554f82d76085" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts": { - "version": "395b244164dcbccc9be7b4b609e1ef23769d31ad07b5a27ebfaa178876ae248d", - "signature": "8bd1b5129f031a9bf91d960a00bbfe966dca72e602a6aa3a55fa87e5a118e02a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts": { - "version": "55817b672aac7230ec1d5b8e683b340a0d4644dfc1660bf091880c47beb3d8e0", - "signature": "7f6cc469a9c80bc1f5ca5e63f9fd7e756ae6face3a8a13e43bf596da946cba5a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts": { - "version": "073ec3cedbe06be34d1eff395c768abf9b43692758f660b43ad8f7e9cfc10348", - "signature": "d78d0fde1c53a830cb34dfdbd7344b98c8b51b33d0356d20fa60c71cf988f0f8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts": { - "version": "77b379fac0101f863f38b8c0143818279a35cf6cbd50be9467a857ba5e80abe1", - "signature": "d45dd295dfd3546dc5fada66133066b78ada6528b6f97dc7d691b628fa8fc4ba" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts": { - "version": "4887ded75de1eb275e97b3185a6ba96b642114aea3d103025c1b30f3f844d0a2", - "signature": "ecef0485313e4084266b376d24e9bda7a95e863d9de16a522dc347c9cda008b6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts": { - "version": "f07374d7593994a7ff155e3775aae0447ed91188d2f1d31157026198c4d175f4", - "signature": "23960011769a27baff228accfee87c6a1d4f55ac7b41a2e5b01ee78260b7c55d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts": { - "version": "5f65578ead6752d549b1d4980b937e2ee7eed97efc92013ce481d6842c940eec", - "signature": "529646d690a3d5b5103e47f37ee9386f6a8810e9feb69f5198a79052cd3a7e1d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts": { - "version": "5ff570a803eb7e8b61081b63b338079c3ac2f1a76af67fd5a8215a265f9464f0", - "signature": "87d7cedce61d2a05d45e6a031b3a4eed96ac2cb533372164b87d5248be4d41c9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts": { - "version": "9f7be3fe54c23ae205642cc6a29bb449b9091f497a85de6f722e12813a143dbf", - "signature": "a41a97d0d39215d513f2bd3f5ba896ee08e90205b46eb05250f585c19663d4f8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts": { - "version": "30ced194176d0519220c7857043257006c5c6f16550779389e47935f84539adc", - "signature": "13a465a8c44eba6978f8bba926571445c7787932f7652356093b6031da09e0b7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts": { - "version": "8576b3dae36cdf5bacfea13b3325c598925b484a33295aee859581d6f0b8cb44", - "signature": "e4ad180e310d08956d20994764c98453499879ca6435c3e716edde2c9dfe55a1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts": { - "version": "b4c458ee28fef1a356307b9fe9e769c5dd6a99792ade450dc4a0d4eb985ab3c1", - "signature": "38832fa10f0fb0c7a6c95e79573950510cbf4716edd75d1a9b4eaf649027348c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts": { - "version": "d4e325ccd99f972f7f990212d2489fddef7bd80dc146aa9e1a0bff14c3683b33", - "signature": "711e85589a1fdb89a7c93f48a89685831a462129a983d162fbd78a00855de1c2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts": { - "version": "b90b9917e4314302be223763c5e859bea2615512a7614d5a17ff2855c567b258", - "signature": "7a853183c7b02cf75dd41f88807061b43f6c6c6a7b3bdc0efcd6a560145c874c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts": { - "version": "12b18dc36a130d445b6e4299e7a41f7508c2bba5bc81d634d95cb9d470d89419", - "signature": "6fce1ee4f71ed72ec2d8dc389b83caaca463a14315cc2b69c1930e9f2924ebcf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts": { - "version": "e84e8f5337a7b906e25b3ecd8ae168649e29c2887013125fbed494bd54ed8d79", - "signature": "75375f5283563d63e7626fc0db785dc623d3a668138bdaf32813fba3c3a5fdfa" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts": { - "version": "2cde5d782887b33747d69b67297027f5cc398fd687bcc026fd052f4d1a1bb249", - "signature": "089e54143e34c93c5acf0431113efbeae70d0732548ea5975451b02c3d278e3c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts": { - "version": "5244578ceb4fdaa73687ff3a62004afd8e0e6e983e5ae30c52240ea14b9fd7af", - "signature": "ab5ffabf6d48d324a2fec94302d113a8e17d1c1f8717bb70bc3d5ef765a68af8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts": { - "version": "2378253d37ae3a9cb05613859a797a9d3f779173e27557efe64debd7b7b1d595", - "signature": "139a8f380bf367507be0bd32a9789fb0855cdf984958edfd9b2e3f945ed9340d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts": { - "version": "c65dc144a96ee3acc972e855a0c420f38a1c2c87126416976170b9dfd0e269e3", - "signature": "cd656af83ba47b9348fd0aae1badf295b8ade7c067858b95da9835c2ce4c4007" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts": { - "version": "dd315eacab967f43ddcf4cf3a5aa4455ddc9d4ac0c94744764e9cf0d6f798097", - "signature": "13501fa78093455748c0784e6b3a16a1496f4b85e7cad29342823f23b478d1e7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts": { - "version": "c68b96e1ce7795530bb6ddb67b3e5ca48afc75df3789193ba9a260622cfaaea3", - "signature": "82826f9dc7ccbc0162f6ac9c890a6e11b702ab2d4962d5073814c16b11a97ad0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks_test.ts": { - "version": "b373ab8720b56660198e507b495671aa6d1f164923d530fc5893391a9ae4221b", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks_test.ts": { - "version": "f6ad0a60d604c591f8e7d01fbd3128b181bcda8207948cdee33c61c858d48e08", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/common_test.ts": { - "version": "0d91753ad5c3aaeb16f6e4d002aac6e61720c33ac5667c023f3c378c81f9db0e", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints_test.ts": { - "version": "cbce9fd42910a6c75be7e86acc96bcfe3c43e2cb5f5efbc8f6b6206d118ff446", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/errors_test.ts": { - "version": "76ddfe666683f1cf877c5f63f3184e4ce35da24623438078351f76d8c0b86cde", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers_test.ts": { - "version": "fabf5de65cd359249344873562c842c1609424240bc48a9119240e9a8f5530ba", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/losses_test.ts": { - "version": "9e972f5f77c1f0a112d33e80e859d0734d563cc94fee29268e1e0d23c4a527df", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics_test.ts": { - "version": "dc9aceae8cf3966f182c48669e7f8c3a50e41aa08b1553e37b6e8438d0f6a4cc", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/model_save_test.ts": { - "version": "89315efe9aad82e2fadc64b55d7c1ae4d0cb12f4401964d009317d83bb52f14d", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/model_summary_test.ts": { - "version": "cde443fe5228ed3dcce149655d8f023c57eafab79cde7f11749e4be762e44c23", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/models_test.ts": { - "version": "fbe61e166e11b5589b4e229bd9fa941f8b8a58a3471871bfefdb9f502f3a166b", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers_test.ts": { - "version": "326f9106f8a028092c3f7ab5909506a1553a15f8036a6df920dca357e4653b4c", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers_test.ts": { - "version": "84843f1f5928fd0f0cd1bd562be777f513e77d275c327d8be0c496f23050bc4d", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": { - "version": "44b1fbef93b4ca93bd59cee4da7916070c035e55198accec24438d4c61d6e680", - "signature": "44b1fbef93b4ca93bd59cee4da7916070c035e55198accec24438d4c61d6e680" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": { - "version": "f11ce27db76fe05e817e9ed1f5d333ff3b35e4d5c62b4da129671aebe2811817", - "signature": "f11ce27db76fe05e817e9ed1f5d333ff3b35e4d5c62b4da129671aebe2811817" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": { - "version": "39f0464c9c08f8985b194fb154ab8a60bde16291a80c748ab97b8c175d38a58e", - "signature": "39f0464c9c08f8985b194fb154ab8a60bde16291a80c748ab97b8c175d38a58e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": { - "version": "9659828681b7b7082e980b0ea68ac12a1d21e21e1ef7840107083b0b10522ae2", - "signature": "9659828681b7b7082e980b0ea68ac12a1d21e21e1ef7840107083b0b10522ae2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": { - "version": "8d1a624a8c99cb27f02a355ac5b5f02952563c18e37336b46f1054df0796652d", - "signature": "8d1a624a8c99cb27f02a355ac5b5f02952563c18e37336b46f1054df0796652d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": { - "version": "3a3c95fc1f93f8c12da29e830da071d56f4a4da25da9fd58a444240e589e34f2", - "signature": "3a3c95fc1f93f8c12da29e830da071d56f4a4da25da9fd58a444240e589e34f2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": { - "version": "041d8fdbe234c00ed74ca9c4575c508b589cdac3b5ae6fddb213cf35b6a8e5b5", - "signature": "041d8fdbe234c00ed74ca9c4575c508b589cdac3b5ae6fddb213cf35b6a8e5b5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": { - "version": "7fbb43be1f78af4c2dedbbbf578d976c36107fe9ef40a40320ef2603a049080b", - "signature": "7fbb43be1f78af4c2dedbbbf578d976c36107fe9ef40a40320ef2603a049080b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": { - "version": "4c86d1e1aaa27a35210b1656a610f63ccb75f49b74afcdcbf160516827b92996", - "signature": "4c86d1e1aaa27a35210b1656a610f63ccb75f49b74afcdcbf160516827b92996" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": { - "version": "b810b5d85042d5fde78dfa964453a3dc949a911ef94fa1a8efb52c9378a858e4", - "signature": "b810b5d85042d5fde78dfa964453a3dc949a911ef94fa1a8efb52c9378a858e4" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": { - "version": "d8acfe7994e794625e6cb6665e8fcd9d40c5f8981dd7081f60ab6e63daff9bb7", - "signature": "d8acfe7994e794625e6cb6665e8fcd9d40c5f8981dd7081f60ab6e63daff9bb7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": { - "version": "f38868f7d0aae87e644142b5a5fbfc062ecc57ab9535c03869b47791f022f1f5", - "signature": "f38868f7d0aae87e644142b5a5fbfc062ecc57ab9535c03869b47791f022f1f5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": { - "version": "a7d0885cc4b1f233dd3dd97fadd8e4e59c69f6fb8aff61ed95b376315cbac4f5", - "signature": "a7d0885cc4b1f233dd3dd97fadd8e4e59c69f6fb8aff61ed95b376315cbac4f5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": { - "version": "e9c37e8f77721a3fc2a409561c49441eb70d112170c204a9a1fcd4538e3c936c", - "signature": "e9c37e8f77721a3fc2a409561c49441eb70d112170c204a9a1fcd4538e3c936c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": { - "version": "7b409fa170070a8da0965171132736dfaf18909900a7ea6b1e78620fb0431239", - "signature": "7b409fa170070a8da0965171132736dfaf18909900a7ea6b1e78620fb0431239" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": { - "version": "5799c368be85cba206864ec0a26185bb8b6b073205b0b846a609ed2a16131a65", - "signature": "5799c368be85cba206864ec0a26185bb8b6b073205b0b846a609ed2a16131a65" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": { - "version": "4fc71e0df1212078642650dfec6ef92e5f679e5988469befe46afbefe3bde6d5", - "signature": "4fc71e0df1212078642650dfec6ef92e5f679e5988469befe46afbefe3bde6d5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": { - "version": "d66d059667a71fc5ac69d2d63c1587c4a7f3910d660a43516c5755276e7fb06c", - "signature": "d66d059667a71fc5ac69d2d63c1587c4a7f3910d660a43516c5755276e7fb06c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": { - "version": "70b9eeb73ad07f0dfdcc7387762c96c4f3e80a8e99035c62a8a8097fe3618ffc", - "signature": "70b9eeb73ad07f0dfdcc7387762c96c4f3e80a8e99035c62a8a8097fe3618ffc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": { - "version": "920a76dd5bd0555e29fd1dc2ad76ead46efa2c5b13f70b4fb32f1e8f38f8a01b", - "signature": "920a76dd5bd0555e29fd1dc2ad76ead46efa2c5b13f70b4fb32f1e8f38f8a01b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": { - "version": "e084466eb25f3e1428bca0c09bde58700764fcf08793cfcc3b126504120d5a20", - "signature": "e084466eb25f3e1428bca0c09bde58700764fcf08793cfcc3b126504120d5a20" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": { - "version": "56d19a60a58d1869a7e1f29cf6f5c15efe21022e849bb72f8f3b40ce8df2fca5", - "signature": "56d19a60a58d1869a7e1f29cf6f5c15efe21022e849bb72f8f3b40ce8df2fca5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": { - "version": "0be18aded4466ff961dceb469c4bec795953726a7cf9b865a3896e47b6c5abe0", - "signature": "0be18aded4466ff961dceb469c4bec795953726a7cf9b865a3896e47b6c5abe0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": { - "version": "745fba44dfedf962b50f7a8828dcc9ea5ea5e35eb27d52c0b2c71b265a8cbfe6", - "signature": "745fba44dfedf962b50f7a8828dcc9ea5ea5e35eb27d52c0b2c71b265a8cbfe6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": { - "version": "2b5aaff17c0701143ec24dbc73f2bb0ddcf7b220bc0a71e38f384518c6d88a4f", - "signature": "2b5aaff17c0701143ec24dbc73f2bb0ddcf7b220bc0a71e38f384518c6d88a4f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": { - "version": "400e9e4aa9c433f2bb693a8fae24ff675527691a270a63da9cb3a40ab9d28154", - "signature": "400e9e4aa9c433f2bb693a8fae24ff675527691a270a63da9cb3a40ab9d28154" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": { - "version": "b0d010e95a4964aef0e17ba4353c52e6bc766a1be2b4901fdbe76f16a5420735", - "signature": "b0d010e95a4964aef0e17ba4353c52e6bc766a1be2b4901fdbe76f16a5420735" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": { - "version": "aa8c80d3a04b5bb4f0a51d64168a30cafc8ef6bef0eb46b5dd137e19775613cc", - "signature": "aa8c80d3a04b5bb4f0a51d64168a30cafc8ef6bef0eb46b5dd137e19775613cc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": { - "version": "86ac2e63cde417edc528df02d0542640310c803eb589eb4de520037b2763b389", - "signature": "86ac2e63cde417edc528df02d0542640310c803eb589eb4de520037b2763b389" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": { - "version": "b9fb743e4cca9acab98e7236806f180e1426997b7d2520e9a918878a67217485", - "signature": "b9fb743e4cca9acab98e7236806f180e1426997b7d2520e9a918878a67217485" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": { - "version": "f9b00a106118ef7c7909a13dacd6738c2d5998fddb2321933f0862608ede9e79", - "signature": "f9b00a106118ef7c7909a13dacd6738c2d5998fddb2321933f0862608ede9e79" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": { - "version": "f40cee4c39dcc6224977ee27a4ebb2ee4504c81508ac12cbde1906362c405fea", - "signature": "f40cee4c39dcc6224977ee27a4ebb2ee4504c81508ac12cbde1906362c405fea" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": { - "version": "21bbca7d159962db3a39761906cb39a205ef927b94e9acc2e9330a6fe16f747b", - "signature": "21bbca7d159962db3a39761906cb39a205ef927b94e9acc2e9330a6fe16f747b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": { - "version": "3d37946e11188a1c8a06c652734ae08d9025ded293f43f4d19a2fb098d59f701", - "signature": "3d37946e11188a1c8a06c652734ae08d9025ded293f43f4d19a2fb098d59f701" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": { - "version": "e51e2517c253d86256f3eac5fa39f25a65489c9ac0d2694e6628a7ae87f5aa8a", - "signature": "e51e2517c253d86256f3eac5fa39f25a65489c9ac0d2694e6628a7ae87f5aa8a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": { - "version": "57bfe17cb530761ad65d2e6163f17915807db9d739bef97972662d9194bbe6f7", - "signature": "57bfe17cb530761ad65d2e6163f17915807db9d739bef97972662d9194bbe6f7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts": { - "version": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": { - "version": "aceecabeef1218dc0b6c94e9a813cff98166761611469bec20b9cfe9824edcdc", - "signature": "aceecabeef1218dc0b6c94e9a813cff98166761611469bec20b9cfe9824edcdc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts": { - "version": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", - "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": { - "version": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6", - "signature": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/version.d.ts": { - "version": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts": { - "version": "bc7770ea3502034bdb3fec4ea10f7c79559ae940510c0d9ea36d356478c6e56f", - "signature": "bc7770ea3502034bdb3fec4ea10f7c79559ae940510c0d9ea36d356478c6e56f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts": { - "version": "ad791e1f51795752a31be73c502592acfe30e1e9003b12a9eb58be798866ec69", - "signature": "ad791e1f51795752a31be73c502592acfe30e1e9003b12a9eb58be798866ec69" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts": { - "version": "2647bed3790eeb94f0370d9ec88624e2bbd6c5982b108508a6468b55a22d5c63", - "signature": "2647bed3790eeb94f0370d9ec88624e2bbd6c5982b108508a6468b55a22d5c63" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts": { - "version": "c8599f03aecebf6b1b1bb5ad8149e789ef458ffbc9a35b4e6be6edae241ecc0c", - "signature": "c8599f03aecebf6b1b1bb5ad8149e789ef458ffbc9a35b4e6be6edae241ecc0c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/flags_webgl.d.ts": { - "version": "7ab4599ea84fe926131e6209c3cea2a8a2a2bda6b1bb31739736492a2e2ebf52", - "signature": "7ab4599ea84fe926131e6209c3cea2a8a2a2bda6b1bb31739736492a2e2ebf52" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts": { - "version": "003e6a0952424af3b251c6a0a4027bea1a98a0cb519f150afb2531fa98d717d5", - "signature": "003e6a0952424af3b251c6a0a4027bea1a98a0cb519f150afb2531fa98d717d5" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts": { - "version": "5102cd1c6b41883694bfa051fba84030530898e99b6d6f44ddcc5b8c5f4baa03", - "signature": "5102cd1c6b41883694bfa051fba84030530898e99b6d6f44ddcc5b8c5f4baa03" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler.d.ts": { - "version": "cc5bad82ffcfd8ed81f24aad4584cdeadbfabb62f7f6c464be54d928b65196d8", - "signature": "cc5bad82ffcfd8ed81f24aad4584cdeadbfabb62f7f6c464be54d928b65196d8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts": { - "version": "ed9559a2b62360560f816921fd8f3d75104e857bf0b4f69911b3ce30b646b60b", - "signature": "ed9559a2b62360560f816921fd8f3d75104e857bf0b4f69911b3ce30b646b60b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts": { - "version": "72c340e5b9726a3375aac4e03a9d63b41853c65f5181fd3373be9562099f0e3e", - "signature": "72c340e5b9726a3375aac4e03a9d63b41853c65f5181fd3373be9562099f0e3e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts": { - "version": "0bdabbb6e3d6227c6f6fbf44526856e96ae6209a219f4a343a8c614bb38f25ba", - "signature": "0bdabbb6e3d6227c6f6fbf44526856e96ae6209a219f4a343a8c614bb38f25ba" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/canvas_util.d.ts": { - "version": "85d2198bc5c04add592058d54ee4435246da0c0cce55d45207a8698b25793018", - "signature": "85d2198bc5c04add592058d54ee4435246da0c0cce55d45207a8698b25793018" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts": { - "version": "7355a43a94f6d44bc7416b5e4508265a338662ff653762e3464175545f5fd1c6", - "signature": "7355a43a94f6d44bc7416b5e4508265a338662ff653762e3464175545f5fd1c6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts": { - "version": "fc72568a4439e0535f02baf274c4e7b7e67adf513810f08f3cd4412092c7eac0", - "signature": "fc72568a4439e0535f02baf274c4e7b7e67adf513810f08f3cd4412092c7eac0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.d.ts": { - "version": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", - "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts": { - "version": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6", - "signature": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/setup_tests.ts": { - "version": "46a8a1e8fad6c27dd7d1f99155a4604c07c0512d133dfaeaa4784d0e9f506728", - "signature": "42419113757656c9d52651c07c1a360bd07ba503ff1b7cac477a3d085a3994d0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/types_test.ts": { - "version": "f370e49eaf693171d2badcbcbda9cdbefe6fc79fc826f81c7096e069cff65c70", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata_test.ts": { - "version": "261c4321116fd681bdb20fc8a8a1e9b62294bb5a3356dde6580c45666a159dd0", - "signature": "ad9d27e984a903562a88bb574c61f0e09636a0c2050bc06b9a0a38955e9ba822" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/variables_test.ts": { - "version": "01591a9da843c0c9eaff408cb41745ae8cd8d4690781e63741abc6763151ae67", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/version_test.ts": { - "version": "0bb6859691e1e99b4f35ea680c30c941f0e2ab02cb9a9316ccec891d90cc2456", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state_test.ts": { - "version": "060ddc86777db849bc111159f9d00278aec57b9ae22f3d661d0d02fd8078869f", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend_test.ts": { - "version": "d5850547ba2f6be1d97772266ef86b3f47439616833c1333ac991d70e6dc008e", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container_test.ts": { - "version": "e918e65aae88bb1cea65db1333e13affaafb99a151db9534bd9cae3fbb59fad0", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts": { - "version": "10cff3b72836485b6cb7f279d6502f988022d0b4e84666456ca871518c9c17c2", - "signature": "a34814dad293a48456ca10e50f9fcc53aee8539f18dadf9b06e0e15243641653" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes_test.ts": { - "version": "e1d3edd430265127167fec965af955f0e4c826e2556e2b634acb689b04030d05", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor_test.ts": { - "version": "3ed4378550c776b615af761f4db6a2dd0a25f9e3d7cfafa16870bc241f469445", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer_test.ts": { - "version": "71fe99dffa6929ed79a3f38c5859d180e36f85d4a6a8dff8035312d99eb1f6dc", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology_test.ts": { - "version": "6e7023d3f55ef36ab5cef194c9ebb1cc771daab0dbbb4843284822dfd9752a81", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset_test.ts": { - "version": "d05454037384c85536adfd8d0698ea920fe2b3a71daaa9f9133a2a13122e1d02", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_test.ts": { - "version": "02172d9d002c03e78b2ce90c69435b3d1400369bf1a6f1664c6c76f6858ee8c9", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils_test.ts": { - "version": "310495a240ac4cc67c0ba67f71f3bfbff5097111e1ff889433ddf6dc39aada1e", - "signature": "ad9d27e984a903562a88bb574c61f0e09636a0c2050bc06b9a0a38955e9ba822" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_weighted_test.ts": { - "version": "8c1c3924e70031d6c071a5d6599d3d39cbf589ef5ee00012d550a9d88b2c965f", - "signature": "ad9d27e984a903562a88bb574c61f0e09636a0c2050bc06b9a0a38955e9ba822" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts": { - "version": "905e24d89ca6f17bb628f2580a03fedcc832df202f8ba60c0131742ea90a5388", - "signature": "93a490bdf339e1f3058d8d1664984f26e0caaf559a8e288e70320e16025f0e07" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts": { - "version": "993f3e5334f08e46377e1216145a14daa05507e263c0c099e027a9b16acdbf9f", - "signature": "1a4ecfe0b7c1c6cd03b25c3d622185c6cbd0b4bcd9c0acf7ecbbd6cf6e39492d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts": { - "version": "0fece183946533835426089658748d1445347e6a4fdcc0b9e81c9eed481e6924", - "signature": "7bf70d7beef3ee51ad4cbae0155559c2ad7a6d8bdecafb65473deaaf2dd0dc98" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts": { - "version": "6da8c92d21a8b6322dc72bc41970799b162f7db5490c826855c916d3e9279565", - "signature": "00db12eef2a07115dfaaf0938e1cc139bdcc3b6adfea594367fe921ff1818067" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts": { - "version": "caab05b85c6107b903e8b0a6d226aae0ff6a38c831a45ba475131e6c7eb94f2b", - "signature": "08d16915dfff0e4bbb9a849bce46afa3ed484c0010f6ade95dc6dc821057318d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts": { - "version": "ca19a0ee1cb29ae0e4c7c45cd1482f12da824fe700a579dd07d292b2b20dd5c2", - "signature": "d11b77c9d643c5089951f90cf2cdb136dc33646a3a515056591ed4561be08ad3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts": { - "version": "39bbf756102330816585c7edae307dd13f3b655a4b37c7d42b89546fc03726ab", - "signature": "d4ccd99a85fb187bbb2178cfc33af74002239bbe0de6fcc6a7a1138dc6aed5df" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts": { - "version": "bc0cc40c4e5c5622660cd2787c74414334d8e43e76a931631c0e2ed93d0f12d4", - "signature": "f6b171909ae15b4b851770dc72e94818a030703745cac534e8f7dc472226aebf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts": { - "version": "7f009f78b6df1cc847413e562177bb445d38c88814e94019242e8b2bca2dccc0", - "signature": "f089549ba4b8987cc5979637948373e1c9ef154a14e2fcfd8cca394d4af2ce4c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts": { - "version": "e815f0fec9a315a8c3e28a1bde442e5a505ba030fa3330695845c9dc3beba71a", - "signature": "9b8fcacd0c3ef8b1f769896de7cedb283f0e9b4f08e1accbec9f07594ff058a7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts": { - "version": "84e769b40d060aaa69e4a8722d9dbc129e2f8bcd3240256bb375cffdc62a28ac", - "signature": "eda785d1175204d485810472973d465795094a96f74e83c76878e8a6b7a17c6e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts": { - "version": "c3b1af043e4d16fea399a5ebe65e901daf0d782a7d478ddd25a3258cb6c89fbd", - "signature": "eda80e632f3519142eb913a7a0a70714490c5d9e7cbc979faab2ad26649fabd1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts": { - "version": "76b43f7ea1c8f46500b09f89282ec2555e341dae916044f74ebe2b03e1a3c382", - "signature": "3b53c677f5ee89f21e6675638f72a4907d991f41911c3be64c11399c32f1abf8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts": { - "version": "382752c73880b00dead2756c07f99354bc1a2c357aa8ac9dfb798be21a328f24", - "signature": "69c06a16e8d71cf4deb01732bc85e091862a78d3c91a9cc0f666e1d7176b245d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/keras_class_names.ts": { - "version": "ac8f068d51b72905fc3774442c44c779d1ef198c4bc81af92a09e580a9763b31", - "signature": "93cd36c432ca675f232a063fbe91a23b80cfd7ed10f4a666397a05a5abc941c2" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/model_serialization.ts": { - "version": "80cad7e3864c295827109d981dbff1e41f99a4f62746b161b9952ddc55a31901", - "signature": "5939eb7ca1ef127ba0ed4c07dcc816d8c9d1801b134d29f19d7e9bd45b5aa5a3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts": { - "version": "3c3a34c0c95d03d2beea59c0c99e6e264e35e4d83b114432470f175e15d758e3", - "signature": "d12f2d638a0975220a6b0e8f66aa5e246d2a578bc38c23010d8c0c83e9147b3b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activation_test.ts": { - "version": "32c5ed5145b66748fa3cfa4eab5852ec9d5ad21cdcd7e7d2b2907815f6cc76b4", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise_test.ts": { - "version": "35e0ec9f168e09ca82ce6df9d8e045accc39cf785a2e3db0f63c1d5d9806dc47", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent_test.ts": { - "version": "25cd7c9b3c1d05ae1cd33c3cbfc68b4b050b2e30e55a65d7857cd92634ae9ec7", - "signature": "8e55167576f32c3145f99f910d587e425a58fcb35e717e26aa74e7ad8c9b1bba" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_test.ts": { - "version": "e1cbc2ac3eaae4b5808ac24a4cf2fbcfad894a5a523f1b5d504e7e955c7b36cf", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core_test.ts": { - "version": "651cf010b96894562e255171a9c71cf776ee59c8986205ba596de10eafe9eb9d", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings_test.ts": { - "version": "b9a5dc51c0f55247bdf7c05bce5153cdd500096589f6180e67ef28222db75fa0", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge_test.ts": { - "version": "f5a7b9827b8ff133b86c84513d06ede5ea0aba948468d9ca036b5a69547cd4fc", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise_test.ts": { - "version": "d16188f63b0c8ccb606b15da9f374be79644c93abd3718dbbf86aa2e874690c9", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization_test.ts": { - "version": "e53027558afc73f7aa1b64b652a2daf24e6336e9c1dcee347b4264c004fd3b2b", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding_test.ts": { - "version": "05c3bd4d341e17f6cc2ff1e73f1fccdc2ceb32f304ef7788dfb4dec1a76caf59", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling_test.ts": { - "version": "7ed6d4b4148046e7170b563ec37a14fdd373b207bed722151fa85c70a9c40b4e", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent_test.ts": { - "version": "5bc42f2d9a069701c934192390bdd6efd37584baccdf8afd07f25394234d67ae", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization_test.ts": { - "version": "33e4a797ff8f1cd64ced2f9fde5d5510ebda76f642587b1f164bdb00c45aca4a", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers_test.ts": { - "version": "f8d7ab3aeaacedcfae50af6cf4fae082dac8a1b8eb3d836af2f06d2589495430", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils_test.ts": { - "version": "7b43286f95f8572730885c1c80a56fc41d676dcea56a830a7845ea792a442a1b", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils_test.ts": { - "version": "d074ddd502476643e3d961a4623108c2cbf480eb9cd982add0cea61cdcfd9df8", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils_test.ts": { - "version": "1f1910d8abdfbf92995ea1eb29d6bd3c6fc64c1d5e4c92fbafea4454d2895666", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils_test.ts": { - "version": "5c09b76aab5d846d5586e125e58f7078bca322069cdfbf4d20b2700917dac61e", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils_test.ts": { - "version": "738082ab65e5e039f257a3cdc57ab509d6e08f53aa0b50352f623df1f762dde5", - "signature": "4c68a516cea6fcf416f5b6bad2386d93c49570e6f3405d6009b58e42a8b234fe" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/component-emitter/index.d.ts": { - "version": "a3a88c1869ba1022dfaefac47ff7a984ec62510e9b4d60988f91d5e523266c34", - "signature": "a3a88c1869ba1022dfaefac47ff7a984ec62510e9b4d60988f91d5e523266c34" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cookie/index.d.ts": { - "version": "405ad6db8aa3d5618c3be21cde8125de28a3e40690eb05136c123f420c05c082", - "signature": "405ad6db8aa3d5618c3be21cde8125de28a3e40690eb05136c123f420c05c082" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cors/index.d.ts": { - "version": "a68969f643e0cb091046a9437b64cb1880a081fc07c70a4717b0edef2a38bc85", - "signature": "a68969f643e0cb091046a9437b64cb1880a081fc07c70a4717b0edef2a38bc85" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/estree/index.d.ts": { - "version": "f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320", - "signature": "f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/jasmine/index.d.ts": { - "version": "ead8cd125d2c92993ec86f60fd88ab821275e7cd902d65650cc27146c9d5225a", - "signature": "ead8cd125d2c92993ec86f60fd88ab821275e7cd902d65650cc27146c9d5225a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.d.ts": { - "version": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", - "signature": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts": { - "version": "7698983d080f951eaf53ff81e5c7bd61abc02e4a1a21266f1bd79ea85c0dc641", - "signature": "7698983d080f951eaf53ff81e5c7bd61abc02e4a1a21266f1bd79ea85c0dc641" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts": { - "version": "5726b5ce952dc5beaeb08d5f64236632501568a54a390363d2339ba1dc5393b1", - "signature": "5726b5ce952dc5beaeb08d5f64236632501568a54a390363d2339ba1dc5393b1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts": { - "version": "674bedbfd2004e233e2a266a3d2286e524f0d58787a98522d834d6ccda1d215a", - "signature": "674bedbfd2004e233e2a266a3d2286e524f0d58787a98522d834d6ccda1d215a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts": { - "version": "714637d594e1a38a075091fe464ca91c6abc0b154784b4287f6883200e28ccef", - "signature": "714637d594e1a38a075091fe464ca91c6abc0b154784b4287f6883200e28ccef" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts": { - "version": "23edba5f47d3409810c563fe8034ae2c59e718e1ef8570f4152ccdde1915a096", - "signature": "23edba5f47d3409810c563fe8034ae2c59e718e1ef8570f4152ccdde1915a096" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts": { - "version": "0e9c55f894ca2d9cf63b5b0d43a8cec1772dd560233fd16275bc7a485eb82f83", - "signature": "0e9c55f894ca2d9cf63b5b0d43a8cec1772dd560233fd16275bc7a485eb82f83" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts": { - "version": "d53b352a01645c470a0d8c31bf290ba791fc28ade0ce187a4a50f5c2f826f75e", - "signature": "d53b352a01645c470a0d8c31bf290ba791fc28ade0ce187a4a50f5c2f826f75e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts": { - "version": "5f0a09de75bd965c21dc6d73671ba88830272f9ed62897bb0aa9754b369b1eed", - "signature": "5f0a09de75bd965c21dc6d73671ba88830272f9ed62897bb0aa9754b369b1eed" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts": { - "version": "2b34e7fcba9e1f24e7f54ba5c8be5a8895b0b8b444ccf6548e04acdee0899317", - "signature": "2b34e7fcba9e1f24e7f54ba5c8be5a8895b0b8b444ccf6548e04acdee0899317" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts": { - "version": "06d2be99c3dd2ff52114d02ee443ba486ab482423df1941d3c97d6a92e924d70", - "signature": "06d2be99c3dd2ff52114d02ee443ba486ab482423df1941d3c97d6a92e924d70" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts": { - "version": "bfd4f140c07091b5e8a963c89e6fa3f44b6cfcbc11471b465cf63e2d020ad0eb", - "signature": "bfd4f140c07091b5e8a963c89e6fa3f44b6cfcbc11471b465cf63e2d020ad0eb" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts": { - "version": "a106a0bea088b70879ac88ff606dc253c0cc474ea05ad3a282b8bfb1091ae576", - "signature": "a106a0bea088b70879ac88ff606dc253c0cc474ea05ad3a282b8bfb1091ae576" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts": { - "version": "c98ce957db9eebd75f53edda3f6893e05ab2d2283b5667b18e31bcdb6427ed10", - "signature": "c98ce957db9eebd75f53edda3f6893e05ab2d2283b5667b18e31bcdb6427ed10" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts": { - "version": "1f08bd8305d4a789a68f71ab622156dfff993aa51a2aa58b9ccf166cc6f9fcf7", - "signature": "1f08bd8305d4a789a68f71ab622156dfff993aa51a2aa58b9ccf166cc6f9fcf7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts": { - "version": "9aff68f1b847b846d3d50a58c9f8f99389bedd0258d1b1c201f11b97ecfd36f8", - "signature": "9aff68f1b847b846d3d50a58c9f8f99389bedd0258d1b1c201f11b97ecfd36f8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts": { - "version": "1978992206803f5761e99e893d93b25abc818c5fe619674fdf2ae02b29f641ba", - "signature": "1978992206803f5761e99e893d93b25abc818c5fe619674fdf2ae02b29f641ba" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts": { - "version": "05fbe81f09fc455a2c343d2458d2b3c600c90b92b22926be765ee79326be9466", - "signature": "05fbe81f09fc455a2c343d2458d2b3c600c90b92b22926be765ee79326be9466" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts": { - "version": "8e7d6dae9e19bbe47600dcfd4418db85b30ae7351474ea0aad5e628f9845d340", - "signature": "8e7d6dae9e19bbe47600dcfd4418db85b30ae7351474ea0aad5e628f9845d340" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts": { - "version": "f20ea392f7f27feb7a90e5a24319a4e365b07bf83c39a547711fe7ff9df68657", - "signature": "f20ea392f7f27feb7a90e5a24319a4e365b07bf83c39a547711fe7ff9df68657" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts": { - "version": "32542c4660ecda892a333a533feedba31738ee538ef6a78eb73af647137bc3fc", - "signature": "32542c4660ecda892a333a533feedba31738ee538ef6a78eb73af647137bc3fc" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts": { - "version": "0ecacea5047d1a7d350e7049dbd22f26435be5e8736a81a56afec5b3264db1ca", - "signature": "0ecacea5047d1a7d350e7049dbd22f26435be5e8736a81a56afec5b3264db1ca" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts": { - "version": "ffcb4ebde21f83370ed402583888b28651d2eb7f05bfec9482eb46d82adedd7f", - "signature": "ffcb4ebde21f83370ed402583888b28651d2eb7f05bfec9482eb46d82adedd7f" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts": { - "version": "06c004006016a51c4d1855527a523562c329dc44c473931c65f10373281f730e", - "signature": "06c004006016a51c4d1855527a523562c329dc44c473931c65f10373281f730e" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts": { - "version": "a7b43c69f9602d198825e403ee34e5d64f83c48b391b2897e8c0e6f72bca35f8", - "signature": "a7b43c69f9602d198825e403ee34e5d64f83c48b391b2897e8c0e6f72bca35f8" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts": { - "version": "f4a3fc4efc6944e7b7bd4ccfa45e0df68b6359808e6cf9d061f04fd964a7b2d3", - "signature": "f4a3fc4efc6944e7b7bd4ccfa45e0df68b6359808e6cf9d061f04fd964a7b2d3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts": { - "version": "73cad675aead7a2c05cf934e7e700c61d84b2037ac1d576c3f751199b25331da", - "signature": "73cad675aead7a2c05cf934e7e700c61d84b2037ac1d576c3f751199b25331da" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts": { - "version": "8c3137ba3583ec18484429ec1c8eff89efdc42730542f157b38b102fdccc0c71", - "signature": "8c3137ba3583ec18484429ec1c8eff89efdc42730542f157b38b102fdccc0c71" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts": { - "version": "d84300d886b45a198c346158e4ff7ae361cc7bc1c3deab44afb3db7de56b5d25", - "signature": "d84300d886b45a198c346158e4ff7ae361cc7bc1c3deab44afb3db7de56b5d25" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts": { - "version": "94ca7beec4e274d32362b54e0133152f7b4be9487db7b005070c03880b6363aa", - "signature": "94ca7beec4e274d32362b54e0133152f7b4be9487db7b005070c03880b6363aa" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts": { - "version": "2d713cbcbd5bcc38d91546eaeea7bb1c8686dc4a2995a28556d957b1b9de11d9", - "signature": "2d713cbcbd5bcc38d91546eaeea7bb1c8686dc4a2995a28556d957b1b9de11d9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts": { - "version": "bbf21f210782db4193359010a4710786add43e3b50aa42fc0d371f45b4e4d8d3", - "signature": "bbf21f210782db4193359010a4710786add43e3b50aa42fc0d371f45b4e4d8d3" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts": { - "version": "0b7733d83619ac4e3963e2a9f7c75dc1e9af6850cb2354c9554977813092c10a", - "signature": "0b7733d83619ac4e3963e2a9f7c75dc1e9af6850cb2354c9554977813092c10a" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts": { - "version": "3ce933f0c3955f67f67eb7d6b5c83c2c54a18472c1d6f2bb651e51dd40c84837", - "signature": "3ce933f0c3955f67f67eb7d6b5c83c2c54a18472c1d6f2bb651e51dd40c84837" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts": { - "version": "631e96db896d645f7132c488ad34a16d71fd2be9f44696f8c98289ee1c8cbfa9", - "signature": "631e96db896d645f7132c488ad34a16d71fd2be9f44696f8c98289ee1c8cbfa9" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts": { - "version": "2c77230d381cba81eb6f87cda2fbfff6c0427c6546c2e2590110effff37c58f7", - "signature": "2c77230d381cba81eb6f87cda2fbfff6c0427c6546c2e2590110effff37c58f7" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts": { - "version": "da86ee9a2f09a4583db1d5e37815894967e1f694ad9f3c25e84e0e4d40411e14", - "signature": "da86ee9a2f09a4583db1d5e37815894967e1f694ad9f3c25e84e0e4d40411e14" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts": { - "version": "66679e8ffbf1fddef1796c60757e54e6e6551dd9823f75ef2f80176473bdaaff", - "signature": "66679e8ffbf1fddef1796c60757e54e6e6551dd9823f75ef2f80176473bdaaff" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts": { - "version": "ddc086b1adac44e2fccf55422da1e90fa970e659d77f99712422a421564b4877", - "signature": "ddc086b1adac44e2fccf55422da1e90fa970e659d77f99712422a421564b4877" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts": { - "version": "515ef1d99036ff0dafa5bf738e02222edea94e0d97a0aa0ff277ac5e96b57977", - "signature": "515ef1d99036ff0dafa5bf738e02222edea94e0d97a0aa0ff277ac5e96b57977" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.global.d.ts": { - "version": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", - "signature": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts": { - "version": "780058f4a804c8bdcdd2f60e7af64b2bc57d149c1586ee3db732a84d659a50bf", - "signature": "780058f4a804c8bdcdd2f60e7af64b2bc57d149c1586ee3db732a84d659a50bf" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts": { - "version": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", - "signature": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts": { - "version": "1aa743b5b89d2f3c7eff2c20661d119623e4dbfa33f992a16583f16af7b70c75", - "signature": "1aa743b5b89d2f3c7eff2c20661d119623e4dbfa33f992a16583f16af7b70c75" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts": { - "version": "092cf35ca0f8f72a652d9a9e3dbdb892927de37a1704cd8d77e04ec1efbb148b", - "signature": "092cf35ca0f8f72a652d9a9e3dbdb892927de37a1704cd8d77e04ec1efbb148b" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/offscreencanvas/index.d.ts": { - "version": "fc35a74dd14f55d6fea9e5a4804ae812d559519352fa3836eb5f5555a64dd0ac", - "signature": "fc35a74dd14f55d6fea9e5a4804ae812d559519352fa3836eb5f5555a64dd0ac" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/resolve/index.d.ts": { - "version": "2880728492d6a6baa55411d14cc42fa55714a24b1d1d27ff9a8a610abd47c761", - "signature": "2880728492d6a6baa55411d14cc42fa55714a24b1d1d27ff9a8a610abd47c761" - }, - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/seedrandom/index.d.ts": { - "version": "1268e311431a3b23db043921bb743be87f3ec0acb2d675564d7961620f4569e0", - "signature": "1268e311431a3b23db043921bb743be87f3ec0acb2d675564d7961620f4569e0" - }, - "/private/tmp/tfjs-publish/tfjs-layers/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/node-fetch/index.d.ts": { - "version": "07c251f1baf3825cbde02335ba07554f700deee4138bbbfe2d29203a9e26a8f1", - "signature": "07c251f1baf3825cbde02335ba07554f700deee4138bbbfe2d29203a9e26a8f1" - }, - "/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-layers/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-layers/tsconfig.json" - }, - "referencedMap": { - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/activations_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/layer_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/layer_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/common_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/errors_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/losses_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/model_save_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/model_summary_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/models_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/flags_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/canvas_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/setup_tests.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/types_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/variables_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/version_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_weighted_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/keras_class_names.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/model_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activation_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cors/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/resolve/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/node-fetch/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts" - ] - }, - "exportedModulesMap": { - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/setup_tests.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/model_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/keras_class_names.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/flags_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/canvas_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/layer_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cors/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/node-fetch/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/resolve/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es5.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2016.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.dom.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.core.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.collection.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.generator.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.iterable.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.promise.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.proxy.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.reflect.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.symbol.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2016.array.include.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.object.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.string.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.promise.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.es2018.regexp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.esnext.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/typescript/lib/lib.esnext.bigint.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/common.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/activation_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/activations_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/types.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/node_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/initializer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/logs.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/loss_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/optimizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/training_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/layer_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_stub.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_tensors.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_constraints.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_initializers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activations.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/conv_utils.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/topology_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_layers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_metrics.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_models.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/exports_regularizers.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/base_callbacks_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/callbacks_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/common_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/constraints_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/errors_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/initializers_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/losses_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/metrics_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/model_save_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/model_summary_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/models_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/optimizers_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/regularizers_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/webgl2/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/flags_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/canvas_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@tensorflow/tfjs-backend-webgl/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/setup_tests.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/types_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/user_defined_metadata_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/variables_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/version_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/state_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/backend/tfjs_backend_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/container_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/dataset_fakes_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/executor_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/input_layer_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/topology_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_dataset_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/engine/training_weighted_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/constraint_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/input_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/regularizer_config.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/core_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/merge_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/normalization_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/padding_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/pooling_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/layer_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/keras_class_names.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/model_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/advanced_activation_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_depthwise_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_recurrent_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/convolutional_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/core_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/embeddings_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/merge_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/noise_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/normalization_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/padding_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/pooling_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/recurrent_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/serialization_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/layers/wrappers_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/generic_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/math_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/serialization_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/types_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/src/utils/variable_utils_test.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/component-emitter/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cookie/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/cors/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/estree/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/jasmine/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/wasi.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/assert.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/node/ts3.6/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/offscreencanvas/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/resolve/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/node_modules/@types/seedrandom/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-layers/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/node-fetch/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-layers/dist/types.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts deleted file mode 100644 index 0196f51ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Defines allowable data types for tensors. */ -import { NamedTensorMap, Scalar, Tensor } from '@tensorflow/tfjs-core'; -import { Shape } from './keras_format/common'; -export interface NamedTensor { - name: string; - tensor: Tensor; -} -export declare type HasShape = { - shape: Shape; -}; -/** - * Type for loss a metric function. - * - * Takes a true value and a predicted value, and returns a loss or metric value. - */ -export declare type LossOrMetricFn = (yTrue: Tensor, yPred: Tensor) => Tensor; -/** - * Type for a regularizer function. - */ -export declare type RegularizerFn = () => Scalar; -export declare type RnnStepFunction = (inputs: Tensor, states: Tensor[]) => [Tensor, Tensor[]]; -/** - * A single Tensor or a non-nested collection of Tensors. - * - * An object of this type can always be reduced to `Tensor[]`. A single - * 'Tensor' becomes `[Tensor]`. A `Tensor[]` is unchanged. A `NamedTensorMap` - * can be converted with the help of a list of names, providing the order in - * which the Tensors should appear in the resulting array. - */ -export declare type TensorOrArrayOrMap = Tensor | Tensor[] | NamedTensorMap; -/** - * Type representing a loosely-typed bundle of keyword arguments. - * - * This is a looser type than PyJsonDict/serialization.ConfigDict as it - * can contain arbitrary objects as its values. It is most appropriate - * for functions that pass through keyword arguments to other functions - * without knowledge of the structure. If the function can place type - * restrictions on the keyword arguments, it should via the Config - * interface convention used throughout. - */ -export declare type Kwargs = { - [key: string]: any; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js deleted file mode 100644 index 68c605505..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -//# 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-layers/dist/types.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js.map deleted file mode 100644 index 01e415209..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Defines allowable data types for tensors. */\n\nimport {NamedTensorMap, Scalar, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Shape} from './keras_format/common';\n\nexport interface NamedTensor {\n name: string;\n tensor: Tensor;\n}\n\nexport type HasShape = {\n shape: Shape;\n};\n\n/**\n * Type for loss a metric function.\n *\n * Takes a true value and a predicted value, and returns a loss or metric value.\n */\nexport type LossOrMetricFn = (yTrue: Tensor, yPred: Tensor) => Tensor;\n\n/**\n * Type for a regularizer function.\n */\nexport type RegularizerFn = () => Scalar;\n\n/*\n * The type for an RNN step function.\n * The arguments are:\n * - inputs: Input data, with shape `[sapmles, ...]`.\n * The return values are:\n * - outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * - newStates: Array of tensors. The `Array` has the same length as `states`\n * in the input arguments. Each `tf.Tensor` has the same shape as the\n * corresponding element in `states`.\n */\nexport type RnnStepFunction =\n (inputs: Tensor, states: Tensor[]) => [Tensor, Tensor[]];\n\n/**\n * A single Tensor or a non-nested collection of Tensors.\n *\n * An object of this type can always be reduced to `Tensor[]`. A single\n * 'Tensor' becomes `[Tensor]`. A `Tensor[]` is unchanged. A `NamedTensorMap`\n * can be converted with the help of a list of names, providing the order in\n * which the Tensors should appear in the resulting array.\n */\nexport type TensorOrArrayOrMap = Tensor|Tensor[]|NamedTensorMap;\n\n/**\n * Type representing a loosely-typed bundle of keyword arguments.\n *\n * This is a looser type than PyJsonDict/serialization.ConfigDict as it\n * can contain arbitrary objects as its values. It is most appropriate\n * for functions that pass through keyword arguments to other functions\n * without knowledge of the structure. If the function can place type\n * restrictions on the keyword arguments, it should via the Config\n * interface convention used throughout.\n */\nexport type Kwargs = {\n // tslint:disable-next-line:no-any\n [key: string]: any\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-layers/dist/types_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map deleted file mode 100644 index 01b78de82..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types_test.js","sourceRoot":"","sources":["../src/types_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,C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E,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for -specific types.\n */\n\nimport {SymbolicTensor} from './engine/topology';\n\n/**\n * Unit tests for SymbolicTensor.\n */\ndescribe('SymbolicTensor Test', () => {\n it('Correct dtype and shape properties', () => {\n const st1 = new SymbolicTensor('float32', [4, 6], null, [], {});\n expect(st1.dtype).toEqual('float32');\n expect(st1.shape).toEqual([4, 6]);\n expect(st1.rank).toEqual(2);\n });\n it('Correct when operating on scalars', () => {\n const scalar = new SymbolicTensor('float32', [], null, [], {});\n expect(scalar.dtype).toEqual('float32');\n expect(scalar.shape).toEqual([]);\n expect(scalar.rank).toEqual(0);\n });\n\n it('Correct names and ids', () => {\n const st1 = new SymbolicTensor(\n 'float32', [2, 2], null, [], {}, 'TestSymbolicTensor');\n const st2 = new SymbolicTensor(\n 'float32', [2, 2], null, [], {}, 'TestSymbolicTensor');\n expect(st1.name.indexOf('TestSymbolicTensor')).toEqual(0);\n expect(st2.name.indexOf('TestSymbolicTensor')).toEqual(0);\n // Explicit names of symbolic tensors should be unique.\n expect(st1 === st2).toBe(false);\n\n expect(st1.id).toBeGreaterThanOrEqual(0);\n expect(st2.id).toBeGreaterThanOrEqual(0);\n expect(st1.id === st2.id).toBe(false);\n });\n\n it('Invalid tensor name leads to error', () => {\n expect(() => new SymbolicTensor('float32', [2, 2], null, [], {}, '!'))\n .toThrowError();\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-layers/dist/user_defined_metadata.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.d.ts deleted file mode 100644 index 3926cc383..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Utility functions related to user-defined metadata. */ -export declare const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH: number; -/** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ -export declare function checkUserDefinedMetadata(userDefinedMetadata: {}, modelName: string, checkSize?: boolean): void; -/** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ -export declare function plainObjectCheck(x: any): boolean; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js deleted file mode 100644 index a276ffeb3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** Utility functions related to user-defined metadata. */ -// Maximum recommended serialized size for user-defined metadata. -// Beyond this limit, a warning message will be printed during model loading and -// saving. -export const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; -/** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ -export function checkUserDefinedMetadata(userDefinedMetadata, modelName, checkSize = false) { - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error('User-defined metadata is expected to be a JSON object, but is not.'); - } - if (checkSize) { - const out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn(`User-defined metadata of model "${modelName}" is too large in ` + - `size (length=${out.length} when serialized). It is not ` + - `recommended to store such large objects in user-defined metadata. ` + - `Please make sure its serialized length is <= ` + - `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`); - } - } -} -/** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ -// tslint:disable-next-line:no-any -export function plainObjectCheck(x) { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } - else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - const keys = Object.keys(x); - for (const key of keys) { - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (const item of x) { - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } - else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } - else { - // `x` is not a JavaScript object or `null`. - const xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } -} -//# sourceMappingURL=user_defined_metadata.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-layers/dist/user_defined_metadata.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js.map deleted file mode 100644 index ba89d5a9b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user_defined_metadata.js","sourceRoot":"","sources":["../src/user_defined_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0DAA0D;AAE1D,iEAAiE;AACjE,gFAAgF;AAChF,UAAU;AACV,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CACpC,mBAAuB,EAAE,SAAiB,EAAE,SAAS,GAAG,KAAK;IAC/D,IAAI,mBAAmB,IAAI,IAAI;QAC3B,OAAO,mBAAmB,KAAK,QAAQ;QACvC,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,MAAM,CAAC,SAAS;QAC/D,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,EAAE;QAC1C,M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AK,CAAC;qBACd;iBACF;gBACD,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,8DAA8D;gBAC9D,6DAA6D;gBAC7D,sBAAsB;gBACtB,OAAO,KAAK,CAAC;aACd;SACF;KACF;SAAM;QACL,4CAA4C;QAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC;QACvB,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC;KACxE;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/** Utility functions related to user-defined metadata. */\n\n// Maximum recommended serialized size for user-defined metadata.\n// Beyond this limit, a warning message will be printed during model loading and\n// saving.\nexport const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024;\n\n/**\n * Check validity of user-defined metadata.\n *\n * @param userDefinedMetadata\n * @param modelName Name of the model that the user-defined metadata belongs to.\n * Used during construction of error messages.\n * @param checkSize Whether to check the size of the metadata is under\n * recommended limit. Default: `false`. If `true`, will try stringify the\n * JSON object and print a console warning if the serialzied size is above the\n * limit.\n * @throws Error if `userDefinedMetadata` is not a plain JSON object.\n */\nexport function checkUserDefinedMetadata(\n userDefinedMetadata: {}, modelName: string, checkSize = false): void {\n if (userDefinedMetadata == null ||\n typeof userDefinedMetadata !== 'object' ||\n Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype ||\n !plainObjectCheck(userDefinedMetadata)) {\n throw new Error(\n 'User-defined metadata is expected to be a JSON object, but is not.');\n }\n\n if (checkSize) {\n const out = JSON.stringify(userDefinedMetadata);\n if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) {\n console.warn(\n `User-defined metadata of model \"${modelName}\" is too large in ` +\n `size (length=${out.length} when serialized). It is not ` +\n `recommended to store such large objects in user-defined metadata. ` +\n `Please make sure its serialized length is <= ` +\n `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`);\n }\n }\n}\n\n/**\n * Check if an input is plain JSON object or any valid subfield of it.\n *\n * @param x The input to be checked.\n * @param assertObject Whether to assert `x` is a JSON object, i.e., reject\n * cases of arrays and primitives.\n * @return Returns `true` if and only if `x` is a plain JSON object,\n * a JSON-valid primitive including string, number, boolean and null,\n * or an array of the said types.\n */\n// tslint:disable-next-line:no-any\nexport function plainObjectCheck(x: any): boolean {\n if (x === null) {\n // Note: typeof `null` is 'object', and `null` is valid in JSON.\n return true;\n } else if (typeof x === 'object') {\n if (Object.getPrototypeOf(x) === Object.prototype) {\n // `x` is a JavaScript object and its prototype is Object.\n const keys = Object.keys(x);\n for (const key of keys) {\n if (typeof key !== 'string') {\n // JSON keys must be strings.\n return false;\n }\n if (!plainObjectCheck(x[key])) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object but its prototype is not Object.\n if (Array.isArray(x)) {\n // `x` is a JavaScript array.\n for (const item of x) {\n if (!plainObjectCheck(item)) { // Recursive call.\n return false;\n }\n }\n return true;\n } else {\n // `x` is a JavaScript object and its prototype is not Object,\n // and it's not an Array. I.e., it's a complex object such as\n // `Error` and `Date`.\n return false;\n }\n }\n } else {\n // `x` is not a JavaScript object or `null`.\n const xType = typeof x;\n return xType === 'string' || xType === 'number' || xType === 'boolean';\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-layers/dist/user_defined_metadata_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata_test.js.map deleted file mode 100644 index 477091318..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata_test.js.map +++ /dev/null @@ -1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AE,EAAE,KAAK,IAAI,EAAE;YAClE,MAAM,eAAe,GAAa,EAAE,CAAC;YACrC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAe,EAAE,EAAE;gBACtD,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,MAAM,aAAa,GAAO;gBACxB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,2CAA2C,CAAC;aACpE,CAAC;YACF,MAAM,KAAK,GAAG,SAAS,KAAK,YAAY,CAAC,CAAC;gBACtC,4BAA4B,EAAE,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC;YACpE,KAAK,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;YAC5C,MAAM,KAAK,CAAC,IAAI,CACZ,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,SAA4B,EAAE,EAAE;gBACxD,OAAO,EAAC,kBAAkB,EAAE,IAAI,EAAC,CAAC;YACpC,CAAC,CAAC,CAAC,CAAC;YACR,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;KACJ;IACD,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,2CAA2C,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC;aAChE,OAAO,CAAC,IAAI,CAAC,CAAC;IAErB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {io, zeros} from '@tensorflow/tfjs-core';\n\nimport * as tfl from './index';\nimport {Sequential} from './models';\nimport {plainObjectCheck, MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH} from './user_defined_metadata';\n\ndescribe('plainObjectCheck', () => {\n it('Primitives', () => {\n // `undefined` is not valid JSON.\n expect(plainObjectCheck(undefined)).toEqual(false);\n // `null` is valid JSON.\n expect(plainObjectCheck(null)).toEqual(true);\n expect(plainObjectCheck(true)).toEqual(true);\n expect(plainObjectCheck(1337)).toEqual(true);\n expect(plainObjectCheck('foo')).toEqual(true);\n });\n it('Complex objects lead to false', () => {\n expect(plainObjectCheck(new Date())).toEqual(false);\n expect(plainObjectCheck(new Float32Array([1, 2])))\n .toEqual(false);\n expect(plainObjectCheck(new ArrayBuffer(4))).toEqual(false);\n expect(plainObjectCheck(new Error())).toEqual(false);\n expect(plainObjectCheck(zeros([2, 3]))).toEqual(false);\n });\n it('POJOs lead to true', () => {\n expect(plainObjectCheck({})).toEqual(true);\n expect(plainObjectCheck({\n 'key1': 'foo',\n 'key2': 1337,\n 'key3': false\n })).toEqual(true);\n expect(plainObjectCheck({\n 'key1': {\n 'key1_1': [1, 3, 3, 7, [42]],\n 'key1_2': null,\n 'key1_3': ['foo', 'bar', null, {}, {'qux': 233}],\n },\n 'key2': 1337,\n 'key3': false\n })).toEqual(true);\n });\n it('POJOs with invalid value types lead to false', () => {\n expect(plainObjectCheck({\n 'key1': new Date(),\n 'key2': 1337\n })).toEqual(false);\n expect(plainObjectCheck({\n 'key1': new ArrayBuffer(3),\n 'key2': 1337\n })).toEqual(false);\n expect(plainObjectCheck({\n 'key1': 'foo',\n 'key2': undefined\n })).toEqual(false);\n expect(plainObjectCheck({\n 'key1': 'foo',\n 'key2': {\n 'tensor': zeros([2, 3])\n }\n })).toEqual(false);\n });\n it('Arrays of POJO lead to true', () => {\n expect(plainObjectCheck([])).toEqual(true);\n expect(plainObjectCheck([{}, {}])).toEqual(true);\n expect(plainObjectCheck([{\n 'key1': 'foo',\n 'key2': 1337,\n 'key3': false\n }])).toEqual(true);\n expect(plainObjectCheck([{\n 'key1': {\n 'key1_1': [1, 3, 3, 7],\n 'key1_2': null,\n 'key1_3': ['foo', 'bar', null, {}, {'qux': 233}],\n },\n 'key2': 1337,\n 'key3': false\n }])).toEqual(true);\n });\n});\n\ndescribe('Save and load model with metadata', () => {\n\n function createSequentialModelForTest(): Sequential {\n const model = tfl.sequential();\n model.add(tfl.layers.dense({\n units: 3,\n inputShape: [10],\n activation: 'softmax'\n }));\n return model;\n }\n\n function createFunctionalModelForTest(): tfl.LayersModel {\n const input1 = tfl.input({shape: [3]});\n const input2 = tfl.input({shape: [4]});\n const dense1 = tfl.layers.dense({units: 2, inputShape: [3]});\n const dense2 = tfl.layers.dense({units: 1, inputShape: [4]});\n const y1 = dense1.apply(input1) as tfl.SymbolicTensor;\n const y2 = dense2.apply(input2) as tfl.SymbolicTensor;\n const output = tfl.layers.concatenate().apply([y1, y2]) as\n tfl.SymbolicTensor;\n return tfl.model({inputs: [input1, input2], outputs: output});\n }\n\n for (const modelType of ['sequential', 'functional']) {\n it(`Valid user-defined metadata round trip: ${modelType}`, async () => {\n const model = modelType === 'sequential' ?\n createSequentialModelForTest() : createFunctionalModelForTest();\n const userDefinedMetadata = {'outputLabels': ['foo', 'bar', 'baz']};\n model.setUserDefinedMetadata(userDefinedMetadata);\n expect(model.getUserDefinedMetadata()).toEqual(userDefinedMetadata);\n let savedArtifacts: io.ModelArtifacts;\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n savedArtifacts = artifacts;\n return {modelArtifactsInfo: null};\n }));\n const reloadedModel = await tfl.loadLayersModel(\n io.fromMemory(savedArtifacts));\n expect(reloadedModel.getUserDefinedMetadata())\n .toEqual(userDefinedMetadata);\n });\n }\n for (const modelType of ['sequential', 'functional']) {\n it(`Invalid user metadata leads to error: ${modelType}`, async () => {\n const model = modelType === 'sequential' ?\n createSequentialModelForTest() : createFunctionalModelForTest();\n expect(() => model.setUserDefinedMetadata(\n JSON.stringify({'outputLabels': ['foo', 'bar', 'baz']})))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata(\n ['foo', 'bar', 'baz']))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata(\n {'foo': zeros([2, 3]), 'outputLabels': ['foo', 'bar', 'baz']}))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata(undefined))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata(null))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata('foo'))\n .toThrowError(/is expected to be a JSON object, but is not/);\n expect(() => model.setUserDefinedMetadata(1337))\n .toThrowError(/is expected to be a JSON object, but is not/);\n });\n }\n for (const modelType of ['sequential', 'functional']) {\n it(`Large metadata size leads to warning: ${modelType}`, async () => {\n const warningMessages: string[] = [];\n spyOn(console, 'warn').and.callFake((message: string) => {\n warningMessages.push(message);\n });\n const largeMetadata: {} = {\n 'metadata': 'x'.repeat(MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH)\n };\n const model = modelType === 'sequential' ?\n createSequentialModelForTest() : createFunctionalModelForTest();\n model.setUserDefinedMetadata(largeMetadata);\n await model.save(\n io.withSaveHandler(async (artifacts: io.ModelArtifacts) => {\n return {modelArtifactsInfo: null};\n }));\n expect(warningMessages.length).toEqual(1);\n expect(warningMessages).toMatch(/is too large in size/);\n });\n }\n it('MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH value', () => {\n expect(MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH).toBeGreaterThan(0);\n expect(Number.isInteger(MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH))\n .toEqual(true);\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-layers/dist/utils/conv_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts deleted file mode 100644 index 4f960bc5a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { PaddingMode } from '../keras_format/common'; -/** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ -export declare function normalizeArray(value: number | number[], n: number, name: string): number[]; -/** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ -export declare function convOutputLength(inputLength: number, filterSize: number, padding: PaddingMode, stride: number, dilation?: number): number; -export declare function deconvLength(dimSize: number, strideSize: number, kernelSize: number, padding: PaddingMode): number; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js deleted file mode 100644 index cab7693c7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ValueError } from '../errors'; -import { pyListRepeat } from './generic_utils'; -import { isInteger, max } from './math_utils'; -/** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ -export function normalizeArray(value, n, name) { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } - else { - if (value.length !== n) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n} integers.` + - ` Received: ${value.length} elements.`); - } - for (let i = 0; i < n; ++i) { - const singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError(`The ${name} argument must be an integer or tuple of ${n}` + - ` integers. Received: ${JSON.stringify(value)} including a` + - ` non-integer number ${singleValue}`); - } - } - return value; - } -} -/** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ -export function convOutputLength(inputLength, filterSize, padding, stride, dilation = 1) { - if (inputLength == null) { - return inputLength; - } - const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - let outputLength; - if (padding === 'same') { - outputLength = inputLength; - } - else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); -} -export function deconvLength(dimSize, strideSize, kernelSize, padding) { - if (dimSize == null) { - return null; - } - if (padding === 'valid') { - dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]); - } - else if (padding === 'same') { - dimSize = dimSize * strideSize; - } - else { - throw new ValueError(`Unsupport padding mode: ${padding}.`); - } - return dimSize; -} -//# sourceMappingURL=conv_utils.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-layers/dist/utils/conv_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js.map deleted file mode 100644 index 30c3abaec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensor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;QACvB,OAAO,WAAW,CAAC;KACpB;IACD,MAAM,iBAAiB,GAAG,UAAU,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IACzE,IAAI,YAAoB,CAAC;IACzB,IAAI,OAAO,KAAK,MAAM,EAAE;QACtB,YAAY,GAAG,WAAW,CAAC;KAC5B;SAAM,EAAG,QAAQ;QAChB,YAAY,GAAG,WAAW,GAAG,iBAAiB,GAAG,CAAC,CAAC;KACpD;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,YAAY,CACxB,OAAe,EAAE,UAAkB,EAAE,UAAkB,EACvD,OAAoB;IACtB,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,KAAK,OAAO,EAAE;QACvB,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;KACpE;SAAM,IAAI,OAAO,KAAK,MAAM,EAAE;QAC7B,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;KAChC;SAAM;QACL,MAAM,IAAI,UAAU,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;KAC7D;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {ValueError} from '../errors';\nimport {PaddingMode} from '../keras_format/common';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n} integers.` +\n ` Received: ${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be an integer or tuple of ${n}` +\n ` integers. Received: ${JSON.stringify(value)} including a` +\n ` non-integer number ${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\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-layers/dist/utils/generic_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts deleted file mode 100644 index 2be5f0c8f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { DataType, fused, serialization } from '@tensorflow/tfjs-core'; -/** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ -export declare function pyListRepeat(value: any, numValues: number): any[]; -export declare function assert(val: boolean, message?: string): void; -/** - * Count the number of elements of the `array` that are equal to `reference`. - */ -export declare function count(array: T[], refernce: T): number; -/** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ -export declare function singletonOrArray(xs: T[]): T | T[]; -/** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ -export declare function toList(x: any): any[]; -/** - * Generate a UID for a list - */ -export declare function objectListUid(objs: any | any[]): string; -/** - * Converts string to snake-case. - * @param name - */ -export declare function toSnakeCase(name: string): string; -export declare function toCamelCase(identifier: string): string; -export declare function serializeKerasObject(instance: serialization.Serializable): serialization.ConfigDictValue; -/** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ -export declare function deserializeKerasObject(identifier: string | serialization.ConfigDict, moduleObjects?: { - [objName: string]: any; -}, customObjects?: { - [objName: string]: any; -}, printableModuleName?: string, fastWeightInit?: boolean): any; -/** - * Compares two numbers for sorting. - * @param a - * @param b - */ -export declare function numberCompare(a: number, b: number): 1 | -1 | 0; -/** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ -export declare function reverseNumberCompare(a: number, b: number): number; -/** - * Convert a string into the corresponding DType. - * @param dtype - * @returns An instance of DType. - */ -export declare function stringToDType(dtype: string): DataType; -/** - * Test the element-by-element equality of two Arrays of strings. - * @param xs First array of strings. - * @param ys Second array of strings. - * @returns Wether the two arrays are all equal, element by element. - */ -export declare function stringsEqual(xs: string[], ys: string[]): boolean; -/** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ -export declare function unique(xs: T[]): T[]; -/** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ -export declare function isObjectEmpty(obj: {}): boolean; -/** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ -export declare function checkStringTypeUnionValue(values: string[], label: string, value: string): void; -/** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ -export declare function checkArrayTypeAndLength(x: any, expectedType: string, minLength?: number, maxLength?: number): boolean; -/** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ -export declare function assertPositiveInteger(value: number | number[], name: string): void; -/** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ -export declare function formatAsFriendlyString(value: any): string; -/** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ -export declare function debounce(f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T; -/** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ -export declare function mapActivationToFusedKernel(activationName: string): fused.Activation; -declare type PossibleValues = Array>; -/** - * Returns the cartesian product of sets of values. - * This works the same as itertools.product in Python. - * - * Example: - * - * filters = [128, 256, 512] - * paddings = ['same', 'valid'] - * - * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'], - * [512, 'same'], [512, 'valid']] - * - * @param arrayOfValues List/array of values. - * @return The cartesian product. - */ -export declare function getCartesianProductOfValues(...arrayOfValues: PossibleValues): PossibleValues; -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js deleted file mode 100644 index 71af9503d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js +++ /dev/null @@ -1,517 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/* Original source: utils/generic_utils.py */ -import { util } from '@tensorflow/tfjs-core'; -import { AssertionError, ValueError } from '../errors'; -// tslint:enable -/** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ -// tslint:disable-next-line:no-any -export function pyListRepeat(value, numValues) { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - let newArray = []; - for (let i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } - else { - const newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } -} -export function assert(val, message) { - if (!val) { - throw new AssertionError(message); - } -} -/** - * Count the number of elements of the `array` that are equal to `reference`. - */ -export function count(array, refernce) { - let counter = 0; - for (const item of array) { - if (item === refernce) { - counter++; - } - } - return counter; -} -/** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ -export function singletonOrArray(xs) { - if (xs.length === 1) { - return xs[0]; - } - return xs; -} -/** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ -// tslint:disable-next-line:no-any -export function toList(x) { - if (Array.isArray(x)) { - return x; - } - return [x]; -} -/** - * Generate a UID for a list - */ -// tslint:disable-next-line:no-any -export function objectListUid(objs) { - const objectList = toList(objs); - let retVal = ''; - for (const obj of objectList) { - if (obj.id == null) { - throw new ValueError(`Object ${obj} passed to objectListUid without an id`); - } - if (retVal !== '') { - retVal = retVal + ', '; - } - retVal = `${retVal}${Math.abs(obj.id)}`; - } - return retVal; -} -/** - * Converts string to snake-case. - * @param name - */ -export function toSnakeCase(name) { - const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - const insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; -} -export function toCamelCase(identifier) { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, (m, p1) => p1.toUpperCase()); -} -// tslint:disable-next-line:no-any -let _GLOBAL_CUSTOM_OBJECTS = {}; -export function serializeKerasObject(instance) { - if (instance === null || instance === undefined) { - return null; - } - const dict = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; -} -/** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ -function convertNDArrayScalarsInConfig(config) { - if (config == null || typeof config !== 'object') { - return; - } - else if (Array.isArray(config)) { - config.forEach(configItem => convertNDArrayScalarsInConfig(configItem)); - } - else { - const fields = Object.keys(config); - for (const field of fields) { - const value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } - else { - convertNDArrayScalarsInConfig(value); - } - } - } - } -} -/** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ -// tslint:disable:no-any -export function deserializeKerasObject(identifier, moduleObjects = {}, customObjects = {}, printableModuleName = 'object', fastWeightInit = false) { - // tslint:enable - if (typeof identifier === 'string') { - const functionName = identifier; - let fn; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } - else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } - else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${identifier}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } - else { - // In this case we are dealing with a Keras config dictionary. - const config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError(`${printableModuleName}: Improper config format: ` + - `${JSON.stringify(config)}.\n` + - `'className' and 'config' must set.`); - } - const className = config['className']; - let cls, fromConfig; - if (className in customObjects) { - [cls, fromConfig] = customObjects[className]; - } - else if (className in _GLOBAL_CUSTOM_OBJECTS) { - [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className']; - } - else if (className in moduleObjects) { - [cls, fromConfig] = moduleObjects[className]; - } - if (cls == null) { - throw new ValueError(`Unknown ${printableModuleName}: ${className}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - // tslint:disable-next-line:no-any - const customObjectsCombined = {}; - for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) { - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (const key of Object.keys(customObjects)) { - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - const nestedConfig = config['config']; - nestedConfig['customObjects'] = customObjectsCombined; - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - const returnObj = fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS); - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - const returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = Object.assign({}, backupCustomObjects); - return returnObj; - } - } -} -/** - * Compares two numbers for sorting. - * @param a - * @param b - */ -export function numberCompare(a, b) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); -} -/** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ -export function reverseNumberCompare(a, b) { - return -1 * numberCompare(a, b); -} -/** - * Convert a string into the corresponding DType. - * @param dtype - * @returns An instance of DType. - */ -export function stringToDType(dtype) { - switch (dtype) { - case 'float32': - return 'float32'; - default: - throw new ValueError(`Invalid dtype: ${dtype}`); - } -} -/** - * Test the element-by-element equality of two Arrays of strings. - * @param xs First array of strings. - * @param ys Second array of strings. - * @returns Wether the two arrays are all equal, element by element. - */ -export function stringsEqual(xs, ys) { - if (xs == null || ys == null) { - return xs === ys; - } - if (xs.length !== ys.length) { - return false; - } - for (let i = 0; i < xs.length; ++i) { - if (xs[i] !== ys[i]) { - return false; - } - } - return true; -} -/** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ -export function unique(xs) { - if (xs == null) { - return xs; - } - const out = []; - // TODO(cais): Maybe improve performance by sorting. - for (const x of xs) { - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; -} -/** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ -export function isObjectEmpty(obj) { - if (obj == null) { - throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`); - } - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; -} -/** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ -export function checkStringTypeUnionValue(values, label, value) { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(`${value} is not a valid ${label}. Valid values are ${values} or null/undefined.`); - } -} -/** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ -// tslint:disable:no-any -export function checkArrayTypeAndLength(x, expectedType, minLength = 0, maxLength = Infinity) { - assert(minLength >= 0); - assert(maxLength >= minLength); - return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(e => typeof e === expectedType)); -} -// tslint:enable:no-any -/** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ -export function assertPositiveInteger(value, name) { - if (Array.isArray(value)) { - util.assert(value.length > 0, () => `${name} is unexpectedly an empty array.`); - value.forEach((v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`)); - } - else { - util.assert(Number.isInteger(value) && value > 0, () => `Expected ${name} to be a positive integer, but got ` + - `${formatAsFriendlyString(value)}.`); - } -} -/** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ -// tslint:disable-next-line:no-any -export function formatAsFriendlyString(value) { - if (value === null) { - return 'null'; - } - else if (Array.isArray(value)) { - return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']'; - } - else if (typeof value === 'string') { - return `"${value}"`; - } - else { - return `${value}`; - } -} -/** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ -export function debounce(f, waitMs) { - let lastTime = util.now(); - let lastResult; - const f2 = (...args) => { - const now = util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f(...args); - return lastResult; - }; - return f2; -} -/** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ -export function mapActivationToFusedKernel(activationName) { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; -} -/** - * Returns the cartesian product of sets of values. - * This works the same as itertools.product in Python. - * - * Example: - * - * filters = [128, 256, 512] - * paddings = ['same', 'valid'] - * - * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'], - * [512, 'same'], [512, 'valid']] - * - * @param arrayOfValues List/array of values. - * @return The cartesian product. - */ -export function getCartesianProductOfValues(...arrayOfValues) { - assert(arrayOfValues.length > 0, 'arrayOfValues is empty'); - for (const values of arrayOfValues) { - assert(Array.isArray(values), 'one of the values is not an array'); - assert(values.length > 0, 'one of the values is empty'); - } - return arrayOfValues.reduce((products, values) => { - if (products.length === 0) { - return values.map(value => [value]); - } - return values - .map(value => { - return products.map((prevValue) => [...prevValue, value]); - }) - .reduce((flattenedProduct, unflattenedProduct) => { - return flattenedProduct.concat(unflattenedProduct); - }, []); - }, []); -} -//# sourceMappingURL=generic_utils.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-layers/dist/utils/generic_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map deleted file mode 100644 index a2e4c76d5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generic_utils.js","sourceRoot":"","sources":["../../src/utils/generic_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,6CAA6C;AAE7C,OAAO,EAAiC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAC,cAAc,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAErD,gBAAgB;AAEhB;;;GAGG;AACH,kCAAkC;AAClC,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,SAAiB;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,kCAAkC;QAClC,IAAI,QAAQ,GAAU,EAAE,CAAC;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAClC,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACnC;QACD,OAAO,QAAQ,CAAC;KACjB;SAAM;QACL,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,QAAQ,CAAC;KACjB;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAY,EAAE,OAAgB;IACnD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;KACnC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAI,KAAU,EAAE,QAAW;IAC9C,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI,IAAI,KAAK,QAAQ,EAAE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AAM,CAAC,MAAM,GAAG,CAAC,EAAE,4BAA4B,CAAC,CAAC;KACzD;IAED,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;QAC/C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;SACrC;QAED,OAAO,MAAM;aACR,GAAG,CAAC,KAAK,CAAC,EAAE;YACX,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,EAAE;YAC/C,OAAO,gBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACrD,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,CAAC,EAAE,EAAoB,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {DataType, fused, serialization, util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n const dict: serialization.ConfigDictValue = {};\n dict['className'] = instance.getClassName();\n dict['config'] = instance.getConfig();\n return dict;\n}\n\n/**\n * Replace ndarray-style scalar objects in serialization objects with numbers.\n *\n * Background: In some versions of tf.keras, certain scalar values in the HDF5\n * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`,\n * where in `num` is a plain number. This method converts such serialization\n * to a `number`.\n *\n * @param config The keras-format serialization object to be processed\n * (in place).\n */\nfunction convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue):\n void {\n if (config == null || typeof config !== 'object') {\n return;\n } else if (Array.isArray(config)) {\n config.forEach(configItem => convertNDArrayScalarsInConfig(configItem));\n } else {\n const fields = Object.keys(config);\n for (const field of fields) {\n const value = config[field];\n if (value != null && typeof value === 'object') {\n if (!Array.isArray(value) && value['type'] === 'ndarray' &&\n typeof value['value'] === 'number') {\n config[field] = value['value'];\n } else {\n convertNDArrayScalarsInConfig(value as serialization.ConfigDict);\n }\n }\n }\n }\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @param fastWeightInit Optional flag to use fast weight initialization\n * during deserialization. This is applicable to cases in which\n * the initialization will be immediately overwritten by loaded weight\n * values. Default: `false`.\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object', fastWeightInit = false): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${identifier}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config['className'] == null || config['config'] == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config['className'] as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects[className];\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className'];\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(\n `Unknown ${printableModuleName}: ${className}. ` +\n `This may be due to one of the following reasons:\\n` +\n `1. The ${printableModuleName} is defined in Python, in which ` +\n `case it needs to be ported to TensorFlow.js or your JavaScript ` +\n `code.\\n` +\n `2. The custom ${printableModuleName} is defined in JavaScript, ` +\n `but is not registered properly with ` +\n `tf.serialization.registerClass().`);\n // TODO(cais): Add link to tutorial page on custom layers.\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config['config'] as config['config'].customObjects. Objects can use it,\n // if they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config['config'] as serialization.ConfigDict;\n nestedConfig['customObjects'] = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n convertNDArrayScalarsInConfig(config['config']);\n const returnObj =\n fromConfig(cls, config['config'], customObjects, fastWeightInit);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config['config']);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n\n/**\n * Assert that a value or an array of value are positive integer.\n *\n * @param value The value being asserted on. May be a single number or an array\n * of numbers.\n * @param name Name of the value, used to make the error message.\n */\nexport function assertPositiveInteger(value: number|number[], name: string) {\n if (Array.isArray(value)) {\n util.assert(\n value.length > 0, () => `${name} is unexpectedly an empty array.`);\n value.forEach(\n (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`));\n } else {\n util.assert(\n Number.isInteger(value) && value > 0,\n () => `Expected ${name} to be a positive integer, but got ` +\n `${formatAsFriendlyString(value)}.`);\n }\n}\n\n/**\n * Format a value into a display-friendly, human-readable fashion.\n *\n * - `null` is formatted as `'null'`\n * - Strings are formated with flanking pair of quotes.\n * - Arrays are formatted with flanking pair of square brackets.\n *\n * @param value The value to display.\n * @return Formatted string.\n */\n// tslint:disable-next-line:no-any\nexport function formatAsFriendlyString(value: any): string {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';\n } else if (typeof value === 'string') {\n return `\"${value}\"`;\n } else {\n return `${value}`;\n }\n}\n\n/**\n * Returns a function `f2` (decorator) which wraps the original function\n * `f`. `f2` guarantees that `f` can be called at most once\n * every `waitMs` ms. If `f2` is called more often, it will return\n * the last returned result of `f`.\n *\n * @param f The original function `f` to wrap.\n * @param waitMs The time between two consecutive calls to `f` in ms.\n */\nexport function debounce(\n f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T {\n let lastTime = util.now();\n let lastResult: T;\n const f2 = (...args: Array<{}>) => {\n const now = util.now();\n if (now - lastTime < waitMs) {\n return lastResult;\n }\n lastTime = now;\n lastResult = f(...args);\n return lastResult;\n };\n return f2;\n}\n\n/**\n * Returns the fusable activation given a layers identifier.\n *\n * @param activationName The layers identifier string.\n * @return The name of the fusable activation.\n */\nexport function mapActivationToFusedKernel(activationName: string):\n fused.Activation {\n if (activationName === 'relu') {\n return 'relu';\n }\n if (activationName === 'linear') {\n return 'linear';\n }\n if (activationName === 'elu') {\n return 'elu';\n }\n return null;\n}\n\ntype PossibleValues = Array>;\n\n/**\n * Returns the cartesian product of sets of values.\n * This works the same as itertools.product in Python.\n *\n * Example:\n *\n * filters = [128, 256, 512]\n * paddings = ['same', 'valid']\n *\n * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n * [512, 'same'], [512, 'valid']]\n *\n * @param arrayOfValues List/array of values.\n * @return The cartesian product.\n */\nexport function getCartesianProductOfValues(...arrayOfValues: PossibleValues):\n PossibleValues {\n assert(arrayOfValues.length > 0, 'arrayOfValues is empty');\n\n for (const values of arrayOfValues) {\n assert(Array.isArray(values), 'one of the values is not an array');\n assert(values.length > 0, 'one of the values is empty');\n }\n\n return arrayOfValues.reduce((products, values) => {\n if (products.length === 0) {\n return values.map(value => [value]);\n }\n\n return values\n .map(value => {\n return products.map((prevValue) => [...prevValue, value]);\n })\n .reduce((flattenedProduct, unflattenedProduct) => {\n return flattenedProduct.concat(unflattenedProduct);\n }, []);\n }, [] as PossibleValues);\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-layers/dist/utils/generic_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map deleted file mode 100644 index 47bbe3453..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generic_utils_test.js","sourceRoot":"","sources":["../../src/utils/generic_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAGzC,OA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,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,GAAG,EAAE;YACV,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,GAAG,EAAE;YACV,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAChC,MAAM,OAAO,GAAa,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAElD,KAAK,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\n\nimport {AssertionError} from '../errors';\nimport {DataFormat, PaddingMode} from '../keras_format/common';\n\nimport * as utils from './generic_utils';\n\ndescribe('pyListRepeat() ', () => {\n it('creates an empty array for 0 numValues', () => {\n expect(utils.pyListRepeat(null, 0)).toEqual([]);\n });\n\n it('creates an array with 1 value for 1 numValues', () => {\n const value = 'a';\n expect(utils.pyListRepeat(value, 1)).toEqual([value]);\n });\n\n it('creates an array with 3 values for 3 numValues', () => {\n const value = 'a';\n const numValues = 3;\n const expectedValue = [value, value, value];\n expect(utils.pyListRepeat(value, numValues)).toEqual(expectedValue);\n });\n\n it('throws an exception when numValues <0', () => {\n const fillFn = () => utils.pyListRepeat(null, -1);\n expect(fillFn).toThrowError();\n });\n\n it('takes an existing array and replicates its contents.', () => {\n const value = [1, 2];\n const numValues = 2;\n const expectedValue = [1, 2, 1, 2];\n expect(utils.pyListRepeat(value, numValues)).toEqual(expectedValue);\n });\n});\n\ndescribe('assert', () => {\n for (const x of [false, null, undefined]) {\n it('throws error for false conditions', () => {\n expect(() => utils.assert(x)).toThrowError();\n });\n }\n\n it('doesn\\'t throw error for true conditions', () => {\n expect(() => utils.assert(true)).not.toThrowError();\n });\n});\n\ndescribe('count', () => {\n it('string array, non-empty', () => {\n const array: string[] = ['foo', 'bar', 'foo'];\n expect(utils.count(array, 'foo')).toEqual(2);\n expect(utils.count(array, 'bar')).toEqual(1);\n expect(utils.count(array, 'baz')).toEqual(0);\n expect(utils.count(array, '')).toEqual(0);\n });\n it('number array, non-empty', () => {\n const array: number[] = [-1, 1, 3, 3, 7, -1, 1.337, -1];\n expect(utils.count(array, 1)).toEqual(1);\n expect(utils.count(array, 3)).toEqual(2);\n expect(utils.count(array, 1.337)).toEqual(1);\n expect(utils.count(array, -1)).toEqual(3);\n expect(utils.count(array, 0)).toEqual(0);\n });\n it('string array, empty', () => {\n const array: string[] = [];\n expect(utils.count(array, 'foo')).toEqual(0);\n expect(utils.count(array, 'bar')).toEqual(0);\n expect(utils.count(array, 'baz')).toEqual(0);\n expect(utils.count(array, '')).toEqual(0);\n });\n});\n\ndescribe('Compare functions', () => {\n const inputs =\n [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]];\n\n for (const input of inputs) {\n it('cmp sorts numbers in ascending order', () => {\n const expected = [1, 2, 3];\n expect(input.slice().sort(utils.numberCompare)).toEqual(expected);\n });\n }\n\n for (const input of inputs) {\n it('reverseCmp sorts numbers in ascending order', () => {\n const expected = [3, 2, 1];\n expect(input.slice().sort(utils.reverseNumberCompare)).toEqual(expected);\n });\n }\n});\n\ndescribe('toList', () => {\n it('creates array from non-array.', () => {\n const value = 1;\n expect(utils.toList(value)).toEqual([value]);\n });\n\n it('returns array if passed an array.', () => {\n const value = [1];\n expect(utils.toList(value)).toEqual(value);\n });\n});\n\ndescribe('toSnakeCase', () => {\n for (const [inputString, expectedOutput] of [\n ['', ''], ['A', 'a'], ['AA', 'aa'], ['AAA', 'aaa'], ['AAa', 'a_aa'],\n ['AA0', 'a_a0'], ['aB', 'a_b'], ['aBC', 'a_bc'], ['aBc', 'a_bc'],\n ['_', 'private_'], ['a', 'a'], ['_a', 'private_a']]) {\n it('creates expected output', () => {\n expect(utils.toSnakeCase(inputString)).toEqual(expectedOutput);\n });\n }\n});\n\ndescribe('toCamelCase', () => {\n for (const [inputString, expectedOutput] of [\n ['', ''], ['A', 'A'], ['aa', 'aa'], ['a_a', 'aA'], ['a_aa', 'aAa'],\n ['aAa', 'aAa']]) {\n it('creates expected output', () => {\n expect(utils.toCamelCase(inputString)).toEqual(expectedOutput);\n });\n }\n});\n\ndescribe('stringsEqual', () => {\n it('null and undefined', () => {\n expect(utils.stringsEqual(null, null)).toEqual(true);\n expect(utils.stringsEqual(undefined, undefined)).toEqual(true);\n expect(utils.stringsEqual(undefined, null)).toEqual(false);\n expect(utils.stringsEqual(undefined, [])).toEqual(false);\n expect(utils.stringsEqual(null, [])).toEqual(false);\n expect(utils.stringsEqual(null, ['a'])).toEqual(false);\n });\n it('Empty arrays', () => {\n expect(utils.stringsEqual([], [])).toEqual(true);\n expect(utils.stringsEqual([], ['a'])).toEqual(false);\n });\n it('Non-empty arrays', () => {\n expect(utils.stringsEqual(['a', 'b', 'c', null], [\n 'a', 'b', 'c', null\n ])).toEqual(true);\n expect(utils.stringsEqual(['a', 'b', 'c', ''], [\n 'a', 'b', 'c', ''\n ])).toEqual(true);\n expect(utils.stringsEqual(['a', 'b', 'c', null], [\n 'a', 'b', 'c', undefined\n ])).toEqual(false);\n expect(utils.stringsEqual(['a', 'b', 'c', ''], [\n 'a', 'c', 'b', ''\n ])).toEqual(false);\n });\n});\n\ndescribe('unique', () => {\n it('null or undefined', () => {\n expect(utils.unique(null)).toEqual(null);\n expect(utils.unique(undefined)).toEqual(undefined);\n });\n it('empty array', () => {\n expect(utils.unique([])).toEqual([]);\n });\n it('Non-empty array: string', () => {\n expect(utils.unique(['foo', 'bar', 'foo'])).toEqual(['foo', 'bar']);\n expect(utils.unique(['foo', 'bar', ''])).toEqual(['foo', 'bar', '']);\n expect(utils.unique(['foo', 'bar', null, ''])).toEqual([\n 'foo', 'bar', null, ''\n ]);\n });\n it('Non-empty array: number', () => {\n expect(utils.unique([1, 2, -1, 2])).toEqual([1, 2, -1]);\n expect(utils.unique([2, 3, 2, null])).toEqual([2, 3, null]);\n });\n});\n\ndescribe('isObjectEmpty', () => {\n it('null or undefined', () => {\n expect(() => utils.isObjectEmpty(null)).toThrowError();\n expect(() => utils.isObjectEmpty(undefined)).toThrowError();\n });\n it('empty object', () => {\n expect(utils.isObjectEmpty({})).toEqual(true);\n });\n it('Non-empty object', () => {\n expect(utils.isObjectEmpty({'a': 12})).toEqual(false);\n expect(utils.isObjectEmpty({'a': 12, 'b': 34})).toEqual(false);\n });\n});\n\ndescribe('checkArrayTypeAndLength', () => {\n it('checks types', () => {\n // [1,2,3] is made of all 'number's.\n expect(utils.checkArrayTypeAndLength([1, 2, 3], 'number')).toEqual(true);\n // ['hello', 'world'] is made of all 'strings's.\n expect(utils.checkArrayTypeAndLength(['hello', 'world'], 'string'))\n .toEqual(true);\n // [1,2,[3]] is not made of all 'number's.\n expect(utils.checkArrayTypeAndLength([1, 2, [3]], 'number')).toEqual(false);\n });\n it('checks lengths', () => {\n // length of [1,2,3] is >= 1.\n expect(utils.checkArrayTypeAndLength([1, 2, 3], 'number', 1)).toEqual(true);\n // length of [1,2,3] is >= 1 and <= 3.\n expect(utils.checkArrayTypeAndLength([1, 2, 3], 'number', 1, 3))\n .toEqual(true);\n // length of [1,2,3,4,5] is not >= 1 and <= 3.\n expect(utils.checkArrayTypeAndLength([1, 2, 3, 4, 5], 'number', 1, 3))\n .toEqual(false);\n // length of [1,2,3,4,5] is not >= 7 and <= 10.\n expect(utils.checkArrayTypeAndLength([1, 2, 3, 4, 5], 'number', 7, 10))\n .toEqual(false);\n // Length of the empty array is >= 0 and <= 0.\n expect(utils.checkArrayTypeAndLength([], 'does_not_matter', 0, 0))\n .toEqual(true);\n });\n it('rejects negative length limits', () => {\n expect(() => utils.checkArrayTypeAndLength([1, 2, 3], 'number', -1))\n .toThrowError();\n });\n it('rejects maxLength < minLength', () => {\n expect(() => utils.checkArrayTypeAndLength([1, 2, 3], 'number', 100, 2))\n .toThrowError();\n });\n});\n\ndescribe('formatValueAsFriendlyString', () => {\n it('null input', () => {\n expect(utils.formatAsFriendlyString(null)).toEqual('null');\n });\n\n it('string input', () => {\n expect(utils.formatAsFriendlyString('')).toEqual('\\\"\\\"');\n expect(utils.formatAsFriendlyString('foo')).toEqual('\\\"foo\\\"');\n });\n\n it('array input', () => {\n expect(utils.formatAsFriendlyString([])).toEqual('[]');\n expect(utils.formatAsFriendlyString([null, 3])).toEqual('[null,3]');\n expect(utils.formatAsFriendlyString([1, 3, 3, 7])).toEqual('[1,3,3,7]');\n expect(utils.formatAsFriendlyString([1, 3, 3, 'a'])).toEqual('[1,3,3,\"a\"]');\n expect(utils.formatAsFriendlyString([\n [1], 3, [3], 7\n ])).toEqual('[[1],3,[3],7]');\n });\n});\n\ndescribe('debouce', () => {\n it('first call happens after waitMs', async () => {\n const timestamps = [0, 1, 11, 12];\n let counter = 0;\n spyOn(util, 'now').and.callFake(() => timestamps[counter++]);\n let numCalls = 0;\n const f = () => numCalls++;\n const waitMs = 10;\n const f2 = utils.debounce(f, waitMs);\n // The first call is ignored since waitMs hasn't passed yet.\n f2();\n expect(numCalls).toBe(0);\n f2();\n expect(numCalls).toBe(1);\n // The second call is ignored.\n f2();\n expect(numCalls).toBe(1);\n });\n\n it('allows at most period/wait calls in a given period', async () => {\n const timestamps = [0, 2, 4, 6, 8, 10];\n let counter = 0;\n spyOn(util, 'now').and.callFake(() => timestamps[counter++]);\n let numCalls = 0;\n const f = () => numCalls++;\n const waitMs = 3;\n const f2 = utils.debounce(f, waitMs);\n // Call f2 5 times.\n for (let i = 1; i < 5; i++) {\n f2();\n }\n // Expect f to be called 2 times (between timestamps 4 and 2, and 8 and 4).\n expect(numCalls).toBe(2);\n });\n});\n\ndescribe('getCartesianProductOfValues', () => {\n it('should return correct cartesian product of 2 group of values', () => {\n const filters = [128, 256, 512];\n const paddings: PaddingMode[] = ['same', 'valid'];\n\n const product = utils.getCartesianProductOfValues(filters, paddings);\n\n expect(Array.isArray(product)).toBe(true);\n expect(product.length).toBe(6);\n expect(product.sort()).toEqual([\n [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'],\n [512, 'same'], [512, 'valid']\n ].sort());\n });\n\n it('should return correct cartesian product of 3 group of values', () => {\n const filters = [128, 256, 512];\n const kernels = [3, 5, 7];\n const paddings: PaddingMode[] = ['same', 'valid'];\n\n const product =\n utils.getCartesianProductOfValues(filters, kernels, paddings);\n\n expect(Array.isArray(product)).toBe(true);\n expect(product.length).toBe(18);\n expect(product.sort()).toEqual([\n [128, 3, 'same'], [128, 3, 'valid'], [128, 5, 'same'], [128, 5, 'valid'],\n [128, 7, 'same'], [128, 7, 'valid'], [256, 3, 'same'], [256, 3, 'valid'],\n [256, 5, 'same'], [256, 5, 'valid'], [256, 7, 'same'], [256, 7, 'valid'],\n [512, 3, 'same'], [512, 3, 'valid'], [512, 5, 'same'], [512, 5, 'valid'],\n [512, 7, 'same'], [512, 7, 'valid']\n ].sort());\n });\n\n it('should return correct cartesian product of 5 group of values', () => {\n const filters = [128, 256, 512];\n const kernels = [3, 5, 7];\n const paddings: PaddingMode[] = ['same', 'valid'];\n const formats: DataFormat[] = ['channelsFirst', 'channelsLast'];\n const dilation = [1, 2];\n\n const product = utils.getCartesianProductOfValues(\n filters, kernels, paddings, formats, dilation);\n\n expect(Array.isArray(product)).toBe(true);\n expect(product.length).toBe(72);\n // expect(product[0].length).toBe(5);\n expect(product.every(p => p.length === 5)).toBe(true);\n expect(product[0].map(p => typeof p)).toEqual([\n 'number', 'number', 'string', 'string', 'number'\n ]);\n });\n\n it('should raise AssertionError if array is not valid', () => {\n expect(() => {\n utils.getCartesianProductOfValues(undefined);\n }).toThrowError(AssertionError);\n });\n\n it('should raise AssertionError if array is empty', () => {\n expect(() => {\n utils.getCartesianProductOfValues([]);\n }).toThrowError(AssertionError);\n });\n\n it('should raise AssertionError if 1 group of values is empty', () => {\n expect(() => {\n const filters = [128, 256, 512];\n const kernels: string[] = [];\n const paddings: PaddingMode[] = ['same', 'valid'];\n\n utils.getCartesianProductOfValues(filters, kernels, paddings);\n }).toThrowError(AssertionError);\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-layers/dist/utils/layer_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts deleted file mode 100644 index d00844136..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Container } from '../engine/container'; -/** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ -export declare function printSummary(model: Container, lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js deleted file mode 100644 index 2f072c17e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js +++ /dev/null @@ -1,197 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { countParamsInWeights } from './variable_utils'; -/** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ -export function printSummary(model, lineLength, positions, -// tslint:disable-next-line:no-any -printFn = console.log) { - const sequentialLike = isModelSequentialLike(model); - // Header names for different log elements. - const toDisplay = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } - else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(p => Math.floor(lineLength * p)); - } - let relevantNodes; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (const depth in model.nodesByDepth) { - relevantNodes.push(...model.nodesByDepth[depth]); - } - } - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - const layers = model.layers; - for (let i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } - else { - printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - // tslint:disable-next-line:no-any - model.checkTrainableWeightsConsistency(); - const trainableCount = countTrainableParams(model); - const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - printFn(`Total params: ${trainableCount + nonTrainableCount}`); - printFn(`Trainable params: ${trainableCount}`); - printFn(`Non-trainable params: ${nonTrainableCount}`); - printFn('_'.repeat(lineLength)); -} -function countTrainableParams(model) { - let trainableCount; - // tslint:disable:no-any - if (model.collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights(model.collectedTrainableWeights); - } - else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; -} -function isModelSequentialLike(model) { - let sequentialLike = true; - const nodesByDepth = []; - const nodes = []; - for (const depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (const depthNodes of nodesByDepth) { - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push(...depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (const layer of model.layers) { - let flag = false; - for (const node of layer.inboundNodes) { - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } - else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; -} -function printRow(fields, positions, -// tslint:disable-next-line:no-any -printFn = console.log) { - let line = ''; - for (let i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); -} -/** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ -function printLayerSummary(layer, positions, -// tslint:disable-next-line:no-any -printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const name = layer.name; - const className = layer.getClassName(); - const fields = [`${name} (${className})`, outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); -} -/** - * Prints a summary for a single Layer, with connectivity information. - */ -function printLayerSummaryWithConnections(layer, positions, relevantNodes, -// tslint:disable-next-line:no-any -printFn) { - let outputShape; - try { - outputShape = JSON.stringify(layer.outputShape); - } - catch (err) { - outputShape = 'multiple'; - } - const connections = []; - for (const node of layer.inboundNodes) { - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (let i = 0; i < node.inboundLayers.length; ++i) { - const inboundLayer = node.inboundLayers[i].name; - const inboundLayerIndex = node.nodeIndices[i]; - const inboundTensorIndex = node.tensorIndices[i]; - connections.push(`${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`); - } - } - const name = layer.name; - const className = layer.getClassName(); - const firstConnection = connections.length === 0 ? '' : connections[0]; - const fields = [ - `${name} (${className})`, outputShape, layer.countParams().toString(), - firstConnection - ]; - printRow(fields, positions, printFn); - for (let i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } -} -//# sourceMappingURL=layer_utils.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-layers/dist/utils/layer_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map deleted file mode 100644 index 32b80ca0d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map +++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CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,MAAM,GAAa;QACvB,GAAG,IAAI,KAAK,SAAS,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACrE,eAAe;KAChB,CAAC;IAEF,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC3C,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;KAC5D;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a LayersModel object.\n *\n * @param model tf.LayersModel instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n\n const trainableCount = countTrainableParams(model);\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction countTrainableParams(model: Container): number {\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n return trainableCount;\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\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-layers/dist/utils/math_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts deleted file mode 100644 index 2d7da63ef..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -export declare type ArrayTypes = Uint8Array | Int32Array | Float32Array; -/** - * Determine if a number is an integer. - */ -export declare function isInteger(x: number): boolean; -/** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ -export declare function arrayProd(array: number[] | ArrayTypes, begin?: number, end?: number): number; -/** - * Compute minimum value. - * @param array - * @return minimum value. - */ -export declare function min(array: number[] | Float32Array): number; -/** - * Compute maximum value. - * @param array - * @return maximum value - */ -export declare function max(array: number[] | Float32Array): number; -/** - * Compute sum of array. - * @param array - * @return The sum. - */ -export declare function sum(array: number[] | Float32Array): number; -/** - * Compute mean of array. - * @param array - * @return The mean. - */ -export declare function mean(array: number[] | Float32Array): number; -/** - * Compute variance of array. - * @param array - * @return The variance. - */ -export declare function variance(array: number[] | Float32Array): number; -/** - * Compute median of array. - * @param array - * @return The median value. - */ -export declare function median(array: number[] | Float32Array): number; -/** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ -export declare function range(begin: number, end: number): number[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js deleted file mode 100644 index b3217861d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Math utility functions. - * - * This file contains some frequently used math function that operates on - * number[] or Float32Array and return a number. Many of these functions are - * not-so-thick wrappers around TF.js Core functions. But they offer the - * convenience of - * 1) not having to convert the inputs into Tensors, - * 2) not having to convert the returned Tensors to numbers. - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { scalar, tensor1d } from '@tensorflow/tfjs-core'; -import { ValueError } from '../errors'; -/** - * Determine if a number is an integer. - */ -export function isInteger(x) { - return x === parseInt(x.toString(), 10); -} -/** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ -export function arrayProd(array, begin, end) { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - let prod = 1; - for (let i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; -} -/** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ -function toArray1D(array) { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tensor1d(array); -} -/** - * Compute minimum value. - * @param array - * @return minimum value. - */ -export function min(array) { - return tfc.min(toArray1D(array)).dataSync()[0]; -} -/** - * Compute maximum value. - * @param array - * @return maximum value - */ -export function max(array) { - return tfc.max(toArray1D(array)).dataSync()[0]; -} -/** - * Compute sum of array. - * @param array - * @return The sum. - */ -export function sum(array) { - return tfc.sum(toArray1D(array)).dataSync()[0]; -} -/** - * Compute mean of array. - * @param array - * @return The mean. - */ -export function mean(array) { - return sum(array) / array.length; -} -/** - * Compute variance of array. - * @param array - * @return The variance. - */ -export function variance(array) { - const demeaned = tfc.sub(toArray1D(array), scalar(mean(array))); - const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0]; - return sumSquare / array.length; -} -/** - * Compute median of array. - * @param array - * @return The median value. - */ -export function median(array) { - const arraySorted = array.slice().sort((a, b) => a - b); - const lowIdx = Math.floor((arraySorted.length - 1) / 2); - const highIdx = Math.ceil((arraySorted.length - 1) / 2); - if (lowIdx === highIdx) { - return arraySorted[lowIdx]; - } - return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2; -} -/** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ -export function range(begin, end) { - if (end < begin) { - throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`); - } - const out = []; - for (let i = begin; i < end; ++i) { - out.push(i); - } - return out; -} -//# sourceMappingURL=math_utils.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-layers/dist/utils/math_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map deleted file mode 100644 index 00249007c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"math_utils.js","sourceRoot":"","sources":["../../src/utils/math_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAY,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAIrC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACrB,KAA0B,EAAE,KAAc,EAAE,GAAY;IAC1D,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,KAAK,GAAG,CAAC,CAAC;KACX;IACD,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;KACpB;IAED,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;QAChC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAA4B;IAC7C,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED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D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;KAC5B;IACD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,GAAW;IAC9C,IAAI,GAAG,GAAG,KAAK,EAAE;QACf,MAAM,IAAI,UAAU,CAAC,QAAQ,GAAG,cAAc,KAAK,iBAAiB,CAAC,CAAC;KACvE;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;QAChC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACb;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, exclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\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-layers/dist/utils/math_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map deleted file mode 100644 index 337d170e2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"math_utils_test.js","sourceRoot":"","sources":["../../src/utils/math_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACpB,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI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,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3C,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for math_utils.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\n\nimport * as math_utils from './math_utils';\nimport {describeMathCPU} from './test_utils';\n\ndescribe('isInteger', () => {\n it('True cases', () => {\n expect(math_utils.isInteger(-103)).toBe(true);\n expect(math_utils.isInteger(0)).toBe(true);\n expect(math_utils.isInteger(1337)).toBe(true);\n });\n\n it('False cases', () => {\n expect(math_utils.isInteger(-1.03)).toBe(false);\n expect(math_utils.isInteger(0.008)).toBe(false);\n expect(math_utils.isInteger(133.7)).toBe(false);\n });\n});\n\ndescribe('arrayProd', () => {\n it('Full length', () => {\n expect(math_utils.arrayProd([2, 3, 4])).toEqual(24);\n expect(math_utils.arrayProd(new Float32Array([2, 3, 4]))).toEqual(24);\n });\n\n it('Partial from beginning', () => {\n expect(math_utils.arrayProd([2, 3, 4], null, 2)).toEqual(6);\n expect(math_utils.arrayProd([2, 3, 4], 0, 2)).toEqual(6);\n });\n\n it('Partial to end', () => {\n expect(math_utils.arrayProd([2, 3, 4], 1)).toEqual(12);\n expect(math_utils.arrayProd([2, 3, 4], 1, 3)).toEqual(12);\n });\n\n it('Partial no beginninng no end', () => {\n expect(math_utils.arrayProd([2, 3, 4, 5], 1, 3)).toEqual(12);\n });\n\n it('Empty array', () => {\n expect(math_utils.arrayProd([])).toEqual(1);\n });\n});\n\ndescribeMathCPU('min', () => {\n it('Number array', () => {\n expect(math_utils.min([-100, -200, 150])).toEqual(-200);\n });\n\n it('Float32Array', () => {\n expect(math_utils.min(new Float32Array([-100, -200, 150]))).toEqual(-200);\n });\n});\n\ndescribeMathCPU('max', () => {\n it('Number array', () => {\n expect(math_utils.max([-100, -200, 150])).toEqual(150);\n });\n\n it('Float32Array', () => {\n expect(math_utils.max(new Float32Array([-100, -200, 150]))).toEqual(150);\n });\n});\n\ndescribeMathCPU('sum', () => {\n it('Number array', () => {\n expect(math_utils.sum([-100, -200, 150])).toEqual(-150);\n });\n\n it('Float32Array', () => {\n expect(math_utils.sum(new Float32Array([-100, -200, 150]))).toEqual(-150);\n });\n});\n\ndescribeMathCPU('mean', () => {\n it('Number array', () => {\n expect(math_utils.mean([-100, -200, 150])).toEqual(-50);\n });\n\n it('Float32Array', () => {\n expect(math_utils.mean(new Float32Array([-100, -200, 150]))).toEqual(-50);\n });\n});\n\ndescribeMathCPU('variance', () => {\n it('Number array', () => {\n expect(math_utils.variance([-100, -200, 150, 50])).toEqual(18125);\n });\n\n it('Float32Array', () => {\n expect(math_utils.variance(new Float32Array([-100, -200, 150, 50])))\n .toEqual(18125);\n });\n});\n\ndescribeMathCPU('median', () => {\n it('Number array', () => {\n expect(math_utils.median([-100, -200, 150, 50])).toEqual(-25);\n });\n\n it('Float32Array', () => {\n expect(math_utils.median(new Float32Array([-100, -200, 150, 50])))\n .toEqual(-25);\n });\n\n it('does not mutate input array', () => {\n const numbers = [-100, -200, 150, 50];\n math_utils.median(numbers);\n tfc.test_util.expectArraysClose(numbers, [-100, -200, 150, 50]);\n });\n});\n\ndescribe('range', () => {\n it('end > begin', () => {\n expect(math_utils.range(0, 1)).toEqual([0]);\n expect(math_utils.range(0, 5)).toEqual([0, 1, 2, 3, 4]);\n expect(math_utils.range(-10, -5)).toEqual([-10, -9, -8, -7, -6]);\n expect(math_utils.range(-3, 3)).toEqual([-3, -2, -1, 0, 1, 2]);\n });\n it('end === begin', () => {\n expect(math_utils.range(0, 0)).toEqual([]);\n expect(math_utils.range(-2, -2)).toEqual([]);\n });\n it('end < begin throws error', () => {\n expect(() => math_utils.range(0, -2)).toThrowError(/.*-2.*0.*forbidden/);\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-layers/dist/utils/serialization_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts deleted file mode 100644 index 394a529c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { serialization } from '@tensorflow/tfjs-core'; -import { PyJsonValue } from '../keras_format/types'; -/** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export declare function convertPythonicToTs(pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue; -/** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export declare function convertTsToPythonic(tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js deleted file mode 100644 index 73023bfb3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as generic_utils from '../utils/generic_utils'; -// tslint:enable -/** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ -function isArrayItemInputOrOutputName(key, index, value) { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; -} -/** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export function convertPythonicToTs(pythonicConfig, key) { - if (pythonicConfig === null) { - return null; - } - else if (typeof pythonicConfig === 'string') { - return generic_utils.toCamelCase(pythonicConfig); - } - else if ((typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } - else if (pythonicConfig instanceof Array) { - const tsArray = []; - const arrayLength = pythonicConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } - else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } - else { - const tsDict = {}; - for (const pythonicKey of Object.keys(pythonicConfig)) { - const pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } - else { - const tsKey = generic_utils.toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } -} -/** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export function convertTsToPythonic(tsConfig, key) { - if (tsConfig === null || tsConfig === undefined) { - return null; - } - else if (typeof tsConfig === 'string') { - return generic_utils.toSnakeCase(tsConfig); - } - else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } - else if (tsConfig instanceof Array) { - const pyArray = []; - const arrayLength = tsConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } - else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } - else { - const pyDict = {}; - for (const tsKey of Object.keys(tsConfig)) { - const tsValue = tsConfig[tsKey]; - const pyKey = generic_utils.toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } - else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } -} -//# sourceMappingURL=serialization_utils.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-layers/dist/utils/serialization_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map deleted file mode 100644 index bd73cd58f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialization_utils.js","sourceRoot":"","sources":["../../src/utils/serialization_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,gBAAgB;AAEhB;;;;;;;;GAQG;AACH,SAAS,4BAA4B,CACjC,GAAW,EAAE,KAAa,EAAE,KAAQ;IACtC,OAAO,CAAC,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,cAAc;QAChD,GAAG,KAAK,aAAa,CAAC;QAC1B,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAC/B,cAA2B,EAAE,GAAY;IAC3C,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC7C,OAAO,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;KAClD;SAAM,IACH,CAAC,OAAO,cAAc,KAAK,QAAQ,CAAC;QACpC,CAAC,OAAO,cAAc,KAAK,SAAS,CAAC,EAAE;QACzC,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,YAAY,KAAK,EAAE;Q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AAC,CAAC;aACrD;SACF;QACD,OAAO,MAAM,CAAC;KACf;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a LayersModel or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of LayersModel and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\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-layers/dist/utils/serialization_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map deleted file mode 100644 index 9909e9f04..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialization_utils_test.js","sourceRoot":"","sources":["../../src/utils/serialization_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE/E,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACpB,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,C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gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,mBAAmB,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC,CAAC;QACzE,MAAM,CAAC,mBAAmB,CAAC,EAAC,YAAY,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC5D,YAAY,EAAE,QAAQ;SACvB,CAAC,CAAC;QACH,MAAM,CAAC,mBAAmB,CAAC,EAAC,UAAU,EAAE,cAAc,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAChE,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,MAAM,CAAC,mBAAmB,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit Tests for serialization_utils\n * Porting Note: serialization_utils is a tfjs-layers only file, not found\n * int the original PyKeras.\n */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {PyJsonValue} from '../keras_format/types';\n\nimport {convertPythonicToTs, convertTsToPythonic} from './serialization_utils';\n\ndescribe('convertPythonToTs', () => {\n it('primitives', () => {\n expect(convertPythonicToTs(null)).toEqual(null);\n expect(convertPythonicToTs(true)).toEqual(true);\n expect(convertPythonicToTs(false)).toEqual(false);\n expect(convertPythonicToTs(4)).toEqual(4);\n });\n it('strings w/o name tags', () => {\n expect(convertPythonicToTs('abc')).toEqual('abc');\n expect(convertPythonicToTs('ABC')).toEqual('ABC');\n expect(convertPythonicToTs('one_two')).toEqual('oneTwo');\n expect(convertPythonicToTs('OneTwo')).toEqual('OneTwo');\n });\n it('simple arrays', () => {\n expect(convertPythonicToTs([])).toEqual([]);\n expect(convertPythonicToTs([null])).toEqual([null]);\n expect(convertPythonicToTs(['one_two'])).toEqual(['oneTwo']);\n expect(convertPythonicToTs([null, true, false, 4, 'abc'])).toEqual([\n null, true, false, 4, 'abc'\n ]);\n expect(convertPythonicToTs([[[]]])).toEqual([[[]]]);\n });\n // We have to special case strings that are layer_names to not be converted\n it('layer tuple (array) with key', () => {\n for (const key of ['inboundNodes', 'inputLayers', 'outputLayers']) {\n expect(convertPythonicToTs(['layer_name', 'meta_data', 0], key)).toEqual([\n 'layer_name', 'metaData', 0\n ]);\n }\n });\n it('dictionary', () => {\n expect(convertPythonicToTs({})).toEqual({});\n expect(convertPythonicToTs({key: null})).toEqual({key: null});\n expect(convertPythonicToTs({key_one: 4})).toEqual({keyOne: 4});\n expect(convertPythonicToTs({key_two: 'abc_def'})).toEqual({\n keyTwo: 'abcDef'\n });\n expect(convertPythonicToTs({key_one: true, key_two: false}))\n .toEqual({keyOne: true, keyTwo: false});\n // values keyed by 'name' are special and don't get converted.\n expect(convertPythonicToTs({name: 'layer_name'})).toEqual({\n name: 'layer_name'\n });\n });\n it('dictionary keys are passed down the stack', () => {\n const dict: PyJsonValue = {inbound_nodes: ['DoNotChange_Me', 0, null]};\n expect(convertPythonicToTs(dict)).toEqual({\n inboundNodes: ['DoNotChange_Me', 0, null]\n });\n });\n // We promote certan fields to enums\n it('enum promotion', () => {\n expect(convertPythonicToTs({mode: 'fan_out'})).toEqual({mode: 'fanOut'});\n expect(convertPythonicToTs({distribution: 'normal'})).toEqual({\n distribution: 'normal'\n });\n expect(convertPythonicToTs({data_format: 'channels_last'})).toEqual({\n dataFormat: 'channelsLast'\n });\n expect(convertPythonicToTs({padding: 'valid'})).toEqual({padding: 'valid'});\n });\n});\n\ndescribe('convertTsToPythonic', () => {\n it('primitives', () => {\n expect(convertTsToPythonic(null)).toEqual(null);\n expect(convertTsToPythonic(true)).toEqual(true);\n expect(convertTsToPythonic(false)).toEqual(false);\n expect(convertTsToPythonic(4)).toEqual(4);\n });\n it('strings w/o name tags', () => {\n expect(convertTsToPythonic('abc')).toEqual('abc');\n expect(convertTsToPythonic('ABC')).toEqual('abc');\n expect(convertTsToPythonic('oneTwo')).toEqual('one_two');\n expect(convertTsToPythonic('OneTwo')).toEqual('one_two');\n });\n it('simple arrays', () => {\n expect(convertTsToPythonic([])).toEqual([]);\n expect(convertTsToPythonic([null])).toEqual([null]);\n expect(convertTsToPythonic(['oneTwo'])).toEqual(['one_two']);\n expect(convertTsToPythonic([null, true, false, 4, 'abc'])).toEqual([\n null, true, false, 4, 'abc'\n ]);\n expect(convertTsToPythonic([[[]]])).toEqual([[[]]]);\n });\n // We have to special case strings that are layer_names to not be converted\n it('layer tuple (array) with key', () => {\n for (const key of ['inboundNodes', 'inputLayers', 'outputLayers']) {\n expect(convertTsToPythonic(['layerName', 'metaData', 0], key)).toEqual([\n 'layerName', 'meta_data', 0\n ]);\n }\n });\n it('dictionary', () => {\n expect(convertTsToPythonic({})).toEqual({});\n expect(convertTsToPythonic({key: null})).toEqual({key: null});\n expect(convertTsToPythonic({keyOne: 4})).toEqual({key_one: 4});\n expect(convertTsToPythonic({keyTwo: 'abcDef'})).toEqual({\n key_two: 'abc_def'\n });\n expect(convertTsToPythonic({keyOne: true, keyTwo: false}))\n .toEqual({key_one: true, key_two: false});\n // values keyed by 'name' are special and don't get converted.\n expect(convertTsToPythonic({name: 'layerName'})).toEqual({\n name: 'layerName'\n });\n });\n it('dictionary keys are passed down the stack', () => {\n const dict: serialization.ConfigDictValue = {\n inboundNodes: ['DoNotChange_Me', 0, null]\n };\n expect(convertTsToPythonic(dict)).toEqual({\n inbound_nodes: ['DoNotChange_Me', 0, null]\n });\n });\n // We need to stringify our enums\n it('enum promotion', () => {\n expect(convertTsToPythonic({mode: 'fanOut'})).toEqual({mode: 'fan_out'});\n expect(convertTsToPythonic({distribution: 'normal'})).toEqual({\n distribution: 'normal'\n });\n expect(convertTsToPythonic({dataFormat: 'channelsLast'})).toEqual({\n data_format: 'channels_last'\n });\n expect(convertTsToPythonic({padding: 'valid'})).toEqual({padding: 'valid'});\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-layers/dist/utils/test_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts deleted file mode 100644 index c99ee4b80..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Testing utilities. - */ -import { Tensor } from '@tensorflow/tfjs-core'; -/** - * Expect values are close between a Tensor or number array. - * @param actual - * @param expected - */ -export declare function expectTensorsClose(actual: Tensor | number[], expected: Tensor | number[], epsilon?: number): void; -/** - * Expect values in array are within a specified range, boundaries inclusive. - * @param actual - * @param expected - */ -export declare function expectTensorsValuesInRange(actual: Tensor, low: number, high: number): void; -/** - * Describe tests to be run on CPU and GPU. - * @param testName - * @param tests - */ -export declare function describeMathCPUAndGPU(testName: string, tests: () => void): void; -/** - * Describe tests to be run on CPU only. - * @param testName - * @param tests - */ -export declare function describeMathCPU(testName: string, tests: () => void): void; -/** - * Describe tests to be run on GPU only. - * @param testName - * @param tests - */ -export declare function describeMathGPU(testName: string, tests: () => void): void; -/** - * Check that a function only generates the expected number of new Tensors. - * - * The test function is called twice, once to prime any regular constants and - * once to ensure that additional copies aren't created/tensors aren't leaked. - * - * @param testFunc A fully curried (zero arg) version of the function to test. - * @param numNewTensors The expected number of new Tensors that should exist. - */ -export declare function expectNoLeakedTensors(testFunc: () => any, numNewTensors: number): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js deleted file mode 100644 index c33053e78..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Testing utilities. - */ -import { memory, Tensor, test_util, util } from '@tensorflow/tfjs-core'; -// tslint:disable-next-line: no-imports-from-dist -import { ALL_ENVS, describeWithFlags, registerTestEnv } from '@tensorflow/tfjs-core/dist/jasmine_util'; -import { ValueError } from '../errors'; -// Register backends. -registerTestEnv({ name: 'cpu', backendName: 'cpu' }); -registerTestEnv({ - name: 'webgl2', - backendName: 'webgl', - flags: { - 'WEBGL_VERSION': 2, - 'WEBGL_CPU_FORWARD': false, - 'WEBGL_SIZE_UPLOAD_UNIFORM': 0 - } -}); -/** - * Expect values are close between a Tensor or number array. - * @param actual - * @param expected - */ -export function expectTensorsClose(actual, expected, epsilon) { - if (actual == null) { - throw new ValueError('First argument to expectTensorsClose() is not defined.'); - } - if (expected == null) { - throw new ValueError('Second argument to expectTensorsClose() is not defined.'); - } - if (actual instanceof Tensor && expected instanceof Tensor) { - if (actual.dtype !== expected.dtype) { - throw new Error(`Data types do not match. Actual: '${actual.dtype}'. ` + - `Expected: '${expected.dtype}'`); - } - if (!util.arraysEqual(actual.shape, expected.shape)) { - throw new Error(`Shapes do not match. Actual: [${actual.shape}]. ` + - `Expected: [${expected.shape}].`); - } - } - const actualData = actual instanceof Tensor ? actual.dataSync() : actual; - const expectedData = expected instanceof Tensor ? expected.dataSync() : expected; - test_util.expectArraysClose(actualData, expectedData, epsilon); -} -/** - * Expect values in array are within a specified range, boundaries inclusive. - * @param actual - * @param expected - */ -export function expectTensorsValuesInRange(actual, low, high) { - if (actual == null) { - throw new ValueError('First argument to expectTensorsClose() is not defined.'); - } - test_util.expectValuesInRange(actual.dataSync(), low, high); -} -/** - * Describe tests to be run on CPU and GPU. - * @param testName - * @param tests - */ -export function describeMathCPUAndGPU(testName, tests) { - describeWithFlags(testName, ALL_ENVS, () => { - tests(); - }); -} -/** - * Describe tests to be run on CPU only. - * @param testName - * @param tests - */ -export function describeMathCPU(testName, tests) { - describeWithFlags(testName, { predicate: testEnv => testEnv.backendName === 'cpu' }, () => { - tests(); - }); -} -/** - * Describe tests to be run on GPU only. - * @param testName - * @param tests - */ -export function describeMathGPU(testName, tests) { - describeWithFlags(testName, { predicate: testEnv => testEnv.backendName === 'webgl' }, () => { - tests(); - }); -} -/** - * Check that a function only generates the expected number of new Tensors. - * - * The test function is called twice, once to prime any regular constants and - * once to ensure that additional copies aren't created/tensors aren't leaked. - * - * @param testFunc A fully curried (zero arg) version of the function to test. - * @param numNewTensors The expected number of new Tensors that should exist. - */ -export function expectNoLeakedTensors( -// tslint:disable-next-line:no-any -testFunc, numNewTensors) { - testFunc(); - const numTensorsBefore = memory().numTensors; - testFunc(); - const numTensorsAfter = memory().numTensors; - const actualNewTensors = numTensorsAfter - numTensorsBefore; - if (actualNewTensors !== numNewTensors) { - throw new ValueError(`Created an unexpected number of new ` + - `Tensors. Expected: ${numNewTensors}, created : ${actualNewTensors}. ` + - `Please investigate the discrepency and/or use tidy.`); - } -} -//# sourceMappingURL=test_utils.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-layers/dist/utils/test_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map deleted file mode 100644 index 62d638fdf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test_utils.js","sourceRoot":"","sources":["../../src/utils/test_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AACtE,iDAAiD;AACjD,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,yCAAyC,CAAC;AACrG,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC,qBAAqB;AACrB,eAAe,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC,CAAC;AACnD,eAAe,CAAC;IACd,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,OAAO;IACpB,KAAK,EAAE;QACL,eAAe,EAAE,CAAC;QAClB,mBAAmB,EAAE,KAAK;QAC1B,2BAA2B,EAAE,CAAC;KAC/B;CACF,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAuB,EAAE,QAAyB,EAAE,OAAgB;IACtE,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,IAAI,UAAU,CAChB,wDAAwD,CAAC,CAAC;KAC/D;IACD,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,MAAM,IAAI,UAAU,CAChB,yDAAyD,CAAC,CAAC;KAChE;IACD,IAAI,MAAM,YAAY,MAAM,IAAI,QAAQ,YAAY,MAAM,EAAE;QAC1D,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE;YACnC,MAAM,IAAI,KAAK,CACX,qCAAq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AAW,KAAK,KAAK,EAAC,EAAE,GAAG,EAAE;QACpE,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACT,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,KAAiB;IACjE,iBAAiB,CACb,QAAQ,EAAE,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,OAAO,EAAC,EAAE,GAAG,EAAE;QACtE,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACT,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB;AACjC,kCAAkC;AAClC,QAAmB,EAAE,aAAqB;IAC5C,QAAQ,EAAE,CAAC;IACX,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC;IAC7C,QAAQ,EAAE,CAAC;IACX,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC;IAC5C,MAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,IAAI,gBAAgB,KAAK,aAAa,EAAE;QACtC,MAAM,IAAI,UAAU,CAChB,sCAAsC;YACtC,uBAAuB,aAAa,eAChC,gBAAgB,IAAI;YACxB,qDAAqD,CAAC,CAAC;KAC5D;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Testing utilities.\n */\n\nimport {memory, Tensor, test_util, util} from '@tensorflow/tfjs-core';\n// tslint:disable-next-line: no-imports-from-dist\nimport {ALL_ENVS, describeWithFlags, registerTestEnv} from '@tensorflow/tfjs-core/dist/jasmine_util';\nimport {ValueError} from '../errors';\n\n// Register backends.\nregisterTestEnv({name: 'cpu', backendName: 'cpu'});\nregisterTestEnv({\n name: 'webgl2',\n backendName: 'webgl',\n flags: {\n 'WEBGL_VERSION': 2,\n 'WEBGL_CPU_FORWARD': false,\n 'WEBGL_SIZE_UPLOAD_UNIFORM': 0\n }\n});\n\n/**\n * Expect values are close between a Tensor or number array.\n * @param actual\n * @param expected\n */\nexport function expectTensorsClose(\n actual: Tensor|number[], expected: Tensor|number[], epsilon?: number) {\n if (actual == null) {\n throw new ValueError(\n 'First argument to expectTensorsClose() is not defined.');\n }\n if (expected == null) {\n throw new ValueError(\n 'Second argument to expectTensorsClose() is not defined.');\n }\n if (actual instanceof Tensor && expected instanceof Tensor) {\n if (actual.dtype !== expected.dtype) {\n throw new Error(\n `Data types do not match. Actual: '${actual.dtype}'. ` +\n `Expected: '${expected.dtype}'`);\n }\n if (!util.arraysEqual(actual.shape, expected.shape)) {\n throw new Error(\n `Shapes do not match. Actual: [${actual.shape}]. ` +\n `Expected: [${expected.shape}].`);\n }\n }\n const actualData = actual instanceof Tensor ? actual.dataSync() : actual;\n const expectedData =\n expected instanceof Tensor ? expected.dataSync() : expected;\n test_util.expectArraysClose(actualData, expectedData, epsilon);\n}\n\n/**\n * Expect values in array are within a specified range, boundaries inclusive.\n * @param actual\n * @param expected\n */\nexport function expectTensorsValuesInRange(\n actual: Tensor, low: number, high: number) {\n if (actual == null) {\n throw new ValueError(\n 'First argument to expectTensorsClose() is not defined.');\n }\n test_util.expectValuesInRange(actual.dataSync(), low, high);\n}\n\n/**\n * Describe tests to be run on CPU and GPU.\n * @param testName\n * @param tests\n */\nexport function describeMathCPUAndGPU(testName: string, tests: () => void) {\n describeWithFlags(testName, ALL_ENVS, () => {\n tests();\n });\n}\n\n/**\n * Describe tests to be run on CPU only.\n * @param testName\n * @param tests\n */\nexport function describeMathCPU(testName: string, tests: () => void) {\n describeWithFlags(\n testName, {predicate: testEnv => testEnv.backendName === 'cpu'}, () => {\n tests();\n });\n}\n\n/**\n * Describe tests to be run on GPU only.\n * @param testName\n * @param tests\n */\nexport function describeMathGPU(testName: string, tests: () => void) {\n describeWithFlags(\n testName, {predicate: testEnv => testEnv.backendName === 'webgl'}, () => {\n tests();\n });\n}\n\n/**\n * Check that a function only generates the expected number of new Tensors.\n *\n * The test function is called twice, once to prime any regular constants and\n * once to ensure that additional copies aren't created/tensors aren't leaked.\n *\n * @param testFunc A fully curried (zero arg) version of the function to test.\n * @param numNewTensors The expected number of new Tensors that should exist.\n */\nexport function expectNoLeakedTensors(\n // tslint:disable-next-line:no-any\n testFunc: () => any, numNewTensors: number) {\n testFunc();\n const numTensorsBefore = memory().numTensors;\n testFunc();\n const numTensorsAfter = memory().numTensors;\n const actualNewTensors = numTensorsAfter - numTensorsBefore;\n if (actualNewTensors !== numNewTensors) {\n throw new ValueError(\n `Created an unexpected number of new ` +\n `Tensors. Expected: ${numNewTensors}, created : ${\n actualNewTensors}. ` +\n `Please investigate the discrepency and/or use tidy.`);\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-layers/dist/utils/types_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts deleted file mode 100644 index 5c98fda28..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { Tensor } from '@tensorflow/tfjs-core'; -import { Shape } from '../keras_format/common'; -/** - * Determine whether the input is an Array of Shapes. - */ -export declare function isArrayOfShapes(x: Shape | Shape[]): boolean; -/** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ -export declare function normalizeShapeList(x: Shape | Shape[]): Shape[]; -/** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ -export declare function getExactlyOneTensor(xs: Tensor | Tensor[]): Tensor; -/** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ -export declare function getExactlyOneShape(shapes: Shape | Shape[]): Shape; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js deleted file mode 100644 index dd9aaa044..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { ValueError } from '../errors'; -// tslint:enable -/** - * Determine whether the input is an Array of Shapes. - */ -export function isArrayOfShapes(x) { - return Array.isArray(x) && Array.isArray(x[0]); -} -/** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ -export function normalizeShapeList(x) { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x]; - } - return x; -} -/** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ -export function getExactlyOneTensor(xs) { - let x; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`); - } - x = xs[0]; - } - else { - x = xs; - } - return x; -} -/** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ -export function getExactlyOneShape(shapes) { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes; - return shapes[0]; - } - else { - throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`); - } - } - else { - return shapes; - } -} -//# sourceMappingURL=types_utils.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-layers/dist/utils/types_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map deleted file mode 100644 index 92d0fb875..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types_utils.js","sourceRoot":"","sources":["../../src/utils/types_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC,gBAAgB;AAEhB;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,CAAgB;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAgB;IACjD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAClB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACxB,OAAO,CAAC,CAAC,CAAY,CAAC;KACvB;IACD,OAAO,CAAY,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAmB;IACrD,IAAI,CAAS,CAAC;IACd,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACrB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;YACnB,MAAM,IAAI,UAAU,CAAC,uCAAuC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1E;QACD,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;KACX;SAAM;QACL,CAAC,GAAG,EAAE,CAAC;KACR;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;IACtD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;QACrD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,MAAM,GAAG,MAAiB,CAAC;YAC3B,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,MAAM,IAAI,UAAU,CAAC,iCAAiC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;SACxE;KACF;SAAM;QACL,OAAO,MAAe,CAAC;KACxB;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../keras_format/common';\n// tslint:enable\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s.\n * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\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-layers/dist/utils/types_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map deleted file mode 100644 index 8e2c0d103..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types_utils_test.js","sourceRoot":"","sources":["../../src/utils/types_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAE7C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAA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GAAG,EAAE;QACzB,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAC1C,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACT,CAAC,CAAC,CAAC,YAAY,CAAC,iCAAiC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as types_utils from './types_utils';\n\ndescribe('isArrayOfShapes', () => {\n it('returns false for a single non-empty shape', () => {\n expect(types_utils.isArrayOfShapes([1, 2, 3])).toEqual(false);\n });\n it('returns false for a single empty shape', () => {\n expect(types_utils.isArrayOfShapes([])).toEqual(false);\n });\n it('returns true for an array of shapes', () => {\n expect(types_utils.isArrayOfShapes([[1], [2, 3]])).toEqual(true);\n });\n it('returns true for an array of shapes that includes empty shapes', () => {\n expect(types_utils.isArrayOfShapes([[], [2, 3]])).toEqual(true);\n expect(types_utils.isArrayOfShapes([[]])).toEqual(true);\n expect(types_utils.isArrayOfShapes([[], []])).toEqual(true);\n });\n});\n\ndescribe('normalizeShapeList', () => {\n it('returns an empty list if an empty list is passed in.', () => {\n expect(types_utils.normalizeShapeList([])).toEqual([]);\n });\n\n it('returns a list of shapes if a single shape is passed in.', () => {\n expect(types_utils.normalizeShapeList([1])).toEqual([[1]]);\n });\n\n it('returns a list of shapes if an empty shape is passed in.', () => {\n expect(types_utils.normalizeShapeList([[]])).toEqual([[]]);\n });\n\n it('returns a list of shapes if a list of shapes is passed in.', () => {\n expect(types_utils.normalizeShapeList([[1]])).toEqual([[1]]);\n });\n});\n\ndescribe('getExactlyOneShape', () => {\n it('single instance', () => {\n expect(types_utils.getExactlyOneShape([1, 2, 3])).toEqual([1, 2, 3]);\n expect(types_utils.getExactlyOneShape([null, 8])).toEqual([null, 8]);\n expect(types_utils.getExactlyOneShape([])).toEqual([]);\n });\n it('Array of length 1', () => {\n expect(types_utils.getExactlyOneShape([[1, 2]])).toEqual([1, 2]);\n expect(types_utils.getExactlyOneShape([[]])).toEqual([]);\n });\n it('Array of length 2: ValueError', () => {\n expect(() => types_utils.getExactlyOneShape([\n [1], [2]\n ])).toThrowError(/Expected exactly 1 Shape; got 2/);\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-layers/dist/utils/variable_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts deleted file mode 100644 index 0f63588a7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import { LayerVariable } from '../variables'; -/** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ -export declare function countParamsInWeights(weights: LayerVariable[]): number; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js deleted file mode 100644 index ee506f293..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -/** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ -export function countParamsInWeights(weights) { - let count = 0; - for (const weight of weights) { - if (weight.shape.length === 0) { - count += 1; - } - else { - count += weight.shape.reduce((a, b) => a * b); - } - } - return count; -} -//# sourceMappingURL=variable_utils.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-layers/dist/utils/variable_utils.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map deleted file mode 100644 index 37c5f1d0b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"variable_utils.js","sourceRoot":"","sources":["../../src/utils/variable_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,KAAK,IAAI,CAAC,CAAC;SACZ;aAAM;YACL,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/C;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\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-layers/dist/utils/variable_utils_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map deleted file mode 100644 index 6d3c5c345..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"variable_utils_test.js","sourceRoot":"","sources":["../../src/utils/variable_utils_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACtB,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC5B,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC;YACzC,OAAO,EAAE,OAAO,EAAE,OAAO;SAC1B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {scalar, zeros} from '@tensorflow/tfjs-core';\n\nimport {LayerVariable} from '../variables';\n\nimport * as variable_utils from './variable_utils';\n\ndescribe('countParamsInWeights', () => {\n it('Zero weights', () => {\n expect(variable_utils.countParamsInWeights([])).toEqual(0);\n });\n\n it('One float32 weight', () => {\n const weight1 = new LayerVariable(zeros([2, 3]));\n expect(variable_utils.countParamsInWeights([weight1])).toEqual(6);\n });\n\n it('One float32 scalar weight', () => {\n const weight1 = new LayerVariable(scalar(42));\n expect(variable_utils.countParamsInWeights([weight1])).toEqual(1);\n });\n\n it('One int32 weight', () => {\n const weight1 = new LayerVariable(zeros([1, 3, 4], 'int32'), 'int32');\n expect(variable_utils.countParamsInWeights([weight1])).toEqual(12);\n });\n\n it('Two weights, mixed types and shapes', () => {\n const weight1 = new LayerVariable(scalar(42));\n const weight2 = new LayerVariable(zeros([2, 3]));\n const weight3 = new LayerVariable(zeros([1, 3, 4], 'int32'), 'int32');\n expect(variable_utils.countParamsInWeights([\n weight1, weight2, weight3\n ])).toEqual(19);\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-layers/dist/variables.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts deleted file mode 100644 index 77107e761..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { DataType, Tensor } from '@tensorflow/tfjs-core'; -import { Constraint } from './constraints'; -import { Shape } from './keras_format/common'; -/** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ -export declare class LayerVariable { - readonly dtype: DataType; - readonly shape: Shape; - readonly id: number; - readonly name: string; - readonly originalName: string; - private trainable_; - protected readonly val: tfc.Variable; - readonly constraint: Constraint; - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - constructor(val: Tensor, dtype?: DataType, name?: string, trainable?: boolean, constraint?: Constraint); - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - read(): Tensor; - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - write(newVal: Tensor): this; - /** - * Dispose this LayersVariable instance from memory. - */ - dispose(): void; - protected assertNotDisposed(): void; - trainable: boolean; -} -/** - * Create a Variable. - * @param x The initial value of the `Variable`. - * @param dtype optional, the type of the variable. - * @param name optional, the name of the variable, default provided by - * Variable. - * @param constraint optional, a constraint to be applied after every update. - * @return The newly instantiated `Variable`. - */ -export declare function variable(x: Tensor, dtype?: DataType, name?: string, constraint?: Constraint): LayerVariable; -/** - * Instantiates an all-zeros Variable and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-zero Variable. - */ -export declare function zerosVariable(shape: Shape, dtype?: DataType, name?: string): LayerVariable; -/** - * Instantiates an all-zeros tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export declare function zerosLike(x: Tensor, dtype?: DataType, name?: string): LayerVariable; -/** - * Instantiates an all-ones tensor and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-ones Variable. - */ -export declare function onesVariable(shape: Shape, dtype?: DataType, name?: string): LayerVariable; -/** - * Instantiates an all-ones tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export declare function onesLike(x: Tensor, dtype?: DataType, name?: string): LayerVariable; -/** - * Instantiate an identity matrix and returns it, as a Variable - * - * @param size Number of rows/columns. - * @param dtype Data type of returned Variable. - * @param name Name of returned Variable. - * @return A Variable, an identity matrix. - */ -export declare function eyeVariable(size: number, dtype?: DataType, name?: string): LayerVariable; -/** - * Get a Variable with uniform distribution of values. - * @param shape Shape of the tensor. - * @param minval Lower bound of the uniform distribution. - * @param maxval Upper bound of the uniform distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The uniform-random Variable. - */ -export declare function randomUniformVariable(shape: Shape, minval: number, maxval: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; -/** - * Get a Variable with truncated-normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export declare function truncatedNormalVariable(shape: Shape, mean?: number, stddev?: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; -/** - * Get a Variable with normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export declare function randomNormalVariable(shape: Shape, mean?: number, stddev?: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; -/** - * Update the value of a Variable. - * @param x The Variable to be updated. - * @param xNew The new value to update to. - * @return The Variable updated. - */ -export declare function update(x: LayerVariable, xNew: Tensor): LayerVariable; -/** - * Update the value of a Variable by adding an increment. - * @param x The Variable to be updated. - * @param increment The incrment to add to `x`. - * @return The Variable updated. - */ -export declare function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable; -/** - * Update the value of a Variable by subtracting a decrement. - * @param x The Variable to be updated. - * @param decrement The decrement to subtract from `x`. - * @return The Variable updated. - */ -export declare function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable; -/** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ -export declare function batchGetValue(xs: LayerVariable[]): Tensor[]; -/** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ -export declare function batchSetValue(variablesAndValues: Array<[LayerVariable, Tensor]>): void; -/** - * Returns the gradients of `variables` w.r.t. the return value of `lossFn`. - * @param lossFn A function which returns a Scalar to be used as the function - * value (i.e., numerator) for differentiation. - * @param variables List of variables to be used as the independent variables - * (i.e., denominator) for differentiation. - * @returns An Array of gradients tensors. - */ -export declare function gradients(lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js deleted file mode 100644 index b76e04672..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js +++ /dev/null @@ -1,290 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as tfc from '@tensorflow/tfjs-core'; -import { variableGrads } from '@tensorflow/tfjs-core'; -import { getNextUniqueTensorId } from './backend/state'; -import { getScopedTensorName, getUniqueTensorName } from './common'; -import { NotImplementedError } from './errors'; -const DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; -/** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ -export class LayerVariable { - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - constructor(val, dtype = 'float32', name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true, constraint = null) { - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - this.trainable_ = trainable; - this.constraint = constraint; - this.val = tfc.variable(val, this.trainable_, this.name, this.dtype); - } - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - read() { - this.assertNotDisposed(); - return this.val; - } - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - write(newVal) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - } - /** - * Dispose this LayersVariable instance from memory. - */ - dispose() { - this.assertNotDisposed(); - this.val.dispose(); - } - assertNotDisposed() { - if (this.val.isDisposed) { - throw new Error(`LayersVariable ${this.name} is already disposed.`); - } - } - get trainable() { - return this.trainable_; - } - set trainable(trainable) { - this.trainable_ = trainable; - this.val.trainable = trainable; - } -} -function checkShapesMatch(x, y) { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } -} -/** - * Create a Variable. - * @param x The initial value of the `Variable`. - * @param dtype optional, the type of the variable. - * @param name optional, the name of the variable, default provided by - * Variable. - * @param constraint optional, a constraint to be applied after every update. - * @return The newly instantiated `Variable`. - */ -export function variable(x, dtype, name, constraint) { - return new LayerVariable(x, dtype, name, true, constraint); -} -/** - * Instantiates an all-zeros Variable and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-zero Variable. - */ -export function zerosVariable(shape, dtype, name) { - // TODO(cais): Implement logic for dtype. - return new LayerVariable(tfc.zeros(shape), dtype, name); -} -/** - * Instantiates an all-zeros tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export function zerosLike(x, dtype, name) { - return new LayerVariable(tfc.zerosLike(x), dtype, name); -} -/** - * Instantiates an all-ones tensor and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-ones Variable. - */ -export function onesVariable(shape, dtype, name) { - // TODO(cais): Implement logic for dtype. - const allocated = tfc.ones(shape); - return new LayerVariable(allocated, dtype, name); -} -/** - * Instantiates an all-ones tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export function onesLike(x, dtype, name) { - const allocated = tfc.onesLike(x); - return new LayerVariable(allocated, dtype, name); -} -/** - * Instantiate an identity matrix and returns it, as a Variable - * - * @param size Number of rows/columns. - * @param dtype Data type of returned Variable. - * @param name Name of returned Variable. - * @return A Variable, an identity matrix. - */ -export function eyeVariable(size, dtype, name) { - return new LayerVariable(tfc.eye(size), dtype, name); -} -/** - * Get a Variable with uniform distribution of values. - * @param shape Shape of the tensor. - * @param minval Lower bound of the uniform distribution. - * @param maxval Upper bound of the uniform distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The uniform-random Variable. - */ -export function randomUniformVariable(shape, minval, maxval, dtype, seed, name = 'randomUniform') { - return new LayerVariable(tfc.randomUniform(shape, minval, maxval, dtype), dtype, name); -} -/** - * Get a Variable with truncated-normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export function truncatedNormalVariable(shape, mean = 0.0, stddev = 1.0, dtype, seed, name = 'truncatedNormal') { - // TODO(cais): Implement logic for dtype and seed once they are supported - // by deeplearn.js. - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`randomNormal does not support dType ${dtype}.`); - } - return new LayerVariable(tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name); -} -/** - * Get a Variable with normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export function randomNormalVariable(shape, mean = 0.0, stddev = 1.0, dtype, seed, name = 'randomNormal') { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError(`randomNormalVariable does not support dType ${dtype}.`); - } - return new LayerVariable(tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name); -} -/** - * Update the value of a Variable. - * @param x The Variable to be updated. - * @param xNew The new value to update to. - * @return The Variable updated. - */ -export function update(x, xNew) { - return x.write(xNew); -} -/** - * Update the value of a Variable by adding an increment. - * @param x The Variable to be updated. - * @param increment The incrment to add to `x`. - * @return The Variable updated. - */ -export function updateAdd(x, increment) { - return x.write(tfc.add(x.read(), increment)); -} -/** - * Update the value of a Variable by subtracting a decrement. - * @param x The Variable to be updated. - * @param decrement The decrement to subtract from `x`. - * @return The Variable updated. - */ -export function updateSub(x, decrement) { - return x.write(tfc.sub(x.read(), decrement)); -} -/** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ -export function batchGetValue(xs) { - return xs.map(x => x.read()); -} -/** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ -export function batchSetValue(variablesAndValues) { - variablesAndValues.forEach(variableAndValue => { - const variable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); -} -/** - * Returns the gradients of `variables` w.r.t. the return value of `lossFn`. - * @param lossFn A function which returns a Scalar to be used as the function - * value (i.e., numerator) for differentiation. - * @param variables List of variables to be used as the independent variables - * (i.e., denominator) for differentiation. - * @returns An Array of gradients tensors. - */ -export function gradients(lossFn, variables) { - // TODO(cais): The return type signature can be simplified if deeplearn makes - // the corresponding type public. - const variableList = variables.map(variable => variable.read()); - const valudAndGrads = variableGrads(lossFn, variableList); - return variables.map(variable => valudAndGrads.grads[variable.name]); -} -//# sourceMappingURL=variables.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-layers/dist/variables.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map deleted file mode 100644 index 735bf99da..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"variables.js","sourceRoot":"","sources":["../src/variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C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6EAA6E;IAC7E,mCAAmC;IACnC,MAAM,YAAY,GACd,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAkB,CAAC,CAAC;IAC/D,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {Shape} from './keras_format/common';\nimport {HasShape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a\n * dtype and shape, but its value is mutable. The value is itself represented\n * as a`tf.Tensor`, and can be read with the `read()` method and updated with\n * the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n private trainable_: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a `tf.Tensor`.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable_ = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable_, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n this.assertNotDisposed();\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n this.assertNotDisposed();\n checkShapesMatch(this.val, newVal);\n // Skip updating if this is the exact same tensor.\n if (this.val.id !== newVal.id) {\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n }\n return this;\n }\n\n /**\n * Dispose this LayersVariable instance from memory.\n */\n dispose(): void {\n this.assertNotDisposed();\n this.val.dispose();\n }\n\n protected assertNotDisposed(): void {\n if (this.val.isDisposed) {\n throw new Error(`LayersVariable ${this.name} is already disposed.`);\n }\n }\n\n get trainable(): boolean {\n return this.trainable_;\n }\n\n set trainable(trainable: boolean) {\n this.trainable_ = trainable;\n this.val.trainable = trainable;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormal does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n dtype = dtype || 'float32';\n if (dtype !== 'float32' && dtype !== 'int32') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType ${dtype}.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of`tf.Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.forEach(variableAndValue => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\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-layers/dist/variables_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map deleted file mode 100644 index ad1a9b5c1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"variables_test.js","sourceRoot":"","sources":["../src/variables_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC9F,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC;;GAEG;AACH,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,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,CAAC,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CACzB,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACpC,qBAAqB;QACrB,kBAAkB,CACd,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,qBAAqB;QACrB,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Unit tests for LayerVariables.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {randomUniform, scalar, tensor1d, tensor2d, zeros} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {nameScope} from './common';\nimport * as tfl from './index';\nimport {describeMathCPU, describeMathCPUAndGPU, expectTensorsClose} from './utils/test_utils';\nimport * as V from './variables';\n\n/**\n * Unit tests for Variable.\n */\ndescribeMathCPU('Variable', () => {\n it('Variable constructor: no explicit name', () => {\n const v1 = new V.LayerVariable(zeros([2]));\n expect(v1.name.indexOf('Variable')).toEqual(0);\n expect(v1.dtype).toEqual('float32');\n expect(v1.shape).toEqual([2]);\n expect(v1.trainable).toEqual(true);\n expect(v1.read().dataSync()).toEqual(new Float32Array([0, 0]));\n\n const v2 = new V.LayerVariable(zeros([2, 2]));\n expect(v2.name.indexOf('Variable')).toEqual(0);\n expect(v2.dtype).toEqual('float32');\n expect(v2.shape).toEqual([2, 2]);\n expect(v2.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n\n expect(v2.name === v1.name).toBe(false);\n });\n\n it('Variable constructor: explicit name', () => {\n const v1 = new V.LayerVariable(zeros([]), undefined, 'foo');\n expect(v1.name.indexOf('foo')).toEqual(0);\n expect(v1.dtype).toEqual('float32');\n expect(v1.shape).toEqual([]);\n expect(v1.trainable).toEqual(true);\n expect(v1.read().dataSync()).toEqual(new Float32Array([0]));\n\n const v2 = new V.LayerVariable(zeros([2, 2, 1]));\n expect(v1.name.indexOf('foo')).toEqual(0);\n expect(v2.dtype).toEqual('float32');\n expect(v2.shape).toEqual([2, 2, 1]);\n expect(v2.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n expect(v2.name.length).toBeGreaterThan(0);\n\n expect(v2.name === v1.name).toBe(false);\n });\n\n it('Variable constructor: explicit name with name scope', () => {\n let v1: V.LayerVariable;\n nameScope('barScope', () => {\n nameScope('bazScope', () => {\n v1 = new V.LayerVariable(scalar(0), undefined, 'foo');\n });\n });\n expect(v1.name.indexOf('barScope/bazScope/foo')).toEqual(0);\n expect(v1.dtype).toEqual('float32');\n expect(v1.shape).toEqual([]);\n expect(v1.trainable).toEqual(true);\n expect(v1.read().dataSync()).toEqual(new Float32Array([0]));\n });\n\n it('Variable trainable property', () => {\n const v1 = new V.LayerVariable(zeros([]), null, 'foo', false);\n expect(v1.trainable).toEqual(false);\n });\n\n it('Variable works if name is null or undefined', () => {\n expect((new V.LayerVariable(zeros([]), null)).name.indexOf('Variable'))\n .toEqual(0);\n expect((new V.LayerVariable(zeros([]), undefined)).name.indexOf('Variable'))\n .toEqual(0);\n });\n\n it('int32 dtype', () => {\n expect(new V.LayerVariable(zeros([]), 'int32').dtype).toEqual('int32');\n });\n\n it('bool dtype', () => {\n expect(new V.LayerVariable(zeros([]), 'bool').dtype).toEqual('bool');\n });\n\n it('Read value', () => {\n const v1 = new V.LayerVariable(scalar(10), null, 'foo');\n expect(v1.read().dataSync()).toEqual(new Float32Array([10]));\n });\n\n it('Update value: Compatible shape', () => {\n const v = new V.LayerVariable(tensor1d([10, -10]), null, 'bar');\n expect(v.name.indexOf('bar')).toEqual(0);\n expect(v.shape).toEqual([2]);\n expect(v.read().dataSync()).toEqual(new Float32Array([10, -10]));\n\n v.write(tensor1d([10, 50]));\n expect(v.name.indexOf('bar')).toEqual(0);\n expect(v.shape).toEqual([2]);\n expect(v.read().dataSync()).toEqual(new Float32Array([10, 50]));\n });\n\n it('Update value: w/ constraint', () => {\n const v = new V.LayerVariable(\n tensor1d([10, -10]), null, 'bar', true, tfl.constraints.nonNeg());\n\n v.write(tensor1d([-10, 10]));\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 10]));\n });\n\n it('Update value: Incompatible shape', () => {\n const v = new V.LayerVariable(zeros([2, 2]), null, 'qux');\n expect(() => {\n v.write(zeros([4]));\n }).toThrowError();\n });\n\n it('Generates unique ID', () => {\n const v1 = new V.LayerVariable(scalar(1), null, 'foo');\n const v2 = new V.LayerVariable(scalar(1), null, 'foo');\n expect(v1.id).not.toEqual(v2.id);\n });\n\n it('Generates unique IDs for Tensors and Variables', () => {\n const v1 = scalar(1);\n const v2 = new V.LayerVariable(scalar(1), null, 'foo');\n expect(v1.id).not.toEqual(v2.id);\n });\n\n it('dispose() frees memory', () => {\n const v = new V.LayerVariable(tensor1d([10, -10]), null, 'gralk');\n const numTensors0 = tfc.memory().numTensors;\n v.dispose();\n expect(tfc.memory().numTensors).toEqual(numTensors0 - 1);\n });\n\n it('Disposing LayersVariable twices leads to Error', () => {\n const v = new V.LayerVariable(tensor1d([10, -10]), null, 'gralk');\n v.dispose();\n expect(() => v.dispose()).toThrowError(/LayersVariable .*gralk.* disposed/);\n });\n\n it('read() after dispose() leads to Error', () => {\n const v = new V.LayerVariable(tensor1d([10, -10]), null, 'gralk');\n v.dispose();\n expect(() => v.read()).toThrowError(/LayersVariable .*gralk.* disposed/);\n });\n\n it('write() after dispose() leads to Error', () => {\n const v = new V.LayerVariable(tensor1d([10, -10]), null, 'gralk');\n v.dispose();\n expect(() => v.write(tensor1d([20, -20])))\n .toThrowError(/LayersVariable .*gralk.* disposed/);\n });\n\n it('Setting trainable sets the trainable of underlying tfc.Variable', () => {\n const v1 = new V.LayerVariable(scalar(1), null, 'foo', true);\n // tslint:disable-next-line:no-any\n const coreVariable = (v1 as any).val as tfc.Variable;\n expect(coreVariable.trainable).toEqual(true);\n v1.trainable = false;\n expect(coreVariable.trainable).toEqual(false);\n v1.trainable = true;\n expect(coreVariable.trainable).toEqual(true);\n });\n});\n\ndescribeMathCPUAndGPU('Create Variable', () => {\n it('From Tensor, no explicit name', () => {\n const v = V.variable(zeros([2, 2]));\n expect(v.name.indexOf('Variable')).toEqual(0);\n expect(v.shape).toEqual([2, 2]);\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('From Tensor, no explicit name', () => {\n const v = V.variable(zeros([3]));\n expect(v.name.indexOf('Variable')).toEqual(0);\n expect(v.shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n\n it('From Tensor, explicit name', () => {\n const v = V.variable(zeros([3]), undefined, 'Var1');\n expect(v.name.indexOf('Var1')).toEqual(0);\n expect(v.shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n});\n\ndescribeMathCPUAndGPU('ZerosVariable', () => {\n it('Scalar', () => {\n const s = V.zerosVariable([], 'float32', 'Scalar');\n expect(s.name.indexOf('Scalar')).toEqual(0);\n expect(s.read().shape).toEqual([]);\n expect(s.read().dataSync()).toEqual(new Float32Array([0]));\n });\n\n it('Vector', () => {\n const v = V.zerosVariable([3], 'float32', 'Vector');\n expect(v.name.indexOf('Vector')).toEqual(0);\n expect(v.read().shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n\n it('Matrix', () => {\n const m = V.zerosVariable([2, 2], 'float32', 'Matrix');\n expect(m.name.indexOf('Matrix')).toEqual(0);\n expect(m.read().shape).toEqual([2, 2]);\n expect(m.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('3D', () => {\n const t = V.zerosVariable([2, 2, 2], 'float32', 'Tertiary');\n expect(t.name.indexOf('Tertiary')).toEqual(0);\n expect(t.read().shape).toEqual([2, 2, 2]);\n expect(t.read().dataSync()).toEqual(new Float32Array([\n 0, 0, 0, 0, 0, 0, 0, 0\n ]));\n });\n\n it('4D', () => {\n const q = V.zerosVariable([1, 2, 1, 3], 'float32', 'Quaternary');\n expect(q.name.indexOf('Quaternary')).toEqual(0);\n expect(q.read().shape).toEqual([1, 2, 1, 3]);\n expect(q.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0, 0, 0]));\n });\n});\n\ndescribeMathCPUAndGPU('OnesVariable', () => {\n it('Scalar', () => {\n const s = V.onesVariable([], 'float32', 'Scalar');\n expect(s.name.indexOf('Scalar')).toEqual(0);\n expect(s.read().shape).toEqual([]);\n expect(s.read().dataSync()).toEqual(new Float32Array([1]));\n });\n it('Vector', () => {\n const v = V.onesVariable([3], 'float32', 'Vector');\n expect(v.name.indexOf('Vector')).toEqual(0);\n expect(v.read().shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([1, 1, 1]));\n });\n it('Matrix', () => {\n const m = V.onesVariable([2, 2], 'float32', 'Matrix');\n expect(m.name.indexOf('Matrix')).toEqual(0);\n expect(m.read().shape).toEqual([2, 2]);\n expect(m.read().dataSync()).toEqual(new Float32Array([1, 1, 1, 1]));\n });\n it('3D', () => {\n const t = V.onesVariable([2, 2, 2], 'float32', 'Tertiary');\n expect(t.name.indexOf('Tertiary')).toEqual(0);\n expect(t.read().shape).toEqual([2, 2, 2]);\n expect(t.read().dataSync()).toEqual(new Float32Array([\n 1, 1, 1, 1, 1, 1, 1, 1\n ]));\n });\n it('4D', () => {\n const q = V.onesVariable([1, 2, 1, 3], 'float32', 'Quaternary');\n expect(q.name.indexOf('Quaternary')).toEqual(0);\n expect(q.read().shape).toEqual([1, 2, 1, 3]);\n expect(q.read().dataSync()).toEqual(new Float32Array([1, 1, 1, 1, 1, 1]));\n });\n});\n\ndescribeMathCPUAndGPU('ZerosLike', () => {\n it('Scalar', () => {\n const s = V.zerosLike(randomUniform([], -10, 10));\n expect(s.read().shape).toEqual([]);\n expect(s.read().dataSync()).toEqual(new Float32Array([0]));\n });\n\n it('Vector', () => {\n const v = V.zerosLike(randomUniform([3], -10, 10));\n expect(v.read().shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([0, 0, 0]));\n });\n\n it('Matrix', () => {\n const m = V.zerosLike(randomUniform([2, 2], -10, 10));\n expect(m.read().shape).toEqual([2, 2]);\n expect(m.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('3D', () => {\n const t = V.zerosLike(randomUniform([2, 2, 2], -10, 10));\n expect(t.read().shape).toEqual([2, 2, 2]);\n expect(t.read().dataSync()).toEqual(new Float32Array([\n 0, 0, 0, 0, 0, 0, 0, 0\n ]));\n });\n\n it('4D', () => {\n const q = V.zerosLike(randomUniform([1, 2, 1, 3], -10, 10));\n expect(q.read().shape).toEqual([1, 2, 1, 3]);\n expect(q.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0, 0, 0]));\n });\n});\n\ndescribeMathCPUAndGPU('OnesLike', () => {\n it('Scalar', () => {\n const s = V.onesLike(randomUniform([], -10, 10));\n expect(s.read().shape).toEqual([]);\n expect(s.read().dataSync()).toEqual(new Float32Array([1]));\n });\n\n it('Vector', () => {\n const v = V.onesLike(randomUniform([3], -10, 10));\n expect(v.read().shape).toEqual([3]);\n expect(v.read().dataSync()).toEqual(new Float32Array([1, 1, 1]));\n });\n\n it('Matrix', () => {\n const m = V.onesLike(randomUniform([2, 2], -10, 10));\n expect(m.read().shape).toEqual([2, 2]);\n expect(m.read().dataSync()).toEqual(new Float32Array([1, 1, 1, 1]));\n });\n\n it('3D', () => {\n const t = V.onesLike(randomUniform([2, 2, 2], -10, 10));\n expect(t.read().shape).toEqual([2, 2, 2]);\n expect(t.read().dataSync()).toEqual(new Float32Array([\n 1, 1, 1, 1, 1, 1, 1, 1\n ]));\n });\n\n it('4D', () => {\n const q = V.onesLike(randomUniform([1, 2, 1, 3], -10, 10));\n expect(q.read().shape).toEqual([1, 2, 1, 3]);\n expect(q.read().dataSync()).toEqual(new Float32Array([1, 1, 1, 1, 1, 1]));\n });\n});\n\ndescribeMathCPUAndGPU('eye (I-matrix builder)', () => {\n it('Variable Zero sized 2D matrix works', () => {\n const v = V.eyeVariable(0);\n expect(v.shape).toEqual([0, 0]);\n });\n it('Variable 1 sized 2D matrix', () => {\n const I = V.eyeVariable(1);\n expect(I.shape).toEqual([1, 1]);\n expect(I.read().dataSync()).toEqual(new Float32Array([1]));\n });\n it('Variable 2 sized 2D matrix', () => {\n const I = V.eyeVariable(2);\n expect(I.shape).toEqual([2, 2]);\n expect(I.read().dataSync()).toEqual(new Float32Array([1, 0, 0, 1]));\n });\n});\n\ndescribeMathCPUAndGPU('Variable update', () => {\n it('Update', () => {\n const v = new V.LayerVariable(scalar(10.0));\n V.update(v, scalar(20.0));\n expectTensorsClose(v.read(), scalar(20.0));\n });\n it('Update: Incompatible shape', () => {\n const v = new V.LayerVariable(tensor1d([10.0, 20.0]));\n const x = tensor1d([10.0, 20.0, 30.0]);\n expect(() => V.update(v, x)).toThrowError();\n });\n it('UpdateAdd', () => {\n const v = new V.LayerVariable(scalar(10.0));\n V.updateAdd(v, scalar(20.0));\n expectTensorsClose(v.read(), scalar(30.0));\n });\n it('UpdateAdd: Incompatible shape', () => {\n const v = new V.LayerVariable(tensor1d([10.0, 20.0]));\n const x = tensor1d([0.0, 10.0, 20.0]);\n expect(() => V.updateAdd(v, x)).toThrowError();\n });\n it('UpdateSub', () => {\n const v = new V.LayerVariable(scalar(10.0));\n V.updateSub(v, scalar(20.0));\n const vNew = v.read();\n expectTensorsClose(vNew, scalar(-10.0));\n });\n it('UpdateSub: Incompatible shape', () => {\n const v = new V.LayerVariable(tensor1d([10.0, 20.0]));\n const x = tensor1d([0.0, 10.0, 20.0]);\n expect(() => V.updateSub(v, x)).toThrowError();\n });\n});\n\ndescribeMathCPUAndGPU('batchGetValue', () => {\n it('Legnth-3 Array, Mixed Tensor and Variable', () => {\n const v1 = V.variable(zeros([]));\n const v2 = V.variable(zeros([2]));\n const v3 = V.variable(zeros([2, 2]));\n const values = V.batchGetValue([v1, v2, v3]);\n expect(values.length).toEqual(3);\n expect(values[0].shape).toEqual([]);\n expect(values[0].dataSync()).toEqual(new Float32Array([0]));\n expect(values[1].shape).toEqual([2]);\n expect(values[1].dataSync()).toEqual(new Float32Array([0, 0]));\n expect(values[2].shape).toEqual([2, 2]);\n expect(values[2].dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n});\n\ndescribeMathCPUAndGPU('batchSetValue', () => {\n it('Update using Tensor values', () => {\n const v1 = V.randomUniformVariable([2], 0, 1);\n const v2 = V.randomUniformVariable([2, 2], 0, 1);\n V.batchSetValue([[v1, zeros([2])], [v2, zeros([2, 2])]]);\n expect(v1.shape).toEqual([2]);\n expect(v1.read().dataSync()).toEqual(new Float32Array([0, 0]));\n expect(v2.shape).toEqual([2, 2]);\n expect(v2.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('Update using Tensor values', () => {\n const v1 = V.randomUniformVariable([], 0, 1);\n const v2 = V.randomUniformVariable([2, 2, 1], 0, 1);\n V.batchSetValue([[v1, zeros([])], [v2, zeros([2, 2, 1])]]);\n expect(v1.shape).toEqual([]);\n expect(v1.read().dataSync()).toEqual(new Float32Array([0]));\n expect(v2.shape).toEqual([2, 2, 1]);\n expect(v2.read().dataSync()).toEqual(new Float32Array([0, 0, 0, 0]));\n });\n\n it('Update empty Array', () => {\n V.batchSetValue([]);\n });\n});\n\ndescribeMathCPUAndGPU('gradients', () => {\n it('Simple mean: 1 variable', () => {\n const var1 = new V.LayerVariable(tfc.mul(scalar(2.0), tfc.ones([2, 2])));\n const gradients = V.gradients(() => tfc.mean(var1.read()), [var1]);\n expect(gradients.length).toEqual(1);\n expectTensorsClose(\n tensor2d([[0.25, 0.25], [0.25, 0.25]], [2, 2]), gradients[0]);\n });\n it('Simple matmul and mean: 2 variables', () => {\n const var1 = new V.LayerVariable(tensor2d([[1, 0], [0, 0]], [2, 2]));\n const var2 = new V.LayerVariable(tensor2d([[1, 0], [0, 1]], [2, 2]));\n const gradients = V.gradients(\n () => tfc.mean(K.dot(var1.read(), var2.read())), [var1, var2]);\n expect(gradients.length).toEqual(2);\n // d(loss) / d(var1).\n expectTensorsClose(\n tensor2d([[0.25, 0.25], [0.25, 0.25]], [2, 2]), gradients[0]);\n // d(loss) / d(var2).\n expectTensorsClose(tensor2d([[0.25, 0.25], [0, 0]], [2, 2]), gradients[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-layers/dist/version.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/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-layers/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-layers/dist/version.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js deleted file mode 100644 index a02ce6909..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; -export { version }; -//# sourceMappingURL=version.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-layers/dist/version.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js.map deleted file mode 100644 index 4e5822fb5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,wDAAwD;AACxD,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,OAAO,EAAC,OAAO,EAAC,CAAC","sourcesContent":["/** @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"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map deleted file mode 100644 index 5dd1393d6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version_test.js","sourceRoot":"","sources":["../src/version_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8CAA8C;AAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAEvC,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,qBAAqB,GACvB,WAAW,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;QACzD,MAAM,sBAAsB,GACxB,WAAW,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAC1D,MAAM,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// tslint:disable-next-line:no-require-imports\nconst packageJSON = require('../package.json');\nimport {version_layers} from './index';\n\ndescribe('tfjs-core version consistency', () => {\n it('dev-peer match', () => {\n const tfjsCoreDevDepVersion =\n packageJSON.devDependencies['@tensorflow/tfjs-core'];\n const tfjsCorePeerDepVersion =\n packageJSON.peerDependencies['@tensorflow/tfjs-core'];\n expect(tfjsCoreDevDepVersion).toEqual(tfjsCorePeerDepVersion);\n });\n\n it('version.ts matches package version', () => {\n // tslint:disable-next-line:no-require-imports\n const expected = require('../package.json').version;\n expect(version_layers).toBe(expected);\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-layers/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/package.json deleted file mode 100644 index c4a9a9fe0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - "@tensorflow/tfjs-layers@3.6.0", - "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning" - ] - ], - "_from": "@tensorflow/tfjs-layers@3.6.0", - "_id": "@tensorflow/tfjs-layers@3.6.0", - "_inBundle": false, - "_integrity": "sha512-B7EHwAT6KFqhKzdf0e2Sr6haj9qpqpyEATV8OCPHdk+g8z2AGXOLlFfbgW6vCMjy1wb5jzYqCyZDoY3EWdgJAw==", - "_location": "/@tensorflow/tfjs-layers", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@tensorflow/tfjs-layers@3.6.0", - "name": "@tensorflow/tfjs-layers", - "escapedName": "@tensorflow%2ftfjs-layers", - "scope": "@tensorflow", - "rawSpec": "3.6.0", - "saveSpec": null, - "fetchSpec": "3.6.0" - }, - "_requiredBy": [ - "/@tensorflow/tfjs" - ], - "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-3.6.0.tgz", - "_spec": "3.6.0", - "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", - "description": "TensorFlow layers API in JavaScript", - "devDependencies": { - "@babel/polyfill": "^7.8.7", - "@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-backend-webgl": "3.6.0", - "@tensorflow/tfjs-core": "3.6.0", - "@types/jasmine": "~2.5.53", - "clang-format": "~1.2.2", - "http-server": "~0.12.3", - "jasmine": "~3.1.0", - "jasmine-core": "~3.1.0", - "karma": "~6.3.1", - "karma-browserstack-launcher": "~1.6.0", - "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", - "rimraf": "~2.6.2", - "rollup": "~2.3.2", - "rollup-plugin-terser": "~7.0.2", - "rollup-plugin-visualizer": "~3.3.2", - "ts-node": "~8.8.2", - "tslint": "~6.1.3", - "tslint-no-circular-imports": "^0.7.0", - "typescript": "3.5.3", - "yalc": "~1.0.0-pre.50" - }, - "jsdelivr": "dist/tf-layers.min.js", - "jsnext:main": "dist/index.js", - "license": "Apache-2.0 AND MIT", - "main": "dist/tf-layers.node.js", - "miniprogram": "dist/miniprogram", - "module": "dist/index.js", - "name": "@tensorflow/tfjs-layers", - "peerDependencies": { - "@tensorflow/tfjs-core": "3.6.0" - }, - "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-backend-webgl": "cd ../tfjs-backend-webgl && yarn && yarn build", - "build-backend-webgl-ci": "cd ../tfjs-backend-webgl && 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-backend-cpu && yarn build-backend-webgl", - "build-deps-ci": "yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci", - "build-npm": "./scripts/build-npm.sh", - "bundle": "rollup -c", - "bundle-ci": "rollup -c --ci", - "coverage": "KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun", - "format": "./tools/clang_format_ts.sh", - "link-local": "yalc link", - "lint": "tslint -p . -t verbose", - "prep": "yarn install && yarn build-ci", - "publish-local": "yarn build-npm && yalc push", - "publish-npm": "npm publish", - "run-browserstack": "karma start --browsers='bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'", - "test": "yarn && yarn build-deps && karma start", - "test-ci": "./scripts/test-ci.sh", - "test-dev": "karma start", - "test-snippets": "yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts", - "test-snippets-ci": "ts-node --skip-ignore -s ./scripts/test_snippets.ts" - }, - "types": "dist/index.d.ts", - "unpkg": "dist/tf-layers.min.js", - "version": "3.6.0" -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/activations.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/activations.ts deleted file mode 100644 index 2edaa07f1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/activations.ts +++ /dev/null @@ -1,278 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -// Layer activation functions -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import {ActivationIdentifier} from './keras_format/activation_config'; -import {deserializeKerasObject} from './utils/generic_utils'; - -/** - * Base class for Activations. - * - * Special note: due to cross-language compatibility reasons, the - * static readonly className field in this family of classes must be set to - * the initialLowerCamelCase name of the activation. - */ -export abstract class Activation extends serialization.Serializable { - abstract apply(tensor: Tensor, axis?: number): Tensor; - getConfig(): serialization.ConfigDict { - return {}; - } -} - -/** - * Exponential linear unit (ELU). - * Reference: https://arxiv.org/abs/1511.07289 - */ -export class Elu extends Activation { - /** @nocollapse */ - static readonly className = 'elu'; - /** - * Calculate the activation function. - * - * @param x: Input. - * @param alpha: Scaling factor the negative section. - * @return Output of the ELU activation. - */ - apply(x: Tensor, alpha = 1): Tensor { - return K.elu(x, alpha); - } -} -serialization.registerClass(Elu); - -/** - * Scaled Exponential Linear Unit. (Klambauer et al., 2017). - * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515 - * Notes: - * - To be used together with the initialization "lecunNormal". - * - To be used together with the dropout variant "AlphaDropout". - */ -export class Selu extends Activation { - /** @nocollapse */ - static readonly className = 'selu'; - apply(x: Tensor): Tensor { - return tfc.selu(x); - } -} -serialization.registerClass(Selu); - -/** - * Rectified linear unit - */ -export class Relu extends Activation { - /** @nocollapse */ - static readonly className = 'relu'; - apply(x: Tensor): Tensor { - return tfc.relu(x); - } -} -serialization.registerClass(Relu); - -/** - * Rectified linear unit activation maxing out at 6.0. - */ -export class Relu6 extends Activation { - /** @nocollapse */ - static readonly className = 'relu6'; - apply(x: Tensor): Tensor { - return tidy(() => tfc.minimum(6.0, tfc.relu(x))); - } -} -serialization.registerClass(Relu6); - -//* Linear activation (no-op) */ -export class Linear extends Activation { - /** @nocollapse */ - static readonly className = 'linear'; - apply(x: Tensor): Tensor { - return x; - } -} -serialization.registerClass(Linear); - -/** - * Sigmoid activation function. - */ -export class Sigmoid extends Activation { - /** @nocollapse */ - static readonly className = 'sigmoid'; - apply(x: Tensor): Tensor { - return tfc.sigmoid(x); - } -} -serialization.registerClass(Sigmoid); - -/** - * Segment-wise linear approximation of sigmoid. - */ -export class HardSigmoid extends Activation { - /** @nocollapse */ - static readonly className = 'hardSigmoid'; - apply(x: Tensor): Tensor { - return K.hardSigmoid(x); - } -} -serialization.registerClass(HardSigmoid); - -/** - * Softplus activation function. - */ -export class Softplus extends Activation { - /** @nocollapse */ - static readonly className = 'softplus'; - apply(x: Tensor): Tensor { - return tfc.softplus(x); - } -} -serialization.registerClass(Softplus); - -/** - * Softsign activation function. - */ -export class Softsign extends Activation { - /** @nocollapse */ - static readonly className = 'softsign'; - apply(x: Tensor): Tensor { - return K.softsign(x); - } -} -serialization.registerClass(Softsign); - -/** - * Hyperbolic tangent function. - */ -export class Tanh extends Activation { - /** @nocollapse */ - static readonly className = 'tanh'; - apply(x: Tensor): Tensor { - return tfc.tanh(x); - } -} -serialization.registerClass(Tanh); - -/** - * Softmax activation function - */ -export class Softmax extends Activation { - /** @nocollapse */ - static readonly className = 'softmax'; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x: Tensor, axis: number = (-1)): Tensor { - return tfc.softmax(x, axis); - } -} -serialization.registerClass(Softmax); - -/** - * Log softmax activation function - */ -export class LogSoftmax extends Activation { - /** @nocollapse */ - static readonly className = 'logSoftmax'; - /** - * Calculate the activation function of log softmax: - * log( exp(x_i) / sum(exp(x)) ) - * - * @param x Tensor. - * @param axis Integer, axis along which the softmax normalization is applied. - * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be - * an error. - * - * @returns a Tensor of the same shape as x - * - * @throws ValueError: In case `dim(x) < 2`. - */ - apply(x: Tensor, axis: number = (-1)): Tensor { - return tfc.logSoftmax(x, axis); - } -} -serialization.registerClass(LogSoftmax); - -/** - * Swish activation function - */ -export class Swish extends Activation { - /** @nocollapse */ - static readonly className = 'swish'; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @param alpha Scaling factor for the sigmoid function. - * @returns a Tensor of the same shape as x - */ - apply(x: Tensor, alpha = 1): Tensor { - return tidy(() => tfc.sigmoid(x.mul(alpha)).mul(x)); - } -} -serialization.registerClass(Swish); - -/** - * Mish activation function - */ -export class Mish extends Activation { - /** @nocollapse */ - static readonly className = 'mish'; - /** - * Calculate the activation function. - * - * @param x Tensor. - * @returns a Tensor of the same shape as x - */ - apply(x: Tensor): Tensor { - return tidy(() => tfc.mul(x, tfc.tanh(tfc.softplus(x)))); - } -} -serialization.registerClass(Mish); - -export function serializeActivation(activation: Activation): string { - return activation.getClassName(); -} - -export function deserializeActivation( - config: serialization.ConfigDict, - customObjects: serialization.ConfigDict = {}): Activation { - return deserializeKerasObject( - config, serialization.SerializationMap.getMap().classNameMap, - customObjects, 'activation'); -} - -export function getActivation(identifier: ActivationIdentifier| - serialization.ConfigDict|Activation): Activation { - if (identifier == null) { - const config: serialization.ConfigDict = {}; - config['className'] = 'linear'; - config['config'] = {}; - return deserializeActivation(config); - } - if (typeof identifier === 'string') { - const config: serialization.ConfigDict = {}; - config['className'] = identifier; - config['config'] = {}; - return deserializeActivation(config); - } else if (identifier instanceof Activation) { - return identifier; - } else { - return deserializeActivation(identifier); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts deleted file mode 100644 index 649f9352f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {backend} from '@tensorflow/tfjs-core'; -import {DataFormat} from '../keras_format/common'; - -let _epsilon: number; - -/** - * Returns the value of the fuzz factor used in numeric expressions. - */ -export function epsilon() { - if (_epsilon == null) { - _epsilon = backend().epsilon(); - } - return _epsilon; -} - -/** - * Sets the value of the fuzz factor used in numeric expressions. - * @param e New value of epsilon. - */ -export function setEpsilon(e: number) { - _epsilon = e; -} - -/** - * Returns the default image data format convention. - */ -export function imageDataFormat(): DataFormat { - return 'channelsLast'; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts deleted file mode 100644 index 41ea8871e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Utilities related to persistent state in the backend. - */ - -/** - * An ID to track `tf.SymbolicTensor`s and derived classes. - * Required in different places in engine/topology.ts to identify unique - * tensors. - */ -let _nextUniqueTensorId = 0; - -export function getNextUniqueTensorId(): number { - return _nextUniqueTensorId++; -} - -const _uidPrefixes: {[prefix: string]: number} = {}; - -/** - * Provides a unique UID given a string prefix. - * - * @param prefix - */ -export function getUid(prefix = ''): string { - if (!(prefix in _uidPrefixes)) { - _uidPrefixes[prefix] = 0; - } - _uidPrefixes[prefix] += 1; - return prefix + _uidPrefixes[prefix].toString(); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts deleted file mode 100644 index 58265dc39..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts +++ /dev/null @@ -1,719 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * deeplearn.js backend. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {onesLike as coreOnesLike, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core'; -import {checkDataFormat} from '../common'; -import {NotImplementedError, ValueError} from '../errors'; -import {DataFormat, Shape} from '../keras_format/common'; -import {HasShape} from '../types'; -import * as math_utils from '../utils/math_utils'; - -import {imageDataFormat} from './common'; - -// tslint:enable - -/* Setting and getting backend from deeplearn.js. */ - -// Default deeplearn.js backend is WebGL (GPU). -let backend: 'cpu'|'webgl' = 'webgl'; - -export function setBackend(requestedBackend: 'cpu'|'webgl') { - tfc.setBackend(requestedBackend); - backend = requestedBackend; -} - -export function getBackend(): 'cpu'|'webgl' { - return backend; -} - -/** - * Indicates whether the backend is operating symbolically. - * - * This function will be used to determine how to interpret user code. If - * it returns true, calls to the backend construct a symbolic graph; if - * it returns false, calls to the backend execute immediately. - */ -export function isBackendSymbolic(): boolean { - return false; -} - -/** - * Get the number of elements in a Tensor. - * @param x The Tensor. - * @return Number of elements in `x`. - */ -export function countParams(x: HasShape): number { - const shape = x.shape; - if (shape.length > 0) { - return shape.reduce((a: number, b: number) => a * b); - } else { - // Scalar. - return 1; - } -} - -/** - * Casts a tensor to a different dtype and returns it. - * @param x Input tensor. - * @param dtype String: 'float32'|'int32'|'bool'. - * @returns Tensor of the specified `dtype`. - */ -export function cast(x: Tensor, dtype: tfc.DataType): Tensor { - return x.asType(dtype); -} - -/** - * Adds a 1-sized dimension at index "axis". - * @param x Input tensor. - * @param axis Position where to add the new axis. - * @returns Result of the dimension expansion. - */ -export function expandDims(x: Tensor, axis = -1): Tensor { - const outShape = x.shape.slice(); - if (axis < 0) { - axis = outShape.length + axis + 1; - } - outShape.splice(axis, 0, 1); - return x.reshape(outShape); -} - -/** - * Repeats a 2D tensor. - * - * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output - * will have shape `[samples, 2, dim]`. - * - * @param x Input tensor. - * @param n Integer, number of times to repeat. - * @returns The result of the repeat operation. - * @throws ValueError: If input tensor is not 2D. - */ -export function repeat(x: Tensor, n: number): Tensor { - return tidy(() => { - if (x.shape.length !== 2) { - throw new ValueError( - `repeat() expects a rank-2 tensor, but received a ` + - `rank-${x.shape.length} tensor.`); - } - const y = expandDims(x, 1); - return tile(y, [1, n, 1]); - }); -} - -/** - * Flatten a Tensor into 1D. - * @param x Input tensor. - * @return The result of the flattening `x`. - */ -export function flatten(x: Tensor): Tensor { - const newShape = [math_utils.arrayProd(x.shape)]; - return x.reshape(newShape); -} - -/** - * Turn a nD tensor into a 2D tensor with same 0th dimension. - * In other words, it flattens each data samples of a batch. - * - * @param x The tensor to flatten. The rank of this tensor is required to be 2 - * or higher. - * @return The result of the flattening. - */ -export function batchFlatten(x: Tensor): Tensor { - if (x.rank <= 1) { - throw new ValueError( - `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`); - } - const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)]; - return x.reshape(newShape); -} - -/** - * Do slicing along the first axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the first axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongFirstAxis( - array: Tensor, start: number, size: number): Tensor { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array as Tensor1D, start, size); - case 2: - return tfc.slice2d( - array as Tensor2D, [start, 0], [size, array.shape[1]]); - case 3: - return tfc.slice3d( - array as Tensor3D, [start, 0, 0], - [size, array.shape[1], array.shape[2]]); - case 4: - return tfc.slice4d( - array as Tensor4D, [start, 0, 0, 0], - [size, array.shape[1], array.shape[2], array.shape[3]]); - case 5: - return tfc.slice(array as Tensor5D, [start, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4] - ]); - case 6: - return tfc.slice(array, [start, 0, 0, 0, 0, 0], [ - size, array.shape[1], array.shape[2], array.shape[3], array.shape[4], - array.shape[5] - ]); - default: - throw new ValueError( - `sliceAlongFirstAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} - -/** - * Do slicing along the last axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size size of the slice along the last axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongLastAxis( - array: Tensor, start: number, size: number): Tensor { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array as Tensor1D, start, size); - case 2: - return tfc.slice2d( - array as Tensor2D, [0, start], [array.shape[0], size]); - case 3: - return tfc.slice3d( - array as Tensor3D, [0, 0, start], - [array.shape[0], array.shape[1], size]); - case 4: - return tfc.slice4d( - array as Tensor4D, [0, 0, 0, start], - [array.shape[0], array.shape[1], array.shape[2], size]); - default: - throw new ValueError( - `sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} - -/** - * Do slicing along the sepcified axis. - * @param array input `tf.Tensor`. - * @param start starting index, inclusive. - * @param size of the slice along the chosen axis. - * @param choose an axis. - * @returns result of the slicing. - * @throws ValueError: If `array` is of an unsupported subtype of `tf.Tensor`. - */ -export function sliceAlongAxis( - array: Tensor, start: number, size: number, axis: number): Tensor { - return tidy(() => { - switch (array.rank) { - case 1: - return tfc.slice1d(array as Tensor1D, start, size); - case 2: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError( - `The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 3: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice3d( - array as Tensor3D, [0, start, 0], - [array.shape[0], size, array.shape[2]]); - case 3: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError( - `The axis is not within the rank of the tensor ` + - `${axis}`); - } - case 4: - switch (axis) { - case 1: - return sliceAlongFirstAxis(array, start, size); - case 2: - return tfc.slice4d( - array as Tensor4D, [0, start, 0, 0], - [array.shape[0], size, array.shape[2], array.shape[3]]); - case 3: - return tfc.slice4d( - array as Tensor4D, [0, 0, start, 0], - [array.shape[0], array.shape[1], size, array.shape[3]]); - case 4: - return sliceAlongLastAxis(array, start, size); - default: - throw new ValueError( - `The axis is not within the rank of the tensor ` + - `${axis}`); - } - default: - throw new ValueError( - `sliceAlongLastAxis() received an unsupported tensor rank: ` + - `${array.rank}`); - } - }); -} - -/** - * Concatenates a list of tensors alongside the specified axis. - * @param tensors `Array` of tensors to concatenate. - * @param axis Concatenation axis. - * @returns The result of the concatenation. - */ -export function concatenate(tensors: Tensor[], axis = -1): Tensor { - let rank: number; - if (axis < 0) { - rank = tensors[0].rank; - if (rank !== 0) { - axis = rank; - } else { - axis = 0; - } - } - if (axis === tensors[0].rank) { - // Porting Note: This is necessary because tfc.concat() requires axis to be - // in the interval [-rank, rank). - axis = -1; - } - // Porting Note: Sparse concat is not supported yet. - return tfc.concat(tensors, axis); -} - -/** - * Concatenate two arrays along the first dimension. - * @param a The 1st `tf.Tensor` to concatenate. - * @param b The 2nd `tf.Tensor` to concatenate. - * @returns Result of the concatenation. - * @throws ValueError: If `a` is of an unsupported subtype of `tf.Tensor`. - */ -export function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor { - switch (a.rank) { - case 1: - return tfc.concat1d([a as Tensor1D, b as Tensor1D]); - case 2: - return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0); - case 3: - return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0); - case 4: - return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0); - default: - throw new ValueError( - `concatAlongFirstAxis() received an unsupported ` + - `tensor rank: ${a.rank}`); - } -} - -/** - * Creates a tensor by tiling `x` by `n`. - * @param x A tensor. - * @param n An Array of integers or a single integer. If an Array, the length - * must be the same as the number of dimensions in `x`. If a single integer, - * it will be treated as an Array of length 1. - */ -export function tile(x: Tensor, n: number|number[]): Tensor { - if (!Array.isArray(n)) { - n = [n]; - } - if (x.rank !== n.length) { - throw new ValueError( - `The length of input n (${n.length}) does not match ` + - `the number of dimensions in input x (${x.rank})`); - } - return tfc.tile(x, n); -} - -/* Creation of random tensors. */ - -/** - * Get a tensor with normal distribution of values. - * - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @return The normal tensor. - */ -export function randomNormal( - shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32', - seed?: number): Tensor { - return tfc.randomNormal(shape, mean, stddev, dtype, seed); -} - -/* Linear Algebra */ - -/** - * Multiply two tensors and returns the result as a tensor. - * - * For 2D tensors, this is equivalent to matrix multiplication (matMul). - * For tensors of higher ranks, it follows the Theano behavior, - * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`). From the Theano documentation: - * - * For N dimensions it is a sum product over the last axis of x and the - * second-to-last of y: - * - * @param a A tensor of at least rank 2. - * @param b A tensor of at least rank 2. - * @param activation (optional) A string identifying the activation - * function. - * @return Result of the dot operation. - */ -export function dot( - a: Tensor, b: Tensor, activation?: tfc.fused.Activation, - bias?: Tensor): Tensor { - if ((a.rank < 2) || (b.rank < 2)) { - throw new NotImplementedError( - `dot requires both inputs to be rank >= 2` + - ` but got x shape = ${a.shape} and y shape = ${b.shape}`); - } - if (b.rank >= 3) { - const xLastDim = a.shape.slice(-1)[0]; - const ySecondLastDim = b.shape.slice(-2)[0]; - if (xLastDim !== ySecondLastDim) { - throw new NotImplementedError( - `If rank y >= 3, then the second last dim` + - ` of y must equal the last dim of x but got x shape = ${ - a.shape} and ` + - ` y shape = ${b.shape}`); - } - } - // Handle basic 2D x 2D case. - if ((a.rank === 2) && (b.rank === 2)) { - const transposeA = false; - const transposeB = false; - // tfc.fused.matMul only fuses certain activation functions. Unsupported - // activation functions are treated as 'linear' activations, which is - // equivalent to a no-op. - return tfc.fused.matMul({ - a, - b: b as Tensor2D, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }); - } else { - // Reshape x into the analogous 2D Tensor. - const aFirstDims = a.shape.slice(); // Holds all but the last dim of x. - const aLastDim = aFirstDims.pop(); - a = a.reshape([-1, aLastDim]); - - // Reshape y into the analogous 2D Tensor, and keep track of the - // required dimensions to reproduce the output shape. - const bShape = b.shape.slice(); - const bLastDim = bShape.pop(); - const ySecondLastDim = bShape.pop(); - const yOtherDims = [...bShape, bLastDim]; - // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1] - // where r is the rank of y. - const perm = Array.from({length: b.rank}, (_, i) => { - if (i === 0) { - return b.rank - 2; - } else if (i <= b.rank - 2) { - return i - 1; - } - return i; - }); - b = b.transpose(perm).reshape([ySecondLastDim, -1]); - - // Multiply x and y as 2D Tensors, and then reshape back to original. - const outputShape = [...aFirstDims, ...yOtherDims]; - const transposeA = false; - const transposeB = false; - return tfc.fused - .matMul({ - a, - b, - transposeA, - transposeB, - bias: bias ? reshapeBias(a.rank, bias, imageDataFormat()) : null, - activation - }) - .reshape(outputShape); - } -} - -/** - * Compute the sign Tensor of an input Tensor. - * - * Elements of the input `tf.Tensor` that are === 0 are mapped to 0. - * Elements of the input `tf.Tensor` that are > 0 are mapped to 1. - * Elements of the input `tf.Tensor` that are < 0 are mapped to -1. - * - * @param x Input `tf.Tensor`. - * @return The sign `tf.Tensor`. - */ -export function sign(x: Tensor): Tensor { - // TODO(cais): Move to the core. - return tidy(() => { - const zerosLikeX = coreZerosLike(x); - const onesLikeX = coreOnesLike(x); - return where( - tfc.equal(x, zerosLikeX), zerosLikeX, - where( - tfc.greater(x, coreZerosLike(x)), onesLikeX, - tfc.mul(-1, onesLikeX))); - }); -} - -/** - * Computes the one-hot representation of an integer tensor. - * @param indices nD integer tensor of shape - * `(batch_size, dim1, dim2, ... dim(n-1))` - * @param numClasses Integer, number of classes to consider. - * @returns (n + 1)D one hot representation of the input - * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)` - */ -export function oneHot(indices: Tensor, numClasses: number): Tensor { - return tidy(() => { - if (indices.rank !== 1) { - throw new Error( - 'Only 1D one-hot tensors are supported in the ' + - 'deeplearn backend, at present.'); - } - indices = indices.toInt(); - return tfc.oneHot(indices as Tensor1D, numClasses).toFloat(); - }); -} - -/* Elementary math functions. */ - -/** - * Retrieves the elements of indices `indices` in the tensor `reference`. - * @param reference A tensor. - * @param indices An integer tensor of indices or an `Array` of integers. - * @param axis Axis along which to perform the gather operation. - * @returns The result of the gathering as a tensor. - */ -export function gather( - reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor { - return tidy(() => { - if (Array.isArray(indices)) { - indices = tensor1d(indices, 'int32'); - } else { - indices = indices.toInt(); - } - return tfc.gather(reference, indices, axis); - }); -} - -/** - * Element-wise square. - * @param x Input tensor. - * @return element-wise x^2 - */ -export function square(x: Tensor): Tensor { - return tfc.mul(x, x); -} - -/** - * Element-wise exponentiation. - * - * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which - * takes advatnage of the backend's (e.g., TensorFlow's) automatic - * conversion to tensor. Here we allow `a` to be either a number or a tensor. - * - * @param x The base tensor. - * @param a The exponent, tensor or number. If a number, it is rounded to the - * nearest integer and converted to a tensor. - * @returns A tensor of the same shape as `x`. - */ -export function pow(x: Tensor, a: Tensor|number): Tensor { - return tidy(() => { - if (typeof (a) === 'number') { - a = scalar(Math.round(a), 'int32'); - } - if (a.dtype !== 'int32') { - throw new NotImplementedError( - `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`); - } - return tfc.pow(x, a); - }); -} - -/** - * Reshapes bias tensor according to rank of x. - */ -function reshapeBias(xRank: number, bias: Tensor, dataFormat: string) { - const biasShape = bias.shape; - - if (bias.rank !== 1 && bias.rank !== xRank) { - throw new ValueError( - `Unexpected bias dimensions: ${bias.rank}` + - `; expected it to be 1 or ${xRank}`); - } - - if (xRank === 5) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1, 1]); - } else { - return bias.reshape( - [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); - } - } else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, 1, biasShape[0]]); - } else { - return bias.reshape([1].concat(biasShape)); - } - } - } else if (xRank === 4) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1, 1]); - } else { - return bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]); - } - } else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, 1, biasShape[0]]); - } else { - return bias.reshape([1].concat(biasShape)); - } - } - } else if (xRank === 3) { - if (dataFormat === 'channelsFirst') { - if (biasShape.length === 1) { - return bias.reshape([1, biasShape[0], 1]); - } else { - return bias.reshape([1, biasShape[1], biasShape[0]]); - } - } else if (dataFormat === 'channelsLast') { - if (biasShape.length === 1) { - return bias.reshape([1, 1, biasShape[0]]); - } else { - return bias.reshape([1].concat(biasShape)); - } - } - } else if (xRank < 3) { - return bias; - } - throw new ValueError(`Unsupported input rank by biasAdd: ${bias.rank}`); -} - -/* Neural-network operations. */ - -/** - * Add a bias to a tensor. - * - * @param x The tensor to add the bias to. - * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`. - * @return Result of the bias adding. - * @throws ValueError: If the rank of `bias` is incorrect. - */ -export function biasAdd( - x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - - return x.add(reshapeBias(x.rank, bias, dataFormat)); - }); -} - -/** - * Exponential linear unit (ELU). - * @param x A tensor or variable to compute the activation function for. - * @param alpha: A scalar, a scaling factor for the negative section. - * @return Output of the ELU operation. - */ -export function elu(x: Tensor, alpha = 1): Tensor { - // TODO(cais): Add support for alpha values other than 1. - if (alpha !== 1) { - throw new NotImplementedError( - `Support for alpha values other than 1 (${alpha}) is not implemented ` + - `yet.`); - } - return tfc.elu(x); -} - -/** - * Softsign of a tensor. - * - * Defined as x / (abs(x) + 1), element-wise. - * - * @param x: Input. - * @returns Output. - */ -export function softsign(x: Tensor): Tensor { - return tidy(() => tfc.div(x, tfc.abs(x).add(1))); -} - -/** - * Sets entries in `x` to zero at random, while scaling the entire tensor. - * - * @param x input tensor. - * @param level fraction of the entries in the tensor that will be set to 0. - * @param noiseShape shape of randomly generated keep/drop flags, must be - * broadcastable to the shape of `x`. Optional. - * @param seed random seed to ensure determinism. Optional. - * @returns Result of the dropout operation. - */ -export function dropout( - x: Tensor, level: number, noiseShape?: number[], seed?: number): Tensor { - return tidy(() => tfc.dropout(x, level, noiseShape, seed)); -} - -/** - * Element-wise, segment-wise linear approximation of sigmoid. - * - * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. - * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`. - * - * @param x Input tensor. - * @returns Output tensor. - */ -export function hardSigmoid(x: Tensor): Tensor { - return tidy(() => { - const y = tfc.add(.5, tfc.mul(.2, x)); - return tfc.clipByValue(y, 0, 1); - }); -} - -/** - * Invoke `x` in the training phase, and `alt` otherwise. - * - * Porting Note: We do not create placeholder tensors for the `training` - * boolean flag here, because there is no such thing in the TF.js imperative - * backend. - * - * @param x The function to invoke iff `training` is `true`. - * @param alt The function to invoke iff `training` is `false`. - * @param training Boolean flag for whether training phase is active. - * @returns The return value of `x()` if `training` is `true`, or the return - * value of `alt()` if `training` is `false`. - */ -export function inTrainPhase(x: () => T, alt: () => T, training = false): T { - return training ? x() : alt(); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts deleted file mode 100644 index 964977c2b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts +++ /dev/null @@ -1,597 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: keras/callbacks.py */ - -import {add, div, keep, mul, nextFrame, Scalar, Tensor, tidy, util} from '@tensorflow/tfjs-core'; - -import {Container} from './engine/container'; -import {ValueError} from './errors'; -import {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs'; -import * as generic_utils from './utils/generic_utils'; - -/** Verbosity logging level when fitting a model. */ -export enum ModelLoggingVerbosity { - SILENT = 0, - VERBOSE = 1 -} - -/** How often to yield to the main thread when training (in ms). */ -export const DEFAULT_YIELD_EVERY_MS = 125; - -export type Params = { - [key: string]: number|string|boolean|number[]|string[]|boolean[]; -}; - -export type YieldEveryOptions = 'auto'|'batch'|'epoch'|'never'|number; - -/** - * Abstract base class used to build new callbacks. - * - * The `logs` dictionary that callback methods take as argument will contain - * keys for quantities relevant to the current batch or epoch. - * - * Currently, the `.fit()` method of the `Sequential` model class - * will include the following quantities in the `logs` that - * it passes to its callbacks: - * - * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss` - * (if validation is enabled in `fit`), and `valAcc` (if validation and - * accuracy monitoring are enabled). - * onBatchBegin: Logs include `size`, the number of samples in the current - * batch. - * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring - * is enabled). - */ -export abstract class BaseCallback { - // TODO(michaelterry): This type is a best guess. - validationData: Tensor|Tensor[] = null; - /** - * Training parameters (eg. verbosity, batch size, number of epochs...). - */ - params: Params; - - setParams(params: Params): void { - this.params = params; - } - - async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {} - - async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {} - - async onBatchBegin(batch: number, logs?: UnresolvedLogs) {} - - async onBatchEnd(batch: number, logs?: UnresolvedLogs) {} - - async onTrainBegin(logs?: UnresolvedLogs) {} - - async onTrainEnd(logs?: UnresolvedLogs) {} - - // LayersModel needs to call Callback.setModel(), but cannot actually depend - // on Callback because that creates a cyclic dependency. Providing this no-op - // method on BaseCallback breaks the cycle: this way LayersModel can depend on - // BaseCallback but not on Callback. The argument is typed as `Container` - // (the superclass of LayersModel) to avoid recapitulating the cycle. Callback - // overrides this method and enforces that the argument is really a - // LayersModel. - setModel(model: Container): void { - // Do nothing. Use Callback instead of BaseCallback to track the model. - } -} - -/** - * Container abstracting a list of callbacks. - */ -export class CallbackList { - callbacks: BaseCallback[]; - queueLength: number; - - // TODO(cais): When the need arises, uncomment the following lines and - // implement the queue for time values. - // private deltaTBatch: number; - // private deltaTsBatchBegin: Array; - // private deltaTsBatchEnd: Array; - - /** - * Constructor of CallbackList. - * @param callbacks Array of `Callback` instances. - * @param queueLength Queue length for keeping running statistics over - * callback execution time. - */ - constructor(callbacks?: BaseCallback[], queueLength = 10) { - // TODO(cais): Make use of queueLength when implementing the queue for time - // values. - if (callbacks == null) { - callbacks = []; - } - this.callbacks = callbacks; - this.queueLength = queueLength; - } - - append(callback: BaseCallback): void { - this.callbacks.push(callback); - } - - setParams(params: Params): void { - for (const callback of this.callbacks) { - callback.setParams(params); - } - } - - setModel(model: Container): void { - for (const callback of this.callbacks) { - callback.setModel(model); - } - } - - /** - * Called at the start of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochBegin(epoch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochBegin(epoch, logs); - } - } - - /** - * Called at the end of an epoch. - * @param epoch Index of epoch. - * @param logs Dictionary of logs. - */ - async onEpochEnd(epoch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onEpochEnd(epoch, logs); - } - } - - /** - * Called right before processing a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchBegin(batch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchBegin(batch, logs); - } - } - - /** - * Called at the end of a batch. - * @param batch Index of batch within the current epoch. - * @param logs Dictionary of logs. - */ - async onBatchEnd(batch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onBatchEnd(batch, logs); - } - } - - /** - * Called at the beginning of training. - * @param logs Dictionary of logs. - */ - async onTrainBegin(logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainBegin(logs); - } - } - - /** - * Called at the end of training. - * @param logs Dictionary of logs. - */ - async onTrainEnd(logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - for (const callback of this.callbacks) { - await callback.onTrainEnd(logs); - } - } -} - -/** - * Callback that accumulates epoch averages of metrics. - * - * This callback is automatically applied to every LayersModel. - */ -export class BaseLogger extends BaseCallback { - private seen: number; - private totals: UnresolvedLogs; - - constructor() { - super(); - } - - async onEpochBegin(epoch: number) { - this.seen = 0; - this.totals = {}; - } - - async onBatchEnd(batch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - const batchSize = logs['size'] == null ? 0 : logs['size'] as number; - this.seen += batchSize; - for (const key in logs) { - const value = logs[key]; - if (typeof value === 'number') { - if (!this.totals.hasOwnProperty(key)) { - this.totals[key] = 0; - } - this.totals[key] = this.totals[key] as number + value * batchSize; - } else { - let oldTotalsToDispose: Scalar; - if (key in this.totals) { - oldTotalsToDispose = this.totals[key] as Scalar; - } else { - this.totals[key] = 0; - } - const total: Scalar = - tidy(() => add((this.totals[key]), mul(value, batchSize))); - this.totals[key] = total; - if (oldTotalsToDispose != null) { - oldTotalsToDispose.dispose(); - } - } - } - } - - async onEpochEnd(epoch: number, logs?: UnresolvedLogs) { - if (logs != null) { - for (const key of this.params['metrics'] as string[]) { - if (this.totals[key] == null) { - continue; - } - if (typeof this.totals[key] === 'number') { - logs[key] = this.totals[key] as number / this.seen; - } else { - tidy(() => { - const log: Scalar = mul(div(1, this.seen), this.totals[key]); - logs[key] = log; - (this.totals[key] as Tensor).dispose(); - keep(logs[key] as Scalar); - }); - } - } - } - } -} - -/** - * Callback that records events into a `History` object. This callback is - * automatically applied to every TF.js Layers model. The `History` object - * gets returned by the `fit` method of models. - */ -export class History extends BaseCallback { - epoch: number[]; - history: {[key: string]: Array}; - - async onTrainBegin(logs?: UnresolvedLogs) { - this.epoch = []; - this.history = {}; - } - - async onEpochEnd(epoch: number, logs?: UnresolvedLogs) { - if (logs == null) { - logs = {}; - } - this.epoch.push(epoch); - for (const key in logs) { - if (this.history[key] == null) { - this.history[key] = []; - } - this.history[key].push(logs[key]); - } - } - - /** - * Await the values of all losses and metrics. - */ - async syncData() { - const promises: Array> = []; - const keys: string[] = []; - const indices: number[] = []; - for (const key in this.history) { - const valueArray = this.history[key]; - for (let i = 0; i < valueArray.length; ++i) { - if (typeof valueArray[i] !== 'number') { - const valueScalar = valueArray[i] as Tensor; - promises.push(valueScalar.data()); - keys.push(key); - indices.push(i); - } - } - } - const values = await Promise.all(promises); - for (let n = 0; n < values.length; ++n) { - const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor; - tensorToDispose.dispose(); - this.history[keys[n]][indices[n]] = values[n][0]; - } - } -} - -export interface CustomCallbackArgs { - onTrainBegin?: (logs?: Logs) => void | Promise; - onTrainEnd?: (logs?: Logs) => void | Promise; - onEpochBegin?: (epoch: number, logs?: Logs) => void | Promise; - onEpochEnd?: (epoch: number, logs?: Logs) => void | Promise; - onBatchBegin?: (batch: number, logs?: Logs) => void | Promise; - onBatchEnd?: (batch: number, logs?: Logs) => void | Promise; - onYield?: (epoch: number, batch: number, logs: Logs) => void | Promise; -} - -/** - * Custom callback for training. - */ -export class CustomCallback extends BaseCallback { - protected readonly trainBegin: (logs?: Logs) => void | Promise; - protected readonly trainEnd: (logs?: Logs) => void | Promise; - protected readonly epochBegin: - (epoch: number, logs?: Logs) => void | Promise; - protected readonly epochEnd: - (epoch: number, logs?: Logs) => void | Promise; - protected readonly batchBegin: - (batch: number, logs?: Logs) => void | Promise; - protected readonly batchEnd: - (batch: number, logs?: Logs) => void | Promise; - protected readonly yield: - (epoch: number, batch: number, logs: Logs) => void | Promise; - - private yieldEvery: YieldEveryOptions; - private currentEpoch = 0; - - constructor(args: CustomCallbackArgs, yieldEvery?: YieldEveryOptions) { - super(); - this.yieldEvery = yieldEvery || 'auto'; - if (this.yieldEvery === 'auto') { - this.yieldEvery = DEFAULT_YIELD_EVERY_MS; - } - if (this.yieldEvery === 'never' && args.onYield != null) { - throw new Error( - 'yieldEvery is `never` but you provided an `onYield` callback. ' + - 'Either change `yieldEvery` or remove the callback'); - } - if (util.isNumber(this.yieldEvery)) { - // Decorate `maybeWait` so it will be called at most once every - // `yieldEvery` ms. - this.maybeWait = generic_utils.debounce( - this.maybeWait.bind(this), this.yieldEvery as number); - } - this.trainBegin = args.onTrainBegin; - this.trainEnd = args.onTrainEnd; - this.epochBegin = args.onEpochBegin; - this.epochEnd = args.onEpochEnd; - this.batchBegin = args.onBatchBegin; - this.batchEnd = args.onBatchEnd; - this.yield = args.onYield; - } - - async maybeWait(epoch: number, batch: number, logs: UnresolvedLogs) { - const ps: Array> = []; - if (this.yield != null) { - await resolveScalarsInLogs(logs); - ps.push(this.yield(epoch, batch, logs as Logs)); - } - ps.push(nextFrame()); - await Promise.all(ps); - } - - async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise { - this.currentEpoch = epoch; - if (this.epochBegin != null) { - await resolveScalarsInLogs(logs); - await this.epochBegin(epoch, logs as Logs); - } - } - - async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise { - const ps: Array> = []; - if (this.epochEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.epochEnd(epoch, logs as Logs)); - } - if (this.yieldEvery === 'epoch') { - ps.push(nextFrame()); - } - await Promise.all(ps); - } - - async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise { - if (this.batchBegin != null) { - await resolveScalarsInLogs(logs); - await this.batchBegin(batch, logs as Logs); - } - } - - async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise { - const ps: Array> = []; - if (this.batchEnd != null) { - await resolveScalarsInLogs(logs); - ps.push(this.batchEnd(batch, logs as Logs)); - } - if (this.yieldEvery === 'batch') { - ps.push(nextFrame()); - } else if (util.isNumber(this.yieldEvery)) { - ps.push(this.maybeWait(this.currentEpoch, batch, logs)); - } - await Promise.all(ps); - } - - async onTrainBegin(logs?: UnresolvedLogs): Promise { - if (this.trainBegin != null) { - await resolveScalarsInLogs(logs); - await this.trainBegin(logs as Logs); - } - } - - async onTrainEnd(logs?: UnresolvedLogs): Promise { - if (this.trainEnd != null) { - await resolveScalarsInLogs(logs); - await this.trainEnd(logs as Logs); - } - } -} - -/** - * Standardize callbacks or configurations of them to an Array of callbacks. - */ -export function standardizeCallbacks( - callbacks: BaseCallback|BaseCallback[]|CustomCallbackArgs| - CustomCallbackArgs[], - yieldEvery: YieldEveryOptions): BaseCallback[] { - if (callbacks == null) { - callbacks = {} as BaseCallback; - } - if (callbacks instanceof BaseCallback) { - return [callbacks]; - } - if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { - return callbacks as BaseCallback[]; - } - // Convert custom callback configs to custom callback objects. - const callbackConfigs = - generic_utils.toList(callbacks) as CustomCallbackArgs[]; - return callbackConfigs.map( - callbackConfig => new CustomCallback(callbackConfig, yieldEvery)); -} - -export declare type BaseCallbackConstructor = { - new (): BaseCallback -}; - -/** - * A global registry for callback constructors to be used during - * LayersModel.fit(). - */ -export class CallbackConstructorRegistry { - private static constructors: - {[verbosityLevel: number]: BaseCallbackConstructor[]} = {}; - - /** - * Blocks public access to constructor. - */ - private constructor() {} - - /** - * Register a tf.LayersModel.fit() callback constructor. - * - * The registered callback constructor will be used to instantiate - * callbacks for every tf.LayersModel.fit() call afterwards. - * - * @param verbosityLevel Level of verbosity at which the `callbackConstructor` - * is to be reigstered. - * @param callbackConstructor A no-arg constructor for `tf.Callback`. - * @throws Error, if the same callbackConstructor has been registered before, - * either at the same or a different `verbosityLevel`. - */ - static registerCallbackConstructor( - verbosityLevel: number, callbackConstructor: BaseCallbackConstructor) { - util.assert( - verbosityLevel >= 0 && Number.isInteger(verbosityLevel), - () => `Verbosity level is expected to be an integer >= 0, ` + - `but got ${verbosityLevel}`); - CallbackConstructorRegistry.checkForDuplicate(callbackConstructor); - if (CallbackConstructorRegistry.constructors[verbosityLevel] == null) { - CallbackConstructorRegistry.constructors[verbosityLevel] = []; - } - CallbackConstructorRegistry.constructors[verbosityLevel].push( - callbackConstructor); - } - - private static checkForDuplicate(callbackConstructor: - BaseCallbackConstructor) { - for (const levelName in CallbackConstructorRegistry.constructors) { - const constructors = CallbackConstructorRegistry.constructors[+levelName]; - constructors.forEach(ctor => { - if (ctor === callbackConstructor) { - throw new ValueError('Duplicate callback constructor.'); - } - }); - } - } - - /** - * Clear all registered callback constructors. - */ - protected static clear() { - CallbackConstructorRegistry.constructors = {}; - } - - /** - * Create callbacks using the registered callback constructors. - * - * Given `verbosityLevel`, all constructors registered at that level or above - * will be called and the instantiated callbacks will be used. - * - * @param verbosityLevel: Level of verbosity. - */ - static createCallbacks(verbosityLevel: number): BaseCallback[] { - const constructors: BaseCallbackConstructor[] = []; - for (const levelName in CallbackConstructorRegistry.constructors) { - const level = +levelName; - if (verbosityLevel >= level) { - constructors.push(...CallbackConstructorRegistry.constructors[level]); - } - } - return constructors.map(ctor => new ctor()); - } -} - -export function configureCallbacks( - callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number, - initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number, - batchSize: number, doValidation: boolean, - callbackMetrics: string[]): {callbackList: CallbackList, history: History} { - const history = new History(); - const actualCallbacks: BaseCallback[] = [ - new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose) - ]; - if (callbacks != null) { - actualCallbacks.push(...callbacks); - } - actualCallbacks.push(history); - const callbackList = new CallbackList(actualCallbacks); - - // TODO(cais): Figure out when this LayersModel instance can have a - // dynamically - // set property called 'callback_model' as in PyKeras. - - callbackList.setParams({ - epochs, - initialEpoch, - samples: numTrainSamples, - steps: stepsPerEpoch, - batchSize, - verbose, - doValidation, - metrics: callbackMetrics, - }); - return {callbackList, history}; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts deleted file mode 100644 index 77dc9de14..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts +++ /dev/null @@ -1,255 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: keras/callbacks.py */ - -import {BaseCallback} from './base_callbacks'; -import {Container} from './engine/container'; -import {LayersModel} from './engine/training'; -import {NotImplementedError} from './errors'; -import {Logs, resolveScalarsInLogs} from './logs'; - -export abstract class Callback extends BaseCallback { - /** Instance of `keras.models.Model`. Reference of the model being trained. */ - model: LayersModel = null; - - setModel(model: Container): void { - if (!(model instanceof LayersModel)) { - throw new Error('model must be a LayersModel, not some other Container'); - } - this.model = model; - } -} - -export interface EarlyStoppingCallbackArgs { - /** - * Quantity to be monitored. - * - * Defaults to 'val_loss'. - */ - monitor?: string; - - /** - * Minimum change in the monitored quantity to qualify as improvement, - * i.e., an absolute change of less than `minDelta` will count as no - * improvement. - * - * Defaults to 0. - */ - minDelta?: number; - - /** - * Number of epochs with no improvement after which training will be stopped. - * - * Defaults to 0. - */ - patience?: number; - - /** Verbosity mode. */ - verbose?: number; - - /** - * Mode: one of 'min', 'max', and 'auto'. - * - In 'min' mode, training will be stopped when the quantity monitored has - * stopped decreasing. - * - In 'max' mode, training will be stopped when the quantity monitored has - * stopped increasing. - * - In 'auto' mode, the direction is inferred automatically from the name of - * the monitored quantity. - * - * Defaults to 'auto'. - */ - mode?: 'auto'|'min'|'max'; - - /** - * Baseline value of the monitored quantity. - * - * If specified, training will be stopped if the model doesn't show - * improvement over the baseline. - */ - baseline?: number; - - /** - * Whether to restore model weights from the epoch with the best value - * of the monitored quantity. If `False`, the model weights obtained at the - * at the last step of training are used. - * - * **`True` is not supported yet.** - */ - restoreBestWeights?: boolean; -} - -function less(currVal: number, prevVal: number) { - return currVal < prevVal; -} - -function greater(currVal: number, prevVal: number) { - return currVal > prevVal; -} - -/** - * A Callback that stops training when a monitored quantity has stopped - * improving. - */ -export class EarlyStopping extends Callback { - protected readonly monitor: string; - protected readonly minDelta: number; - protected readonly patience: number; - protected readonly baseline: number; - protected readonly verbose: number; - protected readonly mode: 'auto'|'min'|'max'; - - protected monitorFunc: (currVal: number, prevVal: number) => boolean; - - private wait: number; - private stoppedEpoch: number; - private best: number; - - constructor(args?: EarlyStoppingCallbackArgs) { - super(); - if (args == null) { - args = {}; - } - if (args.restoreBestWeights) { - throw new NotImplementedError( - 'restoreBestWeights = True is not implemented in EarlyStopping yet.'); - } - - this.monitor = args.monitor || 'val_loss'; - this.minDelta = Math.abs(args.minDelta || 0); - this.patience = args.patience || 0; - this.verbose = args.verbose || 0; - this.mode = args.mode || 'auto'; - this.baseline = args.baseline; - - if (['auto', 'min', 'max'].indexOf(this.mode) === -1) { - console.warn( - `EarlyStopping mode '${this.mode}' is invalid. ` + - `Falling back to mode 'auto'.`); - this.mode = 'auto'; - } - - if (this.mode === 'min') { - this.monitorFunc = less; - } else if (this.mode === 'max') { - this.monitorFunc = greater; - } else { - // For mode === 'auto'. - if (this.monitor.indexOf('acc') !== -1) { - this.monitorFunc = greater; - } else { - this.monitorFunc = less; - } - } - - if (this.monitorFunc === less) { - this.minDelta *= -1; - } - } - - async onTrainBegin(logs?: Logs) { - this.wait = 0; - this.stoppedEpoch = 0; - if (this.baseline != null) { - this.best = this.baseline; - } else { - this.best = this.monitorFunc === less ? Infinity : -Infinity; - } - } - - async onEpochEnd(epoch: number, logs?: Logs) { - await resolveScalarsInLogs(logs); - const current = this.getMonitorValue(logs); - if (current == null) { - return; - } - - if (this.monitorFunc(current - this.minDelta, this.best)) { - this.best = current; - this.wait = 0; - // TODO(cais): Logic for restoreBestWeights. - } else { - this.wait++; - if (this.wait >= this.patience) { - this.stoppedEpoch = epoch; - this.model.stopTraining = true; - } - // TODO(cais): Logic for restoreBestWeights. - } - } - - async onTrainEnd(logs?: Logs) { - if (this.stoppedEpoch > 0 && this.verbose) { - console.log(`Epoch ${this.stoppedEpoch}: early stopping.`); - } - } - - private getMonitorValue(logs: Logs) { - if (logs == null) { - logs = {}; - } - const monitorValue = logs[this.monitor]; - if (monitorValue == null) { - console.warn( - `Metric for EarlyStopping ${this.monitor} is not available. ` + - `Available metrics are: ${Object.keys(logs)}`); - } - return monitorValue; - } -} - -/** - * Factory function for a Callback that stops training when a monitored - * quantity has stopped improving. - * - * Early stopping is a type of regularization, and protects model against - * overfitting. - * - * The following example based on fake data illustrates how this callback - * can be used during `tf.LayersModel.fit()`: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * units: 3, - * activation: 'softmax', - * kernelInitializer: 'ones', - * inputShape: [2] - * })); - * const xs = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const ys = tf.tensor2d([[1, 0, 0], [0, 1, 0]], [2, 3]); - * const xsVal = tf.tensor2d([4, 3, 2, 1], [2, 2]); - * const ysVal = tf.tensor2d([[0, 0, 1], [0, 1, 0]], [2, 3]); - * model.compile( - * {loss: 'categoricalCrossentropy', optimizer: 'sgd', metrics: ['acc']}); - * - * // Without the EarlyStopping callback, the val_acc value would be: - * // 0.5, 0.5, 0.5, 0.5, ... - * // With val_acc being monitored, training should stop after the 2nd epoch. - * const history = await model.fit(xs, ys, { - * epochs: 10, - * validationData: [xsVal, ysVal], - * callbacks: tf.callbacks.earlyStopping({monitor: 'val_acc'}) - * }); - * - * // Expect to see a length-2 array. - * console.log(history.history.val_acc); - * ``` - * - * @doc { - * heading: 'Callbacks', - * namespace: 'callbacks' - * } - */ -export function earlyStopping(args?: EarlyStoppingCallbackArgs) { - return new EarlyStopping(args); -} - -export const callbacks = {earlyStopping}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/common.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/common.ts deleted file mode 100644 index bf305e206..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/common.ts +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Common functions for TensorFlow.js Layers. - */ -import {VALID_DATA_FORMAT_VALUES, VALID_INTERPOLATION_FORMAT_VALUES, VALID_PADDING_MODE_VALUES, VALID_POOL_MODE_VALUES} from './keras_format/common'; -import {checkStringTypeUnionValue} from './utils/generic_utils'; - -// A map from the requested scoped name of a Tensor to the number of Tensors -// wanting that name so far. This allows enforcing name uniqueness by appending -// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc. -const nameMap: Map = new Map(); - -export function checkDataFormat(value?: string): void { - checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); -} - -export function checkInterpolationFormat(value?: string): void { - checkStringTypeUnionValue( - VALID_INTERPOLATION_FORMAT_VALUES, 'InterpolationFormat', value); -} - -export function checkPaddingMode(value?: string): void { - checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); -} - -export function checkPoolMode(value?: string): void { - checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); -} - -const _nameScopeStack: string[] = []; -const _nameScopeDivider = '/'; - -/** - * Enter namescope, which can be nested. - */ -export function nameScope(name: string, fn: () => T): T { - _nameScopeStack.push(name); - try { - const val: T = fn(); - _nameScopeStack.pop(); - return val; - } catch (e) { - _nameScopeStack.pop(); - throw e; - } -} - -/** - * Get the current namescope as a flat, concatenated string. - */ -function currentNameScopePrefix(): string { - if (_nameScopeStack.length === 0) { - return ''; - } else { - return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; - } -} - -/** - * Get the name a Tensor (or Variable) would have if not uniqueified. - * @param tensorName - * @return Scoped name string. - */ -export function getScopedTensorName(tensorName: string): string { - if (!isValidTensorName(tensorName)) { - throw new Error('Not a valid tensor name: \'' + tensorName + '\''); - } - return currentNameScopePrefix() + tensorName; -} - -/** - * Get unique names for Tensors and Variables. - * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by - * `getScopedTensorName()`. - * @return A unique version of the given fully scoped name. - * If this is the first time that the scoped name is seen in this session, - * then the given `scopedName` is returned unaltered. If the same name is - * seen again (producing a collision), an incrementing suffix is added to the - * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc. - */ -export function getUniqueTensorName(scopedName: string): string { - if (!isValidTensorName(scopedName)) { - throw new Error('Not a valid tensor name: \'' + scopedName + '\''); - } - if (!nameMap.has(scopedName)) { - nameMap.set(scopedName, 0); - } - const index = nameMap.get(scopedName); - nameMap.set(scopedName, nameMap.get(scopedName) + 1); - - if (index > 0) { - const result = `${scopedName}_${index}`; - // Mark the composed name as used in case someone wants - // to call getUniqueTensorName("name_1"). - nameMap.set(result, 1); - return result; - } else { - return scopedName; - } -} - -const tensorNameRegex = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); - -/** - * Determine whether a string is a valid tensor name. - * @param name - * @returns A Boolean indicating whether `name` is a valid tensor name. - */ -export function isValidTensorName(name: string): boolean { - return !!name.match(tensorNameRegex); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/constraints.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/constraints.ts deleted file mode 100644 index 2fd8c3fa2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/constraints.ts +++ /dev/null @@ -1,263 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: keras/contraints.py */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; -import {epsilon} from './backend/common'; -import {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils'; - -/** - * Helper function used by many of the Constraints to find the L2Norms. - */ -function calcL2Norms(w: Tensor, axis: number): Tensor { - return tidy(() => tfc.sqrt(tfc.sum(tfc.mul(w, w), axis, true))); -} - -/** - * Base class for functions that impose constraints on weight values - * - * @doc { - * heading: 'Constraints', - * subheading: 'Classes', - * namespace: 'constraints' - * } - */ -export abstract class Constraint extends serialization.Serializable { - /* Porting note: was __call__, apply chosen to match other similar choices */ - abstract apply(w: Tensor): Tensor; - getConfig(): serialization.ConfigDict { - return {}; - } -} - -export interface MaxNormArgs { - /** - * Maximum norm for incoming weights - */ - maxValue?: number; - /** - * Axis along which to calculate norms. - * - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * `[rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; -} - -export class MaxNorm extends Constraint { - /** @nocollapse */ - static readonly className = 'MaxNorm'; - private maxValue: number; - private axis: number; - private readonly defaultMaxValue = 2; - private readonly defaultAxis = 0; - - constructor(args: MaxNormArgs) { - super(); - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - - apply(w: Tensor): Tensor { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.clipByValue(norms, 0, this.maxValue); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - - getConfig(): serialization.ConfigDict { - return {maxValue: this.maxValue, axis: this.axis}; - } -} -serialization.registerClass(MaxNorm); - -export interface UnitNormArgs { - /** - * Axis along which to calculate norms. - * - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * [rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; -} - -export class UnitNorm extends Constraint { - /** @nocollapse */ - static readonly className = 'UnitNorm'; - private axis: number; - private readonly defaultAxis = 0; - constructor(args: UnitNormArgs) { - super(); - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - - apply(w: Tensor): Tensor { - return tidy( - () => tfc.div(w, tfc.add(epsilon(), calcL2Norms(w, this.axis)))); - } - - getConfig(): serialization.ConfigDict { - return {axis: this.axis}; - } -} -serialization.registerClass(UnitNorm); - -export class NonNeg extends Constraint { - /** @nocollapse */ - static readonly className = 'NonNeg'; - - apply(w: Tensor): Tensor { - return tfc.relu(w); - } -} -serialization.registerClass(NonNeg); - -export interface MinMaxNormArgs { - /** - * Minimum norm for incoming weights - */ - minValue?: number; - /** - * Maximum norm for incoming weights - */ - maxValue?: number; - /** - * Axis along which to calculate norms. - * For instance, in a `Dense` layer the weight matrix - * has shape `[inputDim, outputDim]`, - * set `axis` to `0` to constrain each weight vector - * of length `[inputDim,]`. - * In a `Conv2D` layer with `dataFormat="channels_last"`, - * the weight tensor has shape - * `[rows, cols, inputDepth, outputDepth]`, - * set `axis` to `[0, 1, 2]` - * to constrain the weights of each filter tensor of size - * `[rows, cols, inputDepth]`. - */ - axis?: number; - /** - * Rate for enforcing the constraint: weights will be rescaled to yield: - * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`. - * Effectively, this means that rate=1.0 stands for strict - * enforcement of the constraint, while rate<1.0 means that - * weights will be rescaled at each step to slowly move - * towards a value inside the desired interval. - */ - rate?: number; -} - -export class MinMaxNorm extends Constraint { - /** @nocollapse */ - static readonly className = 'MinMaxNorm'; - private minValue: number; - private maxValue: number; - private rate: number; - private axis: number; - private readonly defaultMinValue = 0.0; - private readonly defaultMaxValue = 1.0; - private readonly defaultRate = 1.0; - private readonly defaultAxis = 0; - - constructor(args: MinMaxNormArgs) { - super(); - this.minValue = - args.minValue != null ? args.minValue : this.defaultMinValue; - this.maxValue = - args.maxValue != null ? args.maxValue : this.defaultMaxValue; - this.rate = args.rate != null ? args.rate : this.defaultRate; - this.axis = args.axis != null ? args.axis : this.defaultAxis; - } - - apply(w: Tensor): Tensor { - return tidy(() => { - const norms = calcL2Norms(w, this.axis); - const desired = tfc.add( - tfc.mul( - this.rate, tfc.clipByValue(norms, this.minValue, this.maxValue)), - tfc.mul(1.0 - this.rate, norms)); - return tfc.mul(w, tfc.div(desired, tfc.add(epsilon(), norms))); - }); - } - - getConfig(): serialization.ConfigDict { - return { - minValue: this.minValue, - maxValue: this.maxValue, - rate: this.rate, - axis: this.axis - }; - } -} -serialization.registerClass(MinMaxNorm); - -/** @docinline */ -export type ConstraintIdentifier = - 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string; - -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -export const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP: - {[identifier in ConstraintIdentifier]: string} = { - 'maxNorm': 'MaxNorm', - 'minMaxNorm': 'MinMaxNorm', - 'nonNeg': 'NonNeg', - 'unitNorm': 'UnitNorm' - }; - -export function serializeConstraint(constraint: Constraint): - serialization.ConfigDictValue { - return serializeKerasObject(constraint); -} - -export function deserializeConstraint( - config: serialization.ConfigDict, - customObjects: serialization.ConfigDict = {}): Constraint { - return deserializeKerasObject( - config, serialization.SerializationMap.getMap().classNameMap, - customObjects, 'constraint'); -} - -export function getConstraint(identifier: ConstraintIdentifier| - serialization.ConfigDict|Constraint): Constraint { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = {className, config: {}}; - return deserializeConstraint(config); - } else if (identifier instanceof Constraint) { - return identifier; - } else { - return deserializeConstraint(identifier); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts deleted file mode 100644 index 1d6b198b2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts +++ /dev/null @@ -1,1321 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: keras/engine/topology.py */ - -import {NamedTensorMap, Scalar, serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; - -import {getUid} from '../backend/state'; -import {NotImplementedError, RuntimeError, ValueError} from '../errors'; -import {Shape} from '../keras_format/common'; -import {TensorKeyWithArgsArray} from '../keras_format/node_config'; -import {PyJsonDict} from '../keras_format/types'; -import {deserialize as deserializeLayer} from '../layers/serialization'; -import {Kwargs} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import {convertTsToPythonic} from '../utils/serialization_utils'; -import * as types_utils from '../utils/types_utils'; -import {batchSetValue, LayerVariable} from '../variables'; -import {version as layersVersion} from '../version'; - -import {execute, FeedDict} from './executor'; -import {InputLayer} from './input_layer'; -import {DisposeResult, Layer, Node, SymbolicTensor} from './topology'; - -/** Constructor config for Container. */ -export interface ContainerArgs { - inputs: SymbolicTensor|SymbolicTensor[]; - outputs: SymbolicTensor|SymbolicTensor[]; - name?: string; -} - -/** - * A Container is a directed acyclic graph of layers. - * - * It is the topological form of a "model". A LayersModel - * is simply a Container with added training routines. - * - */ -export abstract class Container extends Layer { - inputs: SymbolicTensor[]; - outputs: SymbolicTensor[]; - - inputLayers: Layer[]; - inputLayersNodeIndices: number[]; - inputLayersTensorIndices: number[]; - - outputLayers: Layer[]; - outputLayersNodeIndices: number[]; - outputLayersTensorIndices: number[]; - - layers: Layer[]; - layersByDepth: {[depth: string]: Layer[]}; - nodesByDepth: {[depth: string]: Node[]}; - - internalContainerRefs: Container[]; - - containerNodes = new Set(); - - // TODO(michaelterry): Add cache support - // private outputMaskCache: any; - // private outputTensorCache: any; - // private outputShapeCache: any; - - inputNames: string[]; - outputNames: string[]; - feedInputShapes: Shape[]; - - protected internalInputShapes: Shape[]; - protected internalOutputShapes: Shape[]; - // TODO(cais): Maybe 'feed' should not in the names of these variables, - // due to the fact that our backend is not symbolic. - protected feedInputNames: string[]; - protected feedOutputNames: string[]; - - constructor(args: ContainerArgs) { - // No args passed to super's constructor. - super({}); - this.name = args.name; - if (this.name == null) { - const prefix = this.getClassName().toLowerCase(); - this.name = getUid(prefix); - } - - this.supportsMasking = false; - this.trainable_ = true; - - // TODO(michaelterry): Initialize perInputLosses/Updates here. - - // Container-specific properties. - if (Array.isArray(args.inputs)) { - this.inputs = args.inputs.slice(); - } else { - this.inputs = [args.inputs]; - } - if (Array.isArray(args.outputs)) { - this.outputs = args.outputs.slice(); - } else { - this.outputs = [args.outputs]; - } - - // Check for redundancy in inputs. - if (generic_utils.unique(this.inputs).length !== this.inputs.length) { - throw new ValueError( - 'The list of inputs passed to the model is ' + - 'redundant. All inputs should only appear once. Found: ' + - `${this.inputs.map(x => x.name)}`); - } - - // Check for redundancy in outputs. - if (generic_utils.unique(this.outputs).length !== this.outputs.length) { - console.warn( - 'The list of outputs passed to the model is redundant. ' + - 'All outputs should only appear once. Found: ' + - `${this.outputs.map(x => x.name)}`); - } - - /* - List of initial layers (1 to 1 mapping with this.inputs, hence the same - layer might appear twice) - */ - this.inputLayers = []; - this.inputLayersNodeIndices = []; - this.inputLayersTensorIndices = []; - /* - List of layers (1 to 1 mapping with this.outputs, hence the same layer - might appear twice) - */ - this.outputLayers = []; - this.outputLayersNodeIndices = []; - this.outputLayersTensorIndices = []; - /* - All layers in order of horizontal graph traversal. Entries are unique. - Includes input and output layers. - */ - this.layers = []; - - /* - References to container layers that were constructed internally. We need - these to properly dispose of tensors from nested containers. - */ - this.internalContainerRefs = []; - - // TODO(michaelterry): Determine if caching still needed with eager - // backend. - /* - This is for performance optimization when calling the Container on new - inputs. Every time the Container is called on a set on input tensors, - we compute the output tensors, output masks and output shapes in one pass, - then cache them here. When one of these outputs is queried later, - we retrieve it from there instead of recomputing it. - */ - // this.outputTensorCache = {}; - // this.outputShapeCache = {}; - - // Build this.outputLayers: - for (const x of this.outputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - this.outputLayers.push(layer); - this.outputLayersNodeIndices.push(nodeIndex); - this.outputLayersTensorIndices.push(tensorIndex); - } - - // TODO(michaelterry): Add output mask cache code. - - // Build this.inputLayers: - for (const x of this.inputs) { - const layer = x.sourceLayer; - const nodeIndex = x.nodeIndex; - const tensorIndex = x.tensorIndex; - /* - It's supposed to be an input layer, so only one node - and one tensor output. - */ - generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes'); - generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors'); - this.inputLayers.push(layer); - this.inputLayersNodeIndices.push(nodeIndex); - this.inputLayersTensorIndices.push(tensorIndex); - } - - // Build this.inputNames and this.outputNames. - this.inputNames = []; - this.outputNames = []; - this.feedInputShapes = []; - this.feedInputNames = []; - this.feedOutputNames = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - // Check that layer is an InputLayer. - if (!(layer instanceof InputLayer)) { - throw new TypeError( - 'Input layers to a LayersModel must be InputLayer objects. ' + - `Received inputs: ${args.inputs}. ` + - `Input ${i} (0-based) originates ` + - `from layer type ${layer.getClassName()}.`); - } - this.inputNames.push(layer.name); - this.feedInputShapes.push(layer.batchInputShape); - - this.feedInputNames.push(layer.name); - } - for (const layer of this.outputLayers) { - this.outputNames.push(layer.name); - } - - this.internalInputShapes = this.inputs.map(x => x.shape); - this.internalOutputShapes = this.outputs.map(x => x.shape); - - /* - Container_nodes: set of nodes included in the graph (not all nodes - included in the layers are relevant to the current graph). - */ - // ids of all nodes relevant to the Container: - const nodesDepths: {[nodeID: string]: number} = {}; - // To recover nodes from their ID. - const nodeIDToNode: {[nodeID: string]: Node} = {}; - const layersDepths: {[layerID: string]: number} = {}; - // To layers from their ID. - const layerIDToLayer: {[layerID: string]: Layer} = {}; - const layerIndices: {[layerID: string]: number} = {}; - const nodesInDecreasingDepth: Node[] = []; - - /** - * Builds a map of the graph of layers. - * - * This recursively updates the map `layerIndices`, - * the list `nodesInDecreasingDepth` and the set `containerNodes`. - * - * @param tensor Some tensor in a graph. - * @param finishedNodes Set of nodes whose subgraphs have been traversed - * completely. Useful to prevent duplicated work. - * @param nodesInProgress Set of nodes that are currently active on the - * recursion stack. Useful to detect cycles. - * @param layer Layer from which `tensor` comes from. If not provided, - * will be obtained from tensor.sourceLayer. - * @param nodeIndex Node index from which `tensor` comes from. - * @param tensorIndex TensorIndex from which `tensor` comes from. - * - * @exception RuntimeError if a cycle is detected. - */ - const buildMapOfGraph = - (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[], - layer?: Layer, nodeIndex?: number, tensorIndex?: number) => { - if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - tensorIndex = tensor.tensorIndex; - } - const node = layer.inboundNodes[nodeIndex]; - - // Prevent cycles. - if (nodesInProgress.indexOf(node) !== -1) { - throw new RuntimeError( - `The tensor ${tensor.name} at layer "${layer.name}" ` + - 'is part of a cycle.'); - } - - // Don't repeat work for shared subgraphs - if (finishedNodes.indexOf(node) !== -1) { - return; - } - - // Update containerNodes. - this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); - - // Store the traversal order for layer sorting. - if (!(layer.id in layerIndices)) { - layerIndices[layer.id] = Object.keys(layerIndices).length; - } - - if (nodesInProgress.indexOf(node) === -1) { - nodesInProgress.push(node); - } - - // Propagate to all previous tensors connected to this node. - const numInboundLayers = node.inboundLayers.length; - for (let i = 0; i < numInboundLayers; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - buildMapOfGraph( - x, finishedNodes, nodesInProgress, layer, nodeIndex, - tensorIndex); - } - finishedNodes.push(node); - while (nodesInProgress.indexOf(node) >= 0) { - nodesInProgress.splice(nodesInProgress.indexOf(node), 1); - } - nodesInDecreasingDepth.push(node); - }; - - const finishedNodes: Node[] = []; - const nodesInProgress: Node[] = []; - for (const x of this.outputs) { - buildMapOfGraph(x, finishedNodes, nodesInProgress); - } - - const reversedNodesInDecreasingDepth = - nodesInDecreasingDepth.slice().reverse(); - for (const node of reversedNodesInDecreasingDepth) { - nodeIDToNode[node.id] = node; - // If the depth is not set, the node has no outbound nodes (depth 0). - if (!(node.id in nodesDepths)) { - nodesDepths[node.id] = 0; - } - let depth = nodesDepths[node.id]; - - // Update the depth of the corresponding layer - const previousDepth = - (layersDepths[node.outboundLayer.id] == null ? - 0 : - layersDepths[node.outboundLayer.id]); - - /* - If we've seen this layer before at a higher depth, we should use that - depth instead of the node depth. This is necessary for shared layers - that have inputs at different depth levels in the graph. - */ - depth = Math.max(depth, previousDepth); - layersDepths[node.outboundLayer.id] = depth; - layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; - nodesDepths[node.id] = depth; - - // Update the depth of inbound nodes. - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const inboundNode = inboundLayer.inboundNodes[nodeIndex]; - const previousDepth = - (nodesDepths[inboundNode.id] == null ? 0 : - nodesDepths[inboundNode.id]); - nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth); - nodeIDToNode[inboundNode.id] = inboundNode; - } - } - - // Build a dict {depth: list of nodes with this depth} - const nodesByDepth: {[depth: string]: Node[]} = {}; - for (const nodeID in nodesDepths) { - const depth = nodesDepths[nodeID]; - if (!(depth in nodesByDepth)) { - nodesByDepth[depth] = []; - } - nodesByDepth[depth].push(nodeIDToNode[nodeID]); - } - - // Build a dict {depth: list of layers with this depth} - const layersByDepth: {[depth: string]: Layer[]} = {}; - for (const layerID in layersDepths) { - const depth = layersDepths[layerID]; - if (!(depth in layersByDepth)) { - layersByDepth[depth] = []; - } - layersByDepth[depth].push(layerIDToLayer[layerID]); - } - - // Get sorted list of layer depths. - let depthKeys = Object.keys(layersByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - - // Set this.layers and this.layersByDepth. - this.layers = []; - for (const depth of depthKeys) { - const layersForDepth = layersByDepth[depth]; - // Container.layers needs to have a deterministic order: - // here we order them by traversal order. - layersForDepth.sort((a, b) => { - const aIndex = layerIndices[a.id]; - const bIndex = layerIndices[b.id]; - if (aIndex < bIndex) { - return -1; - } - if (aIndex > bIndex) { - return 1; - } - return 0; - }); - for (const layer of layersForDepth) { - if (layer instanceof Container) { - this.internalContainerRefs.push(layer); - } - this.layers.push(layer); - } - } - this.layersByDepth = layersByDepth; - - // Get sorted list of node depths; - depthKeys = Object.keys(nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - - // Check that all tensors required are computable. - // computable_tensors: all tensors in the graph - // that can be computed from the inputs provided. - const computableTensors = this.inputs.slice(); - - // To provide a better error msg. - const layersWithCompleteInput: string[] = []; - for (const depth of depthKeys) { - for (const node of nodesByDepth[depth]) { - const layer = node.outboundLayer; - if (layer != null) { - for (const x of node.inputTensors) { - if (computableTensors.indexOf(x) === -1) { - throw new RuntimeError( - `Graph disconnected: cannot obtain value for tensor ${x}` + - ` at layer "${layer.name}". ` + - 'The following previous layers were accessed without ' + - `issue: ${layersWithCompleteInput}`); - } - } - for (const x of node.outputTensors) { - computableTensors.push(x); - } - layersWithCompleteInput.push(layer.name); - } - } - } - - // Set this.containerNodes and this.nodesByDepth. - this.nodesByDepth = nodesByDepth; - - // Ensure name unicity, which will be crucial for serialization - // (since serialized nodes refer to layers by their name). - const allNames = this.layers.map(x => x.name); - for (const name of allNames) { - const numOccurrences = allNames.filter(x => x === name).length; - if (numOccurrences !== 1) { - throw new RuntimeError( - `The name "${name}" is used ${numOccurrences} times ` + - 'in the model. All layer names should be unique. Layer names: ' + - JSON.stringify(allNames)); - } - } - - // Layer parameters. - // The new container starts with a single inbound node - // for its inputs, and no outbound nodes. - // Will be appended to by future calls to apply(). - this.outboundNodes = []; - // Will be appended to below, and by future calls to apply(). - this.inboundNodes = []; - - // Create the node linking internal inputs to internal outputs. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - inputMasks: this.inputs.map(x => null), - outputMasks: this.outputs.map(x => null), - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs.map(x => x.shape) - }); - this.built = true; - this._refCount = 1; // The ref count of a container always start at 1. - } - - protected assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Container '${this.name}' is already disposed.`); - } - } - - /** - * Attempt to dispose a LayersModel's weights. - * - * This method decrease the reference count of the LayersModel object by 1. - * - * A LayersModel is reference-counted. Its reference count is incremented by 1 - * when it is first constructed and when it is used as a Layer of another - * LayersModel. - * - * If the reference count of a LayersModel becomes 0, the `dispose` method of - * all its constituent `Layer`s will be called. - * - * Note: If the reference count is greater than 0 after the decrement, the - * `dispose` method of its constituent `Layer`s will *not* be called. - * - * After a LayersModel is disposed, it cannot be used in calls such as - * 'predict`, `evaluate` or `fit` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the LayersModel after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the LayersModel has - * already been disposed. - */ - dispose(): DisposeResult { - this.assertNotDisposed(); - const result: - DisposeResult = {refCountAfterDispose: null, numDisposedVariables: 0}; - if (--this._refCount === 0) { - for (const layer of this.layers) { - result.numDisposedVariables += layer.dispose().numDisposedVariables; - } - - // Call dispose on each internally created container layer again to ensure - // their refCounts hit zero and their tensors are subsequently deleted. - for (const container of this.internalContainerRefs) { - result.numDisposedVariables += container.dispose().numDisposedVariables; - } - } - result.refCountAfterDispose = this._refCount; - return result; - } - - get trainable() { - return this.trainable_; - } - - set trainable(trainable: boolean) { - this.layers.forEach(layer => { - // tslint:disable-next-line:no-any - ((layer as any)._trainableWeights as LayerVariable[]) - .forEach(w => w.trainable = trainable); - }); - this.trainable_ = trainable; - } - - get trainableWeights(): LayerVariable[] { - // Porting Note: This check below is to prevent errors where the - // _trainableWeights inherited from the parent class (Layer) gets - // inadvertently used. - if (this._trainableWeights.length > 0) { - throw new ValueError( - 'Container instance unexpectedly contains _trainableWeights.' + - 'The trainable weights of a Container are a union of the ' + - 'trainable weights of its consituent Layers. Its own ' + - '_trainableWeights must remain an empty Array.'); - } - - if (!this.trainable) { - return []; - } - let weights: LayerVariable[] = []; - for (const layer of this.layers) { - weights = weights.concat(layer.trainableWeights); - } - return weights; - } - - get nonTrainableWeights(): LayerVariable[] { - const weights: LayerVariable[] = []; - for (const layer of this.layers) { - weights.push(...layer.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights: LayerVariable[] = []; - for (const layer of this.layers) { - trainableWeights.push(...layer.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - - get weights(): LayerVariable[] { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - - /** - * Loads all layer weights from a JSON object. - * - * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript / - * TypeScript. The utility script at `scripts/pykeras.py` offers means - * to convert them into JSON strings compatible with this method. - * Porting Note: TensorFlow.js Layers supports only loading by name currently. - * - * @param weights A JSON mapping weight names to weight values as nested - * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight - * names to `tf.Tensor` objects. - * @param strict Require that the provided weights exactly match those - * required by the container. Default: `true`. Passing `false` means that - * extra weights and missing weights will be silently ignored. - */ - loadWeights(weights: NamedTensorMap, strict = true) { - const nameToWeight: {[name: string]: LayerVariable} = {}; - let totalWeightsCount = 0; - for (const layer of this.layers) { - for (const weight of layer.weights) { - if (nameToWeight[weight.originalName] != null) { - throw new ValueError(`Duplicate weight name: ${weight.originalName}`); - } - nameToWeight[weight.originalName] = weight; - totalWeightsCount++; - } - } - - const weightValueTuples: Array<[LayerVariable, Tensor]> = []; - for (const name in weights) { - // TF 2.2.0 added cell name to the weight name in the format of - // layer_name/cell_name/weight_name, we need to remove - // the inner cell name. - let validatedName = name; - if (nameToWeight[name] == null) { - const tokens = name.split('/'); - const shortenNameArray = - tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); - validatedName = shortenNameArray.join('/'); - } - if (nameToWeight[validatedName] != null) { - weightValueTuples.push([nameToWeight[validatedName], weights[name]]); - } else if (strict) { - throw new ValueError( - `Provided weight data has no target variable: ${name}`); - } - delete nameToWeight[validatedName]; - } - - if (strict) { - // Check that all weights are set. - const unsetNames: string[] = []; - for (const name in nameToWeight) { - unsetNames.push(name); - } - if (unsetNames.length > 0) { - throw new ValueError( - `${unsetNames.length} of ${ - totalWeightsCount} weights are not set: ` + - `${unsetNames}`); - } - } - - batchSetValue(weightValueTuples); - } - - /** - * Util shared between different serialization methods. - * @returns LayersModel config with Keras version information added. - */ - protected updatedConfig(): serialization.ConfigDict { - const theConfig = this.getConfig(); - const modelConfig: serialization.ConfigDict = {}; - modelConfig['className'] = this.getClassName(); - modelConfig['config'] = theConfig; - modelConfig['kerasVersion'] = `tfjs-layers ${layersVersion}`; - // TODO(nielsene): Replace something like K.backend() once - // possible. - modelConfig['backend'] = 'TensorFlow.js'; - return modelConfig; - } - - /** - * Returns a JSON string containing the network configuration. - * - * To load a network from a JSON save file, use - * models.modelFromJSON(jsonString); - * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras - * @param returnString Whether the return value should be stringified - * (default: `true`). - * @returns a JSON string if `returnString` (default), or a JSON object if - * `!returnString`. - */ - // tslint:disable-next-line:no-any - toJSON(unused?: any, returnString = true): string|PyJsonDict { - const modelConfig = convertTsToPythonic(this.updatedConfig()) as PyJsonDict; - return returnString ? JSON.stringify(modelConfig) : modelConfig; - } - - /** - * Call the model on new inputs. - * - * In this case `call` just reapplies all ops in the graph to the new inputs - * (e.g. build a new computational graph from the provided inputs). - * - * @param inputs A tensor or list of tensors. - * @param mask A mask or list of masks. A mask can be either a tensor or null - * (no mask). - * - * @return A tensor if there is a single output, or a list of tensors if there - * are more than one outputs. - */ - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = generic_utils.toList(inputs); - const feedDict = new FeedDict(); - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - return execute(this.outputs, feedDict, kwargs) as Tensor | Tensor[]; - }); - } - - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor - |Tensor[] { - return tidy(() => { - inputs = generic_utils.toList(inputs); - let masks: Tensor[]; - if (mask == null) { - masks = generic_utils.pyListRepeat(null, inputs.length); - } else { - masks = generic_utils.toList(mask); - } - // TODO(michaelterry): Add support for mask caching. - return this.runInternalGraph(inputs, masks)[1]; - }); - } - - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - */ - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - const inputShapes = types_utils.normalizeShapeList(inputShape); - if (inputShapes.length !== this.inputLayers.length) { - throw new ValueError( - `Invalid inputShape argument ${inputShape}: ` + - `model has ${this.inputLayers.length} tensor inputs.`); - } - - // TODO(michaelterry): Add caching - const layersToOutputShapes: {[shapeKey: string]: Shape} = {}; - for (let i = 0; i < inputShapes.length; i++) { - const layer = this.inputLayers[i]; - const inputShape = inputShapes[i]; - // It's an input layer: computeOutputShape is identity, - // and there is only one node and one tensor output. - const shapeKey = layer.name + '_0_0'; - layersToOutputShapes[shapeKey] = inputShape; - } - - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - // Iterate over nodes, by depth level. - if (depthKeys.length > 1) { - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) { - // We've already covered the input layers a few lines above. - continue; - } - // Potentially redundant list, same size of node.inputTensors. - const inputShapes: Shape[] = []; - for (let j = 0; j < node.inboundLayers.length; j++) { - const inboundLayer = node.inboundLayers[j]; - const nodeIndex = node.nodeIndices[j]; - const tensorIndex = node.tensorIndices[j]; - const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`; - const inputShape = layersToOutputShapes[shapeKey]; - inputShapes.push(inputShape); - } - - const outputShape = layer.computeOutputShape( - generic_utils.singletonOrArray(inputShapes)); - - const outputShapes = types_utils.normalizeShapeList(outputShape); - const nodeIndex = layer.inboundNodes.indexOf(node); - for (let j = 0; j < outputShapes.length; j++) { - const shapeKey = `${layer.name}_${nodeIndex}_${j}`; - layersToOutputShapes[shapeKey] = outputShapes[j]; - } - } - } - } - - // Read final output shapes from layersToOutputShapes. - const outputShapes: Shape[] = []; - const outputShapeKeys: string[] = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - const tensorIndex = this.outputLayersTensorIndices[i]; - const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`; - outputShapeKeys.push(shapeKey); - } - - for (let i = 0; i < outputShapeKeys.length; i++) { - const key = outputShapeKeys[i]; - generic_utils.assert(key in layersToOutputShapes); - outputShapes.push(layersToOutputShapes[key]); - } - - // TODO(michaelterry): Update cache - return generic_utils.singletonOrArray(outputShapes); - } - - /** - * Computes output tensors for new inputs. - * - * Note: - * - Expects `inputs` to be a list (potentially with 1 element). - * - * @param inputs List of tensors - * @param masks List of masks (tensors or null). - * @return Three lists: outputTensors, outputMasks, outputShapes - */ - protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]): - [Tensor[], Tensor[], Shape[]] { - if (masks == null) { - masks = generic_utils.pyListRepeat(null, inputs.length); - } - - // Dictionary mapping reference tensors to tuples - // (computed tensor, compute mask) - // we assume a 1:1 mapping from tensor to mask - // TODO: raise exception when a `.computeMask()` call - // does not return a list the same size as `call` - const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {}; - for (let i = 0; i < this.inputs.length; ++i) { - const x = this.inputs[i]; - const y = inputs[i]; - const mask = masks[i]; - tensorMap[x.id] = [y, mask]; - } - - const depthKeys = Object.keys(this.nodesByDepth) - .map(x => parseInt(x, 10)) - .sort(generic_utils.reverseNumberCompare); - for (const depth of depthKeys) { - const nodes = this.nodesByDepth[depth]; - for (const node of nodes) { - // This is always a single layer, never a list. - const layer = node.outboundLayer; - const referenceInputTensors = node.inputTensors; - const referenceOutputTensors = node.outputTensors; - - // If all previous input tensors are available in tensorMap, - // then call node.inboundLayer on them. - // List of tuples [input, mask]: - const computedData = new Array<[Tensor, Tensor]>(); - for (const x of referenceInputTensors) { - if (x.id in tensorMap) { - computedData.push(tensorMap[x.id]); - } - } - if (computedData.length === referenceInputTensors.length) { - // TODO(michaelterry): Add K.name_scope here, if we need it. - let kwargs: Kwargs = {}; - let computedTensors: Tensor[]; - let computedMasks: Tensor[]; - let outputTensors: Tensor[]; - let outputMasks: Tensor[]; - // call layer - if (node.callArgs != null) { - kwargs = node.callArgs; - } - if (computedData.length === 1) { - const [computedTensor, computedMask] = computedData[0]; - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMask; - } - outputTensors = - generic_utils.toList(layer.call(computedTensor, kwargs)); - outputMasks = generic_utils.toList( - layer.computeMask(computedTensor, computedMask)); - computedTensors = [computedTensor]; - computedMasks = [computedMask]; - } else { - computedTensors = computedData.map(x => x[0]); - computedMasks = computedData.map(x => x[1]); - if (kwargs['mask'] == null) { - kwargs['mask'] = computedMasks; - } - outputTensors = - generic_utils.toList(layer.call(computedTensors, kwargs)); - outputMasks = generic_utils.toList( - layer.computeMask(computedTensors, computedMasks)); - } - - if (layer.activityRegularizer) { - throw new NotImplementedError( - 'LayersModel invocation with concrete Tensor value(s) in the ' + - 'presence of activity regularizer(s) is not supported yet.'); - } - // TODO(michaelterry): Add model updates and losses - - // Update tensor map. - for (let i = 0; i < referenceOutputTensors.length; ++i) { - const x = referenceOutputTensors[i]; - const y = outputTensors[i]; - const mask = outputMasks[i]; - tensorMap[x.id] = [y, mask]; - } - } - } - } - - const outputTensors: Tensor[] = []; - const outputMasks: Tensor[] = []; - const outputShapes: Shape[] = []; - for (const x of this.outputs) { - generic_utils.assert( - x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); - const [tensor, mask] = tensorMap[x.id]; - outputShapes.push(tensor.shape); - outputTensors.push(tensor); - outputMasks.push(mask); - } - - // TODO(michaelterry): Add support for caches. - return [outputTensors, outputMasks, outputShapes]; - } - - /** - * Builds a map of internal node keys to node ordering. - * Used in serializaion a node orderings may change as unused nodes are - * dropped. Porting Note: This helper method was pulled out of getConfig to - * improve readability. - * @param layers An array of Layers in the model. - * @returns Map of Node Keys to index order within the layer. - */ - private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} { - const nodeConversionMap: {[nodeKey: string]: number} = {}; - let keptNodes: number; - for (const layer of this.layers) { - keptNodes = layer instanceof Container ? 1 : 0; - for (let originalNodeIndex = 0; - originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - if (this.containerNodes.has(nodeKey)) { - // i.e. we mark it to be saved - nodeConversionMap[nodeKey] = keptNodes; - keptNodes += 1; - } - } - } - return nodeConversionMap; - } - - /** - * Retrieves a layer based on either its name (unique) or index. - * - * Indices are based on order of horizontal graph traversal (bottom-up). - * - * If both `name` and `index` are specified, `index` takes precedence. - * - * @param name Name of layer. - * @param index Index of layer. - * @returns A Layer instance. - * @throws ValueError: In case of invalid layer name or index. - * - * @doc { - * heading: 'Layers', - * subheading: 'Classes', - * namespace: 'layers', - * subclasses: ['LayersModel'] - * } - */ - getLayer(name?: string, index?: number): Layer { - if (index != null) { - if (this.layers.length <= index) { - throw new ValueError( - `Was asked to retrieve layer at index ${index}, but model only ` + - `has ${this.layers.length} layer(s).`); - } else { - return this.layers[index]; - } - } else { - if (name == null) { - throw new ValueError('Provide either a layer name or layer index'); - } - } - - for (const layer of this.layers) { - if (layer.name === name) { - return layer; - } - } - throw new ValueError(`No such layer: ${name}`); - } - - /** - * Retrieves the Container's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses(): Scalar[] { - // Porting Node: This is an augmentation to Container.loss in PyKeras. - // In PyKeras, Container.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return tidy(() => { - const losses: Scalar[] = []; - for (const layer of this.layers) { - for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length; - ++nodeIndex) { - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (this.containerNodes.has(nodeKey)) { - losses.push(...layer.calculateLosses()); - } - } - } - // TODO(cais): Add any unconditional model-level losses? - return losses; - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {name: this.name}; - - // Build a map from layer unique name (self._node_key) - // to the index of the nodes that are saved in the config. - // Only nodes in container_nodes are saved. - const nodeConversionMap: {[nodeKey: string]: number} = - this.buildNodeConversionMap(this.layers); - - // Serialize and save the layers in layerConfigs - const layerConfigs = []; - for (const layer of this.layers) { - const layerClassName = layer.getClassName(); - const layerConfig = layer.getConfig(); - const filteredInboundNodes = []; - for (let originalNodeIndex = 0; - originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { - const node = layer.inboundNodes[originalNodeIndex]; - const nodeKey = Container.nodeKey(layer, originalNodeIndex); - let kwargs = {}; - if (this.containerNodes.has(nodeKey)) { - // The node is relevant to the model: - // add to filteredInboundNodes. - if (node.callArgs) { - try { - JSON.stringify(node.callArgs); - kwargs = node.callArgs; - } catch (err) { - console.warn( - `Layer ${layer.name} was passed ` + - `non-serializable keyword arguments: ` + - `${node.callArgs}. They will not be included ` + - `in the serialized model (and thus will be ` + - `missing at deserialization time).`); - kwargs = {}; - } - } - if (node.inboundLayers.length > 0) { - const nodeData = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const inboundLayer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const tensorIndex = node.tensorIndices[i]; - const nodeKey = Container.nodeKey(inboundLayer, nodeIndex); - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex == null) { - newNodeIndex = 0; - } - nodeData.push( - [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); - } - filteredInboundNodes.push(nodeData); - } - } - } - const dict: serialization.ConfigDict = {}; - dict['name'] = layer.name; - dict['className'] = layerClassName; - dict['config'] = layerConfig; - dict['inboundNodes'] = filteredInboundNodes; - layerConfigs.push(dict); - } - config['layers'] = layerConfigs; - // Gather info about inputs and outputs - const modelInputs = []; - for (let i = 0; i < this.inputLayers.length; i++) { - const layer = this.inputLayers[i]; - const nodeIndex = this.inputLayersNodeIndices[i]; - - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.inputLayersTensorIndices[i]; - modelInputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['inputLayers'] = modelInputs; - - const modelOutputs = []; - for (let i = 0; i < this.outputLayers.length; i++) { - const layer = this.outputLayers[i]; - const nodeIndex = this.outputLayersNodeIndices[i]; - - const nodeKey = Container.nodeKey(layer, nodeIndex); - if (!this.containerNodes.has(nodeKey)) { - continue; - } - let newNodeIndex = nodeConversionMap[nodeKey]; - if (newNodeIndex === null || newNodeIndex === undefined) { - newNodeIndex = 0; - } - const tensorIndex = this.outputLayersTensorIndices[i]; - modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); - } - config['outputLayers'] = modelOutputs; - return config; - } - - /** - * Instantiates a LayersModel from its config (output of `get_config()`). - * @param cls the class to create - * @param config LayersModel config dictionary. - * @param customObjects An optional dictionary of custom objects. - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns A LayersModel instance. - * @throws ValueError: In case of improperly formatted config dict. - */ - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict, - fastWeightInit = false): T { - // Layer instances created during - // the graph reconstruction process - const createdLayers: {[layerName: string]: Layer} = {}; - - // Dictionary mapping layer instances to - // node data that specifies a layer call. - // It acts as a queue that maintains any unprocessed - // layer call until it becomes possible to process it - // (i.e. until the input tensors to the call all exist). - const unprocessedNodes: {[layer: string]: TensorKeyWithArgsArray[][]} = {}; - function addUnprocessedNode( - layer: Layer, nodeData: TensorKeyWithArgsArray[]) { - if (!(layer.name in unprocessedNodes)) { - unprocessedNodes[layer.name] = [nodeData]; - } else { - unprocessedNodes[layer.name].push(nodeData); - } - } - - function processNode(layer: Layer, nodeData: TensorKeyWithArgsArray[]) { - const inputTensors: SymbolicTensor[] = []; - let kwargs; - for (const inputData of nodeData) { - const inboundLayerName = inputData[0]; - const inboundNodeIndex = inputData[1]; - const inboundTensorIndex = inputData[2]; - - kwargs = inputData[3] == null ? - {} : - inputData[3] as serialization.ConfigDict; - if (!(inboundLayerName in createdLayers)) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundLayer = createdLayers[inboundLayerName]; - if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { - addUnprocessedNode(layer, nodeData); - return; - } - const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; - inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); - } - // Call layer on its inputs, thus creating the node - // and building the layer if needed. - // Note: This has Eager vs Graph Implications. - if (inputTensors.length > 0) { - layer.apply( - generic_utils.singletonOrArray(inputTensors), - kwargs); // was ** kwargs - } - } - - /** - * Deserialize a layer, then call it on appropriate inputs. - * @param layerData: layer config dict. - * @throws ValueError: In case of improperly formatted `layer_data` - * dict. - */ - function processLayer(layerData: serialization.ConfigDict|null) { - const layerName = layerData['name'] as string; - // Instantiate layer. - const layer = - deserializeLayer( - layerData, - config['customObjects'] != null ? - config['customObjects'] as serialization.ConfigDict : - {}) as Layer; - layer.setFastWeightInitDuringBuild(fastWeightInit); - createdLayers[layerName] = layer; - // Gather layer inputs. - const inboundNodesData = - layerData['inboundNodes'] as TensorKeyWithArgsArray[][]; - inboundNodesData.forEach(nodeData => { - if (!(nodeData instanceof Array)) { - throw new ValueError( - `Corrupted configuration, expected array for nodeData: ${ - nodeData}`); - } - // We don't process nodes (i.e. make layer calls) - // on the fly because the inbound node may not yet exist, - // in case of layer shared at different topological depths - // (e.g.a model such as A(B(A(B(x))))) - addUnprocessedNode(layer, nodeData); - }); - } - - // First, we create all layers and enqueue nodes to be processed. - const name = config['name']; - const layersFromConfig = config['layers'] as serialization.ConfigDict[]; - for (const layerData of layersFromConfig) { - processLayer(layerData); - } - - // Then we process nodes in order of layer depth. - // Nodes that cannot yet be processed(if the inbound node - // does not yet exist) are re - enqueued, and the process - // is repeated until all nodes are processed. - while (!generic_utils.isObjectEmpty(unprocessedNodes)) { - for (const layerData of layersFromConfig) { - const layer = createdLayers[layerData['name'] as string]; - if (layer.name in unprocessedNodes) { - const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; - delete unprocessedNodes[layer.name]; - for (const nodeData of currentUnprocessedNodesForLayer) { - processNode(layer, nodeData); - } - } - } - } - - const inputTensors: SymbolicTensor[] = []; - const outputTensors: SymbolicTensor[] = []; - const inputLayersFromConfig = - config['inputLayers'] as serialization.ConfigDict[]; - for (const layerData of inputLayersFromConfig) { - const layerName = layerData[0] as string; - const nodeIndex = layerData[1] as number; - const tensorIndex = layerData[2] as number; - generic_utils.assert(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - inputTensors.push(layerOutputTensors[tensorIndex]); - } - const outputLayersFromConfig = - config['outputLayers'] as serialization.ConfigDict[]; - for (const layerData of outputLayersFromConfig) { - const layerName = layerData[0] as string; - const nodeIndex = layerData[1] as number; - const tensorIndex = layerData[2] as number; - generic_utils.assert(layerName in createdLayers); - const layer = createdLayers[layerName]; - const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; - outputTensors.push(layerOutputTensors[tensorIndex]); - } - return new cls({inputs: inputTensors, outputs: outputTensors, name}); - } - - /** - * Determine whether the container is stateful. - * - * Porting Note: this is the equivalent of the stateful @property of - * the Container class in PyKeras. - */ - get stateful(): boolean { - // Porting Note: This check is to prevent inadvertent setting of the - // _stateful property of the Container instance. - if (this._stateful) { - throw new ValueError( - 'Container instance unexpectedly has _stateful = true. The ' + - 'statefulness of a Container is determined by the Layers it ' + - 'contains. Its _stateful property must remain the default false.'); - } - for (const layer of this.layers) { - if (layer.stateful) { - return true; - } - } - return false; - } - - /** - * Reset the state of all stateful constituent layers (if any). - * - * Examples of stateful layers include RNN layers whose `stateful` property - * is set as `true`. - */ - resetStates() { - tidy(() => { - this.layers.forEach(layer => { - // tslint:disable:no-any - if (layer.stateful) { - layer.resetStates(); - } - // tslint:enable:no-any - }); - }); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_fakes.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_fakes.ts deleted file mode 100644 index 222a89353..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_fakes.ts +++ /dev/null @@ -1,245 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import * as tfc from '@tensorflow/tfjs-core'; - -import {Shape} from '../keras_format/common'; -import {TensorOrArrayOrMap} from '../types'; - -import {Dataset, LazyIterator} from './dataset_stub'; -import {FitDatasetElement} from './training_dataset'; - -export interface FakeDatasetArgs { - /** - * The shape(s) of the features of a single example. - * - * Use an object mapping name to shape, if more than one feature tensors - * are required. - */ - xShape: Shape|{[name: string]: Shape}; - - /** - * The shape of the target(s) of a single exapmle. - */ - yShape: Shape|{[name: string]: Shape}; - - /** - * A function that generates preset sequence of X tensors. - * - * This function is invoked each time a new iterator is created. - */ - xTensorsFunc?: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]}; - - /** - * A function that generates preset sequence of Y tensors. - * - * This function is invoked each time a new iterator is created. - */ - yTensorsFunc?: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]}; - - /** - * The size of each batch generated by the iterator. - */ - batchSize: number; - - /** - * The number of batches an iterator generates before declaring done to be - * true. - */ - numBatches: number; -} - -function mergeBatchSizeAndShape( - batchSize: number, shape: Shape|{[name: string]: Shape}): Shape| - {[name: string]: Shape} { - if (Array.isArray(shape)) { - return [batchSize].concat(shape); - } else { - const output: {[name: string]: Shape} = {}; - for (const name in shape) { - output[name] = [batchSize].concat(shape[name]); - } - return output; - } -} - -function generateRandomTensorContainer(shape: Shape|{[name: string]: Shape}): - tfc.Tensor|{[name: string]: tfc.Tensor} { - let output: tfc.Tensor|{[name: string]: tfc.Tensor}; - if (Array.isArray(shape)) { - output = tfc.randomNormal(shape); - } else { - output = {}; - for (const name in shape) { - output[name] = tfc.randomNormal(shape[name]); - } - } - return output; -} - -class FakeNumericIterator extends LazyIterator { - private xBatchShape: Shape|{[name: string]: Shape}; - private yBatchShape: Shape|{[name: string]: Shape}; - private numBatches: number; - private batchCount: number; - private xTensorsFunc: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]}; - private yTensorsFunc: () => tfc.Tensor[] | {[name: string]: tfc.Tensor[]}; - private xTensorValues: tfc.Tensor[]|{[name: string]: tfc.Tensor[]}; - private yTensorValues: tfc.Tensor[]|{[name: string]: tfc.Tensor[]}; - private tensorIndex = 0; - - constructor(args: FakeDatasetArgs) { - super(); - this.xBatchShape = mergeBatchSizeAndShape(args.batchSize, args.xShape); - this.yBatchShape = mergeBatchSizeAndShape(args.batchSize, args.yShape); - this.numBatches = args.numBatches; - this.batchCount = 0; - this.xTensorsFunc = args.xTensorsFunc; - this.yTensorsFunc = args.yTensorsFunc; - - // Sanity check on the preset tensors. - tfc.util.assert( - this.xTensorsFunc == null && this.yTensorsFunc == null || - this.xTensorsFunc != null && this.yTensorsFunc != null, - () => 'presetXTensors and presetYTensors must be both null/undefined ' + - 'or both set.'); - } - - async next(): Promise> { - const done = ++this.batchCount > this.numBatches; - if (done) { - return {done, value: null}; - } - if (this.xTensorsFunc == null) { - // Generate data randomly. - return { - done, - value: done ? null : { - xs: generateRandomTensorContainer(this.xBatchShape), - ys: generateRandomTensorContainer(this.yBatchShape) - } - }; - } else { - // Use preset tensors. - if ((this.batchCount - 1) % this.numBatches === 0) { - this.xTensorValues = this.xTensorsFunc(); - this.yTensorValues = this.yTensorsFunc(); - this.tensorIndex = 0; - } - const index = this.tensorIndex++; - - let xs: tfc.Tensor|{[name: string]: tfc.Tensor}; - if (Array.isArray(this.xTensorValues)) { - xs = this.xTensorValues[index]; - tfc.util.assert( - tfc.util.arraysEqual(xs.shape, this.xBatchShape as Shape), - () => `Shape mismatch: expected: ${ - JSON.stringify(this.xBatchShape)}; ` + - `actual: ${JSON.stringify((xs as tfc.Tensor).shape)}`); - } else { - xs = {}; - for (const key in this.xTensorValues) { - xs[key] = this.xTensorValues[key][index]; - tfc.util.assert( - tfc.util.arraysEqual(xs[key].shape, this.xBatchShape as Shape), - () => `Shape mismatch: expected: ${ - JSON.stringify(this.xBatchShape)}; ` + - `actual: ${JSON.stringify((xs as tfc.Tensor).shape)}`); - } - } - - let ys: tfc.Tensor|{[name: string]: tfc.Tensor}; - if (Array.isArray(this.yTensorValues)) { - // Get preset ys tensors for single-output models. - ys = this.yTensorValues[index]; - tfc.util.assert( - tfc.util.arraysEqual(ys.shape, this.yBatchShape as Shape), - () => `Shape mismatch: expected: ${ - JSON.stringify(this.yBatchShape)}; ` + - `actual: ${JSON.stringify((ys as tfc.Tensor).shape)}`); - } else { - // Get preset ys tensors for multi-output models. - ys = {}; - this.yBatchShape = this.yBatchShape as {[name: string]: Shape}; - for (const key in this.yTensorValues) { - ys[key] = this.yTensorValues[key][index]; - tfc.util.assert( - tfc.util.arraysEqual(ys[key].shape, this.yBatchShape[key]), - () => `Shape mismatch: expected: ${ - JSON.stringify(this.yBatchShape)}; ` + - `actual: ${ - JSON.stringify( - (ys as {[name: string]: tfc.Tensor})[key].shape)}`); - } - } - - return {done, value: {xs, ys}}; - } - } -} - -/** - * A fake dataset with configurable feature and target shapes. - * - * The batch size and # of batches are also configurable. - * - * The iterator from the dataset always generate random-normal float32 values. - */ -export class FakeNumericDataset extends Dataset { - constructor(readonly args: FakeDatasetArgs) { - super(); - tfc.util.assert( - args.batchSize > 0 && Number.isInteger(args.batchSize), - () => - `batchSize must be a positive integer, but got ${args.batchSize}`); - tfc.util.assert( - args.numBatches > 0 && Number.isInteger(args.numBatches), - () => - `numBatches must be positive integer, but got ${args.numBatches}`); - this.size = args.numBatches; - } - - async iterator(): Promise> { - return new FakeNumericIterator(this.args); - } -} - -// We can't use Dataset.map(...) because we don't depend on tfjs-data here, -// so we manually transform the above {xs, ys} dataset to the [xs, ys] form. -export class FakeNumericDatasetLegacyArrayForm extends - Dataset<[TensorOrArrayOrMap, TensorOrArrayOrMap]> { - ds: FakeNumericDataset; - constructor(readonly args: FakeDatasetArgs) { - super(); - this.ds = new FakeNumericDataset(args); - } - - async iterator(): - Promise> { - const it = await this.ds.iterator(); - return new FakeNumericIteratorLegacyArrayForm(it); - } -} - -class FakeNumericIteratorLegacyArrayForm extends - LazyIterator<[TensorOrArrayOrMap, TensorOrArrayOrMap]> { - constructor(private readonly it: LazyIterator) { - super(); - } - - async next(): - Promise> { - const result = await this.it.next(); - return { - done: result.done, - value: result.value == null ? null : [result.value.xs, result.value.ys] - }; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_stub.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_stub.ts deleted file mode 100644 index 5546c7af0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/dataset_stub.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Stub interfaces and classes for testing tf.LayersModel.fitDataset(). - * - * TODO(cais, soergel): Remove this in favor of actual interfaces and classes - * when ready. - */ - -export abstract class LazyIterator { - abstract next(): Promise>; -} - -export abstract class Dataset { - abstract iterator(): Promise>; - size: number; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts deleted file mode 100644 index 8ad907203..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts +++ /dev/null @@ -1,531 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Executor: Evaluates SymbolicTensor based on feeds. - */ - -import {cast, dispose, memory, Tensor, util} from '@tensorflow/tfjs-core'; - -import {ValueError} from '../errors'; -import {Kwargs} from '../types'; -import {toList} from '../utils/generic_utils'; - -import {InputLayer} from './input_layer'; -import {SymbolicTensor} from './topology'; - -/** - * Helper function to check the dtype and shape compatibility of a feed value. - */ -function assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor { - // Check dtype compatibility. - if (key.dtype == null || key.dtype === val.dtype) { - // a. If types match, return val tensor as is. - return val; - } - try { - // b. Attempt to convert to expected type. - return cast(val, key.dtype); - } catch (err) { - // c. If conversion fails, return helpful error. - throw new ValueError( - `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` + - `of the key '${key.name}' (${key.dtype}).`); - } -} - -/** - * A concrete Tensor value for a symbolic tensor as the key. - */ -export interface Feed { - key: SymbolicTensor; - value: Tensor; -} - -/** - * FeedDict: A mapping from unique SymbolicTensors to feed values for them. - * A feed value is a concrete value represented as an `Tensor`. - */ -export class FeedDict { - private id2Value: {[id: number]: Tensor} = {}; - private id2Mask: {[id: number]: Tensor} = {}; - private name2Id: {[name: string]: number} = {}; - - /** - * Constructor, optionally does copy-construction. - * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case - * copy-construction will be performed. - */ - constructor(feeds?: Feed[]|FeedDict) { - if (feeds instanceof FeedDict) { - for (const id in feeds.id2Value) { - this.id2Value[id] = feeds.id2Value[id]; - if (id in feeds.id2Mask) { - this.id2Mask[id] = feeds.id2Mask[id]; - } - } - } else { - if (feeds == null) { - return; - } - for (const feed of feeds) { - this.add(feed.key, feed.value); - } - } - } - - /** - * Add a key-value pair to the FeedDict. - * - * @param key The key of the feed. - * @param value The value of the tensor feed. - * @param mask The value of the mask feed (optional). - * @returns This `FeedDict`. - * @throws ValueError: If the key `SymbolicTensor` already exists in the - * `FeedDict`. - */ - add(key: SymbolicTensor, value: Tensor, mask?: Tensor): FeedDict { - if (this.id2Value[key.id] == null) { - this.id2Value[key.id] = assertFeedCompatibility(key, value); - this.name2Id[key.name] = key.id; - if (mask != null) { - this.id2Mask[key.id] = mask; - } - } else { - throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`); - } - return this; - } - - /** - * Add a Feed to the FeedDict. - * @param feed The new `Feed` to add. - * @returns This `FeedDict`. - */ - addFeed(feed: Feed) { - this.add(feed.key, feed.value); - } - - /** - * Probe whether a key already exists in the FeedDict. - * @param key - */ - hasKey(key: SymbolicTensor): boolean { - return this.id2Value[key.id] != null; - } - - /** - * Get all the SymbolicTensor available in this FeedDict. - */ - names(): string[] { - return Object.keys(this.name2Id); - } - - /** - * Get the feed value for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed value. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getValue(key: SymbolicTensor|string): Tensor { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } else { - return this.id2Value[key.id]; - } - } else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Value[id]; - } - } - - /** - * Get the feed mask for given key. - * @param key The SymbolicTensor, or its name (as a string), of which the - * value is sought. - * @returns If `key` exists, the corresponding feed mask. - * @throws ValueError: If `key` does not exist in this `FeedDict`. - */ - getMask(key: SymbolicTensor|string): Tensor { - if (key instanceof SymbolicTensor) { - if (this.id2Value[key.id] == null) { - throw new ValueError(`Nonexistent key: ${key.name}`); - } else { - return this.id2Mask[key.id]; - } - } else { - const id = this.name2Id[key]; - if (id == null) { - throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); - } - return this.id2Mask[id]; - } - } - - /** Dispose all mask Tensors held by this object. */ - disposeMasks() { - if (this.id2Mask != null) { - dispose(this.id2Mask); - } - } -} - -// Cache for topologically sorted SymbolicTensors for given execution -// targets (i.e., fetches). -const cachedSorted: {[concatFetchNames: string]: SymbolicTensor[]} = {}; - -// Cache for recipient count maps for given execution targets (i.e., fetches). -const cachedRecipientCounts: - {[concatFetchNames: string]: {[fetchName: string]: number}} = {}; - -/** - * Interface for the optional object used for probing the memory - * usage and other statistics during execution. - */ -export interface ExecutionProbe { - /** - * Maximum number of tensors that exist during all steps of the - * execution. Tensor counts are measured at the beginning of every - * step. - */ - maxNumTensors?: number; - - /** - * Minimum number of tensors that exist during all steps of the - * execution. Tensor counts are measured at the beginning of every - * step. - */ - minNumTensors?: number; -} - -/** - * Execute a SymbolicTensor by using concrete feed values. - * - * A `SymbolicTensor` object is a node in a computation graph of TF.js - * Layers. The object is backed by a source layer and input - * `SymbolicTensor`s to the source layer. This method evaluates - * the `call()` method of the source layer, using concrete values of the - * inputs obtained from either - * * `feedDict`, if the input key exists in `feedDict`, or else, - * * a recursive call to `execute()` itself. - * - * @param x: The `SymbolicTensor` to execute. - * @param feedDict: The feed values, as base condition of the recursion. - * execution. - * @param kwargs: Optional keyword arguments. - * @param probe: A probe object (of interface `ExecutionProbe`) used for - * testing memory footprint of `execute` calls. - * @returns Result of the execution. - * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s - * encountered during the execution lacks a feed value in `feedDict`. - */ -export function execute( - fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict, - kwargs?: Kwargs, probe?: ExecutionProbe): Tensor| - Tensor[]|[Tensor | Tensor[]] { - const training: boolean = kwargs == null ? false : kwargs['training']; - - const arrayFetches = Array.isArray(fetches); - const fetchArray: SymbolicTensor[] = - arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor]; - - const outputNames = fetchArray.map(t => t.name); - const finalOutputs: Tensor[] = []; - const feedNames = feedDict.names(); - for (const outputName of outputNames) { - if (feedNames.indexOf(outputName) !== -1) { - finalOutputs.push(feedDict.getValue(outputName)); - } else { - finalOutputs.push(null); - } - } - - if (probe != null) { - // For optional probing of memory footprint during execution. - probe.maxNumTensors = -Infinity; - probe.minNumTensors = Infinity; - } - - // Check cache. - const fetchAndFeedKey = - outputNames.join(',') + '|' + feedDict.names().join(','); - let sorted: SymbolicTensor[]; - let recipientCounts: {[fetchName: string]: number}; - if (cachedSorted[fetchAndFeedKey] == null) { - // Cache doesn't contain the desired combination of fetches. Compute - // topological sort for the combination for the first time. - const out = getTopologicalSortAndRecipientCounts(fetchArray, feedDict); - sorted = out.sorted; - recipientCounts = out.recipientCounts; - - // Store results in cache for future use. - cachedSorted[fetchAndFeedKey] = sorted; - cachedRecipientCounts[fetchAndFeedKey] = recipientCounts; - } - sorted = cachedSorted[fetchAndFeedKey]; - recipientCounts = {}; - if (!training) { - Object.assign(recipientCounts, cachedRecipientCounts[fetchAndFeedKey]); - } - - const internalFeedDict = new FeedDict(feedDict); - - // Start iterative execution on the topologically-sorted SymbolicTensors. - for (let i = 0; i < sorted.length; ++i) { - if (probe != null) { - // For optional probing of memory usage during execution. - const numTensors = memory().numTensors; - if (numTensors > probe.maxNumTensors) { - probe.maxNumTensors = numTensors; - } - if (numTensors < probe.minNumTensors) { - probe.minNumTensors = numTensors; - } - } - - const symbolic = sorted[i]; - const srcLayer = symbolic.sourceLayer; - if (srcLayer instanceof InputLayer) { - continue; - } - const inputValues: Tensor[] = []; - const inputMasks: Tensor[] = []; - const tensorsToDispose: Tensor[] = []; - - let maskExists = false; - for (const input of symbolic.inputs) { - const value = internalFeedDict.getValue(input); - const mask = internalFeedDict.getMask(input); - inputValues.push(value); - inputMasks.push(mask); - if (mask != null) { - maskExists = true; - } - if (!training) { - recipientCounts[input.name]--; - if (recipientCounts[input.name] === 0 && !feedDict.hasKey(input) && - outputNames.indexOf(input.name) === -1 && !value.isDisposed && - input.sourceLayer.stateful !== true) { - tensorsToDispose.push(value); - } - } - } - - if (maskExists) { - kwargs = kwargs || {}; - kwargs['mask'] = inputMasks[0]; - } - const outputTensors = - toList(srcLayer.apply(inputValues, kwargs)) as Tensor[]; - let outputMask: Tensor|Tensor[] = null; - if (srcLayer.supportsMasking) { - outputMask = srcLayer.computeMask(inputValues, inputMasks); - } - const layerOutputs = getNodeOutputs(symbolic); - const outputSymbolicTensors = - Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; - for (let i = 0; i < outputSymbolicTensors.length; ++i) { - if (!internalFeedDict.hasKey(outputSymbolicTensors[i])) { - internalFeedDict.add( - outputSymbolicTensors[i], outputTensors[i], - Array.isArray(outputMask) ? outputMask[0] : outputMask); - } - const index = outputNames.indexOf(outputSymbolicTensors[i].name); - if (index !== -1) { - finalOutputs[index] = outputTensors[i]; - } - } - - if (!training) { - // Clean up Tensors that are no longer needed. - dispose(tensorsToDispose); - } - } - // NOTE(cais): Unlike intermediate tensors, we don't discard mask - // tensors as we go, because these tensors are sometimes passed over a - // series of mutliple layers, i.e., not obeying the immediate input - // relations in the graph. If this becomes a memory-usage concern, - // we can improve this in the future. - internalFeedDict.disposeMasks(); - - return arrayFetches ? finalOutputs : finalOutputs[0]; -} - -type RecipientCounts = { - [fetchName: string]: number -}; - -export type RecipientMap = { - [fetchName: string]: Set; -}; - -/** - * Sort the `SymbolicTensor`s topologically, for an array of fetches. - * - * This function calls getTopologicalSortAndRecipientCountsForOneFetch and - * merges their results. - * - * @param fetch The array of fetches requested. Must be a non-empty array. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientCounts: Recipient counts for all SymbolicTensors in `sorted`. - */ -function getTopologicalSortAndRecipientCounts( - fetches: SymbolicTensor[], feedDict: FeedDict): - {sorted: SymbolicTensor[], recipientCounts: RecipientCounts} { - util.assert( - fetches != null && fetches.length > 0, - () => `Expected at least one fetch, got none`); - - let finalSorted: SymbolicTensor[] = []; - let finalRecipientMap: RecipientMap = {}; - if (fetches.length === 1) { - // Special-casing 1 fetch for efficiency. - const out = - getTopologicalSortAndRecipientCountsForOneFetch(fetches[0], feedDict); - finalSorted = out.sorted; - finalRecipientMap = out.recipientMap; - } else { - const visited = new Set(); - for (const fetch of fetches) { - const {sorted, recipientMap} = - getTopologicalSortAndRecipientCountsForOneFetch(fetch, feedDict); - - // Merge sorted SymbolicTensor Arrays. - for (const symbolicTensor of sorted) { - if (!visited.has(symbolicTensor.name)) { - finalSorted.push(symbolicTensor); - visited.add(symbolicTensor.name); - } - } - - // Merge recipient maps. - for (const name in recipientMap) { - if (finalRecipientMap[name] == null) { - finalRecipientMap[name] = new Set(); - } - recipientMap[name].forEach( - recipient => finalRecipientMap[name].add(recipient)); - } - } - } - return { - sorted: finalSorted, - recipientCounts: recipientMap2Counts(finalRecipientMap) - }; -} - -function recipientMap2Counts(recipientMap: RecipientMap): RecipientCounts { - const recipientCounts: RecipientCounts = {}; - for (const name in recipientMap) { - recipientCounts[name] = recipientMap[name].size; - } - return recipientCounts; -} - -/** - * Sort the `SymbolicTensor`s topologically, for a single fetch. - * - * This helper function processes the upstream SymbolicTensors of a single - * fetch. - * - * @param fetch The single fetch requested. - * @param feedDict The dictionary of fed values. - * @returns sorted: Topologically-sorted array of SymbolicTensors. - * recipientMap: Recipient names for all SymbolicTensors in `sorted`. - */ -export function getTopologicalSortAndRecipientCountsForOneFetch( - fetch: SymbolicTensor, feedDict: FeedDict): - {sorted: SymbolicTensor[], recipientMap: RecipientMap} { - const visited = new Set(); - const sorted: SymbolicTensor[] = []; - const recipientMap: RecipientMap = {}; - - // Put keys of the feedDict into visited first, so they don't have to be - // walked. This is needed in case where there are feeds for intermediate - // SymbolicTensors of the graph. - for (const key of feedDict.names()) { - visited.add(key); - } - - const stack: SymbolicTensor[] = []; - const marks: number[] = []; - - // Initial population of stack and marks. - stack.push(fetch); - - while (stack.length > 0) { - const top = stack[stack.length - 1]; - if (visited.has(top.name)) { - stack.pop(); - continue; - } - const topIsMarked = marks[marks.length - 1] === stack.length - 1; - if (top.inputs.length === 0 || topIsMarked) { - // Input SymbolicTensor or all children have been visited. - stack.pop(); - sorted.push(top); - visited.add(top.name); - if (topIsMarked) { - marks.pop(); - } - } else { - // A non-input SymbolicTensor whose upstream SymbolicTensors haven't - // been visited yet. Push them onto the stack. - marks.push(stack.length - 1); - for (const input of top.inputs) { - // Increment the recipient count. Note that this needs to happen - // regardless of whether the SymbolicTensor has been visited before. - if (recipientMap[input.name] == null) { - recipientMap[input.name] = new Set(); - } - recipientMap[input.name].add(top.name); - - if (visited.has(input.name)) { - continue; // Avoid repeated visits to the same SymbolicTensor. - } - stack.push(input); - } - } - } - return {sorted, recipientMap}; -} - -/** - * Get the symbolic output tensors of the node to which a given fetch belongs. - * @param fetch The fetched symbolic tensor. - * @returns The Array of symbolic tensors output by the node to which `fetch` - * belongs. - */ -function getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor| - SymbolicTensor[] { - let layerOutputs: SymbolicTensor|SymbolicTensor[]; - if (fetch.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch.sourceLayer.output; - } else { - let nodeIndex: number = null; - for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { - for (const outputTensor of fetch.sourceLayer.inboundNodes[i] - .outputTensors) { - if (outputTensor.id === fetch.id) { - nodeIndex = i; - break; - } - } - } - layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); - } - return layerOutputs; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts deleted file mode 100644 index 682ee009a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataType, serialization, Tensor} from '@tensorflow/tfjs-core'; - -import {getUid} from '../backend/state'; -import {ValueError} from '../errors'; -import {Shape} from '../keras_format/common'; -import {Kwargs} from '../types'; - -import {DisposeResult, Layer, Node, SymbolicTensor} from './topology'; - -/** - * Constructor arguments for InputLayer. - * - * Note: You should provide only inputShape or batchInputShape (not both). - * If only inputShape is provided, then the batchInputShape is determined by - * the batchSize argument and the inputShape: [batchSize].concat(inputShape). - */ -export declare interface InputLayerArgs { - /** Input shape, not including the batch axis. */ - inputShape?: Shape; - /** Optional input batch size (integer or null). */ - batchSize?: number; - /** Batch input shape, including the batch axis. */ - batchInputShape?: Shape; - /** Datatype of the input. */ - dtype?: DataType; - /** - * Whether the placeholder created is meant to be sparse. - */ - sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this. - - /** Name of the layer. */ - name?: string; -} - -export class InputLayer extends Layer { - /** @nocollapse */ - static readonly className = 'InputLayer'; - sparse: boolean; - constructor(args: InputLayerArgs) { - super({ - dtype: args.dtype, - name: args.name != null ? args.name : getUid('input').toString() - }); - // Normalize config.batchSize and config.sparse - if (args.batchSize == null) { - args.batchSize = null; - } - if (args.sparse == null) { - args.sparse = false; - } - - this.trainable = false; - this.built = true; - this.sparse = args.sparse; - - if (args.inputShape != null && args.batchInputShape != null) { - throw new ValueError( - 'Only provide the inputShape OR ' + - 'batchInputShape argument to inputLayer, not both at the same time.'); - } - let batchInputShape = args.batchInputShape; - if (batchInputShape == null) { - if (args.inputShape == null) { - throw new ValueError( - 'An InputLayer should be passed either a ' + - '`batchInputShape` or an `inputShape`.'); - } else { - batchInputShape = [args.batchSize].concat(args.inputShape); - } - } else { - // TODO(michaelterry): Backport to PyKeras - if (args.batchSize != null) { - throw new ValueError( - 'Cannot specify batchSize if batchInputShape is ' + - 'specified when creating an InputLayer.'); - } - } - - const dtype = args.dtype || 'float32'; - - this.batchInputShape = batchInputShape; - this.dtype = dtype; - // TODO(michaelterry): Backport this to PyKeras? - this.inputSpec = [{shape: batchInputShape}]; - - const inputTensor = new SymbolicTensor( - this.dtype, this.batchInputShape, this, [], {}, this.name); - inputTensor.nodeIndex = 0; - inputTensor.tensorIndex = 0; - - // Create an input node to add to this.outboundNode. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: [inputTensor], - outputTensors: [inputTensor], - inputMasks: [null], - outputMasks: [null], - inputShapes: [batchInputShape], - outputShapes: [batchInputShape] - }); - } - - apply( - inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor { - throw new ValueError( - 'Cannot pass any input to an ' + - `InputLayer's apply() method. InputLayer name: ${this.name}`); - } - - dispose(): DisposeResult { - // dispose() for InputLayer is overridden as no-op. - return {refCountAfterDispose: this._refCount, numDisposedVariables: 0}; - } - - getConfig(): serialization.ConfigDict { - return { - batchInputShape: this.batchInputShape, - dtype: this.dtype, - sparse: this.sparse, - name: this.name - }; - } -} -serialization.registerClass(InputLayer); - -/** - * Config for the Input function. - * - * Note: You should provide only shape or batchShape (not both). - * If only shape is provided, then the batchShape becomes - * [null].concat(inputShape). - */ -export interface InputConfig { - /** - * A shape, not including the batch size. For instance, `shape=[32]` - * indicates that the expected input will be batches of 32-dimensional - * vectors. - */ - shape?: Shape; - /** - * A shape tuple (integer), including the batch size. For instance, - * `batchShape=[10, 32]` indicates that the expected input will be batches of - * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an - * arbitrary number of 32-dimensional vectors. - */ - batchShape?: Shape; - /** - * An optional name string for the layer. Should be unique in a model (do not - * reuse the same name twice). It will be autogenerated if it isn't provided. - */ - name?: string; - dtype?: DataType; - /** - * A boolean specifying whether the placeholder to be created is sparse. - */ - sparse?: boolean; -} - -export function Input(config: InputConfig): SymbolicTensor { - if (config.batchShape == null && config.shape == null) { - throw new Error( - 'Please provide to Input either a `shape`' + - ' or a `batchShape` argument. Note that ' + - '`shape` does not include the batch ' + - 'dimension.'); - } - if (config.batchShape != null && config.shape != null) { - // TODO(michaelterry): Backport to PyKeras. - throw new ValueError( - 'Please provide either a `shape` or `batchShape` ' + - 'argument to Input, but not both.'); - } - let batchShape = config.batchShape; - if (config.shape != null && batchShape == null) { - batchShape = [null].concat(config.shape); - } - - let dtype = config.dtype; - if (dtype == null) { - dtype = 'float32'; - } - - const inputLayer = new InputLayer({ - batchInputShape: batchShape, - name: config.name, - dtype, - sparse: config.sparse - }); - - const outputs = inputLayer.inboundNodes[0].outputTensors; - return outputs[0]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts deleted file mode 100644 index f1007bcc0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts +++ /dev/null @@ -1,1643 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: keras/engine/topology.py */ - -import {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core'; - -import {getNextUniqueTensorId, getUid} from '../backend/state'; -import {getScopedTensorName, getUniqueTensorName, nameScope} from '../common'; -import {Constraint} from '../constraints'; -import {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors'; -import {getInitializer, Initializer} from '../initializers'; -import {Shape} from '../keras_format/common'; -import {Regularizer} from '../regularizers'; -import {Kwargs, RegularizerFn} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import * as types_utils from '../utils/types_utils'; -import * as variable_utils from '../utils/variable_utils'; -import {batchGetValue, batchSetValue, LayerVariable} from '../variables'; - -// TODO(michaelterry): This is a stub until it's defined. -export type Op = (x: LayerVariable) => LayerVariable; - -/** - * Constructor arguments for InputSpec. - */ -export interface InputSpecArgs { - /** Expected datatype of the input. */ - dtype?: DataType; - /** Expected shape of the input (may include null for unchecked axes). */ - shape?: Shape; - /** Expected rank of the input. */ - ndim?: number; - /** Maximum rank of the input. */ - maxNDim?: number; - /** Minimum rank of the input. */ - minNDim?: number; - /** Dictionary mapping integer axes to a specific dimension value. */ - axes?: {[axis: number]: number}; -} - -/** - * Specifies the ndim, dtype and shape of every input to a layer. - * - * Every layer should expose (if appropriate) an `inputSpec` attribute: - * a list of instances of InputSpec (one per input tensor). - * - * A null entry in a shape is compatible with any dimension, - * a null shape is compatible with any shape. - */ -export class InputSpec { - /** Expected datatype of the input. */ - dtype?: DataType; - /** Expected shape of the input (may include null for unchecked axes). */ - shape?: Shape; - /** Expected rank of the input. */ - ndim?: number; - /** Maximum rank of the input. */ - maxNDim?: number; - /** Minimum rank of the input. */ - minNDim?: number; - /** Dictionary mapping integer axes to a specific dimension value. */ - axes?: {[axis: number]: number}; - - constructor(args: InputSpecArgs) { - this.dtype = args.dtype; - this.shape = args.shape; - /* - TODO(michaelterry): Could throw error if ndim and shape are both defined - (then backport). - */ - if (args.shape != null) { - this.ndim = args.shape.length; - } else { - this.ndim = args.ndim; - } - this.maxNDim = args.maxNDim; - this.minNDim = args.minNDim; - this.axes = args.axes || {}; - } -} - -/** - * `tf.SymbolicTensor` is a placeholder for a Tensor without any concrete value. - * - * They are most often encountered when building a graph of `Layer`s for a - * a `tf.LayersModel` and the input data's shape, but not values are known. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ -export class SymbolicTensor { - /* A unique ID for the tensor to be able to differentiate tensors. */ - readonly id: number; - // The fully scoped name of this Variable, including a unique suffix if needed - readonly name: string; - // The originally requested fully scoped name of this Variable, not including - // any unique suffix. This may be needed when restoring weights because this - // original name is used as a key. - readonly originalName?: string; - /** - * Rank/dimensionality of the tensor. - */ - readonly rank: number; - /** - * Replacement for _keras_history. - */ - nodeIndex: number; - /** - * Replacement for _keras_history. - */ - tensorIndex: number; - - /** - * - * @param dtype - * @param shape - * @param sourceLayer The Layer that produced this symbolic tensor. - * @param inputs The inputs passed to sourceLayer's __call__() method. - * @param nodeIndex - * @param tensorIndex - * @param callArgs The keyword arguments passed to the __call__() method. - * @param name - * @param outputTensorIndex The index of this tensor in the list of outputs - * returned by apply(). - */ - constructor( - readonly dtype: DataType, readonly shape: Shape, - public sourceLayer: Layer, readonly inputs: SymbolicTensor[], - readonly callArgs: Kwargs, name?: string, - readonly outputTensorIndex?: number) { - this.id = getNextUniqueTensorId(); - if (name != null) { - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - } - this.rank = shape.length; - } -} - -/** - * Constructor arguments for Node. - */ -export interface NodeArgs { - /** - * The layer that takes `inputTensors` and turns them into `outputTensors`. - * (the node gets created when the `call` method of the layer is called). - */ - outboundLayer: Layer; - /** - * A list of layers, the same length as `inputTensors`, the layers from where - * `inputTensors` originate. - */ - inboundLayers: Layer[]; - /** - * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is - * the origin node of `inputTensors[i]` (necessary since each inbound layer - * might have several nodes, e.g. if the layer is being shared with a - * different data stream). - */ - nodeIndices: number[]; - /** - * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]` - * is the index of `inputTensors[i]` within the output of the inbound layer - * (necessary since each inbound layer might have multiple tensor outputs, - * with each one being independently manipulable). - */ - tensorIndices: number[]; - /** List of input tensors. */ - inputTensors: SymbolicTensor[]; - /** List of output tensors. */ - outputTensors: SymbolicTensor[]; - /** List of input masks (a mask can be a tensor, or null). */ - inputMasks: Tensor[]; - /** List of output masks (a mask can be a tensor, or null). */ - outputMasks: Tensor[]; - /** List of input shape tuples. */ - inputShapes: Shape|Shape[]; - /** List of output shape tuples. */ - outputShapes: Shape|Shape[]; -} - -/** - * The type of the return value of Layer.dispose() and Container.dispose(). - */ -export interface DisposeResult { - /** - * Reference count after the dispose call. - */ - refCountAfterDispose: number; - - /** - * Number of variables dispose in this dispose call. - */ - numDisposedVariables: number; -} - -let _nextNodeID = 0; - -/** - * A `Node` describes the connectivity between two layers. - * - * Each time a layer is connected to some new input, - * a node is added to `layer.inboundNodes`. - * - * Each time the output of a layer is used by another layer, - * a node is added to `layer.outboundNodes`. - * - * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates - * describing the origin of the `inputTensors`, verifying the following: - * - * `inputTensors[i] == - * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[ - * tensorIndices[i]]` - * - * A node from layer A to layer B is added to: - * A.outboundNodes - * B.inboundNodes - */ -export class Node { - /** - * The layer that takes `inputTensors` and turns them into `outputTensors` - * (the node gets created when the `call` method of the layer is called). - */ - outboundLayer: Layer; - /** - * A list of layers, the same length as `inputTensors`, the layers from where - * `inputTensors` originate. - */ - inboundLayers: Layer[]; - /** - * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is - * the origin node of `inputTensors[i]` (necessary since each inbound layer - * might have several nodes, e.g. if the layer is being shared with a - * different data stream). - */ - nodeIndices: number[]; - /** - * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]` - * is the index of `inputTensors[i]` within the output of the inbound layer - * (necessary since each inbound layer might have multiple tensor outputs, - * with each one being independently manipulable). - */ - tensorIndices: number[]; - /** List of input tensors. */ - inputTensors: SymbolicTensor[]; - /** List of output tensors. */ - outputTensors: SymbolicTensor[]; - /** List of input masks (a mask can be a tensor, or null). */ - inputMasks: Tensor[]; - /** List of output masks (a mask can be a tensor, or null). */ - outputMasks: Tensor[]; - /** List of input shape tuples. */ - inputShapes: Shape|Shape[]; - /** List of output shape tuples. */ - outputShapes: Shape|Shape[]; - - readonly id: number; - - constructor( - args: NodeArgs, - // TODO(michaelterry): Define actual type for this. - public callArgs?: Kwargs) { - this.id = _nextNodeID++; - /* - Layer instance (NOT a list). - this is the layer that takes a list of input tensors - and turns them into a list of output tensors. - the current node will be added to - the inboundNodes of outboundLayer. - */ - this.outboundLayer = args.outboundLayer; - - /* - The following 3 properties describe where - the input tensors come from: which layers, - and for each layer, which node and which - tensor output of each node. - */ - - // List of layer instances. - this.inboundLayers = args.inboundLayers; - // List of integers, 1:1 mapping with inboundLayers. - this.nodeIndices = args.nodeIndices; - // List of integers, 1:1 mapping with inboundLayers. - this.tensorIndices = args.tensorIndices; - - /* - Following 2 properties: - tensor inputs and outputs of outboundLayer. - */ - - // List of tensors. 1:1 mapping with inboundLayers. - this.inputTensors = args.inputTensors; - // List of tensors, created by outboundLayer.call(). - this.outputTensors = args.outputTensors; - - /* - Following 2 properties: input and output masks. - List of tensors, 1:1 mapping with inputTensor. - */ - this.inputMasks = args.inputMasks; - // List of tensors, created by outboundLayer.computeMask(). - this.outputMasks = args.outputMasks; - - // Following 2 properties: input and output shapes. - - // List of shape tuples, shapes of inputTensors. - this.inputShapes = args.inputShapes; - // List of shape tuples, shapes of outputTensors. - this.outputShapes = args.outputShapes; - - // Add nodes to all layers involved. - for (const layer of args.inboundLayers) { - if (layer != null) { - layer.outboundNodes.push(this); - } - } - args.outboundLayer.inboundNodes.push(this); - } - - getConfig(): serialization.ConfigDict { - const inboundNames: string[] = []; - for (const layer of this.inboundLayers) { - if (layer != null) { - inboundNames.push(layer.name); - } else { - inboundNames.push(null); - } - } - return { - outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, - inboundLayers: inboundNames, - nodeIndices: this.nodeIndices, - tensorIndices: this.tensorIndices - }; - } -} - -/** Constructor arguments for Layer. */ -export declare interface LayerArgs { - /** - * If defined, will be used to create an input layer to insert before this - * layer. If both `inputShape` and `batchInputShape` are defined, - * `batchInputShape` will be used. This argument is only applicable to input - * layers (the first layer of a model). - */ - inputShape?: Shape; - /** - * If defined, will be used to create an input layer to insert before this - * layer. If both `inputShape` and `batchInputShape` are defined, - * `batchInputShape` will be used. This argument is only applicable to input - * layers (the first layer of a model). - */ - batchInputShape?: Shape; - /** - * If `inputShape` is specified and `batchInputShape` is *not* specified, - * `batchSize` is used to construct the `batchInputShape`: `[batchSize, - * ...inputShape]` - */ - batchSize?: number; - /** - * The data-type for this layer. Defaults to 'float32'. - * This argument is only applicable to input layers (the first layer of a - * model). - */ - dtype?: DataType; - /** Name for this layer. */ - name?: string; - /** - * Whether the weights of this layer are updatable by `fit`. - * Defaults to true. - */ - trainable?: boolean; - /** - * Initial weight values of the layer. - */ - weights?: Tensor[]; - /** Legacy support. Do not use for new code. */ - inputDType?: DataType; -} - -// If necessary, add `output` arguments to the CallHook function. -// This is currently used for testing only, but may be used for debugger-related -// purposes in the future. -export type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void; - -let _nextLayerID = 0; - -/** - * A layer is a grouping of operations and weights that can be composed to - * create a `tf.LayersModel`. - * - * Layers are constructed by using the functions under the - * [tf.layers](#Layers-Basic) namespace. - * - * @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} - */ -export abstract class Layer extends serialization.Serializable { - /** Name for this layer. Must be unique within a model. */ - name: string; - /** - * List of InputSpec class instances. - * - * Each entry describes one required input: - * - ndim - * - dtype - * A layer with `n` input tensors must have an `inputSpec` of length `n`. - */ - inputSpec: InputSpec[]; - supportsMasking: boolean; - /** Whether the layer weights will be updated during training. */ - protected trainable_: boolean; - batchInputShape: Shape; - dtype: DataType; - initialWeights: Tensor[]; - - inboundNodes: Node[]; - outboundNodes: Node[]; - - activityRegularizer: Regularizer; - - protected _trainableWeights: LayerVariable[]; - private _nonTrainableWeights: LayerVariable[]; - private _losses: RegularizerFn[]; - // TODO(cais): _updates is currently unused. - private _updates: Tensor[]; - private _built: boolean; - private _callHook: CallHook = null; - - private _addedWeightNames: string[] = []; - - readonly id: number; - - // Porting Notes: PyKeras does not have this property in this base Layer - // class. Instead lets Layer subclass set it dynamically and checks the - // value with `hasattr`. In tfjs-layers, we let this be a member of this - // base class. - protected _stateful = false; - - protected _refCount: number|null; - - // A flag for whether fast (i.e., all-zero) weight initialization is to - // be used during `build()` call. This speeds up weight initialization - // by saving unnecessary calls to expensive initializers in cases where - // the initialized values will be overwritten by loaded weight values - // during model loading. - private fastWeightInitDuringBuild: boolean; - - constructor(args: LayerArgs = {}) { - super(); - this.id = _nextLayerID++; - - this.activityRegularizer = null; - - this.inputSpec = null; - this.supportsMasking = false; - - // These properties will be set upon call of this.build() - this._trainableWeights = []; - this._nonTrainableWeights = []; - this._losses = []; - this._updates = []; - this._built = false; - - /* - These lists will be filled via successive calls - to this.addInboundNode(). - */ - this.inboundNodes = []; - this.outboundNodes = []; - - let name = args.name; - if (!name) { - const prefix = this.getClassName(); - name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix); - } - this.name = name; - - this.trainable_ = args.trainable == null ? true : args.trainable; - - if (args.inputShape != null || args.batchInputShape != null) { - /* - In this case we will later create an input layer - to insert before the current layer - */ - let batchInputShape: Shape; - if (args.batchInputShape != null) { - batchInputShape = args.batchInputShape; - } else if (args.inputShape != null) { - let batchSize: number = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - batchInputShape = [batchSize].concat(args.inputShape); - } - this.batchInputShape = batchInputShape; - - // Set dtype. - let dtype = args.dtype; - if (dtype == null) { - dtype = args.inputDType; - } - if (dtype == null) { - dtype = 'float32'; - } - this.dtype = dtype; - } - - if (args.weights != null) { - this.initialWeights = args.weights; - } else { - this.initialWeights = null; - } - - // The value of `_refCount` is initialized to null. When the layer is used - // in a symbolic way for the first time, it will be set to 1. - this._refCount = null; - - this.fastWeightInitDuringBuild = false; - } - - /** - * Converts a layer and its index to a unique (immutable type) name. - * This function is used internally with `this.containerNodes`. - * @param layer The layer. - * @param nodeIndex The layer's position (e.g. via enumerate) in a list of - * nodes. - * - * @returns The unique name. - */ - protected static nodeKey(layer: Layer, nodeIndex: number) { - return layer.name + '_ib-' + nodeIndex.toString(); - } - - /** - * Returns this.inboundNode at index nodeIndex. - * - * Porting note: This is a replacement for _get_node_attribute_at_index() - * @param nodeIndex - * @param attrName The name of the attribute related to request for this node. - */ - private getNodeAtIndex(nodeIndex: number, attrName: string): Node { - if (this.inboundNodes.length === 0) { - throw new RuntimeError( - 'The layer has never been called ' + - `and thus has no defined ${attrName}.`); - } - if (this.inboundNodes.length <= nodeIndex) { - throw new ValueError( - `Asked to get ${attrName} at node ${nodeIndex}, ` + - `but the layer has only ${this.inboundNodes.length} inbound nodes.`); - } - return this.inboundNodes[nodeIndex]; - } - - /** - * Retrieves the input tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple inputs). - */ - getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] { - return generic_utils.singletonOrArray( - this.getNodeAtIndex(nodeIndex, 'input').inputTensors); - } - - /** - * Retrieves the output tensor(s) of a layer at a given node. - * - * @param nodeIndex Integer, index of the node from which to retrieve the - * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer - * was called. - * - * @return A tensor (or list of tensors if the layer has multiple outputs). - */ - getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] { - return generic_utils.singletonOrArray( - this.getNodeAtIndex(nodeIndex, 'output').outputTensors); - } - - // Properties - - /** - * Retrieves the input tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Input tensor or list of input tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get input(): SymbolicTensor|SymbolicTensor[] { - if (this.inboundNodes.length > 1) { - throw new AttributeError( - `Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer input" ' + - 'is ill-defined. ' + - 'Use `getInputAt(nodeIndex)` instead.'); - } else if (this.inboundNodes.length === 0) { - throw new AttributeError( - `Layer ${this.name}` + - ' is not connected, no input to return.'); - } - return generic_utils.singletonOrArray( - this.getNodeAtIndex(0, 'input').inputTensors); - } - - /** - * Retrieves the output tensor(s) of a layer. - * - * Only applicable if the layer has exactly one inbound node, - * i.e. if it is connected to one incoming layer. - * - * @return Output tensor or list of output tensors. - * - * @exception AttributeError if the layer is connected to more than one - * incoming layers. - */ - get output(): SymbolicTensor|SymbolicTensor[] { - if (this.inboundNodes.length === 0) { - throw new AttributeError( - `Layer ${this.name}` + - ' has no inbound nodes.'); - } - if (this.inboundNodes.length > 1) { - throw new AttributeError( - `Layer ${this.name}` + - ' has multiple inbound nodes, ' + - 'hence the notion of "layer output" ' + - 'is ill-defined. ' + - 'Use `getOutputAt(nodeIndex)` instead.'); - } - return generic_utils.singletonOrArray( - this.getNodeAtIndex(0, 'output').outputTensors); - } - - get losses(): RegularizerFn[] { - return this._losses; - } - - /** - * Retrieves the Layer's current loss values. - * - * Used for regularizers during training. - */ - calculateLosses(): Scalar[] { - // Porting Node: This is an augmentation to Layer.loss in PyKeras. - // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete - // Tensor (specifically Scalar) values are returned. This is due to the - // imperative backend. - return this.losses.map(lossFn => lossFn()); - } - - get updates(): Tensor[] { - return this._updates; - } - - get built(): boolean { - return this._built; - } - - set built(built: boolean) { - this._built = built; - } - - get trainable(): boolean { - return this.trainable_; - } - - set trainable(trainable: boolean) { - this._trainableWeights.forEach(w => w.trainable = trainable); - this.trainable_ = trainable; - } - - get trainableWeights(): LayerVariable[] { - if (this.trainable_) { - return this._trainableWeights.filter(w => w.trainable); - } else { - return []; - } - } - - set trainableWeights(weights: LayerVariable[]) { - this._trainableWeights = weights; - } - - get nonTrainableWeights(): LayerVariable[] { - if (this.trainable) { - return this._trainableWeights.filter(w => !w.trainable) - .concat(this._nonTrainableWeights); - } else { - return this._trainableWeights.concat(this._nonTrainableWeights); - } - } - - set nonTrainableWeights(weights: LayerVariable[]) { - this._nonTrainableWeights = weights; - } - - /** - * The concatenation of the lists trainableWeights and nonTrainableWeights - * (in this order). - */ - get weights(): LayerVariable[] { - return this.trainableWeights.concat(this.nonTrainableWeights); - } - - get stateful(): boolean { - return this._stateful; - } - - /** - * Reset the states of the layer. - * - * This method of the base Layer class is essentially a no-op. - * Subclasses that are stateful (e.g., stateful RNNs) should override this - * method. - */ - resetStates(): void { - if (!this.stateful) { - throw new Error( - 'Cannot call the resetStates() method of a non-stateful Layer ' + - 'object.'); - } - } - - /** - * Checks compatibility between the layer and provided inputs. - * - * This checks that the tensor(s) `input` - * verify the input assumptions of the layer - * (if any). If not, exceptions are raised. - * - * @param inputs Input tensor or list of input tensors. - * - * @exception ValueError in case of mismatch between - * the provided inputs and the expectations of the layer. - */ - protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor| - SymbolicTensor[]): void { - inputs = generic_utils.toList(inputs); - if (this.inputSpec == null || this.inputSpec.length === 0) { - return; - } - const inputSpec = generic_utils.toList(this.inputSpec); - if (inputs.length !== inputSpec.length) { - throw new ValueError( - `Layer ${this.name} expects ${inputSpec.length} inputs, ` + - `but it received ${inputs.length} input tensors. ` + - `Input received: ${inputs}`); - } - for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) { - const x = inputs[inputIndex]; - const spec: InputSpec = inputSpec[inputIndex]; - if (spec == null) { - continue; - } - - // Check ndim. - const ndim = x.rank; - if (spec.ndim != null) { - if (ndim !== spec.ndim) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ${this.name}: ` + - `expected ndim=${spec.ndim}, found ndim=${ndim}`); - } - } - if (spec.maxNDim != null) { - if (ndim > spec.maxNDim) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`); - } - } - if (spec.minNDim != null) { - if (ndim < spec.minNDim) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ${this.name}` + - `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`); - } - } - - // Check dtype. - if (spec.dtype != null) { - if (x.dtype !== spec.dtype) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ${this.name} ` + - `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`); - } - } - - // Check specific shape axes. - if (spec.axes) { - const xShape = x.shape; - for (const key in spec.axes) { - const axis = Number(key); - const value = spec.axes[key]; - // Perform Python-style slicing in case axis < 0; - // TODO(cais): Use https://github.com/alvivi/typescript-underscore to - // ensure type safety through Underscore calls. - const xShapeAtAxis = - axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; - if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected axis ${axis} of input shape to ` + - `have value ${value} but got shape ${xShape}.`); - } - } - } - - // Check shape. - if (spec.shape != null) { - for (let i = 0; i < spec.shape.length; ++i) { - const specDim = spec.shape[i]; - const dim = x.shape[i]; - if (specDim != null && dim != null) { - if (specDim !== dim) { - throw new ValueError( - `Input ${inputIndex} is incompatible with layer ` + - `${this.name}: expected shape=${spec.shape}, ` + - `found shape=${x.shape}.`); - } - } - } - } - } - } - - /** - * This is where the layer's logic lives. - * - * @param inputs Input tensor, or list/tuple of input tensors. - * @param kwargs Additional keyword arguments. - * - * @return A tensor or list/tuple of tensors. - */ - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return inputs; - } - - protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) { - if (this._callHook != null) { - this._callHook(inputs, kwargs); - } - } - - /** - * Set call hook. - * This is currently used for testing only. - * @param callHook - */ - setCallHook(callHook: CallHook) { - this._callHook = callHook; - } - - /** - * Clear call hook. - * This is currently used for testing only. - */ - clearCallHook() { - this._callHook = null; - } - - /** - * Builds or executes a `Layer's logic. - * - * When called with `tf.Tensor`(s), execute the `Layer`s computation and - * return Tensor(s). For example: - * - * ```js - * const denseLayer = tf.layers.dense({ - * units: 1, - * kernelInitializer: 'zeros', - * useBias: false - * }); - * - * // Invoke the layer's apply() method with a `tf.Tensor` (with concrete - * // numeric values). - * const input = tf.ones([2, 2]); - * const output = denseLayer.apply(input); - * - * // The output's value is expected to be [[0], [0]], due to the fact that - * // the dense layer has a kernel initialized to all-zeros and does not have - * // a bias. - * output.print(); - * ``` - * - * When called with `tf.SymbolicTensor`(s), this will prepare the layer for - * future execution. This entails internal book-keeping on shapes of - * expected Tensors, wiring layers together, and initializing weights. - * - * Calling `apply` with `tf.SymbolicTensor`s are typically used during the - * building of non-`tf.Sequential` models. For example: - * - * ```js - * const flattenLayer = tf.layers.flatten(); - * const denseLayer = tf.layers.dense({units: 1}); - * - * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply(). - * const input = tf.input({shape: [2, 2]}); - * const output1 = flattenLayer.apply(input); - * - * // output1.shape is [null, 4]. The first dimension is the undetermined - * // batch size. The second dimension comes from flattening the [2, 2] - * // shape. - * console.log(JSON.stringify(output1.shape)); - * - * // The output SymbolicTensor of the flatten layer can be used to call - * // the apply() of the dense layer: - * const output2 = denseLayer.apply(output1); - * - * // output2.shape is [null, 1]. The first dimension is the undetermined - * // batch size. The second dimension matches the number of units of the - * // dense layer. - * console.log(JSON.stringify(output2.shape)); - * - * // The input and output and be used to construct a model that consists - * // of the flatten and dense layers. - * const model = tf.model({inputs: input, outputs: output2}); - * ``` - * - * @param inputs a `tf.Tensor` or `tf.SymbolicTensor` or an Array of them. - * @param kwargs Additional keyword arguments to be passed to `call()`. - * - * @return Output of the layer's `call` method. - * - * @exception ValueError error in case the layer is missing shape information - * for its `build` call. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - // Porting Note: This is a replacement for __call__() in Python. - apply( - inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] { - kwargs = kwargs || {}; - - this.assertNotDisposed(); - - // Ensure inputs are all the same type. - const inputsList = generic_utils.toList(inputs); - - let allAreSymbolic = true; - for (const input of inputsList) { - if (!(input instanceof SymbolicTensor)) { - allAreSymbolic = false; - break; - } - } - let noneAreSymbolic = true; - for (const input of inputsList) { - if (input instanceof SymbolicTensor) { - noneAreSymbolic = false; - break; - } - } - - if (allAreSymbolic === noneAreSymbolic) { - throw new ValueError( - 'Arguments to apply() must be all ' + - 'SymbolicTensors or all Tensors'); - } - - // TODO(michaelterry): nameScope() may not be necessary. - return nameScope(this.name, () => { - // Handle laying building (weight creating, input spec locking). - if (!this.built) { - /* - Throw exceptions in case the input is not compatible - with the inputSpec specified in the layer constructor. - */ - this.assertInputCompatibility(inputs); - - // Collect input shapes to build layer. - const inputShapes: Shape[] = []; - for (const xElem of generic_utils.toList(inputs)) { - inputShapes.push(xElem.shape); - } - this.build(generic_utils.singletonOrArray(inputShapes)); - this.built = true; - - // Load weights that were specified at layer instantiation. - if (this.initialWeights) { - this.setWeights(this.initialWeights); - } - - if (this._refCount === null && noneAreSymbolic) { - // The first use of this layer is a non-symbolic call, set ref count - // to 1 so the Layer can be properly disposed if its dispose() method - // is called. - this._refCount = 1; - } - } - - /* - Throw exceptions in case the input is not compatible - with the inputSpec set at build time. - */ - this.assertInputCompatibility(inputs); - - // Handle mask propagation. - // TODO(michaelterry): Mask propagation not currently implemented. - - // Actually call the layer, collecting output(s), mask(s), and shape(s). - if (noneAreSymbolic) { - let output = this.call(inputs as Tensor | Tensor[], kwargs); - // TODO(michaelterry): Compute the outputMask - - // If the layer returns tensors from its inputs, unmodified, - // we copy them to avoid loss of tensor metadata. - const outputList: Tensor[] = generic_utils.toList(output); - const outputListCopy: Tensor[] = []; - // TODO(michaelterry): This copying may not be necessary given our eager - // backend. - for (let x of outputList) { - if (inputsList.indexOf(x) !== -1) { - x = x.clone(); - } - outputListCopy.push(x); - } - output = generic_utils.singletonOrArray(outputListCopy); - - if (this.activityRegularizer != null) { - throw new NotImplementedError( - 'Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - - // TODO(michaelterry): Call addInboundNode()? - return output; - } else { - const inputShape = collectInputShape(inputs); - const outputShape = this.computeOutputShape(inputShape); - let output: SymbolicTensor|SymbolicTensor[]; - const outputDType = guessOutputDType(inputs); - this.warnOnIncompatibleInputShape( - Array.isArray(inputs) ? inputShape[0] as Shape : - inputShape as Shape); - - if (outputShape != null && outputShape.length > 0 && - Array.isArray(outputShape[0])) { - // We have multiple output shapes. Create multiple output tensors. - output = (outputShape as Shape[]) - .map( - (shape, index) => new SymbolicTensor( - outputDType, shape, this, - generic_utils.toList(inputs), kwargs, this.name, - index)); - } else { - output = new SymbolicTensor( - outputDType, outputShape as Shape, this, - generic_utils.toList(inputs), kwargs, this.name); - } - - /* - Add an inbound node to the layer, so that it keeps track - of the call and of all new variables created during the call. - This also updates the layer history of the output tensor(s). - If the input tensor(s) had no previous history, - this does nothing. - */ - this.addInboundNode( - inputs as SymbolicTensor | SymbolicTensor[], output, null, null, - inputShape, outputShape, kwargs); - this._refCount++; - - if (this.activityRegularizer != null) { - throw new NotImplementedError( - 'Layer invocation in the presence of activity ' + - 'regularizer(s) is not supported yet.'); - } - - return output; - } - }); - } - - /** - * Check compatibility between input shape and this layer's batchInputShape. - * - * Print warning if any incompatibility is found. - * - * @param inputShape Input shape to be checked. - */ - protected warnOnIncompatibleInputShape(inputShape: Shape) { - if (this.batchInputShape == null) { - return; - } else if (inputShape.length !== this.batchInputShape.length) { - console.warn( - `The rank of the input tensor provided (shape: ` + - `${JSON.stringify(inputShape)}) does not match that of the ` + - `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` + - `of the layer ${this.name}`); - } else { - let dimMismatch = false; - this.batchInputShape.forEach((dimension, i) => { - if (dimension != null && inputShape[i] != null && - inputShape[i] !== dimension) { - dimMismatch = true; - } - }); - if (dimMismatch) { - console.warn( - `The shape of the input tensor ` + - `(${JSON.stringify(inputShape)}) does not ` + - `match the expectation of layer ${this.name}: ` + - `${JSON.stringify(this.batchInputShape)}`); - } - } - } - - /** - * Retrieves the output shape(s) of a layer. - * - * Only applicable if the layer has only one inbound node, or if all inbound - * nodes have the same output shape. - * - * @returns Output shape or shapes. - * @throws AttributeError: if the layer is connected to more than one incoming - * nodes. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - get outputShape(): Shape|Shape[] { - if (this.inboundNodes == null || this.inboundNodes.length === 0) { - throw new AttributeError( - `The layer ${this.name} has never been called and thus has no ` + - `defined output shape.`); - } - const allOutputShapes: string[] = []; - for (const node of this.inboundNodes) { - const shapeString = JSON.stringify(node.outputShapes); - if (allOutputShapes.indexOf(shapeString) === -1) { - allOutputShapes.push(shapeString); - } - } - if (allOutputShapes.length === 1) { - const outputShapes = this.inboundNodes[0].outputShapes; - if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && - outputShapes.length === 1) { - return (outputShapes as Shape[])[0]; - } else { - return outputShapes; - } - - } else { - throw new AttributeError( - `The layer ${this.name} has multiple inbound nodes with different ` + - `output shapes. Hence the notion of "output shape" is ill-defined ` + - `for the layer.`); - // TODO(cais): Implement getOutputShapeAt(). - } - } - - /** - * Counts the total number of numbers (e.g., float32, int32) in the - * weights. - * - * @returns An integer count. - * @throws RuntimeError: If the layer is not built yet (in which case its - * weights are not defined yet.) - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - countParams(): number { - if (!this.built) { - throw new RuntimeError( - `You tried to call countParams() on ${this.name}, ` + - `but the layer is not built yet. Build it first by calling ` + - `build(batchInputShape).`); - } - return variable_utils.countParamsInWeights(this.weights); - } - - /** - * Creates the layer weights. - * - * Must be implemented on all layers that have weights. - * - * Called when apply() is called to construct the weights. - * - * @param inputShape A `Shape` or array of `Shape` (unused). - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - build(inputShape: Shape|Shape[]) { - this.built = true; - } - - /** - * Returns the current values of the weights of the layer. - * - * @param trainableOnly Whether to get the values of only trainable weights. - * @returns Weight values as an `Array` of `tf.Tensor`s. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getWeights(trainableOnly = false): Tensor[] { - return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); - } - - /** - * Sets the weights of the layer, from Tensors. - * - * @param weights a list of Tensors. The number of arrays and their shape - * must match number of the dimensions of the weights of the layer (i.e. - * it should match the output of `getWeights`). - * - * @exception ValueError If the provided weights list does not match the - * layer's specifications. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - setWeights(weights: Tensor[]): void { - tidy(() => { - const params = this.weights; - if (params.length !== weights.length) { - // TODO(cais): Restore the following and use `providedWeights`, instead - // of `weights` in the error message, once the deeplearn.js bug is - // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const - // providedWeights = JSON.stringify(weights).substr(0, 50); - throw new ValueError( - `You called setWeights(weights) on layer "${this.name}" ` + - `with a weight list of length ${weights.length}, ` + - `but the layer was expecting ${params.length} weights. ` + - `Provided weights: ${weights}...`); - } - if (params.length === 0) { - return; - } - const weightValueTuples: Array<[LayerVariable, Tensor]> = []; - const paramValues = batchGetValue(params); - for (let i = 0; i < paramValues.length; ++i) { - const pv = paramValues[i]; - const p = params[i]; - const w = weights[i]; - if (!util.arraysEqual(pv.shape, w.shape)) { - throw new ValueError( - `Layer weight shape ${pv.shape} ` + - `not compatible with provided weight shape ${w.shape}`); - } - weightValueTuples.push([p, w]); - } - batchSetValue(weightValueTuples); - }); - } - - /** - * Adds a weight variable to the layer. - * - * @param name Name of the new weight variable. - * @param shape The shape of the weight. - * @param dtype The dtype of the weight. - * @param initializer An initializer instance. - * @param regularizer A regularizer instance. - * @param trainable Whether the weight should be trained via backprop or not - * (assuming that the layer itself is also trainable). - * @param constraint An optional trainable. - * @return The created weight variable. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - protected addWeight( - name: string, shape: Shape, dtype?: DataType, initializer?: Initializer, - regularizer?: Regularizer, trainable?: boolean, - constraint?: Constraint): LayerVariable { - // Reject duplicate weight names. - if (this._addedWeightNames.indexOf(name) !== -1) { - throw new ValueError( - `Duplicate weight name ${name} for layer ${this.name}`); - } - this._addedWeightNames.push(name); - - if (dtype == null) { - dtype = 'float32'; - } - - if (this.fastWeightInitDuringBuild) { - initializer = getInitializer('zeros'); - } - const initValue = initializer.apply(shape, dtype); - const weight = - new LayerVariable(initValue, dtype, name, trainable, constraint); - initValue.dispose(); - // Request backend not to dispose the weights of the model on scope() exit. - if (regularizer != null) { - this.addLoss(() => regularizer.apply(weight.read())); - } - if (trainable == null) { - trainable = true; - } - if (trainable) { - this._trainableWeights.push(weight); - } else { - this._nonTrainableWeights.push(weight); - } - return weight; - } - - /** - * Set the fast-weight-initialization flag. - * - * In cases where the initialized weight values will be immediately - * overwritten by loaded weight values during model loading, setting - * the flag to `true` saves unnecessary calls to potentially expensive - * initializers and speeds up the loading process. - * - * @param value Target value of the flag. - */ - setFastWeightInitDuringBuild(value: boolean) { - this.fastWeightInitDuringBuild = value; - } - - /** - * Add losses to the layer. - * - * The loss may potentionally be conditional on some inputs tensors, - * for instance activity losses are conditional on the layer's inputs. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - addLoss(losses: RegularizerFn|RegularizerFn[]): void { - if (losses == null || Array.isArray(losses) && losses.length === 0) { - return; - } - // Update this.losses - losses = generic_utils.toList(losses); - if (this._losses !== undefined && this._losses !== null) { - this.losses.push(...losses); - } - } - - /** - * Computes the output shape of the layer. - * - * Assumes that the layer will be built to match that input shape provided. - * - * @param inputShape A shape (tuple of integers) or a list of shape tuples - * (one per output tensor of the layer). Shape tuples can include null for - * free dimensions, instead of an integer. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - /** - * Computes an output mask tensor. - * - * @param inputs Tensor or list of tensors. - * @param mask Tensor or list of tensors. - * - * @return null or a tensor (or list of tensors, one per output tensor of the - * layer). - */ - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor - |Tensor[] { - if (!this.supportsMasking) { - if (mask != null) { - if (Array.isArray(mask)) { - mask.forEach(maskElement => { - if (maskElement != null) { - throw new TypeError( - `Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - }); - } else { - throw new TypeError( - `Layer ${this.name} does not support masking, ` + - 'but was passed an inputMask.'); - } - } - // masking not explicitly supported: return null as mask - return null; - } - // if masking is explictly supported, by default - // carry over the input mask - return mask; - } - - /** - * Internal method to create an inbound node for the layer. - * - * @param inputTensors List of input tensors. - * @param outputTensors List of output tensors. - * @param inputMasks List of input masks (a mask can be a tensor, or null). - * @param outputMasks List of output masks (a mask can be a tensor, or null). - * @param inputShapes List of input shape tuples. - * @param outputShapes List of output shape tuples. - * @param kwargs Dictionary of keyword arguments that were passed to the - * `call` method of the layer at the call that created the node. - */ - private addInboundNode( - inputTensors: SymbolicTensor|SymbolicTensor[], - outputTensors: SymbolicTensor|SymbolicTensor[], - inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[], - inputShapes: Shape|Shape[], outputShapes: Shape|Shape[], - kwargs: {} = null): void { - const inputTensorList: SymbolicTensor[] = - generic_utils.toList(inputTensors); - outputTensors = generic_utils.toList(outputTensors); - inputMasks = generic_utils.toList(inputMasks); - outputMasks = generic_utils.toList(outputMasks); - inputShapes = types_utils.normalizeShapeList(inputShapes); - outputShapes = types_utils.normalizeShapeList(outputShapes); - - // Collect input tensor(s) coordinates. - const inboundLayers: Layer[] = []; - const nodeIndices: number[] = []; - const tensorIndices: number[] = []; - for (const x of inputTensorList) { - /* - * TODO(michaelterry): Keras adds this value to tensors; it's not - * clear whether we'll use this or not. - */ - inboundLayers.push(x.sourceLayer); - nodeIndices.push(x.nodeIndex); - tensorIndices.push(x.tensorIndex); - } - - // Create node, add it to inbound nodes. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node( - { - outboundLayer: this, - inboundLayers, - nodeIndices, - tensorIndices, - inputTensors: inputTensorList, - outputTensors, - inputMasks, - outputMasks, - inputShapes, - outputShapes - }, - kwargs); - - // Update tensor history - for (let i = 0; i < outputTensors.length; i++) { - // TODO(michaelterry: _uses_learning_phase not tracked. - outputTensors[i].sourceLayer = this; - outputTensors[i].nodeIndex = this.inboundNodes.length - 1; - outputTensors[i].tensorIndex = i; - } - } - - /** - * Returns the config of the layer. - * - * A layer config is a TS dictionary (serializable) - * containing the configuration of a layer. - * The same layer can be reinstantiated later - * (without its trained weights) from this configuration. - * - * The config of a layer does not include connectivity - * information, nor the layer class name. These are handled - * by 'Container' (one layer of abstraction above). - * - * Porting Note: The TS dictionary follows TS naming standrds for - * keys, and uses tfjs-layers type-safe Enums. Serialization methods - * should use a helper function to convert to the pythonic storage - * standard. (see serialization_utils.convertTsToPythonic) - * - * @returns TS dictionary of configuration. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - getConfig(): serialization.ConfigDict { - const config: - serialization.ConfigDict = {name: this.name, trainable: this.trainable}; - if (this.batchInputShape != null) { - config['batchInputShape'] = this.batchInputShape; - } - if (this.dtype != null) { - config['dtype'] = this.dtype; - } - return config; - } - - /** - * Dispose the weight variables that this Layer instance holds. - * - * @returns {number} Number of disposed variables. - */ - protected disposeWeights(): number { - this.weights.forEach(weight => weight.dispose()); - return this.weights.length; - } - - protected assertNotDisposed() { - if (this._refCount === 0) { - throw new Error(`Layer '${this.name}' is already disposed.`); - } - } - - /** - * Attempt to dispose layer's weights. - * - * This method decrease the reference count of the Layer object by 1. - * - * A Layer is reference-counted. Its reference count is incremented by 1 - * the first item its `apply()` method is called and when it becomes a part - * of a new `Node` (through calling the `apply()`) method on a - * `tf.SymbolicTensor`). - * - * If the reference count of a Layer becomes 0, all the weights will be - * disposed and the underlying memory (e.g., the textures allocated in WebGL) - * will be freed. - * - * Note: If the reference count is greater than 0 after the decrement, the - * weights of the Layer will *not* be disposed. - * - * After a Layer is disposed, it cannot be used in calls such as `apply()`, - * `getWeights()` or `setWeights()` anymore. - * - * @returns A DisposeResult Object with the following fields: - * - refCountAfterDispose: The reference count of the Container after this - * `dispose()` call. - * - numDisposedVariables: Number of `tf.Variable`s (i.e., weights) disposed - * during this `dispose()` call. - * @throws {Error} If the layer is not built yet, or if the layer has already - * been disposed. - * - * @doc {heading: 'Models', 'subheading': 'Classes'} - */ - dispose(): DisposeResult { - if (!this.built) { - throw new Error( - `Cannot dispose Layer ${this.name} because it has not been ` + - `built yet.`); - } - - if (this._refCount === null) { - throw new Error( - `Cannot dispose Layer ${this.name} because it has not been used ` + - `yet.`); - } - - this.assertNotDisposed(); - - let numDisposedVariables = 0; - if (--this._refCount === 0) { - numDisposedVariables = this.disposeWeights(); - } - - return {refCountAfterDispose: this._refCount, numDisposedVariables}; - } -} - -/** - * Collects the input shape(s) of a list of `tf.Tensor`s or - * `tf.SymbolicTensor`s. - * - * TODO(michaelterry): Update PyKeras docs (backport). - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return List of shape tuples (or single tuple), one tuple per input. - */ -function collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor| - Tensor[]): Shape|Shape[] { - inputTensors = - generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[]; - const shapes: Shape[] = []; - for (const x of inputTensors) { - shapes.push(x.shape); - } - return generic_utils.singletonOrArray(shapes); -} - -/** - * Guesses output dtype based on inputs. - * - * At present, just returns 'float32' for any input. - * - * @param inputTensors List of input tensors (or single input tensor). - * - * @return The guessed DType. At present, always returns 'float32'. - */ -function guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor| - Tensor[]): DataType { - return 'float32'; -} - -/** - * Returns the list of input tensors necessary to compute `tensor`. - * - * Output will always be a list of tensors (potentially with 1 element). - * - * @param tensor The tensor to start from. - * @param layer Origin layer of the tensor. - * @param nodeIndex Origin node index of the tensor. - * - * @return Array of input tensors. - */ -export function getSourceInputs( - tensor: SymbolicTensor, layer?: Layer, - nodeIndex?: number): SymbolicTensor[] { - if (layer == null || (nodeIndex != null && nodeIndex > 0)) { - layer = tensor.sourceLayer; - nodeIndex = tensor.nodeIndex; - } - if (layer.inboundNodes.length === 0) { - return [tensor]; - } else { - const node = layer.inboundNodes[nodeIndex]; - if (node.inboundLayers.length === 0) { - return node.inputTensors; - } else { - const sourceTensors: SymbolicTensor[] = []; - for (let i = 0; i < node.inboundLayers.length; i++) { - const x = node.inputTensors[i]; - const layer = node.inboundLayers[i]; - const nodeIndex = node.nodeIndices[i]; - const previousSources = getSourceInputs(x, layer, nodeIndex); - // Avoid input redundancy. - for (const x of previousSources) { - if (sourceTensors.indexOf(x) === -1) { - sourceTensors.push(x); - } - } - } - return sourceTensors; - } - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts deleted file mode 100644 index aa4f6c408..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts +++ /dev/null @@ -1,1902 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original Source: engine/training.py */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {io, ModelPredictConfig as ModelPredictArgs, NamedTensorMap, Optimizer, Scalar, scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core'; - -import * as K from '../backend/tfjs_backend'; -import {History, ModelLoggingVerbosity} from '../base_callbacks'; -import {nameScope} from '../common'; -import {NotImplementedError, RuntimeError, ValueError} from '../errors'; -import {Shape} from '../keras_format/common'; -import {LossIdentifier} from '../keras_format/loss_config'; -import {OptimizerSerialization} from '../keras_format/optimizer_config'; -import {MetricsIdentifier, TrainingConfig} from '../keras_format/training_config'; -import {deserialize} from '../layers/serialization'; -import * as losses from '../losses'; -import * as Metrics from '../metrics'; -import * as optimizers from '../optimizers'; -import {LossOrMetricFn, NamedTensor} from '../types'; -import {checkUserDefinedMetadata} from '../user_defined_metadata'; -import {count, pyListRepeat, singletonOrArray, toCamelCase, toSnakeCase, unique} from '../utils/generic_utils'; -import {printSummary} from '../utils/layer_utils'; -import {range} from '../utils/math_utils'; -import {convertPythonicToTs} from '../utils/serialization_utils'; -import {LayerVariable} from '../variables'; -import {version} from '../version'; - -import {Container, ContainerArgs} from './container'; -import {Dataset} from './dataset_stub'; -import {execute, FeedDict} from './executor'; -import {DisposeResult, SymbolicTensor} from './topology'; -import {evaluateDataset, fitDataset, ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './training_dataset'; -import {checkBatchSize, disposeNewTensors, ensureTensorsRank2OrHigher, fitTensors, makeBatches, ModelFitArgs, sliceArrays, sliceArraysByIndices} from './training_tensors'; -import {ClassWeight, ClassWeightMap, computeWeightedLoss, standardizeClassWeights, standardizeWeights} from './training_utils'; - -/** - * Helper function for polymorphic input data: 1. singleton Tensor. - */ -export function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}| - {[inputName: string]: Tensor[]}): boolean { - return x instanceof Tensor; -} - -/** - * Helper function for polymorphic input data: 2. Array of Tensor. - */ -export function isDataArray(x: Tensor|Tensor[]| - {[inputName: string]: Tensor}): boolean { - return Array.isArray(x); -} - -/** - * Helper function for polymorphic input data: 3. "dict" of Tensor. - */ -export function isDataDict(x: Tensor|Tensor[]| - {[inputName: string]: Tensor}): boolean { - return !isDataTensor(x) && !isDataArray(x); -} - -/** - * Normalizes inputs and targets provided by users. - * @param data User-provided input data (polymorphic). - * @param names An Array of expected Tensor names. - * @param shapes Optional Array of expected Tensor shapes. - * @param checkBatchAxis Whether to check that the batch axis of the arrays - * match the expected value found in `shapes`. - * @param exceptionPrefix String prefix used for exception formatting. - * @returns List of standardized input Tensors (one Tensor per model input). - * @throws ValueError: in case of improperly formatted user data. - */ -export function standardizeInputData( - data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[], - shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] { - if (names == null || names.length === 0) { - // Check for the case where the model expected no data, but some data got - // sent. - if (data != null) { - let gotUnexpectedData = false; - if (isDataArray(data) && (data as Tensor[]).length > 0) { - gotUnexpectedData = true; - } else if (isDataDict(data)) { - for (const key in data) { - if (data.hasOwnProperty(key)) { - gotUnexpectedData = true; - break; - } - } - } else { - // `data` is a singleton Tensor in this case. - gotUnexpectedData = true; - } - if (gotUnexpectedData) { - throw new ValueError( - `Error when checking model ${exceptionPrefix} expected no data, ` + - `but got ${data}`); - } - } - return []; - } - if (data == null) { - return names.map(name => null); - } - - let arrays: Tensor[]; - if (isDataDict(data)) { - data = data as {[inputName: string]: Tensor}; - arrays = []; - for (const name of names) { - if (data[name] == null) { - throw new ValueError( - `No data provided for "${name}". Need data for each key in: ` + - `${names}`); - } - arrays.push(data[name]); - } - } else if (isDataArray(data)) { - data = data as Tensor[]; - if (data.length !== names.length) { - throw new ValueError( - `Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `model expected. Expected to see ${names.length} Tensor(s), but ` + - `instead got the following list of Tensor(s): ${data}`); - } - arrays = data; - } else { - data = data as Tensor; - if (names.length > 1) { - throw new ValueError( - `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` + - `but only received one Tensor. Found: Tensor with shape ${ - data.shape}`); - } - arrays = [data]; - } - - arrays = ensureTensorsRank2OrHigher(arrays); - - // Check shape compatibility. - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError( - `Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s). but got array with ` + - `shape ${array.shape}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - // Skip the first (batch) axis. - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError( - `Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have shape [${shapes[i]}], but got array with shape ` + - `[${array.shape}].`); - } - } - } - } - return arrays; -} - -/** - * User input validation for Tensors. - * @param inputs `Array` of `tf.Tensor`s for inputs. - * @param targets `Array` of `tf.Tensor`s for targets. - * @param weights Optional `Array` of `tf.Tensor`s for sample weights. - * @throws ValueError: in case of incorrectly formatted data. - */ -export function checkArrayLengths( - inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) { - const setX = unique(inputs.map(input => input.shape[0])); - setX.sort(); - const setY = unique(targets.map(target => target.shape[0])); - setY.sort(); - // TODO(cais): Check `weights` as well. - if (setX.length > 1) { - throw new ValueError( - `All input Tensors (x) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(inputs.map(input => input.shape))}`); - } - if (setY.length > 1) { - throw new ValueError( - `All target Tensors (y) should have the same number of samples. ` + - `Got array shapes: ` + - `${JSON.stringify(targets.map(target => target.shape))}`); - } - if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) { - throw new ValueError( - `Input Tensors should have the same number of samples as target ` + - `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` + - `sample(s).`); - } -} - -/** - * Validation on the compatibility of targes and loss functions. - * - * This helps prevent users from using loss functions incorrectly. - * - * @param targets `Array` of `tf.Tensor`s of targets. - * @param lossFns `Array` of loss functions. - * @param outputShapes `Array` of shapes of model outputs. - */ -function checkLossAndTargetCompatibility( - targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) { - // TODO(cais): Dedicated test coverage? - const keyLosses = [ - losses.meanSquaredError, losses.binaryCrossentropy, - losses.categoricalCrossentropy - ]; - for (let i = 0; i < targets.length; ++i) { - const y = targets[i]; - const loss = lossFns[i]; - const shape = outputShapes[i]; - if (loss == null) { - continue; - } - if (loss === losses.categoricalCrossentropy) { - if (y.shape[y.shape.length - 1] === 1) { - throw new ValueError( - `You are passing a target array of shape ${y.shape} while using ` + - `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` + - `expects targets to be binary matrices (1s and 0s) of shape ` + - `[samples, classes].`); - // TODO(cais): Example code in error message. - } - } - if (keyLosses.indexOf(loss) !== -1) { - const slicedYShape = y.shape.slice(1); - const slicedShape = shape.slice(1); - for (let j = 0; j < slicedYShape.length; ++j) { - const targetDim = slicedYShape[j]; - const outDim = slicedShape[j]; - if (outDim != null && targetDim !== outDim) { - throw new ValueError( - `A target Tensor with shape ${y.shape} was passed for an ` + - `output of shape ${shape}, while using a loss function that ` + - `expects targets to have the same shape as the output.`); - } - } - } - } -} - -/** - * Check inputs provided by the user. - * - * Porting Note: This corresponds to _standardize_input_data() in Python - * Keras. Because of the strong typing in TF.js, we do not need to convert - * the data. Specifically: - * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for - * example. We don't need to worry about that here because there is no - * widely popular javascript/typesdcript equivalent of pandas (so far). - * If one becomes available in the future, we can add support. - * 2) in PyKeras, inputs can be Python dict. But here we are stipulating - * that the data is either a single `tf.Tensor` or an Array of `tf.Tensor`s. We - * may add support for `Object` data inputs in the future when the need - * arises. - * - * Instead, we perform basic checks for number of parameters and shapes. - * - * @param data: The input data. - * @param names: Name for the inputs, from the model. - * @param shapes: Expected shapes for the input data, from the model. - * @param checkBatchAxis: Whether the size along the batch axis (i.e., the - * first dimension) will be checked for matching. - * @param exceptionPrefix: Execption prefix message, used in generating error - * messages. - * @throws ValueError: on incorrect number of inputs or mismatches in shapes. - */ -function checkInputData( - data: Tensor|Tensor[], names: string[], shapes?: Shape[], - checkBatchAxis = true, exceptionPrefix = '') { - let arrays: Tensor[]; - if (Array.isArray(data)) { - if (data.length !== names.length) { - throw new ValueError( - `Error when checking model ${exceptionPrefix}: the Array of ` + - `Tensors that you are passing to your model is not the size the ` + - `the model expected. Expected to see ${names.length} Tensor(s),` + - ` but instead got ${data.length} Tensors(s).`); - } - arrays = data; - } else { - if (names.length > 1) { - throw new ValueError( - `The model expects ${names.length} ${exceptionPrefix} Tensors, ` + - `but only received one Tensor. Found: array with shape ` + - `${JSON.stringify(data.shape)}.`); - } - arrays = [data]; - } - - if (shapes != null) { - for (let i = 0; i < names.length; ++i) { - if (shapes[i] == null) { - continue; - } - const array = arrays[i]; - if (array.shape.length !== shapes[i].length) { - throw new ValueError( - `Error when checking ${exceptionPrefix}: expected ${names[i]} ` + - `to have ${shapes[i].length} dimension(s), but got array with ` + - `shape ${JSON.stringify(array.shape)}`); - } - for (let j = 0; j < shapes[i].length; ++j) { - if (j === 0 && !checkBatchAxis) { - continue; - } - const dim = array.shape[j]; - const refDim = shapes[i][j]; - if (refDim != null) { - if (refDim !== dim) { - throw new ValueError( - `Error when checking ${exceptionPrefix}: expected ` + - `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` + - `got array with shape ${JSON.stringify(array.shape)}.`); - } - } - } - } - } -} - -/** - * Maps metric functions to model outputs. - * @param metrics An shortcut strings name, metric function, `Array` or dict - * (`Object`) of metric functions. - * @param outputNames An `Array` of the names of model outputs. - * @returns An `Array` (one entry per model output) of `Array` of metric - * functions. For instance, if the model has 2 outputs, and for the first - * output we want to compute `binaryAccuracy` and `binaryCrossentropy`, - * and just `binaryAccuracy` for the second output, the `Array` would look - * like: - * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]` - * @throws TypeError: incompatible metrics format. - */ -export function collectMetrics( - metrics: string|LossOrMetricFn|Array| - {[outputName: string]: string | LossOrMetricFn}, - outputNames: string[]): Array> { - if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { - return outputNames.map(name => []); - } - - let wrappedMetrics: Array| - {[outputName: string]: string | LossOrMetricFn}; - if (typeof metrics === 'string' || typeof metrics === 'function') { - wrappedMetrics = [metrics]; - } else if (Array.isArray(metrics) || typeof metrics === 'object') { - wrappedMetrics = metrics as Array| - {[outputName: string]: string} | {[outputName: string]: LossOrMetricFn}; - } else { - throw new TypeError( - 'Type of metrics argument not understood. Expected an string,' + - `function, Array, or Object, found: ${metrics}`); - } - - if (Array.isArray(wrappedMetrics)) { - // We then apply all metrics to all outputs. - return outputNames.map( - name => wrappedMetrics as Array); - } else { - // In this case, metrics is a dict. - const nestedMetrics: Array> = []; - for (const name of outputNames) { - let outputMetrics: string|LossOrMetricFn|Array = - wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : []; - if (!Array.isArray(outputMetrics)) { - outputMetrics = [outputMetrics]; - } - nestedMetrics.push(outputMetrics); - } - return nestedMetrics; - } -} - -export interface ModelEvaluateArgs { - /** - * Batch size (Integer). If unspecified, it will default to 32. - */ - batchSize?: number; - - /** - * Verbosity mode. - */ - verbose?: ModelLoggingVerbosity; - - /** - * Tensor of weights to weight the contribution of different samples to the - * loss and metrics. - */ - sampleWeight?: Tensor; - - /** - * integer: total number of steps (batches of samples) - * before declaring the evaluation round finished. Ignored with the default - * value of `undefined`. - */ - steps?: number; -} - -/** - * Configuration for calls to `LayersModel.compile()`. - */ -export interface ModelCompileArgs { - /** - * An instance of `tf.train.Optimizer` or a string name for an Optimizer. - */ - optimizer: string|Optimizer; - - /** - * Object function(s) or name(s) of object function(s). - * If the model has multiple outputs, you can use a different loss - * on each output by passing a dictionary or an Array of losses. - * The loss value that will be minimized by the model will then be the sum - * of all individual losses. - */ - loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn| - LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn}; - - /** - * List of metrics to be evaluated by the model during training and testing. - * Typically you will use `metrics=['accuracy']`. - * To specify different metrics for different outputs of a multi-output - * model, you could also pass a dictionary. - */ - metrics?: string|LossOrMetricFn|Array| - {[outputName: string]: string | LossOrMetricFn}; - - // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and - // targetTensors. -} - -const LAYERS_MODEL_FORMAT_NAME = 'layers-model'; - -/** - * A `tf.LayersModel` is a directed, acyclic graph of `tf.Layer`s plus methods - * for training, evaluation, prediction and saving. - * - * `tf.LayersModel` is the basic unit of training, inference and evaluation in - * TensorFlow.js. To create a `tf.LayersModel`, use `tf.LayersModel`. - * - * See also: - * `tf.Sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export class LayersModel extends Container implements tfc.InferenceModel { - // The class name is 'Model' rather than 'LayersModel' for backwards - // compatibility since this class name shows up in the serialization format. - /** @nocollapse */ - static className = 'Model'; - protected optimizer_: Optimizer; - // Whether the model instance owns the optimizer: `true` if and only if - // `optimizer` is created from a string parameter during `compile()` call. - protected isOptimizerOwned: boolean; - - loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn| - LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn}; - lossFunctions: LossOrMetricFn[]; - - // TODO(cais): These private variables should probably not have the string - // 'feed' in their names, because we are not dealing with a symbolic - // backend. - private feedOutputShapes: Shape[]; - private feedLossFns: LossOrMetricFn[]; - private collectedTrainableWeights: LayerVariable[]; - private testFunction: (data: Tensor[]) => Scalar[]; - history: History; - - // A public property that can be set by Callbacks to order early stopping - // during `fit()` calls. - protected stopTraining_: boolean; - protected isTraining: boolean; - - metrics: string|LossOrMetricFn|Array| - {[outputName: string]: string | LossOrMetricFn}; - metricsNames: string[]; - // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given - // the imperative nature of tfjs-core, `metricsTensors` is a - // TypeScript function here. - // Also note that due to the imperative nature of tfjs-core, `metricsTensor` - // here needs an output index to keep track of which output of the - // LayersModel a metric belongs to. This is unlike `metrics_tensors` in - // PyKeras, which is a `list` of symbolic tensors, each of which has - // implicit "knowledge" of the outputs it depends on. - metricsTensors: Array<[LossOrMetricFn, number]>; - - // User defind metadata (if any). - private userDefinedMetadata: {}; - - constructor(args: ContainerArgs) { - super(args); - this.isTraining = false; - } - - /** - * Print a text summary of the model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - If the model has non-sequential-like topology, the inputs each layer - * receives - * - The total number of trainable and non-trainable parameters of the model. - * - * ```js - * const input1 = tf.input({shape: [10]}); - * const input2 = tf.input({shape: [20]}); - * const dense1 = tf.layers.dense({units: 4}).apply(input1); - * const dense2 = tf.layers.dense({units: 8}).apply(input2); - * const concat = tf.layers.concatenate().apply([dense1, dense2]); - * const output = - * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat); - * - * const model = tf.model({inputs: [input1, input2], outputs: output}); - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary( - lineLength?: number, positions?: number[], - printFn: - // tslint:disable-next-line:no-any - (message?: any, ...optionalParams: any[]) => void = console.log) { - if (!this.built) { - throw new ValueError( - `This model has never been called, thus its weights have not been ` + - `created yet. So no summary can be displayed. Build the model ` + - `first (e.g., by calling it on some test data).`); - } - printSummary(this, lineLength, positions, printFn); - } - - /** - * Configures and prepares the model for training and evaluation. Compiling - * outfits the model with an optimizer, loss, and/or metrics. Calling `fit` - * or `evaluate` on an un-compiled model will throw an error. - * - * @param args a `ModelCompileArgs` specifying the loss, optimizer, and - * metrics to be used for fitting and evaluating this model. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - compile(args: ModelCompileArgs): void { - if (args.loss == null) { - args.loss = []; - } - this.loss = args.loss; - - if (typeof args.optimizer === 'string') { - this.optimizer_ = optimizers.getOptimizer(args.optimizer); - this.isOptimizerOwned = true; - } else { - if (!(args.optimizer instanceof Optimizer)) { - throw new ValueError( - `User-defined optimizer must be an instance of tf.Optimizer.`); - } - this.optimizer_ = args.optimizer; - this.isOptimizerOwned = false; - } - - // TODO(cais): Add lossWeights. - // TODO(cais): Add sampleWeightMode. - - // Prepare loss functions. - let lossFunctions: LossOrMetricFn[] = []; - if (!Array.isArray(args.loss) && typeof args.loss !== 'string' && - typeof args.loss !== 'function') { - args.loss = args.loss as {[outputName: string]: string}; - for (const name in args.loss) { - if (this.outputNames.indexOf(name) === -1) { - throw new ValueError( - `Unknown entry in loss dictionary: "${name}". ` + - `Only expected the following keys: ${this.outputNames}`); - } - } - for (const name of this.outputNames) { - if (args.loss[name] == null) { - console.warn( - `Output "${name}" is missing from loss dictionary. We assume ` + - `this was done on purpose, and we will not be expecting data ` + - `to be passed to ${name} during training`); - } - lossFunctions.push(losses.get(args.loss[name])); - } - } else if (Array.isArray(args.loss)) { - if (args.loss.length !== this.outputs.length) { - throw new ValueError( - `When passing an Array as loss, it should have one entry per ` + - `model output. The model has ${this.outputs.length} output(s), ` + - `but you passed loss=${args.loss}.`); - } - const theLosses = args.loss as Array; - lossFunctions = theLosses.map(l => losses.get(l)); - } else { - const lossFunction = losses.get(args.loss); - this.outputs.forEach(_ => { - lossFunctions.push(lossFunction); - }); - } - - this.lossFunctions = lossFunctions; - - this.feedOutputNames = []; - this.feedOutputShapes = []; - this.feedLossFns = []; - for (let i = 0; i < this.outputs.length; ++i) { - // TODO(cais): Logic for skipping target(s). - const shape = this.internalOutputShapes[i]; - const name = this.outputNames[i]; - this.feedOutputNames.push(name); - this.feedOutputShapes.push(shape); - this.feedLossFns.push(this.lossFunctions[i]); - } - - // TODO(cais): Add logic for output masks. - // TODO(cais): Add logic for sample weights. - const skipTargetIndices: number[] = []; - - // Prepare metrics. - this.metrics = args.metrics; - // TODO(cais): Add weightedMetrics. - this.metricsNames = ['loss']; - this.metricsTensors = []; - - // Compute total loss. - // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects. - // Here, metricsTensors are TypeScript functions. This difference is due - // to the difference in symbolic/imperative property of the backends. - nameScope('loss', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - // TODO(cais): Add weightedLoss, sampleWeight and mask. - // The following line should be weightedLoss - const weightedLoss = this.lossFunctions[i]; - if (this.outputs.length > 1) { - this.metricsTensors.push([weightedLoss, i]); - this.metricsNames.push(this.outputNames[i] + '_loss'); - } - } - - // Porting Note: Due to the imperative nature of the backend, we calculate - // the regularizer penalties in the totalLossFunction, instead of here. - }); - - const nestedMetrics = collectMetrics(args.metrics, this.outputNames); - // TODO(cais): Add nestedWeightedMetrics. - - /** - * Helper function used in loop below. - */ - const appendMetric = - (outputIndex: number, metricName: string, - metricTensor: LossOrMetricFn) => { - if (this.outputNames.length > 1) { - metricName = this.outputNames[outputIndex] + '_' + metricName; - } - this.metricsNames.push(metricName); - this.metricsTensors.push([metricTensor, outputIndex]); - }; - - nameScope('metric', () => { - for (let i = 0; i < this.outputs.length; ++i) { - if (skipTargetIndices.indexOf(i) !== -1) { - continue; - } - const outputMetrics = nestedMetrics[i]; - // TODO(cais): Add weights and outputWeightedMetrics. - - // TODO(cais): Add optional arg `weights` to the following function. - const handleMetrics = (metrics: Array) => { - const metricNamePrefix = ''; - let metricName: string; - let accFn: LossOrMetricFn; - let weightedMetricFn: LossOrMetricFn; - // TODO(cais): Use 'weights_' for weighted metrics. - - for (const metric of metrics) { - if (typeof metric === 'string' && - ['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== - -1) { - const outputShape = this.internalOutputShapes[i]; - - if (outputShape[outputShape.length - 1] === 1 || - this.lossFunctions[i] === losses.binaryCrossentropy) { - // case: binary accuracy/crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.binaryAccuracy; - } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.binaryCrossentropy; - } - } else if ( - this.lossFunctions[i] === - losses.sparseCategoricalCrossentropy) { - // case: categorical accuracy / crossentropy with sparse - // targets. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.sparseCategoricalAccuracy; - } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.sparseCategoricalCrossentropy; - } - } else { - // case: categorical accuracy / crossentropy. - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - accFn = Metrics.categoricalAccuracy; - } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - accFn = Metrics.categoricalCrossentropy; - } - } - let suffix: string; - if (['accuracy', 'acc'].indexOf(metric) !== -1) { - suffix = 'acc'; - } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { - suffix = 'ce'; - } - // TODO(cais): Add weighting actually. - weightedMetricFn = accFn; - metricName = metricNamePrefix + suffix; - } else { - const metricFn = Metrics.get(metric); - // TODO(cais): Add weighting actually. - weightedMetricFn = metricFn; - metricName = - metricNamePrefix + Metrics.getLossOrMetricName(metric); - } - - // TODO(cais): Add weighting and masking to metricResult. - let metricResult: LossOrMetricFn; - nameScope(metricName, () => { - metricResult = weightedMetricFn; - }); - appendMetric(i, metricName, metricResult); - } - }; - - handleMetrics(outputMetrics); - // TODO(cais): Call handleMetrics with weights. - } - }); - - // Porting Notes: Given the imperative backend of tfjs-core, - // there is no need for constructing the symbolic graph and placeholders. - this.collectedTrainableWeights = this.trainableWeights; - } - - /** - * Check trainable weights count consistency. - * - * This will raise a warning if `this.trainableWeights` and - * `this.collectedTrainableWeights` are inconsistent (i.e., have different - * numbers of parameters). - * Inconsistency will typically arise when one modifies `model.trainable` - * without calling `model.compile()` again. - */ - protected checkTrainableWeightsConsistency(): void { - if (this.collectedTrainableWeights == null) { - return; - } - if (this.trainableWeights.length !== - this.collectedTrainableWeights.length) { - console.warn( - 'Discrepancy between trainableweights and collected trainable ' + - 'weights. Did you set `model.trainable` without calling ' + - '`model.compile()` afterwards?'); - } - } - - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate( - * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4}); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateArgs`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate( - x: Tensor|Tensor[], y: Tensor|Tensor[], - args: ModelEvaluateArgs = {}): Scalar|Scalar[] { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - - // TODO(cais): Standardize `config.sampleWeights` as well. - // Validate user data. - const checkBatchAxis = true; - const standardizedOuts = - this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - try { - // TODO(cais): If uses `useLearningPhase`, set the corresponding element - // of the input to 0. - const ins = standardizedOuts[0].concat(standardizedOuts[1]); - this.makeTestFunction(); - const f = this.testFunction; - const testOuts = - this.testLoop(f, ins, batchSize, args.verbose, args.steps); - return singletonOrArray(testOuts); - } finally { - disposeNewTensors(standardizedOuts[0], x); - disposeNewTensors(standardizedOuts[1], y); - } - } - - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset: Dataset<{}>, args?: ModelEvaluateDatasetArgs): - Promise { - this.makeTestFunction(); - return evaluateDataset(this, dataset, args); - } - - /** - * Get number of samples provided for training, evaluation or prediction. - * - * @param ins Input `tf.Tensor`. - * @param batchSize Integer batch size, optional. - * @param steps Total number of steps (batches of samples) before - * declaring loop finished. Optional. - * @param stepsName The public API's parameter name for `steps`. - * @returns Number of samples provided. - */ - private checkNumSamples( - ins: Tensor|Tensor[], batchSize?: number, steps?: number, - stepsName = 'steps'): number { - let numSamples: number; - if (steps != null) { - numSamples = null; - if (batchSize != null) { - throw new ValueError( - `If ${stepsName} is set, batchSize must be null or undefined.` + - `Got batchSize = ${batchSize}`); - } - } else if (ins != null) { - if (Array.isArray(ins)) { - numSamples = ins[0].shape[0]; - } else { - numSamples = ins.shape[0]; - } - } else { - throw new ValueError( - `Either the input data should have a defined shape, or ` + - `${stepsName} shoud be specified.`); - } - return numSamples; - } - - /** - * Execute internal tensors of the model with input data feed. - * @param inputs Input data feed. Must match the inputs of the model. - * @param outputs Names of the output tensors to be fetched. Must match - * names of the SymbolicTensors that belong to the graph. - * @returns Fetched values for `outputs`. - */ - execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]): - Tensor|Tensor[] { - if (Array.isArray(outputs) && outputs.length === 0) { - throw new ValueError( - '`outputs` is an empty Array, which is not allowed.'); - } - - const outputsIsArray = Array.isArray(outputs); - const outputNames = - (outputsIsArray ? outputs as string[] : [outputs as string]); - const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); - - // Format the input into a FeedDict. - const feedDict = new FeedDict(); - if (inputs instanceof Tensor) { - inputs = [inputs]; - } - if (Array.isArray(inputs)) { - if (inputs.length !== this.inputs.length) { - throw new ValueError( - `The number of inputs provided (${inputs.length}) ` + - `does not match the number of inputs of this model ` + - `(${this.inputs.length}).`); - } - for (let i = 0; i < this.inputs.length; ++i) { - feedDict.add(this.inputs[i], inputs[i]); - } - } else { - for (const input of this.inputs) { - const tensorValue = inputs[input.name]; - if (tensorValue == null) { - throw new ValueError( - `No value is provided for the model's input ${input.name}`); - } - feedDict.add(input, tensorValue); - } - } - - // Run execution. - const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[]; - return outputsIsArray ? executeOutputs : executeOutputs[0]; - } - - /** - * Retrieve the model's internal symbolic tensors from symbolic-tensor names. - */ - private retrieveSymbolicTensors(symbolicTensorNames: string[]): - SymbolicTensor[] { - const outputSymbolicTensors: SymbolicTensor[] = - pyListRepeat(null, symbolicTensorNames.length); - let outputsRemaining = symbolicTensorNames.length; - for (const layer of this.layers) { - const layerOutputs: SymbolicTensor[] = - Array.isArray(layer.output) ? layer.output : [layer.output]; - const layerOutputNames = layerOutputs.map(output => output.name); - for (let i = 0; i < symbolicTensorNames.length; ++i) { - const index = layerOutputNames.indexOf(symbolicTensorNames[i]); - if (index !== -1) { - outputSymbolicTensors[i] = layerOutputs[index]; - outputsRemaining--; - } - if (outputsRemaining === 0) { - break; - } - } - if (outputsRemaining === 0) { - break; - } - } - - if (outputsRemaining > 0) { - const remainingNames: string[] = []; - outputSymbolicTensors.forEach((tensor, i) => { - if (tensor == null) { - remainingNames.push(symbolicTensorNames[i]); - } - }); - throw new ValueError( - `Cannot find SymbolicTensors for output name(s): ` + - `${JSON.stringify(remainingNames)}`); - } - return outputSymbolicTensors; - } - - /** - * Helper method to loop over some data in batches. - * - * Porting Note: Not using the functional approach in the Python equivalent - * due to the imperative backend. - * Porting Note: Does not support step mode currently. - * - * @param ins: input data - * @param batchSize: integer batch size. - * @param verbose: verbosity model - * @returns: Predictions as `tf.Tensor` (if a single output) or an `Array` of - * `tf.Tensor` (if multipe outputs). - */ - private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false): - Tensor|Tensor[] { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins); - if (verbose) { - throw new NotImplementedError( - 'Verbose predictLoop() is not implemented yet.'); - } - - // Sample-based predictions. - // Porting Note: Tensor currently does not support sliced assignments as - // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while - // iterating over the batches. - - const batches = makeBatches(numSamples, batchSize); - const outsBatches: Tensor[][] = this.outputs.map(output => []); - - // TODO(cais): Can the scope() be pushed down inside the for loop? - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchOuts = tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - // TODO(cais): Take care of the case of the last element is a flag for - // training/test. - const insBatch = sliceArrays(ins, batchStart, batchEnd); - - // Construct the feeds for execute(); - const feeds = []; - if (Array.isArray(insBatch)) { - for (let i = 0; i < insBatch.length; ++i) { - feeds.push({key: this.inputs[i], value: insBatch[i]}); - } - } else { - feeds.push({key: this.inputs[0], value: insBatch}); - } - const feedDict = new FeedDict(feeds); - return execute(this.outputs, feedDict) as Tensor[]; - }); - batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut)); - } - return singletonOrArray( - outsBatches.map(batches => tfc.concat(batches, 0))); - }); - } - - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFlow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param args A `ModelPredictArgs` object containing optional fields. - * - * @return Prediction results as a `tf.Tensor`(s). - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] { - const xsRank2OrHigher = ensureTensorsRank2OrHigher(x); - checkInputData( - xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); - try { - // TODO(cais): Take care of stateful models. - // if (this.stateful) ... - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - return this.predictLoop(xsRank2OrHigher, batchSize); - } finally { - disposeNewTensors(xsRank2OrHigher, x); - } - } - - /** - * Returns predictions for a single batch of samples. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predictOnBatch(tf.ones([8, 10])).print(); - * ``` - * @param x: Input samples, as a Tensor (for models with exactly one - * input) or an array of Tensors (for models with more than one input). - * @return Tensor(s) of predictions - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] { - checkInputData(x, this.inputNames, this.feedInputShapes, true); - // TODO(cais): Take care of the learning_phase boolean flag. - // if (this.useLearningPhase) ... - const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; - return this.predictLoop(x, batchSize); - } - - protected standardizeUserDataXY( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true, - batchSize?: number): [Tensor[], Tensor[]] { - // TODO(cais): Add sampleWeight, classWeight - if (this.optimizer_ == null) { - throw new RuntimeError( - 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileArgs).'); - } - const outputShapes: Shape[] = []; - for (let i = 0; i < this.feedOutputShapes.length; ++i) { - const outputShape = this.feedOutputShapes[i]; - const lossFn = this.feedLossFns[i]; - if (lossFn === losses.sparseCategoricalCrossentropy) { - outputShapes.push( - outputShape.slice(0, outputShape.length - 1).concat([1])); - } else { - // Porting Note: Because of strong typing `lossFn` must be a function. - outputShapes.push(outputShape); - } - } - x = standardizeInputData( - x, this.feedInputNames, this.feedInputShapes, false, 'input'); - y = standardizeInputData( - y, this.feedOutputNames, outputShapes, false, 'target'); - // TODO(cais): Standardize sampleWeights & classWeights. - checkArrayLengths(x, y, null); - // TODO(cais): Check sampleWeights as well. - checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); - if (this.stateful && batchSize != null && batchSize > 0) { - if (x[0].shape[0] % batchSize !== 0) { - throw new ValueError( - `In a stateful network, you should only pass inputs with a ` + - `number of samples that is divisible by the batch size ` + - `${batchSize}. Found: ${x[0].shape[0]} sample(s).`); - } - } - return [x, y]; - } - - protected async standardizeUserData( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]|{[inputName: string]: Tensor}, - sampleWeight?: Tensor|Tensor[]|{[outputName: string]: Tensor}, - classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap, - checkBatchAxis = true, - batchSize?: number): Promise<[Tensor[], Tensor[], Tensor[]]> { - const [standardXs, standardYs] = - this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); - // TODO(cais): Handle sampleWeights. - if (sampleWeight != null) { - throw new Error('sample weight is not supported yet.'); - } - - let standardSampleWeights: Tensor[] = null; - if (classWeight != null) { - const classWeights = - standardizeClassWeights(classWeight, this.outputNames); - standardSampleWeights = []; - for (let i = 0; i < classWeights.length; ++i) { - standardSampleWeights.push( - await standardizeWeights(standardYs[i], null, classWeights[i])); - } - } - - // TODO(cais): Deal with the case of model.stateful == true. - return [standardXs, standardYs, standardSampleWeights]; - } - - /** - * Loop over some test data in batches. - * @param f A Function returning a list of tensors. - * @param ins Array of tensors to be fed to `f`. - * @param batchSize Integer batch size or `null` / `undefined`. - * @param verbose verbosity mode. - * @param steps Total number of steps (batches of samples) before - * declaring test finished. Ignored with the default value of `null` / - * `undefined`. - * @returns Array of Scalars. - */ - private testLoop( - f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number, - verbose = 0, steps?: number): Scalar[] { - return tfc.tidy(() => { - const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps'); - const outs: Scalar[] = []; - if (verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - // TODO(cais): Use `indicesForConversionToDense' to prevent slow down. - if (steps != null) { - throw new NotImplementedError( - 'steps mode in testLoop() is not implemented yet'); - } else { - const batches = makeBatches(numSamples, batchSize); - const indexArray = tensor1d(range(0, numSamples)); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = - K.sliceAlongFirstAxis( - indexArray, batchStart, batchEnd - batchStart) as Tensor1D; - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[]; - const batchOuts = f(insBatch); - if (batchIndex === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar(0)); - } - } - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - outs[i] = - tfc.add(outs[i], tfc.mul(batchEnd - batchStart, batchOut)); - } - } - for (let i = 0; i < outs.length; ++i) { - outs[i] = tfc.div(outs[i], numSamples); - } - } - return outs; - }); - } - - protected getDedupedMetricsNames(): string[] { - const outLabels = this.metricsNames; - // Rename duplicated metrics names (can happen with an output layer - // shared among multiple dataflows). - const dedupedOutLabels = []; - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - let newLabel = label; - if (count(outLabels, label) > 1) { - const dupIndex = count(outLabels.slice(0, i), label); - newLabel += `_${dupIndex}`; - } - dedupedOutLabels.push(newLabel); - } - return dedupedOutLabels; - } - - /** - * Creates a function that performs the following actions: - * - * 1. computes the losses - * 2. sums them to get the total loss - * 3. call the optimizer computes the gradients of the LayersModel's - * trainable weights w.r.t. the total loss and update the variables - * 4. calculates the metrics - * 5. returns the values of the losses and metrics. - */ - protected makeTrainFunction(): (data: Tensor[]) => Scalar[] { - return (data: Tensor[]) => { - const lossValues: Scalar[] = []; - - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice( - this.inputs.length, this.inputs.length + this.outputs.length); - const sampleWeights = data.slice( - this.inputs.length + this.outputs.length, - this.inputs.length + this.outputs.length * 2); - - const metricsValues: Scalar[] = []; - - // Create a function that computes the total loss based on the - // inputs. This function is used for obtaining gradients through - // backprop. - const totalLossFunction = () => { - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({key: this.inputs[i], value: inputs[i]}); - } - const feedDict = new FeedDict(feeds); - const outputs = - execute(this.outputs, feedDict, {'training': true}) as Tensor[]; - // TODO(cais): Take care of the case of multiple outputs from a - // single layer? - - let totalLoss: Tensor; - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - let loss = lossFunction(targets[i], outputs[i]); - if (sampleWeights[i] != null) { - loss = computeWeightedLoss(loss, sampleWeights[i]); - } - - // TODO(cais): push Scalar instead. - const meanLoss: Scalar = tfc.mean(loss); - // TODO(cais): Use a scope() instead, to avoid ownership. - lossValues.push(meanLoss); - if (i === 0) { - totalLoss = loss; - } else { - totalLoss = tfc.add(totalLoss, loss); - } - } - - // Compute the metrics. - // TODO(cais): These should probably be calculated outside - // totalLossFunction to benefit speed? - for (let i = 0; i < this.metricsTensors.length; ++i) { - let weightedMetric: Scalar; - - if (this.outputs.length > 1 && i < this.outputs.length) { - weightedMetric = lossValues[i]; - } else { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - weightedMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - } - - tfc.keep(weightedMetric); - // TODO(cais): Use a scope() instead, to avoid ownership. - metricsValues.push(weightedMetric); - } - - totalLoss = tfc.mean(totalLoss); - - // Add regularizer penalties. - this.calculateLosses().forEach(regularizerLoss => { - totalLoss = tfc.add(totalLoss, regularizerLoss); - }); - - return totalLoss as Scalar; - }; - - const variables = this.collectedTrainableWeights.map( - param => param.read() as tfc.Variable); - const returnCost = true; - const totalLossValue = - this.optimizer_.minimize(totalLossFunction, returnCost, variables); - - return [totalLossValue].concat(metricsValues); - }; - } - - /** - * Create a function which, when invoked with an array of `tf.Tensor`s as a - * batch of inputs, returns the prespecified loss and metrics of the model - * under the batch of input data. - */ - private makeTestFunction() { - this.testFunction = (data: Tensor[]) => { - return tfc.tidy(() => { - const valOutputs: Scalar[] = []; - let totalLoss: Scalar; - const inputs = data.slice(0, this.inputs.length); - const targets = data.slice( - this.inputs.length, this.inputs.length + this.outputs.length); - const feeds = []; - for (let i = 0; i < this.inputs.length; ++i) { - feeds.push({key: this.inputs[i], value: inputs[i]}); - } - const feedDict = new FeedDict(feeds); - const outputs = execute(this.outputs, feedDict) as Tensor[]; - // Compute total loss. - for (let i = 0; i < this.lossFunctions.length; ++i) { - const lossFunction = this.lossFunctions[i]; - // TODO(cais): Add sample weighting and replace the simple - // averaging. - const loss: Scalar = tfc.mean(lossFunction(targets[i], outputs[i])); - if (i === 0) { - totalLoss = loss; - } else { - totalLoss = tfc.add(totalLoss, loss); - } - valOutputs.push(totalLoss); - } - // Compute the metrics. - for (let i = 0; i < this.metricsTensors.length; ++i) { - const metric = this.metricsTensors[i][0]; - const outputIndex = this.metricsTensors[i][1]; - // TODO(cais): Replace K.mean() with a proper weighting function. - const meanMetric = - tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); - valOutputs.push(meanMetric as Scalar); - } - return valOutputs; - }); - }; - } - - /** - * Trains the model for a fixed number of epochs (iterations on a - * dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * for (let i = 1; i < 5 ; ++i) { - * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log("Loss after Epoch " + i + " : " + h.history.loss[0]); - * } - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you - * can also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, - * you can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input - * data and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]|{[inputName: string]: Tensor}, - args: ModelFitArgs = {}): Promise { - return fitTensors(this, x, y, args); - } - - // TODO(cais): Add code snippet below when it's possible to instantiate - // actual dataset objects. - /** - * Trains the model using a dataset object. - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for training. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. - * Of the two items in the array, the first is the input feature(s) and - * the second is the output target(s). - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs): - Promise { - return fitDataset(this, dataset, args); - } - - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]| - {[inputName: string]: Tensor}): Promise { - // TODO(cais): Support sampleWeight and classWeight. - // TODO(cais): Support Dataset objects. - const standardizeOut = await this.standardizeUserData(x, y); - const inputs = standardizeOut[0]; - const targets = standardizeOut[1]; - const trainFunction = this.makeTrainFunction(); - const losses = trainFunction(inputs.concat(targets)); - const lossValues: number[] = []; - for (const loss of losses) { - const v = await loss.data(); - lossValues.push(v[0]); - } - tfc.dispose(losses); - return singletonOrArray(lossValues); - } - - /** - * Extract weight values of the model. - * - * @param config: An instance of `io.SaveConfig`, which specifies - * model-saving options such as whether only trainable weights are to be - * saved. - * @returns A `NamedTensorMap` mapping original weight names (i.e., - * non-uniqueified weight names) to their values. - */ - protected getNamedWeights(config?: io.SaveConfig): NamedTensor[] { - const namedWeights: NamedTensor[] = []; - - const trainableOnly = config != null && config.trainableOnly; - const weights = trainableOnly ? this.trainableWeights : this.weights; - const weightValues = this.getWeights(trainableOnly); - for (let i = 0; i < weights.length; ++i) { - if (trainableOnly && !weights[i].trainable) { - // Optionally skip non-trainable weights. - continue; - } - namedWeights.push( - {name: weights[i].originalName, tensor: weightValues[i]}); - } - return namedWeights; - } - - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const input = tf.input({shape: [10]}); - * const output = tf.layers.dense({units: 1}).apply(input); - * const model = tf.model({inputs: [input], outputs: [output]}); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 - * values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop: boolean) { - this.stopTraining_ = stop; - } - - get stopTraining(): boolean { - return this.stopTraining_; - } - - get optimizer(): Optimizer { - return this.optimizer_; - } - - set optimizer(optimizer: Optimizer) { - if (this.optimizer_ !== optimizer) { - this.optimizer_ = optimizer; - this.isOptimizerOwned = false; - } - } - - dispose(): DisposeResult { - const result = super.dispose(); - if (result.refCountAfterDispose === 0 && this.optimizer != null && - this.isOptimizerOwned) { - const numTensorsBeforeOptmizerDisposal = tfc.memory().numTensors; - this.optimizer_.dispose(); - result.numDisposedVariables += - numTensorsBeforeOptmizerDisposal - tfc.memory().numTensors; - } - return result; - } - - private getLossIdentifiers(): LossIdentifier|LossIdentifier[]| - {[outputName: string]: LossIdentifier} { - let lossNames: LossIdentifier|LossIdentifier[]| - {[outputName: string]: LossIdentifier}; - if (typeof this.loss === 'string') { - lossNames = toSnakeCase(this.loss) as LossIdentifier; - } else if (Array.isArray(this.loss)) { - for (const loss of this.loss) { - if (typeof loss !== 'string') { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - lossNames = (this.loss as string[]).map(name => toSnakeCase(name)) as - LossIdentifier[]; - } else { - const outputNames = Object.keys(this.loss); - lossNames = {} as {[outputName: string]: LossIdentifier}; - const losses = - this.loss as {[outputName: string]: LossOrMetricFn | string}; - for (const outputName of outputNames) { - if (typeof losses[outputName] === 'string') { - lossNames[outputName] = - toSnakeCase(losses[outputName] as string) as LossIdentifier; - } else { - throw new Error('Serialization of non-string loss is not supported.'); - } - } - } - return lossNames; - } - - private getMetricIdentifiers(): MetricsIdentifier[]| - {[key: string]: MetricsIdentifier} { - if (typeof this.metrics === 'string' || - typeof this.metrics === 'function') { - return [toSnakeCase(Metrics.getLossOrMetricName(this.metrics))]; - } else if (Array.isArray(this.metrics)) { - return this.metrics.map( - metric => toSnakeCase(Metrics.getLossOrMetricName(metric))); - } else { - const metricsIdentifiers: {[key: string]: MetricsIdentifier} = {}; - for (const key in this.metrics) { - metricsIdentifiers[key] = - toSnakeCase(Metrics.getLossOrMetricName(this.metrics[key])); - } - return metricsIdentifiers; - } - } - - protected getTrainingConfig(): TrainingConfig { - return { - loss: this.getLossIdentifiers(), - metrics: this.getMetricIdentifiers(), - optimizer_config: { - class_name: this.optimizer.getClassName(), - config: this.optimizer.getConfig() - } as OptimizerSerialization - }; - // TODO(cais): Add weight_metrics when they are supported. - // TODO(cais): Add sample_weight_mode when it's supported. - // TODO(cais): Add loss_weights when it's supported. - } - - loadTrainingConfig(trainingConfig: TrainingConfig) { - if (trainingConfig.weighted_metrics != null) { - throw new Error('Loading weight_metrics is not supported yet.'); - } - if (trainingConfig.loss_weights != null) { - throw new Error('Loading loss_weights is not supported yet.'); - } - if (trainingConfig.sample_weight_mode != null) { - throw new Error('Loading sample_weight_mode is not supported yet.'); - } - - const tsConfig = convertPythonicToTs(trainingConfig.optimizer_config) as - serialization.ConfigDict; - const optimizer = deserialize(tsConfig) as Optimizer; - - let loss; - if (typeof trainingConfig.loss === 'string') { - loss = toCamelCase(trainingConfig.loss); - } else if (Array.isArray(trainingConfig.loss)) { - loss = trainingConfig.loss.map(lossEntry => toCamelCase(lossEntry)); - } else if (trainingConfig.loss != null) { - loss = {} as {[outputName: string]: LossIdentifier}; - for (const key in trainingConfig.loss) { - loss[key] = toCamelCase(trainingConfig.loss[key]) as LossIdentifier; - } - } - - let metrics; - if (Array.isArray(trainingConfig.metrics)) { - metrics = trainingConfig.metrics.map(metric => toCamelCase(metric)); - } else if (trainingConfig.metrics != null) { - metrics = {} as {[outputName: string]: MetricsIdentifier}; - for (const key in trainingConfig.metrics) { - metrics[key] = toCamelCase(trainingConfig.metrics[key]); - } - } - - this.compile({loss, metrics, optimizer}); - } - - /** - * Save the configuration and/or weights of the LayersModel. - * - * An `IOHandler` is an object that has a `save` method of the proper - * signature defined. The `save` method manages the storing or - * transmission of serialized data ("artifacts") that represent the - * model's topology and weights onto or via a specific medium, such as - * file downloads, local storage, IndexedDB in the web browser and HTTP - * requests to a server. TensorFlow.js provides `IOHandler` - * implementations for a number of frequently used saving mediums, such as - * `tf.io.browserDownloads` and `tf.io.browserLocalStorage`. See `tf.io` - * for more details. - * - * This method also allows you to refer to certain types of `IOHandler`s - * as URL-like string shortcuts, such as 'localstorage://' and - * 'indexeddb://'. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights as two files - * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from - * browser. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('downloads://my-model-1'); - * ``` - * - * Example 4. Send `model`'s topology and weights to an HTTP server. - * See the documentation of `tf.io.http` for more details - * including specifying request parameters and implementation of the - * server. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * const saveResults = await model.save('http://my-server/model/upload'); - * ``` - * - * @param handlerOrURL An instance of `IOHandler` or a URL-like, - * scheme-based string shortcut for `IOHandler`. - * @param config Options for saving the model. - * @returns A `Promise` of `SaveResult`, which summarizes the result of - * the saving, such as byte sizes of the saved artifacts for the model's - * topology and weight values. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig): - Promise { - if (typeof handlerOrURL === 'string') { - const handlers = io.getSaveHandlers(handlerOrURL); - if (handlers.length === 0) { - throw new ValueError( - `Cannot find any save handlers for URL '${handlerOrURL}'`); - } else if (handlers.length > 1) { - throw new ValueError( - `Found more than one (${handlers.length}) save handlers for ` + - `URL '${handlerOrURL}'`); - } - handlerOrURL = handlers[0]; - } - if (handlerOrURL.save == null) { - throw new ValueError( - 'LayersModel.save() cannot proceed because the IOHandler ' + - 'provided does not have the `save` attribute defined.'); - } - - const weightDataAndSpecs = - await io.encodeWeights(this.getNamedWeights(config)); - - const returnString = false; - const unusedArg: {} = null; - const modelConfig = this.toJSON(unusedArg, returnString); - const modelArtifacts: io.ModelArtifacts = { - modelTopology: modelConfig, - format: LAYERS_MODEL_FORMAT_NAME, - generatedBy: `TensorFlow.js tfjs-layers v${version}`, - convertedBy: null, - }; - - const includeOptimizer = config == null ? false : config.includeOptimizer; - if (includeOptimizer && this.optimizer != null) { - modelArtifacts.trainingConfig = this.getTrainingConfig(); - const weightType = 'optimizer'; - const {data: optimizerWeightData, specs: optimizerWeightSpecs} = - await io.encodeWeights(await this.optimizer.getWeights(), weightType); - weightDataAndSpecs.specs.push(...optimizerWeightSpecs); - weightDataAndSpecs.data = io.concatenateArrayBuffers( - [weightDataAndSpecs.data, optimizerWeightData]); - } - - if (this.userDefinedMetadata != null) { - // Check serialized size of user-defined metadata. - const checkSize = true; - checkUserDefinedMetadata(this.userDefinedMetadata, this.name, checkSize); - modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; - } - - modelArtifacts.weightData = weightDataAndSpecs.data; - modelArtifacts.weightSpecs = weightDataAndSpecs.specs; - return handlerOrURL.save(modelArtifacts); - } - - /** - * Set user-defined metadata. - * - * The set metadata will be serialized together with the topology - * and weights of the model during `save()` calls. - * - * @param setUserDefinedMetadata - */ - setUserDefinedMetadata(userDefinedMetadata: {}): void { - checkUserDefinedMetadata(userDefinedMetadata, this.name); - this.userDefinedMetadata = userDefinedMetadata; - } - - /** - * Get user-defined metadata. - * - * The metadata is supplied via one of the two routes: - * 1. By calling `setUserDefinedMetadata()`. - * 2. Loaded during model loading (if the model is constructed - * via `tf.loadLayersModel()`.) - * - * If no user-defined metadata is available from either of the - * two routes, this function will return `undefined`. - */ - getUserDefinedMetadata(): {} { - return this.userDefinedMetadata; - } -} -serialization.registerClass(LayersModel); - -/** - * A `tf.Functional` is an alias to `tf.LayersModel`. - * - * See also: - * `tf.LayersModel`, `tf.Sequential`, `tf.loadLayersModel`. - */ -/** @doc {heading: 'Models', subheading: 'Classes'} */ -export class Functional extends LayersModel { - static className = 'Functional'; -} -serialization.registerClass(Functional); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts deleted file mode 100644 index 043b80c6e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts +++ /dev/null @@ -1,615 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Interfaces and methods for training models using TensorFlow.js datasets. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {scalar} from '@tensorflow/tfjs-core'; -import {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks'; -import {NotImplementedError, ValueError} from '../errors'; -import {disposeTensorsInLogs, UnresolvedLogs} from '../logs'; -import {TensorOrArrayOrMap} from '../types'; -import {singletonOrArray, toList} from '../utils/generic_utils'; - -import {Dataset, LazyIterator} from './dataset_stub'; -import {ClassWeight, ClassWeightMap, standardizeClassWeights, standardizeWeights} from './training_utils'; - -/** - * Interface for configuring model training based on a dataset object. - */ -export interface ModelFitDatasetArgs { - /** - * (Optional) Total number of steps (batches of samples) before - * declaring one epoch finished and starting the next epoch. It should - * typically be equal to the number of samples of your dataset divided by - * the batch size, so that `fitDataset`() call can utilize the entire dataset. - * If it is not provided, use `done` return value in `iterator.next()` as - * signal to finish an epoch. - */ - batchesPerEpoch?: number; - - /** - * Integer number of times to iterate over the training dataset. - */ - epochs: number; - - /** - * Verbosity level. - * - * Expected to be 0, 1, or 2. Default: 1. - * - * 0 - No printed message during fit() call. - * 1 - In Node.js (tfjs-node), prints the progress bar, together with - * real-time updates of loss and metric values and training speed. - * In the browser: no action. This is the default. - * 2 - Not implemented yet. - */ - verbose?: ModelLoggingVerbosity; - - /** - * List of callbacks to be called during training. - * Can have one or more of the following callbacks: - * - `onTrainBegin(logs)`: called when training starts. - * - `onTrainEnd(logs)`: called when training ends. - * - `onEpochBegin(epoch, logs)`: called at the start of every epoch. - * - `onEpochEnd(epoch, logs)`: called at the end of every epoch. - * - `onBatchBegin(batch, logs)`: called at the start of every batch. - * - `onBatchEnd(batch, logs)`: called at the end of every batch. - * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds - * with the current epoch, batch and logs. The logs are the same - * as in `onBatchEnd()`. Note that `onYield` can skip batches or - * epochs. See also docs for `yieldEvery` below. - */ - callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[]; - - /** - * Data on which to evaluate the loss and any model - * metrics at the end of each epoch. The model will not be trained on this - * data. This could be any of the following: - * - * - An array `[xVal, yVal]`, where the two values may be `tf.Tensor`, - * an array of Tensors, or a map of string to Tensor. - * - Similarly, an array ` [xVal, yVal, valSampleWeights]` - * (not implemented yet). - * - a `Dataset` object with elements of the form `{xs: xVal, ys: yVal}`, - * where `xs` and `ys` are the feature and label tensors, respectively. - * - * If `validationData` is an Array of Tensor objects, each `tf.Tensor` will be - * sliced into batches during validation, using the parameter - * `validationBatchSize` (which defaults to 32). The entirety of the - * `tf.Tensor` objects will be used in the validation. - * - * If `validationData` is a dataset object, and the `validationBatches` - * parameter is specified, the validation will use `validationBatches` batches - * drawn from the dataset object. If `validationBatches` parameter is not - * specified, the validation will stop when the dataset is exhausted. - * - * The model will not be trained on this data. - */ - validationData?: [ - TensorOrArrayOrMap, TensorOrArrayOrMap - ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]|Dataset; - - /** - * Optional batch size for validation. - * - * Used only if `validationData` is an array of `tf.Tensor` objects, i.e., not - * a dataset object. - * - * If not specified, its value defaults to 32. - */ - validationBatchSize?: number; - - /** - * (Optional) Only relevant if `validationData` is specified and is a dataset - * object. - * - * Total number of batches of samples to draw from `validationData` for - * validation purpose before stopping at the end of every epoch. If not - * specified, `evaluateDataset` will use `iterator.next().done` as signal to - * stop validation. - */ - validationBatches?: number; - - /** - * Configures the frequency of yielding the main thread to other tasks. - * - * In the browser environment, yielding the main thread can improve the - * responsiveness of the page during training. In the Node.js environment, - * it can ensure tasks queued in the event loop can be handled in a timely - * manner. - * - * The value can be one of the following: - * - `'auto'`: The yielding happens at a certain frame rate (currently set - * at 125ms). This is the default. - * - `'batch'`: yield every batch. - * - `'epoch'`: yield every epoch. - * - a `number`: Will yield every `number` milliseconds. - * - `'never'`: never yield. (But yielding can still happen through `await - * nextFrame()` calls in custom callbacks.) - */ - yieldEvery?: YieldEveryOptions; - - /** - * Epoch at which to start training (useful for resuming a previous training - * run). When this is used, `epochs` is the index of the "final epoch". - * The model is not trained for a number of iterations given by `epochs`, - * but merely until the epoch of index `epochs` is reached. - */ - initialEpoch?: number; - - /** - * Optional object mapping class indices (integers) to - * a weight (float) to apply to the model's loss for the samples from this - * class during training. This can be useful to tell the model to "pay more - * attention" to samples from an under-represented class. - * - * If the model has multiple outputs, a class weight can be specified for - * each of the outputs by setting this field an array of weight object - * or a object that maps model output names (e.g., `model.outputNames[0]`) - * to weight objects. - */ - classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap; -} - -export interface FitDatasetElement { - xs: TensorOrArrayOrMap; - ys: TensorOrArrayOrMap; -} - -/** - * Interface for configuring model evaluation based on a dataset object. - */ -export interface ModelEvaluateDatasetArgs { - /** - * Number of batches to draw from the dataset object before ending the - * evaluation. - */ - batches?: number; - - /** - * Verbosity mode. - */ - verbose?: ModelLoggingVerbosity; -} - -// Default batch size used during tensor-based validation. -const DEFAULT_VALIDATION_BATCH_SIZE = 32; - -/** - * Standardize the output of a dataset iterator for use by - * LayersModel.fitDataset(). - * - * @param model: A `tf.LayersModel` object. - * @param iteratorOut The output of a dataset iterator. It is required to be - * an object of the form `{xs: TensorOrArrayOrMap, ys: - * TensorOrArrayOrMap}`, where `TensorOrArrayOrMap` is a single `tf.Tensor`, - * a `tf.Tensor[]`, or a flat map from string names to `tf.Tensor`s. - * @returns A flat array of `tf.Tensor` objects: the input `tf.Tensor`s - * followed by the target `tf.Tensor`s. When `tf.Tensor`s are provided - * as a map, the order in the resulting array is taken from the `inputNames` - * and `outputNames` of the model. - */ -function standardizeDataIteratorOutput( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model: any, iteratorOut: {}): {xs: tfc.Tensor[], ys: tfc.Tensor[]} { - let xs: TensorOrArrayOrMap; - let ys: TensorOrArrayOrMap; - - const iteratorOutObj = iteratorOut as FitDatasetElement; - xs = iteratorOutObj['xs']; - ys = iteratorOutObj['ys']; - tfc.util.assert( - xs != null && ys != null, - () => 'A Dataset iterator for fitDataset() is expected to generate ' + - 'objects of the form `{xs: xVal, ys: yVal}`, where the two ' + - 'values may be `tf.Tensor`, an array of Tensors, or a map of ' + - 'string to Tensor. The provided Dataset instead generates ' + - `${iteratorOut}`); - - const flattenedXs: tfc.Tensor[] = - flattenTensorOrArrayOrMap('input', model.inputNames, xs); - const flattenedYs: tfc.Tensor[] = - flattenTensorOrArrayOrMap('output', model.outputNames, ys); - - const batchSize: number = flattenedXs[0].shape[0]; - - tfc.util.assert( - flattenedXs.length === model.inputs.length, - () => `LayersModel has ${model.inputs.length} inputs, but the dataset ` + - `provides ${flattenedXs.length} inputs. (Expected input keys: ` + - `${JSON.stringify(model.inputNames)})`); - - tfc.util.assert( - flattenedYs.length === model.outputs.length, - () => - `LayersModel has ${model.outputs.length} outputs, but the dataset ` + - `provides ${flattenedYs.length} outputs. (Expected output keys: ` + - `${JSON.stringify(model.outputNames)})`); - - for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) { - tfc.util.assert( - flattenedXs[xIndex].shape[0] === batchSize, - () => `Batch size mismatch: input ` + - `${model.inputNames[xIndex]} has ${ - flattenedXs[xIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - - for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) { - tfc.util.assert( - flattenedYs[yIndex].shape[0] === batchSize, - () => `Batch size mismatch: output ` + - `${model.outputNames[yIndex]} has ${ - flattenedYs[yIndex].shape[0]}; ` + - `expected ${batchSize} based on input ${model.inputNames[0]}.`); - } - - return {xs: flattenedXs, ys: flattenedYs}; -} - -function flattenTensorOrArrayOrMap( - inputOrOutput: string, names: string[], values: TensorOrArrayOrMap) { - if (values instanceof tfc.Tensor) { - return [values]; - } else if (Array.isArray(values)) { - tfc.util.assert( - values.length === names.length, - () => `Received an array of ${values.length} Tensors, but expected ${ - names.length} to match the ${inputOrOutput} keys ${names}.`); - return values; - } else { - const result: tfc.Tensor[] = []; - // Check that all the required keys are available. - for (const name of names) { - if (values[name] == null) { - throw new ValueError( - `The feature data generated by the dataset lacks the required ` + - `${inputOrOutput} key '${name}'.`); - } - result.push(values[name]); - } - return result; - } -} - -function standardizeTensorValidationData( - data: - [ - tfc.Tensor|tfc.Tensor[], tfc.Tensor|tfc.Tensor[] - ]|[tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[], - tfc.Tensor | tfc.Tensor[]]): - {xs: tfc.Tensor|tfc.Tensor[], ys: tfc.Tensor|tfc.Tensor[]} { - if (data.length === 3) { - throw new NotImplementedError( - 'Validation with sample weights is not implemented yet.'); - } - return {xs: data[0], ys: data[1]}; -} - -export async function fitDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model: any, dataset: Dataset, - args: ModelFitDatasetArgs): Promise { - const hasBatchesPerEpoch = args.batchesPerEpoch != null; - tfc.util.assert( - model.optimizer != null, - () => 'You must compile a model before training/testing. Use ' + - 'LayersModel.compile(modelCompileConfig).'); - - tfc.util.assert( - args != null, - () => `For fitDataset(), the 2nd argument (config) is required, ` + - `but it is not provided in this call.`); - tfc.util.assert( - args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), - () => `For fitDataset(), config.epochs is expected to be a positive ` + - `integer, but got ${args.epochs}`); - tfc.util.assert( - !hasBatchesPerEpoch || - (args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch)), - () => `For fitDataset(), config.batchesPerEpoch is expected to be a ` + - `positive integer if specified, but got ${args.batchesPerEpoch}`); - tfc.util.assert( - // tslint:disable-next-line:no-any - (args as any)['validationSplit'] == null, - () => '`validationSplit` is not supported by `fitDataset()`. ' + - 'Use validationData instead.'); - - if (model.isTraining) { - throw new Error( - 'Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - - try { - const doValidation = args.validationData != null; - let valXs: tfc.Tensor|tfc.Tensor[]; - let valYs: tfc.Tensor|tfc.Tensor[]; - if (doValidation) { - if (isDatasetObject(args.validationData)) { - tfc.util.assert( - args.validationBatches == null || - (args.validationBatches > 0 && - Number.isInteger(args.validationBatches)), - () => `For fitDataset() with dataset-based validation, ` + - `config.validationBatches is expected not to be provided, ` + - `or to be a positive integer, ` + - `but got ${args.validationBatches}`); - } else { - const validationData = standardizeTensorValidationData( - args.validationData as - [tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[]] | - [ - tfc.Tensor | tfc.Tensor[], tfc.Tensor | tfc.Tensor[], - tfc.Tensor | tfc.Tensor[] - ]); - valXs = validationData.xs; - valYs = validationData.ys; - } - } - - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames() as string[]; - - let callbackMetrics: string[]; - if (doValidation) { - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } else { - callbackMetrics = outLabels.slice(); - } - - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const verbose = args.verbose == null ? 1 : args.verbose; - const {callbackList, history} = configureCallbacks( - callbacks, verbose, args.epochs, null, null, - getStepsPerEpoch(dataset, args), - null, // Batch size determined by the dataset itself. - doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - let epoch = args.initialEpoch == null ? 0 : args.initialEpoch; - - let dataIterator = await dataset.iterator(); - while (epoch < args.epochs) { - const epochLogs: UnresolvedLogs = {}; - await callbackList.onEpochBegin(epoch); - let stepsDone = 0; - let batchIndex = 0; - if (!hasBatchesPerEpoch) { - dataIterator = await dataset.iterator(); - } - while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) { - const iteratorOut = await dataIterator.next(); - - // If `batchesPerEpoch` is specified, the dataset should not be - // exhausted until all epoches are done. - if (hasBatchesPerEpoch && iteratorOut.done) { - console.warn( - 'You provided `batchesPerEpoch` as ' + - `${args.batchesPerEpoch}, ` + - 'but your dataset iterator ran out of data after ' + - `${stepsDone} batches; ` + - 'interrupting training. Make sure that your ' + - 'dataset can generate at least `batchesPerEpoch * epochs` ' + - 'batches (in this case, ' + - `${args.batchesPerEpoch * args.epochs} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - break; - } - - if (iteratorOut.value != null) { - const {xs, ys} = - standardizeDataIteratorOutput(model, iteratorOut.value); - const batchLogs: UnresolvedLogs = {}; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = xs[0].shape[0]; - - await callbackList.onBatchBegin(batchIndex, batchLogs); - - const sampleWeights: tfc.Tensor[] = []; - if (args.classWeight != null) { - const standardClassWeights = - standardizeClassWeights(args.classWeight, model.outputNames); - for (let i = 0; i < standardClassWeights.length; ++i) { - sampleWeights.push(await standardizeWeights( - ys[i], null, standardClassWeights[i])); - } - } - - // Train on batch. - const ins = xs.concat(ys).concat(sampleWeights); - const outs = trainFunction(ins); - tfc.dispose(ins); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - } - - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - - batchIndex++; - stepsDone++; - } - - if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : - iteratorOut.done) { - // Epoch finished. Perform validation. - if (doValidation) { - let valOuts: tfc.Scalar[]; - if (isDatasetObject(args.validationData)) { - valOuts = toList(await model.evaluateDataset( - args.validationData, {batches: args.validationBatches})); - } else { - valOuts = toList(model.evaluate(valXs, valYs, { - batchSize: args.validationBatchSize == null ? - DEFAULT_VALIDATION_BATCH_SIZE : - args.validationBatchSize, - verbose: 0 - })); - } - for (let i = 0; i < model.metricsNames.length; ++i) { - epochLogs[`val_${model.metricsNames[i]}`] = valOuts[i]; - } - } - // Call `break` to exit one epoch lopp after validation is done. If - // config.batchesPerEpoch is specified, an epoch while loop will - // stop when `stepsDone >= config.batchesPerEpoch`. When - // config.batchesPerEpoch is not provided, the following `break` is - // required to exit the while lopp after dataset is exhausted. - break; - } - - if (model.stopTraining_) { - break; - } - } - await callbackList.onEpochEnd(epoch, epochLogs); - epoch++; - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - await model.history.syncData(); - return model.history; - } finally { - model.isTraining = false; - } -} - -/** Helper function that determines number of steps (batches) per epoch. */ -function getStepsPerEpoch( - dataset: Dataset, args: ModelFitDatasetArgs): number { - // Attempt to determine # of batches in an epoch. - let stepsPerEpoch: number = null; - if (args.batchesPerEpoch != null) { - stepsPerEpoch = args.batchesPerEpoch; - } else if (Number.isFinite(dataset.size)) { - stepsPerEpoch = dataset.size; - } - return stepsPerEpoch; -} - -// Check if provided object is a Dataset object by checking its .iterator -// element. -function isDatasetObject( - dataset: - [ - TensorOrArrayOrMap, TensorOrArrayOrMap - ]|[TensorOrArrayOrMap, TensorOrArrayOrMap, TensorOrArrayOrMap]| - Dataset): boolean { - return (typeof (dataset as Dataset).iterator === 'function'); -} - -// Check if provided object is a LazyIterator object by checking it's .next -// element. -function isLazyIteratorObject(iterator: Dataset| - LazyIterator): boolean { - return (typeof (iterator as LazyIterator).next === 'function'); -} - -export async function evaluateDataset( - // Type `model` as `any` here to avoid circular dependency w/ - // training.ts. - // tslint:disable-next-line:no-any - model: any, dataset: Dataset|LazyIterator, - args: ModelEvaluateDatasetArgs): Promise { - args = args || {}; - const hasBatches = args.batches != null; - const f = model.testFunction; - let outs: tfc.Scalar[] = []; - if (args.verbose > 0) { - throw new NotImplementedError('Verbose mode is not implemented yet.'); - } - - tfc.util.assert( - !hasBatches || (args.batches > 0 && Number.isInteger(args.batches)), - () => 'Test loop expects `batches` to be a positive integer, but ' + - `received ${JSON.stringify(args.batches)}`); - const dataIterator = isLazyIteratorObject(dataset) ? - dataset as LazyIterator: - await (dataset as Dataset).iterator(); - // Keeps track of number of examples used in this evaluation. - let numExamples = 0; - let batch = 0; - - while (hasBatches ? batch < args.batches : true) { - const iteratorOut = await dataIterator.next(); - outs = tfc.tidy(() => { - if (iteratorOut.value) { - // TODO(cais): Once real dataset is available, use - // `map(x => standardizeDataIteratorOutput(model, x).map(f)`. - const {xs, ys} = - standardizeDataIteratorOutput(model, iteratorOut.value); - const xsAndYs = xs.concat(ys); - const batchOuts = tfc.tidy(() => f(xsAndYs)); - tfc.dispose(xsAndYs); - - if (batch === 0) { - for (let i = 0; i < batchOuts.length; ++i) { - outs.push(scalar(0)); - } - } - - const batchSize = xsAndYs[0].shape[0]; - for (let i = 0; i < batchOuts.length; ++i) { - const batchOut = batchOuts[i]; - const oldScalar = outs[i]; - outs[i] = - tfc.tidy(() => tfc.add(outs[i], tfc.mul(batchSize, batchOut))); - if (batch > 0) { - tfc.dispose(oldScalar); - } - } - tfc.dispose(batchOuts); - numExamples += batchSize; - - ++batch; - } - return outs; - }); - - if (iteratorOut.done) { - if (hasBatches) { - console.warn( - 'Your dataset iterator ran out of data during evaluateDataset(). ' + - 'Interrupting evalution. Make sure that your ' + - 'dataset can generate at least `batches` ' + - `batches (in this case, ${args.batches} batches). ` + - 'You may need to use the repeat() function when building ' + - 'your dataset.'); - } - break; - } - } - - for (let i = 0; i < outs.length; ++i) { - const oldScalar = outs[i]; - outs[i] = tfc.div(outs[i], numExamples); - tfc.dispose(oldScalar); - } - - return singletonOrArray(outs); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts deleted file mode 100644 index a98753846..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts +++ /dev/null @@ -1,633 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Interfaces and methods for training models using tf.Tensor objects. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {Scalar, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core'; - -import {expandDims, gather, sliceAlongFirstAxis} from '../backend/tfjs_backend'; -import {BaseCallback, configureCallbacks, CustomCallbackArgs, History, ModelLoggingVerbosity, standardizeCallbacks, YieldEveryOptions} from '../base_callbacks'; -import {NotImplementedError, ValueError} from '../errors'; -import {disposeTensorsInLogs, UnresolvedLogs} from '../logs'; -import {range} from '../utils/math_utils'; -import {ClassWeight, ClassWeightMap} from './training_utils'; - -/** - * Interface configuration model training based on data as `tf.Tensor`s. - */ -export interface ModelFitArgs { - /** - * Number of samples per gradient update. If unspecified, it - * will default to 32. - */ - batchSize?: number; - - /** - * Integer number of times to iterate over the training data arrays. - */ - epochs?: number; - - /** - * Verbosity level. - * - * Expected to be 0, 1, or 2. Default: 1. - * - * 0 - No printed message during fit() call. - * 1 - In Node.js (tfjs-node), prints the progress bar, together with - * real-time updates of loss and metric values and training speed. - * In the browser: no action. This is the default. - * 2 - Not implemented yet. - */ - verbose?: ModelLoggingVerbosity; - - /** - * List of callbacks to be called during training. - * Can have one or more of the following callbacks: - * - `onTrainBegin(logs)`: called when training starts. - * - `onTrainEnd(logs)`: called when training ends. - * - `onEpochBegin(epoch, logs)`: called at the start of every epoch. - * - `onEpochEnd(epoch, logs)`: called at the end of every epoch. - * - `onBatchBegin(batch, logs)`: called at the start of every batch. - * - `onBatchEnd(batch, logs)`: called at the end of every batch. - * - `onYield(epoch, batch, logs)`: called every `yieldEvery` milliseconds - * with the current epoch, batch and logs. The logs are the same - * as in `onBatchEnd()`. Note that `onYield` can skip batches or - * epochs. See also docs for `yieldEvery` below. - */ - callbacks?: BaseCallback[]|CustomCallbackArgs|CustomCallbackArgs[]; - - /** - * Float between 0 and 1: fraction of the training data - * to be used as validation data. The model will set apart this fraction of - * the training data, will not train on it, and will evaluate the loss and - * any model metrics on this data at the end of each epoch. - * The validation data is selected from the last samples in the `x` and `y` - * data provided, before shuffling. - */ - validationSplit?: number; - - /** - * Data on which to evaluate the loss and any model - * metrics at the end of each epoch. The model will not be trained on this - * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal, - * valSampleWeights]. The model will not be trained on this data. - * `validationData` will override `validationSplit`. - */ - validationData?: [ - Tensor|Tensor[], Tensor|Tensor[] - ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]]; - - /** - * Whether to shuffle the training data before each epoch. Has - * no effect when `stepsPerEpoch` is not `null`. - */ - shuffle?: boolean; - - /** - * Optional object mapping class indices (integers) to - * a weight (float) to apply to the model's loss for the samples from this - * class during training. This can be useful to tell the model to "pay more - * attention" to samples from an under-represented class. - * - * If the model has multiple outputs, a class weight can be specified for - * each of the outputs by setting this field an array of weight object - * or a object that maps model output names (e.g., `model.outputNames[0]`) - * to weight objects. - */ - classWeight?: ClassWeight|ClassWeight[]|ClassWeightMap; - - /** - * Optional array of the same length as x, containing - * weights to apply to the model's loss for each sample. In the case of - * temporal data, you can pass a 2D array with shape (samples, - * sequenceLength), to apply a different weight to every timestep of every - * sample. In this case you should make sure to specify - * sampleWeightMode="temporal" in compile(). - */ - sampleWeight?: Tensor; - - /** - * Epoch at which to start training (useful for resuming a previous training - * run). When this is used, `epochs` is the index of the "final epoch". - * The model is not trained for a number of iterations given by `epochs`, - * but merely until the epoch of index `epochs` is reached. - */ - initialEpoch?: number; - - /** - * Total number of steps (batches of samples) before - * declaring one epoch finished and starting the next epoch. When training - * with Input Tensors such as TensorFlow data tensors, the default `null` is - * equal to the number of unique samples in your dataset divided by the - * batch size, or 1 if that cannot be determined. - */ - stepsPerEpoch?: number; - - /** - * Only relevant if `stepsPerEpoch` is specified. Total number of steps - * (batches of samples) to validate before stopping. - */ - validationSteps?: number; - - /** - * Configures the frequency of yielding the main thread to other tasks. - * - * In the browser environment, yielding the main thread can improve the - * responsiveness of the page during training. In the Node.js environment, - * it can ensure tasks queued in the event loop can be handled in a timely - * manner. - * - * The value can be one of the following: - * - `'auto'`: The yielding happens at a certain frame rate (currently set - * at 125ms). This is the default. - * - `'batch'`: yield every batch. - * - `'epoch'`: yield every epoch. - * - any `number`: yield every `number` milliseconds. - * - `'never'`: never yield. (yielding can still happen through `await - * nextFrame()` calls in custom callbacks.) - */ - yieldEvery?: YieldEveryOptions; -} - -export function checkBatchSize(batchSize: number) { - tfc.util.assert( - batchSize > 0 && Number.isInteger(batchSize), - () => `batchSize is required to be a positive integer, but got ${ - batchSize}`); -} - -/** - * Slice a Tensor or an Array of Tensors, by start and stop indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArraysByIndices()` together. - * - * @param arrays: the input. - * @param start: the starting index (inclusive). - * @param stop: the stopping index (exclusive). - * @returns The result of the slicing. If `arrays` is an `Array` of - * `tf.Tensor`s, the slicing will be applied to all elements of the `Array` - * in the same way. - */ -export function sliceArrays( - arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] { - if (arrays == null) { - return [null]; - } else if (Array.isArray(arrays)) { - return arrays.map(array => sliceAlongFirstAxis(array, start, stop - start)); - } else { // Tensor. - return sliceAlongFirstAxis(arrays, start, stop - start); - } -} - -/** - * Slice a Tensor or an Array of Tensors, by random-order indices. - * - * Porting Note: The `_slice_arrays` function in PyKeras is covered by this - * function and `sliceArrays()` together. - * - * @param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice. - * If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the - * same fashion. - * @param indices The indices to use for slicing along the first (batch) - * dimension. - * @returns Result(s) of the slicing. - */ -export function sliceArraysByIndices( - arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] { - return tfc.tidy(() => { - if (arrays == null) { - return null; - } else if (Array.isArray(arrays)) { - return arrays.map( - array => (sliceArraysByIndices(array, indices) as Tensor)); - } else { - // TODO(cais): indices should be a pre-constructed Tensor1D to avoid - // tensor1d() calls. - return gather( - arrays, indices.dtype === 'int32' ? indices : indices.toInt()); - } - }); -} - -/** - * Returns a list of batch indices (tuples of indices). - * @param size: Integer, total size of the data to slice into batches. - * @param batchSize: Integer, batch size. - * @returns An Array of [batchStart, batchEnd] tuples. batchStart is - * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x - * that satisfy batchStart <= x < batchEnd. - */ -export function makeBatches( - size: number, batchSize: number): Array<[number, number]> { - const output: Array<[number, number]> = []; - let batchStart = 0; - let batchEnd: number = null; - while (batchStart < size) { - batchEnd = batchStart + batchSize; - if (batchEnd >= size) { - batchEnd = size; - } - output.push([batchStart, batchEnd]); - batchStart = batchEnd; - } - return output; -} - -/** - * Abstract fit function for `f(ins)`. - * @param f A Function returning a list of tensors. For training, this - * function is expected to perform the updates to the variables. - * @param ins List of tensors to be fed to `f`. - * @param outLabels List of strings, display names of the outputs of `f`. - * @param batchSize Integer batch size or `== null` if unknown. Default : 32. - * @param epochs Number of times to iterate over the data. Default : 1. - * @param verbose Verbosity mode: 0, 1, or 2. Default: 1. - * @param callbacks List of callbacks to be called during training. - * @param valF Function to call for validation. - * @param valIns List of tensors to be fed to `valF`. - * @param shuffle Whether to shuffle the data at the beginning of every - * epoch. Default : true. - * @param callbackMetrics List of strings, the display names of the metrics - * passed to the callbacks. They should be the concatenation of the - * display names of the outputs of `f` and the list of display names - * of the outputs of `valF`. - * @param initialEpoch Epoch at which to start training (useful for - * resuming a previous training run). Default : 0. - * @param stepsPerEpoch Total number of steps (batches on samples) before - * declaring one epoch finished and starting the next epoch. Ignored with - * the default value of `undefined` or `null`. - * @param validationSteps Number of steps to run validation for (only if - * doing validation from data tensors). Not applicable for tfjs-layers. - * @returns A `History` object. - */ -async function fitLoop( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model: any, f: (data: Tensor[]) => Scalar[], ins: Tensor[], - outLabels?: string[], batchSize?: number, epochs?: number, verbose?: number, - callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[], - valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[], - initialEpoch?: number, stepsPerEpoch?: number, - validationSteps?: number): Promise { - if (batchSize == null) { - batchSize = 32; - } - if (epochs == null) { - epochs = 1; - } - if (shuffle == null) { - shuffle = true; - } - if (initialEpoch == null) { - initialEpoch = 0; - } - - // TODO(cais): Change const to let below when implementing validation. - let doValidation = false; - if (valF != null && valIns != null) { - doValidation = true; - // TODO(cais): verbose message. - } - if (validationSteps != null) { - doValidation = true; - if (stepsPerEpoch == null) { - throw new ValueError( - 'Can only use `validationSteps` when doing step-wise training, ' + - 'i.e., `stepsPerEpoch` must be set.'); - } - } - - const numTrainSamples = - model.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); - let indexArray: number[]; - if (numTrainSamples != null) { - indexArray = range(0, numTrainSamples); - } - - if (verbose == null) { - verbose = 1; - } - - const {callbackList, history} = configureCallbacks( - callbacks, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, - batchSize, doValidation, callbackMetrics); - callbackList.setModel(model); - model.history = history; - await callbackList.onTrainBegin(); - model.stopTraining_ = false; - // TODO(cais): Take care of callbacks.validation_data as in PyKeras. - // TODO(cais): Pre-convert feeds for performance as in PyKeras. - - for (let epoch = initialEpoch; epoch < epochs; ++epoch) { - await callbackList.onEpochBegin(epoch); - const epochLogs: UnresolvedLogs = {}; - if (stepsPerEpoch != null) { - throw new NotImplementedError( - 'stepsPerEpoch mode is not implemented yet.'); - } else { - if (shuffle === 'batch') { - throw new NotImplementedError('batch shuffling is not implemneted yet'); - } else if (shuffle) { - util.shuffle(indexArray); - } - // Convert the potentially shuffled indices to Tensor1D, to avoid the - // cost of repeated creation of Array1Ds later on. - const epochIndexArray1D = tensor1d(indexArray); - - const batches = makeBatches(numTrainSamples, batchSize); - for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { - const batchLogs: UnresolvedLogs = {}; - await callbackList.onBatchBegin(batchIndex, batchLogs); - - tfc.tidy(() => { - const batchStart = batches[batchIndex][0]; - const batchEnd = batches[batchIndex][1]; - const batchIds = sliceAlongFirstAxis( - epochIndexArray1D, batchStart, - batchEnd - batchStart) as Tensor1D; - batchLogs['batch'] = batchIndex; - batchLogs['size'] = batchEnd - batchStart; - - // TODO(cais): In ins, train flag can be a number, instead of an - // Tensor? Do we need to handle this in tfjs-layers? - const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[]; - const outs = f(insBatch); - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = outs[i]; - batchLogs[label] = out; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - } - - if (batchIndex === batches.length - 1) { // Last batch. - if (doValidation) { - const valOuts = model.testLoop(valF, valIns, batchSize); - // Porting Notes: In tfjs-layers, valOuts is always an Array. - for (let i = 0; i < outLabels.length; ++i) { - const label = outLabels[i]; - const out = valOuts[i]; - tfc.keep(out); - // TODO(cais): Use scope() to avoid ownership. - epochLogs['val_' + label] = out; - } - } - } - }); - - await callbackList.onBatchEnd(batchIndex, batchLogs); - disposeTensorsInLogs(batchLogs); - - if (model.stopTraining_) { - break; - } - // TODO(cais): return outs as list of Tensor. - } - - epochIndexArray1D.dispose(); - } - // TODO(cais): Run validation at the end of the epoch. - await callbackList.onEpochEnd(epoch, epochLogs); - if (model.stopTraining_) { - break; - } - } - await callbackList.onTrainEnd(); - - await model.history.syncData(); - return model.history; -} - -export async function fitTensors( - // Type `model` as `any` here to avoid circular dependency w/ training.ts. - // tslint:disable-next-line:no-any - model: any, x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]|{[inputName: string]: Tensor}, - args: ModelFitArgs = {}): Promise { - if (model.isTraining) { - throw new Error( - 'Cannot start training because another fit() call is ongoing.'); - } - model.isTraining = true; - let inputs: Tensor[]; - let targets: Tensor[]; - let inputValX: Tensor|Tensor[]; - let inputValY: Tensor|Tensor[]; - let valX: Tensor|Tensor[]; - let valY: Tensor|Tensor[]; - let sampleWeights: Tensor[]; - try { - const batchSize = args.batchSize == null ? 32 : args.batchSize; - checkBatchSize(batchSize); - - // Validate user data. - // TODO(cais): Support sampleWeight. - const checkBatchAxis = false; - const standardizedOuts = - await model.standardizeUserData( - x, y, args.sampleWeight, args.classWeight, checkBatchAxis, - batchSize) as [Tensor[], Tensor[], Tensor[]]; - inputs = standardizedOuts[0]; - targets = standardizedOuts[1]; - sampleWeights = standardizedOuts[2]; - - // Prepare validation data. - let doValidation = false; - let valIns: Tensor[]; - if (args.validationData != null && args.validationData.length > 0) { - doValidation = true; - if (args.validationData.length === 2) { - // config.validationData consists of valX and valY. - inputValX = args.validationData[0]; - inputValY = args.validationData[1]; - } else if (args.validationData.length === 3) { - throw new NotImplementedError( - 'validationData including sample weights is not supported yet.'); - } else { - throw new ValueError( - `When passing validation data, it must contain 2 (valX, valY) ` + - `or 3 (valX, valY, valSampleWeight) items; ` + - `${args.validationData} is invalid.`); - } - - const checkBatchAxis = true; - const valStandardized = - await model.standardizeUserData( - inputValX, inputValY, null, /** Unused sample weights. */ - null, /** Unused class weights. */ - checkBatchAxis, batchSize) as [Tensor[], Tensor[], Tensor[]]; - valX = valStandardized[0]; - valY = valStandardized[1]; - valIns = valX.concat(valY); - // TODO(cais): Add useLearningPhase data properly. - } else if ( - args.validationSplit != null && args.validationSplit > 0 && - args.validationSplit < 1) { - doValidation = true; - // Porting Note: In tfjs-layers, inputs[0] is always a Tensor. - const splitAt = - Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); - const originalBatchSize = inputs[0].shape[0]; - valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[]; - inputs = sliceArrays(inputs, 0, splitAt) as Tensor[]; - valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[]; - targets = sliceArrays(targets, 0, splitAt) as Tensor[]; - // TODO(cais): Once sampleWeights becomes available, slice it to get - // valSampleWeights. - valIns = valX.concat(valY); - - // TODO(cais): Add useLearningPhase data properly. - } else if (args.validationSteps != null) { - doValidation = true; - // TODO(cais): Add useLearningPhase. - } - - const ins = inputs.concat(targets).concat(sampleWeights); - - model.checkTrainableWeightsConsistency(); - - // TODO(cais): Handle use_learning_phase and learning_phase? - - // Porting Note: Here we see a key deviation of tfjs-layers from - // Keras. - // Due to the imperative nature of tfjs-layers' backend (tfjs-core), - // we do not construct symbolic computation graphs to embody the - // training process. Instead, we define a function that performs the - // training action. In PyKeras, the data (inputs and targets) are fed - // through graph placeholders. In tfjs-layers, the data are fed as - // function arguments. Since the function are defined below in the - // scope, we don't have equivalents of PyKeras's - // `_make_train_funciton`. - const trainFunction = model.makeTrainFunction(); - const outLabels = model.getDedupedMetricsNames() as string[]; - - let valFunction: (data: Tensor[]) => Scalar[]; - let callbackMetrics: string[]; - if (doValidation) { - model.makeTestFunction(); - valFunction = model.testFunction; - callbackMetrics = - outLabels.slice().concat(outLabels.map(n => 'val_' + n)); - } else { - valFunction = null; - valIns = []; - callbackMetrics = outLabels.slice(); - } - - const callbacks = standardizeCallbacks(args.callbacks, args.yieldEvery); - const out = await fitLoop( - model, trainFunction, ins, outLabels, batchSize, args.epochs, - args.verbose, callbacks, valFunction, valIns, args.shuffle, - callbackMetrics, args.initialEpoch, null, null); - return out; - } finally { - model.isTraining = false; - // Memory clean up. - disposeNewTensors(inputs, x); - disposeNewTensors(targets, y); - disposeNewTensors(valX as Tensor[], inputValX); - disposeNewTensors(valY as Tensor[], inputValY); - if (sampleWeights != null) { - tfc.dispose(sampleWeights); - } - } - // TODO(cais): Add value to outLabels. -} - -/** - * Ensure tensors all have a rank of at least 2. - * - * If a tensor has a rank of 1, it is dimension-expanded to rank 2. - * If any tensor has a rank of 0 (i.e., is a scalar), an error will be thrown. - */ -export function ensureTensorsRank2OrHigher(tensors: Tensor|Tensor[]): Tensor[] { - const outs: Tensor[] = []; - if (tensors instanceof Tensor) { - tensors = [tensors]; - } - - // Make Tensors at least 2D. - for (let i = 0; i < tensors.length; ++i) { - const tensor = tensors[i]; - if (tensor.rank === 1) { - outs.push(expandDims(tensor, 1)); - } else if (tensor.rank === 0) { - throw new Error( - 'Expected tensor to be at least 1D, but received a 0D tensor ' + - '(scalar).'); - } else { - outs.push(tensor); - } - } - return outs; -} - -/** - * Compare a set of tensors with a reference (old) set, discard the ones - * in the new set that are not present in the reference set. - * - * This method is used for memory clenaup during calls such as - * LayersModel.fit(). - * - * @param tensors New set which may contain Tensors not present in - * `refTensors`. - * @param refTensors Reference Tensor set. - */ -// TODO(cais, kangyizhang): Deduplicate with tfjs-data. -export function disposeNewTensors( - tensors: Tensor|Tensor[]|{[inputName: string]: Tensor}, - refTensors: Tensor|Tensor[]|{[inputName: string]: Tensor}): void { - if (tensors == null) { - return; - } - const oldTensorIds: number[] = []; - if (refTensors instanceof Tensor) { - oldTensorIds.push(refTensors.id); - } else if (Array.isArray(refTensors)) { - refTensors.forEach(t => oldTensorIds.push(t.id)); - } else if (refTensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in refTensors) { - const oldTensor = refTensors[name]; - oldTensorIds.push(oldTensor.id); - } - } - - const tensorsToDispose: Tensor[] = []; - if (tensors instanceof Tensor) { - if (oldTensorIds.indexOf(tensors.id) === -1) { - tensorsToDispose.push(tensors); - } - } else if (Array.isArray(tensors)) { - tensors.forEach(t => { - if (oldTensorIds.indexOf(t.id) === -1) { - tensorsToDispose.push(t); - } - }); - } else if (tensors != null) { - // `oldTensors` is a map from string name to Tensor. - for (const name in tensors) { - const tensor = tensors[name]; - if (oldTensorIds.indexOf(tensor.id) === -1) { - tensorsToDispose.push(tensor); - } - } - } - - tensorsToDispose.forEach(t => { - if (!t.isDisposed) { - t.dispose(); - } - }); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts deleted file mode 100644 index cca8e9350..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {dispose, mul, Tensor, Tensor1D, tensor1d, tidy} from '@tensorflow/tfjs-core'; - -/** - * For multi-class classification problems, this object is designed to store a - * mapping from class index to the "weight" of the class, where higher weighted - * classes have larger impact on loss, accuracy, and other metrics. - * - * This is useful for cases in which you want the model to "pay more attention" - * to examples from an under-represented class, e.g., in unbalanced datasets. - */ -export type ClassWeight = { - [classIndex: number]: number -}; - -/** - * Class weighting for a model with multiple outputs. - * - * This object maps each output name to a class-weighting object. - */ -export type ClassWeightMap = { - [outputName: string]: ClassWeight -}; - -function standardizeSampleOrClassWeights( - xWeight: ClassWeight|ClassWeight[]|ClassWeightMap, outputNames: string[], - weightType: 'sampleWeight'|'classWeight'): ClassWeight[] { - const numOutputs = outputNames.length; - if (xWeight == null || (Array.isArray(xWeight) && xWeight.length === 0)) { - return outputNames.map(name => null); - } - if (numOutputs === 1) { - if (Array.isArray(xWeight) && xWeight.length === 1) { - return xWeight; - } else if (typeof xWeight === 'object' && outputNames[0] in xWeight) { - return [(xWeight as ClassWeightMap)[outputNames[0]]]; - } else { - return [xWeight as ClassWeight]; - } - } - if (Array.isArray(xWeight)) { - if (xWeight.length !== numOutputs) { - throw new Error( - `Provided ${weightType} is an array of ${xWeight.length} ` + - `element(s), but the model has ${numOutputs} outputs. ` + - `Make sure a set of weights is provided for each model output.`); - } - return xWeight; - } else if ( - typeof xWeight === 'object' && Object.keys(xWeight).length > 0 && - typeof (xWeight as ClassWeightMap)[Object.keys(xWeight)[0]] === - 'object') { - const output: ClassWeight[] = []; - outputNames.forEach(outputName => { - if (outputName in xWeight) { - output.push((xWeight as ClassWeightMap)[outputName]); - } else { - output.push(null); - } - }); - return output; - } else { - throw new Error( - `The model has multiple (${numOutputs}) outputs, ` + - `so ${weightType} must be either an array with ` + - `${numOutputs} elements or an object with ${outputNames} keys. ` + - `Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`); - } -} - -/** - * Standardize class weighting objects. - * - * This function takes a single class-weighting object, an array of them, - * or a map from output name to class-weighting object. It compares it to the - * output name(s) of the model, base on which it outputs an array of - * class-weighting objects of which the length matches the number of outputs. - * - * @param classWeight Input class-weighting object(s). - * @param outputNames All output name(s) of the model. - * @return An array of class-weighting objects. The length of the array matches - * the model's number of outputs. - */ -export function standardizeClassWeights( - classWeight: ClassWeight|ClassWeight[]|ClassWeightMap, - outputNames: string[]): ClassWeight[] { - return standardizeSampleOrClassWeights( - classWeight, outputNames, 'classWeight'); -} - -export function standardizeSampleWeights( - classWeight: ClassWeight|ClassWeight[]|ClassWeightMap, - outputNames: string[]): ClassWeight[] { - return standardizeSampleOrClassWeights( - classWeight, outputNames, 'sampleWeight'); -} - -/** - * Standardize by-sample and/or by-class weights for training. - * - * Note that this function operates on one model output at a time. For a model - * with multiple outputs, you must call this function multiple times. - * - * @param y The target tensor that the by-sample and/or by-class weight is for. - * The values of y are assumed to encode the classes, either directly - * as an integer index, or as one-hot encoding. - * @param sampleWeight By-sample weights. - * @param classWeight By-class weights: an object mapping class indices - * (integers) to a weight (float) to apply to the model's loss for the - * samples from this class during training. This can be useful to tell the - * model to "pay more attention" to samples from an under-represented class. - * @param sampleWeightMode The mode for the sample weights. - * @return A Promise of weight tensor, of which the size of the first dimension - * matches that of `y`. - */ -export async function standardizeWeights( - y: Tensor, sampleWeight?: Tensor, classWeight?: ClassWeight, - sampleWeightMode?: 'temporal'): Promise { - if (sampleWeight != null || sampleWeightMode != null) { - // TODO(cais): Once 'temporal' mode is implemented, document it in the doc - // string. - throw new Error('Support sampleWeight is not implemented yet'); - } - - if (classWeight != null) { - // Apply class weights per sample. - const yClasses: Tensor1D = tidy(() => { - if (y.shape.length === 1) { - // Assume class indices. - return y.clone() as Tensor1D; - } else if (y.shape.length === 2) { - if (y.shape[1] > 1) { - // Assume one-hot encoding of classes. - const axis = 1; - return y.argMax(axis); - } else if (y.shape[1] === 1) { - // Class index. - return y.reshape([y.shape[0]]); - } else { - throw new Error( - `Encountered unexpected last-dimension size (${y.shape[1]}) ` + - `during handling of class weights. The size is expected to be ` + - `>= 1.`); - } - } else { - throw new Error( - `Unexpected rank of target (y) tensor (${y.rank}) during ` + - `handling of class weights. The rank is expected to be 1 or 2.`); - } - }); - - const yClassIndices = Array.from(await yClasses.data()); - dispose(yClasses); - const classSampleWeight: number[] = []; - yClassIndices.forEach(classIndex => { - if (classWeight[classIndex] == null) { - throw new Error( - `classWeight must contain all classes in the training data. ` + - `The class ${classIndex} exists in the data but not in ` + - `classWeight`); - } else { - classSampleWeight.push(classWeight[classIndex]); - } - }); - - return tensor1d(classSampleWeight, 'float32'); - } else { - return null; - } -} - -/** - * Apply per-sample weights on the loss values from a number of samples. - * - * @param losses Loss tensor of shape `[batchSize]`. - * @param sampleWeights Per-sample weight tensor of shape `[batchSize]`. - * @returns Tensor of the same shape as`losses`. - */ -export function computeWeightedLoss(losses: Tensor, sampleWeights: Tensor) { - return mul(losses, sampleWeights); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/errors.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/errors.ts deleted file mode 100644 index f0065a740..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/errors.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Explicit error types. - * - * See the following link for more information about why the code includes - * calls to setPrototypeOf: - * - * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - */ -// tslint:enable - -/** - * Equivalent of Python's AttributeError. - */ -export class AttributeError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AttributeError.prototype); - } -} - -/** - * Equivalent of Python's RuntimeError. - */ -export class RuntimeError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, RuntimeError.prototype); - } -} - -/** - * Equivalent of Python's ValueError. - */ -export class ValueError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, ValueError.prototype); - } -} - -/** - * Equivalent of Python's NotImplementedError. - */ -export class NotImplementedError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, NotImplementedError.prototype); - } -} - -/** - * Equivalent of Python's AssertionError. - */ -export class AssertionError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, AssertionError.prototype); - } -} - -/** - * Equivalent of Python's IndexError. - */ -export class IndexError extends Error { - constructor(message?: string) { - super(message); - // Set the prototype explicitly. - Object.setPrototypeOf(this, IndexError.prototype); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports.ts deleted file mode 100644 index 27fdcbd5c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports.ts +++ /dev/null @@ -1,270 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Exported functions. - */ - -import {io} from '@tensorflow/tfjs-core'; - -import {BaseCallbackConstructor, CallbackConstructorRegistry} from './base_callbacks'; -import {ContainerArgs} from './engine/container'; -import {Input, InputConfig,} from './engine/input_layer'; -import {SymbolicTensor} from './engine/topology'; -import {LayersModel} from './engine/training'; -import {loadLayersModelInternal, Sequential, SequentialArgs} from './models'; - -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). - -// LayersModel and related factory methods. - -/** - * A model is a data structure that consists of `Layers` and defines inputs - * and outputs. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.model` is more generic, supporting an arbitrary graph (without - * cycles) of layers. `tf.sequential` is less generic and supports only a linear - * stack of layers. - * - * When creating a `tf.LayersModel`, specify its input(s) and output(s). Layers - * are used to wire input(s) to output(s). - * - * For example, the following code snippet defines a model consisting of - * two `dense` layers, with 10 and 4 units, respectively. - * - * ```js - * // Define input, which has a size of 5 (not including batch dimension). - * const input = tf.input({shape: [5]}); - * - * // First dense layer uses relu activation. - * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'}); - * // Second dense layer uses softmax activation. - * const denseLayer2 = tf.layers.dense({units: 4, activation: 'softmax'}); - * - * // Obtain the output symbolic tensor by applying the layers on the input. - * const output = denseLayer2.apply(denseLayer1.apply(input)); - * - * // Create the model based on the inputs. - * const model = tf.model({inputs: input, outputs: output}); - * - * // The model can be used for training, evaluation and prediction. - * // For example, the following line runs prediction with the model on - * // some fake data. - * model.predict(tf.ones([2, 5])).print(); - * ``` - * See also: - * `tf.sequential`, `tf.loadLayersModel`. - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export function model(args: ContainerArgs): LayersModel { - return new LayersModel(args); -} - -/** - * Creates a `tf.Sequential` model. A sequential model is any model where the - * outputs of one layer are the inputs to the next layer, i.e. the model - * topology is a simple 'stack' of layers, with no branching or skipping. - * - * This means that the first layer passed to a `tf.Sequential` model should have - * a defined input shape. What that means is that it should have received an - * `inputShape` or `batchInputShape` argument, or for some type of layers - * (recurrent, Dense...) an `inputDim` argument. - * - * The key difference between `tf.model` and `tf.sequential` is that - * `tf.sequential` is less generic, supporting only a linear stack of layers. - * `tf.model` is more generic and supports an arbitrary graph (without - * cycles) of layers. - * - * Examples: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have an input shape defined. - * model.add(tf.layers.dense({units: 32, inputShape: [50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output, which equals - * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the - * // 2nd is the output size of the model's last layer. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * It is also possible to specify a batch size (with potentially undetermined - * batch dimension, denoted by "null") for the first layer using the - * `batchInputShape` key. The following example is equivalent to the above: - * - * ```js - * const model = tf.sequential(); - * - * // First layer must have a defined input shape - * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]})); - * // Afterwards, TF.js does automatic shape inference. - * model.add(tf.layers.dense({units: 4})); - * - * // Inspect the inferred shape of the model's output. - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * You can also use an `Array` of already-constructed `Layer`s to create - * a `tf.Sequential` model: - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 32, inputShape: [50]}), - * tf.layers.dense({units: 4})] - * }); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Models', subheading: 'Creation'} - */ -export function sequential(config?: SequentialArgs): Sequential { - return new Sequential(config); -} - -/** - * Load a model composed of Layer objects, including its topology and optionally - * weights. See the Tutorial named "How to import a Keras Model" for usage - * examples. - * - * This method is applicable to: - * - * 1. Models created with the `tf.layers.*`, `tf.sequential`, and - * `tf.model` APIs of TensorFlow.js and later saved with the - * `tf.LayersModel.save` method. - * 2. Models converted from Keras or TensorFlow tf.keras using the - * [tensorflowjs_converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter). - * - * This mode is *not* applicable to TensorFlow `SavedModel`s or their converted - * forms. For those models, use `tf.loadGraphModel`. - * - * Example 1. Load a model from an HTTP server. - * - * ```js - * const model = await tf.loadLayersModel( - * 'https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * Example 2: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 4. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. For file:// - * (tfjs-node-only), http:// and https:// schemas, the path can be - * either absolute or relative. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A function of the signature `(fraction: number) => void', - * that can be used as the progress callback for the model loading. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - * - * @doc {heading: 'Models', subheading: 'Loading'} - */ -export function loadLayersModel( - pathOrIOHandler: string|io.IOHandler, - options?: io.LoadOptions): Promise { - if (options == null) { - options = {}; - } - return loadLayersModelInternal(pathOrIOHandler, options); -} - -/** - * Used to instantiate an input to a model as a `tf.SymbolicTensor`. - * - * Users should call the `input` factory function for - * consistency with other generator functions. - * - * Example: - * - * ```js - * // Defines a simple logistic regression model with 32 dimensional input - * // and 3 dimensional output. - * const x = tf.input({shape: [32]}); - * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x); - * const model = tf.model({inputs: x, outputs: y}); - * model.predict(tf.ones([2, 32])).print(); - * ``` - * - * Note: `input` is only necessary when using `model`. When using - * `sequential`, specify `inputShape` for the first layer or use `inputLayer` - * as the first layer. - * - * @doc {heading: 'Models', subheading: 'Inputs'} - */ -export function input(config: InputConfig): SymbolicTensor { - return Input(config); -} - -export function registerCallbackConstructor( - verbosityLevel: number, - callbackConstructor: BaseCallbackConstructor): void { - CallbackConstructorRegistry.registerCallbackConstructor( - verbosityLevel, callbackConstructor); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts deleted file mode 100644 index dd73fb3ed..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:disable-next-line:max-line-length -import {Constraint, MaxNorm, MaxNormArgs, MinMaxNorm, MinMaxNormArgs, NonNeg, UnitNorm, UnitNormArgs} from './constraints'; - -/** - * MaxNorm weight constraint. - * - * Constrains the weights incident to each hidden unit - * to have a norm less than or equal to a desired value. - * - * References - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting - * Srivastava, Hinton, et al. - * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Constraints',namespace: 'constraints'} - */ -export function maxNorm(args: MaxNormArgs): Constraint { - return new MaxNorm(args); -} - -/** - * Constrains the weights incident to each hidden unit to have unit norm. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export function unitNorm(args: UnitNormArgs): Constraint { - return new UnitNorm(args); -} - -/** - * Constains the weight to be non-negative. - * - * @doc {heading: 'Constraints', namespace: 'constraints'} - */ -export function nonNeg(): Constraint { - return new NonNeg(); -} - -/** @doc {heading: 'Constraints', namespace: 'constraints'} */ -export function minMaxNorm(config: MinMaxNormArgs): Constraint { - return new MinMaxNorm(config); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts deleted file mode 100644 index 46931eadf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -// tslint:disable-next-line:max-line-length -import {Constant, ConstantArgs, GlorotNormal, GlorotUniform, HeNormal, HeUniform, Identity, IdentityArgs, Initializer, LeCunNormal, LeCunUniform, Ones, Orthogonal, OrthogonalArgs, RandomNormal, RandomNormalArgs, RandomUniform, RandomUniformArgs, SeedOnlyInitializerArgs, TruncatedNormal, TruncatedNormalArgs, VarianceScaling, VarianceScalingArgs, Zeros} from './initializers'; - -/** - * Initializer that generates tensors initialized to 0. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function zeros(): Zeros { - return new Zeros(); -} - -/** - * Initializer that generates tensors initialized to 1. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function ones(): Initializer { - return new Ones(); -} - -/** - * Initializer that generates values initialized to some constant. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function constant(args: ConstantArgs): Initializer { - return new Constant(args); -} - -/** - * Initializer that generates random values initialized to a uniform - * distribution. - * - * Values will be distributed uniformly between the configured minval and - * maxval. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function randomUniform(args: RandomUniformArgs): Initializer { - return new RandomUniform(args); -} - -/** - * Initializer that generates random values initialized to a normal - * distribution. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function randomNormal(args: RandomNormalArgs): Initializer { - return new RandomNormal(args); -} - -/** - * Initializer that generates random values initialized to a truncated normal. - * distribution. - * - * These values are similar to values from a `RandomNormal` except that values - * more than two standard deviations from the mean are discarded and re-drawn. - * This is the recommended initializer for neural network weights and filters. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function truncatedNormal(args: TruncatedNormalArgs): Initializer { - return new TruncatedNormal(args); -} - -/** - * Initializer that generates the identity matrix. - * Only use for square 2D matrices. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function identity(args: IdentityArgs): Initializer { - return new Identity(args); -} - -/** - * Initializer capable of adapting its scale to the shape of weights. - * With distribution=NORMAL, samples are drawn from a truncated normal - * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is: - * - number of input units in the weight tensor, if mode = FAN_IN. - * - number of output units, if mode = FAN_OUT. - * - average of the numbers of input and output units, if mode = FAN_AVG. - * With distribution=UNIFORM, - * samples are drawn from a uniform distribution - * within [-limit, limit], with `limit = sqrt(3 * scale / n)`. - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export function varianceScaling(config: VarianceScalingArgs): Initializer { - return new VarianceScaling(config); -} - -/** - * Glorot uniform initializer, also called Xavier uniform initializer. - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function glorotUniform(args: SeedOnlyInitializerArgs): Initializer { - return new GlorotUniform(args); -} - -/** - * Glorot normal initializer, also called Xavier normal initializer. - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / (fan_in + fan_out))` - * where `fan_in` is the number of input units in the weight tensor - * and `fan_out` is the number of output units in the weight tensor. - * - * Reference: - * Glorot & Bengio, AISTATS 2010 - * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function glorotNormal(args: SeedOnlyInitializerArgs): Initializer { - return new GlorotNormal(args); -} - -/** - * He normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(2 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function heNormal(args: SeedOnlyInitializerArgs): Initializer { - return new HeNormal(args); -} - -/** - * He uniform initializer. - * - * It draws samples from a uniform distribution within [-limit, limit] - * where `limit` is `sqrt(6 / fan_in)` - * where `fanIn` is the number of input units in the weight tensor. - * - * Reference: - * He et al., http://arxiv.org/abs/1502.01852 - * - * @doc {heading: 'Initializers',namespace: 'initializers'} - */ -export function heUniform(args: SeedOnlyInitializerArgs): Initializer { - return new HeUniform(args); -} - -/** - * LeCun normal initializer. - * - * It draws samples from a truncated normal distribution centered on 0 - * with `stddev = sqrt(1 / fanIn)` - * where `fanIn` is the number of input units in the weight tensor. - * - * References: - * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function leCunNormal(args: SeedOnlyInitializerArgs): Initializer { - return new LeCunNormal(args); -} - -/** - * LeCun uniform initializer. - * - * It draws samples from a uniform distribution in the interval - * `[-limit, limit]` with `limit = sqrt(3 / fanIn)`, - * where `fanIn` is the number of input units in the weight tensor. - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function leCunUniform(args: SeedOnlyInitializerArgs): Initializer { - return new LeCunUniform(args); -} - -/** - * Initializer that generates a random orthogonal matrix. - * - * Reference: - * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120) - * - * @doc {heading: 'Initializers', namespace: 'initializers'} - */ -export function orthogonal(args: OrthogonalArgs): Initializer { - return new Orthogonal(args); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts deleted file mode 100755 index c5ff8da6f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts +++ /dev/null @@ -1,1699 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {InputLayer, InputLayerArgs} from './engine/input_layer'; -import {Layer, LayerArgs} from './engine/topology'; -import {input} from './exports'; -import {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations'; -import {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional'; -import {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise'; -import {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent'; -import {Activation, ActivationLayerArgs, Dense, DenseLayerArgs, Dropout, DropoutLayerArgs, Flatten, FlattenLayerArgs, Masking, MaskingArgs, Permute, PermuteLayerArgs, RepeatVector, RepeatVectorLayerArgs, Reshape, ReshapeLayerArgs, SpatialDropout1D, SpatialDropout1DLayerConfig} from './layers/core'; -import {Embedding, EmbeddingLayerArgs} from './layers/embeddings'; -import {Add, Average, Concatenate, ConcatenateLayerArgs, Dot, DotLayerArgs, Maximum, Minimum, Multiply} from './layers/merge'; -import {AlphaDropout, AlphaDropoutArgs, GaussianDropout, GaussianDropoutArgs, GaussianNoise, GaussianNoiseArgs} from './layers/noise'; -import {BatchNormalization, BatchNormalizationLayerArgs, LayerNormalization, LayerNormalizationLayerArgs} from './layers/normalization'; -import {ZeroPadding2D, ZeroPadding2DLayerArgs} from './layers/padding'; -import {AveragePooling1D, AveragePooling2D, AveragePooling3D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerArgs, MaxPooling1D, MaxPooling2D, MaxPooling3D, Pooling1DLayerArgs, Pooling2DLayerArgs, Pooling3DLayerArgs} from './layers/pooling'; -import {GRU, GRUCell, GRUCellLayerArgs, GRULayerArgs, LSTM, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs, StackedRNNCells, StackedRNNCellsArgs} from './layers/recurrent'; -import {Bidirectional, BidirectionalLayerArgs, TimeDistributed, WrapperLayerArgs} from './layers/wrappers'; - -// TODO(cais): Add doc string to all the public static functions in this -// class; include exectuable JavaScript code snippets where applicable -// (b/74074458). - -// Input Layer. -/** - * An input layer is an entry point into a `tf.LayersModel`. - * - * `InputLayer` is generated automatically for `tf.Sequential`` models by - * specifying the `inputshape` or `batchInputShape` for the first layer. It - * should not be specified explicitly. However, it can be useful sometimes, - * e.g., when constructing a sequential model from a subset of another - * sequential model's layers. Like the code snippet below shows. - * - * ```js - * // Define a model which simply adds two inputs. - * const model1 = tf.sequential(); - * model1.add(tf.layers.dense({inputShape: [4], units: 3, activation: 'relu'})); - * model1.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * model1.summary(); - * model1.predict(tf.zeros([1, 4])).print(); - * - * // Construct another model, reusing the second layer of `model1` while - * // not using the first layer of `model1`. Note that you cannot add the second - * // layer of `model` directly as the first layer of the new sequential model, - * // because doing so will lead to an error related to the fact that the layer - * // is not an input layer. Instead, you need to create an `inputLayer` and add - * // it to the new sequential model before adding the reused layer. - * const model2 = tf.sequential(); - * // Use an inputShape that matches the input shape of `model1`'s second - * // layer. - * model2.add(tf.layers.inputLayer({inputShape: [3]})); - * model2.add(model1.layers[1]); - * model2.summary(); - * model2.predict(tf.zeros([1, 3])).print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Inputs', namespace: 'layers'} - */ -export function inputLayer(args: InputLayerArgs) { - return new InputLayer(args); -} - -// Advanced Activation Layers. - -/** - * Exponetial Linear Unit (ELU). - * - * It follows: - * `f(x) = alpha * (exp(x) - 1.) for x < 0`, - * `f(x) = x for x >= 0`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Fast and Accurate Deep Network Learning by Exponential Linear Units - * (ELUs)](https://arxiv.org/abs/1511.07289v1) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function elu(args?: ELULayerArgs) { - return new ELU(args); -} - -/** - * Rectified Linear Unit activation function. - * - * Input shape: - * Arbitrary. Use the config field `inputShape` (Array of integers, does - * not include the sample axis) when using this layer as the first layer - * in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function reLU(args?: ReLULayerArgs) { - return new ReLU(args); -} - -/** - * Leaky version of a rectified linear unit. - * - * It allows a small gradient when the unit is not active: - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function leakyReLU(args?: LeakyReLULayerArgs) { - return new LeakyReLU(args); -} - -/** - * Parameterized version of a leaky rectified linear unit. - * - * It follows - * `f(x) = alpha * x for x < 0.` - * `f(x) = x for x >= 0.` - * wherein `alpha` is a trainable weight. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function prelu(args?: PReLULayerArgs) { - return new PReLU(args); -} - -/** - * Softmax activation layer. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function softmax(args?: SoftmaxLayerArgs) { - return new Softmax(args); -} - -/** - * Thresholded Rectified Linear Unit. - * - * It follows: - * `f(x) = x for x > theta`, - * `f(x) = 0 otherwise`. - * - * Input shape: - * Arbitrary. Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * Output shape: - * Same shape as the input. - * - * References: - * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting - * Features](http://arxiv.org/abs/1402.3337) - * - * @doc { - * heading: 'Layers', - * subheading: 'Advanced Activation', - * namespace: 'layers' - * } - */ -export function thresholdedReLU(args?: ThresholdedReLULayerArgs) { - return new ThresholdedReLU(args); -} - -// Convolutional Layers. - -/** - * 1D convolution layer (e.g., temporal convolution). - * - * This layer creates a convolution kernel that is convolved - * with the layer input over a single spatial (or temporal) dimension - * to produce a tensor of outputs. - * - * If `use_bias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, provide an - * `inputShape` argument `Array` or `null`. - * - * For example, `inputShape` would be: - * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors - * - `[null, 128]` for variable-length sequences of 128-dimensional vectors. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv1d(args: ConvLayerArgs) { - return new Conv1D(args); -} - -/** - * 2D convolution layer (e.g. spatial convolution over images). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv2d(args: ConvLayerArgs) { - return new Conv2D(args); -} - -/** - * Transposed convolutional layer (sometimes called Deconvolution). - * - * The need for transposed convolutions generally arises - * from the desire to use a transformation going in the opposite direction of - * a normal convolution, i.e., from something that has the shape of the output - * of some convolution to something that has the shape of its input while - * maintaining a connectivity pattern that is compatible with said - * convolution. - * - * When using this layer as the first layer in a model, provide the - * configuration `inputShape` (`Array` of integers, does not include the - * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in - * `dataFormat: 'channelsLast'`. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`. - * or 4D tensor with shape - * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if `dataFormat` is - * `'channelsFirst'`. or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`. - * - * References: - * - [A guide to convolution arithmetic for deep - * learning](https://arxiv.org/abs/1603.07285v1) - * - [Deconvolutional - * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf) - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv2dTranspose(args: ConvLayerArgs) { - return new Conv2DTranspose(args); -} - -/** - * 3D convolution layer (e.g. spatial convolution over volumes). - * - * This layer creates a convolution kernel that is convolved - * with the layer input to produce a tensor of outputs. - * - * If `useBias` is True, a bias vector is created and added to the outputs. - * - * If `activation` is not `null`, it is applied to the outputs as well. - * - * When using this layer as the first layer in a model, - * provide the keyword argument `inputShape` - * (Array of integers, does not include the sample axis), - * e.g. `inputShape=[128, 128, 128, 1]` for 128x128x128 grayscale volumes - * in `dataFormat='channelsLast'`. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function conv3d(args: ConvLayerArgs) { - return new Conv3D(args); -} - -export function conv3dTranspose(args: ConvLayerArgs): Layer { - return new Conv3DTranspose(args); -} - -/** - * Depthwise separable 2D convolution. - * - * Separable convolution consists of first performing - * a depthwise spatial convolution - * (which acts on each input channel separately) - * followed by a pointwise convolution which mixes together the resulting - * output channels. The `depthMultiplier` argument controls how many - * output channels are generated per input channel in the depthwise step. - * - * Intuitively, separable convolutions can be understood as - * a way to factorize a convolution kernel into two smaller kernels, - * or as an extreme version of an Inception block. - * - * Input shape: - * 4D tensor with shape: - * `[batch, channels, rows, cols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, rows, cols, channels]` if data_format='channelsLast'. - * - * Output shape: - * 4D tensor with shape: - * `[batch, filters, newRows, newCols]` if data_format='channelsFirst' - * or 4D tensor with shape: - * `[batch, newRows, newCols, filters]` if data_format='channelsLast'. - * `rows` and `cols` values might have changed due to padding. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function separableConv2d(args: SeparableConvLayerArgs) { - return new SeparableConv2D(args); -} - -/** - * Cropping layer for 2D input (e.g., image). - * - * This layer can crop an input - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, croppedRows, croppedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, croppedRows, croppedCols]`. - * - * Examples - * ```js - * - * const model = tf.sequential(); - * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]], - * inputShape: [128, 128, 3]})); - * //now output shape is [batch, 124, 124, 3] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function cropping2D(args: Cropping2DLayerArgs) { - return new Cropping2D(args); -} - -/** - * Upsampling layer for 2D inputs. - * - * Repeats the rows and columns of the data - * by size[0] and size[1] respectively. - * - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, rows, cols]` - * - * Output shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, upsampledRows, upsampledCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, upsampledRows, upsampledCols]` - * - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function upSampling2d(args: UpSampling2DLayerArgs) { - return new UpSampling2D(args); -} - -// Convolutional(depthwise) Layers. - -/** - * Depthwise separable 2D convolution. - * - * Depthwise Separable convolutions consists in performing just the first step - * in a depthwise spatial convolution (which acts on each input channel - * separately). The `depthMultplier` argument controls how many output channels - * are generated per input channel in the depthwise step. - * - * @doc {heading: 'Layers', subheading: 'Convolutional', namespace: 'layers'} - */ -export function depthwiseConv2d(args: DepthwiseConv2DLayerArgs) { - return new DepthwiseConv2D(args); -} - -// Basic Layers. - -/** - * Applies an activation function to an output. - * - * This layer applies element-wise activation function. Other layers, notably - * `dense` can also apply activation functions. Use this isolated activation - * function to extract the values before and after the - * activation. For instance: - * - * ```js - * const input = tf.input({shape: [5]}); - * const denseLayer = tf.layers.dense({units: 1}); - * const activationLayer = tf.layers.activation({activation: 'relu6'}); - * - * // Obtain the output symbolic tensors by applying the layers in order. - * const denseOutput = denseLayer.apply(input); - * const activationOutput = activationLayer.apply(denseOutput); - * - * // Create the model based on the inputs. - * const model = tf.model({ - * inputs: input, - * outputs: [denseOutput, activationOutput] - * }); - * - * // Collect both outputs and print separately. - * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); - * denseOut.print(); - * activationOut.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function activation(args: ActivationLayerArgs) { - return new Activation(args); -} - -/** - * Creates a dense (fully connected) layer. - * - * This layer implements the operation: - * `output = activation(dot(input, kernel) + bias)` - * - * `activation` is the element-wise activation function - * passed as the `activation` argument. - * - * `kernel` is a weights matrix created by the layer. - * - * `bias` is a bias vector created by the layer (only applicable if `useBias` - * is `true`). - * - * **Input shape:** - * - * nD `tf.Tensor` with shape: `(batchSize, ..., inputDim)`. - * - * The most common situation would be - * a 2D input with shape `(batchSize, inputDim)`. - * - * **Output shape:** - * - * nD tensor with shape: `(batchSize, ..., units)`. - * - * For instance, for a 2D input with shape `(batchSize, inputDim)`, - * the output would have shape `(batchSize, units)`. - * - * Note: if the input to the layer has a rank greater than 2, then it is - * flattened prior to the initial dot product with the kernel. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function dense(args: DenseLayerArgs) { - return new Dense(args); -} - -/** - * Applies - * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to - * the input. - * - * Dropout consists in randomly setting a fraction `rate` of input units to 0 at - * each update during training time, which helps prevent overfitting. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function dropout(args: DropoutLayerArgs) { - return new Dropout(args); -} - -/** - * Spatial 1D version of Dropout. - * - * This Layer type performs the same function as the Dropout layer, but it drops - * entire 1D feature maps instead of individual elements. For example, if an - * input example consists of 3 timesteps and the feature map for each timestep - * has a size of 4, a `spatialDropout1d` layer may zero out the feature maps - * of the 1st timesteps and 2nd timesteps completely while sparing all feature - * elements of the 3rd timestep. - * - * If adjacent frames (timesteps) are strongly correlated (as is normally the - * case in early convolution layers), regular dropout will not regularize the - * activation and will otherwise just result in merely an effective learning - * rate decrease. In this case, `spatialDropout1d` will help promote - * independence among feature maps and should be used instead. - * - * **Arguments:** - * rate: A floating-point number >=0 and <=1. Fraction of the input elements - * to drop. - * - * **Input shape:** - * 3D tensor with shape `(samples, timesteps, channels)`. - * - * **Output shape:** - * Same as the input shape. - * - * References: - * - [Efficient Object Localization Using Convolutional - * Networks](https://arxiv.org/abs/1411.4280) - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function spatialDropout1d(args: SpatialDropout1DLayerConfig) { - return new SpatialDropout1D(args); -} - -/** - * Flattens the input. Does not affect the batch size. - * - * A `Flatten` layer flattens each batch in its inputs to 1D (making the output - * 2D). - * - * For example: - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const flattenLayer = tf.layers.flatten(); - * // Inspect the inferred output shape of the flatten layer, which - * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the - * // flattening. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(flattenLayer.apply(input).shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function flatten(args?: FlattenLayerArgs) { - return new Flatten(args); -} - -/** - * Repeats the input n times in a new dimension. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]})); - * const x = tf.tensor2d([[10, 20]]); - * // Use the model to do inference on a data point the model hasn't see - * model.predict(x).print(); - * // output shape is now [batch, 2, 4] - * ``` - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function repeatVector(args: RepeatVectorLayerArgs) { - return new RepeatVector(args); -} - -/** - * Reshapes an input to a certain shape. - * - * ```js - * const input = tf.input({shape: [4, 3]}); - * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]}); - * // Inspect the inferred output shape of the Reshape layer, which - * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.) - * console.log(JSON.stringify(reshapeLayer.apply(input).shape)); - * ``` - * - * Input shape: - * Arbitrary, although all dimensions in the input shape must be fixed. - * Use the configuration `inputShape` when using this layer as the - * first layer in a model. - * - * - * Output shape: - * [batchSize, targetShape[0], targetShape[1], ..., - * targetShape[targetShape.length - 1]]. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function reshape(args: ReshapeLayerArgs) { - return new Reshape(args); -} - -/** - * Permutes the dimensions of the input according to a given pattern. - * - * Useful for, e.g., connecting RNNs and convnets together. - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.permute({ - * dims: [2, 1], - * inputShape: [10, 64] - * })); - * console.log(model.outputShape); - * // Now model's output shape is [null, 64, 10], where null is the - * // unpermuted sample (batch) dimension. - * ``` - * - * Input shape: - * Arbitrary. Use the configuration field `inputShape` when using this - * layer as the first layer in a model. - * - * Output shape: - * Same rank as the input shape, but with the dimensions re-ordered (i.e., - * permuted) according to the `dims` configuration of this layer. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function permute(args: PermuteLayerArgs) { - return new Permute(args); -} - -/** - * Maps positive integers (indices) into dense vectors of fixed size. - * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]] - * - * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`. - * - * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength, - * outputDim]`. - * - * @doc {heading: 'Layers', subheading: 'Basic', namespace: 'layers'} - */ -export function embedding(args: EmbeddingLayerArgs) { - return new Embedding(args); -} - -// Merge Layers. - -/** - * Layer that performs element-wise addition on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). The inputs are specified as an - * `Array` when the `apply` method of the `Add` layer instance is called. For - * example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const addLayer = tf.layers.add(); - * const sum = addLayer.apply([input1, input2]); - * console.log(JSON.stringify(sum.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function add(args?: LayerArgs) { - return new Add(args); -} - -/** - * Layer that performs element-wise averaging on an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape, and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const averageLayer = tf.layers.average(); - * const average = averageLayer.apply([input1, input2]); - * console.log(JSON.stringify(average.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function average(args?: LayerArgs) { - return new Average(args); -} - -/** - * Layer that concatenates an `Array` of inputs. - * - * It takes a list of tensors, all of the same shape except for the - * concatenation axis, and returns a single tensor, the concatenation - * of all inputs. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 3]}); - * const concatLayer = tf.layers.concatenate(); - * const output = concatLayer.apply([input1, input2]); - * console.log(JSON.stringify(output.shape)); - * // You get [null, 2, 5], with the first dimension as the undetermined batch - * // dimension. The last dimension (5) is the result of concatenating the - * // last dimensions of the inputs (2 and 3). - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function concatenate(args?: ConcatenateLayerArgs) { - return new Concatenate(args); -} - -/** - * Layer that computes the element-wise maximum an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const maxLayer = tf.layers.maximum(); - * const max = maxLayer.apply([input1, input2]); - * console.log(JSON.stringify(max.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function maximum(args?: LayerArgs) { - return new Maximum(args); -} - -/** - * Layer that computes the element-wise minimum of an `Array` of inputs. - * - * It takes as input a list of tensors, all of the same shape and returns a - * single tensor (also of the same shape). For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const minLayer = tf.layers.minimum(); - * const min = minLayer.apply([input1, input2]); - * console.log(JSON.stringify(min.shape)); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function minimum(args?: LayerArgs) { - return new Minimum(args); -} - -/** - * Layer that multiplies (element-wise) an `Array` of inputs. - * - * It takes as input an Array of tensors, all of the same - * shape, and returns a single tensor (also of the same shape). - * For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const input3 = tf.input({shape: [2, 2]}); - * const multiplyLayer = tf.layers.multiply(); - * const product = multiplyLayer.apply([input1, input2, input3]); - * console.log(product.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function multiply(args?: LayerArgs) { - return new Multiply(args); -} - -/** - * Layer that computes a dot product between samples in two tensors. - * - * E.g., if applied to a list of two tensors `a` and `b` both of shape - * `[batchSize, n]`, the output will be a tensor of shape `[batchSize, 1]`, - * where each entry at index `[i, 0]` will be the dot product between - * `a[i, :]` and `b[i, :]`. - * - * Example: - * - * ```js - * const dotLayer = tf.layers.dot({axes: -1}); - * const x1 = tf.tensor2d([[10, 20], [30, 40]]); - * const x2 = tf.tensor2d([[-1, -2], [-3, -4]]); - * - * // Invoke the layer's apply() method in eager (imperative) mode. - * const y = dotLayer.apply([x1, x2]); - * y.print(); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'} - */ -export function dot(args: DotLayerArgs) { - return new Dot(args); -} - -// Normalization Layers. - -/** - * Batch normalization layer (Ioffe and Szegedy, 2014). - * - * Normalize the activations of the previous layer at each batch, - * i.e. applies a transformation that maintains the mean activation - * close to 0 and the activation standard deviation close to 1. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does - * not include the sample axis) when calling the constructor of this class, - * if this layer is used as a first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Batch Normalization: Accelerating Deep Network Training by Reducing - * Internal Covariate Shift](https://arxiv.org/abs/1502.03167) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export function batchNormalization(args?: BatchNormalizationLayerArgs) { - return new BatchNormalization(args); -} - -/** - * Layer-normalization layer (Ba et al., 2016). - * - * Normalizes the activations of the previous layer for each given example in a - * batch independently, instead of across a batch like in `batchNormalization`. - * In other words, this layer applies a transformation that maintanis the mean - * activation within each example close to0 and activation variance close to 1. - * - * Input shape: - * Arbitrary. Use the argument `inputShape` when using this layer as the first - * layer in a model. - * - * Output shape: - * Same as input. - * - * References: - * - [Layer Normalization](https://arxiv.org/abs/1607.06450) - * - * @doc {heading: 'Layers', subheading: 'Normalization', namespace: 'layers'} - */ -export function layerNormalization(args?: LayerNormalizationLayerArgs) { - return new LayerNormalization(args); -} - -// Padding Layers. - -/** - * Zero-padding layer for 2D input (e.g., image). - * - * This layer can add rows and columns of zeros - * at the top, bottom, left and right side of an image tensor. - * - * Input shape: - * 4D tensor with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, rows, cols, channels]` - * - If `data_format` is `"channels_first"`: - * `[batch, channels, rows, cols]`. - * - * Output shape: - * 4D with shape: - * - If `dataFormat` is `"channelsLast"`: - * `[batch, paddedRows, paddedCols, channels]` - * - If `dataFormat` is `"channelsFirst"`: - * `[batch, channels, paddedRows, paddedCols]`. - * - * @doc {heading: 'Layers', subheading: 'Padding', namespace: 'layers'} - */ -export function zeroPadding2d(args?: ZeroPadding2DLayerArgs) { - return new ZeroPadding2D(args); -} - -// Pooling Layers. - -/** - * Average pooling operation for spatial data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * `tf.avgPool1d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling1d(args: Pooling1DLayerArgs) { - return new AveragePooling1D(args); -} -export function avgPool1d(args: Pooling1DLayerArgs) { - return averagePooling1d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling1d(args: Pooling1DLayerArgs) { - return averagePooling1d(args); -} - -/** - * Average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * `tf.avgPool2d` is an alias. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling2d(args: Pooling2DLayerArgs) { - return new AveragePooling2D(args); -} -export function avgPool2d(args: Pooling2DLayerArgs) { - return averagePooling2d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling2d(args: Pooling2DLayerArgs) { - return averagePooling2d(args); -} - -/** - * Average pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 4D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function averagePooling3d(args: Pooling3DLayerArgs) { - return new AveragePooling3D(args); -} -export function avgPool3d(args: Pooling3DLayerArgs) { - return averagePooling3d(args); -} -// For backwards compatibility. -// See https://github.com/tensorflow/tfjs/issues/152 -export function avgPooling3d(args: Pooling3DLayerArgs) { - return averagePooling3d(args); -} - -/** - * Global average pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalAveragePooling1d(args?: LayerArgs) { - return new GlobalAveragePooling1D(args); -} - -/** - * Global average pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalAveragePooling2d(args: GlobalPooling2DLayerArgs) { - return new GlobalAveragePooling2D(args); -} - -/** - * Global max pooling operation for temporal data. - * - * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`. - * - * Output Shape:2D tensor with shape: `[batchSize, features]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalMaxPooling1d(args?: LayerArgs) { - return new GlobalMaxPooling1D(args); -} - -/** - * Global max pooling operation for spatial data. - * - * Input shape: - * - If `dataFormat` is `CHANNEL_LAST`: - * 4D tensor with shape: `[batchSize, rows, cols, channels]`. - * - If `dataFormat` is `CHANNEL_FIRST`: - * 4D tensor with shape: `[batchSize, channels, rows, cols]`. - * - * Output shape: - * 2D tensor with shape: `[batchSize, channels]`. - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function globalMaxPooling2d(args: GlobalPooling2DLayerArgs) { - return new GlobalMaxPooling2D(args); -} - -/** - * Max pooling operation for temporal data. - * - * Input shape: `[batchSize, inLength, channels]` - * - * Output shape: `[batchSize, pooledLength, channels]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling1d(args: Pooling1DLayerArgs) { - return new MaxPooling1D(args); -} - -/** - * Max pooling operation for spatial data. - * - * Input shape - * - If `dataFormat === CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, rows, cols, channels]` - * - If `dataFormat === CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, rows, cols]` - * - * Output shape - * - If `dataFormat=CHANNEL_LAST`: - * 4D tensor with shape: - * `[batchSize, pooleRows, pooledCols, channels]` - * - If `dataFormat=CHANNEL_FIRST`: - * 4D tensor with shape: - * `[batchSize, channels, pooleRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling2d(args: Pooling2DLayerArgs) { - return new MaxPooling2D(args); -} - -/** - * Max pooling operation for 3D data. - * - * Input shape - * - If `dataFormat === channelsLast`: - * 5D tensor with shape: - * `[batchSize, depths, rows, cols, channels]` - * - If `dataFormat === channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, depths, rows, cols]` - * - * Output shape - * - If `dataFormat=channelsLast`: - * 5D tensor with shape: - * `[batchSize, pooledDepths, pooledRows, pooledCols, channels]` - * - If `dataFormat=channelsFirst`: - * 5D tensor with shape: - * `[batchSize, channels, pooledDepths, pooledRows, pooledCols]` - * - * @doc {heading: 'Layers', subheading: 'Pooling', namespace: 'layers'} - */ -export function maxPooling3d(args: Pooling3DLayerArgs) { - return new MaxPooling3D(args); -} - -// Recurrent Layers. - -/** - * Gated Recurrent Unit - Cho et al. 2014. - * - * This is an `RNN` layer consisting of one `GRUCell`. However, unlike - * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.gru({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `GRUCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function gru(args: GRULayerArgs) { - return new GRU(args); -} - -/** - * Cell class for `GRU`. - * - * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `GRU` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.gruCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.gruCell({units: 4}), - * tf.layers.gruCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `gruCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `GRUCell`, use the - * `tf.layers.gru`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function gruCell(args: GRUCellLayerArgs) { - return new GRUCell(args); -} - -/** - * Long-Short Term Memory layer - Hochreiter 1997. - * - * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike - * the underlying `LSTMCell`, the `apply` method of `LSTM` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const lstm = tf.layers.lstm({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = lstm.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `LSTMCell`'s number of units. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function lstm(args: LSTMLayerArgs) { - return new LSTM(args); -} - -/** - * Cell class for `LSTM`. - * - * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `LSTM` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.lstmCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.lstmCell({units: 4}), - * tf.layers.lstmCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `lstmCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `LSTMCell`, use the - * `tf.layers.lstm`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function lstmCell(args: LSTMCellLayerArgs) { - return new LSTMCell(args); -} - -/** - * Fully-connected RNN where the output is to be fed back to input. - * - * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike - * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates - * on a sequence of inputs. The shape of the input (not including the first, - * batch dimension) needs to be at least 2-D, with the first dimension being - * time steps. For example: - * - * ```js - * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true}); - * - * // Create an input with 10 time steps. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the `SimpleRNNCell`'s number of units. - * ``` - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function simpleRNN(args: SimpleRNNLayerArgs) { - return new SimpleRNN(args); -} - -/** - * Cell class for `SimpleRNN`. - * - * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its - * `apply` method takes the input data of only a single time step and returns - * the cell's output at the time step, while `SimpleRNN` takes the input data - * over a number of time steps. For example: - * - * ```js - * const cell = tf.layers.simpleRNNCell({units: 2}); - * const input = tf.input({shape: [10]}); - * const output = cell.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10]: This is the cell's output at a single time step. The 1st - * // dimension is the unknown batch size. - * ``` - * - * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The - * most typical use of this workflow is to combine a number of cells into a - * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an - * RNN. For example: - * - * ```js - * const cells = [ - * tf.layers.simpleRNNCell({units: 4}), - * tf.layers.simpleRNNCell({units: 8}), - * ]; - * const rnn = tf.layers.rnn({cell: cells, returnSequences: true}); - * - * // Create an input with 10 time steps and a length-20 vector at each step. - * const input = tf.input({shape: [10, 20]}); - * const output = rnn.apply(input); - * - * console.log(JSON.stringify(output.shape)); - * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the - * // same as the sequence length of `input`, due to `returnSequences`: `true`; - * // 3rd dimension is the last `SimpleRNNCell`'s number of units. - * ``` - * - * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the - * `tf.layers.simpleRNN`. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function simpleRNNCell(args: SimpleRNNCellLayerArgs) { - return new SimpleRNNCell(args); -} - -/** - * Convolutional LSTM layer - Xingjian Shi 2015. - * - * This is an `ConvRNN2D` layer consisting of one `ConvLSTM2DCell`. However, - * unlike the underlying `ConvLSTM2DCell`, the `apply` method of `ConvLSTM2D` - * operates on a sequence of inputs. The shape of the input (not including the - * first, batch dimension) needs to be 4-D, with the first dimension being time - * steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const batchSize = 4; - * const sequenceLength = 2; - * const size = 5; - * const channels = 3; - * - * const inputShape = [batchSize, sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const layer = tf.layers.convLstm2d({filters, kernelSize}); - * - * const output = layer.apply(input); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export function convLstm2d(args: ConvLSTM2DArgs) { - return new ConvLSTM2D(args); -} - -/** - * Cell class for `ConvLSTM2D`. - * - * `ConvLSTM2DCell` is distinct from the `ConvRNN2D` subclass `ConvLSTM2D` in - * that its `call` method takes the input data of only a single time step and - * returns the cell's output at the time step, while `ConvLSTM2D` takes the - * input data over a number of time steps. For example: - * - * ```js - * const filters = 3; - * const kernelSize = 3; - * - * const sequenceLength = 1; - * const size = 5; - * const channels = 3; - * - * const inputShape = [sequenceLength, size, size, channels]; - * const input = tf.ones(inputShape); - * - * const cell = tf.layers.convLstm2dCell({filters, kernelSize}); - * - * cell.build(input.shape); - * - * const outputSize = size - kernelSize + 1; - * const outShape = [sequenceLength, outputSize, outputSize, filters]; - * - * const initialH = tf.zeros(outShape); - * const initialC = tf.zeros(outShape); - * - * const [o, h, c] = cell.call([input, initialH, initialC], {}); - * ``` - */ -/** @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} */ -export function convLstm2dCell(args: ConvLSTM2DCellArgs) { - return new ConvLSTM2DCell(args); -} - -/** - * Base class for recurrent layers. - * - * Input shape: - * 3D tensor with shape `[batchSize, timeSteps, inputDim]`. - * - * Output shape: - * - if `returnState`, an Array of tensors (i.e., `tf.Tensor`s). The first - * tensor is the output. The remaining tensors are the states at the - * last time step, each with shape `[batchSize, units]`. - * - if `returnSequences`, the output will have shape - * `[batchSize, timeSteps, units]`. - * - else, the output will have shape `[batchSize, units]`. - * - * Masking: - * This layer supports masking for input data with a variable number - * of timesteps. To introduce masks to your data, - * use an embedding layer with the `mask_zero` parameter - * set to `True`. - * - * Notes on using statefulness in RNNs: - * You can set RNN layers to be 'stateful', which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable statefulness: - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * if sequential model: - * `batchInputShape=[...]` to the first layer in your model. - * else for functional model with 1 or more Input layers: - * `batchShape=[...]` to all the first layers in your model. - * This is the expected shape of your inputs *including the batch size*. - * It should be a tuple of integers, e.g. `(32, 10, 100)`. - * - specify `shuffle=False` when calling fit(). - * - * To reset the states of your model, call `.resetStates()` on either - * a specific layer, or on your entire model. - * - * Note on specifying the initial state of RNNs - * You can specify the initial state of RNN layers symbolically by - * calling them with the option `initialState`. The value of - * `initialState` should be a tensor or list of tensors representing - * the initial state of the RNN layer. - * - * You can specify the initial state of RNN layers numerically by - * calling `resetStates` with the keyword argument `states`. The value of - * `states` should be a numpy array or list of numpy arrays representing - * the initial state of the RNN layer. - * - * Note on passing external constants to RNNs - * You can pass "external" constants to the cell using the `constants` - * keyword argument of `RNN.call` method. This requires that the `cell.call` - * method accepts the same keyword argument `constants`. Such constants - * can be used to conditon the cell transformation on additional static inputs - * (not changing over time), a.k.a an attention mechanism. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function rnn(args: RNNLayerArgs) { - return new RNN(args); -} - -/** - * Wrapper allowing a stack of RNN cells to behave as a single cell. - * - * Used to implement efficient stacked RNNs. - * - * @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'} - */ -export function stackedRNNCells(args: StackedRNNCellsArgs){ - return new StackedRNNCells(args); -} - -// Wrapper Layers. - -/** @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} */ -export function bidirectional(args: BidirectionalLayerArgs) { - return new Bidirectional(args); -} - -/** - * This wrapper applies a layer to every temporal slice of an input. - * - * The input should be at least 3D, and the dimension of the index `1` will be - * considered to be the temporal dimension. - * - * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors - * of 16 dimensions. The batch input shape of the layer is then `[32, 10, - * 16]`, and the `inputShape`, not including the sample dimension, is - * `[10, 16]`. - * - * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10 - * timesteps, independently: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.dense({units: 8}), - * inputShape: [10, 16], - * })); - * - * // Now model.outputShape = [null, 10, 8]. - * // The output will then have shape `[32, 10, 8]`. - * - * // In subsequent layers, there is no need for `inputShape`: - * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})})); - * console.log(JSON.stringify(model.outputs[0].shape)); - * // Now model.outputShape = [null, 10, 32]. - * ``` - * - * The output will then have shape `[32, 10, 32]`. - * - * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for - * instance a `Conv2D` layer. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.timeDistributed({ - * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}), - * inputShape: [10, 299, 299, 3], - * })); - * console.log(JSON.stringify(model.outputs[0].shape)); - * ``` - * - * @doc {heading: 'Layers', subheading: 'Wrapper', namespace: 'layers'} - */ -export function timeDistributed(args: WrapperLayerArgs) { - return new TimeDistributed(args); -} - -// Aliases for pooling. -export const globalMaxPool1d = globalMaxPooling1d; -export const globalMaxPool2d = globalMaxPooling2d; -export const maxPool1d = maxPooling1d; -export const maxPool2d = maxPooling2d; - -export {Layer, RNN, RNNCell, input /* alias for tf.input */}; - -/** - * Apply additive zero-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * This is useful to mitigate overfitting - * (you could see it as a form of random data augmentation). - * Gaussian Noise (GS) is a natural choice as corruption process - * for real valued inputs. - * - * # Arguments - * stddev: float, standard deviation of the noise distribution. - * - * # Input shape - * Arbitrary. Use the keyword argument `input_shape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * # Output shape - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function gaussianNoise(args: GaussianNoiseArgs) { - return new GaussianNoise(args); -} - -/** - * Apply multiplicative 1-centered Gaussian noise. - * - * As it is a regularization layer, it is only active at training time. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting]( - * http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function gaussianDropout(args: GaussianDropoutArgs) { - return new GaussianDropout(args); -} - -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @doc {heading: 'Layers', subheading: 'Noise', namespace: 'layers'} - */ -export function alphaDropout(args: AlphaDropoutArgs) { - return new AlphaDropout(args); -} - -/** - * Masks a sequence by using a mask value to skip timesteps. - * - * If all features for a given sample timestep are equal to `mask_value`, - * then the sample timestep will be masked (skipped) in all downstream layers - * (as long as they support masking). - * - * If any downstream layer does not support masking yet receives such - * an input mask, an exception will be raised. - * - * Arguments: - * - `maskValue`: Either None or mask value to skip. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * @doc {heading: 'Layers', subheading: 'Mask', namespace: 'layers'} - */ -export function masking(args?: MaskingArgs) { - return new Masking(args); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts deleted file mode 100644 index 015aaa4ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts +++ /dev/null @@ -1,316 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import {Tensor} from '@tensorflow/tfjs-core'; - -import * as losses from './losses'; -import * as metrics from './metrics'; - -/** - * Binary accuracy metric function. - * - * `yTrue` and `yPred` can have 0-1 values. Example: - * ```js - * const x = tf.tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]); - * const y = tf.tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in - * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e., - * a value >= 0.5 and <= 1.0 is interpreted as 1. - * ) - * Example: - * ```js - * const x = tf.tensor1d([1, 1, 1, 1, 0, 0, 0, 0]); - * const y = tf.tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]); - * const accuracy = tf.metrics.binaryAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.binaryAccuracy(yTrue, yPred); -} - -/** - * Binary crossentropy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0], [1], [1], [1]]); - * const y = tf.tensor2d([[0], [0], [0.5], [1]]); - * const crossentropy = tf.metrics.binaryCrossentropy(x, y); - * crossentropy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth. - * @param yPred Binary Tensor of prediction, probabilities for the `1` case. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.binaryCrossentropy(yTrue, yPred); -} - -/** - * Sparse categorical accuracy metric function. - * - * Example: - * ```js - * - * const yTrue = tf.tensor1d([1, 1, 2, 2, 0]); - * const yPred = tf.tensor2d( - * [[0, 1, 0], [1, 0, 0], [0, 0.4, 0.6], [0, 0.6, 0.4], [0.7, 0.3, 0]]); - * const crossentropy = tf.metrics.sparseCategoricalAccuracy(yTrue, yPred); - * crossentropy.print(); - * ``` - * - * @param yTrue True labels: indices. - * @param yPred Predicted probabilities or logits. - * @returns Accuracy tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function sparseCategoricalAccuracy( - yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.sparseCategoricalAccuracy(yTrue, yPred); -} - -/** - * Categorical accuracy metric function. - * - * Example: - * ```js - * const x = tf.tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]); - * const y = tf.tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]); - * const accuracy = tf.metrics.categoricalAccuracy(x, y); - * accuracy.print(); - * ``` - * - * @param yTrue Binary Tensor of truth: one-hot encoding of categories. - * @param yPred Binary Tensor of prediction: probabilities or logits for the - * same categories as in `yTrue`. - * @return Accuracy Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.categoricalAccuracy(yTrue, yPred); -} - -/** - * Categorical crossentropy between an output tensor and a target tensor. - * - * @param target A tensor of the same shape as `output`. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.categoricalCrossentropy(yTrue, yPred); -} - -/** - * Computes the precision of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const precision = tf.metrics.precision(x, y); - * precision.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Precision Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function precision(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.precision(yTrue, yPred); -} - -/** - * Computes the recall of the predictions with respect to the labels. - * - * Example: - * ```js - * const x = tf.tensor2d( - * [ - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [1, 0, 0, 0], - * [0, 0, 1, 0] - * ] - * ); - * - * const y = tf.tensor2d( - * [ - * [0, 0, 1, 0], - * [0, 1, 0, 0], - * [0, 0, 0, 1], - * [0, 1, 0, 0], - * [0, 1, 0, 0] - * ] - * ); - * - * const recall = tf.metrics.recall(x, y); - * recall.print(); - * ``` - * - * @param yTrue The ground truth values. Expected to be contain only 0-1 values. - * @param yPred The predicted values. Expected to be contain only 0-1 values. - * @return Recall Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function recall(yTrue: Tensor, yPred: Tensor): Tensor { - return metrics.recall(yTrue, yPred); -} - -/** - * Loss or metric function: Cosine proximity. - * - * Mathematically, cosine proximity is defined as: - * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`, - * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*` - * represents element-wise multiplication. - * - * ```js - * const yTrue = tf.tensor2d([[1, 0], [1, 0]]); - * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]); - * const proximity = tf.metrics.cosineProximity(yTrue, yPred); - * proximity.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Cosine proximity Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.cosineProximity(yTrue, yPred); -} - -/** - * Loss or metric function: Mean absolute error. - * - * Mathematically, mean absolute error is defined as: - * `mean(abs(yPred - yTrue))`, - * wherein the `mean` is applied over feature dimensions. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]); - * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]); - * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred); - * mse.print(); - * ``` - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanAbsoluteError(yTrue, yPred); -} - -/** - * Loss or metric function: Mean absolute percentage error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [10, 20]]); - * const yPred = tf.tensor2d([[0, 1], [11, 24]]); - * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean absolute percentage error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanAbsolutePercentageError( - yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} - -export function MAPE(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} - -export function mape(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanAbsolutePercentageError(yTrue, yPred); -} - -/** - * Loss or metric function: Mean squared error. - * - * ```js - * const yTrue = tf.tensor2d([[0, 1], [3, 4]]); - * const yPred = tf.tensor2d([[0, 1], [-3, -4]]); - * const mse = tf.metrics.meanSquaredError(yTrue, yPred); - * mse.print(); - * ``` - * - * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`. - * - * @param yTrue Truth Tensor. - * @param yPred Prediction Tensor. - * @return Mean squared error Tensor. - * - * @doc {heading: 'Metrics', namespace: 'metrics'} - */ -export function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanSquaredError(yTrue, yPred); -} - -export function MSE(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanSquaredError(yTrue, yPred); -} - -export function mse(yTrue: Tensor, yPred: Tensor): Tensor { - return losses.meanSquaredError(yTrue, yPred); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts deleted file mode 100644 index 68377038f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -export {modelFromJSON} from './models'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts deleted file mode 100644 index eecd0c206..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import * as regularizers from './regularizers'; -// tslint:disable-next-line:max-line-length -import {L1Args, L1L2, L1L2Args, L2Args, Regularizer} from './regularizers'; - -/** - * Regularizer for L1 and L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) + sum(l2 * x^2) - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l1l2(config?: L1L2Args): Regularizer { - return new L1L2(config); -} - -/** - * Regularizer for L1 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l1 * abs(x)) - * @param args l1 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l1(config?: L1Args): Regularizer { - return regularizers.l1(config); -} - -/** - * Regularizer for L2 regularization. - * - * Adds a term to the loss to penalize large weights: - * loss += sum(l2 * x^2) - * @param args l2 config. - * - * @doc {heading: 'Regularizers', namespace: 'regularizers'} - */ -export function l2(config?: L2Args): Regularizer { - return regularizers.l2(config); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/index.ts deleted file mode 100644 index 43bc2a681..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import '@tensorflow/tfjs-core'; -// tslint:disable-next-line:no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; - -// This file lists all exports of TensorFlow.js Layers - -import * as constraints from './exports_constraints'; -import * as initializers from './exports_initializers'; -import * as layers from './exports_layers'; -import * as metrics from './exports_metrics'; -import * as models from './exports_models'; -import * as regularizers from './exports_regularizers'; - -export {CallbackList, CustomCallback, CustomCallbackArgs, History} from './base_callbacks'; -export {Callback, callbacks, EarlyStopping, EarlyStoppingCallbackArgs} from './callbacks'; -export {InputSpec, SymbolicTensor} from './engine/topology'; -export {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training'; -export {ModelFitDatasetArgs} from './engine/training_dataset'; -export {ModelFitArgs} from './engine/training_tensors'; -export {ClassWeight, ClassWeightMap} from './engine/training_utils'; -export {input, loadLayersModel, model, registerCallbackConstructor, sequential} from './exports'; -export {Shape} from './keras_format/common'; -export {GRUCellLayerArgs, GRULayerArgs, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNLayerArgs, SimpleRNNCellLayerArgs, SimpleRNNLayerArgs} from './layers/recurrent'; -export {Logs} from './logs'; -export {ModelAndWeightsConfig, Sequential, SequentialArgs} from './models'; -export {LayerVariable} from './variables'; -export {version as version_layers} from './version'; -export {constraints, initializers, layers, metrics, models, regularizers}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/initializers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/initializers.ts deleted file mode 100644 index d53fca0d4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/initializers.ts +++ /dev/null @@ -1,651 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataType, eye, linalg, mul, ones, randomUniform, scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core'; - -import * as K from './backend/tfjs_backend'; -import {checkDataFormat} from './common'; -import {NotImplementedError, ValueError} from './errors'; -import {DataFormat, Shape} from './keras_format/common'; -import {Distribution, FanMode, VALID_DISTRIBUTION_VALUES, VALID_FAN_MODE_VALUES} from './keras_format/initializer_config'; -import {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils'; -import {arrayProd} from './utils/math_utils'; - -export function checkFanMode(value?: string): void { - checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); -} - -export function checkDistribution(value?: string): void { - checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); -} - -/** - * Initializer base class. - * - * @doc { - * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'} - */ -export abstract class Initializer extends serialization.Serializable { - public fromConfigUsesCustomObjects(): boolean { - return false; - } - /** - * Generate an initial value. - * @param shape - * @param dtype - * @return The init value. - */ - abstract apply(shape: Shape, dtype?: DataType): Tensor; - - getConfig(): serialization.ConfigDict { - return {}; - } -} - -export class Zeros extends Initializer { - /** @nocollapse */ - static className = 'Zeros'; - - apply(shape: Shape, dtype?: DataType): Tensor { - return zeros(shape, dtype); - } -} -serialization.registerClass(Zeros); - -export class Ones extends Initializer { - /** @nocollapse */ - static className = 'Ones'; - - apply(shape: Shape, dtype?: DataType): Tensor { - return ones(shape, dtype); - } -} -serialization.registerClass(Ones); - -export interface ConstantArgs { - /** The value for each element in the variable. */ - value: number; -} - -export class Constant extends Initializer { - /** @nocollapse */ - static className = 'Constant'; - private value: number; - constructor(args: ConstantArgs) { - super(); - if (typeof args !== 'object') { - throw new ValueError( - `Expected argument of type ConstantConfig but got ${args}`); - } - if (args.value === undefined) { - throw new ValueError(`config must have value set but got ${args}`); - } - this.value = args.value; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - return tidy(() => mul(scalar(this.value), ones(shape, dtype))); - } - - getConfig(): serialization.ConfigDict { - return { - value: this.value, - }; - } -} -serialization.registerClass(Constant); - -export interface RandomUniformArgs { - /** Lower bound of the range of random values to generate. */ - minval?: number; - /** Upper bound of the range of random values to generate. */ - maxval?: number; - /** Used to seed the random generator. */ - seed?: number; -} - -export class RandomUniform extends Initializer { - /** @nocollapse */ - static className = 'RandomUniform'; - readonly DEFAULT_MINVAL = -0.05; - readonly DEFAULT_MAXVAL = 0.05; - private minval: number; - private maxval: number; - private seed: number; - - constructor(args: RandomUniformArgs) { - super(); - this.minval = args.minval || this.DEFAULT_MINVAL; - this.maxval = args.maxval || this.DEFAULT_MAXVAL; - this.seed = args.seed; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - return randomUniform(shape, this.minval, this.maxval, dtype); - } - - getConfig(): serialization.ConfigDict { - return {minval: this.minval, maxval: this.maxval, seed: this.seed}; - } -} -serialization.registerClass(RandomUniform); - -export interface RandomNormalArgs { - /** Mean of the random values to generate. */ - mean?: number; - /** Standard deviation of the random values to generate. */ - stddev?: number; - /** Used to seed the random generator. */ - seed?: number; -} - -export class RandomNormal extends Initializer { - /** @nocollapse */ - static className = 'RandomNormal'; - readonly DEFAULT_MEAN = 0.; - readonly DEFAULT_STDDEV = 0.05; - private mean: number; - private stddev: number; - private seed: number; - - constructor(args: RandomNormalArgs) { - super(); - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError( - `randomNormal does not support dType ${dtype}.`); - } - - return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - - getConfig(): serialization.ConfigDict { - return {mean: this.mean, stddev: this.stddev, seed: this.seed}; - } -} -serialization.registerClass(RandomNormal); - -export interface TruncatedNormalArgs { - /** Mean of the random values to generate. */ - mean?: number; - /** Standard deviation of the random values to generate. */ - stddev?: number; - /** Used to seed the random generator. */ - seed?: number; -} - -export class TruncatedNormal extends Initializer { - /** @nocollapse */ - static className = 'TruncatedNormal'; - - readonly DEFAULT_MEAN = 0.; - readonly DEFAULT_STDDEV = 0.05; - private mean: number; - private stddev: number; - private seed: number; - - constructor(args: TruncatedNormalArgs) { - super(); - this.mean = args.mean || this.DEFAULT_MEAN; - this.stddev = args.stddev || this.DEFAULT_STDDEV; - this.seed = args.seed; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError( - `truncatedNormal does not support dType ${dtype}.`); - } - return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); - } - - getConfig(): serialization.ConfigDict { - return {mean: this.mean, stddev: this.stddev, seed: this.seed}; - } -} -serialization.registerClass(TruncatedNormal); - -export interface IdentityArgs { - /** - * Multiplicative factor to apply to the identity matrix. - */ - gain?: number; -} - -export class Identity extends Initializer { - /** @nocollapse */ - static className = 'Identity'; - private gain: number; - constructor(args: IdentityArgs) { - super(); - this.gain = args.gain != null ? args.gain : 1.0; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - return tidy(() => { - if (shape.length !== 2 || shape[0] !== shape[1]) { - throw new ValueError( - 'Identity matrix initializer can only be used for' + - ' 2D square matrices.'); - } else { - return mul(this.gain, eye(shape[0])); - } - }); - } - - getConfig(): serialization.ConfigDict { - return {gain: this.gain}; - } -} -serialization.registerClass(Identity); - -/** - * Computes the number of input and output units for a weight shape. - * @param shape Shape of weight. - * @param dataFormat data format to use for convolution kernels. - * Note that all kernels in Keras are standardized on the - * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST). - * @return An length-2 array: fanIn, fanOut. - */ -function computeFans( - shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] { - let fanIn: number; - let fanOut: number; - checkDataFormat(dataFormat); - if (shape.length === 2) { - fanIn = shape[0]; - fanOut = shape[1]; - } else if ([3, 4, 5].indexOf(shape.length) !== -1) { - if (dataFormat === 'channelsFirst') { - const receptiveFieldSize = arrayProd(shape, 2); - fanIn = shape[1] * receptiveFieldSize; - fanOut = shape[0] * receptiveFieldSize; - } else if (dataFormat === 'channelsLast') { - const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); - fanIn = shape[shape.length - 2] * receptiveFieldSize; - fanOut = shape[shape.length - 1] * receptiveFieldSize; - } - } else { - const shapeProd = arrayProd(shape); - fanIn = Math.sqrt(shapeProd); - fanOut = Math.sqrt(shapeProd); - } - - return [fanIn, fanOut]; -} - -export interface VarianceScalingArgs { - /** Scaling factor (positive float). */ - scale?: number; - - /** Fanning mode for inputs and outputs. */ - mode?: FanMode; - - /** Probabilistic distribution of the values. */ - distribution?: Distribution; - - /** Random number generator seed. */ - seed?: number; -} - -export class VarianceScaling extends Initializer { - /** @nocollapse */ - static className = 'VarianceScaling'; - private scale: number; - private mode: FanMode; - private distribution: Distribution; - private seed: number; - - /** - * Constructor of VarianceScaling. - * @throws ValueError for invalid value in scale. - */ - constructor(args: VarianceScalingArgs) { - super(); - if (args.scale < 0.0) { - throw new ValueError( - `scale must be a positive float. Got: ${args.scale}`); - } - this.scale = args.scale == null ? 1.0 : args.scale; - this.mode = args.mode == null ? 'fanIn' : args.mode; - checkFanMode(this.mode); - this.distribution = - args.distribution == null ? 'normal' : args.distribution; - checkDistribution(this.distribution); - this.seed = args.seed; - } - - apply(shape: Shape, dtype?: DataType): Tensor { - const fans = computeFans(shape); - const fanIn = fans[0]; - const fanOut = fans[1]; - let scale = this.scale; - if (this.mode === 'fanIn') { - scale /= Math.max(1, fanIn); - } else if (this.mode === 'fanOut') { - scale /= Math.max(1, fanOut); - } else { - scale /= Math.max(1, (fanIn + fanOut) / 2); - } - - if (this.distribution === 'normal') { - const stddev = Math.sqrt(scale); - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError( - `${this.getClassName()} does not support dType ${dtype}.`); - } - return truncatedNormal(shape, 0, stddev, dtype, this.seed); - } else { - const limit = Math.sqrt(3 * scale); - return randomUniform(shape, -limit, limit, dtype); - } - } - - getConfig(): serialization.ConfigDict { - return { - scale: this.scale, - mode: this.mode, - distribution: this.distribution, - seed: this.seed - }; - } -} -serialization.registerClass(VarianceScaling); - -export interface SeedOnlyInitializerArgs { - /** Random number generator seed. */ - seed?: number; -} - -export class GlorotUniform extends VarianceScaling { - /** @nocollapse */ - static className = 'GlorotUniform'; - - /** - * Constructor of GlorotUniform - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, GlorotUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(GlorotUniform); - -export class GlorotNormal extends VarianceScaling { - /** @nocollapse */ - static className = 'GlorotNormal'; - - /** - * Constructor of GlorotNormal. - * @param scale - * @param mode - * @param distribution - * @param seed - */ - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 1.0, - mode: 'fanAvg', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, GlorotNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(GlorotNormal); - -export class HeNormal extends VarianceScaling { - /** @nocollapse */ - static className = 'HeNormal'; - - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, HeNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(HeNormal); - -export class HeUniform extends VarianceScaling { - /** @nocollapse */ - static className = 'HeUniform'; - - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 2.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, HeUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(HeUniform); - -export class LeCunNormal extends VarianceScaling { - /** @nocollapse */ - static className = 'LeCunNormal'; - - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'normal', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, LeCunNormal is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(LeCunNormal); - -export class LeCunUniform extends VarianceScaling { - /** @nocollapse */ - static className = 'LeCunNormal'; - - constructor(args?: SeedOnlyInitializerArgs) { - super({ - scale: 1.0, - mode: 'fanIn', - distribution: 'uniform', - seed: args == null ? null : args.seed - }); - } - - getClassName(): string { - // In Python Keras, LeCunUniform is not a class, but a helper method - // that creates a VarianceScaling object. Use 'VarianceScaling' as - // class name to be compatible with that. - return VarianceScaling.className; - } -} -serialization.registerClass(LeCunUniform); - -export interface OrthogonalArgs extends SeedOnlyInitializerArgs { - /** - * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1. - */ - gain?: number; -} - -export class Orthogonal extends Initializer { - /** @nocollapse */ - static className = 'Orthogonal'; - readonly DEFAULT_GAIN = 1; - protected readonly gain: number; - protected readonly seed: number; - - constructor(args?: OrthogonalArgs) { - super(); - this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain; - this.seed = args.seed; - - if (this.seed != null) { - throw new NotImplementedError( - 'Random seed is not implemented for Orthogonal Initializer yet.'); - } - } - - apply(shape: Shape, dtype?: DataType): Tensor { - return tidy(() => { - if (shape.length < 2) { - throw new NotImplementedError('Shape must be at least 2D.'); - } - if (shape[0] * shape[1] > 2000) { - console.warn( - `Orthogonal initializer is being called on a matrix with more ` + - `than 2000 (${shape[0] * shape[1]}) elements: ` + - `Slowness may result.`); - } - - // TODO(cais): Add seed support. - const normalizedShape = - shape[0] > shape[1] ? [shape[1], shape[0]] : shape; - const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D; - let q = linalg.gramSchmidt(a) as Tensor2D; - if (shape[0] > shape[1]) { - q = q.transpose(); - } - return mul(this.gain, q); - }); - } - - getConfig(): serialization.ConfigDict { - return { - gain: this.gain, - seed: this.seed, - }; - } -} -serialization.registerClass(Orthogonal); - -/** @docinline */ -export type InitializerIdentifier = - 'constant'|'glorotNormal'|'glorotUniform'|'heNormal'|'heUniform'|'identity'| - 'leCunNormal'|'leCunUniform'|'ones'|'orthogonal'|'randomNormal'| - 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string; - -// Maps the JavaScript-like identifier keys to the corresponding registry -// symbols. -export const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: - {[identifier in InitializerIdentifier]: string} = { - 'constant': 'Constant', - 'glorotNormal': 'GlorotNormal', - 'glorotUniform': 'GlorotUniform', - 'heNormal': 'HeNormal', - 'heUniform': 'HeUniform', - 'identity': 'Identity', - 'leCunNormal': 'LeCunNormal', - 'leCunUniform': 'LeCunUniform', - 'ones': 'Ones', - 'orthogonal': 'Orthogonal', - 'randomNormal': 'RandomNormal', - 'randomUniform': 'RandomUniform', - 'truncatedNormal': 'TruncatedNormal', - 'varianceScaling': 'VarianceScaling', - 'zeros': 'Zeros' - }; - -function deserializeInitializer( - config: serialization.ConfigDict, - customObjects: serialization.ConfigDict = {}): Initializer { - return deserializeKerasObject( - config, serialization.SerializationMap.getMap().classNameMap, - customObjects, 'initializer'); -} - -export function serializeInitializer(initializer: Initializer): - serialization.ConfigDictValue { - return serializeKerasObject(initializer); -} - -export function getInitializer(identifier: InitializerIdentifier|Initializer| - serialization.ConfigDict): Initializer { - if (typeof identifier === 'string') { - const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - /* We have four 'helper' classes for common initializers that - all get serialized as 'VarianceScaling' and shouldn't go through - the deserializeInitializer pathway. */ - if (className === 'GlorotNormal') { - return new GlorotNormal(); - } else if (className === 'GlorotUniform') { - return new GlorotUniform(); - } else if (className === 'HeNormal') { - return new HeNormal(); - } else if (className === 'HeUniform') { - return new HeUniform(); - } else if (className === 'LeCunNormal') { - return new LeCunNormal(); - } else if (className === 'LeCunUniform') { - return new LeCunUniform(); - } else { - const config: serialization.ConfigDict = {}; - config['className'] = className; - config['config'] = {}; - return deserializeInitializer(config); - } - } else if (identifier instanceof Initializer) { - return identifier; - } else { - return deserializeInitializer(identifier); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/README.md deleted file mode 100644 index cc2117514..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/README.md +++ /dev/null @@ -1,53 +0,0 @@ -TypeScript Interfaces describing the Keras JSON format ------------------------------------------------------- - -This directory contains a description of the current Keras JSON serialization -format, in the form of TypeScript interfaces. The intent is that any valid -Keras JSON file can be parsed in a type-safe manner using these types. - -The Keras JSON format originated in the Python Keras implementation. The basic -design is that the format mirrors the Python API. Each class instance in a -Python model is serialized as a JSON object containing the class name and its -serialized constructor arguments. - -Here, we provide a type called `*Serialization` to describe the on-disk JSON -representation for each class. It always provides a `class_name` and a `config` -representing the constructor arguments required to reconstruct a given instance. - -The constructor arguments may be primitives, arrays of primitives, or plain -key-value dictionaries, in which case the JSON serialization is straightforward. - -If a constructor argument is another object, then it is represented by a nested -`*Serialization`. This structure is illustrated below: - - FooSerialization { - class_name: 'Foo'; - config: { - bar: string; - baz: number[]; - qux: QuxSerialization; - } - } - -Deserializing such a nested object configuration requires recursively -deserializing any object arguments, and finally calling the top-level -constructor using the reconstructed object arguments. - -In general this means that deserialization is purely tree-like, so instances -cannot be reused. (The deserialization code for Models is an exception to this -principle, because it allows Layers to refer to each other in order to describe -a DAG). - -As a consequence of this design, our deserialization code requires an `*Args` -type mirroring each of the `*Serialization` types here. `*Args` types represent -the actual arguments passed to a constructor, after any nested objects have been -deserialized. For instance, the above `FooSerialization` will be resolved into - `FooArgs` like this: - - FooArgs { - bar: string; - baz: number[]; - qux: Qux; - } - -which can then be passed to the `Foo` constructor. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/activation_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/activation_config.ts deleted file mode 100644 index 791d622f1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/activation_config.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {stringLiteralArray} from './utils'; - -/** - * List of all known activation names. - */ -export const activationOptions = stringLiteralArray([ - 'elu', 'hard_sigmoid', 'linear', 'relu', 'relu6', 'selu', 'sigmoid', - 'softmax', 'softplus', 'softsign', 'tanh', 'swish', 'mish' -]); - -/** - * A type representing the strings that are valid loss names. - */ -export type ActivationSerialization = typeof activationOptions[number]; - -// Sad that we have to do all this just for hard_sigmoid vs. hardSigmoid. -// TODO(soergel): Move the CamelCase versions back out of keras_format -// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic? -/** @docinline */ -export type ActivationIdentifier = 'elu'|'hardSigmoid'|'linear'|'relu'|'relu6'| - 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|'swish'|'mish'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts deleted file mode 100644 index 5c279a160..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -// TODO(huan): add layer-specific input shape types (see: https://github.com/tensorflow/tfjs-layers/pull/492) -/** @docalias (null | number)[] */ -export type Shape = Array; - -// The tfjs-core version of DataType must stay synced with this. -export type DataType = 'float32'|'int32'|'bool'|'complex64'|'string'; - -// TODO(soergel): Move the CamelCase versions back out of keras_format -// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic? -/** @docinline */ -export type DataFormat = 'channelsFirst'|'channelsLast'; -export const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; - -export type InterpolationFormat = 'nearest'|'bilinear'; -export const VALID_INTERPOLATION_FORMAT_VALUES = ['nearest', 'bilinear']; -// These constants have a snake vs. camel distinction. -export type DataFormatSerialization = 'channels_first'|'channels_last'; - -/** @docinline */ -export type PaddingMode = 'valid'|'same'|'causal'; -export const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; - -/** @docinline */ -export type PoolMode = 'max'|'avg'; -export const VALID_POOL_MODE_VALUES = ['max', 'avg']; - -/** @docinline */ -export type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave'; -export const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; - -/** @docinline */ -export type SampleWeightMode = 'temporal'; -export const VALID_SAMPLE_WEIGHT_MODES = ['temporal']; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/constraint_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/constraint_config.ts deleted file mode 100644 index 0ab1018c3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/constraint_config.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BaseSerialization} from './types'; - -export type MaxNormConfig = { - max_value?: number; - axis?: number; -}; - -export type MaxNormSerialization = BaseSerialization<'MaxNorm', MaxNormConfig>; - -export type UnitNormConfig = { - axis?: number; -}; - -export type UnitNormSerialization = - BaseSerialization<'UnitNorm', UnitNormConfig>; - -export type NonNegSerialization = BaseSerialization<'NonNeg', null>; - -export type MinMaxNormConfig = { - min_value?: number; - max_value?: number; - axis?: number; - rate?: number; -}; - -export type MinMaxNormSerialization = - BaseSerialization<'MinMaxNorm', MinMaxNormConfig>; - -// Update constraintClassNames below in concert with this. -export type ConstraintSerialization = MaxNormSerialization|NonNegSerialization| - UnitNormSerialization|MinMaxNormSerialization; - -export type ConstraintClassName = ConstraintSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. - -/** - * A string array of valid Constraint class names. - * - * This is guaranteed to match the `ConstraintClassName` union type. - */ -export const constraintClassNames: ConstraintClassName[] = - ['MaxNorm', 'UnitNorm', 'NonNeg', 'MinMaxNorm']; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts deleted file mode 100644 index e471a4dc0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BaseSerialization} from './types'; - -// TODO(soergel): Move the CamelCase versions back out of keras_format -// e.g. to src/common.ts. Maybe even duplicate *all* of these to be pedantic? -/** @docinline */ -export type FanMode = 'fanIn'|'fanOut'|'fanAvg'; -export const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; - -// These constants have a snake vs. camel distinction. -export type FanModeSerialization = 'fan_in'|'fan_out'|'fan_avg'; - -/** @docinline */ -export type Distribution = 'normal'|'uniform'|'truncatedNormal'; -export const VALID_DISTRIBUTION_VALUES = - ['normal', 'uniform', 'truncatedNormal']; -// These constants have a snake vs. camel distinction. -export type DistributionSerialization = 'normal'|'uniform'|'truncated_normal'; - -export type ZerosSerialization = BaseSerialization<'Zeros', {}>; - -export type OnesSerialization = BaseSerialization<'Ones', {}>; - -export type ConstantConfig = { - value: number; -}; - -export type ConstantSerialization = - BaseSerialization<'Constant', ConstantConfig>; - -export type RandomNormalConfig = { - mean?: number; - stddev?: number; - seed?: number; -}; - -export type RandomNormalSerialization = - BaseSerialization<'RandomNormal', RandomNormalConfig>; - -export type RandomUniformConfig = { - minval?: number; - maxval?: number; - seed?: number; -}; - -export type RandomUniformSerialization = - BaseSerialization<'RandomUniform', RandomUniformConfig>; - -export type TruncatedNormalConfig = { - mean?: number; - stddev?: number; - seed?: number; -}; - -export type TruncatedNormalSerialization = - BaseSerialization<'TruncatedNormal', TruncatedNormalConfig>; - -export type VarianceScalingConfig = { - scale?: number; - - mode?: FanModeSerialization; - distribution?: DistributionSerialization; - seed?: number; -}; - -export type VarianceScalingSerialization = - BaseSerialization<'VarianceScaling', VarianceScalingConfig>; - -export type OrthogonalConfig = { - seed?: number; - gain?: number; -}; - -export type OrthogonalSerialization = - BaseSerialization<'Orthogonal', OrthogonalConfig>; - -export type IdentityConfig = { - gain?: number; -}; - -export type IdentitySerialization = - BaseSerialization<'Identity', IdentityConfig>; - -// Update initializerClassNames below in concert with this. -export type InitializerSerialization = ZerosSerialization|OnesSerialization| - ConstantSerialization|RandomUniformSerialization|RandomNormalSerialization| - TruncatedNormalSerialization|IdentitySerialization| - VarianceScalingSerialization|OrthogonalSerialization; - -export type InitializerClassName = InitializerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. - -/** - * A string array of valid Initializer class names. - * - * This is guaranteed to match the `InitializerClassName` union type. - */ -export const initializerClassNames: InitializerClassName[] = [ - 'Zeros', 'Ones', 'Constant', 'RandomNormal', 'RandomUniform', - 'TruncatedNormal', 'VarianceScaling', 'Orthogonal', 'Identity' -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/input_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/input_config.ts deleted file mode 100644 index 1c76830c9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/input_config.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataType} from '@tensorflow/tfjs-core'; -import {Shape} from './common'; -import {BaseLayerSerialization} from './topology_config'; - -export type InputLayerConfig = { - name?: string; - input_shape?: Shape; - batch_size?: number; - batch_input_shape?: Shape; - dtype?: DataType; - sparse?: boolean; -}; - -// This really should be BaseSerialization because an input layer has no -// inbound_nodes. But, that makes type safety more difficult. - -// Update inputLayerClassNames below in concert with this. -export type InputLayerSerialization = - BaseLayerSerialization<'InputLayer', InputLayerConfig>; - -export type InputLayerClassName = InputLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid InputLayer class names. - * - * This is guaranteed to match the `InputLayerClassName` union type. - */ -export const inputLayerClassNames: InputLayerClassName[] = [ - 'InputLayer', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/keras_class_names.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/keras_class_names.ts deleted file mode 100644 index ef0deefa8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/keras_class_names.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {constraintClassNames, ConstraintSerialization} from './constraint_config'; -import {initializerClassNames, InitializerSerialization} from './initializer_config'; -import {layerClassNames, LayerSerialization} from './layers/layer_serialization'; -import {optimizerClassNames, OptimizerSerialization} from './optimizer_config'; -import {regularizerClassNames, RegularizerSerialization} from './regularizer_config'; - -/** - * A type representing all possible Serializations of Keras objects, including - * Layers, Constraints, Optimizers, etc. - */ -export type KerasSerialization = LayerSerialization|ConstraintSerialization| - InitializerSerialization|RegularizerSerialization|OptimizerSerialization; - -/** - * A type representing all valid values of `class_name` in a Keras JSON file - * (regardless of context, which will naturally further restrict the valid - * values). - */ -export type KerasClassName = KerasSerialization['class_name']; - -export const kerasClassNames: KerasClassName[] = [ - ...layerClassNames, ...constraintClassNames, ...initializerClassNames, - ...regularizerClassNames, ...optimizerClassNames -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts deleted file mode 100644 index 4540f8fd7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/advanced_activation_serialization.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface ReLULayerConfig extends LayerConfig { - max_value?: number; -} - -export type ReLULayerSerialization = - BaseLayerSerialization<'ReLU', ReLULayerConfig>; - -export interface LeakyReLULayerConfig extends LayerConfig { - alpha?: number; -} - -export type LeakyReLULayerSerialization = - BaseLayerSerialization<'LeakyReLU', LeakyReLULayerConfig>; - -export interface PReLULayerConfig extends LayerConfig { - alpha_initializer?: InitializerSerialization; - alpha_regularizer?: RegularizerSerialization; - alpha_constraint?: ConstraintSerialization; - shared_axes?: number|number[]; -} - -export type PReLULayerSerialization = - BaseLayerSerialization<'PReLU', PReLULayerConfig>; - -export interface ELULayerConfig extends LayerConfig { - alpha?: number; -} - -export type ELULayerSerialization = - BaseLayerSerialization<'ELU', ELULayerConfig>; - -export interface ThresholdedReLULayerConfig extends LayerConfig { - theta?: number; -} - -export type ThresholdedReLULayerSerialization = - BaseLayerSerialization<'ThresholdedReLU', ThresholdedReLULayerConfig>; - -export interface SoftmaxLayerConfig extends LayerConfig { - axis?: number; -} - -export type SoftmaxLayerSerialization = - BaseLayerSerialization<'Softmax', SoftmaxLayerConfig>; - -// Update advancedActivationLayerClassNames below in concert with this. -export type AdvancedActivationLayerSerialization = ReLULayerSerialization| - LeakyReLULayerSerialization|PReLULayerSerialization|ELULayerSerialization| - ThresholdedReLULayerSerialization|SoftmaxLayerSerialization; - -export type AdvancedActivationLayerClassName = - AdvancedActivationLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid AdvancedActivationLayer class names. - * - * This is guaranteed to match the `AdvancedActivationLayerClassName` union - * type. - */ -export const advancedActivationLayerClassNames: - AdvancedActivationLayerClassName[] = [ - 'ReLU', - 'LeakyReLU', - 'PReLU', - 'ELU', - 'ThresholdedReLU', - 'Softmax', - ]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts deleted file mode 100644 index c8176a454..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_depthwise_serialization.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization} from '../topology_config'; -import {BaseConvLayerConfig} from './convolutional_serialization'; - -export interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig { - kernel_size: number|[number, number]; - depth_multiplier?: number; - depthwise_initializer?: InitializerSerialization; - depthwise_constraint?: ConstraintSerialization; - depthwise_regularizer?: RegularizerSerialization; -} - -// Update depthwiseConv2DLayerClassNames below in concert with this. -export type DepthwiseConv2DLayerSerialization = - BaseLayerSerialization<'DepthwiseConv2D', DepthwiseConv2DLayerConfig>; - -export type ConvolutionalDepthwiseLayerSerialization = - DepthwiseConv2DLayerSerialization; - -export type ConvolutionalDepthwiseLayerClassName = - ConvolutionalDepthwiseLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid ConvolutionalDepthwiseLayer class names. - * - * This is guaranteed to match the `ConvolutionalDepthwiseLayerClassName` union - * type. - */ -export const convolutionalDepthwiseLayerClassNames: - ConvolutionalDepthwiseLayerClassName[] = [ - 'DepthwiseConv2D', - ]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts deleted file mode 100644 index 77c251ee9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/convolutional_serialization.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataFormatSerialization, PaddingMode} from '../common'; -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface BaseConvLayerConfig extends LayerConfig { - kernel_size: number|number[]; - strides?: number|number[]; - padding?: PaddingMode; - data_format?: DataFormatSerialization; - dilation_rate?: number|[number]|[number, number]; - activation?: string; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - kernel_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; -} - -export interface ConvLayerConfig extends BaseConvLayerConfig { - filters: number; -} - -export type Conv1DLayerSerialization = - BaseLayerSerialization<'Conv1D', ConvLayerConfig>; - -export type Conv2DLayerSerialization = - BaseLayerSerialization<'Conv2D', ConvLayerConfig>; - -export type Conv2DTransposeLayerSerialization = - BaseLayerSerialization<'Conv2DTranspose', ConvLayerConfig>; - -export interface SeparableConvLayerConfig extends ConvLayerConfig { - depth_multiplier?: number; - depthwise_initializer?: InitializerSerialization; - pointwise_initializer?: InitializerSerialization; - depthwise_regularizer?: RegularizerSerialization; - pointwise_regularizer?: RegularizerSerialization; - depthwise_constraint?: ConstraintSerialization; - pointwise_constraint?: ConstraintSerialization; -} - -export type SeparableConv2DLayerSerialization = - BaseLayerSerialization<'SeparableConv2D', ConvLayerConfig>; - -export interface Cropping2DLayerConfig extends LayerConfig { - cropping: number|[number, number]|[[number, number], [number, number]]; - data_format?: DataFormatSerialization; -} - -export type Cropping2DLayerSerialization = - BaseLayerSerialization<'Cropping2D', Cropping2DLayerConfig>; - -export interface UpSampling2DLayerConfig extends LayerConfig { - size?: number[]; - data_format?: DataFormatSerialization; -} - -export type UpSampling2DLayerSerialization = - BaseLayerSerialization<'UpSampling2D', UpSampling2DLayerConfig>; - -// Update convolutionalLayerClassNames below in concert with this. -export type ConvolutionalLayerSerialization = - Conv1DLayerSerialization|Conv2DLayerSerialization| - Conv2DTransposeLayerSerialization|SeparableConv2DLayerSerialization| - Cropping2DLayerSerialization|UpSampling2DLayerSerialization; - -export type ConvolutionalLayerClassName = - ConvolutionalLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid ConvolutionalLayer class names. - * - * This is guaranteed to match the `ConvolutionalLayerClassName` union type. - */ -export const convolutionalLayerClassNames: ConvolutionalLayerClassName[] = [ - 'Conv1D', - 'Conv2D', - 'Conv2DTranspose', - 'Cropping2D', - 'SeparableConv2D', - 'UpSampling2D', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/core_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/core_serialization.ts deleted file mode 100644 index 596193ae3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/core_serialization.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ActivationSerialization} from '../activation_config'; -import {Shape} from '../common'; -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface DropoutLayerConfig extends LayerConfig { - rate: number; - noise_shape?: number[]; - seed?: number; -} - -export type DropoutLayerSerialization = - BaseLayerSerialization<'Dropout', DropoutLayerConfig>; - -export interface DenseLayerConfig extends LayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - input_dim?: number; - kernel_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - kernel_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; -} - -export type DenseLayerSerialization = - BaseLayerSerialization<'Dense', DenseLayerConfig>; - -export type FlattenLayerSerialization = - BaseLayerSerialization<'Flatten', LayerConfig>; - -export interface ActivationLayerConfig extends LayerConfig { - activation: ActivationSerialization; -} - -export type ActivationLayerSerialization = - BaseLayerSerialization<'Activation', ActivationLayerConfig>; - -export interface RepeatVectorLayerConfig extends LayerConfig { - n: number; -} - -export type RepeatVectorLayerSerialization = - BaseLayerSerialization<'RepeatVector', RepeatVectorLayerConfig>; - -export interface ReshapeLayerConfig extends LayerConfig { - target_shape: Shape; -} - -export type ReshapeLayerSerialization = - BaseLayerSerialization<'Reshape', ReshapeLayerConfig>; - -export interface PermuteLayerConfig extends LayerConfig { - dims: number[]; -} - -export type PermuteLayerSerialization = - BaseLayerSerialization<'Permute', PermuteLayerConfig>; - -export interface MaskingLayerConfig extends LayerConfig { - maskValue: number; -} - -export type MaskingLayerSerialization = - BaseLayerSerialization<'Masking', MaskingLayerConfig>; - -// Update coreLayerClassNames below in concert with this. -export type CoreLayerSerialization = - DropoutLayerSerialization|DenseLayerSerialization|FlattenLayerSerialization| - ActivationLayerSerialization|RepeatVectorLayerSerialization| - ReshapeLayerSerialization|PermuteLayerSerialization| - MaskingLayerSerialization; - -export type CoreLayerClassName = CoreLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid CoreLayer class names. - * - * This is guaranteed to match the `CoreLayerClassName` union type. - */ -export const coreLayerClassNames: CoreLayerClassName[] = [ - 'Activation', - 'Dense', - 'Dropout', - 'Flatten', - 'Permute', - 'RepeatVector', - 'Reshape', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts deleted file mode 100644 index 238fca8e4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/embeddings_serialization.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface EmbeddingLayerConfig extends LayerConfig { - input_dim: number; - output_dim: number; - embeddings_initializer?: InitializerSerialization; - embeddings_regularizer?: RegularizerSerialization; - activity_regularizer?: RegularizerSerialization; - embeddings_constraint?: ConstraintSerialization; - mask_zero?: boolean; - input_length?: number|number[]; -} - -// Update embeddingLayerClassNames below in concert with this. -export type EmbeddingLayerSerialization = - BaseLayerSerialization<'Embedding', EmbeddingLayerConfig>; - -export type EmbeddingLayerClassName = EmbeddingLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid EmbeddingLayer class names. - * - * This is guaranteed to match the `EmbeddingLayerClassName` union type. - */ -export const embeddingLayerClassNames: EmbeddingLayerClassName[] = [ - 'Embedding', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/layer_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/layer_serialization.ts deleted file mode 100644 index e8bd41aa7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/layer_serialization.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {inputLayerClassNames, InputLayerSerialization} from '../input_config'; -import {advancedActivationLayerClassNames, AdvancedActivationLayerSerialization} from './advanced_activation_serialization'; -import {convolutionalDepthwiseLayerClassNames, ConvolutionalDepthwiseLayerSerialization} from './convolutional_depthwise_serialization'; -import {convolutionalLayerClassNames, ConvolutionalLayerSerialization} from './convolutional_serialization'; -import {coreLayerClassNames, CoreLayerSerialization} from './core_serialization'; -import {embeddingLayerClassNames, EmbeddingLayerSerialization} from './embeddings_serialization'; -import {mergeLayerClassNames, MergeLayerSerialization} from './merge_serialization'; -import {normalizationLayerClassNames, NormalizationLayerSerialization} from './normalization_serialization'; -import {paddingLayerClassNames, PaddingLayerSerialization} from './padding_serialization'; -import {poolingLayerClassNames, PoolingLayerSerialization} from './pooling_serialization'; -import {recurrentLayerClassNames, RecurrentLayerSerialization} from './recurrent_serialization'; - -export type LayerSerialization = AdvancedActivationLayerSerialization| - ConvolutionalDepthwiseLayerSerialization|ConvolutionalLayerSerialization| - CoreLayerSerialization|EmbeddingLayerSerialization|MergeLayerSerialization| - NormalizationLayerSerialization|PaddingLayerSerialization| - PoolingLayerSerialization|RecurrentLayerSerialization| - InputLayerSerialization; - -export type LayerClassName = LayerSerialization['class_name']; - -/** - * A string array of valid Layer class names. - * - * This is guaranteed to match the `LayerClassName` union type. - */ -export const layerClassNames: LayerClassName[] = [ - ...advancedActivationLayerClassNames, - ...convolutionalDepthwiseLayerClassNames, ...convolutionalLayerClassNames, - ...coreLayerClassNames, ...embeddingLayerClassNames, ...mergeLayerClassNames, - ...normalizationLayerClassNames, ...paddingLayerClassNames, - ...poolingLayerClassNames, ...recurrentLayerClassNames, - ...inputLayerClassNames -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/merge_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/merge_serialization.ts deleted file mode 100644 index 4e6f142d9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/merge_serialization.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export type AddLayerSerialization = BaseLayerSerialization<'Add', LayerConfig>; - -export type MultiplyLayerSerialization = - BaseLayerSerialization<'Multiply', LayerConfig>; - -export type AverageLayerSerialization = - BaseLayerSerialization<'Average', LayerConfig>; - -export type MaximumLayerSerialization = - BaseLayerSerialization<'Maximum', LayerConfig>; - -export type MinimumLayerSerialization = - BaseLayerSerialization<'Minimum', LayerConfig>; - -export interface ConcatenateLayerConfig extends LayerConfig { - axis?: number; -} - -export type ConcatenateLayerSerialization = - BaseLayerSerialization<'Concatenate', ConcatenateLayerConfig>; - -export interface DotLayerConfig extends LayerConfig { - axes: number|[number, number]; - normalize?: boolean; -} - -export type DotLayerSerialization = - BaseLayerSerialization<'Dot', DotLayerConfig>; - -// Update mergeLayerClassNames below in concert with this. -export type MergeLayerSerialization = - AddLayerSerialization|MultiplyLayerSerialization|AverageLayerSerialization| - MaximumLayerSerialization|MinimumLayerSerialization| - ConcatenateLayerSerialization|DotLayerSerialization; - -export type MergeLayerClassName = MergeLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid MergeLayer class names. - * - * This is guaranteed to match the `MergeLayerClassName` union type. - */ -export const mergeLayerClassNames: MergeLayerClassName[] = [ - 'Add', - 'Average', - 'Concatenate', - 'Dot', - 'Maximum', - 'Minimum', - 'Multiply', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/normalization_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/normalization_serialization.ts deleted file mode 100644 index 1725d291c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/normalization_serialization.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface BatchNormalizationLayerConfig extends LayerConfig { - axis?: number; - momentum?: number; - epsilon?: number; - center?: boolean; - scale?: boolean; - beta_initializer?: InitializerSerialization; - gamma_initializer?: InitializerSerialization; - moving_mean_initializer?: InitializerSerialization; - moving_variance_initializer?: InitializerSerialization; - beta_constraint?: ConstraintSerialization; - gamma_constraint?: ConstraintSerialization; - beta_regularizer?: RegularizerSerialization; - gamma_regularizer?: RegularizerSerialization; -} - -// Update batchNormalizationLayerClassNames below in concert with this. -export type BatchNormalizationLayerSerialization = - BaseLayerSerialization<'BatchNormalization', BatchNormalizationLayerConfig>; - -export type NormalizationLayerSerialization = - BatchNormalizationLayerSerialization; - -export type NormalizationLayerClassName = - NormalizationLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid NormalizationLayer class names. - * - * This is guaranteed to match the `NormalizationLayerClassName` union - * type. - */ -export const normalizationLayerClassNames: NormalizationLayerClassName[] = [ - 'BatchNormalization', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/padding_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/padding_serialization.ts deleted file mode 100644 index 200897058..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/padding_serialization.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataFormatSerialization} from '../common'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface ZeroPadding2DLayerConfig extends LayerConfig { - padding?: number|[number, number]|[[number, number], [number, number]]; - data_format?: DataFormatSerialization; -} - -// Update paddingLayerClassNames below in concert with this. -export type ZeroPadding2DLayerSerialization = - BaseLayerSerialization<'ZeroPadding2D', ZeroPadding2DLayerConfig>; - -export type PaddingLayerSerialization = ZeroPadding2DLayerSerialization; - -export type PaddingLayerClassName = PaddingLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid PaddingLayer class names. - * - * This is guaranteed to match the `PaddingLayerClassName` union type. - */ -export const paddingLayerClassNames: PaddingLayerClassName[] = [ - 'ZeroPadding2D', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/pooling_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/pooling_serialization.ts deleted file mode 100644 index 7a31f4dc1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/pooling_serialization.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataFormatSerialization, PaddingMode} from '../common'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; - -export interface Pooling1DLayerConfig extends LayerConfig { - pool_size?: [number]; - strides?: [number]; - padding?: PaddingMode; -} - -export type MaxPooling1DLayerSerialization = - BaseLayerSerialization<'MaxPooling1D', Pooling1DLayerConfig>; - -export type AveragePooling1DLayerSerialization = - BaseLayerSerialization<'AveragePooling1D', Pooling1DLayerConfig>; - -export interface Pooling2DLayerConfig extends LayerConfig { - pool_size?: number|[number, number]; - strides?: number|[number, number]; - padding?: PaddingMode; - data_format?: DataFormatSerialization; -} - -export type MaxPooling2DLayerSerialization = - BaseLayerSerialization<'MaxPooling2D', Pooling2DLayerConfig>; - -export type AveragePooling2DLayerSerialization = - BaseLayerSerialization<'AveragePooling2D', Pooling2DLayerConfig>; - -export type GlobalAveragePooling1DLayerSerialization = - BaseLayerSerialization<'GlobalAveragePooling1D', LayerConfig>; - -export type GlobalMaxPooling1DLayerSerialization = - BaseLayerSerialization<'GlobalMaxPooling1D', LayerConfig>; - -export interface GlobalPooling2DLayerConfig extends LayerConfig { - data_format?: DataFormatSerialization; -} - -export type GlobalAveragePooling2DLayerSerialization = BaseLayerSerialization< - 'GlobalAveragePooling2D', GlobalPooling2DLayerConfig>; - -export type GlobalMaxPooling2DLayerSerialization = - BaseLayerSerialization<'GlobalMaxPooling2D', GlobalPooling2DLayerConfig>; - -// Update poolingLayerClassNames below in concert with this. -export type PoolingLayerSerialization = MaxPooling1DLayerSerialization| - AveragePooling1DLayerSerialization|MaxPooling2DLayerSerialization| - AveragePooling2DLayerSerialization|GlobalAveragePooling1DLayerSerialization| - GlobalMaxPooling1DLayerSerialization| - GlobalAveragePooling2DLayerSerialization| - GlobalMaxPooling2DLayerSerialization; - -export type PoolingLayerClassName = PoolingLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid PoolingLayer class names. - * - * This is guaranteed to match the `PoolingLayerClassName` union type. - */ -export const poolingLayerClassNames: PoolingLayerClassName[] = [ - 'AveragePooling1D', - 'AveragePooling2D', - 'GlobalAveragePooling1D', - 'GlobalAveragePooling2D', - 'GlobalMaxPooling1D', - 'GlobalMaxPooling2D', - 'MaxPooling1D', - 'MaxPooling2D', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts deleted file mode 100644 index 7fd735344..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/recurrent_serialization.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ActivationSerialization} from '../activation_config'; -import {ConstraintSerialization} from '../constraint_config'; -import {InitializerSerialization} from '../initializer_config'; -import {RegularizerSerialization} from '../regularizer_config'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; -import {BaseSerialization} from '../types'; - -export interface BaseRNNLayerConfig extends LayerConfig { - cell?: RNNCellSerialization|RNNCellSerialization[]; - return_sequences?: boolean; - return_state?: boolean; - go_backwards?: boolean; - stateful?: boolean; - unroll?: boolean; - input_dim?: number; - input_length?: number; -} - -export interface SimpleRNNCellConfig extends LayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - recurrent_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_regularizer?: RegularizerSerialization; - recurrent_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - kernel_constraint?: ConstraintSerialization; - recurrent_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - dropout?: number; - recurrent_dropout?: number; -} - -export type SimpleRNNCellSerialization = - BaseSerialization<'SimpleRNNCell', SimpleRNNCellConfig>; - -export interface SimpleRNNLayerConfig extends BaseRNNLayerConfig { - units: number; - activation?: ActivationSerialization; - use_bias?: boolean; - kernel_initializer?: InitializerSerialization; - recurrent_initializer?: InitializerSerialization; - bias_initializer?: InitializerSerialization; - kernel_regularizer?: RegularizerSerialization; - recurrent_regularizer?: RegularizerSerialization; - bias_regularizer?: RegularizerSerialization; - kernel_constraint?: ConstraintSerialization; - recurrent_constraint?: ConstraintSerialization; - bias_constraint?: ConstraintSerialization; - dropout?: number; - recurrent_dropout?: number; -} - -export type SimpleRNNLayerSerialization = - BaseLayerSerialization<'SimpleRNN', SimpleRNNLayerConfig>; - -export interface GRUCellConfig extends SimpleRNNCellConfig { - recurrent_activation?: string; - implementation?: number; -} - -export type GRUCellSerialization = BaseSerialization<'GRUCell', GRUCellConfig>; - -export interface GRULayerConfig extends SimpleRNNLayerConfig { - recurrent_activation?: ActivationSerialization; - implementation?: number; -} - -export type GRULayerSerialization = - BaseLayerSerialization<'GRU', GRULayerConfig>; - -export interface LSTMCellConfig extends SimpleRNNCellConfig { - recurrent_activation?: ActivationSerialization; - unit_forget_bias?: boolean; - implementation?: number; -} - -export type LSTMCellSerialization = - BaseSerialization<'LSTMCell', LSTMCellConfig>; - -export interface LSTMLayerConfig extends SimpleRNNLayerConfig { - recurrent_activation?: ActivationSerialization; - unit_forget_bias?: boolean; - implementation?: number; -} -export type LSTMLayerSerialization = - BaseLayerSerialization<'LSTM', LSTMLayerConfig>; - -export interface StackedRNNCellsConfig extends LayerConfig { - // TODO(soergel): consider whether we can avoid improperly mixing - // Simple / LSTM / GRU cells here and in the above Layer serializations. - cells: RNNCellSerialization[]; -} - -export type StackedRNNCellsSerialization = - BaseSerialization<'StackedRNNCells', StackedRNNCellsConfig>; - -export type RNNCellSerialization = SimpleRNNCellSerialization| - GRUCellSerialization|LSTMCellSerialization|StackedRNNCellsSerialization; - -// Update recurrentLayerClassNames below in concert with this. -export type RecurrentLayerSerialization = - SimpleRNNLayerSerialization|LSTMLayerSerialization|GRULayerSerialization; - -export type RecurrentLayerClassName = RecurrentLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid RecurrentLayer class names. - * - * This is guaranteed to match the `RecurrentLayerClassName` union type. - */ -export const recurrentLayerClassNames: RecurrentLayerClassName[] = [ - 'GRU', - 'LSTM', - 'SimpleRNN', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts deleted file mode 100644 index be2d29ae6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/layers/wrappers_serialization.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BidirectionalMergeMode} from '../common'; -import {BaseLayerSerialization, LayerConfig} from '../topology_config'; -import {LayerSerialization} from './layer_serialization'; -import {RecurrentLayerSerialization} from './recurrent_serialization'; - -export type TimeDistributedLayerSerialization = - BaseLayerSerialization<'TimeDistributed', TimeDistributedLayerConfig>; - -export interface TimeDistributedLayerConfig extends LayerConfig { - layer: LayerSerialization; -} - -export type BidirectionalLayerSerialization = - BaseLayerSerialization<'Bidirectional', BidirectionalLayerConfig>; - -export interface BidirectionalLayerConfig extends LayerConfig { - layer: RecurrentLayerSerialization; - merge_mode?: BidirectionalMergeMode; -} - -// Update wrapperLayerClassNames below in concert with this. -export type WrapperLayerSerialization = - TimeDistributedLayerSerialization|BidirectionalLayerSerialization; - -export type WrapperLayerClassName = WrapperLayerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid WrapperLayer class names. - * - * This is guaranteed to match the `WrapperLayerClassName` union type. - */ -export const wrapperLayerClassNames: WrapperLayerClassName[] = [ - 'Bidirectional', - 'TimeDistributed', -]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/loss_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/loss_config.ts deleted file mode 100644 index 8fca8e8d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/loss_config.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {stringLiteralArray} from './utils'; - -/** - * List of all known loss names. - */ -export const lossOptions = stringLiteralArray([ - 'mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error', - 'mean_squared_logarithmic_error', 'squared_hinge', 'hinge', - 'categorical_hinge', 'logcosh', 'categorical_crossentropy', - 'sparse_categorical_crossentropy', 'kullback_leibler_divergence', 'poisson', - 'cosine_proximity' -]); - -/** - * A type representing the strings that are valid loss names. - */ -export type LossIdentifier = typeof lossOptions[number]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/model_serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/model_serialization.ts deleted file mode 100644 index 9b9b006d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/model_serialization.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {LayerSerialization} from './layers/layer_serialization'; -import {TensorKeyArray} from './node_config'; -import {TrainingConfig} from './training_config'; -import {BaseSerialization} from './types'; - -export type ModelConfig = { - name: string, - layers: LayerSerialization[], - input_layers: TensorKeyArray[], - output_layers: TensorKeyArray[], -}; - -/** - * A standard Keras JSON 'Model' configuration. - */ -export interface ModelSerialization extends - BaseSerialization<'Model', ModelConfig> { - backend?: string; - keras_version?: string; -} - -export type SequentialConfig = { - layers: LayerSerialization[] -}; - -/** - * A standard Keras JSON 'Sequential' configuration. - */ -export interface SequentialSerialization extends - BaseSerialization<'Sequential', SequentialConfig> { - backend?: string; - keras_version?: string; -} - -/** - * A legacy Keras JSON 'Sequential' configuration. - * - * It was a bug that Keras Sequential models were recorded with - * model_config.config as an array of layers, instead of a dict containing a - * 'layers' entry. While the bug has been fixed, we still need to be able to - * read this legacy format. - */ -export type LegacySequentialSerialization = { - // Note this cannot extend `BaseSerialization` because of the bug. - class_name: 'Sequential'; - - config: LayerSerialization[]; - backend?: string; - keras_version?: string; -}; - -/** - * Contains the description of a KerasModel, as well as the configuration - * necessary to train that model. - */ -export type KerasFileSerialization = { - // aka ModelTopology? - model_config: ModelSerialization|SequentialSerialization| - LegacySequentialSerialization; - training_config: TrainingConfig; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/node_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/node_config.ts deleted file mode 100644 index a0581fcb2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/node_config.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {PyJsonDict} from './types'; - -/** - * The unique string name of a Layer. - */ -export type LayerName = string; - -/** - * The index of a Node, identifying a specific invocation of a given Layer. - */ -export type NodeIndex = number; - -/** - * The index of a Tensor output by a given Node of a given Layer. - */ -export type TensorIndex = number; - -/** - * Arguments to the apply(...) method that produced a specific Node. - */ -// tslint:disable-next-line:no-empty-interface -export interface NodeArgs extends PyJsonDict {} - -/** - * A reference to a specific Tensor, given by its Layer name, Node index, and - * output index, including the apply() arguments associated with the Node. - * - * This is used in `NodeConfig` to specify the inputs to each Node. - */ -export type TensorKeyWithArgsArray = - [LayerName, NodeIndex, TensorIndex, NodeArgs]; - -// TODO(soergel): verify behavior of Python Keras; maybe PR to standardize it. -/** - * A reference to a specific Tensor, given by its Layer name, Node index, and - * output index. - * - * This does not include the apply() arguments associated with the Node. It is - * used in the LayersModel config to specify the inputLayers and outputLayers. - * It seems to be an idiosyncrasy of Python Keras that the node arguments are - * not included here. - */ -export type TensorKeyArray = [LayerName, NodeIndex, TensorIndex]; - -/** - * A Keras JSON entry representing a Node, i.e. a specific instance of a Layer. - * - * By Keras JSON convention, a Node is specified as an array of Tensor keys - * (i.e., references to Tensors output by other Layers) providing the inputs to - * this Layer in order. - */ -export type NodeConfig = TensorKeyWithArgsArray[]; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/optimizer_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/optimizer_config.ts deleted file mode 100644 index c1e6e2096..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/optimizer_config.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BaseSerialization} from './types'; - -// Because of the limitations in the current Keras spec, there is no clear -// definition of what may or may not be the configuration of an optimizer. -// -// For now we'll represent the ones available in TF.js--but it will take more -// thought to get this right in a cross-platform way. -// -// See internal issue: b/121033602 - -// TODO(soergel): This is a stopgap that needs further thought. -// Does it belong here? -// Does it belong in tfjs-core? -// See also the dormant https://github.com/tensorflow/tfjs-core/pull/1404 - -export type AdadeltaOptimizerConfig = { - learning_rate: number; rho: number; epsilon: number; -}; - -export type AdadeltaSerialization = - BaseSerialization<'Adadelta', AdadeltaOptimizerConfig>; - -export type AdagradOptimizerConfig = { - learning_rate: number; - initial_accumulator_value?: number; -}; - -export type AdagradSerialization = - BaseSerialization<'Adagrad', AdagradOptimizerConfig>; - -export type AdamOptimizerConfig = { - learning_rate: number; beta1: number; beta2: number; - epsilon?: number; -}; - -export type AdamSerialization = BaseSerialization<'Adam', AdamOptimizerConfig>; - -export type AdamaxOptimizerConfig = { - learning_rate: number; beta1: number; beta2: number; - epsilon?: number; - decay?: number; -}; - -export type AdamaxSerialization = - BaseSerialization<'Adamax', AdamaxOptimizerConfig>; - -export type MomentumOptimizerConfig = { - // extends SGDOptimizerConfig { - learning_rate: number; momentum: number; - use_nesterov?: boolean; -}; - -export type MomentumSerialization = - BaseSerialization<'Momentum', MomentumOptimizerConfig>; - -export type RMSPropOptimizerConfig = { - learning_rate: number; - decay?: number; - momentum?: number; - epsilon?: number; - centered?: boolean; -}; - -export type RMSPropSerialization = - BaseSerialization<'RMSProp', RMSPropOptimizerConfig>; - -export type SGDOptimizerConfig = { - learning_rate: number; -}; - -export type SGDSerialization = BaseSerialization<'SGD', SGDOptimizerConfig>; - -// Update optimizerClassNames below in concert with this. -export type OptimizerSerialization = AdadeltaSerialization|AdagradSerialization| - AdamSerialization|AdamaxSerialization|MomentumSerialization| - RMSPropSerialization|SGDSerialization; - -export type OptimizerClassName = OptimizerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid. - -/** - * A string array of valid Optimizer class names. - * - * This is guaranteed to match the `OptimizerClassName` union type. - */ -export const optimizerClassNames: OptimizerClassName[] = - ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Momentum', 'RMSProp', 'SGD']; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/regularizer_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/regularizer_config.ts deleted file mode 100644 index aca7a703b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/regularizer_config.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {BaseSerialization} from './types'; - -export type L1L2Config = { - l1?: number; - l2?: number; -}; - -export type L1L2Serialization = BaseSerialization<'L1L2', L1L2Config>; - -// Update regularizerClassNames below in concert with this. -export type RegularizerSerialization = L1L2Serialization; - -export type RegularizerClassName = RegularizerSerialization['class_name']; - -// We can't easily extract a string[] from the string union type, but we can -// recapitulate the list, enforcing at compile time that the values are valid -// and that we have the right number of them. - -/** - * A string array of valid Regularizer class names. - * - * This is guaranteed to match the `RegularizerClassName` union type. - */ -export const regularizerClassNames: RegularizerClassName[] = ['L1L2']; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/topology_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/topology_config.ts deleted file mode 100644 index c8e208995..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/topology_config.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {DataType} from '@tensorflow/tfjs-core'; - -import {Shape} from './common'; -import {NodeConfig} from './node_config'; -import {BaseSerialization, PyJson, PyJsonDict} from './types'; - -/** Constructor arguments for Layer. */ -export interface LayerConfig extends PyJsonDict { - input_shape?: Shape; - batch_input_shape?: Shape; - batch_size?: number; - dtype?: DataType; - name?: string; - trainable?: boolean; - input_dtype?: DataType; -} - -/** - * Converts a subtype of `LayerConfig` to a variant with restricted keys. - * - * This is a bit tricky because `keyof` obtains only local fields, not inherited - * fields. Thus, this type combines the keys from the `LayerConfig` supertype - * with those of the specific subtype. - * - * See ./types.ts for an explanation of the PyJson type. - */ -export type JsonLayer = C&LayerConfig& - PyJson|Extract>; - -/** - * A Keras JSON entry representing a layer. - * - * The Keras JSON convention is to provide the `class_name` (i.e., the layer - * type) at the top level, and then to place the layer-specific configuration in - * a `config` subtree. These layer-specific configurations are provided by - * subtypes of `LayerConfig`. Thus, this `*Serialization` has a type parameter - * giving the specific type of the wrapped `LayerConfig`. - */ -export interface BaseLayerSerialization - extends BaseSerialization> { - name: string; - inbound_nodes?: NodeConfig[]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/training_config.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/training_config.ts deleted file mode 100644 index bf7b220b2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/training_config.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ -import {SampleWeightMode} from './common'; -import {LossIdentifier} from './loss_config'; -import {OptimizerSerialization} from './optimizer_config'; -import {PyJsonDict} from './types'; - -// TODO(soergel): flesh out known metrics options -export type MetricsIdentifier = string; - -/** - * a type for valid values of the `loss_weights` field. - */ -export type LossWeights = number[]|{[key: string]: number}; - -/** - * Configuration of the Keras trainer. This includes the configuration to the - * optimizer, the loss, any metrics to be calculated, etc. - */ -export interface TrainingConfig extends PyJsonDict { - // tslint:disable-next-line:no-any - optimizer_config: OptimizerSerialization; - loss: LossIdentifier|LossIdentifier[]|{[key: string]: LossIdentifier}; - metrics?: MetricsIdentifier[]|{[key: string]: MetricsIdentifier}; - weighted_metrics?: MetricsIdentifier[]; - sample_weight_mode?: SampleWeightMode; - loss_weights?: LossWeights; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/types.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/types.ts deleted file mode 100644 index caa01670f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/types.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * A value within the JSON-serialized form of a serializable object. - * - * The keys of any nested dicts should be in snake_case (i.e., using Python - * naming conventions) for compatibility with Python Keras. - * - * @see PyJsonDict - */ -export type PyJsonValue = boolean|number|string|null|PyJsonArray|PyJsonDict; - -/** - * A key-value dict within the JSON-serialized form of a serializable object. - * - * Serialization/deserialization uses stringified-JSON as the storage - * representation. Typically this should be used for materialized JSON - * stored on disk or sent/received over the wire. - * - * The keys of this dict and of any nested dicts should be in snake_case (i.e., - * using Python naming conventions) for compatibility with Python Keras. - * - * Internally this is normally converted to a ConfigDict that has CamelCase keys - * (using TypeScript naming conventions) and support for Enums. - */ -export interface PyJsonDict { - [key: string]: PyJsonValue; -} - -/** - * A key-value dict like @see PyJsonDict, but with restricted keys. - * - * This makes it possible to create subtypes that have only the specified - * fields, while requiring that the values are JSON-compatible. - * - * That is in contrast to extending `PyJsonDict`, or using an intersection type - * `Foo & PyJsonDict`. In both of those cases, the fields of Foo are actually - * allowed to be of types that are incompatible with `PyJsonValue`. Worse, the - * index signature of `PyJsonValue` means that *any* key is accepted: eg. - * `const foo: Foo = ...; foo.bogus = 12; const x = foo.bogus` works for both - * reading and assignment, even if `bogus` is not a field of the type `Foo`, - * because the index signature inherited from `PyJsonDict` accepts all strings. - * - * Here, we *both* restrict the keys to known values, *and* guarantee that the - * values associated with those keys are compatible with `PyJsonValue`. - * - * This guarantee is easiest to apply via an additional incantation: - * - * ``` - * export interface Foo extends PyJson { - * a: SomeType; - * b: SomeOtherType; - * } - * ``` - * - * Now instances of `Foo` have *only* the fields `a` and `b`, and furthermore, - * if either the type `SomeType` or `SomeOtherType` is incompatible with - * `PyJsonValue`, the compiler produces a typing error. - */ -export type PyJson = { - [x in Keys]?: PyJsonValue; -}; - -/** - * An array of values within the JSON-serialized form of a serializable object. - * - * The keys of any nested dicts should be in snake_case (i.e., using Python - * naming conventions) for compatibility with Python Keras. - * - * @see PyJsonDict - */ -export interface PyJsonArray extends Array {} - -/** - * A Keras JSON entry representing a Keras object such as a Layer. - * - * The Keras JSON convention is to provide the `class_name` (e.g., the layer - * type) at the top level, and then to place the class-specific configuration in - * a `config` subtree. These class-specific configurations are provided by - * subtypes of `PyJsonDict`. Thus, this `*Serialization` has a type parameter - * giving the specific type of the wrapped `PyJsonDict`. - */ -export interface BaseSerialization< - N extends string, T extends PyJson>> extends - PyJsonDict { - // The above type voodoo does this: - // * `keyof T` obtains the known keys of the specific config type. - // `keyof` returns `string | number | symbol`; see - // (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html) - // * `Extract` selects the string values. This amounts to - // assuming that we are dealing with a type with string keys, as opposed to - // an array. In our usage, this assumption always holds. - // * `PyJson>` is a type whose keys are constrained - // to the provided ones, and whose values must be JSON-compatible. - // * `T extends PyJson> means that we can provide any - // config type with known keys, provided that the associated values are - // JSON-compatible. - // - // The upshot is that we can extend `BaseSerialization` with whatever config - // type `T` that we like-- remaining confident that the result can be - // trivially rendered as JSON, because the compiler will produce a typing - // error if that guarantee does not hold. - // - // To test this, try adding a field with a non-JSON-like value (e.g., Tensor) - // to any subclass of `BaseSerialization`. A compilation error will result. - class_name: N; - config: T; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/utils.ts deleted file mode 100644 index ac26ee0a1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/keras_format/utils.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Infers a string union type from an array of string literals, and returns - * the array as an array of that type. - * - * For instance: - * - * ``` - * const fruits = stringLiteralArray(['apple', 'banana', 'orange']); - * type Fruit = typeof activationOptions[number]; - * ``` - * - * now `Fruit` is the union type `'apple'|'banana'|'orange'`. - * - * https://stackoverflow.com/questions/52085454/typescript-define-a-union-type-from-an-array-of-strings/52085658 - */ -export function stringLiteralArray(a: T[]) { - return a; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts deleted file mode 100644 index ba7103e6c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Advanced activation layers. - */ - -import {clipByValue, elu, leakyRelu, prelu, relu, serialization, Tensor} from '@tensorflow/tfjs-core'; - -import {Softmax as softmaxActivation} from '../activations'; -import {cast} from '../backend/tfjs_backend'; -import {Constraint, getConstraint, serializeConstraint} from '../constraints'; -import {InputSpec, Layer, LayerArgs} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -export declare interface ReLULayerArgs extends LayerArgs { - /** - * Float, the maximum output value. - */ - maxValue?: number; -} - -export class ReLU extends Layer { - /** @nocollapse */ - static className = 'ReLU'; - maxValue: number; - - constructor(args?: ReLULayerArgs) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maxValue = args.maxValue; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - inputs = getExactlyOneTensor(inputs); - let output = relu(inputs); - if (this.maxValue != null) { - output = clipByValue(output, 0, this.maxValue); - } - return output; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {maxValue: this.maxValue}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(ReLU); - -export declare interface LeakyReLULayerArgs extends LayerArgs { - /** - * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`. - */ - alpha?: number; -} - -export class LeakyReLU extends Layer { - /** @nocollapse */ - static className = 'LeakyReLU'; - readonly alpha: number; - - readonly DEFAULT_ALPHA = 0.3; - - constructor(args?: LeakyReLULayerArgs) { - super(args == null ? {} : args); - if (args == null) { - args = {}; - } - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - const x = getExactlyOneTensor(inputs); - return leakyRelu(x, this.alpha); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {alpha: this.alpha}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(LeakyReLU); - -export declare interface PReLULayerArgs extends LayerArgs { - /** - * Initializer for the learnable alpha. - */ - alphaInitializer?: Initializer|InitializerIdentifier; - - /** - * Regularizer for the learnable alpha. - */ - alphaRegularizer?: Regularizer; - - /** - * Constraint for the learnable alpha. - */ - alphaConstraint?: Constraint; - - /** - * The axes along which to share learnable parameters for the activation - * function. For example, if the incoming feature maps are from a 2D - * convolution with output shape `[numExamples, height, width, channels]`, - * and you wish to share parameters across space (height and width) so that - * each filter channels has only one set of parameters, set - * `shared_axes: [1, 2]`. - */ - sharedAxes?: number|number[]; -} - -export class PReLU extends Layer { - /** @nocollapse */ - static className = 'PReLU'; - private readonly alphaInitializer: Initializer; - private readonly alphaRegularizer: Regularizer; - private readonly alphaConstraint: Constraint; - private readonly sharedAxes: number[]; - private alpha: LayerVariable; - - readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros'; - - constructor(args?: PReLULayerArgs) { - super(args == null ? {} : args); - if (args == null) { - args = {}; - } - - this.supportsMasking = true; - this.alphaInitializer = - getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); - this.alphaRegularizer = getRegularizer(args.alphaRegularizer); - this.alphaConstraint = getConstraint(args.alphaConstraint); - if (args.sharedAxes == null) { - this.sharedAxes = null; - } else if (Array.isArray(args.sharedAxes)) { - this.sharedAxes = args.sharedAxes; - } else if (typeof args.sharedAxes === 'number') { - this.sharedAxes = [args.sharedAxes]; - } else { - throw new ValueError( - `Expected sharedAxes to be a number or an array of numbers, ` + - `but got ${args.sharedAxes}`); - } - } - - build(inputShape: Shape|Shape[]) { - inputShape = getExactlyOneShape(inputShape); - const paramShape: Shape = inputShape.slice(1); - if (this.sharedAxes != null) { - for (const i of this.sharedAxes) { - paramShape[i - 1] = 1; - } - } - this.alpha = this.addWeight( - 'alpha', paramShape, 'float32', this.alphaInitializer, - this.alphaRegularizer, true, this.alphaConstraint); - // Set input spec. - const axes: {[axis: number]: number} = {}; - if (this.sharedAxes != null) { - for (let i = 1; i < inputShape.length; ++i) { - axes[i] = inputShape[i]; - } - } - this.inputSpec = [new InputSpec({ - ndim: inputShape.length, - axes, - })]; - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - inputs = getExactlyOneTensor(inputs); - return prelu(inputs, this.alpha.read()); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - alphaInitializer: serializeInitializer(this.alphaInitializer), - alphaRegularizer: serializeRegularizer(this.alphaRegularizer), - alphaConstraint: serializeConstraint(this.alphaConstraint), - sharedAxes: this.sharedAxes - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(PReLU); - -export declare interface ELULayerArgs extends LayerArgs { - /** - * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`. - */ - alpha?: number; -} - -export class ELU extends Layer { - /** @nocollapse */ - static className = 'ELU'; - readonly alpha: number; - - readonly DEFAULT_ALPHA = 1.0; - - constructor(args?: ELULayerArgs) { - super(args == null ? {} : args); - if (args == null) { - args = {}; - } - - if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) { - throw new NotImplementedError( - `Non-default alpha value (${args.alpha}) is not supported by the ` + - `ELU layer yet.`); - } - - this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - const x = getExactlyOneTensor(inputs); - return elu(x); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {alpha: this.alpha}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(ELU); - -export declare interface ThresholdedReLULayerArgs extends LayerArgs { - /** - * Float >= 0. Threshold location of activation. - */ - theta?: number; -} - -export class ThresholdedReLU extends Layer { - /** @nocollapse */ - static className = 'ThresholdedReLU'; - readonly theta: number; - - readonly DEFAULT_THETA = 1.0; - - constructor(args?: ThresholdedReLULayerArgs) { - super(args == null ? {} : args); - if (args == null) { - args = {}; - } - - this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - const x = getExactlyOneTensor(inputs); - return x.mul(cast(x.greater(this.theta), 'float32')); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {theta: this.theta}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(ThresholdedReLU); - -export declare interface SoftmaxLayerArgs extends LayerArgs { - /** - * Integer, axis along which the softmax normalization is applied. - * Defaults to `-1` (i.e., the last axis). - */ - axis?: number; -} - -export class Softmax extends Layer { - /** @nocollapse */ - static className = 'Softmax'; - readonly axis: number; - readonly softmax: (t: Tensor, a?: number) => Tensor; - readonly DEFAULT_AXIS = 1.0; - - constructor(args?: SoftmaxLayerArgs) { - super(args == null ? {} : args); - if (args == null) { - args = {}; - } - this.softmax = new softmaxActivation().apply; - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - const x = getExactlyOneTensor(inputs); - return this.softmax(x, this.axis); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {axis: this.axis}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Softmax); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts deleted file mode 100644 index ae47e927c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts +++ /dev/null @@ -1,1446 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Convolutional Layers - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {fused, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core'; - -import {Activation, getActivation, serializeActivation} from '../activations'; -import {imageDataFormat} from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import {checkDataFormat, checkInterpolationFormat, checkPaddingMode} from '../common'; -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {InputSpec, Layer, LayerArgs} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {ActivationIdentifier} from '../keras_format/activation_config'; -import {DataFormat, InterpolationFormat, PaddingMode, Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils'; -import * as generic_utils from '../utils/generic_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -/** - * Transpose and cast the input before the conv2d. - * @param x Input image tensor. - * @param dataFormat - */ -export function preprocessConv2DInput( - x: Tensor, dataFormat: DataFormat): Tensor { - // TODO(cais): Cast type to float32 if not. - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC. - } else { - return x; - } - }); -} - -/** - * Transpose and cast the input before the conv3d. - * @param x Input image tensor. - * @param dataFormat - */ -export function preprocessConv3DInput( - x: Tensor, dataFormat: DataFormat): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - if (dataFormat === 'channelsFirst') { - return tfc.transpose(x, [0, 2, 3, 4, 1]); // NCDHW -> NDHWC. - } else { - return x; - } - }); -} - -/** - * 1D-convolution with bias added. - * - * Porting Note: This function does not exist in the Python Keras backend. - * It is exactly the same as `conv2d`, except the added `bias`. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`. - * @param bias Bias, rank-3, of shape `[outDepth]`. - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export function conv1dWithBias( - x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid', - dataFormat?: DataFormat, dilationRate = 1): Tensor { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - // Check the ranks of x, kernel and bias. - if (x.shape.length !== 3) { - throw new ValueError( - `The input of a conv1dWithBias operation should be 3, but is ` + - `${x.shape.length} instead.`); - } - if (kernel.shape.length !== 3) { - throw new ValueError( - `The kernel for a conv1dWithBias operation should be 3, but is ` + - `${kernel.shape.length} instead`); - } - if (bias != null && bias.shape.length !== 1) { - throw new ValueError( - `The bias for a conv1dWithBias operation should be 1, but is ` + - `${kernel.shape.length} instead`); - } - // TODO(cais): Support CAUSAL padding mode. - if (dataFormat === 'channelsFirst') { - x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC. - } - if (padding === 'causal') { - throw new NotImplementedError( - 'The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - let y: Tensor = tfc.conv1d( - x as Tensor2D | Tensor3D, kernel as Tensor3D, strides, - padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); - if (bias != null) { - y = K.biasAdd(y, bias); - } - return y; - }); -} - -/** - * 1D-convolution. - * - * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`. - * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s - * @param strides - * @param padding Padding mode. - * @param dataFormat Data format. - * @param dilationRate - * @returns The result of the 1D convolution. - * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank. - */ -export function conv1d( - x: Tensor, kernel: Tensor, strides = 1, padding = 'valid', - dataFormat?: DataFormat, dilationRate = 1): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - return conv1dWithBias( - x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} - -/** - * 2D Convolution - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 2D pooling. - */ -export function conv2d( - x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid', - dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - return conv2dWithBiasActivation( - x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} - -/** - * 2D Convolution with an added bias and optional activation. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv2d`, except the added `bias`. - */ -export function conv2dWithBiasActivation( - x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1], - padding = 'valid', dataFormat?: DataFormat, dilationRate?: [number, number], - activation: fused.Activation = null): Tensor { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 3 && x.rank !== 4) { - throw new ValueError( - `conv2dWithBiasActivation expects input to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - if (kernel.rank !== 3 && kernel.rank !== 4) { - throw new ValueError( - `conv2dWithBiasActivation expects kernel to be of rank 3 or 4, ` + - `but received ${x.rank}.`); - } - let y = preprocessConv2DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError( - 'The support for CAUSAL padding mode in conv1dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.fused.conv2d({ - x: y as Tensor3D | Tensor4D, - filter: kernel as Tensor4D, - strides: strides as [number, number], - pad: padding === 'same' ? 'same' : 'valid', - dilations: dilationRate, - dataFormat: 'NHWC', - bias, - activation - }); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} - -/** - * 3D Convolution. - * @param x - * @param kernel kernel of the convolution. - * @param strides strides array. - * @param padding padding mode. Default to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param dilationRate dilation rate array. - * @returns Result of the 3D convolution. - */ -export function conv3d( - x: Tensor, kernel: Tensor, strides = [1, 1, 1], padding = 'valid', - dataFormat?: DataFormat, dilationRate?: [number, number, number]): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - return conv3dWithBias( - x, kernel, null, strides, padding, dataFormat, dilationRate); - }); -} - -/** - * 3D Convolution with an added bias. - * Note: This function does not exist in the Python Keras Backend. This function - * is exactly the same as `conv3d`, except the added `bias`. - */ -export function conv3dWithBias( - x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1, 1], - padding = 'valid', dataFormat?: DataFormat, - dilationRate?: [number, number, number]): Tensor { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - if (x.rank !== 4 && x.rank !== 5) { - throw new ValueError( - `conv3dWithBias expects input to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - if (kernel.rank !== 4 && kernel.rank !== 5) { - throw new ValueError( - `conv3dWithBias expects kernel to be of rank 4 or 5, but received ` + - `${x.rank}.`); - } - let y = preprocessConv3DInput(x, dataFormat); - if (padding === 'causal') { - throw new NotImplementedError( - 'The support for CAUSAL padding mode in conv3dWithBias is not ' + - 'implemented yet.'); - } - y = tfc.conv3d( - y as Tensor4D | tfc.Tensor, - kernel as tfc.Tensor, strides as [number, number, number], - padding === 'same' ? 'same' : 'valid', 'NDHWC', dilationRate); - if (bias != null) { - y = K.biasAdd(y, bias as Tensor1D); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); - } - return y; - }); -} - -/** - * Base LayerConfig for depthwise and non-depthwise convolutional layers. - */ -export declare interface BaseConvLayerArgs extends LayerArgs { - /** - * The dimensions of the convolution window. If kernelSize is a number, the - * convolutional window will be square. - */ - kernelSize: number|number[]; - - /** - * The strides of the convolution in each dimension. If strides is a number, - * strides in both dimensions are equal. - * - * Specifying any stride value != 1 is incompatible with specifying any - * `dilationRate` value != 1. - */ - strides?: number|number[]; - - /** - * Padding mode. - */ - padding?: PaddingMode; - - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape `(batch, channels, - * ...)`. - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; - - /** - * The dilation rate to use for the dilated convolution in each dimension. - * Should be an integer or array of two or three integers. - * - * Currently, specifying any `dilationRate` value != 1 is incompatible with - * specifying any `strides` value != 1. - */ - dilationRate?: number|[number]|[number, number]|[number, number, number]; - - /** - * Activation function of the layer. - * - * If you don't specify the activation, none is applied. - */ - activation?: ActivationIdentifier; - - /** - * Whether the layer uses a bias vector. Defaults to `true`. - */ - useBias?: boolean; - - /** - * Initializer for the convolutional kernel weights matrix. - */ - kernelInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier|Initializer; - - /** - * Constraint for the convolutional kernel weights. - */ - kernelConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint for the bias vector. - */ - biasConstraint?: ConstraintIdentifier|Constraint; - - /** - * Regularizer function applied to the kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier|Regularizer; -} - -/** - * LayerConfig for non-depthwise convolutional layers. - * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D, - * Conv3D). - */ -export declare interface ConvLayerArgs extends BaseConvLayerArgs { - /** - * The dimensionality of the output space (i.e. the number of filters in the - * convolution). - */ - filters: number; -} - -/** - * Abstract convolution layer. - */ -export abstract class BaseConv extends Layer { - protected readonly rank: number; - protected readonly kernelSize: number[]; - protected readonly strides: number[]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - protected readonly activation: Activation; - protected readonly useBias: boolean; - protected readonly dilationRate: number[]; - - // Bias-related members are here because all convolution subclasses use the - // same configuration parmeters to control bias. Kernel-related members - // are in subclass `Conv` because some subclasses use different parameters to - // control kernel properties, for instance, `DepthwiseConv2D` uses - // `depthwiseInitializer` instead of `kernelInitializer`. - protected readonly biasInitializer?: Initializer; - protected readonly biasConstraint?: Constraint; - protected readonly biasRegularizer?: Regularizer; - - protected bias: LayerVariable = null; - - readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal'; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros'; - - constructor(rank: number, args: BaseConvLayerArgs) { - super(args as LayerArgs); - BaseConv.verifyArgs(args); - this.rank = rank; - generic_utils.assertPositiveInteger(this.rank, 'rank'); - if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) { - throw new NotImplementedError( - `Convolution layer for rank other than 1, 2, or 3 (${ - this.rank}) is ` + - `not implemented yet.`); - } - this.kernelSize = normalizeArray(args.kernelSize, rank, 'kernelSize'); - this.strides = normalizeArray( - args.strides == null ? 1 : args.strides, rank, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.activation = getActivation(args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.biasConstraint = getConstraint(args.biasConstraint); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.dilationRate = normalizeArray( - args.dilationRate == null ? 1 : args.dilationRate, rank, - 'dilationRate'); - if (this.rank === 1 && - (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) { - throw new ValueError( - `dilationRate must be a number or an array of a single number ` + - `for 1D convolution, but received ` + - `${JSON.stringify(this.dilationRate)}`); - } else if (this.rank === 2) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = [this.dilationRate, this.dilationRate]; - } else if (this.dilationRate.length !== 2) { - throw new ValueError( - `dilationRate must be a number or array of two numbers for 2D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } else if (this.rank === 3) { - if (typeof this.dilationRate === 'number') { - this.dilationRate = - [this.dilationRate, this.dilationRate, this.dilationRate]; - } else if (this.dilationRate.length !== 3) { - throw new ValueError( - `dilationRate must be a number or array of three numbers for 3D ` + - `convolution, but received ${JSON.stringify(this.dilationRate)}`); - } - } - } - - protected static verifyArgs(args: BaseConvLayerArgs) { - // Check config.kernelSize type and shape. - generic_utils.assert( - 'kernelSize' in args, `required key 'kernelSize' not in config`); - if (typeof args.kernelSize !== 'number' && - !generic_utils.checkArrayTypeAndLength( - args.kernelSize, 'number', 1, 3)) { - throw new ValueError( - `BaseConv expects config.kernelSize to be number or number[] with ` + - `length 1, 2, or 3, but received ${ - JSON.stringify(args.kernelSize)}.`); - } - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - kernelSize: this.kernelSize, - strides: this.strides, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - activation: serializeActivation(this.activation), - useBias: this.useBias, - biasInitializer: serializeInitializer(this.biasInitializer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} - -/** - * Abstract nD convolution layer. Ancestor of convolution layers which reduce - * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D. - */ -export abstract class Conv extends BaseConv { - protected readonly filters: number; - - protected kernel: LayerVariable = null; - - // Bias-related properties are stored in the superclass `BaseConv` because all - // convolution subclasses use the same configuration parameters to control - // bias. Kernel-related properties are defined here rather than in the - // superclass because some convolution subclasses use different names and - // configuration parameters for their internal kernel state. - protected readonly kernelInitializer?: Initializer; - protected readonly kernelConstraint?: Constraint; - protected readonly kernelRegularizer?: Regularizer; - - constructor(rank: number, args: ConvLayerArgs) { - super(rank, args as BaseConvLayerArgs); - Conv.verifyArgs(args); - this.filters = args.filters; - generic_utils.assertPositiveInteger(this.filters, 'filters'); - this.kernelInitializer = getInitializer( - args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const channelAxis = - this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError( - `The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - const inputDim = inputShape[channelAxis]; - - const kernelShape = this.kernelSize.concat([inputDim, this.filters]); - - this.kernel = this.addWeight( - 'kernel', kernelShape, null, this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.filters], null, this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } - - this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}]; - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs: Tensor; - const biasValue = this.bias == null ? null : this.bias.read(); - const fusedActivationName = generic_utils.mapActivationToFusedKernel( - this.activation.getClassName()); - - if (fusedActivationName != null && this.rank === 2) { - outputs = conv2dWithBiasActivation( - inputs, this.kernel.read(), biasValue, this.strides, this.padding, - this.dataFormat, this.dilationRate as [number, number], - fusedActivationName); - } else { - if (this.rank === 1) { - outputs = conv1dWithBias( - inputs, this.kernel.read(), biasValue, this.strides[0], - this.padding, this.dataFormat, this.dilationRate[0]); - } else if (this.rank === 2) { - // TODO(cais): Move up to constructor. - outputs = conv2dWithBiasActivation( - inputs, this.kernel.read(), biasValue, this.strides, this.padding, - this.dataFormat, this.dilationRate as [number, number]); - } else if (this.rank === 3) { - outputs = conv3dWithBias( - inputs, this.kernel.read(), biasValue, this.strides, this.padding, - this.dataFormat, this.dilationRate as [number, number, number]); - } else { - throw new NotImplementedError( - 'convolutions greater than 3D are not implemented yet.'); - } - - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - } - - return outputs; - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const newSpace: number[] = []; - const space = (this.dataFormat === 'channelsLast') ? - inputShape.slice(1, inputShape.length - 1) : - inputShape.slice(2); - for (let i = 0; i < space.length; ++i) { - const newDim = convOutputLength( - space[i], this.kernelSize[i], this.padding, this.strides[i], - typeof this.dilationRate === 'number' ? this.dilationRate : - this.dilationRate[i]); - newSpace.push(newDim); - } - - let outputShape = [inputShape[0]]; - if (this.dataFormat === 'channelsLast') { - outputShape = outputShape.concat(newSpace); - outputShape.push(this.filters); - } else { - outputShape.push(this.filters); - outputShape = outputShape.concat(newSpace); - } - return outputShape; - } - - getConfig(): serialization.ConfigDict { - const config = { - filters: this.filters, - kernelInitializer: serializeInitializer(this.kernelInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - - protected static verifyArgs(args: ConvLayerArgs) { - // Check config.filters type, shape, and value. - if (!('filters' in args) || typeof args.filters !== 'number' || - args.filters < 1) { - throw new ValueError( - `Convolution layer expected config.filters to be a 'number' > 0 ` + - `but got ${JSON.stringify(args.filters)}`); - } - } -} - -export class Conv2D extends Conv { - /** @nocollapse */ - static className = 'Conv2D'; - constructor(args: ConvLayerArgs) { - super(2, args); - Conv2D.verifyArgs(args); - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['rank']; - return config; - } - - protected static verifyArgs(args: ConvLayerArgs) { - // config.kernelSize must be a number or array of numbers. - if ((typeof args.kernelSize !== 'number') && - !generic_utils.checkArrayTypeAndLength( - args.kernelSize, 'number', 1, 2)) { - throw new ValueError( - `Conv2D expects config.kernelSize to be number or number[] with ` + - `length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -serialization.registerClass(Conv2D); - -export class Conv3D extends Conv { - /** @nocollapse */ - static className = 'Conv3D'; - constructor(args: ConvLayerArgs) { - super(3, args); - Conv3D.verifyArgs(args); - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['rank']; - return config; - } - - protected static verifyArgs(args: ConvLayerArgs) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number') { - if (!(Array.isArray(args.kernelSize) && - (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { - throw new ValueError( - `Conv3D expects config.kernelSize to be number or` + - ` [number, number, number], but received ${ - JSON.stringify(args.kernelSize)}.`); - } - } - } -} -serialization.registerClass(Conv3D); - -export class Conv2DTranspose extends Conv2D { - /** @nocollapse */ - static className = 'Conv2DTranspose'; - inputSpec: InputSpec[]; - - constructor(args: ConvLayerArgs) { - super(args); - this.inputSpec = [new InputSpec({ndim: 4})]; - - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError( - `Conv2DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - - if (inputShape.length !== 4) { - throw new ValueError( - 'Input should have rank 4; Received input shape: ' + - JSON.stringify(inputShape)); - } - - const channelAxis = - this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError( - 'The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - - this.kernel = this.addWeight( - 'kernel', kernelShape, 'float32', this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.filters], 'float32', this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } - - // Set input spec. - this.inputSpec = - [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})]; - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 4) { - throw new ValueError( - `Conv2DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - - const inputShape = input.shape; - const batchSize = inputShape[0]; - - let hAxis: number; - let wAxis: number; - if (this.dataFormat === 'channelsFirst') { - hAxis = 2; - wAxis = 3; - } else { - hAxis = 1; - wAxis = 2; - } - - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - - // Infer the dynamic output shape. - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - - // Porting Note: We don't branch based on `this.dataFormat` here, - // because - // the tjfs-core function `conv2dTranspose` called below always - // assumes channelsLast. - const outputShape: [number, number, number, number] = - [batchSize, outHeight, outWidth, this.filters]; - - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 1]); - } - let outputs = tfc.conv2dTranspose( - input as Tensor4D, this.kernel.read() as Tensor4D, outputShape, - this.strides as [number, number], this.padding as 'same' | 'valid'); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 3, 1, 2]); - } - - if (this.bias != null) { - outputs = - K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D; - } - if (this.activation != null) { - outputs = this.activation.apply(outputs) as Tensor4D; - } - return outputs; - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - - let channelAxis: number; - let heightAxis: number; - let widthAxis: number; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - heightAxis = 2; - widthAxis = 3; - } else { - channelAxis = 3; - heightAxis = 1; - widthAxis = 2; - } - - const kernelH = this.kernelSize[0]; - const kernelW = this.kernelSize[1]; - const strideH = this.strides[0]; - const strideW = this.strides[1]; - - outputShape[channelAxis] = this.filters; - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -serialization.registerClass(Conv2DTranspose); - -export class Conv3DTranspose extends Conv3D { - /** @nocollapse */ - static className = 'Conv3DTranspose'; - inputSpec: InputSpec[]; - - constructor(args: ConvLayerArgs) { - super(args); - this.inputSpec = [new InputSpec({ndim: 5})]; - - if (this.padding !== 'same' && this.padding !== 'valid') { - throw new ValueError( - `Conv3DTranspose currently supports only padding modes 'same' ` + - `and 'valid', but received padding mode ${this.padding}`); - } - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - - if (inputShape.length !== 5) { - throw new ValueError( - 'Input should have rank 5; Received input shape: ' + - JSON.stringify(inputShape)); - } - - const channelAxis = - this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null) { - throw new ValueError( - 'The channel dimension of the inputs should be defined. ' + - 'Found `None`.'); - } - const inputDim = inputShape[channelAxis]; - const kernelShape = this.kernelSize.concat([this.filters, inputDim]); - - this.kernel = this.addWeight( - 'kernel', kernelShape, 'float32', this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.filters], 'float32', this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } - - // Set input spec. - this.inputSpec = - [new InputSpec({ndim: 5, axes: {[channelAxis]: inputDim}})]; - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs); - if (input.shape.length !== 5) { - throw new ValueError( - `Conv3DTranspose.call() expects input tensor to be rank-4, but ` + - `received a tensor of rank-${input.shape.length}`); - } - - const inputShape = input.shape; - const batchSize = inputShape[0]; - - let hAxis: number; - let wAxis: number; - let dAxis: number; - - if (this.dataFormat === 'channelsFirst') { - dAxis = 2; - hAxis = 3; - wAxis = 4; - } else { - dAxis = 1; - hAxis = 2; - wAxis = 3; - } - - const depth = inputShape[dAxis]; - const height = inputShape[hAxis]; - const width = inputShape[wAxis]; - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - - // Infer the dynamic output shape. - const outDepth = deconvLength(depth, strideD, kernelD, this.padding); - const outHeight = deconvLength(height, strideH, kernelH, this.padding); - const outWidth = deconvLength(width, strideW, kernelW, this.padding); - - // Same as `conv2dTranspose`. We always assumes channelsLast. - const outputShape: [number, number, number, number, number] = - [batchSize, outDepth, outHeight, outWidth, this.filters]; - if (this.dataFormat !== 'channelsLast') { - input = tfc.transpose(input, [0, 2, 3, 4, 1]); - } - let outputs = tfc.conv3dTranspose( - input as Tensor5D, this.kernel.read() as Tensor5D, outputShape, - this.strides as [number, number, number], - this.padding as 'same' | 'valid'); - if (this.dataFormat !== 'channelsLast') { - outputs = tfc.transpose(outputs, [0, 4, 1, 2, 3]); - } - - if (this.bias !== null) { - outputs = - K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor5D; - } - if (this.activation !== null) { - outputs = this.activation.apply(outputs) as Tensor5D; - } - return outputs; - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - - let channelAxis: number; - let depthAxis: number; - let heightAxis: number; - let widthAxis: number; - if (this.dataFormat === 'channelsFirst') { - channelAxis = 1; - depthAxis = 2; - heightAxis = 3; - widthAxis = 4; - } else { - channelAxis = 4; - depthAxis = 1; - heightAxis = 2; - widthAxis = 3; - } - - const kernelD = this.kernelSize[0]; - const kernelH = this.kernelSize[1]; - const kernelW = this.kernelSize[2]; - const strideD = this.strides[0]; - const strideH = this.strides[1]; - const strideW = this.strides[2]; - - outputShape[channelAxis] = this.filters; - outputShape[depthAxis] = - deconvLength(outputShape[depthAxis], strideD, kernelD, this.padding); - outputShape[heightAxis] = - deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); - outputShape[widthAxis] = - deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); - return outputShape; - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['dilationRate']; - return config; - } -} -serialization.registerClass(Conv3DTranspose); - -export declare interface SeparableConvLayerArgs extends ConvLayerArgs { - /** - * The number of depthwise convolution output channels for each input - * channel. - * The total number of depthwise convolution output channels will be equal - * to `filtersIn * depthMultiplier`. Default: 1. - */ - depthMultiplier?: number; - - /** - * Initializer for the depthwise kernel matrix. - */ - depthwiseInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the pointwise kernel matrix. - */ - pointwiseInitializer?: InitializerIdentifier|Initializer; - - /** - * Regularizer function applied to the depthwise kernel matrix. - */ - depthwiseRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the pointwise kernel matrix. - */ - pointwiseRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Constraint function applied to the depthwise kernel matrix. - */ - depthwiseConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint function applied to the pointwise kernel matrix. - */ - pointwiseConstraint?: ConstraintIdentifier|Constraint; -} - -export class SeparableConv extends Conv { - /** @nocollapse */ - static className = 'SeparableConv'; - - readonly depthMultiplier: number; - - protected readonly depthwiseInitializer?: Initializer; - protected readonly depthwiseRegularizer?: Regularizer; - protected readonly depthwiseConstraint?: Constraint; - protected readonly pointwiseInitializer?: Initializer; - protected readonly pointwiseRegularizer?: Regularizer; - protected readonly pointwiseConstraint?: Constraint; - - readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier = - 'glorotUniform'; - readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier = - 'glorotUniform'; - - protected depthwiseKernel: LayerVariable = null; - protected pointwiseKernel: LayerVariable = null; - - constructor(rank: number, config?: SeparableConvLayerArgs) { - super(rank, config); - - if (config.filters == null) { - throw new ValueError( - 'The `filters` configuration field is required by SeparableConv, ' + - 'but is unspecified.'); - } - if (config.kernelInitializer != null || config.kernelRegularizer != null || - config.kernelConstraint != null) { - throw new ValueError( - 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + - 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + - 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + - 'pointwiseRegularizer and pointwiseConstraint instead.'); - } - if (config.padding != null && config.padding !== 'same' && - config.padding !== 'valid') { - throw new ValueError( - `SeparableConv${this.rank}D supports only padding modes: ` + - `'same' and 'valid', but received ${JSON.stringify(config.padding)}`); - } - - this.depthMultiplier = - config.depthMultiplier == null ? 1 : config.depthMultiplier; - this.depthwiseInitializer = getInitializer( - config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); - this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); - this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); - this.pointwiseInitializer = getInitializer( - config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); - this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); - this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < this.rank + 2) { - throw new ValueError( - `Inputs to SeparableConv${this.rank}D should have rank ` + - `${this.rank + 2}, but received input shape: ` + - `${JSON.stringify(inputShape)}`); - } - const channelAxis = - this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError( - `The channel dimension of the inputs should be defined, ` + - `but found ${JSON.stringify(inputShape[channelAxis])}`); - } - - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape = - this.kernelSize.concat([inputDim, this.depthMultiplier]); - const pointwiseKernelShape = []; - for (let i = 0; i < this.rank; ++i) { - pointwiseKernelShape.push(1); - } - pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); - - const trainable = true; - this.depthwiseKernel = this.addWeight( - 'depthwise_kernel', depthwiseKernelShape, 'float32', - this.depthwiseInitializer, this.depthwiseRegularizer, trainable, - this.depthwiseConstraint); - this.pointwiseKernel = this.addWeight( - 'pointwise_kernel', pointwiseKernelShape, 'float32', - this.pointwiseInitializer, this.pointwiseRegularizer, trainable, - this.pointwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.filters], 'float32', this.biasInitializer, - this.biasRegularizer, trainable, this.biasConstraint); - } else { - this.bias = null; - } - - this.inputSpec = - [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})]; - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - - let output: Tensor; - if (this.rank === 1) { - throw new NotImplementedError( - '1D separable convolution is not implemented yet.'); - } else if (this.rank === 2) { - if (this.dataFormat === 'channelsFirst') { - inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC. - } - - output = tfc.separableConv2d( - inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D, - this.pointwiseKernel.read() as Tensor4D, - this.strides as [number, number], this.padding as 'same' | 'valid', - this.dilationRate as [number, number], 'NHWC'); - } - - if (this.useBias) { - output = K.biasAdd(output, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - - if (this.dataFormat === 'channelsFirst') { - output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return output; - }); - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['rank']; - delete config['kernelInitializer']; - delete config['kernelRegularizer']; - delete config['kernelConstraint']; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['pointwiseInitializer'] = - serializeInitializer(this.pointwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['pointwiseRegularizer'] = - serializeRegularizer(this.pointwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseConstraint); - config['pointwiseConstraint'] = - serializeConstraint(this.pointwiseConstraint); - return config; - } -} - -export class SeparableConv2D extends SeparableConv { - /** @nocollapse */ - static className = 'SeparableConv2D'; - constructor(args?: SeparableConvLayerArgs) { - super(2, args); - } -} -serialization.registerClass(SeparableConv2D); - -export class Conv1D extends Conv { - /** @nocollapse */ - static className = 'Conv1D'; - constructor(args: ConvLayerArgs) { - super(1, args); - Conv1D.verifyArgs(args); - this.inputSpec = [{ndim: 3}]; - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - delete config['rank']; - delete config['dataFormat']; - return config; - } - - protected static verifyArgs(args: ConvLayerArgs) { - // config.kernelSize must be a number or array of numbers. - if (typeof args.kernelSize !== 'number' && - !generic_utils.checkArrayTypeAndLength( - args.kernelSize, 'number', 1, 1)) { - throw new ValueError( - `Conv1D expects config.kernelSize to be number or number[] with ` + - `length 1, but received ${JSON.stringify(args.kernelSize)}.`); - } - } -} -serialization.registerClass(Conv1D); - -export declare interface Cropping2DLayerArgs extends LayerArgs { - /** - * Dimension of the cropping along the width and the height. - * - If integer: the same symmetric cropping - * is applied to width and height. - * - If list of 2 integers: - * interpreted as two different - * symmetric cropping values for height and width: - * `[symmetric_height_crop, symmetric_width_crop]`. - * - If a list of 2 list of 2 integers: - * interpreted as - * `[[top_crop, bottom_crop], [left_crop, right_crop]]` - */ - cropping: number|[number, number]|[[number, number], [number, number]]; - - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape - * `(batch, channels, ...)` - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; -} - -export class Cropping2D extends Layer { - /** @nocollapse */ - static className = 'Cropping2D'; - protected readonly cropping: [[number, number], [number, number]]; - protected readonly dataFormat: DataFormat; - - constructor(args: Cropping2DLayerArgs) { - super(args); - if (typeof args.cropping === 'number') { - this.cropping = - [[args.cropping, args.cropping], [args.cropping, args.cropping]]; - } else if (typeof args.cropping[0] === 'number') { - this.cropping = [ - [args.cropping[0], args.cropping[0]], - [args.cropping[1] as number, args.cropping[1] as number] - ]; - } else { - this.cropping = args.cropping as [[number, number], [number, number]]; - } - this.dataFormat = - args.dataFormat === undefined ? 'channelsLast' : args.dataFormat; - this.inputSpec = [{ndim: 4}]; - } - - computeOutputShape(inputShape: Shape): Shape { - if (this.dataFormat === 'channelsFirst') { - return [ - inputShape[0], inputShape[1], - inputShape[2] - this.cropping[0][0] - this.cropping[0][1], - inputShape[3] - this.cropping[1][0] - this.cropping[1][1] - ]; - } else { - return [ - inputShape[0], - inputShape[1] - this.cropping[0][0] - this.cropping[0][1], - inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] - ]; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - - if (this.dataFormat === 'channelsLast') { - const hSliced = K.sliceAlongAxis( - inputs, this.cropping[0][0], - inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2); - return K.sliceAlongAxis( - hSliced, this.cropping[1][0], - inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3); - } else { - const hSliced = K.sliceAlongAxis( - inputs, this.cropping[0][0], - inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3); - return K.sliceAlongAxis( - hSliced, this.cropping[1][0], - inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4); - } - }); - } - - getConfig(): serialization.ConfigDict { - const config = {cropping: this.cropping, dataFormat: this.dataFormat}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Cropping2D); - -export declare interface UpSampling2DLayerArgs extends LayerArgs { - /** - * The upsampling factors for rows and columns. - * - * Defaults to `[2, 2]`. - */ - size?: number[]; - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `"channelsLast"` corresponds to inputs with shape - * `[batch, ..., channels]` - * - * `"channelsFirst"` corresponds to inputs with shape `[batch, channels, - * ...]`. - * - * Defaults to `"channelsLast"`. - */ - dataFormat?: DataFormat; - /** - * The interpolation mechanism, one of `"nearest"` or `"bilinear"`, default - * to `"nearest"`. - */ - interpolation?: InterpolationFormat; -} - -export class UpSampling2D extends Layer { - /** @nocollapse */ - static className = 'UpSampling2D'; - protected readonly DEFAULT_SIZE = [2, 2]; - protected readonly size: number[]; - protected readonly dataFormat: DataFormat; - protected readonly interpolation: InterpolationFormat; - - constructor(args: UpSampling2DLayerArgs) { - super(args); - this.inputSpec = [{ndim: 4}]; - this.size = args.size == null ? this.DEFAULT_SIZE : args.size; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.interpolation = - args.interpolation == null ? 'nearest' : args.interpolation; - checkInterpolationFormat(this.interpolation); - } - - computeOutputShape(inputShape: Shape): Shape { - if (this.dataFormat === 'channelsFirst') { - const height = - inputShape[2] == null ? null : this.size[0] * inputShape[2]; - const width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; - return [inputShape[0], inputShape[1], height, width]; - } else { - const height = - inputShape[1] == null ? null : this.size[0] * inputShape[1]; - const width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; - return [inputShape[0], height, width, inputShape[3]]; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tfc.tidy(() => { - let input = getExactlyOneTensor(inputs) as Tensor4D; - const inputShape = input.shape; - - if (this.dataFormat === 'channelsFirst') { - input = tfc.transpose(input, [0, 2, 3, 1]); - const height = this.size[0] * inputShape[2]; - const width = this.size[1] * inputShape[3]; - - const resized = this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - return tfc.transpose(resized, [0, 3, 1, 2]); - } else { - const height = this.size[0] * inputShape[1]; - const width = this.size[1] * inputShape[2]; - return this.interpolation === 'nearest' ? - input.resizeNearestNeighbor([height, width]) : - input.resizeBilinear([height, width]); - } - }); - } - - getConfig(): serialization.ConfigDict { - const config = {size: this.size, dataFormat: this.dataFormat}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(UpSampling2D); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts deleted file mode 100644 index 916154c02..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts +++ /dev/null @@ -1,211 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Depthwise Convolutional Layers - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core'; - -import {imageDataFormat} from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import {checkDataFormat} from '../common'; -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {DataFormat, Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import {convOutputLength} from '../utils/conv_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -import {BaseConv, BaseConvLayerArgs, ConvLayerArgs, preprocessConv2DInput} from './convolutional'; - -/** - * 2D convolution with separable filters. - * @param x Input tensor. - * @param depthwiseKernel Convolution kernel for depthwise convolution. - * @param strides Strides (Array of two integers). - * @param padding Padding model. - * @param dataFormat Data format. - * @param dilationRate Array of two integers, dilation rates for the separable - * convolution. - * @returns Output tensor. - * @throws ValueError If depthwiseKernel is not a 4D array. - */ -export function depthwiseConv2d( - x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1], - padding = 'valid', dataFormat?: DataFormat, - dilationRate?: [number, number]): Tensor { - return tidy(() => { - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - checkDataFormat(dataFormat); - let y = preprocessConv2DInput(x, dataFormat); - if (x.rank !== 4) { - throw new ValueError( - `Input for depthwiseConv2d is required to be 4-D, but is instead ` + - `${x.rank}-D`); - } - if (depthwiseKernel.rank !== 4) { - throw new ValueError( - `depthwiseKernel is required to be 4-D, but is instead ` + - `${depthwiseKernel.rank}-D`); - } - y = tfc.depthwiseConv2d( - y as Tensor4D, depthwiseKernel as Tensor4D, strides, - padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); - } - return y; - }); -} - -export declare interface DepthwiseConv2DLayerArgs extends BaseConvLayerArgs { - /** - * An integer or Array of 2 integers, specifying the width and height of the - * 2D convolution window. Can be a single integer to specify the same value - * for all spatial dimensions. - */ - kernelSize: number|[number, number]; - - /** - * The number of depthwise convolution output channels for each input - * channel. - * The total number of depthwise convolution output channels will be equal to - * `filtersIn * depthMultiplier`. - * Default: 1. - */ - depthMultiplier?: number; - - /** - * Initializer for the depthwise kernel matrix. - * Default: GlorotNormal. - */ - depthwiseInitializer?: InitializerIdentifier|Initializer; - - /** - * Constraint for the depthwise kernel matrix. - */ - depthwiseConstraint?: ConstraintIdentifier|Constraint; - - /** - * Regulzarizer function for the depthwise kernel matrix. - */ - depthwiseRegularizer?: RegularizerIdentifier|Regularizer; -} - -export class DepthwiseConv2D extends BaseConv { - /** @nocollapse */ - static className = 'DepthwiseConv2D'; - private readonly depthMultiplier: number; - private readonly depthwiseInitializer: Initializer; - private readonly depthwiseConstraint: Constraint; - private readonly depthwiseRegularizer: Regularizer; - - private depthwiseKernel: LayerVariable = null; - - constructor(args: DepthwiseConv2DLayerArgs) { - super(2, args as ConvLayerArgs); - this.depthMultiplier = - args.depthMultiplier == null ? 1 : args.depthMultiplier; - this.depthwiseInitializer = getInitializer( - args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.depthwiseConstraint = getConstraint(args.depthwiseConstraint); - this.depthwiseRegularizer = getRegularizer(args.depthwiseRegularizer); - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 4) { - throw new ValueError( - `Inputs to DepthwiseConv2D should have rank 4. ` + - `Received input shape: ${JSON.stringify(inputShape)}.`); - } - const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; - if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { - throw new ValueError( - 'The channel dimension of the inputs to DepthwiseConv2D should ' + - `be defined, but is not (${inputShape[channelAxis]}).`); - } - const inputDim = inputShape[channelAxis]; - const depthwiseKernelShape: Shape = [ - this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier - ]; - - this.depthwiseKernel = this.addWeight( - 'depthwise_kernel', depthwiseKernelShape, null, - this.depthwiseInitializer, this.depthwiseRegularizer, true, - this.depthwiseConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } else { - this.bias = null; - } - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - let outputs = depthwiseConv2d( - inputs, this.depthwiseKernel.read(), this.strides as [number, number], - this.padding, this.dataFormat, null); - // TODO(cais): Add support for dilation. - if (this.useBias) { - outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat); - } - if (this.activation != null) { - outputs = this.activation.apply(outputs); - } - return outputs; - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const rows = - this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - const cols = - this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - const outFilters = this.dataFormat === 'channelsFirst' ? - inputShape[1] * this.depthMultiplier : - inputShape[3] * this.depthMultiplier; - const outRows = convOutputLength( - rows, this.kernelSize[0], this.padding, this.strides[0]); - const outCols = convOutputLength( - cols, this.kernelSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], outFilters, outRows, outCols]; - } else { - // In this case, assume 'channelsLast'. - return [inputShape[0], outRows, outCols, outFilters]; - } - } - - getConfig(): serialization.ConfigDict { - const config = super.getConfig(); - config['depthMultiplier'] = this.depthMultiplier; - config['depthwiseInitializer'] = - serializeInitializer(this.depthwiseInitializer); - config['depthwiseRegularizer'] = - serializeRegularizer(this.depthwiseRegularizer); - config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); - return config; - } -} -serialization.registerClass(DepthwiseConv2D); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts deleted file mode 100644 index e5edf0feb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts +++ /dev/null @@ -1,578 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {Tensor, util} from '@tensorflow/tfjs-core'; - -import {Activation} from '../activations'; -import * as K from '../backend/tfjs_backend'; -import {checkDataFormat, checkPaddingMode} from '../common'; -import {Constraint} from '../constraints'; -import {InputSpec} from '../engine/topology'; -import {AttributeError, NotImplementedError, ValueError} from '../errors'; -import {Initializer} from '../initializers'; -import {DataFormat, DataType, PaddingMode, Shape} from '../keras_format/common'; -import {Regularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import {convOutputLength, normalizeArray} from '../utils/conv_utils'; -import {assertPositiveInteger} from '../utils/generic_utils'; -import {getExactlyOneShape} from '../utils/types_utils'; - -import {BaseRNNLayerArgs, generateDropoutMask, LSTMCell, LSTMCellLayerArgs, LSTMLayerArgs, RNN, RNNCell, RNNLayerArgs, SimpleRNNCellLayerArgs} from './recurrent'; - -declare interface ConvRNN2DCellArgs extends - Omit { - /** - * The dimensionality of the output space (i.e. the number of filters in the - * convolution). - */ - filters: number; - - /** - * The dimensions of the convolution window. If kernelSize is a number, the - * convolutional window will be square. - */ - kernelSize: number|number[]; - - /** - * The strides of the convolution in each dimension. If strides is a number, - * strides in both dimensions are equal. - * - * Specifying any stride value != 1 is incompatible with specifying any - * `dilationRate` value != 1. - */ - strides?: number|number[]; - - /** - * Padding mode. - */ - padding?: PaddingMode; - - /** - * Format of the data, which determines the ordering of the dimensions in - * the inputs. - * - * `channels_last` corresponds to inputs with shape - * `(batch, ..., channels)` - * - * `channels_first` corresponds to inputs with shape `(batch, channels, - * ...)`. - * - * Defaults to `channels_last`. - */ - dataFormat?: DataFormat; - - /** - * The dilation rate to use for the dilated convolution in each dimension. - * Should be an integer or array of two or three integers. - * - * Currently, specifying any `dilationRate` value != 1 is incompatible with - * specifying any `strides` value != 1. - */ - dilationRate?: number|[number]|[number, number]; -} - -abstract class ConvRNN2DCell extends RNNCell { - readonly filters: number; - readonly kernelSize: number[]; - readonly strides: number[]; - readonly padding: PaddingMode; - readonly dataFormat: DataFormat; - readonly dilationRate: number[]; - - readonly activation: Activation; - readonly useBias: boolean; - - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - - readonly dropout: number; - readonly recurrentDropout: number; -} - -declare interface ConvRNN2DLayerArgs extends BaseRNNLayerArgs, - ConvRNN2DCellArgs {} - -/** - * Base class for convolutional-recurrent layers. - */ -class ConvRNN2D extends RNN { - /** @nocollapse */ - static className = 'ConvRNN2D'; - - readonly cell: ConvRNN2DCell; - - constructor(args: ConvRNN2DLayerArgs) { - if (args.unroll) { - throw new NotImplementedError( - 'Unrolling is not possible with convolutional RNNs.'); - } - - if (Array.isArray(args.cell)) { - throw new NotImplementedError( - 'It is not possible at the moment to stack convolutional cells.'); - } - - super(args as RNNLayerArgs); - - this.inputSpec = [new InputSpec({ndim: 5})]; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tfc.tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - - this.cell.dropoutMask = null; - } - - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - - this.cell.recurrentDropoutMask = null; - } - - if (kwargs && kwargs['constants']) { - throw new ValueError('ConvRNN2D cell does not support constants'); - } - - const mask = kwargs == null ? null : kwargs['mask']; - - const training = kwargs == null ? null : kwargs['training']; - - const initialState: Tensor[] = - kwargs == null ? null : kwargs['initialState']; - - return super.call(inputs, {mask, training, initialState}); - }); - } - - computeOutputShape(inputShape: Shape): Shape|Shape[] { - let outShape: Shape = this.computeSingleOutputShape(inputShape); - - if (!this.returnSequences) { - outShape = [outShape[0], ...outShape.slice(2)]; - } - - if (this.returnState) { - outShape = - [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])]; - } - - return outShape; - } - - getInitialState(inputs: tfc.Tensor): tfc.Tensor[] { - return tfc.tidy(() => { - const {stateSize} = this.cell; - - const inputShape = inputs.shape; - - const outputShape = this.computeSingleOutputShape(inputShape); - - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - - const initialState = tfc.zeros(stateShape); - - if (Array.isArray(stateSize)) { - return Array(stateSize.length).fill(initialState); - } - - return [initialState]; - }); - } - - resetStates(states?: Tensor|Tensor[], training = false): void { - tfc.tidy(() => { - if (!this.stateful) { - throw new AttributeError( - 'Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - - const inputShape = this.inputSpec[0].shape; - - const outputShape = this.computeSingleOutputShape(inputShape); - - const stateShape = [outputShape[0], ...outputShape.slice(2)]; - - const batchSize = inputShape[0]; - - if (batchSize == null) { - throw new ValueError( - 'If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - - // Initialize state if null. - if (this.getStates() == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } else { - this.states_ = [tfc.zeros(stateShape)]; - } - } else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - - if (Array.isArray(this.cell.stateSize)) { - this.states_ = this.cell.stateSize.map(() => tfc.zeros(stateShape)); - } else { - this.states_[0] = tfc.zeros(stateShape); - } - } else { - if (!Array.isArray(states)) { - states = [states]; - } - - if (states.length !== this.states_.length) { - throw new ValueError( - `Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - - if (training) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } else { - tfc.dispose(this.states_); - } - - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - - const expectedShape = stateShape; - - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError( - `State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${ - value.shape}`); - } - - this.states_[index] = value; - } - } - - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - - protected computeSingleOutputShape(inputShape: Shape): Shape { - const {dataFormat, filters, kernelSize, padding, strides, dilationRate} = - this.cell; - - const isChannelsFirst = dataFormat === 'channelsFirst'; - - const h = inputShape[isChannelsFirst ? 3 : 2]; - const w = inputShape[isChannelsFirst ? 4 : 3]; - - const hOut = convOutputLength( - h, kernelSize[0], padding, strides[0], dilationRate[0]); - const wOut = convOutputLength( - w, kernelSize[1], padding, strides[1], dilationRate[1]); - - const outShape: Shape = [ - ...inputShape.slice(0, 2), - ...(isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters]) - ]; - - return outShape; - } -} - -export declare interface ConvLSTM2DCellArgs extends - Omit, ConvRNN2DCellArgs {} - -export class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell { - /** @nocollapse */ - static className = 'ConvLSTM2DCell'; - - readonly filters: number; - readonly kernelSize: number[]; - readonly strides: number[]; - readonly padding: PaddingMode; - readonly dataFormat: DataFormat; - readonly dilationRate: number[]; - - constructor(args: ConvLSTM2DCellArgs) { - const { - filters, - kernelSize, - strides, - padding, - dataFormat, - dilationRate, - } = args; - - super({...args, units: filters}); - - this.filters = filters; - assertPositiveInteger(this.filters, 'filters'); - - this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize'); - this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize')); - - this.strides = normalizeArray(strides || 1, 2, 'strides'); - this.strides.forEach(stride => assertPositiveInteger(stride, 'strides')); - - this.padding = padding || 'valid'; - checkPaddingMode(this.padding); - - this.dataFormat = dataFormat || 'channelsLast'; - checkDataFormat(this.dataFormat); - - this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate'); - this.dilationRate.forEach( - rate => assertPositiveInteger(rate, 'dilationRate')); - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - - const channelAxis = - this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; - - if (inputShape[channelAxis] == null) { - throw new ValueError( - `The channel dimension of the input should be defined. ` + - `Found ${inputShape[channelAxis]}`); - } - - const inputDim = inputShape[channelAxis]; - - const numOfKernels = 4; - - const kernelShape = - this.kernelSize.concat([inputDim, this.filters * numOfKernels]); - - this.kernel = this.addWeight( - 'kernel', kernelShape, null, this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - - const recurrentKernelShape = - this.kernelSize.concat([this.filters, this.filters * numOfKernels]); - - this.recurrentKernel = this.addWeight( - 'recurrent_kernel', recurrentKernelShape, null, - this.recurrentInitializer, this.recurrentRegularizer, true, - this.recurrentConstraint); - - if (this.useBias) { - let biasInitializer: Initializer; - - if (this.unitForgetBias) { - const init = this.biasInitializer; - - const filters = this.filters; - - biasInitializer = new (class CustomInit extends Initializer { - /** @nocollapse */ - static className = 'CustomInit'; - - apply(shape: Shape, dtype?: DataType): tfc.Tensor { - const biasI = init.apply([filters]); - const biasF = tfc.ones([filters]); - const biasCAndO = init.apply([filters * 2]); - return K.concatenate([biasI, biasF, biasCAndO]); - } - })(); - } else { - biasInitializer = this.biasInitializer; - } - - this.bias = this.addWeight( - 'bias', [this.filters * numOfKernels], null, biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } - - this.built = true; - } - - call(inputs: tfc.Tensor[], kwargs: Kwargs): tfc.Tensor[] { - return tfc.tidy(() => { - if (inputs.length !== 3) { - throw new ValueError( - `ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - - const training = kwargs['training'] || false; - - const x = inputs[0]; // Current input - const hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - - const numOfKernels = 4; - - type DropoutMasks = [tfc.Tensor, tfc.Tensor, tfc.Tensor, tfc.Tensor]; - - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(x), - rate: this.dropout, - training, - count: numOfKernels - }) as tfc.Tensor[]; - } - - const dropoutMask = this.dropoutMask as DropoutMasks; - - const applyDropout = - (x: tfc.Tensor, mask: tfc.Tensor[], index: number) => { - if (!mask || !mask[index]) { - return x; - } - - return tfc.mul(mask[index], x); - }; - - let xI = applyDropout(x, dropoutMask, 0); - let xF = applyDropout(x, dropoutMask, 1); - let xC = applyDropout(x, dropoutMask, 2); - let xO = applyDropout(x, dropoutMask, 3); - - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: numOfKernels - }) as tfc.Tensor[]; - } - - const recDropoutMask = this.recurrentDropoutMask as DropoutMasks; - - let hI = applyDropout(hTMinus1, recDropoutMask, 0); - let hF = applyDropout(hTMinus1, recDropoutMask, 1); - let hC = applyDropout(hTMinus1, recDropoutMask, 2); - let hO = applyDropout(hTMinus1, recDropoutMask, 3); - - const kernelChannelAxis = 3; - - const [kernelI, kernelF, kernelC, kernelO]: tfc.Tensor[] = - tfc.split(this.kernel.read(), numOfKernels, kernelChannelAxis); - - const [biasI, biasF, biasC, biasO]: tfc.Tensor[] = this.useBias ? - tfc.split(this.bias.read(), numOfKernels) : - [null, null, null, null]; - - xI = this.inputConv(xI, kernelI, biasI, this.padding); - xF = this.inputConv(xF, kernelF, biasF, this.padding); - xC = this.inputConv(xC, kernelC, biasC, this.padding); - xO = this.inputConv(xO, kernelO, biasO, this.padding); - - const [recKernelI, recKernelF, recKernelC, recKernelO]: tfc.Tensor[] = - tfc.split( - this.recurrentKernel.read(), numOfKernels, kernelChannelAxis); - - hI = this.recurrentConv(hI, recKernelI); - hF = this.recurrentConv(hF, recKernelF); - hC = this.recurrentConv(hC, recKernelC); - hO = this.recurrentConv(hO, recKernelO); - - const i = this.recurrentActivation.apply(tfc.add(xI, hI)); - const f = this.recurrentActivation.apply(tfc.add(xF, hF)); - const c = tfc.add( - tfc.mul(f, cTMinus1), - tfc.mul(i, this.activation.apply(tfc.add(xC, hC)))); - const h = tfc.mul( - this.recurrentActivation.apply(tfc.add(xO, hO)), - this.activation.apply(c)); - - return [h, h, c]; - }); - } - - getConfig(): tfc.serialization.ConfigDict { - const {'units': _, ...baseConfig} = super.getConfig(); - - const config: tfc.serialization.ConfigDict = { - filters: this.filters, - kernelSize: this.kernelSize, - padding: this.padding, - dataFormat: this.dataFormat, - dilationRate: this.dilationRate, - strides: this.strides, - }; - - return {...baseConfig, ...config}; - } - - inputConv(x: Tensor, w: Tensor, b?: Tensor, padding?: PaddingMode) { - const out = tfc.conv2d( - x as tfc.Tensor3D, w as tfc.Tensor4D, this.strides as [number, number], - (padding || 'valid') as 'same' | 'valid', - this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC', - this.dilationRate as [number, number]); - - if (b) { - return K.biasAdd(out, b, this.dataFormat) as tfc.Tensor3D; - } - - return out; - } - - recurrentConv(x: Tensor, w: Tensor) { - const strides = 1; - - return tfc.conv2d( - x as tfc.Tensor3D, w as tfc.Tensor4D, strides, 'same', - this.dataFormat === 'channelsFirst' ? 'NCHW' : 'NHWC'); - } -} - -tfc.serialization.registerClass(ConvLSTM2DCell); - -export declare interface ConvLSTM2DArgs extends - Omit, ConvRNN2DLayerArgs {} - -export class ConvLSTM2D extends ConvRNN2D { - /** @nocollapse */ - static className = 'ConvLSTM2D'; - - constructor(args: ConvLSTM2DArgs) { - const cell = new ConvLSTM2DCell(args); - - super({...args, cell} as ConvRNN2DLayerArgs); - } - - /** @nocollapse */ - static fromConfig( - cls: tfc.serialization.SerializableConstructor, - config: tfc.serialization.ConfigDict): T { - return new cls(config); - } -} - -tfc.serialization.registerClass(ConvLSTM2D); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts deleted file mode 100644 index 788b384c6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts +++ /dev/null @@ -1,675 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Basic Layers. - */ - -import {any, notEqual, serialization, Tensor, tidy, transpose, util} from '@tensorflow/tfjs-core'; - -import {Activation as ActivationFn, getActivation, serializeActivation} from '../activations'; -import * as K from '../backend/tfjs_backend'; -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {DisposeResult, InputSpec, Layer, LayerArgs} from '../engine/topology'; -import {ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {ActivationIdentifier} from '../keras_format/activation_config'; -import {DataFormat, Shape} from '../keras_format/common'; -import {LayerConfig} from '../keras_format/topology_config'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import {assertPositiveInteger, mapActivationToFusedKernel} from '../utils/generic_utils'; -import {arrayProd, range} from '../utils/math_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -export declare interface DropoutLayerArgs extends LayerArgs { - /** Float between 0 and 1. Fraction of the input units to drop. */ - rate: number; - - /** - * Integer array representing the shape of the binary dropout mask that will - * be multiplied with the input. - * - * For instance, if your inputs have shape `(batchSize, timesteps, features)` - * and you want the dropout mask to be the same for all timesteps, you can use - * `noise_shape=(batch_size, 1, features)`. - */ - noiseShape?: number[]; - - /** An integer to use as random seed. */ - seed?: number; -} - -export class Dropout extends Layer { - /** @nocollapse */ - static className = 'Dropout'; - private readonly rate: number; - private readonly noiseShape: number[]; - private readonly seed: number; - - constructor(args: DropoutLayerArgs) { - super(args); - this.rate = Math.max(Math.min(args.rate, 1), 0); - // So that the scalar doesn't get tidied up between executions. - this.noiseShape = args.noiseShape; - this.seed = args.seed; - this.supportsMasking = true; - } - - protected getNoiseShape(input: Tensor): Shape { - if (this.noiseShape == null) { - return this.noiseShape; - } - const inputShape = input.shape; - const noiseShape: Shape = []; - for (let i = 0; i < this.noiseShape.length; ++i) { - noiseShape.push( - this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); - } - return noiseShape; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (0 < this.rate && this.rate < 1) { - const training = - kwargs['training'] == null ? false : kwargs['training']; - const noiseShape = this.getNoiseShape(input); - const output = K.inTrainPhase( - () => K.dropout(input, this.rate, noiseShape, this.seed), - () => input, training); - return output; - } - return inputs; - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - rate: this.rate, - noiseShape: this.noiseShape, - seed: this.seed, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - - dispose(): DisposeResult { - return super.dispose(); - } -} -serialization.registerClass(Dropout); - -export declare interface DenseLayerArgs extends LayerArgs { - /** Positive integer, dimensionality of the output space. */ - units: number; - /** - * Activation function to use. - * - * If unspecified, no activation is applied. - */ - activation?: ActivationIdentifier; - /** Whether to apply a bias. */ - useBias?: boolean; - /** - * Initializer for the dense kernel weights matrix. - */ - kernelInitializer?: InitializerIdentifier|Initializer; - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier|Initializer; - /** - * If specified, defines inputShape as `[inputDim]`. - */ - inputDim?: number; - - /** - * Constraint for the kernel weights. - */ - kernelConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint for the bias vector. - */ - biasConstraint?: ConstraintIdentifier|Constraint; - - /** - * Regularizer function applied to the dense kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier|Regularizer; -} - -export interface SpatialDropout1DLayerConfig extends LayerConfig { - /** Float between 0 and 1. Fraction of the input units to drop. */ - rate: number; - - /** An integer to use as random seed. */ - seed?: number; -} - -export class SpatialDropout1D extends Dropout { - /** @nocollapse */ - static className = 'SpatialDropout1D'; - - constructor(args: SpatialDropout1DLayerConfig) { - super(args); - this.inputSpec = [{ndim: 3}]; - } - - protected getNoiseShape(input: Tensor): Shape { - const inputShape = input.shape; - return [inputShape[0], 1, inputShape[2]]; - } -} -serialization.registerClass(SpatialDropout1D); - -export class Dense extends Layer { - /** @nocollapse */ - static className = 'Dense'; - private units: number; - // Default activation: Linear (none). - private activation: ActivationFn = null; - private useBias = true; - private kernelInitializer: Initializer; - private biasInitializer: Initializer; - private kernel: LayerVariable = null; - private bias: LayerVariable = null; - - readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal'; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros'; - private readonly kernelConstraint?: Constraint; - private readonly biasConstraint?: Constraint; - private readonly kernelRegularizer?: Regularizer; - private readonly biasRegularizer?: Regularizer; - - constructor(args: DenseLayerArgs) { - super(args); - if (args.batchInputShape == null && args.inputShape == null && - args.inputDim != null) { - // This logic is copied from Layer's constructor, since we can't - // do exactly what the Python constructor does for Dense(). - let batchSize: number = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - this.batchInputShape = [batchSize, args.inputDim]; - } - - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation(args.activation); - if (args.useBias != null) { - this.useBias = args.useBias; - } - this.kernelInitializer = getInitializer( - args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.supportsMasking = true; - - this.inputSpec = [{minNDim: 2}]; - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const inputLastDim = inputShape[inputShape.length - 1]; - if (this.kernel == null) { - this.kernel = this.addWeight( - 'kernel', [inputLastDim, this.units], null, this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.units], null, this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } - } - - this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}]; - this.built = true; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - outputShape[outputShape.length - 1] = this.units; - return outputShape; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Dense layer accepts only a single input. - const input = getExactlyOneTensor(inputs); - const fusedActivationName = - mapActivationToFusedKernel(this.activation.getClassName()); - let output: Tensor; - - if (fusedActivationName != null) { - output = K.dot( - input, this.kernel.read(), fusedActivationName, - this.bias ? this.bias.read() : null); - } else { - output = K.dot(input, this.kernel.read()); - if (this.bias != null) { - output = K.biasAdd(output, this.bias.read()); - } - if (this.activation != null) { - output = this.activation.apply(output); - } - } - - return output; - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - biasConstraint: serializeConstraint(this.biasConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Dense); - -export declare interface FlattenLayerArgs extends LayerArgs { - /** Image data format: channeLast (default) or channelFirst. */ - dataFormat?: DataFormat; -} - -export class Flatten extends Layer { - private dataFormat: DataFormat; - - /** @nocollapse */ - static className = 'Flatten'; - constructor(args?: FlattenLayerArgs) { - args = args || {}; - super(args); - this.inputSpec = [{minNDim: 3}]; - this.dataFormat = args.dataFormat; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - for (const dim of inputShape.slice(1)) { - if (dim == null) { - throw new ValueError( - `The shape of the input to "Flatten" is not fully defined ` + - `(got ${inputShape.slice(1)}). Make sure to pass a complete ` + - `"input_shape" or "batch_input_shape" argument to the first ` + - `layer in your model.`); - } - } - return [inputShape[0], arrayProd(inputShape, 1)]; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - - let input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsFirst' && input.rank > 1) { - const permutation: number[] = [0]; - for (let i = 2; i < input.rank; ++i) { - permutation.push(i); - } - permutation.push(1); - input = input.transpose(permutation); - } - - return K.batchFlatten(input); - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = {}; - if (this.dataFormat != null) { - config['dataFormat'] = this.dataFormat; - } - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Flatten); - -export declare interface ActivationLayerArgs extends LayerArgs { - /** - * Name of the activation function to use. - */ - activation: ActivationIdentifier; -} - -export class Activation extends Layer { - /** @nocollapse */ - static className = 'Activation'; - activation: ActivationFn; - - constructor(args: ActivationLayerArgs) { - super(args); - this.supportsMasking = true; - this.activation = getActivation(args.activation); - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - return this.activation.apply(input); - }); - } - - getConfig(): serialization.ConfigDict { - const config = {activation: serializeActivation(this.activation)}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Activation); - -export declare interface ReshapeLayerArgs extends LayerArgs { - /** The target shape. Does not include the batch axis. */ - targetShape: Shape; -} - -export declare interface RepeatVectorLayerArgs extends LayerArgs { - /** - * The integer number of times to repeat the input. - */ - n: number; -} - -export class RepeatVector extends Layer { - /** @nocollapse */ - static className = 'RepeatVector'; - readonly n: number; - - constructor(args: RepeatVectorLayerArgs) { - super(args); - this.n = args.n; - this.inputSpec = [{ndim: 2}]; - } - - computeOutputShape(inputShape: Shape): Shape { - return [inputShape[0], this.n, inputShape[1]]; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = getExactlyOneTensor(inputs); - return K.repeat(inputs, this.n); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - n: this.n, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(RepeatVector); - -export class Reshape extends Layer { - /** @nocollapse */ - static className = 'Reshape'; - private targetShape: Shape; - - constructor(args: ReshapeLayerArgs) { - super(args); - this.targetShape = args.targetShape; - - // Make sure that all unknown dimensions are represented as `null`. - for (let i = 0; i < this.targetShape.length; ++i) { - if (this.isUnknown(this.targetShape[i])) { - this.targetShape[i] = null; - } - } - } - - private isUnknown(dim: number): boolean { - return dim < 0 || dim == null; - } - - /** - * Finds and replaces a missing dimension in output shape. - * - * This is a near direct port of the internal Numpy function - * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`. - * - * @param inputShape: Original shape of array begin reshape. - * @param outputShape: Target shape of the array, with at most a single - * `null` or negative number, which indicates an underdetermined dimension - * that should be derived from `inputShape` and the known dimensions of - * `outputShape`. - * @returns: The output shape with `null` replaced with its computed value. - * @throws: ValueError: If `inputShape` and `outputShape` do not match. - */ - private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape { - const errorMsg = 'Total size of new array must be unchanged.'; - const finalShape = outputShape.slice(); - let known = 1; - let unknown = null; - for (let i = 0; i < finalShape.length; ++i) { - const dim = finalShape[i]; - if (this.isUnknown(dim)) { - if (unknown === null) { - unknown = i; - } else { - throw new ValueError('Can only specifiy one unknown dimension.'); - } - } else { - known *= dim; - } - } - - const originalSize = arrayProd(inputShape); - if (unknown !== null) { - if (known === 0 || originalSize % known !== 0) { - throw new ValueError(errorMsg); - } - finalShape[unknown] = originalSize / known; - } else if (originalSize !== known) { - throw new ValueError(errorMsg); - } - - return finalShape; - } - - computeOutputShape(inputShape: Shape): Shape { - let anyUnknownDims = false; - for (let i = 0; i < inputShape.length; ++i) { - if (this.isUnknown(inputShape[i])) { - anyUnknownDims = true; - break; - } - } - - if (anyUnknownDims) { - return inputShape.slice(0, 1).concat(this.targetShape); - } else { - return inputShape.slice(0, 1).concat( - this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const outputShape = inputShape.slice(0, 1).concat( - this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - return input.reshape(outputShape); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - targetShape: this.targetShape, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Reshape); - -export declare interface PermuteLayerArgs extends LayerArgs { - /** - * Array of integers. Permutation pattern. Does not include the - * sample (batch) dimension. Index starts at 1. - * For instance, `[2, 1]` permutes the first and second dimensions - * of the input. - */ - dims: number[]; -} - -export class Permute extends Layer { - /** @nocollapse */ - static className = 'Permute'; - readonly dims: number[]; - private readonly dimsIncludingBatch: number[]; - - constructor(args: PermuteLayerArgs) { - super(args); - if (args.dims == null) { - throw new Error( - 'Required configuration field `dims` is missing during Permute ' + - 'constructor call.'); - } - if (!Array.isArray(args.dims)) { - throw new Error( - 'Permute constructor requires `dims` to be an Array, but received ' + - `${args.dims} instead.`); - } - - // Check the validity of the permutation indices. - const expectedSortedIndices = range(1, args.dims.length + 1); - if (!util.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { - throw new Error( - 'Invalid permutation `dims`: ' + JSON.stringify(args.dims) + - ' `dims` must contain consecutive integers starting from 1.'); - } - - this.dims = args.dims; - this.dimsIncludingBatch = [0].concat(this.dims); - this.inputSpec = [new InputSpec({ndim: this.dims.length + 1})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const outputShape = inputShape.slice(); - this.dims.forEach((dim: number, i: number) => { - outputShape[i + 1] = (inputShape as Shape)[dim]; - }); - return outputShape; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return transpose(getExactlyOneTensor(inputs), this.dimsIncludingBatch); - } - - getConfig(): serialization.ConfigDict { - const config = { - dims: this.dims, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Permute); - -export declare interface MaskingArgs extends LayerArgs { - /** - * Masking Value. Defaults to `0.0`. - */ - maskValue?: number; -} - -export class Masking extends Layer { - /** @nocollapse */ - static className = 'Masking'; - maskValue: number; - - constructor(args?: MaskingArgs) { - super(args == null ? {} : args); - this.supportsMasking = true; - if (args != null) { - this.maskValue = args.maskValue == null ? 0 : args.maskValue; - } else { - this.maskValue = 0; - } - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig() { - const baseConfig = super.getConfig(); - const config = {maskValue: this.maskValue}; - Object.assign(config, baseConfig); - return config; - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor { - const input = getExactlyOneTensor(inputs); - const axis = -1; - return any(notEqual(input, this.maskValue), axis); - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const axis = -1; - const keepDims = true; - const booleanMask = any(notEqual(input, this.maskValue), axis, keepDims); - const output = input.mul(booleanMask.asType(input.dtype)); - return output; - }); - } -} -serialization.registerClass(Masking); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts deleted file mode 100644 index 2917146b9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Embedding Layer. - * - * Original source: keras/constraints.py - */ -import {notEqual, serialization, Tensor, tidy, zerosLike} from '@tensorflow/tfjs-core'; - -import * as K from '../backend/tfjs_backend'; -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {Layer, LayerArgs} from '../engine/topology'; -import {ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -export declare interface EmbeddingLayerArgs extends LayerArgs { - /** - * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1. - */ - inputDim: number; - /** - * Integer >= 0. Dimension of the dense embedding. - */ - outputDim: number; - /** - * Initializer for the `embeddings` matrix. - */ - embeddingsInitializer?: InitializerIdentifier|Initializer; - /** - * Regularizer function applied to the `embeddings` matrix. - */ - embeddingsRegularizer?: RegularizerIdentifier|Regularizer; - /** - * Regularizer function applied to the activation. - */ - activityRegularizer?: RegularizerIdentifier|Regularizer; - /** - * Constraint function applied to the `embeddings` matrix. - */ - embeddingsConstraint?: ConstraintIdentifier|Constraint; - /** - * Whether the input value 0 is a special "padding" value that should be - * masked out. This is useful when using recurrent layers which may take - * variable length input. - * - * If this is `True` then all subsequent layers in the model need to support - * masking or an exception will be raised. If maskZero is set to `True`, as a - * consequence, index 0 cannot be used in the vocabulary (inputDim should - * equal size of vocabulary + 1). - */ - maskZero?: boolean; - /** - * Length of input sequences, when it is constant. - * - * This argument is required if you are going to connect `flatten` then - * `dense` layers upstream (without it, the shape of the dense outputs cannot - * be computed). - */ - inputLength?: number|number[]; -} - -export class Embedding extends Layer { - /** @nocollapse */ - static className = 'Embedding'; - private inputDim: number; - private outputDim: number; - private embeddingsInitializer: Initializer; - private maskZero: boolean; - private inputLength: number|number[]; - - private embeddings: LayerVariable = null; - - readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier = - 'randomUniform'; - private readonly embeddingsRegularizer?: Regularizer; - private readonly embeddingsConstraint?: Constraint; - - constructor(args: EmbeddingLayerArgs) { - super(args); - if (args.batchInputShape == null && args.inputShape == null) { - // Porting Note: This logic is copied from Layer's constructor, since we - // can't do exactly what the Python constructor does for Embedding(). - // Specifically, the super constructor can not be called after the - // mutation of the `config` argument. - let batchSize: number = null; - if (args.batchSize != null) { - batchSize = args.batchSize; - } - if (args.inputLength == null) { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (None, ) - this.batchInputShape = [batchSize, null]; - } else { - // Fix super-constructor to what it would have done if - // 'config.inputShape' were (config.inputLength, ) - this.batchInputShape = - [batchSize].concat(generic_utils.toList(args.inputLength)); - } - } - this.inputDim = args.inputDim; - generic_utils.assertPositiveInteger(this.inputDim, 'inputDim'); - this.outputDim = args.outputDim; - generic_utils.assertPositiveInteger(this.outputDim, 'outputDim'); - this.embeddingsInitializer = getInitializer( - args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER); - this.embeddingsRegularizer = getRegularizer(args.embeddingsRegularizer); - this.activityRegularizer = getRegularizer(args.activityRegularizer); - this.embeddingsConstraint = getConstraint(args.embeddingsConstraint); - this.maskZero = args.maskZero; - this.supportsMasking = args.maskZero; - this.inputLength = args.inputLength; - } - - public build(inputShape: Shape|Shape[]): void { - this.embeddings = this.addWeight( - 'embeddings', [this.inputDim, this.outputDim], this.dtype, - this.embeddingsInitializer, this.embeddingsRegularizer, true, - this.embeddingsConstraint); - this.built = true; - } - - // Override warnOnIncompatibleInputShape because an embedding layer allows - // the input to have varying ranks. - protected warnOnIncompatibleInputShape(inputShape: Shape) {} - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor { - return tidy(() => { - if (!this.maskZero) { - return null; - } else { - inputs = getExactlyOneTensor(inputs); - return notEqual(inputs, zerosLike(inputs)); - } - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - if (this.inputLength == null) { - return [...inputShape, this.outputDim]; - } - // inputLength can be an array if input is 3D or higher. - const inLens: number[] = generic_utils.toList(this.inputLength); - if (inLens.length !== inputShape.length - 1) { - throw new ValueError( - `"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } else { - let i = 0; - for (let k = 0; k < inLens.length; ++k) { - const s1 = inLens[k]; - const s2 = inputShape[k + 1]; - if ((s1 != null) && (s2 != null) && (s1 !== s2)) { - throw new ValueError( - `"inputLength" is ${this.inputLength}, but received ` + - `input shape has shape ${inputShape}`); - } else if (s1 == null) { - inLens[i] = s2; - } - i++; - } - } - return [inputShape[0], ...inLens, this.outputDim]; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Embedding layer accepts only a single input. - let input = getExactlyOneTensor(inputs); - if (input.dtype !== 'int32') { - input = K.cast(input, 'int32'); - } - const output = K.gather(this.embeddings.read(), input.as1D()); - return output.reshape( - getExactlyOneShape(this.computeOutputShape(input.shape))); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - inputDim: this.inputDim, - outputDim: this.outputDim, - embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), - embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), - maskZero: this.maskZero, - inputLength: this.inputLength - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Embedding); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts deleted file mode 100644 index 733c168b1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts +++ /dev/null @@ -1,1075 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Merge Layers. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import {Layer, LayerArgs, SymbolicTensor} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {Shape} from '../keras_format/common'; -import {l2Normalize} from '../losses'; -import {Kwargs} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import * as mathUtils from '../utils/math_utils'; -import {getExactlyOneShape} from '../utils/types_utils'; - -/** - * Generic Merge layer for element-wise merge functions. - * - * Used to implement `Sum`, `Average`, `Concatenate`, etc. - */ -export abstract class Merge extends Layer { - protected reshapeRequired: boolean; - - constructor(args?: LayerArgs) { - super(args || {}); - this.supportsMasking = true; - } - - /** - * Logic for merging multiple tensors, to be overridden by subclasses. - * @param inputs - */ - protected mergeFunction(inputs: Tensor[]): Tensor { - throw new NotImplementedError(); - } - - /** - * Computes the shape of the result of an elementwise operation. - * - * @param shape1: Shape of the first tensor. - * @param shape2: Shape of the second tensor. - * @returns Expected output shape when an elementwise operation is carried - * out on 2 tensors with shapes `shape1` and `shape2`. - * @throws ValueError: If `shape1` and `shape2` are not compatible for - * element-wise operations. - */ - private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape { - if (shape1 == null || shape2 == null) { - return null; - } else if (shape1.length < shape2.length) { - return this.computeElementwiseOpOutputShape(shape2, shape1); - } else if (shape2.length === 0) { - return shape1; - } - const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length); - for (let k = 0; k < shape2.length; ++k) { - const i = shape1[shape1.length - shape2.length + k]; - const j = shape2[k]; - if (i == null || j == null || i < 0 || j < 0) { - outputShape.push(null); - } else if (i === 1) { - outputShape.push(j); - } else if (j === 1) { - outputShape.push(i); - } else { - if (i !== j) { - throw new ValueError( - 'Operands could not be broadcast together with shapes ' + - JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); - } - outputShape.push(i); - } - } - return outputShape; - } - - build(inputShape: Shape|Shape[]): void { - // Used purely for shape validation. - if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { - // Make sure that inputShape is an Array of shape. - inputShape = [getExactlyOneShape(inputShape)]; - } - inputShape = inputShape as Shape[]; - if (inputShape.length < 2) { - throw new ValueError( - 'A merge layer should be called on an Array of at least 2 inputs.' + - ` Got ${inputShape.length} input(s).`); - } - - // Make sure that there is at most one unique batch size among the input - // shapes. - let batchSizes: number[] = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = generic_utils.unique(batchSizes); - if (batchSizes.length > 1) { - throw new ValueError( - `Can not merge tensors with different batch sizes. ` + - `Got tensors with shapes: ${JSON.stringify(inputShape)}.`); - } - - let outputShape: Shape = - inputShape[0] == null ? null : inputShape[0].slice(1); - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - // If the inputs have different ranks, we have to reshape them to make them - // broadcastable. - const allRanks = inputShape.map(shape => shape.length); - if (inputShape.indexOf(null) === -1 && - generic_utils.unique(allRanks).length === 1) { - this.reshapeRequired = false; - } else { - this.reshapeRequired = true; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = inputs as Tensor[]; - if (this.reshapeRequired) { - const reshapedInputs: Tensor[] = []; - const inputDims = inputs.map(input => input.rank); - if (inputDims.indexOf(null) === -1) { - // If ranks of all inputs are available, we simply expand each of them - // at axis=1 until all of them have the same rank. - const maxNDim = mathUtils.max(inputDims); - for (let x of inputs) { - const xNDim = x.rank; - for (let k = 0; k < maxNDim - xNDim; ++k) { - x = K.expandDims(x, 1); - } - reshapedInputs.push(x); - } - return this.mergeFunction(reshapedInputs); - } else { - // Transpose all inputs so that batch size is the last dimension. - // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize] - let transposed = false; - for (const x of inputs) { - const xNDim = x.rank; - if (xNDim == null) { - const xShape = x.shape; - const batchSize = xShape[0]; - const newShape = xShape.slice(1).concat([batchSize]); - let xTransposed = x.reshape( - [batchSize].concat(mathUtils.arrayProd(xShape.slice(1)))); - xTransposed = tfc.transpose(xTransposed, [1, 0]); - xTransposed = xTransposed.reshape(newShape); - reshapedInputs.push(xTransposed); - transposed = true; - } else if (xNDim > 1) { - const dims = mathUtils.range(1, xNDim).concat([0]); - reshapedInputs.push(tfc.transpose(x, dims)); - transposed = true; - } else { - // We don't transpose inputs if they are 1D vectors or scalars. - reshapedInputs.push(x); - } - } - let y = this.mergeFunction(reshapedInputs); - const yNDim = y.rank; - if (transposed) { - // If inputs have been transposed, we have to transpose the output - // too. - if (yNDim == null) { - const yShape = y.shape; - const yNDim = yShape.length; - const batchSize = yShape[yNDim - 1]; - const newShape = - [batchSize].concat(yShape.slice(0, yShape.length - 1)); - y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) - .reshape(newShape); - } else if (yNDim > 1) { - const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1)); - y = tfc.transpose(y, dims); - } - } - return y; - } - } else { - return this.mergeFunction(inputs); - } - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = inputShape as Shape[]; - let outputShape: Shape; - if (inputShape[0] == null) { - outputShape = null; - } else { - outputShape = inputShape[0].slice(1); - } - for (let i = 1; i < inputShape.length; ++i) { - const shape = inputShape[i] == null ? null : inputShape[i].slice(1); - outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); - } - - let batchSizes: number[] = []; - for (const shape of inputShape) { - if (shape != null && shape[0] !== null) { - batchSizes.push(shape[0]); - } - } - batchSizes = generic_utils.unique(batchSizes); - if (batchSizes.length === 1) { - outputShape = batchSizes.concat(outputShape); - } else { - outputShape = [null].concat(outputShape); - } - return outputShape; - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor { - return tfc.tidy(() => { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an Array'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an Array'); - } - if (mask.length !== inputs.length) { - throw new ValueError( - `The Array 'inputs' and 'mask' are expected to have the same ` + - `length, but have different lengths ` + - `(${inputs.length} vs ${mask.length})`); - } - if (mask.every(m => m == null)) { - return null; - } - mask = mask.map(m => m == null ? m : tfc.expandDims(m, 0)); - let output = mask[0]; - for (let i = 1; i < mask.length - 1; ++i) { - output = tfc.logicalAnd(output, mask[i]); - } - return output; - }); - } -} - -export class Add extends Merge { - /** @nocollapse */ - static className = 'Add'; - constructor(args?: LayerArgs) { - super(args); - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return output; - }); - } -} -serialization.registerClass(Add); - -/** - * Calculate the element-wise sum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Add` layer, by using no input argument - * or a single configuration argument. The resultant `Add` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const addLayer = tf.layers.add(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = addLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.add([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.add([input1, input2]).print(); - * // Gives [[11, 22], [33, 44]]. - * - */ -export function add(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer| - SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Add({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Add(config); - } -} - -export class Multiply extends Merge { - /** @nocollapse */ - static className = 'Multiply'; - constructor(args?: LayerArgs) { - super(args); - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.mul(output, inputs[i]); - } - return output; - }); - } -} -serialization.registerClass(Multiply); - -/** - * Calculate the element-wise product of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Multiply` layer, by using no input argument - * or a single configuration argument. The resultant `Multiply` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const multiplyLayer = tf.layers.multiply(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = multiplyLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.multiply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.multiply([input1, input2]).print(); - * // Gives [[10, 40], [90, 160]]. - * - */ -export function multiply(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer| - SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Multiply({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Multiply(config); - } -} - -export class Average extends Merge { - /** @nocollapse */ - static className = 'Average'; - constructor(args?: LayerArgs) { - super(args); - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - let output = inputs[0].clone(); - for (let i = 1; i < inputs.length; ++i) { - output = tfc.add(output, inputs[i]); - } - return tfc.mul(1 / inputs.length, output); - }); - } -} -serialization.registerClass(Average); - -/** - * Calculate the element-wise arithmetic mean of inputs, which all have the same - * shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Average` layer, by using no input argument - * or a single configuration argument. The resultant `Average` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const averageLayer = tf.layers.average(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = averageLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.average([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]); - * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]); - * tf.layers.average([input1, input2]).print(); - * // Gives [[5.5, 11], [16.5, 22]]. - * - */ -export function average(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer| - SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Average({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Average(config); - } -} - -export class Maximum extends Merge { - /** @nocollapse */ - static className = 'Maximum'; - constructor(args?: LayerArgs) { - super(args); - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.maximum(output, inputs[i]); - } - return output; - }); - } -} -serialization.registerClass(Maximum); - -/** - * Calculate the element-wise maximum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Maximum` layer, by using no input argument - * or a single configuration argument. The resultant `Maximum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const maximumLayer = tf.layers.maximum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = maximumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.maximum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.maximum([input1, input2]).print(); - * // Gives [[10, 20], [30, 40]]. - * - */ -export function maximum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer| - SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Maximum({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Maximum(config); - } -} - -export class Minimum extends Merge { - /** @nocollapse */ - static className = 'Minimum'; - constructor(args?: LayerArgs) { - super(args); - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - let output = inputs[0]; - for (let i = 1; i < inputs.length; ++i) { - output = tfc.minimum(output, inputs[i]); - } - return output; - }); - } -} -serialization.registerClass(Minimum); - -/** - * Calculate the element-wise minimum of inputs, which all have the same shape. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Minimum` layer, by using no input argument - * or a single configuration argument. The resultant `Minimum` layer can then - * be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const minimumLayer = tf.layers.minimum(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = minimumLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 2]}); - * const input2 = tf.input({shape: [2, 2]}); - * const output = tf.layers.minimum([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]); - * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]); - * tf.layers.minimum([input1, input2]).print(); - * // Gives [[1, 2], [3, 4]]. - * - */ -export function minimum(config?: SymbolicTensor[]|Tensor[]|LayerArgs): Layer| - SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Minimum({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Minimum(config); - } -} - -export declare interface ConcatenateLayerArgs extends LayerArgs { - /** - * Axis along which to concatenate. - */ - axis?: number; -} - -export class Concatenate extends Merge { - /** @nocollapse */ - static className = 'Concatenate'; - readonly DEFAULT_AXIS = -1; - private readonly axis: number; - - constructor(args?: ConcatenateLayerArgs) { - super(args); - if (args == null) { - args = {}; - } - this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; - this.supportsMasking = true; - this.reshapeRequired = false; - } - - build(inputShape: Shape|Shape[]): void { - // Used purely for shape validation.] - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || - inputShape.length === 1) { - throw new ValueError( - 'A `Concatenate` layer should be called on a list of at least 2 ' + - 'inputs'); - } - inputShape = inputShape as Shape[]; - - let allNoneShape = true; - for (const shape of inputShape) { - if (shape != null) { - allNoneShape = false; - break; - } - } - if (allNoneShape) { - return; - } - - const shapeSet: Shape[] = []; - for (let i = 0; i < inputShape.length; ++i) { - const shapeWithoutConcatAxis = inputShape[i].slice(); - shapeWithoutConcatAxis.splice(this.axis, 1); - let exists = false; - for (const shape of shapeSet) { - if (util.arraysEqual(shape, shapeWithoutConcatAxis)) { - exists = true; - break; - } - } - if (!exists) { - shapeSet.push(shapeWithoutConcatAxis); - } - } - if (shapeSet.length > 1) { - throw new ValueError( - 'A `Concatenate` layer requires inputs with matching shapes ' + - 'except for the concat axis. Got input shapes: ' + - JSON.stringify(inputShape)); - } - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - return tidy(() => { - return K.concatenate(inputs, this.axis); - }); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { - throw new ValueError( - 'A `Concatenate` layer should be called on a list of inputs.'); - } - const inputShapes = inputShape as Shape[]; - const outputShape = inputShapes[0].slice(); - const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; - // Porting Note: the line above is because TypeScript doesn't support - // negative indices. - for (const shape of inputShapes.slice(1)) { - if (outputShape[axis] == null || shape[axis] == null) { - outputShape[axis] = null; - break; - } - outputShape[axis] += shape[axis]; - } - return outputShape; - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor { - if (mask == null) { - return null; - } - if (!Array.isArray(mask)) { - throw new ValueError('`mask` should be an array for Concatenate'); - } - if (!Array.isArray(inputs)) { - throw new ValueError('`inputs` should be an array for Concatenate'); - } - if (mask.length !== inputs.length) { - throw new ValueError( - `Mismatch in the length of mask (${mask.length}) ` + - `and the legnth of inputs (${inputs.length})`); - } - return tfc.tidy(() => { - let allNullMasks = true; - mask.forEach(m => { - if (m != null) { - allNullMasks = false; - return; - } - }); - if (allNullMasks) { - return null; - } - const outputMasks: Tensor[] = []; - for (let i = 0; i < inputs.length; ++i) { - if (mask[i] == null) { - // Input is unmasked. Append all 1's to masks. - outputMasks.push(tfc.onesLike(inputs[i]).asType('bool')); - } else if (mask[i].rank < inputs[i].rank) { - // Mask is smaller than the input, expand it. - outputMasks.push(tfc.expandDims(mask[i], -1)); - } else { - outputMasks.push(mask[i]); - } - } - const concatenatedMasks = tfc.concat(outputMasks, this.axis); - return tfc.all(concatenatedMasks, -1, false); - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - 'axis': this.axis, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Concatenate); - -/** - * Concatenate an `Array` of inputs. - * - * This function can be invoked in three ways. - * - * 1. Construct an instance of `Concatenate` layer, by using no input argument - * or a single configuration argument. The resultant `Concatenate` layer can - * then be used on `tf.SymbolicTensor`s or `tf.Tensor`s. For example: - * - * ```js - * const concatLayer = tf.layers.concatenate(); - * - * // The layer can be applied to inputs. - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = concatLayer.apply([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 7], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 2. Invoke directly on an `Array` of `tf.SymbolicTensor`s. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.SymbolicTensor`. For example: - * - * ```js - * const input1 = tf.input({shape: [2, 3]}); - * const input2 = tf.input({shape: [2, 4]}); - * const output = tf.layers.concatenate([input1, input2]); - * console.log(output.shape); - * // You get [null, 2, 2], with the first dimension as the undetermined batch - * // dimension and the last dimension as the result of concatenating the - * // last dimensions of the two inputs. - * ``` - * - * 3. Invoke directly on `tf.Tensor`s, i.e., concrete values. This constructs - * an `Layer` object internally and calls its `apply` method on the inputs, - * generating a new `tf.Tensor` as the result of the computation. For - * example: - * - * ```js - * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); - * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]); - * tf.layers.concatenate([input1, input2]).print(); - * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]]. - * - */ -export function concatenate(config?: SymbolicTensor[]|Tensor[]| - ConcatenateLayerArgs): Layer|SymbolicTensor|Tensor { - if (Array.isArray(config)) { - const layer = new Concatenate({}); - return layer.apply(config) as SymbolicTensor | Tensor; - } else { - return new Concatenate(config); - } -} - -export declare interface DotLayerArgs extends LayerArgs { - /** - * Axis or axes along which the dot product will be taken. - * - * Integer or an Array of integers. - */ - axes: number|[number, number]; - - /** - * Whether to L2-normalize samples along the dot product axis - * before taking the dot product. - * - * If set to `true`, the output of the dot product isthe cosine - * proximity between the two samples. - */ - normalize?: boolean; -} - -/** - * Interpretable potentially negative axis index. - * - * For example, given axis = -1, and dim = 3, this function will return 2. - * - * @param axis The axis index, may be a positive, zero or negative integer. - * @param dim Total number of dimensions, a positive integer. - * @returns A non-negative axis index equivalent to the input `axis`. - */ -function interpretAxis(axis: number, dim: number): number { - while (axis < 0) { - axis += dim; - } - return axis; -} - -function batchDot(x: Tensor, y: Tensor, axes: number|[number, number]): Tensor { - if (x.shape.length > 3 || y.shape.length > 3) { - throw new NotImplementedError( - 'batchDot is not implemented for tensors of 4D or higher rank yet'); - } - tfc.util.assert( - x.shape.length >= 2, - () => `batchDot requires the rank of x to be >= 2, ` + - `but got ${x.shape.length}`); - tfc.util.assert( - x.shape.length >= 2, - () => `batchDot requires the rank of y to be >= 2, ` + - `but got ${y.shape.length}`); - - if (typeof axes === 'number') { - axes = [axes, axes]; - } - - if (x.dtype === 'complex64' || y.dtype === 'complex64') { - throw new NotImplementedError( - 'batchDot is not implemented for complex64-type Tensors yet.'); - } - - const xNDim = x.shape.length; - const yNDim = y.shape.length; - if (axes == null) { - // Behave like batchMatmul by default. - axes = [xNDim - 1, yNDim - 2]; - } - const axesArray = axes as [number, number]; - - return tfc.tidy(() => { - let diff: number; - if (xNDim > yNDim) { - diff = xNDim - yNDim; - const diffShape: Shape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - y = y.reshape(y.shape.concat(diffShape)); - } else if (yNDim > xNDim) { - diff = yNDim - xNDim; - const diffShape: Shape = []; - for (let i = 0; i < diff; ++i) { - diffShape.push(1); - } - x = x.reshape(x.shape.concat(diffShape)); - } else { - diff = 0; - } - - let out: Tensor; - if (x.shape.length === 2 && y.shape.length === 2) { - if (axesArray[0] === axesArray[1]) { - out = x.mul(y).sum(axesArray[0]); - } else { - out = x.transpose([1, 0]).mul(y).sum(axesArray[1]); - } - } else { - const adjX = axesArray[0] !== x.shape.length - 1; - const adjY = axesArray[1] === y.shape.length - 1; - out = x.matMul(y, adjX, adjY); - } - - if (diff > 0) { - let idx: number; - if (xNDim > yNDim) { - idx = xNDim + yNDim - 3; - } else { - idx = xNDim - 1; - } - const squeezeAxes: number[] = []; - for (let i = idx; i < idx + diff; ++i) { - squeezeAxes.push(i); - } - out = out.squeeze(squeezeAxes); - } - if (out.shape.length === 1) { - out = out.expandDims(1); - } - return out; - }); -} - -export class Dot extends Merge { - /** @nocollapse */ - static className = 'Dot'; - - private axes: number|[number, number]; - private normalize: boolean; - - constructor(args: DotLayerArgs) { - super(args); - this.axes = args.axes; - this.normalize = args.normalize == null ? false : args.normalize; - this.supportsMasking = true; - this.reshapeRequired = false; - } - - build(inputShape: Shape|Shape[]): void { - tfc.util.assert( - Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), - () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = inputShape[0] as Shape; - const shape2 = inputShape[1] as Shape; - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError( - 'Dot layer does not support tensors of 4D or higher rank yet.'); - } - - const axes = this.interpretAxes(shape1, shape2); - if (shape1[axes[0]] !== shape2[axes[1]]) { - throw new ValueError( - `Dimension incompatibility: ` + - `${shape1[axes[0]]} !== ${shape2[axes[1]]}`); - } - } - - protected mergeFunction(inputs: Tensor[]): Tensor { - if (inputs.length !== 2) { - throw new ValueError( - 'A `Dot` layer must be called on exactly 2 inputs, ' + - `but received ${inputs.length} input(s).`); - } - - let x1 = inputs[0]; - let x2 = inputs[1]; - let axes: [number, number]; - if (!Array.isArray(this.axes)) { - axes = [ - interpretAxis(this.axes, x1.shape.length), - interpretAxis(this.axes, x2.shape.length) - ]; - } else { - axes = this.axes.map( - (axis, i) => interpretAxis( - axis, inputs[i].shape.length)) as [number, number]; - } - if (this.normalize) { - x1 = l2Normalize(x1, axes[0]); - x2 = l2Normalize(x2, axes[1]); - } - return batchDot(x1, x2, axes); - } - - private interpretAxes(shape1: Shape, shape2: Shape): number[] { - let axes: number[]; - if (!Array.isArray(this.axes)) { - // `this.axes` is a single integer. - axes = [ - interpretAxis(this.axes, shape1.length), - interpretAxis(this.axes, shape2.length) - ]; - } else { - // `this.axes` is an Array of integers. - axes = this.axes; - } - return axes; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - tfc.util.assert( - Array.isArray(inputShape) && inputShape.length === 2 && - Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), - () => 'A `Dot` layer should be called on a list of exactly 2 inputs.'); - const shape1 = (inputShape[0] as Shape).slice(); - const shape2 = (inputShape[1] as Shape).slice(); - if (shape1.length > 3 || shape2.length > 3) { - throw new NotImplementedError( - 'Dot layer does not support tensors of 4D or higher rank yet.'); - } - - const axes = this.interpretAxes(shape1, shape2); - shape1.splice(axes[0], 1); - shape2.splice(axes[1], 1); - shape2.splice(0, 1); - const outputShape = shape1.concat(shape2); - if (outputShape.length === 1) { - outputShape.push(1); - } - return outputShape; - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor { - return null; - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - 'axes': this.axes, - 'normalize': this.normalize - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(Dot); - -// TODO(cais): Add functional interfaces for the merge layers. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts deleted file mode 100755 index 6135b706f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Noise Layers. - */ - -import {greaterEqual, randomUniform, serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; - -import * as K from '../backend/tfjs_backend'; -import {Layer, LayerArgs} from '../engine/topology'; -import {Shape} from '../keras_format/common'; -import {Kwargs} from '../types'; -import {getExactlyOneTensor} from '../utils/types_utils'; - -export declare interface GaussianNoiseArgs extends LayerArgs { - /** Standard Deviation. */ - stddev: number; -} - -export class GaussianNoise extends Layer { - /** @nocollapse */ - static className = 'GaussianNoise'; - readonly stddev: number; - - constructor(args: GaussianNoiseArgs) { - super(args); - this.supportsMasking = true; - this.stddev = args.stddev; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig() { - const baseConfig = super.getConfig(); - const config = {stddev: this.stddev}; - Object.assign(config, baseConfig); - return config; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - const noised = () => - K.randomNormal(input.shape, 0, this.stddev).add(input); - const output = - K.inTrainPhase(noised, () => input, kwargs['training'] || false); - return output; - }); - } -} -serialization.registerClass(GaussianNoise); - -export declare interface GaussianDropoutArgs extends LayerArgs { - /** drop probability. */ - rate: number; -} - -export class GaussianDropout extends Layer { - /** @nocollapse */ - static className = 'GaussianDropout'; - readonly rate: number; - - constructor(args: GaussianDropoutArgs) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig() { - const baseConfig = super.getConfig(); - const config = {rate: this.rate}; - Object.assign(config, baseConfig); - return config; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - const input = getExactlyOneTensor(inputs); - if (this.rate > 0 && this.rate < 1) { - const noised = () => { - const stddev = Math.sqrt(this.rate / (1 - this.rate)); - return input.mul(K.randomNormal(input.shape, 1, stddev)); - }; - return K.inTrainPhase(noised, () => input, kwargs['training'] || false); - } - return input; - }); - } -} -serialization.registerClass(GaussianDropout); - -export declare interface AlphaDropoutArgs extends LayerArgs { - /** drop probability. */ - rate: number; - /** - * A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - */ - noiseShape?: Shape; -} - -/** - * Applies Alpha Dropout to the input. - * - * As it is a regularization layer, it is only active at training time. - * - * Alpha Dropout is a `Dropout` that keeps mean and variance of inputs - * to their original values, in order to ensure the self-normalizing property - * even after this dropout. - * Alpha Dropout fits well to Scaled Exponential Linear Units - * by randomly setting activations to the negative saturation value. - * - * Arguments: - * - `rate`: float, drop probability (as with `Dropout`). - * The multiplicative noise will have - * standard deviation `sqrt(rate / (1 - rate))`. - * - `noise_shape`: A 1-D `Tensor` of type `int32`, representing the - * shape for randomly generated keep/drop flags. - * - * Input shape: - * Arbitrary. Use the keyword argument `inputShape` - * (tuple of integers, does not include the samples axis) - * when using this layer as the first layer in a model. - * - * Output shape: - * Same shape as input. - * - * References: - * - [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - */ -export class AlphaDropout extends Layer { - /** @nocollapse */ - static className = 'AlphaDropout'; - readonly rate: number; - readonly noiseShape: Shape; - - constructor(args: AlphaDropoutArgs) { - super(args); - this.supportsMasking = true; - this.rate = args.rate; - this.noiseShape = args.noiseShape; - } - - _getNoiseShape(inputs: Tensor|Tensor[]) { - return this.noiseShape || getExactlyOneTensor(inputs).shape; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - return inputShape; - } - - getConfig() { - const baseConfig = super.getConfig(); - const config = {rate: this.rate}; - Object.assign(config, baseConfig); - return config; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - if (this.rate < 1 && this.rate > 0) { - const noiseShape = this._getNoiseShape(inputs); - - const droppedInputs = () => { - const input = getExactlyOneTensor(inputs); - - const alpha = 1.6732632423543772848170429916717; - const scale = 1.0507009873554804934193349852946; - - const alphaP = -alpha * scale; - - let keptIdx = greaterEqual(randomUniform(noiseShape), this.rate); - - keptIdx = K.cast(keptIdx, 'float32'); // get default dtype. - - // Get affine transformation params. - const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; - const b = -a * alphaP * this.rate; - - // Apply mask. - const x = input.mul(keptIdx).add(keptIdx.add(-1).mul(alphaP)); - - return x.mul(a).add(b); - }; - return K.inTrainPhase( - droppedInputs, () => getExactlyOneTensor(inputs), - kwargs['training'] || false); - } - return inputs; - }); - } -} -serialization.registerClass(AlphaDropout); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts deleted file mode 100644 index 31828e57a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts +++ /dev/null @@ -1,639 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Normalization layers. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {moments, serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core'; - -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {InputSpec, Layer, LayerArgs} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers'; -import {Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import * as math_utils from '../utils/math_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -/** - * Applies batch normalization on x given mean, var, beta and gamma. - * - * I.e. returns: - * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` - * - * @param x Input tensor. - * @param mean Mean of batch. - * @param variance Variance of batch. - * @param beta Tensor with which to center the input. - * @param gamma Tensor by which to scale the input. - * @param epsilon Fuzz factor. - * @returns The result of the batch normalization. - */ -export function batchNormalization( - x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor, - epsilon = 1e-3): Tensor { - let out: Tensor; - if (x.rank === 2) { - out = tfc.batchNorm2d( - x as Tensor2D, mean as Tensor2D | Tensor1D, - variance as Tensor2D | Tensor1D, beta as Tensor2D | Tensor1D, - gamma as Tensor2D | Tensor1D, epsilon); - } else if (x.rank === 3) { - // TODO(cais): Check rank; give proper error message. - out = tfc.batchNorm3d( - x as Tensor3D, mean as Tensor3D | Tensor1D, - variance as Tensor3D | Tensor1D, beta as Tensor3D | Tensor1D, - gamma as Tensor3D | Tensor1D, epsilon); - } else if (x.rank === 4) { - out = tfc.batchNorm4d( - x as Tensor4D, mean as Tensor4D | Tensor1D, - variance as Tensor4D | Tensor1D, beta as Tensor4D | Tensor1D, - gamma as Tensor4D | Tensor1D, epsilon); - } else { - throw new NotImplementedError( - `batchNormalization is not implemented for array of rank ${x.rank} ` + - `yet`); - } - return out; -} - -/** - * Non-broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function regularNormalizeBatchInTraining( - x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[], - epsilon = 1e-3): [Tensor, Tensor, Tensor] { - return tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const normed = - batchNormalization(x, mean, variance, beta, gamma, epsilon); - return [normed, mean, variance]; - }) as [Tensor, Tensor, Tensor]; -} - -/** - * Broadcasting batch normalization for use in training (not inference). - * - * The input is normalized to zero mean and unit variance along the - * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`. - * The result of that is returned as the first element - * of the returned `Array`. The other two elements are the mean and variance, - * respectively. - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -function broadcastNormalizeBatchInTraining( - x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[], - epsilon = 1e-3): [Tensor, Tensor, Tensor] { - return tidy(() => { - const meanAndVariance = tfc.moments(x, reductionAxes); - const mean = meanAndVariance.mean; - const variance = meanAndVariance.variance; - const targetShape: number[] = []; - for (const axis of math_utils.range(0, x.rank)) { - if (reductionAxes.indexOf(axis) !== -1) { - targetShape.push(1); - } else { - targetShape.push(x.shape[axis]); - } - } - const broadcastMean = mean.reshape(targetShape); - const broadcastVariance = variance.reshape(targetShape); - const broadcastGamma = - gamma == null ? null : gamma.reshape(targetShape); - const broadcastBeta = - beta == null ? null : beta.reshape(targetShape); - const normed = batchNormalization( - x, broadcastMean, broadcastVariance, broadcastBeta, - broadcastGamma, epsilon); - return [normed, mean, variance]; - }) as [Tensor, Tensor, Tensor]; -} - -/** - * Batch normalization for use in training (not inference). - * - * @param x Input tensor to be normalized. - * @param gamma Tensor by which to scale the input. - * @param beta Tensor by which to center the input. - * @param reductionAxes Axes over which to normalize. - * @param epsilon Fuzz factor. - * @returns An `Array` of three `Tensors`: - * [normalized tensor, mean of input, variance of input]. - */ -export function normalizeBatchInTraining( - x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[], - epsilon = 1e-3): [Tensor, Tensor, Tensor] { - if (util.arraysEqual( - reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) { - return regularNormalizeBatchInTraining( - x, gamma, beta, reductionAxes, epsilon); - } else { - return broadcastNormalizeBatchInTraining( - x, gamma, beta, reductionAxes, epsilon); - } -} - -export declare interface BatchNormalizationLayerArgs extends LayerArgs { - /** - * The integer axis that should be normalized (typically the features axis). - * Defaults to -1. - * - * For instance, after a `Conv2D` layer with `data_format="channels_first"`, - * set `axis=1` in `batchNormalization`. - */ - axis?: number; - - /** - * Momentum of the moving average. Defaults to 0.99. - */ - momentum?: number; - - /** - * Small float added to the variance to avoid dividing by zero. Defaults to - * 1e-3. - */ - epsilon?: number; - - /** - * If `true`, add offset of `beta` to normalized tensor. - * If `false`, `beta` is ignored. - * Defaults to `true`. - */ - center?: boolean; - - /** - * If `true`, multiply by `gamma`. - * If `false`, `gamma` is not used. - * When the next layer is linear (also e.g. `nn.relu`), - * this can be disabled since the scaling will be done by the next layer. - * Defaults to `true`. - */ - scale?: boolean; - - /** - * Initializer for the beta weight. - * Defaults to 'zeros'. - */ - betaInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the gamma weight. - * Defaults to `ones`. - */ - gammaInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the moving mean. - * Defaults to `zeros` - */ - movingMeanInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the moving variance. - * Defaults to 'Ones'. - */ - movingVarianceInitializer?: InitializerIdentifier|Initializer; - - /** - * Constraint for the beta weight. - */ - betaConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint for gamma weight. - */ - gammaConstraint?: ConstraintIdentifier|Constraint; - - /** - * Regularizer for the beta weight. - */ - betaRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer for the gamma weight. - */ - gammaRegularizer?: RegularizerIdentifier|Regularizer; -} - -export class BatchNormalization extends Layer { - /** @nocollapse */ - static className = 'BatchNormalization'; - private readonly axis: number; - private readonly momentum: number; - private readonly epsilon: number; - private readonly center: boolean; - private readonly scale: boolean; - private readonly betaInitializer: Initializer; - private readonly gammaInitializer: Initializer; - private readonly movingMeanInitializer: Initializer; - private readonly movingVarianceInitializer: Initializer; - private readonly betaConstraint: Constraint; - private readonly gammaConstraint: Constraint; - private readonly betaRegularizer: Regularizer; - private readonly gammaRegularizer: Regularizer; - private gamma: LayerVariable; - private beta: LayerVariable; - private movingMean: LayerVariable; - private movingVariance: LayerVariable; - - constructor(args?: BatchNormalizationLayerArgs) { - if (args == null) { - args = {}; - } - super(args); - - this.supportsMasking = true; - this.axis = args.axis == null ? -1 : args.axis; - this.momentum = args.momentum == null ? 0.99 : args.momentum; - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.movingMeanInitializer = - getInitializer(args.movingMeanInitializer || 'zeros'); - this.movingVarianceInitializer = - getInitializer(args.movingVarianceInitializer || 'ones'); - this.betaConstraint = getConstraint(args.betaConstraint); - this.gammaConstraint = getConstraint(args.gammaConstraint); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); - const dim = inputShape[axis]; - if (dim == null) { - throw new ValueError( - `Axis ${axis} of input tensor should have a defined dimension but ` + - `the layer received an input with shape ` + - `${JSON.stringify(inputShape)}.`); - } - this.inputSpec = - [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})]; - const shape = [dim]; - if (this.scale) { - this.gamma = this.addWeight( - 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, - true, this.gammaConstraint); - } - if (this.center) { - this.beta = this.addWeight( - 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true, - this.betaConstraint); - } - this.movingMean = this.addWeight( - 'moving_mean', shape, null, this.movingMeanInitializer, null, false); - this.movingVariance = this.addWeight( - 'moving_variance', shape, null, this.movingVarianceInitializer, null, - false); - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const ndim = inputShape.length; - const reductionAxes = math_utils.range(0, ndim); - const axis = this.axis >= 0 ? this.axis : (this.axis + ndim); - reductionAxes.splice(axis, 1); - const broadcastShape = generic_utils.pyListRepeat(1, ndim); - broadcastShape[axis] = inputShape[axis]; - - const sortedReductionAxes = reductionAxes.slice(); - sortedReductionAxes.sort(); - const needsBroadcasting = !util.arraysEqual( - sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1)); - - const normalizeInference: () => Tensor = () => { - if (needsBroadcasting) { - const broadcastMovingMean = - this.movingMean.read().reshape(broadcastShape); - const broadcastMovingVariance = - this.movingVariance.read().reshape(broadcastShape); - const broadcastBeta = - this.center ? this.beta.read().reshape(broadcastShape) : null; - const broadcastGamma = - this.scale ? this.gamma.read().reshape(broadcastShape) : null; - return batchNormalization( - input, broadcastMovingMean, broadcastMovingVariance, - broadcastBeta, broadcastGamma, this.epsilon); - } else { - return batchNormalization( - input, this.movingMean.read(), this.movingVariance.read(), - this.beta == null ? null : this.beta.read(), - this.gamma == null ? null : this.gamma.read(), this.epsilon); - } - }; - - if (!training) { - return normalizeInference(); - } - - const [normedTraining, mean, variance] = normalizeBatchInTraining( - input, this.gamma.read(), this.beta.read(), reductionAxes, - this.epsilon); - - const doMovingAverage = - (variable: LayerVariable, value: Tensor, momentum: number): void => { - tfc.tidy(() => { - const decay = 1 - momentum; - const origValue = variable.read(); - const updateDelta = origValue.sub(value).mul(decay); - variable.write(origValue.sub(updateDelta)); - }); - }; - - // Perform updates to moving mean and moving variance for training. - // Porting Note: In PyKeras, these updates to `movingMean` and - // `movingAverage` are done as a deferred Graph, added to the `Layer`'s - // `update`s using the `add_update()` method. Here we do it imperatively - // and encapsulate the updates in a function that is invoked - // immediately. - const updateMovingMeanAndVariance = () => { - doMovingAverage(this.movingMean, mean, this.momentum); - doMovingAverage(this.movingVariance, variance, this.momentum); - }; - updateMovingMeanAndVariance(); - - return normedTraining; - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - axis: this.axis, - momentum: this.momentum, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), - movingVarianceInitializer: - serializeInitializer(this.movingVarianceInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer), - betaConstraint: serializeConstraint(this.betaConstraint), - gammaConstraint: serializeConstraint(this.gammaConstraint) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(BatchNormalization); - -export interface LayerNormalizationLayerArgs extends LayerArgs { - /** - * The axis or axes that should be normalized (typically, the feature axis.) - * Defaults to -1 (the last axis.) - */ - axis?: number|number[]; - - /** - * A small positive float added to variance to avoid divison by zero. - * Defaults to 1e-3. - */ - epsilon?: number; - - /** - * If `true`, add offset of `beta` to normalized tensor. - * If `false`, `beta` is ignored. - * Default: `true`. - */ - center?: boolean; - - /** - * If `true`, multiply output by `gamma`. - * If `false`, `gamma` is not used. - * When the next layer is linear, this can be disabled since scaling will - * be done by the next layer. - * Default: `true`. - */ - scale?: boolean; - - /** - * Initializer for the beta weight. - * Default: `'zeros'`. - */ - betaInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the gamma weight. - * Default: `'ones'`. - */ - gammaInitializer?: InitializerIdentifier|Initializer; - - /** Regularizer for the beta weight. */ - betaRegularizer?: RegularizerIdentifier|Regularizer; - - /** Regularizer for the gamma weight. */ - gammaRegularizer?: RegularizerIdentifier|Regularizer; -} - -export class LayerNormalization extends Layer { - /** @nocollapse */ - static className = 'LayerNormalization'; - - private axis: number|number[]; - readonly epsilon: number; - readonly center: boolean; - readonly scale: boolean; - readonly betaInitializer: Initializer; - readonly gammaInitializer: Initializer; - readonly betaRegularizer: Regularizer; - readonly gammaRegularizer: Regularizer; - - private gamma: LayerVariable; - private beta: LayerVariable; - - constructor(args?: LayerNormalizationLayerArgs) { - if (args == null) { - args = {}; - } - super(args); - - this.axis = args.axis == null ? -1 : args.axis; - if (typeof this.axis === 'number') { - if (!Number.isInteger(this.axis)) { - throw new Error( - `Expected axis to be an integer, but received ${this.axis}`); - } - } else if (Array.isArray(this.axis)) { - for (const axis of this.axis) { - if (!Number.isInteger(axis)) { - throw new Error( - `Expected axis to be an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - } - } else { - throw new Error( - `Expected axis to be an integer or an array of integers, ` + - `but received ${JSON.stringify(this.axis)}`); - } - - this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; - this.center = args.center == null ? true : args.center; - this.scale = args.scale == null ? true : args.scale; - this.betaInitializer = getInitializer(args.betaInitializer || 'zeros'); - this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones'); - this.betaRegularizer = getRegularizer(args.betaRegularizer); - this.gammaRegularizer = getRegularizer(args.gammaRegularizer); - - this.supportsMasking = true; - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const nDims = inputShape.length; - - // Convert axis to array and resolve negatives. - if (typeof this.axis === 'number') { - this.axis = [this.axis]; - } - for (let i = 0; i < this.axis.length; ++i) { - if (this.axis[i] < 0) { - this.axis[i] += nDims; - } - } - - // Further validate axes. - for (const axis of this.axis) { - if (axis < 0 || axis >= nDims) { - throw new Error(`Invalid axis: ${axis}`); - } - } - if (this.axis.length !== generic_utils.unique(this.axis).length) { - throw new Error(`Found duplicate axes in: ${this.axis}`); - } - - const paramShape = this.axis.map(axis => inputShape[axis]) as number[]; - - const trainable = true; - if (this.scale) { - this.gamma = this.addWeight( - 'gamma', paramShape, 'float32', this.gammaInitializer, - this.gammaRegularizer, trainable); - } else { - this.gamma = null; - } - if (this.center) { - this.beta = this.addWeight( - 'beta', paramShape, 'float32', this.betaInitializer, - this.betaRegularizer, trainable); - } else { - this.beta = null; - } - - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - const input = getExactlyOneTensor(inputs); - const inputShape = input.shape; - const nDims = inputShape.length; - - return tidy(() => { - const keepDims = true; - let {mean, variance} = moments(input, this.axis, keepDims); - const broadcastShape = generic_utils.pyListRepeat(1, nDims); - for (const dim of this.axis as number[]) { - broadcastShape[dim] = inputShape[dim]; - } - - const broadcast = (v: Tensor) => { - if (v != null && v.shape.length !== nDims && - this.axis !== [nDims - 1]) { - return v.reshape(broadcastShape); - } else { - return v; - } - }; - - let scale = broadcast(this.gamma.read()); - let offset = broadcast(this.beta.read()); - - // TODO(https://github.com/tensorflow/tfjs/issues/2120): The tiling below - // is a workaround for the limitation of core's batchNormalization?d don't - // support broadcasting in their gradients. In addition, the tiling is - // necessary to ensure correctness on the browser CPU backend regardless - // of forward or backward computation. Remove this workaround once the - // limitation is addressed. See . - const momentsTiling: number[] = []; - const scaleOffsetTiling: number[] = []; - for (let i = 0; i < nDims; ++i) { - if ((this.axis as number[]).indexOf(i) !== -1) { - momentsTiling.push(inputShape[i]); - scaleOffsetTiling.push(1); - } else { - momentsTiling.push(1); - scaleOffsetTiling.push(inputShape[i]); - } - } - mean = mean.tile(momentsTiling); - variance = variance.tile(momentsTiling); - scale = scale.tile(scaleOffsetTiling); - offset = offset.tile(scaleOffsetTiling); - - return batchNormalization( - input, mean, variance, offset, scale, this.epsilon); - }); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - axis: this.axis, - epsilon: this.epsilon, - center: this.center, - scale: this.scale, - betaInitializer: serializeInitializer(this.betaInitializer), - gammaInitializer: serializeInitializer(this.gammaInitializer), - betaRegularizer: serializeRegularizer(this.betaRegularizer), - gammaRegularizer: serializeRegularizer(this.gammaRegularizer) - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(LayerNormalization); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts deleted file mode 100644 index f2b66ab85..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Padding Layers. - */ - -// Porting Note: In Python Keras, the padding layers are in convolutional.py, -// but we decided to put them in a separate file (padding.ts) for clarity. - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; - -import {imageDataFormat} from '../backend/common'; -import {InputSpec, Layer, LayerArgs} from '../engine/topology'; -import {ValueError} from '../errors'; -import {DataFormat, Shape} from '../keras_format/common'; -import {Kwargs} from '../types'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; - -/** - * Pads the middle dimension of a 3D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of 2 integers, how many zeros to add at the start and - * end of the middle dimension (i.e., dimension 1). - * @return A padded 3D `tf.Tensor`. - */ -export function temporalPadding(x: Tensor, padding?: [number, number]): Tensor { - return tidy(() => { - if (x.rank !== 3) { - throw new ValueError( - `temporalPadding expects input tensor to be 3-D, but received a ` + - `${x.rank}-D tensor.`); - } - - if (padding == null) { - padding = [1, 1]; - } - if (padding.length !== 2) { - throw new ValueError( - `temporalPadding expects input padding pattern to be a length-2 ` + - `array, but received a length-${padding.length} array.`); - } - - const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]]; - return tfc.pad(x, pattern); - }); -} - -/** - * Pads the 2nd and 3rd dimensions of a 4D tensor. - * - * @param x Input `tf.Tensor` to be padded. - * @param padding `Array` of two `Array`s, each of which is an `Array` of two - * integers. The amount of padding at the beginning and end of the 2nd and 3rd - * dimensions, respectively. - * @param dataFormat 'channelsLast' (default) or 'channelsFirst'. - * @return Padded 4D `tf.Tensor`. - */ -export function spatial2dPadding( - x: Tensor, padding?: [[number, number], [number, number]], - dataFormat?: DataFormat): Tensor { - return tidy(() => { - if (x.rank !== 4) { - throw new ValueError( - `temporalPadding expects input tensor to be 4-D, but received a ` + - `${x.rank}-D tensor.`); - } - - if (padding == null) { - padding = [[1, 1], [1, 1]]; - } - if (padding.length !== 2 || padding[0].length !== 2 || - padding[1].length !== 2) { - throw new ValueError( - 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' + - 'each of which is an Array of two integers.'); - } - - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { - throw new ValueError( - `Unknown data format: ${dataFormat}. ` + - `Supported data formats are 'channelsLast' and 'channelsFirst.`); - } - - let pattern: Array<[number, number]>; - if (dataFormat === 'channelsFirst') { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; - } else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; - } - - return tfc.pad(x, pattern); - }); -} - -export declare interface ZeroPadding2DLayerArgs extends LayerArgs { - /** - * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of - * which is an `Array` of 2 integers. - * - If integer, the same symmetric padding is applied to width and height. - * - If Array` of 2 integers, interpreted as two different symmetric values - * for height and width: - * `[symmetricHeightPad, symmetricWidthPad]`. - * - If `Array` of 2 `Array`s, interpreted as: - * `[[topPad, bottomPad], [leftPad, rightPad]]`. - */ - padding?: number|[number, number]|[[number, number], [number, number]]; - - /** - * One of `'channelsLast'` (default) and `'channelsFirst'`. - * - * The ordering of the dimensions in the inputs. - * `channelsLast` corresponds to inputs with shape - * `[batch, height, width, channels]` while `channelsFirst` - * corresponds to inputs with shape - * `[batch, channels, height, width]`. - */ - dataFormat?: DataFormat; -} - -export class ZeroPadding2D extends Layer { - /** @nocollapse */ - static className = 'ZeroPadding2D'; - readonly dataFormat: DataFormat; - readonly padding: [[number, number], [number, number]]; - - constructor(args?: ZeroPadding2DLayerArgs) { - if (args == null) { - args = {}; - } - super(args); - - this.dataFormat = - args.dataFormat == null ? imageDataFormat() : args.dataFormat; - // TODO(cais): Maybe refactor the following logic surrounding `padding` - // into a helper method. - if (args.padding == null) { - this.padding = [[1, 1], [1, 1]]; - } else if (typeof args.padding === 'number') { - this.padding = - [[args.padding, args.padding], [args.padding, args.padding]]; - } else { - args.padding = args.padding; - if (args.padding.length !== 2) { - throw new ValueError( - `ZeroPadding2D expects padding to be a length-2 array, but ` + - `received a length-${args.padding.length} array.`); - } - - let heightPadding: [number, number]; - let widthPadding: [number, number]; - if (typeof args.padding[0] === 'number') { - heightPadding = [args.padding[0], args.padding[0]]; - widthPadding = [args.padding[1] as number, args.padding[1] as number]; - } else { - args.padding = args.padding as [[number, number], [number, number]]; - - if (args.padding[0].length !== 2) { - throw new ValueError( - `ZeroPadding2D expects height padding to be a length-2 array, ` + - `but received a length-${args.padding[0].length} array.`); - } - heightPadding = args.padding[0] as [number, number]; - - if (args.padding[1].length !== 2) { - throw new ValueError( - `ZeroPadding2D expects width padding to be a length-2 array, ` + - `but received a length-${args.padding[1].length} array.`); - } - widthPadding = args.padding[1] as [number, number]; - } - this.padding = [heightPadding, widthPadding]; - } - this.inputSpec = [new InputSpec({ndim: 4})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - - let rows: number; - let cols: number; - if (this.dataFormat === 'channelsFirst') { - if (inputShape[2] != null && inputShape[2] >= 0) { - rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; - } else { - rows = null; - } - if (inputShape[3] != null && inputShape[3] >= 0) { - cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; - } else { - cols = null; - } - return [inputShape[0], inputShape[1], rows, cols]; - } else { - if (inputShape[1] != null && inputShape[1] >= 0) { - rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; - } else { - rows = null; - } - if (inputShape[2] != null && inputShape[2] >= 0) { - cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; - } else { - cols = null; - } - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy( - () => spatial2dPadding( - getExactlyOneTensor(inputs), this.padding, this.dataFormat)); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - padding: this.padding, - dataFormat: this.dataFormat, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} -serialization.registerClass(ZeroPadding2D); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts deleted file mode 100644 index bf1f0e7f4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts +++ /dev/null @@ -1,701 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Pooling Layers. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, Tensor3D, Tensor4D, Tensor5D, tidy} from '@tensorflow/tfjs-core'; - -import {imageDataFormat} from '../backend/common'; -import * as K from '../backend/tfjs_backend'; -import {checkDataFormat, checkPaddingMode, checkPoolMode} from '../common'; -import {InputSpec} from '../engine/topology'; -import {Layer, LayerArgs} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {DataFormat, PaddingMode, PoolMode, Shape} from '../keras_format/common'; -import {Kwargs} from '../types'; -import {convOutputLength} from '../utils/conv_utils'; -import {assertPositiveInteger} from '../utils/generic_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; - -import {preprocessConv2DInput, preprocessConv3DInput} from './convolutional'; - -/** - * 2D pooling. - * @param x - * @param poolSize - * @param stridesdes strides. Defaults to [1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 2D pooling. - */ -export function pool2d( - x: Tensor, poolSize: [number, number], strides?: [number, number], - padding?: PaddingMode, dataFormat?: DataFormat, - poolMode?: PoolMode): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - - // TODO(cais): Remove the preprocessing step once deeplearn.js supports - // dataFormat as an input argument. - x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing. - let y: Tensor; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - // TODO(cais): Rank check? - y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString); - } else { // 'avg' - // TODO(cais): Check the dtype and rank of x and give clear error message - // if those are incorrect. - y = tfc.avgPool( - // TODO(cais): Rank check? - x as Tensor3D | Tensor4D, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW. - } - return y; - }); -} - -/** - * 3D pooling. - * @param x - * @param poolSize. Default to [1, 1, 1]. - * @param strides strides. Defaults to [1, 1, 1]. - * @param padding padding. Defaults to 'valid'. - * @param dataFormat data format. Defaults to 'channelsLast'. - * @param poolMode Mode of pooling. Defaults to 'max'. - * @returns Result of the 3D pooling. - */ -export function pool3d( - x: Tensor5D, poolSize: [number, number, number], - strides?: [number, number, number], padding?: PaddingMode, - dataFormat?: DataFormat, poolMode?: PoolMode): Tensor { - return tidy(() => { - checkDataFormat(dataFormat); - checkPoolMode(poolMode); - checkPaddingMode(padding); - if (strides == null) { - strides = [1, 1, 1]; - } - if (padding == null) { - padding = 'valid'; - } - if (dataFormat == null) { - dataFormat = imageDataFormat(); - } - if (poolMode == null) { - poolMode = 'max'; - } - - // x is NDHWC after preprocessing. - x = preprocessConv3DInput(x as Tensor, dataFormat) as Tensor5D; - let y: Tensor; - const paddingString = (padding === 'same') ? 'same' : 'valid'; - if (poolMode === 'max') { - y = tfc.maxPool3d(x, poolSize, strides, paddingString); - } else { // 'avg' - y = tfc.avgPool3d(x, poolSize, strides, paddingString); - } - if (dataFormat === 'channelsFirst') { - y = tfc.transpose(y, [0, 4, 1, 2, 3]); // NDHWC -> NCDHW. - } - return y; - }); -} - -export declare interface Pooling1DLayerArgs extends LayerArgs { - /** - * Size of the window to pool over, should be an integer. - */ - poolSize?: number|[number]; - /** - * Period at which to sample the pooled values. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number|[number]; - /** How to fill in data that's not an integer multiple of poolSize. */ - padding?: PaddingMode; -} - -/** - * Abstract class for different pooling 1D layers. - */ -export abstract class Pooling1D extends Layer { - protected readonly poolSize: [number]; - protected readonly strides: [number]; - protected readonly padding: PaddingMode; - - /** - * - * @param args Parameters for the Pooling layer. - * - * config.poolSize defaults to 2. - */ - constructor(args: Pooling1DLayerArgs) { - if (args.poolSize == null) { - args.poolSize = 2; - } - super(args); - if (typeof args.poolSize === 'number') { - this.poolSize = [args.poolSize]; - } else if ( - Array.isArray(args.poolSize) && - (args.poolSize as number[]).length === 1 && - typeof (args.poolSize as number[])[0] === 'number') { - this.poolSize = args.poolSize; - } else { - throw new ValueError( - `poolSize for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.poolSize)}`); - } - assertPositiveInteger(this.poolSize, 'poolSize'); - if (args.strides == null) { - this.strides = this.poolSize; - } else { - if (typeof args.strides === 'number') { - this.strides = [args.strides]; - } else if ( - Array.isArray(args.strides) && - (args.strides as number[]).length === 1 && - typeof (args.strides as number[])[0] === 'number') { - this.strides = args.strides; - } else { - throw new ValueError( - `strides for 1D convolutional layer must be a number or an ` + - `Array of a single number, but received ` + - `${JSON.stringify(args.strides)}`); - } - } - assertPositiveInteger(this.strides, 'strides'); - - this.padding = args.padding == null ? 'valid' : args.padding; - checkPaddingMode(this.padding); - this.inputSpec = [new InputSpec({ndim: 3})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const length = convOutputLength( - inputShape[1], this.poolSize[0], this.padding, this.strides[0]); - return [inputShape[0], length, inputShape[2]]; - } - - protected abstract poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor; - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - // Add dummy last dimension. - inputs = K.expandDims(getExactlyOneTensor(inputs), 2); - const output = this.poolingFunction( - getExactlyOneTensor(inputs), [this.poolSize[0], 1], - [this.strides[0], 1], this.padding, 'channelsLast'); - // Remove dummy last dimension. - return tfc.squeeze(output, [2]); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} - -export class MaxPooling1D extends Pooling1D { - /** @nocollapse */ - static className = 'MaxPooling1D'; - constructor(args: Pooling1DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -serialization.registerClass(MaxPooling1D); - -export class AveragePooling1D extends Pooling1D { - /** @nocollapse */ - static className = 'AveragePooling1D'; - constructor(args: Pooling1DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -serialization.registerClass(AveragePooling1D); - -export declare interface Pooling2DLayerArgs extends LayerArgs { - /** - * Factors by which to downscale in each dimension [vertical, horizontal]. - * Expects an integer or an array of 2 integers. - * - * For example, `[2, 2]` will halve the input in both spatial dimension. - * If only one integer is specified, the same window length - * will be used for both dimensions. - */ - poolSize?: number|[number, number]; - - /** - * The size of the stride in each dimension of the pooling window. Expects - * an integer or an array of 2 integers. Integer, tuple of 2 integers, or - * None. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number|[number, number]; - - /** The padding type to use for the pooling layer. */ - padding?: PaddingMode; - /** The data format to use for the pooling layer. */ - dataFormat?: DataFormat; -} - -/** - * Abstract class for different pooling 2D layers. - */ -export abstract class Pooling2D extends Layer { - protected readonly poolSize: [number, number]; - protected readonly strides: [number, number]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - - constructor(args: Pooling2DLayerArgs) { - if (args.poolSize == null) { - args.poolSize = [2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } else if (Array.isArray(args.strides)) { - if (args.strides.length !== 2) { - throw new ValueError( - `If the strides property of a 2D pooling layer is an Array, ` + - `it is expected to have a length of 2, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - - this.inputSpec = [new InputSpec({ndim: 4})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - let rows = - this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let cols = - this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - rows = - convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); - cols = - convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], rows, cols]; - } else { - return [inputShape[0], rows, cols, inputShape[3]]; - } - } - - protected abstract poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor; - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction( - getExactlyOneTensor(inputs), this.poolSize, this.strides, - this.padding, this.dataFormat); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} - -export class MaxPooling2D extends Pooling2D { - /** @nocollapse */ - static className = 'MaxPooling2D'; - constructor(args: Pooling2DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); - } -} -serialization.registerClass(MaxPooling2D); - -export class AveragePooling2D extends Pooling2D { - /** @nocollapse */ - static className = 'AveragePooling2D'; - constructor(args: Pooling2DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number], strides: [number, number], - padding: PaddingMode, dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); - } -} -serialization.registerClass(AveragePooling2D); - -export declare interface Pooling3DLayerArgs extends LayerArgs { - /** - * Factors by which to downscale in each dimension [depth, height, width]. - * Expects an integer or an array of 3 integers. - * - * For example, `[2, 2, 2]` will halve the input in three dimensions. - * If only one integer is specified, the same window length - * will be used for all dimensions. - */ - poolSize?: number|[number, number, number]; - - /** - * The size of the stride in each dimension of the pooling window. Expects - * an integer or an array of 3 integers. Integer, tuple of 3 integers, or - * None. - * - * If `null`, defaults to `poolSize`. - */ - strides?: number|[number, number, number]; - - /** The padding type to use for the pooling layer. */ - padding?: PaddingMode; - /** The data format to use for the pooling layer. */ - dataFormat?: DataFormat; -} - -/** - * Abstract class for different pooling 3D layers. - */ -export abstract class Pooling3D extends Layer { - protected readonly poolSize: [number, number, number]; - protected readonly strides: [number, number, number]; - protected readonly padding: PaddingMode; - protected readonly dataFormat: DataFormat; - - constructor(args: Pooling3DLayerArgs) { - if (args.poolSize == null) { - args.poolSize = [2, 2, 2]; - } - super(args); - this.poolSize = Array.isArray(args.poolSize) ? - args.poolSize : - [args.poolSize, args.poolSize, args.poolSize]; - if (args.strides == null) { - this.strides = this.poolSize; - } else if (Array.isArray(args.strides)) { - if (args.strides.length !== 3) { - throw new ValueError( - `If the strides property of a 3D pooling layer is an Array, ` + - `it is expected to have a length of 3, but received length ` + - `${args.strides.length}.`); - } - this.strides = args.strides; - } else { - // `config.strides` is a number. - this.strides = [args.strides, args.strides, args.strides]; - } - assertPositiveInteger(this.poolSize, 'poolSize'); - assertPositiveInteger(this.strides, 'strides'); - this.padding = args.padding == null ? 'valid' : args.padding; - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - checkPaddingMode(this.padding); - - this.inputSpec = [new InputSpec({ndim: 5})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - let depths = - this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; - let rows = - this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; - let cols = - this.dataFormat === 'channelsFirst' ? inputShape[4] : inputShape[3]; - depths = convOutputLength( - depths, this.poolSize[0], this.padding, this.strides[0]); - rows = - convOutputLength(rows, this.poolSize[1], this.padding, this.strides[1]); - cols = - convOutputLength(cols, this.poolSize[2], this.padding, this.strides[2]); - if (this.dataFormat === 'channelsFirst') { - return [inputShape[0], inputShape[1], depths, rows, cols]; - } else { - return [inputShape[0], depths, rows, cols, inputShape[4]]; - } - } - - protected abstract poolingFunction( - inputs: Tensor, poolSize: [number, number, number], - strides: [number, number, number], padding: PaddingMode, - dataFormat: DataFormat): Tensor; - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - this.invokeCallHook(inputs, kwargs); - return this.poolingFunction( - getExactlyOneTensor(inputs), this.poolSize, this.strides, - this.padding, this.dataFormat); - }); - } - - getConfig(): serialization.ConfigDict { - const config = { - poolSize: this.poolSize, - padding: this.padding, - strides: this.strides, - dataFormat: this.dataFormat - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} - -export class MaxPooling3D extends Pooling3D { - /** @nocollapse */ - static className = 'MaxPooling3D'; - constructor(args: Pooling3DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number, number], - strides: [number, number, number], padding: PaddingMode, - dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d( - inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'max'); - } -} -serialization.registerClass(MaxPooling3D); - -export class AveragePooling3D extends Pooling3D { - /** @nocollapse */ - static className = 'AveragePooling3D'; - constructor(args: Pooling3DLayerArgs) { - super(args); - } - - protected poolingFunction( - inputs: Tensor, poolSize: [number, number, number], - strides: [number, number, number], padding: PaddingMode, - dataFormat: DataFormat): Tensor { - checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d( - inputs as Tensor5D, poolSize, strides, padding, dataFormat, 'avg'); - } -} -serialization.registerClass(AveragePooling3D); - -/** - * Abstract class for different global pooling 1D layers. - */ -export abstract class GlobalPooling1D extends Layer { - constructor(args: LayerArgs) { - super(args); - this.inputSpec = [new InputSpec({ndim: 3})]; - } - - computeOutputShape(inputShape: Shape): Shape { - return [inputShape[0], inputShape[2]]; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - throw new NotImplementedError(); - } -} - -export class GlobalAveragePooling1D extends GlobalPooling1D { - /** @nocollapse */ - static className = 'GlobalAveragePooling1D'; - constructor(args?: LayerArgs) { - super(args || {}); - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.mean(input, 1); - }); - } -} -serialization.registerClass(GlobalAveragePooling1D); - -export class GlobalMaxPooling1D extends GlobalPooling1D { - /** @nocollapse */ - static className = 'GlobalMaxPooling1D'; - constructor(args: LayerArgs) { - super(args || {}); - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - return tfc.max(input, 1); - }); - } -} -serialization.registerClass(GlobalMaxPooling1D); - -export declare interface GlobalPooling2DLayerArgs extends LayerArgs { - /** - * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`. - * - * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds - * to inputs with shape `[batch, height, width, channels[` while - * `CHANNEL_FIRST` corresponds to inputs with shape - * `[batch, channels, height, width]`. - */ - dataFormat?: DataFormat; -} - -/** - * Abstract class for different global pooling 2D layers. - */ -export abstract class GlobalPooling2D extends Layer { - protected dataFormat: DataFormat; - constructor(args: GlobalPooling2DLayerArgs) { - super(args); - this.dataFormat = - args.dataFormat == null ? 'channelsLast' : args.dataFormat; - checkDataFormat(this.dataFormat); - this.inputSpec = [new InputSpec({ndim: 4})]; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = inputShape as Shape; - if (this.dataFormat === 'channelsLast') { - return [inputShape[0], inputShape[3]]; - } else { - return [inputShape[0], inputShape[1]]; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - throw new NotImplementedError(); - } - - getConfig(): serialization.ConfigDict { - const config = {dataFormat: this.dataFormat}; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } -} - -export class GlobalAveragePooling2D extends GlobalPooling2D { - /** @nocollapse */ - static className = 'GlobalAveragePooling2D'; - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.mean(input, [1, 2]); - } else { - return tfc.mean(input, [2, 3]); - } - }); - } -} -serialization.registerClass(GlobalAveragePooling2D); - -export class GlobalMaxPooling2D extends GlobalPooling2D { - /** @nocollapse */ - static className = 'GlobalMaxPooling2D'; - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const input = getExactlyOneTensor(inputs); - if (this.dataFormat === 'channelsLast') { - return tfc.max(input, [1, 2]); - } else { - return tfc.max(input, [2, 3]); - } - }); - } -} -serialization.registerClass(GlobalMaxPooling2D); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts deleted file mode 100644 index 9945ae2de..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts +++ /dev/null @@ -1,2099 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * TensorFlow.js Layers: Recurrent Neural Network Layers. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core'; - -import {Activation, getActivation, serializeActivation} from '../activations'; -import * as K from '../backend/tfjs_backend'; -import {nameScope} from '../common'; -import {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints'; -import {InputSpec, SymbolicTensor} from '../engine/topology'; -import {Layer, LayerArgs} from '../engine/topology'; -import {AttributeError, NotImplementedError, ValueError} from '../errors'; -import {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers'; -import {ActivationIdentifier} from '../keras_format/activation_config'; -import {Shape} from '../keras_format/common'; -import {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers'; -import {Kwargs, RnnStepFunction} from '../types'; -import {assertPositiveInteger} from '../utils/generic_utils'; -import * as math_utils from '../utils/math_utils'; -import {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils'; -import {batchGetValue, batchSetValue, LayerVariable} from '../variables'; -import {deserialize} from './serialization'; - -/** - * Standardize `apply()` args to a single list of tensor inputs. - * - * When running a model loaded from file, the input tensors `initialState` and - * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the - * dedicated kwargs fields. `inputs` consists of - * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this - * case. - * This method makes sure that arguments are - * separated and that `initialState` and `constants` are `Array`s of tensors - * (or None). - * - * @param inputs Tensor or `Array` of tensors. - * @param initialState Tensor or `Array` of tensors or `null`/`undefined`. - * @param constants Tensor or `Array` of tensors or `null`/`undefined`. - * @returns An object consisting of - * inputs: A tensor. - * initialState: `Array` of tensors or `null`. - * constants: `Array` of tensors or `null`. - * @throws ValueError, if `inputs` is an `Array` but either `initialState` or - * `constants` is provided. - */ -export function standardizeArgs( - inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - numConstants?: number): { - inputs: Tensor|SymbolicTensor, - initialState: Tensor[]|SymbolicTensor[], - constants: Tensor[]|SymbolicTensor[] -} { - if (Array.isArray(inputs)) { - if (initialState != null || constants != null) { - throw new ValueError( - 'When inputs is an array, neither initialState or constants ' + - 'should be provided'); - } - if (numConstants != null) { - constants = inputs.slice(inputs.length - numConstants, inputs.length); - inputs = inputs.slice(0, inputs.length - numConstants); - } - if (inputs.length > 1) { - initialState = inputs.slice(1, inputs.length); - } - inputs = inputs[0]; - } - - function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor| - SymbolicTensor[]): Tensor[]|SymbolicTensor[] { - if (x == null || Array.isArray(x)) { - return x as Tensor[] | SymbolicTensor[]; - } else { - return [x] as Tensor[] | SymbolicTensor[]; - } - } - - initialState = toListOrNull(initialState); - constants = toListOrNull(constants); - - return {inputs, initialState, constants}; -} - -/** - * Iterates over the time dimension of a tensor. - * - * @param stepFunction RNN step function. - * Parameters: - * inputs: tensor with shape `[samples, ...]` (no time dimension), - * representing input for the batch of samples at a certain time step. - * states: an Array of tensors. - * Returns: - * outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * newStates: list of tensors, same length and shapes as `states`. The first - * state in the list must be the output tensor at the previous timestep. - * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at - * least 3D). - * @param initialStates Tensor with shape `[samples, outputDim]` (no time - * dimension), containing the initial values of the states used in the step - * function. - * @param goBackwards If `true`, do the iteration over the time dimension in - * reverse order and return the reversed sequence. - * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for - * every element that is masked. - * @param constants An Array of constant values passed at each step. - * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not* - * applicable to this imperative deeplearn.js backend. Its value is ignored. - * @param needPerStepOutputs Whether the per-step outputs are to be - * concatenated into a single tensor and returned (as the second return - * value). Default: `false`. This arg is included so that the relatively - * expensive concatenation of the stepwise outputs can be omitted unless - * the stepwise outputs need to be kept (e.g., for an LSTM layer of which - * `returnSequence` is `true`.) - * @returns An Array: `[lastOutput, outputs, newStates]`. - * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`. - * outputs: tensor with shape `[samples, time, ...]` where each entry - * `output[s, t]` is the output of the step function at time `t` for sample - * `s`. This return value is provided if and only if the - * `needPerStepOutputs` is set as `true`. If it is set as `false`, this - * return value will be `undefined`. - * newStates: Array of tensors, latest states returned by the step function, - * of shape `(samples, ...)`. - * @throws ValueError If input dimension is less than 3. - * - * TODO(nielsene): This needs to be tidy-ed. - */ -export function rnn( - stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[], - goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false, - needPerStepOutputs = false): [Tensor, Tensor, Tensor[]] { - return tfc.tidy(() => { - const ndim = inputs.shape.length; - if (ndim < 3) { - throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`); - } - - // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch, - // ...]. - const axes = [1, 0].concat(math_utils.range(2, ndim)); - inputs = tfc.transpose(inputs, axes); - - if (constants != null) { - throw new NotImplementedError( - 'The rnn() functoin of the deeplearn.js backend does not support ' + - 'constants yet.'); - } - - // Porting Note: the unroll option is ignored by the imperative backend. - if (unroll) { - console.warn( - 'Backend rnn(): the unroll = true option is not applicable to the ' + - 'imperative deeplearn.js backend.'); - } - - if (mask != null) { - mask = mask.asType('bool').asType('float32'); - if (mask.rank === ndim - 1) { - mask = tfc.expandDims(mask, -1); - } - mask = tfc.transpose(mask, axes); - } - - if (goBackwards) { - inputs = tfc.reverse(inputs, 0); - if (mask != null) { - mask = tfc.reverse(mask, 0); - } - } - - // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop - // (tf.while_loop). But for the imperative deeplearn.js backend, we just - // use the usual TypeScript control flow to iterate over the time steps in - // the inputs. - // Porting Note: PyKeras patches a "_use_learning_phase" attribute to - // outputs. - // This is not idiomatic in TypeScript. The info regarding whether we are - // in a learning (i.e., training) phase for RNN is passed in a different - // way. - - const perStepOutputs: Tensor[] = []; - let lastOutput: Tensor; - let states = initialStates; - const timeSteps = inputs.shape[0]; - const perStepInputs = tfc.unstack(inputs); - let perStepMasks: Tensor[]; - if (mask != null) { - perStepMasks = tfc.unstack(mask); - } - - for (let t = 0; t < timeSteps; ++t) { - const currentInput = perStepInputs[t]; - const stepOutputs = tfc.tidy(() => stepFunction(currentInput, states)); - - if (mask == null) { - lastOutput = stepOutputs[0]; - states = stepOutputs[1]; - } else { - const maskedOutputs = tfc.tidy(() => { - const stepMask = perStepMasks[t]; - const negStepMask = tfc.onesLike(stepMask).sub(stepMask); - // TODO(cais): Would tfc.where() be better for performance? - const output = - stepOutputs[0].mul(stepMask).add(states[0].mul(negStepMask)); - const newStates = states.map((state, i) => { - return stepOutputs[1][i].mul(stepMask).add(state.mul(negStepMask)); - }); - return {output, newStates}; - }); - lastOutput = maskedOutputs.output; - states = maskedOutputs.newStates; - } - - if (needPerStepOutputs) { - perStepOutputs.push(lastOutput); - } - } - let outputs: Tensor; - if (needPerStepOutputs) { - const axis = 1; - outputs = tfc.stack(perStepOutputs, axis); - } - return [lastOutput, outputs, states] as [Tensor, Tensor, Tensor[]]; - }); -} - -export declare interface BaseRNNLayerArgs extends LayerArgs { - /** - * A RNN cell instance. A RNN cell is a class that has: - * - a `call()` method, which takes `[Tensor, Tensor]` as the - * first input argument. The first item is the input at time t, and - * second item is the cell state at time t. - * The `call()` method returns `[outputAtT, statesAtTPlus1]`. - * The `call()` method of the cell can also take the argument `constants`, - * see section "Note on passing external constants" below. - * Porting Node: PyKeras overrides the `call()` signature of RNN cells, - * which are Layer subtypes, to accept two arguments. tfjs-layers does - * not do such overriding. Instead we preseve the `call()` signature, - * which due to its `Tensor|Tensor[]` argument and return value, is - * flexible enough to handle the inputs and states. - * - a `stateSize` attribute. This can be a single integer (single state) - * in which case it is the size of the recurrent state (which should be - * the same as the size of the cell output). This can also be an Array of - * integers (one size per state). In this case, the first entry - * (`stateSize[0]`) should be the same as the size of the cell output. - * It is also possible for `cell` to be a list of RNN cell instances, in which - * case the cells get stacked on after the other in the RNN, implementing an - * efficient stacked RNN. - */ - cell?: RNNCell|RNNCell[]; - - /** - * Whether to return the last output in the output sequence, or the full - * sequence. - */ - returnSequences?: boolean; - - /** - * Whether to return the last state in addition to the output. - */ - returnState?: boolean; - - /** - * If `true`, process the input sequence backwards and return the reversed - * sequence (default: `false`). - */ - goBackwards?: boolean; - - /** - * If `true`, the last state for each sample at index i in a batch will be - * used as initial state of the sample of index i in the following batch - * (default: `false`). - * - * You can set RNN layers to be "stateful", which means that the states - * computed for the samples in one batch will be reused as initial states - * for the samples in the next batch. This assumes a one-to-one mapping - * between samples in different successive batches. - * - * To enable "statefulness": - * - specify `stateful: true` in the layer constructor. - * - specify a fixed batch size for your model, by passing - * - if sequential model: - * `batchInputShape: [...]` to the first layer in your model. - * - else for functional model with 1 or more Input layers: - * `batchShape: [...]` to all the first layers in your model. - * This is the expected shape of your inputs - * *including the batch size*. - * It should be a tuple of integers, e.g., `[32, 10, 100]`. - * - specify `shuffle: false` when calling `LayersModel.fit()`. - * - * To reset the state of your model, call `resetStates()` on either the - * specific layer or on the entire model. - */ - stateful?: boolean; - // TODO(cais): Explore whether we can warn users when they fail to set - // `shuffle: false` when training a model consisting of stateful RNNs - // and any stateful Layers in general. - - /** - * If `true`, the network will be unrolled, else a symbolic loop will be - * used. Unrolling can speed-up a RNN, although it tends to be more memory- - * intensive. Unrolling is only suitable for short sequences (default: - * `false`). - * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with - * normal TypeScript control flow. Hence this property is inapplicable and - * ignored in tfjs-layers. - */ - unroll?: boolean; - - /** - * Dimensionality of the input (integer). - * This option (or alternatively, the option `inputShape`) is required when - * this layer is used as the first layer in a model. - */ - inputDim?: number; - - /** - * Length of the input sequences, to be specified when it is constant. - * This argument is required if you are going to connect `Flatten` then - * `Dense` layers upstream (without it, the shape of the dense outputs cannot - * be computed). Note that if the recurrent layer is not the first layer in - * your model, you would need to specify the input length at the level of the - * first layer (e.g., via the `inputShape` option). - */ - inputLength?: number; -} - -export class RNN extends Layer { - /** @nocollapse */ - static className = 'RNN'; - public readonly cell: RNNCell; - public readonly returnSequences: boolean; - public readonly returnState: boolean; - public readonly goBackwards: boolean; - public readonly unroll: boolean; - - public stateSpec: InputSpec[]; - protected states_: Tensor[]; - - // NOTE(cais): For stateful RNNs, the old states cannot be disposed right - // away when new states are set, because the old states may need to be used - // later for backpropagation through time (BPTT) and other purposes. So we - // keep them here for final disposal when the state is reset completely - // (i.e., through no-arg call to `resetStates()`). - protected keptStates: Tensor[][]; - - private numConstants: number; - - constructor(args: RNNLayerArgs) { - super(args); - let cell: RNNCell; - if (args.cell == null) { - throw new ValueError( - 'cell property is missing for the constructor of RNN.'); - } else if (Array.isArray(args.cell)) { - cell = new StackedRNNCells({cells: args.cell}); - } else { - cell = args.cell; - } - if (cell.stateSize == null) { - throw new ValueError( - 'The RNN cell should have an attribute `stateSize` (tuple of ' + - 'integers, one integer per RNN state).'); - } - this.cell = cell; - this.returnSequences = - args.returnSequences == null ? false : args.returnSequences; - this.returnState = args.returnState == null ? false : args.returnState; - this.goBackwards = args.goBackwards == null ? false : args.goBackwards; - this._stateful = args.stateful == null ? false : args.stateful; - this.unroll = args.unroll == null ? false : args.unroll; - - this.supportsMasking = true; - this.inputSpec = [new InputSpec({ndim: 3})]; - this.stateSpec = null; - this.states_ = null; - // TODO(cais): Add constantsSpec and numConstants. - this.numConstants = null; - // TODO(cais): Look into the use of initial_state in the kwargs of the - // constructor. - - this.keptStates = []; - } - - // Porting Note: This is the equivalent of `RNN.states` property getter in - // PyKeras. - getStates(): Tensor[] { - if (this.states_ == null) { - const numStates = - Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - return math_utils.range(0, numStates).map(x => null); - } else { - return this.states_; - } - } - - // Porting Note: This is the equivalent of the `RNN.states` property setter in - // PyKeras. - setStates(states: Tensor[]): void { - this.states_ = states; - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - if (isArrayOfShapes(inputShape)) { - inputShape = (inputShape as Shape[])[0]; - } - inputShape = inputShape as Shape; - - // TODO(cais): Remove the casting once stacked RNN cells become supported. - let stateSize = this.cell.stateSize; - if (!Array.isArray(stateSize)) { - stateSize = [stateSize]; - } - const outputDim = stateSize[0]; - let outputShape: Shape|Shape[]; - if (this.returnSequences) { - outputShape = [inputShape[0], inputShape[1], outputDim]; - } else { - outputShape = [inputShape[0], outputDim]; - } - - if (this.returnState) { - const stateShape: Shape[] = []; - for (const dim of stateSize) { - stateShape.push([inputShape[0], dim]); - } - return [outputShape].concat(stateShape); - } else { - return outputShape; - } - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor - |Tensor[] { - return tfc.tidy(() => { - if (Array.isArray(mask)) { - mask = mask[0]; - } - const outputMask = this.returnSequences ? mask : null; - - if (this.returnState) { - const stateMask = this.states.map(s => null); - return [outputMask].concat(stateMask); - } else { - return outputMask; - } - }); - } - - /** - * Get the current state tensors of the RNN. - * - * If the state hasn't been set, return an array of `null`s of the correct - * length. - */ - get states(): Tensor[] { - if (this.states_ == null) { - const numStates = - Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - const output: Tensor[] = []; - for (let i = 0; i < numStates; ++i) { - output.push(null); - } - return output; - } else { - return this.states_; - } - } - - set states(s: Tensor[]) { - this.states_ = s; - } - - public build(inputShape: Shape|Shape[]): void { - // Note inputShape will be an Array of Shapes of initial states and - // constants if these are passed in apply(). - const constantShape: Shape[] = null; - if (this.numConstants != null) { - throw new NotImplementedError( - 'Constants support is not implemented in RNN yet.'); - } - - if (isArrayOfShapes(inputShape)) { - inputShape = (inputShape as Shape[])[0]; - } - inputShape = inputShape as Shape; - - const batchSize: number = this.stateful ? inputShape[0] : null; - const inputDim = inputShape.slice(2); - this.inputSpec[0] = new InputSpec({shape: [batchSize, null, ...inputDim]}); - - // Allow cell (if RNNCell Layer) to build before we set or validate - // stateSpec. - const stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (constantShape != null) { - throw new NotImplementedError( - 'Constants support is not implemented in RNN yet.'); - } else { - this.cell.build(stepInputShape); - } - - // Set or validate stateSpec. - let stateSize: number[]; - if (Array.isArray(this.cell.stateSize)) { - stateSize = this.cell.stateSize; - } else { - stateSize = [this.cell.stateSize]; - } - - if (this.stateSpec != null) { - if (!util.arraysEqual( - this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]), - stateSize)) { - throw new ValueError( - `An initialState was passed that is not compatible with ` + - `cell.stateSize. Received stateSpec=${this.stateSpec}; ` + - `However cell.stateSize is ${this.cell.stateSize}`); - } - } else { - this.stateSpec = - stateSize.map(dim => new InputSpec({shape: [null, dim]})); - } - if (this.stateful) { - this.resetStates(); - } - } - - /** - * Reset the state tensors of the RNN. - * - * If the `states` argument is `undefined` or `null`, will set the - * state tensor(s) of the RNN to all-zero tensors of the appropriate - * shape(s). - * - * If `states` is provided, will set the state tensors of the RNN to its - * value. - * - * @param states Optional externally-provided initial states. - * @param training Whether this call is done during training. For stateful - * RNNs, this affects whether the old states are kept or discarded. In - * particular, if `training` is `true`, the old states will be kept so - * that subsequent backpropgataion through time (BPTT) may work properly. - * Else, the old states will be discarded. - */ - resetStates(states?: Tensor|Tensor[], training = false): void { - tidy(() => { - if (!this.stateful) { - throw new AttributeError( - 'Cannot call resetStates() on an RNN Layer that is not stateful.'); - } - const batchSize = this.inputSpec[0].shape[0]; - if (batchSize == null) { - throw new ValueError( - 'If an RNN is stateful, it needs to know its batch size. Specify ' + - 'the batch size of your input tensors: \n' + - '- If using a Sequential model, specify the batch size by ' + - 'passing a `batchInputShape` option to your first layer.\n' + - '- If using the functional API, specify the batch size by ' + - 'passing a `batchShape` option to your Input layer.'); - } - // Initialize state if null. - if (this.states_ == null) { - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } else { - this.states_ = [tfc.zeros([batchSize, this.cell.stateSize])]; - } - } else if (states == null) { - // Dispose old state tensors. - tfc.dispose(this.states_); - // For stateful RNNs, fully dispose kept old states. - if (this.keptStates != null) { - tfc.dispose(this.keptStates); - this.keptStates = []; - } - - if (Array.isArray(this.cell.stateSize)) { - this.states_ = - this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim])); - } else { - this.states_[0] = tfc.zeros([batchSize, this.cell.stateSize]); - } - } else { - if (!Array.isArray(states)) { - states = [states]; - } - if (states.length !== this.states_.length) { - throw new ValueError( - `Layer ${this.name} expects ${this.states_.length} state(s), ` + - `but it received ${states.length} state value(s). Input ` + - `received: ${states}`); - } - - if (training === true) { - // Store old state tensors for complete disposal later, i.e., during - // the next no-arg call to this method. We do not dispose the old - // states immediately because that BPTT (among other things) require - // them. - this.keptStates.push(this.states_.slice()); - } else { - tfc.dispose(this.states_); - } - - for (let index = 0; index < this.states_.length; ++index) { - const value = states[index]; - const dim = Array.isArray(this.cell.stateSize) ? - this.cell.stateSize[index] : - this.cell.stateSize; - const expectedShape = [batchSize, dim]; - if (!util.arraysEqual(value.shape, expectedShape)) { - throw new ValueError( - `State ${index} is incompatible with layer ${this.name}: ` + - `expected shape=${expectedShape}, received shape=${ - value.shape}`); - } - this.states_[index] = value; - } - } - this.states_ = this.states_.map(state => tfc.keep(state.clone())); - }); - } - - apply( - inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] { - // TODO(cais): Figure out whether initialState is in kwargs or inputs. - let initialState: Tensor[]|SymbolicTensor[] = - kwargs == null ? null : kwargs['initialState']; - let constants: Tensor[]|SymbolicTensor[] = - kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - - const standardized = - standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - - // If any of `initial_state` or `constants` are specified and are - // `tf.SymbolicTensor`s, then add them to the inputs and temporarily modify - // the input_spec to include them. - - let additionalInputs: Array = []; - let additionalSpecs: InputSpec[] = []; - if (initialState != null) { - kwargs['initialState'] = initialState; - additionalInputs = additionalInputs.concat(initialState); - this.stateSpec = []; - for (const state of initialState) { - this.stateSpec.push(new InputSpec({shape: state.shape})); - } - // TODO(cais): Use the following instead. - // this.stateSpec = initialState.map(state => new InputSpec({shape: - // state.shape})); - additionalSpecs = additionalSpecs.concat(this.stateSpec); - } - if (constants != null) { - kwargs['constants'] = constants; - additionalInputs = additionalInputs.concat(constants); - // TODO(cais): Add this.constantsSpec. - this.numConstants = constants.length; - } - - const isTensor = additionalInputs[0] instanceof SymbolicTensor; - if (isTensor) { - // Compute full input spec, including state and constants. - const fullInput = - [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[]; - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call with temporarily replaced inputSpec. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = super.apply(fullInput, kwargs); - this.inputSpec = originalInputSpec; - return output; - } else { - return super.apply(inputs, kwargs); - } - } - - // tslint:disable-next-line:no-any - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - // Input shape: `[samples, time (padded with zeros), input_dim]`. - // Note that the .build() method of subclasses **must** define - // this.inputSpec and this.stateSpec owith complete input shapes. - return tidy(() => { - const mask = kwargs == null ? null : kwargs['mask'] as Tensor; - const training = kwargs == null ? null : kwargs['training']; - let initialState: Tensor[] = - kwargs == null ? null : kwargs['initialState']; - - inputs = getExactlyOneTensor(inputs); - if (initialState == null) { - if (this.stateful) { - initialState = this.states_; - } else { - initialState = this.getInitialState(inputs); - } - } - - const numStates = - Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; - if (initialState.length !== numStates) { - throw new ValueError( - `RNN Layer has ${numStates} state(s) but was passed ` + - `${initialState.length} initial state(s).`); - } - if (this.unroll) { - console.warn( - 'Ignoring unroll = true for RNN layer, due to imperative backend.'); - } - - const cellCallKwargs: Kwargs = {training}; - - // TODO(cais): Add support for constants. - const step = (inputs: Tensor, states: Tensor[]) => { - // `inputs` and `states` are concatenated to form a single `Array` of - // `tf.Tensor`s as the input to `cell.call()`. - const outputs = - this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[]; - // Marshall the return value into output and new states. - return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]]; - }; - - // TODO(cais): Add support for constants. - - const rnnOutputs = - rnn(step, inputs, initialState, this.goBackwards, mask, null, - this.unroll, this.returnSequences); - const lastOutput = rnnOutputs[0]; - const outputs = rnnOutputs[1]; - const states = rnnOutputs[2]; - - if (this.stateful) { - this.resetStates(states, training); - } - - const output = this.returnSequences ? outputs : lastOutput; - - // TODO(cais): Porperty set learning phase flag. - - if (this.returnState) { - return [output].concat(states); - } else { - return output; - } - }); - } - - getInitialState(inputs: Tensor): Tensor[] { - return tidy(() => { - // Build an all-zero tensor of shape [samples, outputDim]. - // [Samples, timeSteps, inputDim]. - let initialState = tfc.zeros(inputs.shape); - // [Samples]. - initialState = tfc.sum(initialState, [1, 2]); - initialState = K.expandDims(initialState); // [Samples, 1]. - - if (Array.isArray(this.cell.stateSize)) { - return this.cell.stateSize.map( - dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState); - } else { - return this.cell.stateSize > 1 ? - [K.tile(initialState, [1, this.cell.stateSize])] : - [initialState]; - } - }); - } - - get trainableWeights(): LayerVariable[] { - if (!this.trainable) { - return []; - } - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - return this.cell.trainableWeights; - } - - get nonTrainableWeights(): LayerVariable[] { - // Porting Note: In TypeScript, `this` is always an instance of `Layer`. - if (!this.trainable) { - return this.cell.weights; - } - return this.cell.nonTrainableWeights; - } - - setFastWeightInitDuringBuild(value: boolean) { - super.setFastWeightInitDuringBuild(value); - if (this.cell != null) { - this.cell.setFastWeightInitDuringBuild(value); - } - } - - getConfig(): serialization.ConfigDict { - const baseConfig = super.getConfig(); - - const config: serialization.ConfigDict = { - returnSequences: this.returnSequences, - returnState: this.returnState, - goBackwards: this.goBackwards, - stateful: this.stateful, - unroll: this.unroll, - }; - - if (this.numConstants != null) { - config['numConstants'] = this.numConstants; - } - - const cellConfig = this.cell.getConfig(); - - if (this.getClassName() === RNN.className) { - config['cell'] = { - 'className': this.cell.getClassName(), - 'config': cellConfig, - } as serialization.ConfigDictValue; - } - - // this order is necessary, to prevent cell name from replacing layer name - return {...cellConfig, ...baseConfig, ...config}; - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict): T { - const cellConfig = config['cell'] as serialization.ConfigDict; - const cell = deserialize(cellConfig, customObjects) as RNNCell; - return new cls(Object.assign(config, {cell})); - } -} -serialization.registerClass(RNN); - -// Porting Note: This is a common parent class for RNN cells. There is no -// equivalent of this in PyKeras. Having a common parent class forgoes the -// need for `has_attr(cell, ...)` checks or its TypeScript equivalent. -/** - * An RNNCell layer. - * - * @doc {heading: 'Layers', subheading: 'Classes'} - */ -export abstract class RNNCell extends Layer { - /** - * Size(s) of the states. - * For RNN cells with only a single state, this is a single integer. - */ - // See - // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error - public abstract stateSize: number|number[]; - public dropoutMask: Tensor|Tensor[]; - public recurrentDropoutMask: Tensor|Tensor[]; -} - -export declare interface SimpleRNNCellLayerArgs extends LayerArgs { - /** - * units: Positive integer, dimensionality of the output space. - */ - units: number; - - /** - * Activation function to use. - * Default: hyperbolic tangent ('tanh'). - * If you pass `null`, 'linear' activation will be applied. - */ - activation?: ActivationIdentifier; - - /** - * Whether the layer uses a bias vector. - */ - useBias?: boolean; - - /** - * Initializer for the `kernel` weights matrix, used for the linear - * transformation of the inputs. - */ - kernelInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the `recurrentKernel` weights matrix, used for - * linear transformation of the recurrent state. - */ - recurrentInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier|Initializer; - - /** - * Regularizer function applied to the `kernel` weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the `recurrent_kernel` weights matrix. - */ - recurrentRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Constraint function applied to the `kernel` weights matrix. - */ - kernelConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint function applied to the `recurrentKernel` weights matrix. - */ - recurrentConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraintfunction applied to the bias vector. - */ - biasConstraint?: ConstraintIdentifier|Constraint; - - /** - * Float number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the inputs. - */ - dropout?: number; - - /** - * Float number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the recurrent state. - */ - recurrentDropout?: number; -} - -export class SimpleRNNCell extends RNNCell { - /** @nocollapse */ - static className = 'SimpleRNNCell'; - readonly units: number; - readonly activation: Activation; - readonly useBias: boolean; - - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - - readonly dropout: number; - readonly recurrentDropout: number; - - readonly stateSize: number; - - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - - readonly DEFAULT_ACTIVATION = 'tanh'; - readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros'; - - constructor(args: SimpleRNNCellLayerArgs) { - super(args); - this.units = args.units; - assertPositiveInteger(this.units, `units`); - this.activation = getActivation( - args.activation == null ? this.DEFAULT_ACTIVATION : args.activation); - this.useBias = args.useBias == null ? true : args.useBias; - - this.kernelInitializer = getInitializer( - args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer( - args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - - this.dropout = math_utils.min( - [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max( - [0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - // TODO(cais): Use regularizer. - this.kernel = this.addWeight( - 'kernel', [inputShape[inputShape.length - 1], this.units], null, - this.kernelInitializer, this.kernelRegularizer, true, - this.kernelConstraint); - this.recurrentKernel = this.addWeight( - 'recurrent_kernel', [this.units, this.units], null, - this.recurrentInitializer, this.recurrentRegularizer, true, - this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.units], null, this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } else { - this.bias = null; - } - this.built = true; - } - - // Porting Note: PyKeras' equivalent of this method takes two tensor inputs: - // `inputs` and `states`. Here, the two tensors are combined into an - // `Tensor[]` Array as the first input argument. - // Similarly, PyKeras' equivalent of this method returns two values: - // `output` and `[output]`. Here the two are combined into one length-2 - // `Tensor[]`, consisting of `output` repeated. - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = inputs as Tensor[]; - if (inputs.length !== 2) { - throw new ValueError( - `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`); - } - let prevOutput = inputs[1]; - inputs = inputs[0]; - const training = kwargs['training'] == null ? false : kwargs['training']; - - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs as Tensor), - rate: this.dropout, - training - }) as Tensor; - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(prevOutput), - rate: this.recurrentDropout, - training - }) as Tensor; - } - let h: Tensor; - const dpMask: Tensor = this.dropoutMask as Tensor; - const recDpMask: Tensor = this.recurrentDropoutMask as Tensor; - if (dpMask != null) { - h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read()); - } else { - h = K.dot(inputs, this.kernel.read()); - } - if (this.bias != null) { - h = K.biasAdd(h, this.bias.read()); - } - if (recDpMask != null) { - prevOutput = tfc.mul(prevOutput, recDpMask); - } - let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read())); - if (this.activation != null) { - output = this.activation.apply(output); - } - - // TODO(cais): Properly set learning phase on output tensor? - return [output, output]; - }); - } - - getConfig(): serialization.ConfigDict { - const baseConfig = super.getConfig(); - - const config: serialization.ConfigDict = { - units: this.units, - activation: serializeActivation(this.activation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - }; - - return {...baseConfig, ...config}; - } -} -serialization.registerClass(SimpleRNNCell); - -export declare interface SimpleRNNLayerArgs extends BaseRNNLayerArgs { - /** - * Positive integer, dimensionality of the output space. - */ - units: number; - - /** - * Activation function to use. - * - * Defaults to hyperbolic tangent (`tanh`) - * - * If you pass `null`, no activation will be applied. - */ - activation?: ActivationIdentifier; - - /** - * Whether the layer uses a bias vector. - */ - useBias?: boolean; - - /** - * Initializer for the `kernel` weights matrix, used for the linear - * transformation of the inputs. - */ - kernelInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the `recurrentKernel` weights matrix, used for - * linear transformation of the recurrent state. - */ - recurrentInitializer?: InitializerIdentifier|Initializer; - - /** - * Initializer for the bias vector. - */ - biasInitializer?: InitializerIdentifier|Initializer; - - /** - * Regularizer function applied to the kernel weights matrix. - */ - kernelRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the recurrentKernel weights matrix. - */ - recurrentRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Regularizer function applied to the bias vector. - */ - biasRegularizer?: RegularizerIdentifier|Regularizer; - - /** - * Constraint function applied to the kernel weights matrix. - */ - kernelConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint function applied to the recurrentKernel weights matrix. - */ - recurrentConstraint?: ConstraintIdentifier|Constraint; - - /** - * Constraint function applied to the bias vector. - */ - biasConstraint?: ConstraintIdentifier|Constraint; - - /** - * Number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the inputs. - */ - dropout?: number; - - /** - * Number between 0 and 1. Fraction of the units to drop for the linear - * transformation of the recurrent state. - */ - recurrentDropout?: number; -} - -/** - * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the - * `cell` property required. This interface is to be used with constructors - * of concrete RNN layer subtypes. - */ -export declare interface RNNLayerArgs extends BaseRNNLayerArgs { - cell: RNNCell|RNNCell[]; -} - -export class SimpleRNN extends RNN { - /** @nocollapse */ - static className = 'SimpleRNN'; - constructor(args: SimpleRNNLayerArgs) { - args.cell = new SimpleRNNCell(args); - super(args as RNNLayerArgs); - // TODO(cais): Add activityRegularizer. - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState: Tensor[] = - kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, {mask, training, initialState}); - }); - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict): T { - return new cls(config); - } -} -serialization.registerClass(SimpleRNN); - -// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend -// that interface instead of repeating the fields. -export declare interface GRUCellLayerArgs extends SimpleRNNCellLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; - - /** - * GRU convention (whether to apply reset gate after or before matrix - * multiplication). false = "before", true = "after" (only false is - * supported). - */ - resetAfter?: boolean; -} - -export class GRUCell extends RNNCell { - /** @nocollapse */ - static className = 'GRUCell'; - readonly units: number; - readonly activation: Activation; - readonly recurrentActivation: Activation; - readonly useBias: boolean; - - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - - readonly dropout: number; - readonly recurrentDropout: number; - - readonly stateSize: number; - readonly implementation: number; - - readonly DEFAULT_ACTIVATION = 'tanh'; - readonly DEFAULT_RECURRENT_ACTIVATION: ActivationIdentifier = 'hardSigmoid'; - - readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros'; - - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - - constructor(args: GRUCellLayerArgs) { - super(args); - if (args.resetAfter) { - throw new ValueError( - `GRUCell does not support reset_after parameter set to true.`); - } - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation( - args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation( - args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - - this.kernelInitializer = getInitializer( - args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer( - args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - - this.dropout = math_utils.min( - [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max( - [0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = this.units; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight( - 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight( - 'recurrent_kernel', [this.units, this.units * 3], null, - this.recurrentInitializer, this.recurrentRegularizer, true, - this.recurrentConstraint); - if (this.useBias) { - this.bias = this.addWeight( - 'bias', [this.units * 3], null, this.biasInitializer, - this.biasRegularizer, true, this.biasConstraint); - } else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = inputs as Tensor[]; - if (inputs.length !== 2) { - throw new ValueError( - `GRUCell expects 2 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - - const training = kwargs['training'] == null ? false : kwargs['training']; - let hTMinus1 = inputs[1]; // Previous memory state. - inputs = inputs[0]; - - // Note: For superior performance, TensorFlow.js always uses - // implementation 2, regardless of the actual value of - // config.implementation. - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs as Tensor), - rate: this.dropout, - training, - count: 3 - }) as Tensor[]; - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 3 - }) as Tensor[]; - } - const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor]; - const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor]; - let z: Tensor; - let r: Tensor; - let hh: Tensor; - - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let matrixX = K.dot(inputs, this.kernel.read()); - if (this.useBias) { - matrixX = K.biasAdd(matrixX, this.bias.read()); - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - - const recurrentKernelValue = this.recurrentKernel.read(); - const [rk1, rk2] = tfc.split( - recurrentKernelValue, [2 * this.units, this.units], - recurrentKernelValue.rank - 1); - const matrixInner = K.dot(hTMinus1, rk1); - - const [xZ, xR, xH] = tfc.split(matrixX, 3, matrixX.rank - 1); - const [recurrentZ, recurrentR] = - tfc.split(matrixInner, 2, matrixInner.rank - 1); - z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); - r = this.recurrentActivation.apply(tfc.add(xR, recurrentR)); - - const recurrentH = K.dot(tfc.mul(r, hTMinus1), rk2); - hh = this.activation.apply(tfc.add(xH, recurrentH)); - - const h = - tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(1, tfc.neg(z)), hh)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h]; - }); - } - - getConfig(): serialization.ConfigDict { - const baseConfig = super.getConfig(); - - const config: serialization.ConfigDict = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - resetAfter: false - }; - - return {...baseConfig, ...config}; - } -} -serialization.registerClass(GRUCell); - -// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit -// from that interface instead of repeating the fields here. -export declare interface GRULayerArgs extends SimpleRNNLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; -} - -export class GRU extends RNN { - /** @nocollapse */ - static className = 'GRU'; - constructor(args: GRULayerArgs) { - if (args.implementation === 0) { - console.warn( - '`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new GRUCell(args); - super(args as RNNLayerArgs); - // TODO(cais): Add activityRegularizer. - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState: Tensor[] = - kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, {mask, training, initialState}); - }); - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict): T { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -serialization.registerClass(GRU); - -// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend -// that interface instead of repeating the fields. -export declare interface LSTMCellLayerArgs extends SimpleRNNCellLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - - /** - * If `true`, add 1 to the bias of the forget gate at initialization. - * Setting it to `true` will also force `biasInitializer = 'zeros'`. - * This is recommended in - * [Jozefowicz et - * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf). - */ - unitForgetBias?: boolean; - - /** - * Implementation mode, either 1 or 2. - * - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions. - * - * Mode 2 will batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this configuration field. - */ - implementation?: number; -} - -export class LSTMCell extends RNNCell { - /** @nocollapse */ - static className = 'LSTMCell'; - readonly units: number; - readonly activation: Activation; - readonly recurrentActivation: Activation; - readonly useBias: boolean; - - readonly kernelInitializer: Initializer; - readonly recurrentInitializer: Initializer; - readonly biasInitializer: Initializer; - readonly unitForgetBias: boolean; - - readonly kernelConstraint: Constraint; - readonly recurrentConstraint: Constraint; - readonly biasConstraint: Constraint; - - readonly kernelRegularizer: Regularizer; - readonly recurrentRegularizer: Regularizer; - readonly biasRegularizer: Regularizer; - - readonly dropout: number; - readonly recurrentDropout: number; - - readonly stateSize: number[]; - readonly implementation: number; - - readonly DEFAULT_ACTIVATION = 'tanh'; - readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; - readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; - readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; - - readonly DEFAULT_BIAS_INITIALIZER = 'zeros'; - - kernel: LayerVariable; - recurrentKernel: LayerVariable; - bias: LayerVariable; - - constructor(args: LSTMCellLayerArgs) { - super(args); - - this.units = args.units; - assertPositiveInteger(this.units, 'units'); - this.activation = getActivation( - args.activation === undefined ? this.DEFAULT_ACTIVATION : - args.activation); - this.recurrentActivation = getActivation( - args.recurrentActivation === undefined ? - this.DEFAULT_RECURRENT_ACTIVATION : - args.recurrentActivation); - this.useBias = args.useBias == null ? true : args.useBias; - - this.kernelInitializer = getInitializer( - args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); - this.recurrentInitializer = getInitializer( - args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); - - this.biasInitializer = - getInitializer(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); - this.unitForgetBias = args.unitForgetBias; - - this.kernelRegularizer = getRegularizer(args.kernelRegularizer); - this.recurrentRegularizer = getRegularizer(args.recurrentRegularizer); - this.biasRegularizer = getRegularizer(args.biasRegularizer); - - this.kernelConstraint = getConstraint(args.kernelConstraint); - this.recurrentConstraint = getConstraint(args.recurrentConstraint); - this.biasConstraint = getConstraint(args.biasConstraint); - - this.dropout = math_utils.min( - [1, math_utils.max([0, args.dropout == null ? 0 : args.dropout])]); - this.recurrentDropout = math_utils.min([ - 1, - math_utils.max( - [0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) - ]); - this.implementation = args.implementation; - this.stateSize = [this.units, this.units]; - this.dropoutMask = null; - this.recurrentDropoutMask = null; - } - - public build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - const inputDim = inputShape[inputShape.length - 1]; - this.kernel = this.addWeight( - 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer, - this.kernelRegularizer, true, this.kernelConstraint); - this.recurrentKernel = this.addWeight( - 'recurrent_kernel', [this.units, this.units * 4], null, - this.recurrentInitializer, this.recurrentRegularizer, true, - this.recurrentConstraint); - let biasInitializer: Initializer; - if (this.useBias) { - if (this.unitForgetBias) { - const capturedBiasInit = this.biasInitializer; - const capturedUnits = this.units; - biasInitializer = new (class CustomInit extends Initializer { - /** @nocollapse */ - static className = 'CustomInit'; - - apply(shape: Shape, dtype?: DataType): Tensor { - // TODO(cais): More informative variable names? - const bI = capturedBiasInit.apply([capturedUnits]); - const bF = (new Ones()).apply([capturedUnits]); - const bCAndH = capturedBiasInit.apply([capturedUnits * 2]); - return K.concatAlongFirstAxis( - K.concatAlongFirstAxis(bI, bF), bCAndH); - } - })(); - } else { - biasInitializer = this.biasInitializer; - } - this.bias = this.addWeight( - 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, - true, this.biasConstraint); - } else { - this.bias = null; - } - // Porting Notes: Unlike the PyKeras implementation, we perform slicing - // of the weights and bias in the call() method, at execution time. - this.built = true; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const training = kwargs['training'] == null ? false : kwargs['training']; - inputs = inputs as Tensor[]; - if (inputs.length !== 3) { - throw new ValueError( - `LSTMCell expects 3 input Tensors (inputs, h, c), got ` + - `${inputs.length}.`); - } - let hTMinus1 = inputs[1]; // Previous memory state. - const cTMinus1 = inputs[2]; // Previous carry state. - inputs = inputs[0]; - if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { - this.dropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(inputs as Tensor), - rate: this.dropout, - training, - count: 4 - }) as Tensor[]; - } - if (0 < this.recurrentDropout && this.recurrentDropout < 1 && - this.recurrentDropoutMask == null) { - this.recurrentDropoutMask = generateDropoutMask({ - ones: () => tfc.onesLike(hTMinus1), - rate: this.recurrentDropout, - training, - count: 4 - }) as Tensor[]; - } - const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor]; - const recDpMask = - this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor]; - - // Note: For superior performance, TensorFlow.js always uses - // implementation 2 regardless of the actual value of - // config.implementation. - let i: Tensor; - let f: Tensor; - let c: Tensor; - let o: Tensor; - if (0 < this.dropout && this.dropout < 1) { - inputs = tfc.mul(inputs, dpMask[0]); - } - let z = K.dot(inputs, this.kernel.read()); - if (0 < this.recurrentDropout && this.recurrentDropout < 1) { - hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); - } - z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read())); - if (this.useBias) { - z = K.biasAdd(z, this.bias.read()); - } - - const [z0, z1, z2, z3] = tfc.split(z, 4, z.rank - 1); - - i = this.recurrentActivation.apply(z0); - f = this.recurrentActivation.apply(z1); - c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2))); - o = this.recurrentActivation.apply(z3); - - const h = tfc.mul(o, this.activation.apply(c)); - // TODO(cais): Add use_learning_phase flag properly. - return [h, h, c]; - }); - } - - getConfig(): serialization.ConfigDict { - const baseConfig = super.getConfig(); - - const config: serialization.ConfigDict = { - units: this.units, - activation: serializeActivation(this.activation), - recurrentActivation: serializeActivation(this.recurrentActivation), - useBias: this.useBias, - kernelInitializer: serializeInitializer(this.kernelInitializer), - recurrentInitializer: serializeInitializer(this.recurrentInitializer), - biasInitializer: serializeInitializer(this.biasInitializer), - unitForgetBias: this.unitForgetBias, - kernelRegularizer: serializeRegularizer(this.kernelRegularizer), - recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), - biasRegularizer: serializeRegularizer(this.biasRegularizer), - activityRegularizer: serializeRegularizer(this.activityRegularizer), - kernelConstraint: serializeConstraint(this.kernelConstraint), - recurrentConstraint: serializeConstraint(this.recurrentConstraint), - biasConstraint: serializeConstraint(this.biasConstraint), - dropout: this.dropout, - recurrentDropout: this.recurrentDropout, - implementation: this.implementation, - }; - - return {...baseConfig, ...config}; - } -} -serialization.registerClass(LSTMCell); - -// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit -// from that interface instead of repeating the fields here. -export declare interface LSTMLayerArgs extends SimpleRNNLayerArgs { - /** - * Activation function to use for the recurrent step. - * - * Defaults to hard sigmoid (`hardSigmoid`). - * - * If `null`, no activation is applied. - */ - recurrentActivation?: ActivationIdentifier; - - /** - * If `true`, add 1 to the bias of the forget gate at initialization. - * Setting it to `true` will also force `biasInitializer = 'zeros'`. - * This is recommended in - * [Jozefowicz et - * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf). - */ - unitForgetBias?: boolean; - - /** - * Implementation mode, either 1 or 2. - * Mode 1 will structure its operations as a larger number of - * smaller dot products and additions, whereas mode 2 will - * batch them into fewer, larger operations. These modes will - * have different performance profiles on different hardware and - * for different applications. - * - * Note: For superior performance, TensorFlow.js always uses implementation - * 2, regardless of the actual value of this config field. - */ - implementation?: number; -} - -export class LSTM extends RNN { - /** @nocollapse */ - static className = 'LSTM'; - constructor(args: LSTMLayerArgs) { - if (args.implementation === 0) { - console.warn( - '`implementation=0` has been deprecated, and now defaults to ' + - '`implementation=1`. Please update your layer call.'); - } - args.cell = new LSTMCell(args); - super(args as RNNLayerArgs); - // TODO(cais): Add activityRegularizer. - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - if (this.cell.dropoutMask != null) { - tfc.dispose(this.cell.dropoutMask); - this.cell.dropoutMask = null; - } - if (this.cell.recurrentDropoutMask != null) { - tfc.dispose(this.cell.recurrentDropoutMask); - this.cell.recurrentDropoutMask = null; - } - const mask = kwargs == null ? null : kwargs['mask']; - const training = kwargs == null ? null : kwargs['training']; - const initialState: Tensor[] = - kwargs == null ? null : kwargs['initialState']; - return super.call(inputs, {mask, training, initialState}); - }); - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict): T { - if (config['implmentation'] === 0) { - config['implementation'] = 1; - } - return new cls(config); - } -} -serialization.registerClass(LSTM); - -export declare interface StackedRNNCellsArgs extends LayerArgs { - /** - * A `Array` of `RNNCell` instances. - */ - cells: RNNCell[]; -} - -export class StackedRNNCells extends RNNCell { - /** @nocollapse */ - static className = 'StackedRNNCells'; - protected cells: RNNCell[]; - - constructor(args: StackedRNNCellsArgs) { - super(args); - this.cells = args.cells; - } - - get stateSize(): number[] { - // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === - // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, - // assuming one LSTM has states `[h, c]`. - const stateSize: number[] = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - stateSize.push(...cell.stateSize); - } else { - stateSize.push(cell.stateSize); - } - } - return stateSize; - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - inputs = inputs as Tensor[]; - let states = inputs.slice(1); - - // Recover per-cell states. - const nestedStates: Tensor[][] = []; - for (const cell of this.cells.slice().reverse()) { - if (Array.isArray(cell.stateSize)) { - nestedStates.push(states.splice(0, cell.stateSize.length)); - } else { - nestedStates.push(states.splice(0, 1)); - } - } - nestedStates.reverse(); - - // Call the cells in order and store the returned states. - const newNestedStates: Tensor[][] = []; - let callInputs: Tensor[]; - for (let i = 0; i < this.cells.length; ++i) { - const cell = this.cells[i]; - states = nestedStates[i]; - // TODO(cais): Take care of constants. - if (i === 0) { - callInputs = [inputs[0]].concat(states); - } else { - callInputs = [callInputs[0]].concat(states); - } - callInputs = cell.call(callInputs, kwargs) as Tensor[]; - newNestedStates.push(callInputs.slice(1)); - } - - // Format the new states as a flat list in reverse cell order. - states = []; - for (const cellStates of newNestedStates.slice().reverse()) { - states.push(...cellStates); - } - return [callInputs[0]].concat(states); - }); - } - - public build(inputShape: Shape|Shape[]): void { - if (isArrayOfShapes(inputShape)) { - // TODO(cais): Take care of input constants. - // const constantShape = inputShape.slice(1); - inputShape = (inputShape as Shape[])[0]; - } - inputShape = inputShape as Shape; - let outputDim: number; - this.cells.forEach((cell, i) => { - nameScope(`RNNCell_${i}`, () => { - // TODO(cais): Take care of input constants. - - cell.build(inputShape); - if (Array.isArray(cell.stateSize)) { - outputDim = cell.stateSize[0]; - } else { - outputDim = cell.stateSize; - } - inputShape = [inputShape[0], outputDim] as Shape; - }); - }); - this.built = true; - } - - getConfig(): serialization.ConfigDict { - const baseConfig = super.getConfig(); - - const getCellConfig = (cell: RNNCell) => { - return { - 'className': cell.getClassName(), - 'config': cell.getConfig(), - }; - }; - - const cellConfigs = this.cells.map(getCellConfig); - - const config = {'cells': cellConfigs}; - - return {...baseConfig, ...config}; - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict): T { - const cells: RNNCell[] = []; - for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) { - cells.push(deserialize(cellConfig, customObjects) as RNNCell); - } - return new cls({cells}); - } - - get trainableWeights(): LayerVariable[] { - if (!this.trainable) { - return []; - } - const weights: LayerVariable[] = []; - for (const cell of this.cells) { - weights.push(...cell.trainableWeights); - } - return weights; - } - - get nonTrainableWeights(): LayerVariable[] { - const weights: LayerVariable[] = []; - for (const cell of this.cells) { - weights.push(...cell.nonTrainableWeights); - } - if (!this.trainable) { - const trainableWeights: LayerVariable[] = []; - for (const cell of this.cells) { - trainableWeights.push(...cell.trainableWeights); - } - return trainableWeights.concat(weights); - } - return weights; - } - - /** - * Retrieve the weights of a the model. - * - * @returns A flat `Array` of `tf.Tensor`s. - */ - getWeights(): Tensor[] { - const weights: LayerVariable[] = []; - for (const cell of this.cells) { - weights.push(...cell.weights); - } - return batchGetValue(weights); - } - - /** - * Set the weights of the model. - * - * @param weights An `Array` of `tf.Tensor`s with shapes and types matching - * the output of `getWeights()`. - */ - setWeights(weights: Tensor[]): void { - const tuples: Array<[LayerVariable, Tensor]> = []; - for (const cell of this.cells) { - const numParams = cell.weights.length; - const inputWeights = weights.splice(numParams); - for (let i = 0; i < cell.weights.length; ++i) { - tuples.push([cell.weights[i], inputWeights[i]]); - } - } - batchSetValue(tuples); - } - - // TODO(cais): Maybe implemnt `losses` and `getLossesFor`. -} -serialization.registerClass(StackedRNNCells); - -export function generateDropoutMask(args: { - ones: () => tfc.Tensor, - rate: number, - training?: boolean, - count?: number, -}): tfc.Tensor|tfc.Tensor[] { - const {ones, rate, training = false, count = 1} = args; - - const droppedInputs = () => K.dropout(ones(), rate); - - const createMask = () => K.inTrainPhase(droppedInputs, ones, training); - - // just in case count is provided with null or undefined - if (!count || count <= 1) { - return tfc.keep(createMask().clone()); - } - - const masks = Array(count).fill(undefined).map(createMask); - - return masks.map(m => tfc.keep(m.clone())); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts deleted file mode 100644 index 2f71caca9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original Source layers/__init__.py */ -import {serialization} from '@tensorflow/tfjs-core'; - -import {deserializeKerasObject} from '../utils/generic_utils'; - -/** - * Instantiate a layer from a config dictionary. - * @param config dict of the form {class_name: str, config: dict} - * @param customObjects dict mapping class names (or function names) - * of custom (non-Keras) objects to class/functions - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns Layer instance (may be LayersModel, Sequential, Layer...) - */ -export function deserialize( - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict, - fastWeightInit = false): serialization.Serializable { - return deserializeKerasObject( - config, serialization.SerializationMap.getMap().classNameMap, - customObjects, 'layer', fastWeightInit); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts deleted file mode 100644 index 4d1950d19..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts +++ /dev/null @@ -1,590 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Layers that augment the functionality of a base layer. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {serialization, Tensor, tidy} from '@tensorflow/tfjs-core'; -import * as K from '../backend/tfjs_backend'; -import {nameScope} from '../common'; -import {InputSpec, Layer, LayerArgs, SymbolicTensor} from '../engine/topology'; -import {NotImplementedError, ValueError} from '../errors'; -import {BidirectionalMergeMode, Shape, VALID_BIDIRECTIONAL_MERGE_MODES} from '../keras_format/common'; -import {Kwargs} from '../types'; -import {RegularizerFn, RnnStepFunction} from '../types'; -import * as generic_utils from '../utils/generic_utils'; -import {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils'; -import {LayerVariable} from '../variables'; - -import {rnn, RNN, standardizeArgs} from './recurrent'; -import {deserialize} from './serialization'; - -export declare interface WrapperLayerArgs extends LayerArgs { - /** - * The layer to be wrapped. - */ - layer: Layer; -} - -/** - * Abstract wrapper base class. - * - * Wrappers take another layer and augment it in various ways. - * Do not use this class as a layer, it is only an abstract base class. - * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. - */ -export abstract class Wrapper extends Layer { - readonly layer: Layer; - - constructor(args: WrapperLayerArgs) { - // Porting Note: In PyKeras, `self.layer` is set prior to the calling - // `super()`. But we can't do that here due to TypeScript's restriction. - // See: https://github.com/Microsoft/TypeScript/issues/8277 - // As a result, we have to add checks in `get trainable()` and - // `set trainable()` below in order to prevent using `this.layer` when - // its value is `undefined`. The super constructor does use the getter - // and the setter of `this.layer`. - super(args); - this.layer = args.layer; - } - - build(inputShape: Shape|Shape[]): void { - this.built = true; - } - - // TODO(cais): Implement activityRegularizer getter. - - get trainable(): boolean { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - return this.layer.trainable; - } else { - return false; - } - } - - set trainable(value: boolean) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - if (this.layer != null) { - this.layer.trainable = value; - } - } - - get trainableWeights(): LayerVariable[] { - return this.layer.trainableWeights; - } - // TODO(cais): Implement setter for trainableWeights. - - get nonTrainableWeights(): LayerVariable[] { - return this.layer.nonTrainableWeights; - } - // TODO(cais): Implement setter for nonTrainableWeights. - - get updates(): Tensor[] { - // tslint:disable-next-line:no-any - return (this.layer as any)._updates; - } - - // TODO(cais): Implement getUpdatesFor(). - - get losses(): RegularizerFn[] { - return this.layer.losses; - } - - // TODO(cais): Implement getLossesFor(). - - getWeights(): Tensor[] { - return this.layer.getWeights(); - } - - setWeights(weights: Tensor[]): void { - this.layer.setWeights(weights); - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - 'layer': { - 'className': this.layer.getClassName(), - 'config': this.layer.getConfig(), - } - }; - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - - setFastWeightInitDuringBuild(value: boolean) { - super.setFastWeightInitDuringBuild(value); - if (this.layer != null) { - this.layer.setFastWeightInitDuringBuild(value); - } - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict): T { - const layerConfig = config['layer'] as serialization.ConfigDict; - const layer = deserialize(layerConfig, customObjects) as Layer; - delete config['layer']; - const newConfig = {layer}; - Object.assign(newConfig, config); - return new cls(newConfig); - } -} - -export class TimeDistributed extends Wrapper { - /** @nocollapse */ - static className = 'TimeDistributed'; - constructor(args: WrapperLayerArgs) { - super(args); - this.supportsMasking = true; - } - - build(inputShape: Shape|Shape[]): void { - inputShape = getExactlyOneShape(inputShape); - if (inputShape.length < 3) { - throw new ValueError( - `TimeDistributed layer expects an input shape >= 3D, but received ` + - `input shape ${JSON.stringify(inputShape)}`); - } - this.inputSpec = [{shape: inputShape}]; - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - if (!this.layer.built) { - this.layer.build(childInputShape); - this.layer.built = true; - } - super.build(inputShape); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - inputShape = getExactlyOneShape(inputShape); - const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); - const childOutputShape = - this.layer.computeOutputShape(childInputShape) as Shape; - const timesteps = inputShape[1]; - return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs. - inputs = getExactlyOneTensor(inputs); - // Porting Note: In tfjs-layers, `inputs` are always concrete tensor - // values. Hence the inputs can't have an undetermined first (batch) - // dimension, which is why we always use the K.rnn approach here. - const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => { - // TODO(cais): Add useLearningPhase. - // NOTE(cais): `layer.call` may return a length-1 array of Tensor in - // some cases (e.g., `layer` is a `Sequential` instance), which is - // why `getExactlyOneTensor` is used below. - const output = getExactlyOneTensor(this.layer.call(inputs, kwargs)); - return [output, []]; - }; - const rnnOutputs = - rnn(step, inputs, [], false /* goBackwards */, null /* mask */, - null /* constants */, false /* unroll */, - true /* needPerStepOutputs */); - const y = rnnOutputs[1]; - // TODO(cais): Add activity regularization. - // TODO(cais): Add useLearningPhase. - return y; - }); - } - - // TODO(cais): Implement detailed computeMask() logic. -} -serialization.registerClass(TimeDistributed); - -export function checkBidirectionalMergeMode(value?: string): void { - generic_utils.checkStringTypeUnionValue( - VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); -} - -export declare interface BidirectionalLayerArgs extends WrapperLayerArgs { - /** - * The instance of an `RNN` layer to be wrapped. - */ - layer: RNN; - - /** - * Mode by which outputs of the forward and backward RNNs are - * combined. If `null` or `undefined`, the output will not be - * combined, they will be returned as an `Array`. - * - * If `undefined` (i.e., not provided), defaults to `'concat'`. - */ - mergeMode?: BidirectionalMergeMode; -} - -const DEFAULT_BIDIRECTIONAL_MERGE_MODE: BidirectionalMergeMode = 'concat'; - -export class Bidirectional extends Wrapper { - /** @nocollapse */ - static className = 'Bidirectional'; - mergeMode: BidirectionalMergeMode; - private forwardLayer: RNN; - private backwardLayer: RNN; - private returnSequences: boolean; - private returnState: boolean; - private numConstants?: number; - private _trainable: boolean; - - constructor(args: BidirectionalLayerArgs) { - super(args); - - // Note: When creating `this.forwardLayer`, the original Layer object - // (`config.layer`) ought to be cloned. This is why we call - // `getConfig()` followed by `deserialize()`. Without this cloning, - // the layer names saved during serialization will incorrectly contain - // the 'forward_' prefix. In Python Keras, this is done using - // `copy.copy` (shallow copy), which does not have a simple equivalent - // in JavaScript. JavaScript's `Object.assign()` does not copy - // methods. - const layerConfig = args.layer.getConfig(); - const forwDict: serialization.ConfigDict = {}; - forwDict['className'] = args.layer.getClassName(); - forwDict['config'] = layerConfig; - this.forwardLayer = deserialize(forwDict) as RNN; - layerConfig['goBackwards'] = - layerConfig['goBackwards'] === true ? false : true; - const backDict: serialization.ConfigDict = {}; - backDict['className'] = args.layer.getClassName(); - backDict['config'] = layerConfig; - this.backwardLayer = deserialize(backDict) as RNN; - this.forwardLayer.name = 'forward_' + this.forwardLayer.name; - this.backwardLayer.name = 'backward_' + this.backwardLayer.name; - - this.mergeMode = args.mergeMode === undefined ? - DEFAULT_BIDIRECTIONAL_MERGE_MODE : - args.mergeMode; - checkBidirectionalMergeMode(this.mergeMode); - if (args.weights) { - throw new NotImplementedError( - 'weights support is not implemented for Bidirectional layer yet.'); - } - this._stateful = args.layer.stateful; - this.returnSequences = args.layer.returnSequences; - this.returnState = args.layer.returnState; - this.supportsMasking = true; - this._trainable = true; - this.inputSpec = args.layer.inputSpec; - this.numConstants = null; - } - - get trainable(): boolean { - return this._trainable; - } - - set trainable(value: boolean) { - // Porting Note: the check of `this.layer` here is necessary due to the - // way the `constructor` of this class is written (see Porting Note - // above). - this._trainable = value; - if (this.forwardLayer != null) { - this.forwardLayer.trainable = value; - } - if (this.backwardLayer != null) { - this.backwardLayer.trainable = value; - } - } - - getWeights(): Tensor[] { - return this.forwardLayer.getWeights().concat( - this.backwardLayer.getWeights()); - } - - setWeights(weights: Tensor[]): void { - const numWeights = weights.length; - const numeightsOver2 = Math.floor(numWeights / 2); - this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); - this.backwardLayer.setWeights(weights.slice(numeightsOver2)); - } - - computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { - let layerShapes: Shape|Shape[] = - this.forwardLayer.computeOutputShape(inputShape); - if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { - layerShapes = [layerShapes as Shape]; - } - layerShapes = layerShapes as Shape[]; - - let outputShape: Shape; - let outputShapes: Shape[]; - let stateShape: Shape[]; - if (this.returnState) { - stateShape = layerShapes.slice(1); - outputShape = layerShapes[0]; - } else { - outputShape = layerShapes[0]; - } - outputShape = outputShape; - if (this.mergeMode === 'concat') { - outputShape[outputShape.length - 1] *= 2; - outputShapes = [outputShape]; - } else if (this.mergeMode == null) { - outputShapes = [outputShape, outputShape.slice()]; - } else { - outputShapes = [outputShape]; - } - - if (this.returnState) { - if (this.mergeMode == null) { - return outputShapes.concat(stateShape).concat(stateShape.slice()); - } - return [outputShape].concat(stateShape).concat(stateShape.slice()); - } - return generic_utils.singletonOrArray(outputShapes); - } - - apply( - inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[], - kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] { - let initialState: Tensor[]|SymbolicTensor[] = - kwargs == null ? null : kwargs['initialState']; - let constants: Tensor[]|SymbolicTensor[] = - kwargs == null ? null : kwargs['constants']; - if (kwargs == null) { - kwargs = {}; - } - const standardized = - standardizeArgs(inputs, initialState, constants, this.numConstants); - inputs = standardized.inputs; - initialState = standardized.initialState; - constants = standardized.constants; - - if (Array.isArray(inputs)) { - initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1); - inputs = (inputs as Tensor[] | SymbolicTensor[])[0]; - } - - if ((initialState == null || initialState.length === 0) && - constants == null) { - return super.apply(inputs, kwargs); - } - const additionalInputs: Array = []; - const additionalSpecs: InputSpec[] = []; - if (initialState != null) { - const numStates = initialState.length; - if (numStates % 2 > 0) { - throw new ValueError( - 'When passing `initialState` to a Bidrectional RNN, ' + - 'the state should be an Array containing the states of ' + - 'the underlying RNNs.'); - } - kwargs['initialState'] = initialState; - additionalInputs.push(...initialState); - const stateSpecs = (initialState as Array) - .map(state => new InputSpec({shape: state.shape})); - this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); - this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); - additionalSpecs.push(...stateSpecs); - } - if (constants != null) { - throw new NotImplementedError( - 'Support for constants in Bidirectional layers is not ' + - 'implemented yet.'); - } - - const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (const tensor of additionalInputs) { - if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { - throw new ValueError( - 'The initial state of a Bidirectional layer cannot be ' + - 'specified as a mix of symbolic and non-symbolic tensors'); - } - } - - if (isSymbolicTensor) { - // Compute the full input and specs, including the states. - const fullInput = [inputs].concat(additionalInputs); - const fullInputSpec = this.inputSpec.concat(additionalSpecs); - // Perform the call temporarily and replace inputSpec. - // Note: with initial states symbolic calls and non-symbolic calls to - // this method differ in how the initial states are passed. For - // symbolic calls, the initial states are passed in the first arg, as - // an Array of SymbolicTensors; for non-symbolic calls, they are - // passed in the second arg as a part of the kwargs. Hence the need to - // temporarily modify inputSpec here. - // TODO(cais): Make refactoring so that this hacky code below is no - // longer needed. - const originalInputSpec = this.inputSpec; - this.inputSpec = fullInputSpec; - const output = - super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs); - this.inputSpec = originalInputSpec; - return output; - } else { - return super.apply(inputs, kwargs); - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - return tidy(() => { - const initialState = kwargs['initialState']; - - let y: Tensor|Tensor[]; - let yRev: Tensor|Tensor[]; - if (initialState == null) { - y = this.forwardLayer.call(inputs, kwargs); - yRev = this.backwardLayer.call(inputs, kwargs); - } else { - const forwardState = initialState.slice(0, initialState.length / 2); - const backwardState = initialState.slice(initialState.length / 2); - y = this.forwardLayer.call( - inputs, Object.assign(kwargs, {initialState: forwardState})); - yRev = this.backwardLayer.call( - inputs, Object.assign(kwargs, {initialState: backwardState})); - } - - let states: Tensor[]; - if (this.returnState) { - if (Array.isArray(y)) { - states = y.slice(1).concat((yRev as Tensor[]).slice(1)); - } else { - } - y = (y as Tensor[])[0]; - yRev = (yRev as Tensor[])[0]; - } - - if (this.returnSequences) { - yRev = tfc.reverse(yRev as Tensor, 1); - } - - let output: Tensor|Tensor[]; - if (this.mergeMode === 'concat') { - output = K.concatenate([y as Tensor, yRev as Tensor]); - } else if (this.mergeMode === 'sum') { - output = tfc.add(y as Tensor, yRev as Tensor); - } else if (this.mergeMode === 'ave') { - output = tfc.mul(.5, tfc.add(y as Tensor, yRev as Tensor)); - } else if (this.mergeMode === 'mul') { - output = tfc.mul(y as Tensor, yRev as Tensor); - } else if (this.mergeMode == null) { - output = [y as Tensor, yRev as Tensor]; - } - - // TODO(cais): Properly set learning phase. - if (this.returnState) { - if (this.mergeMode == null) { - return (output as Tensor[]).concat(states); - } - return [output as Tensor].concat(states); - } - return output; - }); - } - - resetStates(states?: Tensor|Tensor[]): void { - this.forwardLayer.resetStates(); - this.backwardLayer.resetStates(); - } - - build(inputShape: Shape|Shape[]): void { - nameScope(this.forwardLayer.name, () => { - this.forwardLayer.build(inputShape); - }); - nameScope(this.backwardLayer.name, () => { - this.backwardLayer.build(inputShape); - }); - this.built = true; - } - - computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor - |Tensor[] { - if (Array.isArray(mask)) { - mask = mask[0]; - } - let outputMask: Tensor|Tensor[]; - if (this.returnSequences) { - if (this.mergeMode == null) { - outputMask = [mask, mask]; - } else { - outputMask = mask; - } - } else { - if (this.mergeMode == null) { - outputMask = [null, null]; - } else { - outputMask = null; - } - } - if (this.returnState) { - const states = this.forwardLayer.states; - const stateMask: Tensor[] = states.map(state => null); - if (Array.isArray(outputMask)) { - return outputMask.concat(stateMask).concat(stateMask); - } else { - return [outputMask].concat(stateMask).concat(stateMask); - } - } else { - return outputMask; - } - } - - get trainableWeights(): LayerVariable[] { - return this.forwardLayer.trainableWeights.concat( - this.backwardLayer.trainableWeights); - } - - get nonTrainableWeights(): LayerVariable[] { - return this.forwardLayer.nonTrainableWeights.concat( - this.backwardLayer.nonTrainableWeights); - } - - // TODO(cais): Implement constraints(). - - setFastWeightInitDuringBuild(value: boolean) { - super.setFastWeightInitDuringBuild(value); - if (this.forwardLayer != null) { - this.forwardLayer.setFastWeightInitDuringBuild(value); - } - if (this.backwardLayer != null) { - this.backwardLayer.setFastWeightInitDuringBuild(value); - } - } - - getConfig(): serialization.ConfigDict { - const config: serialization.ConfigDict = { - 'mergeMode': this.mergeMode, - }; - // TODO(cais): Add logic for `numConstants` once the property is added. - const baseConfig = super.getConfig(); - Object.assign(config, baseConfig); - return config; - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict): T { - const rnnLayer = - deserialize(config['layer'] as serialization.ConfigDict) as RNN; - delete config['layer']; - // TODO(cais): Add logic for `numConstants` once the property is added. - if (config['numConstants'] != null) { - throw new NotImplementedError( - `Deserialization of a Bidirectional layer with numConstants ` + - `present is not supported yet.`); - } - // tslint:disable-next-line:no-any - const newConfig: {[key: string]: any} = config; - newConfig['layer'] = rnnLayer; - return new cls(newConfig); - } -} -serialization.registerClass(Bidirectional); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/logs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/logs.ts deleted file mode 100644 index 2e011bb98..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/logs.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {dispose, Scalar} from '@tensorflow/tfjs-core'; - -/** - * Logs in which values can be either numbers or Tensors (Scalars). - * - * Used internally. - */ -export type UnresolvedLogs = { - [key: string]: number|Scalar; -}; - -/** - * Turn any Scalar values in a Logs object into actual number values. - * - * @param logs The `Logs` object to be resolved in place. - */ -export async function resolveScalarsInLogs(logs: UnresolvedLogs) { - if (logs == null) { - return; - } - const promises: Array> = []; - const keys: string[] = []; - const scalarsToDispose: Scalar[] = []; - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - const valueScalar = value; - promises.push(valueScalar.data()); - keys.push(key); - scalarsToDispose.push(valueScalar); - } - } - if (promises.length > 0) { - const values = await Promise.all(promises); - for (let i = 0; i < values.length; ++i) { - logs[keys[i]] = values[i][0]; - } - // Dispose the original scalar tensors. - dispose(scalarsToDispose); - } -} - -/** - * Dispose all Tensors in an UnresolvedLogs object. - * - * @param logs An `UnresolvedLogs` object potentially containing `tf.Tensor`s in - * places where the values can be `tf.Tensor` or `number`. - */ -export function disposeTensorsInLogs(logs: UnresolvedLogs) { - if (logs == null) { - return; - } - for (const key in logs) { - const value = logs[key]; - if (typeof value !== 'number') { - value.dispose(); - } - } -} - -/** - * Logs in which values can only be numbers. - * - * Used when calling client-provided custom callbacks. - */ -export type Logs = { - [key: string]: number; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/losses.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/losses.ts deleted file mode 100644 index 082ab8881..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/losses.ts +++ /dev/null @@ -1,272 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original Source: losses.py */ -import * as tfc from '@tensorflow/tfjs-core'; -import {Tensor, Tensor1D, tidy, util} from '@tensorflow/tfjs-core'; - -import {epsilon} from './backend/common'; -import * as K from './backend/tfjs_backend'; -import {ValueError} from './errors'; -import {LossOrMetricFn} from './types'; - -/** - * Normalizes a tensor wrt the L2 norm alongside the specified axis. - * @param x - * @param axis Axis along which to perform normalization. - */ -export function l2Normalize(x: Tensor, axis?: number): Tensor { - return tidy(() => { - if (x.dtype !== 'float32') { - x = x.asType('float32'); - } - const squareSum = tfc.sum(K.square(x), axis, true); - const epsilonTensor = tfc.fill(squareSum.shape, epsilon()); - const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); - return tfc.div(x, norm); - }); -} - -export function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1)); -} - -export function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1)); -} - -export function meanAbsolutePercentageError( - yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const diff = tfc.sub(yTrue, yPred); - const clippedTrue = - tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); - const absResult = tfc.abs(tfc.div(diff, clippedTrue)); - return tfc.mul(100, tfc.mean(absResult, -1)); - }); -} - -export function meanSquaredLogarithmicError( - yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); - const firstLog = tfc.log(tfc.add(1, clippedPred)); - - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); - const secondLog = tfc.log(tfc.add(1, clippedTrue)); - - return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1); - }); -} - -export function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(K.square(maxResult), -1); - }); -} - -export function hinge(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const maxResult = tfc.maximum(0, tfc.sub(1, tfc.mul(yTrue, yPred))); - return tfc.mean(maxResult, -1); - }); -} - -export function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const pos = tfc.sum(tfc.mul(yTrue, yPred), -1); - const neg = tfc.max(tfc.mul(tfc.sub(1, yTrue), yPred), -1); - return tfc.maximum(0, tfc.add(1, tfc.sub(neg, pos))); - }); -} - -/** - * Logarithm of the hyperbolic cosine of the prediction error. - * - * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and - * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly - * like the mean squared error, but will not be so strongly affected by the - * occasional wildly incorrect prediction. - */ -export function logcosh(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const log2 = Math.log(2); - const predictionDiff = tfc.sub(yPred, yTrue); - const logcoshResult = tfc.sub( - tfc.add(predictionDiff, tfc.softplus(tfc.mul(-2, predictionDiff))), - log2); - return tfc.mean(logcoshResult, -1); - }); -} - -export function categoricalCrossentropy( - target: Tensor, output: Tensor, fromLogits = false): Tensor { - return tidy(() => { - if (fromLogits) { - output = tfc.softmax(output); - } else { - // scale preds so that the class probabilities of each sample sum to 1. - const outputSum = tfc.sum(output, output.shape.length - 1, true); - output = tfc.div(output, outputSum); - } - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - return tfc.neg(tfc.sum( - tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); - }); -} - -/** - * Categorical crossentropy with integer targets. - * - * @param target An integer tensor. - * @param output A tensor resulting from a softmax (unless `fromLogits` is - * `true`, in which case `output` is expected to be the logits). - * @param fromLogits Boolean, whether `output` is the result of a softmax, or is - * a tensor of logits. - */ -export function sparseCategoricalCrossentropy( - target: Tensor, output: Tensor, fromLogits = false): Tensor { - return tidy(() => { - const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D; - output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); - const outputShape = output.shape; - const oneHotTarget = - tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) - .reshape(outputShape); - return categoricalCrossentropy(oneHotTarget, output, fromLogits); - }); -} - -/** - * From TensorFlow's implementation in nn_impl.py: - * - * For brevity, let `x = logits`, `z = labels`. The logistic loss is - * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x)) - * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x))) - * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x)) - * = (1 - z) * x + log(1 + exp(-x)) - * = x - x * z + log(1 + exp(-x)) - * For x < 0, to avoid overflow in exp(-x), we reformulate the above - * x - x * z + log(1 + exp(-x)) - * = log(exp(x)) - x * z + log(1 + exp(-x)) - * = - x * z + log(1 + exp(x)) - * Hence, to ensure stability and avoid overflow, the implementation uses this - * equivalent formulation - * max(x, 0) - x * z + log(1 + exp(-abs(x))) - * - * @param labels The labels. - * @param logits The logits. - */ -export function sigmoidCrossEntropyWithLogits( - labels: Tensor, logits: Tensor): Tensor { - if (!util.arraysEqual(labels.shape, logits.shape)) { - throw new ValueError( - `logits and labels must have the same shape, but got shapes ` + - `${JSON.stringify(labels.shape)} and ${JSON.stringify(logits.shape)}`); - } - return tidy(() => { - // The logistic loss formula from above is - // x - x * z + log(1 + exp(-x)) - // For x < 0, a more numerically stable formula is - // -x * z + log(1 + exp(x)) - // Note that these two expressions can be combined into the following: - // max(x, 0) - x * z + log(1 + exp(-abs(x))) - const reluLogits = logits.relu(); - const negAbsLogits = logits.abs().neg(); - return reluLogits.sub(logits.mul(labels)).add(negAbsLogits.exp().log1p()); - }); -} - -export function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - let y: Tensor; - y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); - y = tfc.log(tfc.div(y, tfc.sub(1, y))); - return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); - }); -} - -export function kullbackLeiblerDivergence( - yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); - const clippedPred = tfc.clipByValue(yPred, epsilon(), 1); - return tfc.sum( - tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); - }); -} - -export function poisson(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const logPred = tfc.log(tfc.add(epsilon(), yPred)); - return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); - }); -} - -export function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const trueNormalized = l2Normalize(yTrue, -1); - const predNormalized = l2Normalize(yPred, -1); - const trueXPred = tfc.mul(trueNormalized, predNormalized); - return tfc.neg(tfc.sum(trueXPred, -1)); - }); -} - -export const mse = meanSquaredError; -export const MSE = meanSquaredError; -export const mae = meanAbsoluteError; -export const MAE = meanAbsoluteError; -export const mape = meanAbsolutePercentageError; -export const MAPE = meanAbsolutePercentageError; -export const msle = meanSquaredLogarithmicError; -export const MSLE = meanSquaredLogarithmicError; -export const kld = kullbackLeiblerDivergence; -export const KLD = kullbackLeiblerDivergence; -export const cosine = cosineProximity; - -// TODO(michaelterry): Add deserialize() function. - -export const lossesMap: {[functionName: string]: LossOrMetricFn} = { - meanSquaredError, - meanAbsoluteError, - meanAbsolutePercentageError, - meanSquaredLogarithmicError, - squaredHinge, - hinge, - categoricalHinge, - logcosh, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - binaryCrossentropy, - kullbackLeiblerDivergence, - poisson, - cosineProximity -}; - -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -export function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn { - if (typeof identifierOrFn === 'string') { - if (identifierOrFn in lossesMap) { - return lossesMap[identifierOrFn]; - } - let errMsg = `Unknown loss ${identifierOrFn}`; - if (identifierOrFn.toLowerCase().includes('softmaxcrossentropy')) { - errMsg = `Unknown loss ${identifierOrFn}. ` + - 'Use "categoricalCrossentropy" as the string name for ' + - 'tf.losses.softmaxCrossEntropy'; - } - throw new ValueError(errMsg); - } else { - return identifierOrFn; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/metrics.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/metrics.ts deleted file mode 100644 index 48fb2b914..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/metrics.ts +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Built-in metrics. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {Tensor, tidy} from '@tensorflow/tfjs-core'; - -import * as K from './backend/tfjs_backend'; -import {NotImplementedError, ValueError} from './errors'; -import {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses'; -import {binaryCrossentropy as lossBinaryCrossentropy} from './losses'; -import {lossesMap} from './losses'; -import {LossOrMetricFn} from './types'; -import * as util from './utils/generic_utils'; - -export function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const threshold = tfc.mul(.5, tfc.onesLike(yPred)); - const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype); - return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); - }); -} - -export function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy( - () => K.cast( - tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32')); -} - -function truePositives(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(1)).sum().cast('float32'); - }); -} - -function falseNegatives(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(1), yPred.equal(0)).sum().cast('float32'); - }); -} - -function falsePositives(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - return tfc.logicalAnd(yTrue.equal(0), yPred.equal(1)).sum().cast('float32'); - }); -} - -export function precision(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fp = falsePositives(yTrue, yPred); - - const denominator = tp.add(fp); - - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} - -export function recall(yTrue: Tensor, yPred: Tensor): Tensor { - return tidy(() => { - const tp = truePositives(yTrue, yPred); - const fn = falseNegatives(yTrue, yPred); - - const denominator = tp.add(fn); - - return tfc.where(tfc.greater(denominator, 0), tp.div(denominator), 0) - .cast('float32'); - }); -} - -export function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor { - return lossBinaryCrossentropy(yTrue, yPred); -} - -export function sparseCategoricalAccuracy( - yTrue: Tensor, yPred: Tensor): Tensor { - if (yTrue.rank === yPred.rank) { - yTrue = yTrue.squeeze([yTrue.rank - 1]); - } - yPred = yPred.argMax(-1); - if (yPred.dtype !== yTrue.dtype) { - yPred = yPred.asType(yTrue.dtype); - } - return tfc.equal(yTrue, yPred).asType('float32'); -} - -export function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor { - throw new NotImplementedError(); -} - -export function sparseTopKCategoricalAccuracy( - yTrue: Tensor, yPred: Tensor): Tensor { - throw new NotImplementedError(); -} - -// Aliases. -export const mse = meanSquaredError; -export const MSE = meanSquaredError; -export const mae = meanAbsoluteError; -export const MAE = meanAbsoluteError; -export const mape = meanAbsolutePercentageError; -export const MAPE = meanAbsolutePercentageError; -export const categoricalCrossentropy = categoricalCrossentropyLoss; -export const cosine = cosineProximity; -export const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss; - -// TODO(cais, nielsene): Add serialize(). - -export const metricsMap: {[functionName: string]: LossOrMetricFn} = { - binaryAccuracy, - categoricalAccuracy, - precision, - categoricalCrossentropy, - sparseCategoricalCrossentropy, - mse, - MSE, - mae, - MAE, - mape, - MAPE, - cosine -}; - -export function get(identifier: string|LossOrMetricFn): LossOrMetricFn { - if (typeof identifier === 'string' && identifier in metricsMap) { - return metricsMap[identifier]; - } else if (typeof identifier !== 'string' && identifier != null) { - return identifier; - } else { - throw new ValueError(`Unknown metric ${identifier}`); - } -} - -/** - * Get the shortcut function name. - * - * If the fn name is a string, - * directly return the string name. - * If the function is included in metricsMap or lossesMap, - * return key of the map. - * - If the function relative to multiple keys, - * return the first found key as the function name. - * - If the function exists in both lossesMap and metricsMap, - * search lossesMap first. - * If the function is not included in metricsMap or lossesMap, - * return the function name. - * - * @param fn loss function, metric function, or short cut name. - * @returns Loss or Metric name in string. - */ -export function getLossOrMetricName(fn: string|LossOrMetricFn): string { - util.assert(fn !== null, `Unknown LossOrMetricFn ${fn}`); - if (typeof fn === 'string') { - return fn; - } else { - let fnName; - for (const key of Object.keys(lossesMap)) { - if (lossesMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - for (const key of Object.keys(metricsMap)) { - if (metricsMap[key] === fn) { - fnName = key; - break; - } - } - if (fnName !== undefined) { - return fnName; - } - return (fn as Function).name; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/models.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/models.ts deleted file mode 100644 index d32844c90..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/models.ts +++ /dev/null @@ -1,1100 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source keras/models.py */ - -import {dispose, io, NamedTensorMap, Optimizer, Scalar, serialization, Tensor, util} from '@tensorflow/tfjs-core'; - -import {getUid} from './backend/state'; -import {History} from './base_callbacks'; -import {Dataset} from './engine/dataset_stub'; -import {Input} from './engine/input_layer'; -import {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology'; -import {LayersModel, ModelCompileArgs, ModelEvaluateArgs} from './engine/training'; -import {ModelEvaluateDatasetArgs, ModelFitDatasetArgs} from './engine/training_dataset'; -import {ModelFitArgs} from './engine/training_tensors'; -import {NotImplementedError, RuntimeError, ValueError} from './errors'; -import {Shape} from './keras_format/common'; -import {TrainingConfig} from './keras_format/training_config'; -import {PyJsonDict} from './keras_format/types'; -import {deserialize} from './layers/serialization'; -import {Kwargs, NamedTensor} from './types'; -import * as generic_utils from './utils/generic_utils'; -import {convertPythonicToTs} from './utils/serialization_utils'; -import {getExactlyOneShape} from './utils/types_utils'; - -/** - * Parses a JSON model configuration file and returns a model instance. - * - * ```js - * // This example shows how to serialize a model using `toJSON()` and - * // deserialize it as another model using `tf.models.modelFromJSON()`. - * // Note: this example serializes and deserializes only the topology - * // of the model; the weights of the loaded model will be different - * // from those of the the original model, due to random weight - * // initialization. - * // To load the topology and weights of a model, use `tf.loadLayersModel()`. - * const model1 = tf.sequential(); - * model1.add(tf.layers.repeatVector({inputShape: [2], n: 4})); - * // Serialize `model1` as a JSON object. - * const model1JSON = model1.toJSON(null, false); - * model1.summary(); - * - * const model2 = await tf.models.modelFromJSON(model1JSON); - * model2.summary(); - * ``` - * - * @param modelAndWeightsConfig JSON object or string encoding a model and - * weights configuration. It can also be only the topology JSON of the - * model, in which case the weights will not be loaded. - * @param custom_objects Optional dictionary mapping names - * (strings) to custom classes or functions to be - * considered during deserialization. - * @returns A TensorFlow.js Layers `tf.LayersModel` instance (uncompiled). - */ -export async function modelFromJSON( - modelAndWeightsConfig: ModelAndWeightsConfig|PyJsonDict, - customObjects?: serialization.ConfigDict): Promise { - if (!('modelTopology' in modelAndWeightsConfig)) { - modelAndWeightsConfig = {modelTopology: modelAndWeightsConfig}; - } - modelAndWeightsConfig = modelAndWeightsConfig as ModelAndWeightsConfig; - - let modelTopology = modelAndWeightsConfig.modelTopology; - if (modelTopology['model_config'] != null) { - // If the model-topology JSON contains a 'model_config' field, then it is - // a full model JSON (e.g., from `keras.Model.save()`), which contains - // not only the model's architecture in its 'model_config' field, but - // additional information such as the model's optimizer. We use only the - // 'model_config' field currently. - modelTopology = modelTopology['model_config'] as PyJsonDict; - } - const tsConfig = - convertPythonicToTs(modelTopology) as serialization.ConfigDict; - const model = deserialize(tsConfig, customObjects) as LayersModel; - - if (modelAndWeightsConfig.weightsManifest != null) { - // Load the weight values keyed by the original tensor names in the model - // file that was loaded. These should match the keys of the weight - // manifest. - const weightValues = await io.loadWeights( - modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, - model.weights.map(weight => weight.originalName)); - - // Map the weights to the unique tensor names generated during model loading - const uniqueWeightValues: NamedTensorMap = {}; - for (const weight of model.weights) { - uniqueWeightValues[weight.originalName] = - weightValues[weight.originalName]; - } - - model.loadWeights(uniqueWeightValues); - // Dispose temporary weight values. - dispose(weightValues); - } - return model; -} - -/** - * Options for loading a saved mode in TensorFlow.js format. - */ -export interface ModelAndWeightsConfig { - /** - * A JSON object or JSON string containing the model config. - * - * This can be either of the following two formats: - * - A model archiecture-only config, i.e., a format consistent with the - * return value of`keras.Model.to_json()`. - * - A full model config, containing not only model architecture, but also - * training options and state, i.e., a format consistent with the return - * value of `keras.models.save_model()`. - */ - modelTopology: PyJsonDict; - - /** - * A weights manifest in TensorFlow.js format. - */ - weightsManifest?: io.WeightsManifestConfig; - - /** - * Path to prepend to the paths in `weightManifest` before fetching. - * - * The path may optionally end in a slash ('/'). - */ - pathPrefix?: string; -} - -// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400 -export interface ModelPredictArgs { - /** - * Optional. Batch size (Integer). If unspecified, it will default to 32. - */ - batchSize?: number; - - /** - * Optional. Verbosity mode. Defaults to false. - */ - verbose?: boolean; -} - -/** - * Load a model, including its topology and optionally weights. See the - * Tutorial named "How to import a Keras Model" for usage examples. - * - * Example 1: Save `model`'s topology and weights to browser [local - * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('localstorage://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('localstorage://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 2. Saving `model`'s topology and weights to browser - * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API); - * then load it back. - * - * ```js - * const model = tf.sequential( - * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]}); - * console.log('Prediction from original model:'); - * model.predict(tf.ones([1, 3])).print(); - * - * const saveResults = await model.save('indexeddb://my-model-1'); - * - * const loadedModel = await tf.loadLayersModel('indexeddb://my-model-1'); - * console.log('Prediction from loaded model:'); - * loadedModel.predict(tf.ones([1, 3])).print(); - * ``` - * - * Example 3. Load a model from user-selected files from HTML - * [file input - * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file). - * - * ```js - * // Note: this code snippet will not work without the HTML elements in the - * // page - * const jsonUpload = document.getElementById('json-upload'); - * const weightsUpload = document.getElementById('weights-upload'); - * - * const model = await tf.loadLayersModel( - * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]])); - * ``` - * - * Example 4. Load a model from an HTTP server. - * - * ```js - * const model = await - * tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json'); - * model.summary(); - * ``` - * - * @param pathOrIOHandler Can be either of the two formats - * 1. A string path to the `ModelAndWeightsConfig` JSON describing - * the model in the canonical TensorFlow.js format. This path will be - * interpreted as a relative HTTP path, to which `fetch` will be used to - * request the model topology and weight manifest JSON. - * The content of the JSON file is assumed to be a JSON object with the - * following fields and values: - * - 'modelTopology': A JSON object that can be either of: - * 1. a model architecture JSON consistent with the format of the return - * value of `keras.Model.to_json()` - * 2. a full model JSON in the format of `keras.models.save_model()`. - * - 'weightsManifest': A TensorFlow.js weights manifest. - * See the Python converter function `save_model()` for more details. - * It is also assumed that model weights can be accessed from relative - * paths described by the `paths` fields in weights manifest. - * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load` - * method. - * @param options Optional configuration arguments for the model loading, - * including: - * - `strict`: Require that the provided weights exactly match those required - * by the layers. Default true. Passing false means that both extra - * weights and missing weights will be silently ignored. - * - `onProgress`: A progress callback of the form: - * `(fraction: number) => void`. This callback can be used to monitor the - * model-loading process. - * @returns A `Promise` of `tf.LayersModel`, with the topology and weights - * loaded. - */ -export async function loadLayersModelInternal( - pathOrIOHandler: string|io.IOHandler, - options?: io.LoadOptions): Promise { - if (options == null) { - options = {}; - } - if (typeof pathOrIOHandler === 'string') { - const handlers = io.getLoadHandlers(pathOrIOHandler, options); - if (handlers.length === 0) { - // For backward compatibility: if no load handler can be found, - // assume it is a relative http path. - // TODO(cais): Reformat the args into a single `LoadOptions` once the core - // is refactored. - handlers.push(io.browserHTTPRequest(pathOrIOHandler, options)); - } else if (handlers.length > 1) { - throw new ValueError( - `Found more than one (${handlers.length}) load handlers for ` + - `URL '${pathOrIOHandler}'`); - } - pathOrIOHandler = handlers[0]; - } - return loadLayersModelFromIOHandler(pathOrIOHandler, undefined, options); -} - -/** - * Load a model and optionally its weights, using an IOHandler object. - * - * @param handler The instance of `IOHandler` to be used during the model - * loading. - * @param customObjects Any optional custom objects to be used during model - * loading. - * @param strict Whether the weight loading will be done in strict mode. - * Default: `true`. - */ -export async function loadLayersModelFromIOHandler( - handler: io.IOHandler, customObjects?: serialization.ConfigDict, - options?: io.LoadOptions): Promise { - if (options == null) { - options = {}; - } - if (handler.load == null) { - throw new ValueError( - 'Cannot proceed with model loading because the IOHandler provided ' + - 'does not have the `load` method implemented.'); - } - const artifacts = await handler.load(); - let modelTopology = artifacts.modelTopology as PyJsonDict; - if (modelTopology['model_config'] != null) { - modelTopology = modelTopology['model_config'] as PyJsonDict; - } - - const strict = options.strict == null ? true : options.strict; - // If weights are provided and the weight-loading mode is strict, use - // fast weight initialization. This skips costly initializers such as - // 'orthogonal' and saves unnecessary computation in cases where - // the initialized weight values will immediately be overwritten by - // loaded weight values. - const fastWeightInit = - artifacts.weightData != null && artifacts.weightSpecs != null && strict; - const model = - deserialize( - convertPythonicToTs(modelTopology) as serialization.ConfigDict, - customObjects, fastWeightInit) as LayersModel; - - const trainingConfig = artifacts.trainingConfig as TrainingConfig; - if (trainingConfig != null) { - model.loadTrainingConfig(trainingConfig); - } - if (artifacts.userDefinedMetadata != null) { - model.setUserDefinedMetadata(artifacts.userDefinedMetadata); - } - - // If weightData is present, load the weights into the model. - if (artifacts.weightData != null) { - // Loading weights requires weightSpecs. - if (artifacts.weightSpecs == null) { - throw new ValueError( - 'LayersModel artifacts contains weight data, but not weight specs. ' + - 'Therefore loading of weights cannot proceed.'); - } - - const {modelWeights, optimizerWeights} = decodeModelAndOptimizerWeights( - artifacts.weightData, artifacts.weightSpecs); - model.loadWeights(modelWeights, strict); - - if (model.optimizer != null && optimizerWeights.length > 0) { - await model.optimizer.setWeights(optimizerWeights); - } - - // Dispose temporary weight values. - dispose(modelWeights); - dispose(optimizerWeights.map(w => w.tensor)); - } - return model; -} - -function decodeModelAndOptimizerWeights( - buffer: ArrayBuffer, specs: io.WeightsManifestEntry[]): - {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} { - const name2Tensor = io.decodeWeights(buffer, specs); - const modelWeights: NamedTensorMap = {}; - const optimizerWeights: NamedTensor[] = []; - specs.forEach(spec => { - if (spec.group === 'optimizer') { - optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]}); - } else { - modelWeights[spec.name] = name2Tensor[spec.name]; - } - }); - return {modelWeights, optimizerWeights}; -} - -/** - * Configuration for a Sequential model. - */ -export interface SequentialArgs { - /** Stack of layers for the model. */ - layers?: Layer[]; - - /** The name of this model. */ - name?: string; -} - -/** - * A model with a stack of layers, feeding linearly from one to the next. - * - * `tf.sequential` is a factory function that creates an instance of - * `tf.Sequential`. - * - * ```js - * // Define a model for linear regression. - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [1]})); - * - * // Prepare the model for training: Specify the loss and the optimizer. - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * - * // Generate some synthetic data for training. - * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); - * - * // Train the model using the data then do inference on a data point the - * // model hasn't seen: - * await model.fit(xs, ys); - * model.predict(tf.tensor2d([5], [1, 1])).print(); - * ``` - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ -export class Sequential extends LayersModel { - /** @nocollapse */ - static className = 'Sequential'; - private model: LayersModel; - constructor(args?: SequentialArgs) { - super({inputs: [], outputs: []}); - args = args || {}; - - this.trainable = true; - this.built = false; - - // Set model name. - this.name = (args.name != null) ? args.name : getUid('sequential_'); - - // Add to the model any layers passed to the constructor. - if (args.layers != null) { - for (const layer of args.layers) { - this.add(layer); - } - } - } - - // Helper function to Sequential.add Throws if the new output shape will be - // invalid. - private checkShape(layer: Layer) { - const shape = layer.inboundNodes[0].outputTensors[0].shape; - if (shape.some(x => x < 0)) { - throw new ValueError( - 'Negative dimension size caused by adding layer ' + - `${layer.name} with input shape [` + - `${layer.inboundNodes[0].inputTensors[0].shape}]`); - } - } - - /** - * Adds a layer instance on top of the layer stack. - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 8, inputShape: [1]})); - * model.add(tf.layers.dense({units: 4, activation: 'relu6'})); - * model.add(tf.layers.dense({units: 1, activation: 'relu6'})); - * // Note that the untrained model is random at this point. - * model.predict(tf.randomNormal([10, 1])).print(); - * ``` - * @param layer Layer instance. - * - * @exception ValueError In case the `layer` argument does not know its - * input shape. - * @exception ValueError In case the `layer` argument has multiple output - * tensors, or is already connected somewhere else (forbidden in - * `Sequential` models). - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - add(layer: Layer): void { - const isLayerModelInstance = - layer instanceof Sequential || layer instanceof LayersModel; - let modelLayer: LayersModel; - if (isLayerModelInstance) { - modelLayer = layer as LayersModel; - if (modelLayer.outputs.length !== 1) { - throw new ValueError( - 'All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - if (modelLayer.inputs.length !== 1) { - throw new ValueError( - 'All layers in a Sequential model ' + - 'should have a single input tensor. ' + - 'For multi-input layers, ' + - 'use the functional API.'); - } - } - - if (this.outputs.length === 0) { - // first layer in model: check that it is an input layer - if (layer.inboundNodes.length === 0) { - // create an input layer - if (layer.batchInputShape == null) { - throw new ValueError( - 'The first layer in a Sequential model must ' + - 'get an `inputShape` or `batchInputShape` argument.'); - } - // Instantiate the input layer. - const x = Input({ - batchShape: layer.batchInputShape, - dtype: layer.dtype, - name: layer.name + '_input' - }); - // This will build the current layer and create the node connecting - // the current layer to the input layer we just created. - layer.apply(x); - } - - if (isLayerModelInstance) { - this.outputs = modelLayer.outputs; - this.inputs = modelLayer.inputs; - } else { - if (layer.inboundNodes.length !== 1) { - throw new ValueError( - 'A layer added to a Sequential model must not already be ' + - `connected somewhere else. LayersModel received layer ${ - layer.name} ` + - `which has ${layer.inboundNodes.length} pre-existing inbound ` + - 'connections.'); - } - - if (layer.inboundNodes[0].outputTensors.length !== 1) { - throw new ValueError( - 'All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [layer.inboundNodes[0].outputTensors[0]]; - this.inputs = getSourceInputs(this.outputs[0]); - } - - this.inboundNodes = []; - // We create an input node, which we will keep updated - // as we add more layers. - // (This call has side effects.) - // tslint:disable-next-line:no-unused-expression - new Node({ - outboundLayer: this, - inboundLayers: [], - nodeIndices: [], - tensorIndices: [], - inputTensors: this.inputs, - outputTensors: this.outputs, - // no model-level masking for now - inputMasks: generic_utils.pyListRepeat(null, this.inputs.length), - outputMasks: [null], - inputShapes: this.inputs.map(x => x.shape), - outputShapes: this.outputs[0].shape - }); - } else { - const outputTensor = layer.apply(this.outputs[0]); - if (Array.isArray(outputTensor)) { - throw new TypeError( - 'All layers in a Sequential model ' + - 'should have a single output tensor. ' + - 'For multi-output layers, ' + - 'use the functional API.'); - } - this.checkShape(layer); - this.outputs = [outputTensor as SymbolicTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - - this.layers.push(layer); - this.built = false; - } - - /** - * Removes the last layer in the model. - * - * @exception TypeError if there are no layers in the model. - */ - pop(): void { - if (this.layers.length === 0) { - throw new TypeError('There are no layers in the model.'); - } - - this.layers.pop(); - if (this.layers.length === 0) { - this.outputs = []; - this.inboundNodes = []; - this.outboundNodes = []; - } else { - const lastLayerIndex = this.layers.length - 1; - this.layers[lastLayerIndex].outboundNodes = []; - this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor]; - // update self.inbound_nodes - this.inboundNodes[0].outputTensors = this.outputs; - this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; - } - } - - call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] { - if (this.model == null) { - this.build(); - } - return this.model.call(inputs, kwargs); - } - - build(inputShape?: Shape|Shape[]) { - // Call `getExactlyOneShape` without using its return value, - // to verify that exactly one input shape is provided. - getExactlyOneShape(inputShape); - - if (this.inputs.length === 0 || this.outputs.length === 0) { - throw new TypeError( - 'Sequential model cannot be built: model is empty.' + - ' Add some layers first.'); - } - // actually create the model - this.model = new LayersModel({ - inputs: this.inputs, - outputs: this.outputs[0], - name: this.name + '_model' - }); - this.model.trainable = this.trainable; - - // mirror model attributes - this.supportsMasking = this.model.supportsMasking; - // TODO(michaelterry): Add caches - this.inputLayers = this.model.inputLayers; - this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; - this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; - this.outputLayers = this.model.outputLayers; - this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; - this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; - this.nodesByDepth = this.model.nodesByDepth; - this.containerNodes = this.model.containerNodes; - this.outputNames = this.model.outputNames; - this.inputNames = this.model.inputNames; - // TODO(michaelterry): Add feedInputNames, feedInputs, if needed. - // TODO(michaelterry): Add callbackModel if needed. - this.built = true; - } - - countParams(): number { - if (!this.built) { - this.build(); - } - return super.countParams(); - } - - /** - * Print a text summary of the Sequential model's layers. - * - * The summary includes - * - Name and type of all layers that comprise the model. - * - Output shape(s) of the layers - * - Number of weight parameters of each layer - * - The total number of trainable and non-trainable parameters of the - * model. - * - * ```js - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'})); - * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'})); - * - * model.summary(); - * ``` - * - * @param lineLength Custom line length, in number of characters. - * @param positions Custom widths of each of the columns, as either - * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number - * of characters (e.g., `[30, 50, 65]`). Each number corresponds to - * right-most (i.e., ending) position of a column. - * @param printFn Custom print function. Can be used to replace the default - * `console.log`. For example, you can use `x => {}` to mute the printed - * messages in the console. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - summary( - lineLength?: number, positions?: number[], - printFn: - // tslint:disable-next-line:no-any - (message?: any, ...optionalParams: any[]) => void = console.log) { - if (!this.built) { - this.build(); - } - super.summary(lineLength, positions, printFn); - } - - /** - * Sets the weights of the model. - * - * @param weights Should be a list of Tensors with shapes and types matching - * the output of `model.getWeights()`. - */ - setWeights(weights: Tensor[]): void { - if (this.model == null) { - this.build(); - } - this.model.setWeights(weights); - } - - /** - * Returns the loss value & metrics values for the model in test mode. - * - * Loss and metrics are specified during `compile()`, which needs to happen - * before calls to `evaluate()`. - * - * Computation is done in batches. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * }); - * result.print(); - * ``` - * - * @param x `tf.Tensor` of test data, or an `Array` of `tf.Tensor`s if the - * model has multiple inputs. - * @param y `tf.Tensor` of target data, or an `Array` of `tf.Tensor`s if the - * model has multiple outputs. - * @param args A `ModelEvaluateConfig`, containing optional fields. - * - * @return `Scalar` test loss (if the model has a single output and no - * metrics) or `Array` of `Scalar`s (if the model has multiple outputs - * and/or metrics). The attribute `model.metricsNames` - * will give you the display labels for the scalar outputs. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - evaluate( - x: Tensor|Tensor[], y: Tensor|Tensor[], - args: ModelEvaluateArgs = {}): Scalar|Scalar[] { - if (!this.built) { - throw new RuntimeError( - 'The model needs to be compiled before being used.'); - } - return this.model.evaluate(x, y, args); - } - - // TODO(cais): Add code snippet below once real dataset objects are - // available. - /** - * Evaluate model using a dataset object. - * - * Note: Unlike `evaluate()`, this method is asynchronous (`async`); - * - * @param dataset A dataset object. Its `iterator()` method is expected - * to generate a dataset iterator object, the `next()` method of which - * is expected to produce data batches for evaluation. The return value - * of the `next()` call ought to contain a boolean `done` field and a - * `value` field. The `value` field is expected to be an array of two - * `tf.Tensor`s or an array of two nested `tf.Tensor` structures. The former - * case is for models with exactly one input and one output (e.g.. - * a sequential model). The latter case is for models with multiple - * inputs and/or multiple outputs. Of the two items in the array, the - * first is the input feature(s) and the second is the output target(s). - * @param args A configuration object for the dataset-based evaluation. - * @returns Loss and metric values as an Array of `Scalar` objects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async evaluateDataset(dataset: Dataset<{}>, args: ModelEvaluateDatasetArgs): - Promise { - if (!this.built) { - throw new RuntimeError( - 'The model needs to be compiled before being used.'); - } - return this.model.evaluateDataset(dataset, args); - } - - /** - * Generates output predictions for the input samples. - * - * Computation is done in batches. - * - * Note: the "step" mode of predict() is currently not supported. - * This is because the TensorFow.js core backend is imperative only. - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.predict(tf.ones([2, 10])).print(); - * ``` - * - * @param x The input data, as a Tensor, or an `Array` of `tf.Tensor`s if - * the model has multiple inputs. - * @param conifg A `ModelPredictConfig` object containing optional fields. - * - * @return `tf.Tensor`(s) of predictions. - * - * @exception ValueError In case of mismatch between the provided input data - * and the model's expectations, or in case a stateful model receives a - * number of samples that is not a multiple of the batch size. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}): Tensor|Tensor[] { - if (this.model == null) { - this.build(); - } - return this.model.predict(x, args); - } - - /** - * Returns predictions for a single batch of samples. - * - * @param x: Input samples, as a Tensor, or list of Tensors (if the model - * has multiple inputs). - * @return Tensor(s) of predictions - */ - predictOnBatch(x: Tensor): Tensor|Tensor[] { - if (this.model == null) { - this.build(); - } - return this.model.predictOnBatch(x); - } - - /** - * See `LayersModel.compile`. - * - * @param args - */ - compile(args: ModelCompileArgs): void { - this.build(); - this.model.compile(args); - this.optimizer_ = this.model.optimizer; - // tslint:disable-next-line:no-any - this.isOptimizerOwned = (this.model as any).isOptimizerOwned; - this.loss = this.model.loss; - this.metrics = this.model.metrics; - // TODO(cais): Add this.lossWeights, this.sampleWeightMode, - // this.weightedMetrics, this.targets. - this.metricsTensors = this.model.metricsTensors; - this.metricsNames = this.model.metricsNames; - // TODO(cais): Add sampleWeights. - } - - get optimizer(): Optimizer { - return this.model == null ? undefined : this.model.optimizer; - } - - set optimizer(optimizer: Optimizer) { - this.model.optimizer = optimizer; - } - - /** - * Trains the model for a fixed number of epochs (iterations on a dataset). - * - * ```js - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [10]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), { - * batchSize: 4, - * epochs: 3 - * }); - * console.log(history.history.loss[0]); - * ``` - * - * @param x `tf.Tensor` of training data, or an array of `tf.Tensor`s if the - * model has multiple inputs. If all inputs in the model are named, you can - * also pass a dictionary mapping input names to `tf.Tensor`s. - * @param y `tf.Tensor` of target (label) data, or an array of `tf.Tensor`s if - * the model has multiple outputs. If all outputs in the model are named, you - * can also pass a dictionary mapping output names to `tf.Tensor`s. - * @param args A `ModelFitConfig`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @exception ValueError In case of mismatch between the provided input data - * and what the model expects. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async fit( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]|{[inputName: string]: Tensor}, - args: ModelFitArgs = {}): Promise { - if (!this.built) { - throw new RuntimeError( - 'The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fit(x, y, args); - } - - /** - * Trains the model using a dataset object. - * - * ```js - * const xArray = [ - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * [1, 1, 1, 1, 1, 1, 1, 1, 1], - * ]; - * const yArray = [1, 1, 1, 1]; - * // Create a dataset from the JavaScript array. - * const xDataset = tf.data.array(xArray); - * const yDataset = tf.data.array(yArray); - * // Zip combines the `x` and `y` Datasets into a single Dataset, the - * // iterator of which will return an object containing of two tensors, - * // corresponding to `x` and `y`. The call to `batch(4)` will bundle - * // four such samples into a single object, with the same keys now pointing - * // to tensors that hold 4 examples, organized along the batch dimension. - * // The call to `shuffle(4)` causes each iteration through the dataset to - * // happen in a different order. The size of the shuffle window is 4. - * const xyDataset = tf.data.zip({xs: xDataset, ys: yDataset}) - * .batch(4) - * .shuffle(4); - * const model = tf.sequential({ - * layers: [tf.layers.dense({units: 1, inputShape: [9]})] - * }); - * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'}); - * const history = await model.fitDataset(xyDataset, { - * epochs: 4, - * callbacks: {onEpochEnd: (epoch, logs) => console.log(logs.loss)} - * }); - * ``` - * - * @param dataset A dataset object. Its `iterator()` method is expected to - * generate a dataset iterator object, the `next()` method of which is - * expected to produce data batches for evaluation. The return value of the - * `next()` call ought to contain a boolean `done` field and a `value` - * field. - * - * The `value` field is expected to be an object of with fields - * `xs` and `ys`, which point to the feature tensor and the target tensor, - * respectively. This case is for models with exactly one input and one - * output (e.g.. a sequential model). For example: - * ```js - * {value: {xs: xsTensor, ys: ysTensor}, done: false} - * ``` - * - * If the model has multiple inputs, the `xs` field of `value` should - * be an object mapping input names to their respective feature tensors. - * For example: - * ```js - * { - * value: { - * xs: { - * input_1: xsTensor1, - * input_2: xsTensor2 - * }, - * ys: ysTensor - * }, - * done: false - * } - * ``` - * If the model has multiple outputs, the `ys` field of `value` should - * be an object mapping output names to their respective target tensors. - * For example: - * ```js - * { - * value: { - * xs: xsTensor, - * ys: { - * output_1: ysTensor1, - * output_2: ysTensor2 - * }, - * }, - * done: false - * } - * ``` - * @param args A `ModelFitDatasetArgs`, containing optional fields. - * - * @return A `History` instance. Its `history` attribute contains all - * information collected during training. - * - * @doc {heading: 'Models', subheading: 'Classes', ignoreCI: true} - */ - async fitDataset(dataset: Dataset, args: ModelFitDatasetArgs): - Promise { - if (!this.built) { - throw new RuntimeError( - 'The model needs to be compiled before ' + - 'being used.'); - } - return this.model.fitDataset(dataset, args); - } - - /** - * Runs a single gradient update on a single batch of data. - * - * This method differs from `fit()` and `fitDataset()` in the following - * regards: - * - It operates on exactly one batch of data. - * - It returns only the loss and matric values, instead of - * returning the batch-by-batch loss and metric values. - * - It doesn't support fine-grained options such as verbosity and - * callbacks. - * - * @param x Input data. It could be one of the following: - * - A `tf.Tensor`, or an Array of `tf.Tensor`s (in case the model has - * multiple inputs). - * - An Object mapping input names to corresponding `tf.Tensor` (if the - * model has named inputs). - * @param y Target darta. It could be either a `tf.Tensor` a multiple - * `tf.Tensor`s. It should be consistent with `x`. - * @returns Training loss or losses (in case the model has - * multiple outputs), along with metrics (if any), as numbers. - * - * @doc {heading: 'Models', subheading: 'Classes'} - */ - async trainOnBatch( - x: Tensor|Tensor[]|{[inputName: string]: Tensor}, - y: Tensor|Tensor[]| - {[inputName: string]: Tensor}): Promise { - return this.model.trainOnBatch(x, y); - } - - /* See parent class for JsDoc */ - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict, - customObjects = {} as serialization.ConfigDict, - fastWeightInit = false): T { - let configArray: serialization.ConfigDictArray; - let extraModelConfig: serialization.ConfigDict = {}; - if (config instanceof Array) { - if (!(config[0].className != null) || - config[0]['className'] === 'Merge') { - throw new ValueError('Legacy serialization format not supported yet.'); - } - configArray = config; - } else { - util.assert( - config['layers'] != null, - () => - `When the config data for a Sequential model is not an Array, ` + - `it must be an Object that contains the 'layers' field.`); - configArray = config['layers'] as serialization.ConfigDictArray; - delete config['layers']; - extraModelConfig = config; - } - - const model = new cls(extraModelConfig); - if (!(model instanceof Sequential)) { - throw new NotImplementedError( - `Sequential.fromConfig called on non-Sequential input: ${model}`); - } - for (const conf of configArray) { - const customObjects: serialization.ConfigDict = undefined; - const layer = deserialize( - conf as serialization.ConfigDict, customObjects, - fastWeightInit) as Layer; - if (fastWeightInit) { - layer.setFastWeightInitDuringBuild(true); - } - model.add(layer); - } - return model; - } - - /** - * Setter used for force stopping of LayersModel.fit() (i.e., training). - * - * Example: - * - * ```js - * const model = tf.sequential(); - * model.add(tf.layers.dense({units: 1, inputShape: [10]})); - * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); - * const xs = tf.ones([8, 10]); - * const ys = tf.zeros([8, 1]); - * - * const history = await model.fit(xs, ys, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * if (epoch === 2) { - * model.stopTraining = true; - * } - * } - * } - * }); - * - * // There should be only 3 values in the loss array, instead of 10 values, - * // due to the stopping after 3 epochs. - * console.log(history.history.loss); - * ``` - */ - set stopTraining(stop: boolean) { - // TODO(cais): When refactoring to remove the composition pattern happens, - // remove this method overriding. - if (this.model == null) { - throw new ValueError( - 'Cannot set the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - this.model.stopTraining = stop; - } - - get stopTraining(): boolean { - if (this.model == null) { - throw new ValueError( - 'Cannot get the stopTraining property of a sequential model before ' + - 'it is compiled.'); - } - return this.model.stopTraining; - } - - // TODO(cais): Override get trainableWeights() here - - // tslint:disable-next-line:no-any - getConfig(): any { - // NOTE(cais): We override the return type of getConfig() to `any` here, - // because the `Sequential` class is a special case among `Container` - // subtypes in that its getConfig() method returns an Array (not a - // dict). - const layers: serialization.ConfigDict[] = []; - for (const layer of this.layers) { - const dict: serialization.ConfigDict = {}; - dict['className'] = layer.getClassName(); - dict['config'] = layer.getConfig(); - layers.push(dict); - } - return {name: this.name, layers}; - } -} -serialization.registerClass(Sequential); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts deleted file mode 100644 index 386edab78..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Optimizers. - */ - -import {Optimizer, train} from '@tensorflow/tfjs-core'; - -import {epsilon} from './backend/common'; - -import {ValueError} from './errors'; - -// Add (de)serialize() - -// Porting note: This diverges from the PyKeras implementation and may need to -// change based on (de)serialization requirements. -export function getOptimizer(identifier: string): Optimizer { - const optimizerMap: {[optimizerName: string]: () => Optimizer} = { - 'Adagrad': () => train.adagrad(0.01), - 'Adadelta': () => train.adadelta(1, 0.95, epsilon()), - 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()), - 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0), - 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()), - 'SGD': () => train.sgd(0.01) - }; - optimizerMap['adagrad'] = optimizerMap['Adagrad']; - optimizerMap['adadelta'] = optimizerMap['Adadelta']; - optimizerMap['adam'] = optimizerMap['Adam']; - optimizerMap['adamax'] = optimizerMap['Adamax']; - optimizerMap['rmsprop'] = optimizerMap['RMSProp']; - optimizerMap['sgd'] = optimizerMap['SGD']; - - if (identifier in optimizerMap) { - return optimizerMap[identifier](); - } - throw new ValueError(`Unknown Optimizer ${identifier}`); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts deleted file mode 100644 index 7bb0e78d3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* original source: keras/regularizers.py */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core'; -import * as K from './backend/tfjs_backend'; -import {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils'; - -function assertObjectArgs(args: L1Args | L2Args | L1L2Args): void { - if (args != null && typeof args !== 'object') { - throw new Error( - `Argument to L1L2 regularizer's constructor is expected to be an ` + - `object, but received: ${args}`); - } -} - -/** - * Regularizer base class. - */ -export abstract class Regularizer extends serialization.Serializable { - abstract apply(x: Tensor): Scalar; -} - -export interface L1L2Args { - /** L1 regularization rate. Defaults to 0.01. */ - l1?: number; - /** L2 regularization rate. Defaults to 0.01. */ - l2?: number; -} - -export interface L1Args { - /** L1 regularization rate. Defaults to 0.01. */ - l1: number; -} - -export interface L2Args { - /** L2 regularization rate. Defaults to 0.01. */ - l2: number; -} - -export class L1L2 extends Regularizer { - /** @nocollapse */ - static className = 'L1L2'; - - private readonly l1: number; - private readonly l2: number; - private readonly hasL1: boolean; - private readonly hasL2: boolean; - constructor(args?: L1L2Args) { - super(); - - assertObjectArgs(args); - - this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; - this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; - this.hasL1 = this.l1 !== 0; - this.hasL2 = this.l2 !== 0; - } - - /** - * Porting note: Renamed from __call__. - * @param x Variable of which to calculate the regularization score. - */ - apply(x: Tensor): Scalar { - return tidy(() => { - let regularization: Tensor = zeros([1]); - if (this.hasL1) { - regularization = add(regularization, sum(tfc.mul(this.l1, abs(x)))); - } - if (this.hasL2) { - regularization = - add(regularization, sum(tfc.mul(this.l2, K.square(x)))); - } - return regularization.asScalar(); - }); - } - - getConfig(): serialization.ConfigDict { - return {'l1': this.l1, 'l2': this.l2}; - } - - /** @nocollapse */ - static fromConfig( - cls: serialization.SerializableConstructor, - config: serialization.ConfigDict): T { - return new cls({l1: config['l1'] as number, l2: config['l2'] as number}); - } -} -serialization.registerClass(L1L2); - -export function l1(args?: L1Args) { - assertObjectArgs(args); - return new L1L2({l1: args != null ? args.l1 : null, l2: 0}); -} - -export function l2(args: L2Args) { - assertObjectArgs(args); - return new L1L2({l2: args != null ? args.l2 : null, l1: 0}); -} - -/** @docinline */ -export type RegularizerIdentifier = 'l1l2'|string; - -// Maps the JavaScript-like identifier keys to the corresponding keras symbols. -export const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: - {[identifier in RegularizerIdentifier]: string} = { - 'l1l2': 'L1L2' - }; - -export function serializeRegularizer(constraint: Regularizer): - serialization.ConfigDictValue { - return serializeKerasObject(constraint); -} - -export function deserializeRegularizer( - config: serialization.ConfigDict, - customObjects: serialization.ConfigDict = {}): Regularizer { - return deserializeKerasObject( - config, serialization.SerializationMap.getMap().classNameMap, - customObjects, 'regularizer'); -} - -export function getRegularizer(identifier: RegularizerIdentifier| - serialization.ConfigDict| - Regularizer): Regularizer { - if (identifier == null) { - return null; - } - if (typeof identifier === 'string') { - const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? - REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : - identifier; - const config = {className, config: {}}; - return deserializeRegularizer(config); - } else if (identifier instanceof Regularizer) { - return identifier; - } else { - return deserializeRegularizer(identifier); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/setup_tests.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/setup_tests.ts deleted file mode 100644 index c388c17b4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/setup_tests.ts +++ /dev/null @@ -1,25 +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 '@tensorflow/tfjs-core'; -// tslint:disable-next-line:no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; - -import '@tensorflow/tfjs-backend-cpu'; -import '@tensorflow/tfjs-backend-webgl'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/types.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/types.ts deleted file mode 100644 index d5f530622..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/types.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** Defines allowable data types for tensors. */ - -import {NamedTensorMap, Scalar, Tensor} from '@tensorflow/tfjs-core'; - -import {Shape} from './keras_format/common'; - -export interface NamedTensor { - name: string; - tensor: Tensor; -} - -export type HasShape = { - shape: Shape; -}; - -/** - * Type for loss a metric function. - * - * Takes a true value and a predicted value, and returns a loss or metric value. - */ -export type LossOrMetricFn = (yTrue: Tensor, yPred: Tensor) => Tensor; - -/** - * Type for a regularizer function. - */ -export type RegularizerFn = () => Scalar; - -/* - * The type for an RNN step function. - * The arguments are: - * - inputs: Input data, with shape `[sapmles, ...]`. - * The return values are: - * - outputs: tensor with shape `[samples, outputDim]` (no time dimension). - * - newStates: Array of tensors. The `Array` has the same length as `states` - * in the input arguments. Each `tf.Tensor` has the same shape as the - * corresponding element in `states`. - */ -export type RnnStepFunction = - (inputs: Tensor, states: Tensor[]) => [Tensor, Tensor[]]; - -/** - * A single Tensor or a non-nested collection of Tensors. - * - * An object of this type can always be reduced to `Tensor[]`. A single - * 'Tensor' becomes `[Tensor]`. A `Tensor[]` is unchanged. A `NamedTensorMap` - * can be converted with the help of a list of names, providing the order in - * which the Tensors should appear in the resulting array. - */ -export type TensorOrArrayOrMap = Tensor|Tensor[]|NamedTensorMap; - -/** - * Type representing a loosely-typed bundle of keyword arguments. - * - * This is a looser type than PyJsonDict/serialization.ConfigDict as it - * can contain arbitrary objects as its values. It is most appropriate - * for functions that pass through keyword arguments to other functions - * without knowledge of the structure. If the function can place type - * restrictions on the keyword arguments, it should via the Config - * interface convention used throughout. - */ -export type Kwargs = { - // tslint:disable-next-line:no-any - [key: string]: any -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts deleted file mode 100644 index 398ce18c2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** Utility functions related to user-defined metadata. */ - -// Maximum recommended serialized size for user-defined metadata. -// Beyond this limit, a warning message will be printed during model loading and -// saving. -export const MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH = 1 * 1024 * 1024; - -/** - * Check validity of user-defined metadata. - * - * @param userDefinedMetadata - * @param modelName Name of the model that the user-defined metadata belongs to. - * Used during construction of error messages. - * @param checkSize Whether to check the size of the metadata is under - * recommended limit. Default: `false`. If `true`, will try stringify the - * JSON object and print a console warning if the serialzied size is above the - * limit. - * @throws Error if `userDefinedMetadata` is not a plain JSON object. - */ -export function checkUserDefinedMetadata( - userDefinedMetadata: {}, modelName: string, checkSize = false): void { - if (userDefinedMetadata == null || - typeof userDefinedMetadata !== 'object' || - Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || - !plainObjectCheck(userDefinedMetadata)) { - throw new Error( - 'User-defined metadata is expected to be a JSON object, but is not.'); - } - - if (checkSize) { - const out = JSON.stringify(userDefinedMetadata); - if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH) { - console.warn( - `User-defined metadata of model "${modelName}" is too large in ` + - `size (length=${out.length} when serialized). It is not ` + - `recommended to store such large objects in user-defined metadata. ` + - `Please make sure its serialized length is <= ` + - `${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH}.`); - } - } -} - -/** - * Check if an input is plain JSON object or any valid subfield of it. - * - * @param x The input to be checked. - * @param assertObject Whether to assert `x` is a JSON object, i.e., reject - * cases of arrays and primitives. - * @return Returns `true` if and only if `x` is a plain JSON object, - * a JSON-valid primitive including string, number, boolean and null, - * or an array of the said types. - */ -// tslint:disable-next-line:no-any -export function plainObjectCheck(x: any): boolean { - if (x === null) { - // Note: typeof `null` is 'object', and `null` is valid in JSON. - return true; - } else if (typeof x === 'object') { - if (Object.getPrototypeOf(x) === Object.prototype) { - // `x` is a JavaScript object and its prototype is Object. - const keys = Object.keys(x); - for (const key of keys) { - if (typeof key !== 'string') { - // JSON keys must be strings. - return false; - } - if (!plainObjectCheck(x[key])) { // Recursive call. - return false; - } - } - return true; - } else { - // `x` is a JavaScript object but its prototype is not Object. - if (Array.isArray(x)) { - // `x` is a JavaScript array. - for (const item of x) { - if (!plainObjectCheck(item)) { // Recursive call. - return false; - } - } - return true; - } else { - // `x` is a JavaScript object and its prototype is not Object, - // and it's not an Array. I.e., it's a complex object such as - // `Error` and `Date`. - return false; - } - } - } else { - // `x` is not a JavaScript object or `null`. - const xType = typeof x; - return xType === 'string' || xType === 'number' || xType === 'boolean'; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts deleted file mode 100644 index 5a62a2c3d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {ValueError} from '../errors'; -import {PaddingMode} from '../keras_format/common'; - -import {pyListRepeat} from './generic_utils'; -import {isInteger, max} from './math_utils'; - -/** - * Transforms a single number of array of numbers into an array of numbers. - * @param value - * @param n: The size of the tuple to be returned. - * @param name: Name of the parameter, used for generating error messages. - * @returns An array of numbers. - */ -export function normalizeArray( - value: number|number[], n: number, name: string): number[] { - if (typeof value === 'number') { - return pyListRepeat(value, n); - } else { - if (value.length !== n) { - throw new ValueError( - `The ${name} argument must be an integer or tuple of ${n} integers.` + - ` Received: ${value.length} elements.`); - } - for (let i = 0; i < n; ++i) { - const singleValue = value[i]; - if (!isInteger(singleValue)) { - throw new ValueError( - `The ${name} argument must be an integer or tuple of ${n}` + - ` integers. Received: ${JSON.stringify(value)} including a` + - ` non-integer number ${singleValue}`); - } - } - return value; - } -} - -/** - * Determines output length of a convolution given input length. - * @param inputLength - * @param filterSize - * @param padding - * @param stride - * @param dilation: dilation rate. - */ -export function convOutputLength( - inputLength: number, filterSize: number, padding: PaddingMode, - stride: number, dilation = 1): number { - if (inputLength == null) { - return inputLength; - } - const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); - let outputLength: number; - if (padding === 'same') { - outputLength = inputLength; - } else { // VALID - outputLength = inputLength - dilatedFilterSize + 1; - } - return Math.floor((outputLength + stride - 1) / stride); -} - -export function deconvLength( - dimSize: number, strideSize: number, kernelSize: number, - padding: PaddingMode): number { - if (dimSize == null) { - return null; - } - - if (padding === 'valid') { - dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]); - } else if (padding === 'same') { - dimSize = dimSize * strideSize; - } else { - throw new ValueError(`Unsupport padding mode: ${padding}.`); - } - return dimSize; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts deleted file mode 100644 index 185340127..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts +++ /dev/null @@ -1,562 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: utils/generic_utils.py */ - -import {DataType, fused, serialization, util} from '@tensorflow/tfjs-core'; - -import {AssertionError, ValueError} from '../errors'; - -// tslint:enable - -/** - * If `value` is an Array, equivalent to Python's `value * numValues`. - * If `value` is not an Array, equivalent to Python's `[value] * numValues` - */ -// tslint:disable-next-line:no-any -export function pyListRepeat(value: any, numValues: number): any[] { - if (Array.isArray(value)) { - // tslint:disable-next-line:no-any - let newArray: any[] = []; - for (let i = 0; i < numValues; i++) { - newArray = newArray.concat(value); - } - return newArray; - } else { - const newArray = new Array(numValues); - newArray.fill(value); - return newArray; - } -} - -export function assert(val: boolean, message?: string): void { - if (!val) { - throw new AssertionError(message); - } -} - -/** - * Count the number of elements of the `array` that are equal to `reference`. - */ -export function count(array: T[], refernce: T) { - let counter = 0; - for (const item of array) { - if (item === refernce) { - counter++; - } - } - return counter; -} - -/** - * If an array is of length 1, just return the first element. Otherwise, return - * the full array. - * @param tensors - */ -export function singletonOrArray(xs: T[]): T|T[] { - if (xs.length === 1) { - return xs[0]; - } - return xs; -} - -/** - * Normalizes a list/tensor into a list. - * - * If a tensor is passed, we return - * a list of size 1 containing the tensor. - * - * @param x target object to be normalized. - */ -// tslint:disable-next-line:no-any -export function toList(x: any): any[] { - if (Array.isArray(x)) { - return x; - } - return [x]; -} - -/** - * Generate a UID for a list - */ -// tslint:disable-next-line:no-any -export function objectListUid(objs: any|any[]): string { - const objectList = toList(objs); - let retVal = ''; - for (const obj of objectList) { - if (obj.id == null) { - throw new ValueError( - `Object ${obj} passed to objectListUid without an id`); - } - if (retVal !== '') { - retVal = retVal + ', '; - } - retVal = `${retVal}${Math.abs(obj.id)}`; - } - return retVal; -} -/** - * Converts string to snake-case. - * @param name - */ -export function toSnakeCase(name: string): string { - const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); - const insecure = - intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); - /* - If the class is private the name starts with "_" which is not secure - for creating scopes. We prefix the name with "private" in this case. - */ - if (insecure[0] !== '_') { - return insecure; - } - return 'private' + insecure; -} - -export function toCamelCase(identifier: string): string { - // quick return for empty string or single character strings - if (identifier.length <= 1) { - return identifier; - } - // Check for the underscore indicating snake_case - if (identifier.indexOf('_') === -1) { - return identifier; - } - return identifier.replace(/[_]+(\w|$)/g, (m, p1) => p1.toUpperCase()); -} - -// tslint:disable-next-line:no-any -let _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any}; - -export function serializeKerasObject(instance: serialization.Serializable): - serialization.ConfigDictValue { - if (instance === null || instance === undefined) { - return null; - } - const dict: serialization.ConfigDictValue = {}; - dict['className'] = instance.getClassName(); - dict['config'] = instance.getConfig(); - return dict; -} - -/** - * Replace ndarray-style scalar objects in serialization objects with numbers. - * - * Background: In some versions of tf.keras, certain scalar values in the HDF5 - * model save file can be serialized as: `{'type': 'ndarray', 'value': num}`, - * where in `num` is a plain number. This method converts such serialization - * to a `number`. - * - * @param config The keras-format serialization object to be processed - * (in place). - */ -function convertNDArrayScalarsInConfig(config: serialization.ConfigDictValue): - void { - if (config == null || typeof config !== 'object') { - return; - } else if (Array.isArray(config)) { - config.forEach(configItem => convertNDArrayScalarsInConfig(configItem)); - } else { - const fields = Object.keys(config); - for (const field of fields) { - const value = config[field]; - if (value != null && typeof value === 'object') { - if (!Array.isArray(value) && value['type'] === 'ndarray' && - typeof value['value'] === 'number') { - config[field] = value['value']; - } else { - convertNDArrayScalarsInConfig(value as serialization.ConfigDict); - } - } - } - } -} - -/** - * Deserialize a saved Keras Object - * @param identifier either a string ID or a saved Keras dictionary - * @param moduleObjects a list of Python class names to object constructors - * @param customObjects a list of Python class names to object constructors - * @param printableModuleName debug text for the object being reconstituted - * @param fastWeightInit Optional flag to use fast weight initialization - * during deserialization. This is applicable to cases in which - * the initialization will be immediately overwritten by loaded weight - * values. Default: `false`. - * @returns a TensorFlow.js Layers object - */ -// tslint:disable:no-any -export function deserializeKerasObject( - identifier: string|serialization.ConfigDict, - moduleObjects = {} as {[objName: string]: any}, - customObjects = {} as {[objName: string]: any}, - printableModuleName = 'object', fastWeightInit = false): any { - // tslint:enable - if (typeof identifier === 'string') { - const functionName = identifier; - let fn; - if (functionName in customObjects) { - fn = customObjects[functionName]; - } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { - fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; - } else { - fn = moduleObjects[functionName]; - if (fn == null) { - throw new ValueError( - `Unknown ${printableModuleName}: ${identifier}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - } - return fn; - } else { - // In this case we are dealing with a Keras config dictionary. - const config = identifier; - if (config['className'] == null || config['config'] == null) { - throw new ValueError( - `${printableModuleName}: Improper config format: ` + - `${JSON.stringify(config)}.\n` + - `'className' and 'config' must set.`); - } - const className = config['className'] as string; - let cls, fromConfig; - if (className in customObjects) { - [cls, fromConfig] = customObjects[className]; - } else if (className in _GLOBAL_CUSTOM_OBJECTS) { - [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS['className']; - } else if (className in moduleObjects) { - [cls, fromConfig] = moduleObjects[className]; - } - if (cls == null) { - throw new ValueError( - `Unknown ${printableModuleName}: ${className}. ` + - `This may be due to one of the following reasons:\n` + - `1. The ${printableModuleName} is defined in Python, in which ` + - `case it needs to be ported to TensorFlow.js or your JavaScript ` + - `code.\n` + - `2. The custom ${printableModuleName} is defined in JavaScript, ` + - `but is not registered properly with ` + - `tf.serialization.registerClass().`); - // TODO(cais): Add link to tutorial page on custom layers. - } - if (fromConfig != null) { - // Porting notes: Instead of checking to see whether fromConfig accepts - // customObjects, we create a customObjects dictionary and tack it on to - // config['config'] as config['config'].customObjects. Objects can use it, - // if they want. - - // tslint:disable-next-line:no-any - const customObjectsCombined = {} as {[objName: string]: any}; - for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) { - customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; - } - for (const key of Object.keys(customObjects)) { - customObjectsCombined[key] = customObjects[key]; - } - // Add the customObjects to config - const nestedConfig = config['config'] as serialization.ConfigDict; - nestedConfig['customObjects'] = customObjectsCombined; - - const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS}; - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - convertNDArrayScalarsInConfig(config['config']); - const returnObj = - fromConfig(cls, config['config'], customObjects, fastWeightInit); - _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects}; - - return returnObj; - } else { - // Then `cls` may be a function returning a class. - // In this case by convention `config` holds - // the kwargs of the function. - const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS}; - for (const key of Object.keys(customObjects)) { - _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; - } - // In python this is **config['config'], for tfjs-layers we require - // classes that use this fall-through construction method to take - // a config interface that mimics the expansion of named parameters. - const returnObj = new cls(config['config']); - _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects}; - return returnObj; - } - } -} - -/** - * Compares two numbers for sorting. - * @param a - * @param b - */ -export function numberCompare(a: number, b: number) { - return (a < b) ? -1 : ((a > b) ? 1 : 0); -} - -/** - * Comparison of two numbers for reverse sorting. - * @param a - * @param b - */ -export function reverseNumberCompare(a: number, b: number) { - return -1 * numberCompare(a, b); -} - -/** - * Convert a string into the corresponding DType. - * @param dtype - * @returns An instance of DType. - */ -export function stringToDType(dtype: string): DataType { - switch (dtype) { - case 'float32': - return 'float32'; - default: - throw new ValueError(`Invalid dtype: ${dtype}`); - } -} - -/** - * Test the element-by-element equality of two Arrays of strings. - * @param xs First array of strings. - * @param ys Second array of strings. - * @returns Wether the two arrays are all equal, element by element. - */ -export function stringsEqual(xs: string[], ys: string[]): boolean { - if (xs == null || ys == null) { - return xs === ys; - } - if (xs.length !== ys.length) { - return false; - } - for (let i = 0; i < xs.length; ++i) { - if (xs[i] !== ys[i]) { - return false; - } - } - return true; -} - -/** - * Get the unique elements of an array. - * @param xs Array. - * @returns An Array consisting of the unique elements in `xs`. - */ -export function unique(xs: T[]): T[] { - if (xs == null) { - return xs; - } - const out: T[] = []; - // TODO(cais): Maybe improve performance by sorting. - for (const x of xs) { - if (out.indexOf(x) === -1) { - out.push(x); - } - } - return out; -} - -/** - * Determine if an Object is empty (i.e., does not have own properties). - * @param obj Object - * @returns Whether the Object is empty. - * @throws ValueError: If object is `null` or `undefined`. - */ -export function isObjectEmpty(obj: {}): boolean { - if (obj == null) { - throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`); - } - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; -} - -/** - * Helper function used to build type union/enum run-time checkers. - * @param values The list of allowed values. - * @param label A string name for the type - * @param value The value to test. - * @throws ValueError: If the value is not in values nor `undefined`/`null`. - */ -export function checkStringTypeUnionValue( - values: string[], label: string, value: string): void { - if (value == null) { - return; - } - if (values.indexOf(value) < 0) { - throw new ValueError(`${value} is not a valid ${label}. Valid values are ${ - values} or null/undefined.`); - } -} - -/** - * Helper function for verifying the types of inputs. - * - * Ensures that the elements of `x` are all of type `expectedType`. - * Also verifies that the length of `x` is within bounds. - * - * @param x Object to test. - * @param expectedType The string expected type of all of the elements in the - * Array. - * @param minLength Return false if x.length is less than this. - * @param maxLength Return false if x.length is greater than this. - * @returns true if and only if `x` is an `Array` with - * length >= `minLength` and <= `maxLength`. - */ -// tslint:disable:no-any -export function checkArrayTypeAndLength( - x: any, expectedType: string, minLength = 0, - maxLength = Infinity): boolean { - assert(minLength >= 0); - assert(maxLength >= minLength); - return ( - Array.isArray(x) && x.length >= minLength && x.length <= maxLength && - x.every(e => typeof e === expectedType)); -} -// tslint:enable:no-any - -/** - * Assert that a value or an array of value are positive integer. - * - * @param value The value being asserted on. May be a single number or an array - * of numbers. - * @param name Name of the value, used to make the error message. - */ -export function assertPositiveInteger(value: number|number[], name: string) { - if (Array.isArray(value)) { - util.assert( - value.length > 0, () => `${name} is unexpectedly an empty array.`); - value.forEach( - (v, i) => assertPositiveInteger(v, `element ${i + 1} of ${name}`)); - } else { - util.assert( - Number.isInteger(value) && value > 0, - () => `Expected ${name} to be a positive integer, but got ` + - `${formatAsFriendlyString(value)}.`); - } -} - -/** - * Format a value into a display-friendly, human-readable fashion. - * - * - `null` is formatted as `'null'` - * - Strings are formated with flanking pair of quotes. - * - Arrays are formatted with flanking pair of square brackets. - * - * @param value The value to display. - * @return Formatted string. - */ -// tslint:disable-next-line:no-any -export function formatAsFriendlyString(value: any): string { - if (value === null) { - return 'null'; - } else if (Array.isArray(value)) { - return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']'; - } else if (typeof value === 'string') { - return `"${value}"`; - } else { - return `${value}`; - } -} - -/** - * Returns a function `f2` (decorator) which wraps the original function - * `f`. `f2` guarantees that `f` can be called at most once - * every `waitMs` ms. If `f2` is called more often, it will return - * the last returned result of `f`. - * - * @param f The original function `f` to wrap. - * @param waitMs The time between two consecutive calls to `f` in ms. - */ -export function debounce( - f: (...args: Array<{}>) => T, waitMs: number): (...args: Array<{}>) => T { - let lastTime = util.now(); - let lastResult: T; - const f2 = (...args: Array<{}>) => { - const now = util.now(); - if (now - lastTime < waitMs) { - return lastResult; - } - lastTime = now; - lastResult = f(...args); - return lastResult; - }; - return f2; -} - -/** - * Returns the fusable activation given a layers identifier. - * - * @param activationName The layers identifier string. - * @return The name of the fusable activation. - */ -export function mapActivationToFusedKernel(activationName: string): - fused.Activation { - if (activationName === 'relu') { - return 'relu'; - } - if (activationName === 'linear') { - return 'linear'; - } - if (activationName === 'elu') { - return 'elu'; - } - return null; -} - -type PossibleValues = Array>; - -/** - * Returns the cartesian product of sets of values. - * This works the same as itertools.product in Python. - * - * Example: - * - * filters = [128, 256, 512] - * paddings = ['same', 'valid'] - * - * product = [ [128, 'same'], [128, 'valid'], [256, 'same'], [256, 'valid'], - * [512, 'same'], [512, 'valid']] - * - * @param arrayOfValues List/array of values. - * @return The cartesian product. - */ -export function getCartesianProductOfValues(...arrayOfValues: PossibleValues): - PossibleValues { - assert(arrayOfValues.length > 0, 'arrayOfValues is empty'); - - for (const values of arrayOfValues) { - assert(Array.isArray(values), 'one of the values is not an array'); - assert(values.length > 0, 'one of the values is empty'); - } - - return arrayOfValues.reduce((products, values) => { - if (products.length === 0) { - return values.map(value => [value]); - } - - return values - .map(value => { - return products.map((prevValue) => [...prevValue, value]); - }) - .reduce((flattenedProduct, unflattenedProduct) => { - return flattenedProduct.concat(unflattenedProduct); - }, []); - }, [] as PossibleValues); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts deleted file mode 100644 index f86c6106a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {Container} from '../engine/container'; -import {Layer, Node} from '../engine/topology'; -import {countParamsInWeights} from './variable_utils'; - -/** - * Print the summary of a LayersModel object. - * - * @param model tf.LayersModel instance. - * @param lineLength Total length of printed lines. Set this to adapt to the - * display to different terminal or console sizes. - * @param positions Relative or absolute positions of log elements in each - * line. Each number corresponds to right-most (i.e., ending) position of a - * column. - * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like - * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models. - * @param printFn Print function to use. - * It will be called on each line of the summary. You can provide a custom - * function in order to capture the string summary. Defaults to `console.log`. - */ -export function printSummary( - model: Container, lineLength?: number, positions?: number[], - // tslint:disable-next-line:no-any - printFn: (message?: any, ...optionalParams: any[]) => void = - console.log): void { - const sequentialLike = isModelSequentialLike(model); - - // Header names for different log elements. - const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #']; - if (sequentialLike) { - lineLength = lineLength || 65; - positions = positions || [0.45, 0.85, 1]; - } else { - lineLength = lineLength || 98; - positions = positions || [0.33, 0.55, 0.67, 1]; - // Header names for different log elements. - } - - if (positions[positions.length - 1] <= 1) { - // `positions` is relative. Convert it to absolute positioning. - positions = positions.map(p => Math.floor(lineLength * p)); - } - - let relevantNodes: Node[]; - if (!sequentialLike) { - toDisplay.push('Receives inputs'); - relevantNodes = []; - for (const depth in model.nodesByDepth) { - relevantNodes.push(...model.nodesByDepth[depth]); - } - } - - printFn('_'.repeat(lineLength)); - printRow(toDisplay, positions, printFn); - printFn('='.repeat(lineLength)); - - const layers = model.layers; - for (let i = 0; i < layers.length; ++i) { - if (sequentialLike) { - printLayerSummary(layers[i], positions, printFn); - } else { - printLayerSummaryWithConnections( - layers[i], positions, relevantNodes, printFn); - } - printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); - } - - // tslint:disable-next-line:no-any - (model as any).checkTrainableWeightsConsistency(); - - const trainableCount = countTrainableParams(model); - const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); - - printFn(`Total params: ${trainableCount + nonTrainableCount}`); - printFn(`Trainable params: ${trainableCount}`); - printFn(`Non-trainable params: ${nonTrainableCount}`); - printFn('_'.repeat(lineLength)); -} - -function countTrainableParams(model: Container): number { - let trainableCount: number; - // tslint:disable:no-any - if ((model as any).collectedTrainableWeights != null) { - trainableCount = - countParamsInWeights((model as any).collectedTrainableWeights); - } else { - trainableCount = countParamsInWeights(model.trainableWeights); - } - // tslint:enable:no-any - return trainableCount; -} - -function isModelSequentialLike(model: Container): boolean { - let sequentialLike = true; - const nodesByDepth: Node[][] = []; - const nodes: Node[] = []; - for (const depth in model.nodesByDepth) { - nodesByDepth.push(model.nodesByDepth[depth]); - } - for (const depthNodes of nodesByDepth) { - if (depthNodes.length > 1 || - depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { - sequentialLike = false; - break; - } - nodes.push(...depthNodes); - } - if (sequentialLike) { - // Search for shared layers. - for (const layer of model.layers) { - let flag = false; - for (const node of layer.inboundNodes) { - if (nodes.indexOf(node) !== -1) { - if (flag) { - sequentialLike = false; - break; - } else { - flag = true; - } - } - } - if (!sequentialLike) { - break; - } - } - } - return sequentialLike; -} - -function printRow( - fields: string[], positions: number[], - // tslint:disable-next-line:no-any - printFn: (message?: any, ...optionalParams: any[]) => void = console.log) { - let line = ''; - for (let i = 0; i < fields.length; ++i) { - if (i > 0) { - line = line.slice(0, line.length - 1) + ' '; - } - line += fields[i]; - line = line.slice(0, positions[i]); - line += ' '.repeat(positions[i] - line.length); - } - printFn(line); -} - -/** - * Prints a summary for a single Layer, without connectivity information. - * - * @param layer: Layer instance to print. - */ -function printLayerSummary( - layer: Layer, positions: number[], - // tslint:disable-next-line:no-any - printFn: (message?: any, ...optionalParams: any[]) => void) { - let outputShape: string; - try { - outputShape = JSON.stringify(layer.outputShape); - } catch (err) { - outputShape = 'multiple'; - } - - const name = layer.name; - const className = layer.getClassName(); - const fields: string[] = - [`${name} (${className})`, outputShape, layer.countParams().toString()]; - printRow(fields, positions, printFn); -} - -/** - * Prints a summary for a single Layer, with connectivity information. - */ -function printLayerSummaryWithConnections( - layer: Layer, positions: number[], relevantNodes: Node[], - // tslint:disable-next-line:no-any - printFn: (message?: any, ...optionalParams: any[]) => void) { - let outputShape: string; - try { - outputShape = JSON.stringify(layer.outputShape); - } catch (err) { - outputShape = 'multiple'; - } - - const connections: string[] = []; - for (const node of layer.inboundNodes) { - if (relevantNodes != null && relevantNodes.length > 0 && - relevantNodes.indexOf(node) === -1) { - continue; - } - for (let i = 0; i < node.inboundLayers.length; ++i) { - const inboundLayer = node.inboundLayers[i].name; - const inboundLayerIndex = node.nodeIndices[i]; - const inboundTensorIndex = node.tensorIndices[i]; - connections.push( - `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`); - } - } - const name = layer.name; - const className = layer.getClassName(); - const firstConnection = connections.length === 0 ? '' : connections[0]; - const fields: string[] = [ - `${name} (${className})`, outputShape, layer.countParams().toString(), - firstConnection - ]; - - printRow(fields, positions, printFn); - for (let i = 1; i < connections.length; ++i) { - printRow(['', '', '', connections[i]], positions, printFn); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts deleted file mode 100644 index 459b1d63d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Math utility functions. - * - * This file contains some frequently used math function that operates on - * number[] or Float32Array and return a number. Many of these functions are - * not-so-thick wrappers around TF.js Core functions. But they offer the - * convenience of - * 1) not having to convert the inputs into Tensors, - * 2) not having to convert the returned Tensors to numbers. - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core'; -import {ValueError} from '../errors'; - -export type ArrayTypes = Uint8Array|Int32Array|Float32Array; - -/** - * Determine if a number is an integer. - */ -export function isInteger(x: number): boolean { - return x === parseInt(x.toString(), 10); -} - -/** - * Calculate the product of an array of numbers. - * @param array The array to calculate the product over. - * @param begin Beginning index, inclusive. - * @param end Ending index, exclusive. - * @return The product. - */ -export function arrayProd( - array: number[]|ArrayTypes, begin?: number, end?: number): number { - if (begin == null) { - begin = 0; - } - if (end == null) { - end = array.length; - } - - let prod = 1; - for (let i = begin; i < end; ++i) { - prod *= array[i]; - } - return prod; -} - -/** - * A helper function transforms the two input types to an instance of Tensor1D, - * so the return value can be fed directly into various TF.js Core functions. - * @param array - */ -function toArray1D(array: number[]|Float32Array): Tensor1D { - array = Array.isArray(array) ? new Float32Array(array) : array; - return tensor1d(array); -} - -/** - * Compute minimum value. - * @param array - * @return minimum value. - */ -export function min(array: number[]|Float32Array): number { - return tfc.min(toArray1D(array)).dataSync()[0]; -} - -/** - * Compute maximum value. - * @param array - * @return maximum value - */ -export function max(array: number[]|Float32Array): number { - return tfc.max(toArray1D(array)).dataSync()[0]; -} - -/** - * Compute sum of array. - * @param array - * @return The sum. - */ -export function sum(array: number[]|Float32Array): number { - return tfc.sum(toArray1D(array)).dataSync()[0]; -} - -/** - * Compute mean of array. - * @param array - * @return The mean. - */ -export function mean(array: number[]|Float32Array): number { - return sum(array) / array.length; -} - -/** - * Compute variance of array. - * @param array - * @return The variance. - */ -export function variance(array: number[]|Float32Array): number { - const demeaned = tfc.sub(toArray1D(array), scalar(mean(array))); - const sumSquare = tfc.sum(tfc.mul(demeaned, demeaned)).dataSync()[0]; - return sumSquare / array.length; -} - -/** - * Compute median of array. - * @param array - * @return The median value. - */ -export function median(array: number[]|Float32Array): number { - const arraySorted = array.slice().sort((a, b) => a - b); - const lowIdx = Math.floor((arraySorted.length - 1) / 2); - const highIdx = Math.ceil((arraySorted.length - 1) / 2); - if (lowIdx === highIdx) { - return arraySorted[lowIdx]; - } - return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2; -} - -/** - * Generate an array of integers in [begin, end). - * @param begin Beginning integer, inclusive. - * @param end Ending integer, exclusive. - * @returns Range array. - * @throws ValueError, iff `end` < `begin`. - */ -export function range(begin: number, end: number): number[] { - if (end < begin) { - throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`); - } - const out: number[] = []; - for (let i = begin; i < end; ++i) { - out.push(i); - } - return out; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts deleted file mode 100644 index 30f80ccfa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -// Porting note: This file doesn't exist in PyKeras. -// Its purpose here is to centralize the boundary layer between -// tfjs-layers's internal Config TS-Centric format and PyKeras's -// serialized Python Config format. - -import {serialization} from '@tensorflow/tfjs-core'; - -import {PyJsonValue} from '../keras_format/types'; -import * as generic_utils from '../utils/generic_utils'; -// tslint:enable - -/** - * Test whether a value in an array is the name of a LayersModel or Layer. - * @param key The key name that the value is found under. Note that the key - * may not be at the level immediately above the value, if the value is in a - * nested array. - * @param index Index of the value in the Array that it is found in. - * @param value The value object. - * @returns A boolean indicating whether value is a name. - */ -function isArrayItemInputOrOutputName( - key: string, index: number, value: T): boolean { - return (key === 'inboundNodes' || key === 'outputLayers' || - key === 'inputLayers') && - index === 0 && typeof value === 'string'; -} - -/** - * Convert a Pythonic config object to TypeScript config object. - * @param pythonicConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export function convertPythonicToTs( - pythonicConfig: PyJsonValue, key?: string): serialization.ConfigDictValue { - if (pythonicConfig === null) { - return null; - } else if (typeof pythonicConfig === 'string') { - return generic_utils.toCamelCase(pythonicConfig); - } else if ( - (typeof pythonicConfig === 'number') || - (typeof pythonicConfig === 'boolean')) { - return pythonicConfig; - } else if (pythonicConfig instanceof Array) { - const tsArray = []; - const arrayLength = pythonicConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = pythonicConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - tsArray.push(item); - } else { - tsArray.push(convertPythonicToTs(item, key)); - } - } - return tsArray; - } else { - const tsDict: serialization.ConfigDict = {}; - for (const pythonicKey of Object.keys(pythonicConfig)) { - const pythonicValue = pythonicConfig[pythonicKey]; - if (pythonicKey === 'name' && typeof pythonicValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // camel-case conversion. - tsDict[pythonicKey] = pythonicValue; - } else { - const tsKey = generic_utils.toCamelCase(pythonicKey); - tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); - } - } - return tsDict; - } -} - -/** - * Convert a TypeScript config object to Python config object. - * @param tsConfig The config object to convert. - * @param key Optional key name of the object being converted. - * @returns Result of the conversion. - */ -export function convertTsToPythonic( - tsConfig: serialization.ConfigDictValue, key?: string): PyJsonValue { - if (tsConfig === null || tsConfig === undefined) { - return null; - } else if (typeof tsConfig === 'string') { - return generic_utils.toSnakeCase(tsConfig); - } else if ( - (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { - return tsConfig; - } else if (tsConfig instanceof Array) { - const pyArray = []; - const arrayLength = tsConfig.length; - for (let i = 0; i < arrayLength; ++i) { - const item = tsConfig[i]; - if (isArrayItemInputOrOutputName(key, i, item)) { - pyArray.push(item); - } else { - pyArray.push(convertTsToPythonic(item, key)); - } - } - return pyArray; - } else { - const pyDict: serialization.ConfigDict = {}; - for (const tsKey of Object.keys(tsConfig)) { - const tsValue = tsConfig[tsKey]; - const pyKey = generic_utils.toSnakeCase(tsKey); - if ((tsKey === 'name' || tsKey === 'className') && - typeof tsValue === 'string') { - // Special case the 'name' key with a string value. Name values, such as - // the names of LayersModel and Layer instances, should not undergo the - // snake-case conversion. - pyDict[pyKey] = tsValue; - } else { - pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); - } - } - return pyDict; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/test_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/test_utils.ts deleted file mode 100644 index 93dc1c7d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/test_utils.ts +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/** - * Testing utilities. - */ - -import {memory, Tensor, test_util, util} from '@tensorflow/tfjs-core'; -// tslint:disable-next-line: no-imports-from-dist -import {ALL_ENVS, describeWithFlags, registerTestEnv} from '@tensorflow/tfjs-core/dist/jasmine_util'; -import {ValueError} from '../errors'; - -// Register backends. -registerTestEnv({name: 'cpu', backendName: 'cpu'}); -registerTestEnv({ - name: 'webgl2', - backendName: 'webgl', - flags: { - 'WEBGL_VERSION': 2, - 'WEBGL_CPU_FORWARD': false, - 'WEBGL_SIZE_UPLOAD_UNIFORM': 0 - } -}); - -/** - * Expect values are close between a Tensor or number array. - * @param actual - * @param expected - */ -export function expectTensorsClose( - actual: Tensor|number[], expected: Tensor|number[], epsilon?: number) { - if (actual == null) { - throw new ValueError( - 'First argument to expectTensorsClose() is not defined.'); - } - if (expected == null) { - throw new ValueError( - 'Second argument to expectTensorsClose() is not defined.'); - } - if (actual instanceof Tensor && expected instanceof Tensor) { - if (actual.dtype !== expected.dtype) { - throw new Error( - `Data types do not match. Actual: '${actual.dtype}'. ` + - `Expected: '${expected.dtype}'`); - } - if (!util.arraysEqual(actual.shape, expected.shape)) { - throw new Error( - `Shapes do not match. Actual: [${actual.shape}]. ` + - `Expected: [${expected.shape}].`); - } - } - const actualData = actual instanceof Tensor ? actual.dataSync() : actual; - const expectedData = - expected instanceof Tensor ? expected.dataSync() : expected; - test_util.expectArraysClose(actualData, expectedData, epsilon); -} - -/** - * Expect values in array are within a specified range, boundaries inclusive. - * @param actual - * @param expected - */ -export function expectTensorsValuesInRange( - actual: Tensor, low: number, high: number) { - if (actual == null) { - throw new ValueError( - 'First argument to expectTensorsClose() is not defined.'); - } - test_util.expectValuesInRange(actual.dataSync(), low, high); -} - -/** - * Describe tests to be run on CPU and GPU. - * @param testName - * @param tests - */ -export function describeMathCPUAndGPU(testName: string, tests: () => void) { - describeWithFlags(testName, ALL_ENVS, () => { - tests(); - }); -} - -/** - * Describe tests to be run on CPU only. - * @param testName - * @param tests - */ -export function describeMathCPU(testName: string, tests: () => void) { - describeWithFlags( - testName, {predicate: testEnv => testEnv.backendName === 'cpu'}, () => { - tests(); - }); -} - -/** - * Describe tests to be run on GPU only. - * @param testName - * @param tests - */ -export function describeMathGPU(testName: string, tests: () => void) { - describeWithFlags( - testName, {predicate: testEnv => testEnv.backendName === 'webgl'}, () => { - tests(); - }); -} - -/** - * Check that a function only generates the expected number of new Tensors. - * - * The test function is called twice, once to prime any regular constants and - * once to ensure that additional copies aren't created/tensors aren't leaked. - * - * @param testFunc A fully curried (zero arg) version of the function to test. - * @param numNewTensors The expected number of new Tensors that should exist. - */ -export function expectNoLeakedTensors( - // tslint:disable-next-line:no-any - testFunc: () => any, numNewTensors: number) { - testFunc(); - const numTensorsBefore = memory().numTensors; - testFunc(); - const numTensorsAfter = memory().numTensors; - const actualNewTensors = numTensorsAfter - numTensorsBefore; - if (actualNewTensors !== numNewTensors) { - throw new ValueError( - `Created an unexpected number of new ` + - `Tensors. Expected: ${numNewTensors}, created : ${ - actualNewTensors}. ` + - `Please investigate the discrepency and/or use tidy.`); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts deleted file mode 100644 index 1d690a7e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -/* Original source: utils/generic_utils.py */ - -import {Tensor} from '@tensorflow/tfjs-core'; -import {ValueError} from '../errors'; -import {Shape} from '../keras_format/common'; -// tslint:enable - -/** - * Determine whether the input is an Array of Shapes. - */ -export function isArrayOfShapes(x: Shape|Shape[]): boolean { - return Array.isArray(x) && Array.isArray(x[0]); -} - -/** - * Special case of normalizing shapes to lists. - * - * @param x A shape or list of shapes to normalize into a list of Shapes. - * @return A list of Shapes. - */ -export function normalizeShapeList(x: Shape|Shape[]): Shape[] { - if (x.length === 0) { - return []; - } - if (!Array.isArray(x[0])) { - return [x] as Shape[]; - } - return x as Shape[]; -} - -/** - * Helper function to obtain exactly one Tensor. - * @param xs: A single `tf.Tensor` or an `Array` of `tf.Tensor`s. - * @return A single `tf.Tensor`. If `xs` is an `Array`, return the first one. - * @throws ValueError: If `xs` is an `Array` and its length is not 1. - */ -export function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor { - let x: Tensor; - if (Array.isArray(xs)) { - if (xs.length !== 1) { - throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`); - } - x = xs[0]; - } else { - x = xs; - } - return x; -} - -/** - * Helper function to obtain exactly on instance of Shape. - * - * @param shapes Input single `Shape` or Array of `Shape`s. - * @returns If input is a single `Shape`, return it unchanged. If the input is - * an `Array` containing exactly one instance of `Shape`, return the instance. - * Otherwise, throw a `ValueError`. - * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not - * 1. - */ -export function getExactlyOneShape(shapes: Shape|Shape[]): Shape { - if (Array.isArray(shapes) && Array.isArray(shapes[0])) { - if (shapes.length === 1) { - shapes = shapes as Shape[]; - return shapes[0]; - } else { - throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`); - } - } else { - return shapes as Shape; - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts deleted file mode 100644 index 2bf690007..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import {LayerVariable} from '../variables'; - -/** - * Count the elements in an Array of LayerVariables. - * - * @param weights: The LayerVariables of which the constituent numbers are to - * be counted. - * @returns A count of the elements in all the LayerVariables - */ -export function countParamsInWeights(weights: LayerVariable[]): number { - let count = 0; - for (const weight of weights) { - if (weight.shape.length === 0) { - count += 1; - } else { - count += weight.shape.reduce((a, b) => a * b); - } - } - return count; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/variables.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/variables.ts deleted file mode 100644 index b1ddc6489..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/variables.ts +++ /dev/null @@ -1,359 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC - * - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - * ============================================================================= - */ - -import * as tfc from '@tensorflow/tfjs-core'; -import {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core'; - -import {getNextUniqueTensorId} from './backend/state'; -import {getScopedTensorName, getUniqueTensorName} from './common'; -import {Constraint} from './constraints'; -import {NotImplementedError} from './errors'; -import {Shape} from './keras_format/common'; -import {HasShape} from './types'; - -const DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; - -/** - * A `tf.layers.LayerVariable` is similar to a `tf.Tensor` in that it has a - * dtype and shape, but its value is mutable. The value is itself represented - * as a`tf.Tensor`, and can be read with the `read()` method and updated with - * the `write()` method. - */ -export class LayerVariable { - readonly dtype: DataType; - readonly shape: Shape; - - readonly id: number; - // The fully scoped name of this Variable, including a unique suffix if needed - readonly name: string; - // The originally requested fully scoped name of this Variable, not including - // any unique suffix. This may be needed when restoring weights because this - // original name is used as a key. - readonly originalName: string; - private trainable_: boolean; - - protected readonly val: tfc.Variable; - readonly constraint: Constraint; - /** - * Construct Variable from a `tf.Tensor`. - * - * If not explicitly named, the Variable will be given a name with the - * prefix 'Variable'. Variable names are unique. In the case of name - * collision, suffixies '_' will be added to the name. - * - * @param val Initial value of the Variable. - * @param name Name of the variable. If `null` or `undefined` is provided, it - * will default a name with the prefix 'Variable'. - * @param constraint Optional, projection function to be applied to the - * variable after optimize updates - * @throws ValueError if `name` is `null` or `undefined`. - */ - constructor( - val: Tensor, dtype: DataType = 'float32', - name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true, - constraint: Constraint = null) { - this.dtype = dtype == null ? 'float32' : dtype; - this.shape = val.shape; - this.id = getNextUniqueTensorId(); - - name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; - this.originalName = getScopedTensorName(name); - this.name = getUniqueTensorName(this.originalName); - - this.trainable_ = trainable; - this.constraint = constraint; - - this.val = tfc.variable(val, this.trainable_, this.name, this.dtype); - } - - /** - * Get a snapshot of the Variable's value. - * - * The returned value is a snapshot of the Variable's value at the time of - * the invocation. Future mutations in the value of the tensor will only - * be reflected by future calls to this method. - */ - read(): Tensor { - this.assertNotDisposed(); - return this.val; - } - - /** - * Update the value of the Variable. - * - * @param newVal: The new value to update to. Must be consistent with the - * dtype and shape of the Variable. - * @return This Variable. - */ - write(newVal: Tensor) { - // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match. - this.assertNotDisposed(); - checkShapesMatch(this.val, newVal); - // Skip updating if this is the exact same tensor. - if (this.val.id !== newVal.id) { - this.val.assign(newVal); - if (this.constraint != null) { - this.val.assign(this.constraint.apply(this.val)); - } - } - return this; - } - - /** - * Dispose this LayersVariable instance from memory. - */ - dispose(): void { - this.assertNotDisposed(); - this.val.dispose(); - } - - protected assertNotDisposed(): void { - if (this.val.isDisposed) { - throw new Error(`LayersVariable ${this.name} is already disposed.`); - } - } - - get trainable(): boolean { - return this.trainable_; - } - - set trainable(trainable: boolean) { - this.trainable_ = trainable; - this.val.trainable = trainable; - } -} - -function checkShapesMatch(x: HasShape, y: HasShape): void { - if (x.shape.toString() !== y.shape.toString()) { - throw new Error( - 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + - JSON.stringify(y.shape)); - } -} - -/** - * Create a Variable. - * @param x The initial value of the `Variable`. - * @param dtype optional, the type of the variable. - * @param name optional, the name of the variable, default provided by - * Variable. - * @param constraint optional, a constraint to be applied after every update. - * @return The newly instantiated `Variable`. - */ -export function variable( - x: Tensor, dtype?: DataType, name?: string, - constraint?: Constraint): LayerVariable { - return new LayerVariable(x, dtype, name, true, constraint); -} - -/** - * Instantiates an all-zeros Variable and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-zero Variable. - */ -export function zerosVariable( - shape: Shape, dtype?: DataType, name?: string): LayerVariable { - // TODO(cais): Implement logic for dtype. - return new LayerVariable(tfc.zeros(shape), dtype, name); -} - -/** - * Instantiates an all-zeros tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export function zerosLike( - x: Tensor, dtype?: DataType, name?: string): LayerVariable { - return new LayerVariable(tfc.zerosLike(x), dtype, name); -} - -/** - * Instantiates an all-ones tensor and returns it. - * - * @param shape Shape of the tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return An all-ones Variable. - */ -export function onesVariable( - shape: Shape, dtype?: DataType, name?: string): LayerVariable { - // TODO(cais): Implement logic for dtype. - const allocated = tfc.ones(shape); - return new LayerVariable(allocated, dtype, name); -} - -/** - * Instantiates an all-ones tensor of the same shape as another tensor. - * - * @param x The other tensor. - * @param dtype DType of the tensor. - * @param name Name of the tensor. - * @return A newly instantiated Variable. - */ -export function onesLike( - x: Tensor, dtype?: DataType, name?: string): LayerVariable { - const allocated = tfc.onesLike(x); - return new LayerVariable(allocated, dtype, name); -} - -/** - * Instantiate an identity matrix and returns it, as a Variable - * - * @param size Number of rows/columns. - * @param dtype Data type of returned Variable. - * @param name Name of returned Variable. - * @return A Variable, an identity matrix. - */ -export function eyeVariable( - size: number, dtype?: DataType, name?: string): LayerVariable { - return new LayerVariable(tfc.eye(size), dtype, name); -} - -/** - * Get a Variable with uniform distribution of values. - * @param shape Shape of the tensor. - * @param minval Lower bound of the uniform distribution. - * @param maxval Upper bound of the uniform distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The uniform-random Variable. - */ -export function randomUniformVariable( - shape: Shape, minval: number, maxval: number, dtype?: DataType, - seed?: number, name = 'randomUniform'): LayerVariable { - return new LayerVariable( - tfc.randomUniform(shape, minval, maxval, dtype), dtype, name); -} - -/** - * Get a Variable with truncated-normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export function truncatedNormalVariable( - shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number, - name = 'truncatedNormal'): LayerVariable { - // TODO(cais): Implement logic for dtype and seed once they are supported - // by deeplearn.js. - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError( - `randomNormal does not support dType ${dtype}.`); - } - return new LayerVariable( - tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name); -} -/** - * Get a Variable with normal distribution of values. - * @param shape Shape of the tensor. - * @param mean mean value of the normal distribution. - * @param stddev standard deviation of the normal distribution. - * @param dtype - * @param seed - * @param name Optional name. - * @return The truncated-normal-random Variable. - */ -export function randomNormalVariable( - shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number, - name = 'randomNormal'): LayerVariable { - dtype = dtype || 'float32'; - if (dtype !== 'float32' && dtype !== 'int32') { - throw new NotImplementedError( - `randomNormalVariable does not support dType ${dtype}.`); - } - return new LayerVariable( - tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name); -} - -/** - * Update the value of a Variable. - * @param x The Variable to be updated. - * @param xNew The new value to update to. - * @return The Variable updated. - */ -export function update(x: LayerVariable, xNew: Tensor): LayerVariable { - return x.write(xNew); -} - -/** - * Update the value of a Variable by adding an increment. - * @param x The Variable to be updated. - * @param increment The incrment to add to `x`. - * @return The Variable updated. - */ -export function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable { - return x.write(tfc.add(x.read(), increment)); -} - -/** - * Update the value of a Variable by subtracting a decrement. - * @param x The Variable to be updated. - * @param decrement The decrement to subtract from `x`. - * @return The Variable updated. - */ -export function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable { - return x.write(tfc.sub(x.read(), decrement)); -} - -/** - * Get the values of an array of Variables. - * - * @param tensors An `Array` of `Variable`s to get the values of. - * @return The values of the inputs, as an `Array` of`tf.Tensor`s. - */ -export function batchGetValue(xs: LayerVariable[]): Tensor[] { - return xs.map(x => x.read()); -} - -/** - * Update the value of multiple Variables at once. - * - * @param variablesAndValues An `Array`, each element is of type - * [Variable, Tensor]. The first item is the - * `Variable` of which the value is to be updated. The second item - * carries the new value. - */ -export function batchSetValue( - variablesAndValues: Array<[LayerVariable, Tensor]>): void { - variablesAndValues.forEach(variableAndValue => { - const variable: LayerVariable = variableAndValue[0]; - variable.write(variableAndValue[1]); - }); -} - -/** - * Returns the gradients of `variables` w.r.t. the return value of `lossFn`. - * @param lossFn A function which returns a Scalar to be used as the function - * value (i.e., numerator) for differentiation. - * @param variables List of variables to be used as the independent variables - * (i.e., denominator) for differentiation. - * @returns An Array of gradients tensors. - */ -export function gradients( - lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] { - // TODO(cais): The return type signature can be simplified if deeplearn makes - // the corresponding type public. - const variableList = - variables.map(variable => variable.read() as tfc.Variable); - const valudAndGrads = variableGrads(lossFn, variableList); - return variables.map(variable => valudAndGrads.grads[variable.name]); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/version.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/version.ts deleted file mode 100644 index 4d1223e8a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/src/version.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** @license See the LICENSE file. */ - -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; -export {version}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/tsconfig.test.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-layers/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-layers/tsconfig.test.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../tsconfig.test", - "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-node/.bazelversion b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.bazelversion deleted file mode 100644 index 2094a100c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -0.24.0 diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.nycrc b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.nycrc deleted file mode 100644 index e99df8422..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/.nycrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extension": [ - ".ts" - ], - "reporter": [ - "html", - "text-summary" - ], - "include": [ - "src/**/*" - ], - "exclude": [ - "src/run_tests.ts", - "src/**/*_test.ts", - "src/proto/*" - ], - "cache": false, - "sourceMap": true, - "instrument": true -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/DEVELOPMENT.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/DEVELOPMENT.md deleted file mode 100644 index 5d445630a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/DEVELOPMENT.md +++ /dev/null @@ -1,117 +0,0 @@ -# TensorFlow.js Node.js bindings development. - -The @tensorflow/tfjs-node repo supports npm package @tensorflow/tfjs-node and @tensorflow/tfjs-node-gpu on Windows/Mac/Linux. This guide lists commands to use when developing this package. - -## Install - -#### Dependencies and addon module - -```sh -$ yarn -``` - -This command installs all dependencies and devDependencies listed in package.json. It also downloads the TensorFlow C library and native node addon. - -#### Compile native addon from source files - -```sh -$ yarn build-addon-from-source -``` - -This command will compile a new native node addon from source files. - -#### - -```sh -$ yarn install-from-source -``` - -This command does the following: - -1. Clears local binary and addon resources -2. Downloads the TensorFlow C library -3. Compiles the native addon from source files (instead of downloading pre-compile addon) - -#### Switching local workflow to CUDA/GPU - -```sh -$ yarn enable-gpu -``` - -This command is the same as `yarn install-from-source` except it uses the TensorFlow GPU library. - -## Build and test - -#### Compile javascript files from typescript - -```sh -$ yarn build -``` - -#### Publish locally through yalc to test this package in another repo - -```sh -$ yarn publish-local -``` - -This command packs the `tfjs-node` package and publishes locally through [yalc](https://github.com/whitecolor/yalc). -NOTE: Dependent packages must install this locally published package through yalc and compile the node native addon locally. In the dependent package run the following command to link local published `tfjs-node` package: - -```sh -$ yalc link @tensorflow/tfjs-node -$ cd .yalc/@tensorflow/tfjs-node -$ yarn && yarn build-addon-from-source -$ cd ../../.. -``` - -#### Run tests - -```sh -$ yarn test -``` - -## Prepare and publish - -#### Prerequisite: install GCP command line tool - -Publishing this package requires uploading objects to GCP bucket. Developers need to install GCP command line tool [gsutil](https://cloud.google.com/storage/docs/gsutil_install) before publishing. Please ask TFJS developers for GCP project ID. - -#### Build and upload node addon to Google Cloud Platform - -```sh -$ yarn build-addon cpu for-publish -``` - -This command will compile, compress, and upload a new node addon to GCP bucket. Please read [build-and-upload-addon.sh](./scripts/build-and-upload-addon.sh) for details. - -#### Build NPM package - -```sh -$ yarn build-npm -``` - -This command will build a new version of tfjs-node/tfjs-node-gpu NPM tarball. NOTE: this command does not update the pre-compiled node addon to GCP (see `yarn build-addon upload`). - -#### Build NPM package and upload node addon - -```sh -$ yarn build-npm upload -``` - -This command combines the above two commands. - -#### Publish NPM package - -```sh -$ yarn publish-npm -``` - -This command compiles a new node addon, upload it to GCP, then builds and publishes a new npm package. Please read instruction in [publish-npm.sh](./scripts/publish.sh) before publishing. - -#### Build and upload node addon on Windows - -```sh -$ yarn upload-windows-addon -``` - -Most times the NPM package is published on Linux machine, and only the Linux node addon is compiled and uploaded to GCP bucket. To build and upload the native node addon for Windows, developers should run the above commands on Windows machine. Please read [build-and-upload-windows-addon.bat](./scripts/build-and-upload-windows-addon.bat) for details. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/README.md deleted file mode 100644 index 18a6a69fc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# TensorFlow backend for TensorFlow.js via Node.js -This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, -accelerated by the TensorFlow C binary under the hood. It provides the same API as [TensorFlow.js](https://js.tensorflow.org/api/latest/). - -This package will work on Linux, Windows, and Mac platforms where TensorFlow is supported. - -## Installing - -TensorFlow.js for Node currently supports the following platforms: -- Mac OS X CPU (10.12.6 Siera or higher) -- Linux CPU (Ubuntu 14.04 or higher) -- Linux GPU (Ubuntu 14.04 or higher and Cuda 10.0 w/ CUDNN v7) ([see installation instructions](https://www.tensorflow.org/install/gpu#software_requirements)) -- Windows CPU (Win 7 or higher) -- Windows GPU (Win 7 or higher and Cuda 10.0 w/ CUDNN v7) ([see installation instructions](https://www.tensorflow.org/install/gpu#windows_setup)) - -For GPU support, tfjs-node-gpu@1.2.4 or later requires the following NVIDIA® software installed on your system: - -| Name | Version | -| ------------- | ------------- | -| [NVIDIA® GPU drivers](https://www.nvidia.com/Download/index.aspx?lang=en-us) | >410.x | -| [CUDA® Toolkit](https://developer.nvidia.com/cuda-10.0-download-archive) | 10.0 | -| [cuDNN SDK](https://developer.nvidia.com/rdp/cudnn-download) | >=7.4.1 | - -*Other Linux variants might also work but this project matches [core TensorFlow installation requirements](https://www.tensorflow.org/install/install_linux).* - -#### Installing CPU TensorFlow.js for Node: - -```sh -npm install @tensorflow/tfjs-node -(or) -yarn add @tensorflow/tfjs-node -``` - -#### Installing Linux/Windows GPU TensorFlow.js for Node: - -```sh -npm install @tensorflow/tfjs-node-gpu -(or) -yarn add @tensorflow/tfjs-node-gpu -``` - -#### Windows / Mac OS X Requires Python 2.7 - -Windows & OSX build support for `node-gyp` requires Python 2.7. Be sure to have this version before installing `@tensorflow/tfjs-node` or `@tensorflow/tfjs-node-gpu`. Machines with Python 3.x will not install the bindings properly. - -*For more troubleshooting on Windows, check out [WINDOWS_TROUBLESHOOTING.md](./WINDOWS_TROUBLESHOOTING.md).* - -#### Mac OS X Requires Xcode - -If you do not have Xcode setup on your machine, please run the following commands: - -```sh -$ xcode-select --install -``` -For Mac OS Catalina please follow [this guide](https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#installing-node-gyp-using-the-xcode-command-line-tools-via-manual-download) to install node-gyp. - -After that operation completes, re-run `yarn add` or `npm install` for the `@tensorflow/tfjs-node` package. - -You only need to include `@tensorflow/tfjs-node` or `@tensorflow/tfjs-node-gpu` in the package.json file, since those packages ship with `@tensorflow/tfjs` already. - -#### Rebuild the package on Raspberry Pi - -To use this package on Raspberry Pi, you need to rebuild the node native addon with the following command after you installed the package: - -```sh -$ npm rebuild @tensorflow/tfjs-node --build-from-source -``` - -#### Custom binaries URI - -If you happen to be using a mirror for the libtensorflow binaries (default is [https://storage.googleapis.com/]), you have 3 options (in order of priority): - -1. Set the environment variable `TFJS_NODE_CDN_STORAGE`. This has the same behavior as `CDN_STORAGE`, but introduced to prevent collisions with other npm packages that might use `CDN_STORAGE`. - -```sh -TFJS_NODE_CDN_STORAGE="https://yourmirrorofchoice.com/" npm install -(or) -TFJS_NODE_CDN_STORAGE="https://yourmirrorofchoice.com/" yarn install -``` - -2. Add the variable `TFJS_NODE_CDN_STORAGE` to your `.npmrc` file. - -``` -TFJS_NODE_CDN_STORAGE=https://yourmirrorofchoice.com/ -``` - -3. Set the environment variable `CDN_STORAGE`. This option is deprecated in favor of the `TFJS_NODE_` prefix version above and will be removed in a future release. - -```sh -CDN_STORAGE="https://yourmirrorofchoice.com/" npm install -(or) -CDN_STORAGE="https://yourmirrorofchoice.com/" yarn install -``` - -If your "mirror" uses a custom URI path that doesn't match the default, you have 2 options (in order of priority): - -1. Set the environment variable `TFJS_NODE_BASE_URI` - -```sh -TFJS_NODE_BASE_URI="https://yourhost.com/your/path/libtensorflow-" npm install -(or) -TFJS_NODE_BASE_URI="https://yourhost.com/your/path/libtensorflow-" yarn install -``` - -2. Add the variable `TFJS_NODE_BASE_URI` to your `.npmrc` file - -``` -TFJS_NODE_BASE_URI=https://yourhost.com/your/path/libtensorflow- -``` - -## Using the binding - -Before executing any TensorFlow.js code, import the node package: - -```js -// Load the binding -const tf = require('@tensorflow/tfjs-node'); - -// Or if running with GPU: -const tf = require('@tensorflow/tfjs-node-gpu'); -``` - -Note: you do not need to add the `@tensorflow/tfjs` package to your dependencies or import it directly. - -## Development - -```sh -# Download and install JS dependencies, including libtensorflow 1.8. -yarn - -# Run TFJS tests against Node.js backend: -yarn test -``` - -```sh -# Switch to GPU for local development: -yarn enable-gpu -``` - - -## MNIST demo for Node.js - -See the [tfjs-examples repository](https://github.com/tensorflow/tfjs-examples/tree/master/mnist-node) for training the MNIST dataset using the Node.js bindings. - -### Optional: Build optimal TensorFlow from source - -To get the most optimal TensorFlow build that can take advantage of your specific hardware (AVX512, MKL-DNN), you can build the `libtensorflow` library from source: -- [Install bazel](https://docs.bazel.build/versions/master/install.html) -- Checkout the [main tensorflow repo](https://github.com/tensorflow/tensorflow) and follow the instructions in [here](https://www.tensorflow.org/install/source) with **one difference**: instead of building the pip package, build `libtensorflow`: - -```sh -./configure -bazel build --config=opt --config=monolithic //tensorflow/tools/lib_package:libtensorflow -``` - -The build might take a while and will produce a `bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz` file, which should be unpacked and replace the files in `deps` folder of `tfjs-node` repo: -```sh -cp bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz ~/myproject/node_modules/@tensorflow/tfjs-node/deps -cd path-to-my-project/node_modules/@tensorflow/tfjs-node/deps -tar -xf libtensorflow.tar.gz -``` - -If you want to publish an addon library with your own libtensorflow binary, you can host the custom libtensorflow binary and optional pre-compiled node addon module on the cloud service you choose, and add a `custom-binary.json` file in `scripts` folder with the following information: - -```js -{ - "tf-lib": "url-to-download-customized-binary", - "addon": { - "host": "host-of-pre-compiled-addon", - "remote_path": "remote-path-of-pre-compiled-addon", - "package_name": "file-name-of-pre-compile-addon" - } -} -``` - -The installation scripts will automatically catch this file and use the custom libtensorflow binary and addon. If `addon` is not provided, the installation script will compile addon from source. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/WINDOWS_TROUBLESHOOTING.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/WINDOWS_TROUBLESHOOTING.md deleted file mode 100644 index 6d3b37aba..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/WINDOWS_TROUBLESHOOTING.md +++ /dev/null @@ -1,54 +0,0 @@ -# TensorFlow.js Node.js bindings Windows troubleshooting. - -The tfjs-node package uses the [node-gyp](https://github.com/nodejs/node-gyp) package to handle cross-compiling the C++ code required to bind TensorFlow to Node.js. This cross platform solution can be somewhat tricky on Windows platforms. This guide helps reference solutions that have been triaged through Issues on the main [tfjs repo](https://github.com/tensorflow/tfjs). - -## Ensure Python 2.x is installed - -Currently, node-gyp requires Python 2.x to work properly. If Python 3.x is installed, you will see build failures. Also double check your python version `python --version` and update the Windows `$PATH` as needed. - -## 'The system cannot find the patch specified' Exceptions - -This can happen for a variety of reasons. First, to inspect what is missing either `cd node_modules/@tensorflow/tfjs-node` or clone the [tensorflow/tfjs repo](https://github.com/tensorflow/tfjs). - -After `cd`'ing or cloning, run the following command (you might need node-gyp installed globablly `npm install -g node-gyp`): - -```sh -node-gyp configure --verbose -``` - -### Missing `python2` - -From the verbose output, if you see something like: - -```sh -gyp verb check python checking for Python executable "python2" in the PATH -gyp verb `which` failed Error: not found: python2 -``` - -This means that node-gyp expects a 'python2' exe somewhere in `%PATH%`. Try running this command from an Admin (elevated privilaged prompt): - -You can try running this from an Adminstrative prompt: - -```sh -$ npm --add-python-to-path='true' --debug install --global windows-build-tools -``` - -### Something else? - -If another missing component shows up - please file an issue on [tensorflow/tfjs](https://github.com/tensorflow/tfjs/issues/new) with the output from the `node-gyp configure --verbose` command. - -## msbuild.exe Exceptions - -Check the full stack trace from `npm install` (or `yarn`) command. If you see something like: - -``` -gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 -``` - -You might need to install the system tools manually. This can be done via: - -``` -npm install -g --production windows-build-tools -``` - -If that still does not work - try re-running the command above in a privileged shell. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding.gyp b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding.gyp deleted file mode 100644 index f335ffcde..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding.gyp +++ /dev/null @@ -1,108 +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. -# ============================================================================= - -# Node.js TensorFlow Binding config: -{ - 'variables' : { - 'tensorflow_include_dir' : '<(module_root_dir)/deps/include', - 'tensorflow_headers' : [ - '<@(tensorflow_include_dir)/tensorflow/c/c_api.h', - '<@(tensorflow_include_dir)/tensorflow/c/eager/c_api.h', - ], - 'tensorflow-library-action': 'move' - }, - 'targets' : [{ - 'target_name' : 'tfjs_binding', - 'sources' : [ - 'binding/tfjs_backend.cc', - 'binding/tfjs_binding.cc' - ], - 'include_dirs' : [ '..', '<(tensorflow_include_dir)' ], - 'conditions' : [ - [ - 'OS=="linux"', { - 'libraries' : [ - '-Wl,-rpath,\$$ORIGIN/../../deps/lib', - '-ltensorflow', - '-ltensorflow_framework', - ], - 'library_dirs' : ['<(module_root_dir)/deps/lib'], - } - ], - [ - 'OS=="mac"', { - 'libraries' : [ - '<(module_root_dir)/deps/lib/libtensorflow.2.dylib', - '<(module_root_dir)/deps/lib/libtensorflow_framework.2.dylib', - ], - 'postbuilds': [ - { - 'postbuild_name': 'Adjust libtensorflow load path', - 'action': [ - 'install_name_tool', - "-change", - "@rpath/libtensorflow.2.dylib", - "@loader_path/../../deps/lib/libtensorflow.dylib", - "<(PRODUCT_DIR)/tfjs_binding.node" - ] - }, - { - 'postbuild_name': 'Adjust libtensorflow_framework load path', - 'action': [ - 'install_name_tool', - "-change", - "@rpath/libtensorflow_framework.2.dylib", - "@loader_path/../../deps/lib/libtensorflow_framework.2.dylib", - "<(PRODUCT_DIR)/tfjs_binding.node" - ] - } - ], - } - ], - [ - 'OS=="win"', { - 'defines': ['COMPILER_MSVC'], - 'libraries': ['tensorflow'], - 'library_dirs' : ['<(module_root_dir)/deps/lib'], - 'variables': { - 'tensorflow-library-target': 'windows' - }, - 'msvs_disabled_warnings': [ - # Warning C4190: 'TF_NewWhile' has C-linkage specified, but returns - # UDT 'TF_WhileParams' which is incompatible with C. - # (in include/tensorflow/c/c_api.h) - 4190 - ] - }, - ] - ], - } - , { - "target_name": "action_after_build", - "type": "none", - "dependencies": [ "<(module_name)" ], - "copies": [ - { - "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], - "destination": "<(module_path)" - } - ] - } - ], - "defines": [ - "NAPI_VERSION=<(napi_build_version)" - ] -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/napi_auto_ref.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/napi_auto_ref.h deleted file mode 100644 index 07f69d230..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/napi_auto_ref.h +++ /dev/null @@ -1,70 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_NAPI_AUTO_REF_H_ -#define TF_NODEJS_NAPI_AUTO_REF_H_ - -#include -#include "utils.h" - -namespace tfnodejs { - -// Helper class to automatically cleanup napi_ref instances. -class NapiAutoRef { - public: - NapiAutoRef() : env_(nullptr), ref_(nullptr) {} - - napi_status Init(napi_env env, napi_value value) { - env_ = env; - return napi_create_reference(env_, value, 1, &ref_); - } - - napi_status Cleanup() { - if (!env_ || !ref_) { -#if DEBUG - NAPI_THROW_ERROR(env_, "Uninitialized reference attempted to cleanup"); -#endif - return napi_invalid_arg; - } - - napi_status nstatus = napi_delete_reference(env_, ref_); - env_ = nullptr; - ref_ = nullptr; - return nstatus; - } - - virtual ~NapiAutoRef() { - if (env_) { -#if DEBUG - NAPI_THROW_ERROR(env_, "Non-cleaned up napi_env instance"); -#endif - } - if (ref_) { -#if DEBUG - NAPI_THROW_ERROR(env_, "Non-cleaned up napi_ref instance"); -#endif - } - } - - private: - napi_env env_; - napi_ref ref_; -}; - -} // namespace tfnodejs - -#endif // TF_NODEJS_NAPI_AUTO_REF_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_status.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_status.h deleted file mode 100644 index 81b512fca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_status.h +++ /dev/null @@ -1,36 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_TF_AUTO_STATUS_H_ -#define TF_NODEJS_TF_AUTO_STATUS_H_ - -#include "tensorflow/c/c_api.h" - -namespace tfnodejs { - -// Automatically cleans up a TF_Status instance. -class TF_AutoStatus { - public: - TF_AutoStatus() : status(TF_NewStatus()) {} - virtual ~TF_AutoStatus() { TF_DeleteStatus(status); } - - TF_Status* status; -}; - -} // namespace tfnodejs - -#endif // TF_NODEJS_TF_AUTO_STATUS_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_tensor.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_tensor.h deleted file mode 100644 index ee8229335..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tf_auto_tensor.h +++ /dev/null @@ -1,36 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_TF_AUTO_TENSOR_H_ -#define TF_NODEJS_TF_AUTO_TENSOR_H_ - -#include "tensorflow/c/c_api.h" - -namespace tfnodejs { - -// Automatically cleans up a TF_Tensor instance. -class TF_AutoTensor { - public: - TF_AutoTensor(TF_Tensor* tensor) : tensor(tensor) {} - virtual ~TF_AutoTensor() { TF_DeleteTensor(tensor); } - - TF_Tensor* tensor; -}; - -} // namespace tfnodejs - -#endif // TF_NODEJS_TF_AUTO_TENSOR_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfe_auto_op.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfe_auto_op.h deleted file mode 100644 index 1b43fa490..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfe_auto_op.h +++ /dev/null @@ -1,36 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_TFE_AUTO_OP_H_ -#define TF_NODEJS_TFE_AUTO_OP_H_ - -#include "tensorflow/c/eager/c_api.h" - -namespace tfnodejs { - -// Automatically cleans up a TF_Op instance. -class TFE_AutoOp { - public: - TFE_AutoOp(TFE_Op* op) : op(op) {} - virtual ~TFE_AutoOp() { TFE_DeleteOp(op); } - - TFE_Op* op; -}; - -} // namespace tfnodejs - -#endif // TF_NODEJS_TFE_AUTO_OP_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.cc b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.cc deleted file mode 100644 index fc2f7f6d4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.cc +++ /dev/null @@ -1,1192 +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. - * ============================================================================= - */ - -#include "tfjs_backend.h" - -#include -#include -#include -#include -#include -#include "napi_auto_ref.h" -#include "tf_auto_tensor.h" -#include "tfe_auto_op.h" -#include "utils.h" - -namespace tfnodejs { - -// Used to hold strings beyond the lifetime of a JS call. -static std::set ATTR_NAME_SET; - -// Callback to cleanup extra reference count for shared V8/TF tensor memory: -static void DeallocTensor(void *data, size_t len, void *arg) { - NapiAutoRef *auto_ref = static_cast(arg); - if (!auto_ref) { -#if DEBUG - fprintf(stderr, "Invalid NapiAutoRef reference passed to V8 cleanup\n"); -#endif - return; - } - if (auto_ref->Cleanup() != napi_ok) { -#if DEBUG - fprintf(stderr, "Exception cleaning up napi_ref instance\n"); -#endif - } - delete auto_ref; -} - -// Creates a TFE_TensorHandle from a JS typed array. -TFE_TensorHandle *CreateTFE_TensorHandleFromTypedArray(napi_env env, - int64_t *shape, - uint32_t shape_length, - TF_DataType dtype, - napi_value array_value) { - napi_status nstatus; - napi_typedarray_type array_type; - size_t array_length; - void *array_data; - nstatus = - napi_get_typedarray_info(env, array_value, &array_type, &array_length, - &array_data, nullptr, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Double check the underlying TF_Tensor type matches the supplied - // typed-array. - size_t width = 0; - switch (array_type) { - case napi_float32_array: - if (dtype != TF_FLOAT) { - NAPI_THROW_ERROR(env, "Tensor type does not match Float32Array"); - return nullptr; - } - width = sizeof(float); - break; - case napi_int32_array: - if (dtype != TF_INT32 && dtype != TF_INT64) { - // Currently, both int32- and int64-type Tensors are represented - // as Int32Arrays in JavaScript. See int64_tensors.ts for details - // about the latter. - NAPI_THROW_ERROR(env, "Tensor type does not match Int32Array"); - return nullptr; - } - width = sizeof(int32_t); - break; - case napi_uint8_array: - if (dtype != TF_BOOL && dtype != TF_UINT8) { - NAPI_THROW_ERROR(env, "Tensor type does not match Uint8Array"); - return nullptr; - } - width = sizeof(uint8_t); - break; - default: - REPORT_UNKNOWN_TYPED_ARRAY_TYPE(env, array_type); - return nullptr; - } - - // Double check that width matches TF data type size: - if (dtype == TF_INT64) { - // Currently, int64-type Tensors are represented as Int32Arrays. So the - // logic for comparing the byte size of the typed-array representation and - // the byte size of the tensor dtype needs to be special-cased for int64. - if (width * 2 != TF_DataTypeSize(dtype)) { - NAPI_THROW_ERROR( - env, - "Byte size of elements differs between JavaScript VM " - "(%zu * 2 = %zu) and TensorFlow (%zu) for int64-type tensor", - width, width * 2, TF_DataTypeSize(dtype)); - return nullptr; - } - } else { - if (width != TF_DataTypeSize(dtype)) { - NAPI_THROW_ERROR(env, - "Byte size of elements differs between JavaScript VM " - "(%zu) and TensorFlow (%zu)", - width, TF_DataTypeSize(dtype)); - return nullptr; - } - } - - // Determine the size of the buffer based on the dimensions. - size_t num_elements = 1; - for (size_t i = 0; i < shape_length; i++) { - num_elements *= shape[i]; - } - - // Ensure the shape matches the length of the passed in typed-array. - if (dtype == TF_INT64) { - // Currently, int64-type Tensors are represented as Int32Arrays. - // To represent a int64-type Tensor of `n` elements, an Int32Array of - // length `2 * n` is requried. This is why the length-match checking - // logic is special-cased for int64. - if (array_length != num_elements * 2) { - NAPI_THROW_ERROR( - env, - "Shape does not match two times typed-array in bindData() " - "(num_elements * 2 = %zu, array_length=%zu) for int64 data type", - num_elements * 2, array_length); - return nullptr; - } - } else { - if (num_elements != array_length) { - NAPI_THROW_ERROR(env, - "Shape does not match typed-array in bindData() " - "(num_elements=%zu, array_length=%zu)", - num_elements, array_length); - return nullptr; - } - } - - // Sharing V8 memory with the underlying TensorFlow tensor requires adding an - // additional refcount. When the Tensor is deleted, the refcount will be - // reduced in the callback helper. - NapiAutoRef *auto_ref = new NapiAutoRef(); - nstatus = auto_ref->Init(env, array_value); - if (nstatus != napi_ok) { - delete auto_ref; - } - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Currently, int64-type Tensors are represented as Int32Arrays. - // So the logic for comparing the byte size of the typed-array representation - // and the byte size of the tensor dtype needs to be special-cased for int64. - const size_t byte_size = - dtype == TF_INT64 ? num_elements * width * 2 : num_elements * width; - - TF_AutoTensor tensor(TF_NewTensor(dtype, shape, shape_length, array_data, - byte_size, DeallocTensor, auto_ref)); - - TF_AutoStatus tf_status; - TFE_TensorHandle *tfe_tensor_handle = - TFE_NewTensorHandle(tensor.tensor, tf_status.status); - if (TF_GetCode(tf_status.status) != TF_OK) { - delete auto_ref; - TFE_DeleteTensorHandle(tfe_tensor_handle); - } - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - - return tfe_tensor_handle; -} - -// Creates a TFE_TensorHandle from a JS array of Uint8Array values. -TFE_TensorHandle *CreateTFE_TensorHandleFromStringArray( - napi_env env, int64_t *shape, uint32_t shape_length, TF_DataType dtype, - napi_value array_value) { - napi_status nstatus; - - uint32_t array_length; - nstatus = napi_get_array_length(env, array_value, &array_length); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - TF_AutoTensor tensor(TF_AllocateTensor(TF_DataType::TF_STRING, shape, - shape_length, - array_length * sizeof(TF_TString))); - - TF_TString *t = reinterpret_cast(TF_TensorData(tensor.tensor)); - - for (uint32_t i = 0; i < array_length; ++i) { - napi_value cur_value; - nstatus = napi_get_element(env, array_value, i, &cur_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - ENSURE_VALUE_IS_TYPED_ARRAY_RETVAL(env, cur_value, nullptr); - - napi_typedarray_type array_type; - size_t cur_array_length; - void *buffer = nullptr; - - nstatus = - napi_get_typedarray_info(env, cur_value, &array_type, &cur_array_length, - &buffer, nullptr, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - // Only Uint8 typed arrays are supported. - if (array_type != napi_uint8_array) { - NAPI_THROW_ERROR(env, "Unsupported array type - expecting Uint8Array"); - return nullptr; - } - - TF_TString_Init(t); - TF_TString_Copy(t, reinterpret_cast(buffer), cur_array_length); - t += 1; - } - - TF_AutoStatus tf_status; - - TFE_TensorHandle *tfe_tensor_handle = - TFE_NewTensorHandle(tensor.tensor, tf_status.status); - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - return tfe_tensor_handle; -} - -TFE_TensorHandle *CreateTFE_TensorHandleFromJSValues(napi_env env, - int64_t *shape, - uint32_t shape_length, - TF_DataType dtype, - napi_value array_value) { - bool is_typed_array; - napi_status nstatus = napi_is_typedarray(env, array_value, &is_typed_array); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - if (is_typed_array) { - return CreateTFE_TensorHandleFromTypedArray(env, shape, shape_length, dtype, - array_value); - } else { - return CreateTFE_TensorHandleFromStringArray(env, shape, shape_length, - dtype, array_value); - } -} - -TFE_TensorHandle *CopyTFE_TensorHandleToDevice(napi_env env, - const char *device_name, - TFE_TensorHandle *handle, - TFE_Context *tfe_context) { - TF_AutoStatus tf_status; - - TFE_TensorHandle *new_handle = TFE_TensorHandleCopyToDevice( - handle, tfe_context, device_name, tf_status.status); - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - - return new_handle; -} - -void CopyTFE_TensorHandleDataToTypedArray(napi_env env, - TFE_Context *tfe_context, - TFE_TensorHandle *tfe_tensor_handle, - TF_DataType tensor_data_type, - napi_typedarray_type array_type, - napi_value *result) { - TF_AutoStatus tf_status; - - TF_AutoTensor tensor( - TFE_TensorHandleResolve(tfe_tensor_handle, tf_status.status)); - ENSURE_TF_OK(env, tf_status); - - // Determine the length of the array based on the shape of the tensor. - size_t num_elements = GetTensorNumElements(tensor.tensor); - - if (tensor_data_type == TF_COMPLEX64) { - // Dimension length will be double for Complex 64. - num_elements *= 2; - } - - size_t byte_length = TF_TensorByteSize(tensor.tensor); - - napi_value array_buffer_value; - void *array_buffer_data; - napi_status nstatus; - nstatus = napi_create_arraybuffer(env, byte_length, &array_buffer_data, - &array_buffer_value); - ENSURE_NAPI_OK(env, nstatus); - - // TFE_TensorHandleResolve can use a shared data pointer, memcpy() the - // current value to the newly allocated NAPI buffer. - memcpy(array_buffer_data, TF_TensorData(tensor.tensor), byte_length); - - nstatus = napi_create_typedarray(env, array_type, num_elements, - array_buffer_value, 0, result); - ENSURE_NAPI_OK(env, nstatus); -} - -void CopyTFE_TensorHandleDataToStringArray(napi_env env, - TFE_Context *tfe_context, - TFE_TensorHandle *tfe_tensor_handle, - napi_value *result) { - TF_AutoStatus tf_status; - - TF_AutoTensor tensor( - TFE_TensorHandleResolve(tfe_tensor_handle, tf_status.status)); - ENSURE_TF_OK(env, tf_status); - - if (TF_TensorType(tensor.tensor) != TF_STRING) { - NAPI_THROW_ERROR(env, "Tensor is not of type TF_STRING"); - return; - } - - size_t num_elements = TF_TensorElementCount(tensor.tensor); - - TF_TString *ts = static_cast(TF_TensorData(tensor.tensor)); - TF_AutoStatus status; - - // Create a JS string to stash strings into - napi_status nstatus; - nstatus = napi_create_array_with_length(env, num_elements, result); - - for (uint64_t i = 0; i < num_elements; i++) { - napi_value array_buffer_value; - - const char *raw_string = TF_TString_GetDataPointer(ts); - size_t raw_string_size = TF_TString_GetSize(ts); - void *array_buffer_data; - nstatus = napi_create_arraybuffer(env, raw_string_size, &array_buffer_data, - &array_buffer_value); - ENSURE_NAPI_OK(env, nstatus); - - memcpy(array_buffer_data, raw_string, raw_string_size); - - napi_value typed_array_value; - nstatus = napi_create_typedarray(env, napi_uint8_array, raw_string_size, - array_buffer_value, 0, &typed_array_value); - ENSURE_NAPI_OK(env, nstatus); - - nstatus = napi_set_element(env, *result, i, typed_array_value); - ENSURE_NAPI_OK(env, nstatus); - - ts += 1; - } -} - -void CopyTFE_TensorHandleDataToResourceArray( - napi_env env, TFE_Context *tfe_context, TFE_TensorHandle *tfe_tensor_handle, - napi_value *result) { - TF_AutoStatus tf_status; - - TF_AutoTensor tensor( - TFE_TensorHandleResolve(tfe_tensor_handle, tf_status.status)); - ENSURE_TF_OK(env, tf_status); - - if (TF_TensorType(tensor.tensor) != TF_RESOURCE) { - NAPI_THROW_ERROR(env, "Tensor is not of type TF_RESOURCE"); - return; - } - - void *tensor_data = TF_TensorData(tensor.tensor); - ENSURE_VALUE_IS_NOT_NULL(env, tensor_data); - - size_t num_elements = GetTensorNumElements(tensor.tensor); - if (num_elements != 1) { - NAPI_THROW_ERROR(env, - "For DT_RESOURCE tensors, Node.js binding currently " - "supports only exactly 1 element, but encountered " - "DT_RESOURCE tensor with %zu elements.", - num_elements); - } - - TF_AutoStatus status; - - // Create a JS string to stash the resouce handle into. - napi_status nstatus; - size_t byte_length = TF_TensorByteSize(tensor.tensor); - nstatus = napi_create_array_with_length(env, byte_length, result); - ENSURE_NAPI_OK(env, nstatus); - - napi_value array_buffer_value; - void *array_buffer_data = nullptr; - nstatus = napi_create_arraybuffer(env, byte_length, &array_buffer_data, - &array_buffer_value); - ENSURE_NAPI_OK(env, nstatus); - - // TFE_TensorHandleResolve can use a shared data pointer, memcpy() the - // current value to the newly allocated NAPI buffer. - memcpy(array_buffer_data, tensor_data, byte_length); - - // This method will only return uint8 arrays. - nstatus = napi_create_typedarray(env, napi_uint8_array, byte_length, - array_buffer_value, 0, result); - ENSURE_NAPI_OK(env, nstatus); -} - -// Handles converting the stored TF_Tensor data into the correct JS value. -void CopyTFE_TensorHandleDataToJSData(napi_env env, TFE_Context *tfe_context, - TFE_TensorHandle *tfe_tensor_handle, - napi_value *result) { - if (tfe_context == nullptr) { - NAPI_THROW_ERROR(env, "Invalid TFE_Context"); - return; - } - if (tfe_tensor_handle == nullptr) { - NAPI_THROW_ERROR(env, "Invalid TFE_TensorHandle"); - return; - } - - // Determine the type of the array - napi_typedarray_type typed_array_type; - bool is_string = false; - bool is_resource = false; - TF_DataType tensor_data_type = TFE_TensorHandleDataType(tfe_tensor_handle); - switch (tensor_data_type) { - case TF_COMPLEX64: - case TF_FLOAT: - typed_array_type = napi_float32_array; - break; - case TF_INT32: - typed_array_type = napi_int32_array; - break; - case TF_INT64: - typed_array_type = napi_bigint64_array; - break; - case TF_BOOL: - typed_array_type = napi_uint8_array; - break; - case TF_STRING: - is_string = true; - break; - case TF_RESOURCE: - // We currently represent a resource handle as an `Uint8Array`. - typed_array_type = napi_uint8_array; - is_resource = true; - break; - default: - REPORT_UNKNOWN_TF_DATA_TYPE(env, - TFE_TensorHandleDataType(tfe_tensor_handle)); - return; - } - - if (is_string) { - CopyTFE_TensorHandleDataToStringArray(env, tfe_context, tfe_tensor_handle, - result); - } else if (is_resource) { - CopyTFE_TensorHandleDataToResourceArray(env, tfe_context, tfe_tensor_handle, - result); - } else { - CopyTFE_TensorHandleDataToTypedArray(env, tfe_context, tfe_tensor_handle, - tensor_data_type, typed_array_type, - result); - } -} - -void GetTFE_TensorHandleShape(napi_env env, TFE_TensorHandle *handle, - napi_value *result) { - napi_status nstatus; - - TF_AutoStatus tf_status; - uint32_t num_dims = TFE_TensorHandleNumDims(handle, tf_status.status); - ENSURE_TF_OK(env, tf_status); - - if (num_dims == 0) { - nstatus = napi_create_array_with_length(env, 0, result); - ENSURE_NAPI_OK(env, nstatus); - } else { - nstatus = napi_create_array_with_length(env, num_dims, result); - ENSURE_NAPI_OK(env, nstatus); - - for (uint32_t i = 0; i < num_dims; i++) { - napi_value cur_dim; - nstatus = napi_create_int64( - env, TFE_TensorHandleDim(handle, i, tf_status.status), &cur_dim); - ENSURE_TF_OK(env, tf_status); - ENSURE_NAPI_OK(env, nstatus); - - nstatus = napi_set_element(env, *result, i, cur_dim); - ENSURE_NAPI_OK(env, nstatus); - } - } -} - -inline bool IsArray(napi_env env, napi_status &nstatus, napi_value *val) { - bool is_array; - nstatus = napi_is_array(env, *val, &is_array); - ENSURE_NAPI_OK_RETVAL(env, nstatus, false); - return is_array; -} - -void GetTFE_TensorHandleType(napi_env env, TFE_TensorHandle *handle, - napi_value *result) { - napi_status nstatus; - - TF_DataType dtype = TFE_TensorHandleDataType(handle); - nstatus = napi_create_int32(env, dtype, result); - ENSURE_NAPI_OK(env, nstatus); -} - -void AssignOpAttr(napi_env env, TFE_Op *tfe_op, napi_value attr_value) { - napi_status nstatus; - - napi_value attr_name_value; - nstatus = napi_get_named_property(env, attr_value, "name", &attr_name_value); - ENSURE_NAPI_OK(env, nstatus); - - std::string attr_name_string; - nstatus = GetStringParam(env, attr_name_value, attr_name_string); - ENSURE_NAPI_OK(env, nstatus); - - // OpAttr will be used beyond the scope of this function call. Stash ops in - // a set for re-use instead of dynamically reallocating strings for - // operations. - const char *attr_name = - ATTR_NAME_SET.insert(attr_name_string.c_str()).first->c_str(); - - napi_value attr_type_value; - nstatus = napi_get_named_property(env, attr_value, "type", &attr_type_value); - ENSURE_NAPI_OK(env, nstatus); - - TF_AttrType tf_attr_type; - nstatus = napi_get_value_int32(env, attr_type_value, - reinterpret_cast(&tf_attr_type)); - ENSURE_NAPI_OK(env, nstatus); - - napi_value js_value; - nstatus = napi_get_named_property(env, attr_value, "value", &js_value); - ENSURE_NAPI_OK(env, nstatus); - - switch (tf_attr_type) { - case TF_ATTR_STRING: { - // NOTE: String attribute values do not have to be utf8 encoded strings - // (could be arbitrary byte sequences). - std::string str_value; - nstatus = GetStringParam(env, js_value, str_value); - ENSURE_NAPI_OK(env, nstatus); - - TFE_OpSetAttrString(tfe_op, attr_name, str_value.c_str(), - str_value.size()); - break; - } - - case TF_ATTR_INT: { - if (IsArray(env, nstatus, &js_value)) { - uint32_t length; - nstatus = napi_get_array_length(env, js_value, &length); - ENSURE_NAPI_OK(env, nstatus); - std::unique_ptr data(new int64_t[length]); - for (uint32_t i = 0; i < length; ++i) { - napi_value element; - nstatus = napi_get_element(env, js_value, i, &element); - ENSURE_NAPI_OK(env, nstatus); - int32_t value; - nstatus = napi_get_value_int32(env, element, &value); - ENSURE_NAPI_OK(env, nstatus); - data[i] = value; - } - TFE_OpSetAttrIntList(tfe_op, attr_name, data.get(), - static_cast(length)); - } else { - int64_t value; - nstatus = napi_get_value_int64(env, js_value, &value); - ENSURE_NAPI_OK(env, nstatus); - - TFE_OpSetAttrInt(tfe_op, attr_name, value); - } - break; - } - - case TF_ATTR_FLOAT: { - if (IsArray(env, nstatus, &js_value)) { - uint32_t length; - nstatus = napi_get_array_length(env, js_value, &length); - ENSURE_NAPI_OK(env, nstatus); - std::unique_ptr data(new float[length]); - for (uint32_t i = 0; i < length; ++i) { - napi_value element; - nstatus = napi_get_element(env, js_value, i, &element); - ENSURE_NAPI_OK(env, nstatus); - double value; - nstatus = napi_get_value_double(env, element, &value); - ENSURE_NAPI_OK(env, nstatus); - data[i] = static_cast(value); - } - TFE_OpSetAttrFloatList(tfe_op, attr_name, data.get(), - static_cast(length)); - } else { - double value; - nstatus = napi_get_value_double(env, js_value, &value); - ENSURE_NAPI_OK(env, nstatus); - TFE_OpSetAttrFloat(tfe_op, attr_name, static_cast(value)); - } - break; - } - - case TF_ATTR_BOOL: { - if (IsArray(env, nstatus, &js_value)) { - uint32_t length; - nstatus = napi_get_array_length(env, js_value, &length); - ENSURE_NAPI_OK(env, nstatus); - std::unique_ptr data(new unsigned char[length]); - for (uint32_t i = 0; i < length; ++i) { - napi_value element; - nstatus = napi_get_element(env, js_value, i, &element); - ENSURE_NAPI_OK(env, nstatus); - bool value; - nstatus = napi_get_value_bool(env, element, &value); - ENSURE_NAPI_OK(env, nstatus); - data[i] = value ? 1 : 0; - } - TFE_OpSetAttrBoolList(tfe_op, attr_name, data.get(), - static_cast(length)); - } else { - bool value; - nstatus = napi_get_value_bool(env, js_value, &value); - ENSURE_NAPI_OK(env, nstatus); - TFE_OpSetAttrBool(tfe_op, attr_name, value ? 1 : 0); - } - break; - } - - case TF_ATTR_TYPE: { - TF_DataType tf_data_type; - nstatus = napi_get_value_int32( - env, js_value, reinterpret_cast(&tf_data_type)); - ENSURE_NAPI_OK(env, nstatus); - - TFE_OpSetAttrType(tfe_op, attr_name, tf_data_type); - break; - } - - case TF_ATTR_SHAPE: { - std::vector shape_vector; - ExtractArrayShape(env, js_value, &shape_vector); - - TF_AutoStatus tf_status; - TFE_OpSetAttrShape(tfe_op, attr_name, shape_vector.data(), - shape_vector.size(), tf_status.status); - ENSURE_TF_OK(env, tf_status); - break; - } - - default: - REPORT_UNKNOWN_TF_ATTR_TYPE(env, tf_attr_type); - break; - } -} - -TFJSBackend::TFJSBackend(napi_env env) - : next_tensor_id_(0), next_savedmodel_id_(0) { - TF_AutoStatus tf_status; - TFE_ContextOptions *tfe_options = TFE_NewContextOptions(); - tfe_context_ = TFE_NewContext(tfe_options, tf_status.status); - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR(env, "Exception creating TFE_Context"); - } - - TFE_DeleteContextOptions(tfe_options); - - TF_DeviceList *device_list = - TFE_ContextListDevices(tfe_context_, tf_status.status); - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR(env, "Exception creating TFE_Context"); - } - - // TODO(kreeger): Add better support for this in the future through the JS - // API. https://github.com/tensorflow/tfjs/issues/320 - std::string cpu_device_name; - const int num_devices = TF_DeviceListCount(device_list); - for (int i = 0; i < num_devices; i++) { - const char *device_type = - TF_DeviceListType(device_list, i, tf_status.status); - ENSURE_TF_OK(env, tf_status); - - // Keep a reference to the host CPU device: - if (strcmp(device_type, "CPU") == 0) { - cpu_device_name = - std::string(TF_DeviceListName(device_list, i, tf_status.status)); - ENSURE_TF_OK(env, tf_status); - } else if (strcmp(device_type, "GPU") == 0) { - device_name = - std::string(TF_DeviceListName(device_list, i, tf_status.status)); - ENSURE_TF_OK(env, tf_status); - } - } - - // If no GPU devices found, fallback to host CPU: - if (device_name.empty()) { - device_name = cpu_device_name; - is_gpu_device = false; - } else { - is_gpu_device = true; - } - TF_DeleteDeviceList(device_list); -} - -TFJSBackend::~TFJSBackend() { - for (auto &kv : tfe_handle_map_) { - TFE_DeleteTensorHandle(kv.second); - } - for (auto &kv : tf_savedmodel_map_) { - TF_AutoStatus tf_status; - TF_DeleteSession(kv.second.first, tf_status.status); - TF_DeleteGraph(kv.second.second); - } - if (tfe_context_ != nullptr) { - TFE_DeleteContext(tfe_context_); - } -} - -TFJSBackend *TFJSBackend::Create(napi_env env) { return new TFJSBackend(env); } - -int32_t TFJSBackend::InsertHandle(TFE_TensorHandle *tfe_handle) { - return tfe_handle_map_.insert(std::make_pair(next_tensor_id_++, tfe_handle)) - .first->first; -} - -int32_t TFJSBackend::InsertSavedModel(TF_Session *tf_session, - TF_Graph *tf_graph) { - // Both TF_Session and TF_Graph are required when executing SavedModel. - // TF_Graph is used to find input/output operation from string name. - return tf_savedmodel_map_ - .insert(std::make_pair(next_savedmodel_id_++, - std::make_pair(tf_session, tf_graph))) - .first->first; -} - -napi_value TFJSBackend::CreateTensor(napi_env env, napi_value shape_value, - napi_value dtype_value, - napi_value array_value) { - napi_status nstatus; - - std::vector shape_vector; - ExtractArrayShape(env, shape_value, &shape_vector); - // Check to see if an exception exists, if so return a failure. - if (IsExceptionPending(env)) { - return nullptr; - } - - int32_t dtype_int32; - nstatus = napi_get_value_int32(env, dtype_value, &dtype_int32); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - TFE_TensorHandle *tfe_handle = CreateTFE_TensorHandleFromJSValues( - env, shape_vector.data(), shape_vector.size(), - static_cast(dtype_int32), array_value); - - // Check to see if an exception exists, if so return a failure. - if (IsExceptionPending(env)) { - return nullptr; - } - - // Copy non-int32 and non-string tensors to a device. Most GPU kernels expect - // to have int32 tensors in host memory. - if (dtype_int32 != TF_INT32 && dtype_int32 != TF_STRING) { - // Note that this is a shallow copy and will share the underlying buffer - // if copying to the same device. - TFE_TensorHandle *new_handle = CopyTFE_TensorHandleToDevice( - env, device_name.c_str(), tfe_handle, tfe_context_); - - TFE_DeleteTensorHandle(tfe_handle); - tfe_handle = new_handle; - } - - napi_value output_tensor_id; - nstatus = napi_create_int32(env, InsertHandle(tfe_handle), &output_tensor_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - return output_tensor_id; -} - -void TFJSBackend::DeleteTensor(napi_env env, napi_value tensor_id_value) { - int32_t tensor_id; - ENSURE_NAPI_OK(env, napi_get_value_int32(env, tensor_id_value, &tensor_id)); - - auto tensor_entry = tfe_handle_map_.find(tensor_id); - if (tensor_entry == tfe_handle_map_.end()) { - NAPI_THROW_ERROR(env, - "Delete called on a Tensor not referenced (tensor_id: %d)", - tensor_id); - return; - } - - TFE_DeleteTensorHandle(tensor_entry->second); - tfe_handle_map_.erase(tensor_entry); -} - -napi_value TFJSBackend::GetTensorData(napi_env env, - napi_value tensor_id_value) { - int32_t tensor_id; - ENSURE_NAPI_OK_RETVAL( - env, napi_get_value_int32(env, tensor_id_value, &tensor_id), nullptr); - - auto tensor_entry = tfe_handle_map_.find(tensor_id); - if (tensor_entry == tfe_handle_map_.end()) { - NAPI_THROW_ERROR( - env, "Get data called on a Tensor not referenced (tensor_id: %d)", - tensor_id); - return nullptr; - } - - napi_value js_value; - CopyTFE_TensorHandleDataToJSData(env, tfe_context_, tensor_entry->second, - &js_value); - return js_value; -} - -napi_value TFJSBackend::ExecuteOp(napi_env env, napi_value op_name_value, - napi_value op_attr_inputs, - napi_value input_tensor_ids, - napi_value num_output_values) { - napi_status nstatus; - - std::string op_name; - nstatus = GetStringParam(env, op_name_value, op_name); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - TF_AutoStatus tf_status; - TFE_AutoOp tfe_op(TFE_NewOp(tfe_context_, op_name.c_str(), tf_status.status)); - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - - uint32_t num_input_ids; - nstatus = napi_get_array_length(env, input_tensor_ids, &num_input_ids); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - for (uint32_t i = 0; i < num_input_ids; i++) { - napi_value cur_input_id; - nstatus = napi_get_element(env, input_tensor_ids, i, &cur_input_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - int32_t cur_input_tensor_id; - nstatus = napi_get_value_int32(env, cur_input_id, &cur_input_tensor_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - auto input_tensor_entry = tfe_handle_map_.find(cur_input_tensor_id); - if (input_tensor_entry == tfe_handle_map_.end()) { - NAPI_THROW_ERROR(env, "Input Tensor ID not referenced (tensor_id: %d)", - cur_input_tensor_id); - return nullptr; - } - - TFE_OpAddInput(tfe_op.op, input_tensor_entry->second, tf_status.status); - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - } - - uint32_t op_attrs_length; - nstatus = napi_get_array_length(env, op_attr_inputs, &op_attrs_length); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - for (uint32_t i = 0; i < op_attrs_length; i++) { - napi_value cur_op_attr; - nstatus = napi_get_element(env, op_attr_inputs, i, &cur_op_attr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - AssignOpAttr(env, tfe_op.op, cur_op_attr); - - // Check to see if an exception exists, if so return a failure. - if (IsExceptionPending(env)) { - return nullptr; - } - } - - int32_t num_outputs; - nstatus = napi_get_value_int32(env, num_output_values, &num_outputs); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Push `nullptr` to get a valid pointer in the call to `TFE_Execute()` - // below. - std::vector result_handles(num_outputs, nullptr); - - int size = result_handles.size(); - TFE_Execute(tfe_op.op, result_handles.data(), &size, tf_status.status); - ENSURE_TF_OK_RETVAL(env, tf_status, nullptr); - - napi_value output_tensor_infos; - nstatus = napi_create_array_with_length(env, size, &output_tensor_infos); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - for (int32_t i = 0; i < num_outputs; i++) { - TFE_TensorHandle *handle = result_handles[i]; - napi_value tensor_info_value = GenerateOutputTensorInfo(env, handle); - // Push into output array - nstatus = napi_set_element(env, output_tensor_infos, i, tensor_info_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - } - - return output_tensor_infos; -} - -/* Helper function to generate TensorInfo(used for JavaScript) from - * TFE_TensorHandle. This helper function is used by ExecuteOp() and - * RunSavedModel(). - */ -napi_value TFJSBackend::GenerateOutputTensorInfo(napi_env env, - TFE_TensorHandle *handle) { - napi_status nstatus; - - // Output tensor info object: - napi_value tensor_info_value; - nstatus = napi_create_object(env, &tensor_info_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Output tensor ID: - napi_value output_tensor_id_value; - nstatus = - napi_create_int32(env, InsertHandle(handle), &output_tensor_id_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - nstatus = napi_set_named_property(env, tensor_info_value, "id", - output_tensor_id_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Output tensor shape: - napi_value shape_value; - GetTFE_TensorHandleShape(env, handle, &shape_value); - - nstatus = - napi_set_named_property(env, tensor_info_value, "shape", shape_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Output tensor dtype: - napi_value type_value; - GetTFE_TensorHandleType(env, handle, &type_value); - - nstatus = - napi_set_named_property(env, tensor_info_value, "dtype", type_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - return tensor_info_value; -} - -napi_value TFJSBackend::LoadSavedModel(napi_env env, - napi_value export_dir_value, - napi_value tags_value) { - TF_SessionOptions *session_options = TF_NewSessionOptions(); - - TF_Buffer *run_options = TF_NewBufferFromString("", 0); - - std::string export_dir_string; - napi_status nstatus; - nstatus = GetStringParam(env, export_dir_value, export_dir_string); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - const char *export_dir = export_dir_string.c_str(); - - std::string tags; - nstatus = GetStringParam(env, tags_value, tags); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - std::vector tags_ptrs = splitStringByComma(tags); - - TF_Graph *graph = TF_NewGraph(); - - TF_Buffer *metagraph = TF_NewBuffer(); - - TF_AutoStatus tf_status; - - TF_Session *session = TF_LoadSessionFromSavedModel( - session_options, run_options, export_dir, tags_ptrs.data(), - tags_ptrs.size(), graph, metagraph, tf_status.status); - // Delete objects that are necessary when loading the SavedModel but not gonna - // be used later. - TF_DeleteSessionOptions(session_options); - TF_DeleteBuffer(run_options); - TF_DeleteBuffer(metagraph); - - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR(env, "Failed to load SavedModel: %s", - TF_Message(tf_status.status)); - return nullptr; - } - - napi_value output_session_id; - nstatus = napi_create_int32(env, InsertSavedModel(session, graph), - &output_session_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // clean up the tags strings. - for (uint32_t i = 0; i < tags_ptrs.size(); i++) { - delete tags_ptrs[i]; - } - return output_session_id; -} - -void TFJSBackend::DeleteSavedModel(napi_env env, - napi_value savedmodel_id_value) { - int32_t savedmodel_id; - ENSURE_NAPI_OK( - env, napi_get_value_int32(env, savedmodel_id_value, &savedmodel_id)); - - auto savedmodel_entry = tf_savedmodel_map_.find(savedmodel_id); - if (savedmodel_entry == tf_savedmodel_map_.end()) { - NAPI_THROW_ERROR( - env, "Delete called on a SavedModel not found (savedmodel_id: %d)", - savedmodel_id); - return; - } - - TF_AutoStatus tf_status; - TF_DeleteSession(savedmodel_entry->second.first, tf_status.status); - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR(env, "Failed to delete SavedModel: %s", - TF_Message(tf_status.status)); - return; - } - // TODO(kangyizhang): Add tests to validate TF_Session and TF_Graph are - // deleted. - TF_DeleteGraph(savedmodel_entry->second.second); - tf_savedmodel_map_.erase(savedmodel_entry); -} - -napi_value TFJSBackend::RunSavedModel(napi_env env, - napi_value savedmodel_id_value, - napi_value input_tensor_ids, - napi_value input_op_names_value, - napi_value output_op_names_value) { - napi_status nstatus; - TF_AutoStatus tf_status; - - int32_t savedmodel_id; - nstatus = napi_get_value_int32(env, savedmodel_id_value, &savedmodel_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Get corresponding SavedModel session and graph. - auto savedmodel_entry = tf_savedmodel_map_.find(savedmodel_id); - if (savedmodel_entry == tf_savedmodel_map_.end()) { - NAPI_THROW_ERROR(env, "SavedModel ID not found (savedmodel_id: %d)", - savedmodel_id); - return nullptr; - } - - std::string input_op_names; - nstatus = GetStringParam(env, input_op_names_value, input_op_names); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - std::string output_op_names; - nstatus = GetStringParam(env, output_op_names_value, output_op_names); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Get input/output op names as vector - std::vector input_op_name_array = - splitStringByComma(input_op_names); - std::vector output_op_name_array = - splitStringByComma(output_op_names); - - std::vector inputs; - std::vector outputs; - - uint32_t num_input_ids; - nstatus = napi_get_array_length(env, input_tensor_ids, &num_input_ids); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - if (input_op_name_array.size() != num_input_ids) { - NAPI_THROW_ERROR(env, - "Length of input op names (%d) does not match the length " - "of input tensors (%d).", - input_op_name_array.size(), num_input_ids); - return nullptr; - } - - std::vector input_values; - - for (uint32_t i = 0; i < num_input_ids; i++) { - napi_value cur_input_id; - nstatus = napi_get_element(env, input_tensor_ids, i, &cur_input_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - int32_t cur_input_tensor_id; - nstatus = napi_get_value_int32(env, cur_input_id, &cur_input_tensor_id); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Find input tensor based on tensor id. - auto tensor_entry = tfe_handle_map_.find(cur_input_tensor_id); - if (tensor_entry == tfe_handle_map_.end()) { - NAPI_THROW_ERROR(env, "Input Tensor ID not found (tensor_id: %d)", - cur_input_tensor_id); - return nullptr; - } - TF_Tensor *inputTensor = - TFE_TensorHandleResolve(tensor_entry->second, tf_status.status); - - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR( - env, "Failed to get input tensor (tensor_id: %d) for session.", - cur_input_tensor_id); - return nullptr; - } - - // Add input tensor into input values list. - input_values.push_back(inputTensor); - - // The item in input_op_name_array is something like "serving_default_x:0". - // Parse it into input op name and index for provided tensor. - std::string name(input_op_name_array[i]); - int index = name.find(":"); - std::string input_op_name = name.substr(0, index); - std::string input_op_index = name.substr(index + 1); - int input_tensor_index; - if (input_op_index.length() == 0) { - input_tensor_index = 0; - } else { - input_tensor_index = atoi(input_op_index.c_str()); - } - - // Add input op into input ops list. - // TODO(kangyizhang): Store these TF_Operations somewhere so they don't need - // to be generated every time. - TF_Operation *input_op = TF_GraphOperationByName( - savedmodel_entry->second.second, input_op_name.c_str()); - if (input_op == nullptr) { - NAPI_THROW_ERROR(env, "Input op name can not be found in the graph."); - return nullptr; - } - TF_Output in = {input_op, input_tensor_index}; - inputs.push_back(in); - } - - // Add output op into output ops list. - for (uint32_t i = 0; i < output_op_name_array.size(); i++) { - // The item in output_op_name_array is something like - // "StatefulPartitionedCall:0". Parse it into output op name and index. - std::string name(output_op_name_array[i]); - int index = name.find(":"); - std::string output_op_name = name.substr(0, index); - std::string output_op_index = name.substr(index + 1); - int output_tensor_index; - if (output_op_index.length() == 0) { - output_tensor_index = 0; - } else { - output_tensor_index = atoi(output_op_index.c_str()); - } - - TF_Operation *output_op = TF_GraphOperationByName( - savedmodel_entry->second.second, output_op_name.c_str()); - if (output_op == nullptr) { - NAPI_THROW_ERROR(env, "Output op name can not be found in the graph."); - return nullptr; - } - TF_Output out = {output_op, output_tensor_index}; - outputs.push_back(out); - } - - std::vector output_values(outputs.size(), nullptr); - - TF_SessionRun(savedmodel_entry->second.first, nullptr, inputs.data(), - input_values.data(), num_input_ids, outputs.data(), - output_values.data(), output_op_name_array.size(), nullptr, 0, - nullptr, tf_status.status); - - if (TF_GetCode(tf_status.status) != TF_OK) { - NAPI_THROW_ERROR(env, "Session fail to run with error: %s", - TF_Message(tf_status.status)); - return nullptr; - } - - napi_value output_tensor_infos; - nstatus = napi_create_array_with_length(env, 1, &output_tensor_infos); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - // Generate output tensors for JS. - for (uint32_t i = 0; i < output_op_name_array.size(); i++) { - TFE_TensorHandle *tfe_handle = - TFE_NewTensorHandle(output_values[i], tf_status.status); - // Deallocate output TF_Tensor in C++. - TF_DeleteTensor(output_values[i]); - - napi_value tensor_info_value = GenerateOutputTensorInfo(env, tfe_handle); - // Push into output array - nstatus = napi_set_element(env, output_tensor_infos, i, tensor_info_value); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - // delete output op name string - delete output_op_name_array[i]; - } - - for (uint32_t i = 0; i < num_input_ids; i++) { - // Deallocate input TF_Tensor in C++. - TF_DeleteTensor(input_values[i]); - // delete input op name string - delete input_op_name_array[i]; - } - - return output_tensor_infos; -} - -napi_value TFJSBackend::GetNumOfSavedModels(napi_env env) { - napi_status nstatus; - napi_value num_saved_models; - nstatus = - napi_create_int32(env, tf_savedmodel_map_.size(), &num_saved_models); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - return num_saved_models; -} - -} // namespace tfnodejs diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.h deleted file mode 100644 index 78ccb4ccd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_backend.h +++ /dev/null @@ -1,108 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_TFJS_BACKEND_H_ -#define TF_NODEJS_TFJS_BACKEND_H_ - -#include -#include -#include -#include -#include "tensorflow/c/c_api.h" -#include "tensorflow/c/eager/c_api.h" - -namespace tfnodejs { - -class TFJSBackend { - public: - // Creates, initializes, and returns a TFJSBackend instance. If initialization - // fails, a nullptr is returned. - static TFJSBackend *Create(napi_env env); - - // Creates a new Tensor with given shape and data and returns an ID that - // refernces the new Tensor. - // - shape_value (number[]) - // - dtype_value (number) - // - array_value (TypedArray|Array) - napi_value CreateTensor(napi_env env, napi_value shape_value, - napi_value dtype_value, napi_value array_value); - - // Deletes a created Tensor. - // - tensor_id_value (number) - void DeleteTensor(napi_env env, napi_value tensor_id_value); - - // Returns a typed-array as a `napi_value` with the data associated with the - // TF/TFE pointers. - // - tensor_id_value (number) - napi_value GetTensorData(napi_env env, napi_value tensor_id_value); - - // Executes a TFE Op and returns an array of objects containing tensor - // attributes (id, dtype, shape). - // - op_name_value (string) - // - op_attr_inputs (array of TFE Op attributes) - // - input_tensor_ids (array of input tensor IDs) - // - num_output_values (number) - napi_value ExecuteOp(napi_env env, napi_value op_name_value, - napi_value op_attr_inputs, napi_value input_tensor_ids, - napi_value num_output_values); - - // Load a SavedModel from a path: - // - export_dir (string) - // - tags_value (string) - napi_value LoadSavedModel(napi_env env, napi_value export_dir, - napi_value tags_value); - - // Delete the SavedModel corresponding TF_Session and TF_Graph - // - saved_model_id (number) - void DeleteSavedModel(napi_env env, napi_value saved_model_id); - - // Execute a session from SavedModel with the provided inputs: - // - saved_model_id (number) - // - input_tensor_ids (array of input tensor IDs) - // - input_op_names (array of input op names) - // - output_op_names (array of output op names) - napi_value RunSavedModel(napi_env env, napi_value saved_model_id, - napi_value input_tensor_ids, - napi_value input_op_names, - napi_value output_op_names); - - // Get number of loaded SavedModel in the backend: - napi_value GetNumOfSavedModels(napi_env env); - - private: - TFJSBackend(napi_env env); - ~TFJSBackend(); - - int32_t InsertHandle(TFE_TensorHandle *tfe_handle); - int32_t InsertSavedModel(TF_Session *tf_session, TF_Graph *tf_graph); - napi_value GenerateOutputTensorInfo(napi_env env, TFE_TensorHandle *handle); - - TFE_Context *tfe_context_; - std::unordered_map tfe_handle_map_; - std::unordered_map> - tf_savedmodel_map_; - int32_t next_tensor_id_; - int32_t next_savedmodel_id_; - std::string device_name; - - public: - bool is_gpu_device; -}; - -} // namespace tfnodejs - -#endif // TF_NODEJS_TFJS_BACKEND_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_binding.cc b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_binding.cc deleted file mode 100644 index 6ec7c5d09..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/tfjs_binding.cc +++ /dev/null @@ -1,296 +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. - * ============================================================================= - */ - -#include -#include "tfjs_backend.h" -#include "utils.h" - -namespace tfnodejs { - -TFJSBackend *gBackend = nullptr; - -static void AssignIntProperty(napi_env env, napi_value exports, - const char *name, int32_t value) { - napi_value js_value; - napi_status nstatus = napi_create_int32(env, value, &js_value); - ENSURE_NAPI_OK(env, nstatus); - - napi_property_descriptor property = {name, nullptr, nullptr, - nullptr, nullptr, js_value, - napi_default, nullptr}; - nstatus = napi_define_properties(env, exports, 1, &property); - ENSURE_NAPI_OK(env, nstatus); -} - -static napi_value CreateTensor(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Create tensor takes 3 params: shape, dtype, typed-array/array: - size_t argc = 3; - napi_value args[3]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - if (argc < 3) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to createTensor(). " - "Expecting 3 args but got %d.", - argc); - return nullptr; - } - - ENSURE_VALUE_IS_ARRAY_RETVAL(env, args[0], nullptr); - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[1], nullptr); - - // The third array can either be a typed array or an array: - bool is_typed_array; - nstatus = napi_is_typedarray(env, args[2], &is_typed_array); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - if (!is_typed_array) { - ENSURE_VALUE_IS_ARRAY_RETVAL(env, args[2], nullptr); - } - - return gBackend->CreateTensor(env, args[0], args[1], args[2]); -} - -static napi_value DeleteTensor(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Delete tensor takes 1 param: tensor ID; - size_t argc = 1; - napi_value args[1]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, js_this); - - if (argc < 1) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to deleteTensor(). " - "Expecting 1 arg but got %d.", - argc); - return js_this; - } - - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[0], js_this); - - gBackend->DeleteTensor(env, args[0]); - return js_this; -} - -static napi_value TensorDataSync(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Tensor data-sync takes 1 param: tensor ID; - size_t argc = 1; - napi_value args[1]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, js_this); - - if (argc < 1) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to tensorDataSync(). " - "Expecting 1 arg but got %d.", - argc); - return nullptr; - } - - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[0], js_this); - - return gBackend->GetTensorData(env, args[0]); -} - -static napi_value ExecuteOp(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Create tensor takes 4 params: op-name, op-attrs, input-tensor-ids, - // num-outputs: - size_t argc = 4; - napi_value args[4]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - if (argc < 4) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to executeOp(). Expecting " - "4 args but got %d.", - argc); - return nullptr; - } - - ENSURE_VALUE_IS_STRING_RETVAL(env, args[0], nullptr); - ENSURE_VALUE_IS_ARRAY_RETVAL(env, args[1], nullptr); - ENSURE_VALUE_IS_ARRAY_RETVAL(env, args[2], nullptr); - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[3], nullptr); - - return gBackend->ExecuteOp(env, args[0], args[1], args[2], args[3]); -} - -static napi_value IsUsingGPUDevice(napi_env env, napi_callback_info info) { - napi_value result; - - napi_status nstatus; - nstatus = napi_get_boolean(env, gBackend->is_gpu_device, &result); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - return result; -} - -static napi_value LoadSavedModel(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Load saved model takes 2 params: export_dir, tags: - size_t argc = 2; - napi_value args[2]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - if (argc < 2) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to LoadSavedModel(). " - "Expecting 2 args but got %d.", - argc); - return nullptr; - } - - ENSURE_VALUE_IS_STRING_RETVAL(env, args[0], nullptr); - ENSURE_VALUE_IS_STRING_RETVAL(env, args[1], nullptr); - - return gBackend->LoadSavedModel(env, args[0], args[1]); -} - -static napi_value DeleteSavedModel(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Delete SavedModel takes 1 param: savedModel ID; - size_t argc = 1; - napi_value args[1]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, js_this); - - if (argc < 1) { - NAPI_THROW_ERROR(env, - "Invalid number of args passed to deleteSavedModel(). " - "Expecting 1 arg but got %d.", - argc); - return js_this; - } - - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[0], js_this); - - gBackend->DeleteSavedModel(env, args[0]); - return js_this; -} - -static napi_value RunSavedModel(napi_env env, napi_callback_info info) { - napi_status nstatus; - - // Run SavedModel takes 4 params: session_id, input_tensor_ids, - // input_op_names, output_op_names. - size_t argc = 4; - napi_value args[4]; - napi_value js_this; - nstatus = napi_get_cb_info(env, info, &argc, args, &js_this, nullptr); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nullptr); - - if (argc < 4) { - NAPI_THROW_ERROR(env, "Invalid number of args passed to RunSavedModel()"); - return nullptr; - } - - ENSURE_VALUE_IS_NUMBER_RETVAL(env, args[0], nullptr); - ENSURE_VALUE_IS_ARRAY_RETVAL(env, args[1], nullptr); - ENSURE_VALUE_IS_STRING_RETVAL(env, args[2], nullptr); - ENSURE_VALUE_IS_STRING_RETVAL(env, args[3], nullptr); - - return gBackend->RunSavedModel(env, args[0], args[1], args[2], args[3]); -} - -static napi_value GetNumOfSavedModels(napi_env env, napi_callback_info info) { - // Delete SavedModel takes 0 param; - return gBackend->GetNumOfSavedModels(env); -} - -static napi_value InitTFNodeJSBinding(napi_env env, napi_value exports) { - napi_status nstatus; - - gBackend = TFJSBackend::Create(env); - ENSURE_VALUE_IS_NOT_NULL_RETVAL(env, gBackend, nullptr); - - // TF version - napi_value tf_version; - nstatus = napi_create_string_latin1(env, TF_Version(), -1, &tf_version); - ENSURE_NAPI_OK_RETVAL(env, nstatus, exports); - - // Set all export values list here. - napi_property_descriptor exports_properties[] = { - {"createTensor", nullptr, CreateTensor, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"deleteTensor", nullptr, DeleteTensor, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"tensorDataSync", nullptr, TensorDataSync, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"executeOp", nullptr, ExecuteOp, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"loadSavedModel", nullptr, LoadSavedModel, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"deleteSavedModel", nullptr, DeleteSavedModel, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"runSavedModel", nullptr, RunSavedModel, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"TF_Version", nullptr, nullptr, nullptr, nullptr, tf_version, - napi_default, nullptr}, - {"isUsingGpuDevice", nullptr, IsUsingGPUDevice, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"getNumOfSavedModels", nullptr, GetNumOfSavedModels, nullptr, nullptr, - nullptr, napi_default, nullptr}, - }; - nstatus = napi_define_properties(env, exports, ARRAY_SIZE(exports_properties), - exports_properties); - ENSURE_NAPI_OK_RETVAL(env, nstatus, exports); - - // Export TF property types to JS -#define EXPORT_INT_PROPERTY(v) AssignIntProperty(env, exports, #v, v) - // Types - EXPORT_INT_PROPERTY(TF_FLOAT); - EXPORT_INT_PROPERTY(TF_INT32); - EXPORT_INT_PROPERTY(TF_INT64); - EXPORT_INT_PROPERTY(TF_BOOL); - EXPORT_INT_PROPERTY(TF_COMPLEX64); - EXPORT_INT_PROPERTY(TF_STRING); - EXPORT_INT_PROPERTY(TF_RESOURCE); - EXPORT_INT_PROPERTY(TF_UINT8); - - // Op AttrType - EXPORT_INT_PROPERTY(TF_ATTR_STRING); - EXPORT_INT_PROPERTY(TF_ATTR_INT); - EXPORT_INT_PROPERTY(TF_ATTR_FLOAT); - EXPORT_INT_PROPERTY(TF_ATTR_BOOL); - EXPORT_INT_PROPERTY(TF_ATTR_TYPE); - EXPORT_INT_PROPERTY(TF_ATTR_SHAPE); -#undef EXPORT_INT_PROPERTY - - return exports; -} - -NAPI_MODULE(tfe_binding, InitTFNodeJSBinding) - -} // namespace tfnodejs diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/utils.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/utils.h deleted file mode 100644 index b620845a9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/binding/utils.h +++ /dev/null @@ -1,329 +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. - * ============================================================================= - */ - -#ifndef TF_NODEJS_UTILS_H_ -#define TF_NODEJS_UTILS_H_ - -#include -#include -#include -#include -#include -#include -#include "tensorflow/c/c_api.h" -#include "tf_auto_status.h" - -#define MAX_TENSOR_SHAPE 4 - -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) - -#ifndef DEBUG -#define DEBUG 0 -#endif - -#define DEBUG_LOG(message, file, line_number) \ - do { \ - if (DEBUG) \ - fprintf(stderr, "** -%s:%zu\n-- %s\n", file, line_number, message); \ - } while (0) - -namespace tfnodejs { - -#define NAPI_THROW_ERROR(env, message, ...) \ - NapiThrowError(env, __FILE__, __LINE__, message, ##__VA_ARGS__); - -inline void NapiThrowError(napi_env env, const char *file, - const size_t line_number, const char *message, ...) { - char buffer[500]; - va_list args; - va_start(args, message); - std::vsnprintf(buffer, 500, message, args); - va_end(args); - DEBUG_LOG(buffer, file, line_number); - napi_throw_error(env, nullptr, buffer); -} - -#define ENSURE_NAPI_OK(env, status) \ - if (!EnsureNapiOK(env, status, __FILE__, __LINE__)) return; -#define ENSURE_NAPI_OK_RETVAL(env, status, retval) \ - if (!EnsureNapiOK(env, status, __FILE__, __LINE__)) return retval; - -inline bool EnsureNapiOK(napi_env env, napi_status status, const char *file, - const size_t line_number) { - if (status != napi_ok) { - const napi_extended_error_info *error_info = 0; - napi_get_last_error_info(env, &error_info); - NapiThrowError( - env, file, line_number, "Invalid napi_status: %s\n", - error_info->error_message ? error_info->error_message : "unknown"); - } - return status == napi_ok; -} - -#define ENSURE_TF_OK(env, status) \ - if (!EnsureTFOK(env, status, __FILE__, __LINE__)) return; -#define ENSURE_TF_OK_RETVAL(env, status, retval) \ - if (!EnsureTFOK(env, status, __FILE__, __LINE__)) return retval; - -inline bool EnsureTFOK(napi_env env, TF_AutoStatus &status, const char *file, - const size_t line_number) { - TF_Code tf_code = TF_GetCode(status.status); - if (tf_code != TF_OK) { - NapiThrowError(env, file, line_number, "Invalid TF_Status: %u\nMessage: %s", - TF_GetCode(status.status), TF_Message(status.status)); - } - return tf_code == TF_OK; -} - -#define ENSURE_CONSTRUCTOR_CALL(env, info) \ - if (!EnsureConstructorCall(env, info, __FILE__, __LINE__)) return; -#define ENSURE_CONSTRUCTOR_CALL_RETVAL(env, info, retval) \ - if (!EnsureConstructorCall(env, info, __FILE__, __LINE__)) return retval; - -inline bool EnsureConstructorCall(napi_env env, napi_callback_info info, - const char *file, const size_t line_number) { - napi_value js_target; - napi_status nstatus = napi_get_new_target(env, info, &js_target); - ENSURE_NAPI_OK_RETVAL(env, nstatus, false); - bool is_target = js_target != nullptr; - if (!is_target) { - NapiThrowError(env, file, line_number, - "Function not used as a constructor!"); - } - return is_target; -} - -#define ENSURE_VALUE_IS_OBJECT(env, value) \ - if (!EnsureValueIsObject(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_OBJECT_RETVAL(env, value, retval) \ - if (!EnsureValueIsObject(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsObject(napi_env env, napi_value value, - const char *file, const size_t line_number) { - napi_valuetype type; - ENSURE_NAPI_OK_RETVAL(env, napi_typeof(env, value, &type), false); - bool is_object = type == napi_object; - if (!is_object) { - NapiThrowError(env, file, line_number, "Argument is not an object!"); - } - return is_object; -} - -#define ENSURE_VALUE_IS_STRING(env, value) \ - if (!EnsureValueIsString(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_STRING_RETVAL(env, value, retval) \ - if (!EnsureValueIsString(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsString(napi_env env, napi_value value, - const char *file, const size_t line_number) { - napi_valuetype type; - ENSURE_NAPI_OK_RETVAL(env, napi_typeof(env, value, &type), false); - bool is_string = type == napi_string; - if (!is_string) { - NapiThrowError(env, file, line_number, "Argument is not a string!"); - } - return is_string; -} - -#define ENSURE_VALUE_IS_NUMBER(env, value) \ - if (!EnsureValueIsNumber(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_NUMBER_RETVAL(env, value, retval) \ - if (!EnsureValueIsNumber(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsNumber(napi_env env, napi_value value, - const char *file, const size_t line_number) { - napi_valuetype type; - ENSURE_NAPI_OK_RETVAL(env, napi_typeof(env, value, &type), false); - bool is_number = type == napi_number; - if (!is_number) { - NapiThrowError(env, file, line_number, "Argument is not a number!"); - } - return is_number; -} - -#define ENSURE_VALUE_IS_ARRAY(env, value) \ - if (!EnsureValueIsArray(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_ARRAY_RETVAL(env, value, retval) \ - if (!EnsureValueIsArray(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsArray(napi_env env, napi_value value, const char *file, - const size_t line_number) { - bool is_array; - ENSURE_NAPI_OK_RETVAL(env, napi_is_array(env, value, &is_array), false); - if (!is_array) { - NapiThrowError(env, file, line_number, "Argument is not an array!"); - } - return is_array; -} - -#define ENSURE_VALUE_IS_TYPED_ARRAY(env, value) \ - if (!EnsureValueIsTypedArray(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_TYPED_ARRAY_RETVAL(env, value, retval) \ - if (!EnsureValueIsTypedArray(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsTypedArray(napi_env env, napi_value value, - const char *file, - const size_t line_number) { - bool is_array; - ENSURE_NAPI_OK_RETVAL(env, napi_is_typedarray(env, value, &is_array), false); - if (!is_array) { - NapiThrowError(env, file, line_number, "Argument is not a typed-array!"); - } - return is_array; -} - -#define ENSURE_VALUE_IS_LESS_THAN(env, value, max) \ - if (!EnsureValueIsLessThan(env, value, max, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_LESS_THAN_RETVAL(env, value, max, retval) \ - if (!EnsureValueIsLessThan(env, value, max, __FILE__, __LINE__)) \ - return retval; - -inline bool EnsureValueIsLessThan(napi_env env, uint32_t value, uint32_t max, - const char *file, const size_t line_number) { - if (value > max) { - NapiThrowError(env, file, line_number, - "Argument is greater than max: %u > %u", value, max); - return false; - } else { - return true; - } -} - -#define REPORT_UNKNOWN_TF_DATA_TYPE(env, type) \ - ReportUnknownTFDataType(env, type, __FILE__, __LINE__) - -inline void ReportUnknownTFDataType(napi_env env, TF_DataType type, - const char *file, - const size_t line_number) { - NapiThrowError(env, file, line_number, "Unhandled TF_DataType: %u\n", type); -} - -#define REPORT_UNKNOWN_TF_ATTR_TYPE(env, type) \ - ReportUnknownTFAttrType(env, type, __FILE__, __LINE__) - -inline void ReportUnknownTFAttrType(napi_env env, TF_AttrType type, - const char *file, - const size_t line_number) { - NapiThrowError(env, file, line_number, "Unhandled TF_AttrType: %u\n", type); -} - -#define REPORT_UNKNOWN_TYPED_ARRAY_TYPE(env, type) \ - ReportUnknownTypedArrayType(env, type, __FILE__, __LINE__) - -inline void ReportUnknownTypedArrayType(napi_env env, napi_typedarray_type type, - const char *file, - const size_t line_number) { - NapiThrowError(env, file, line_number, "Unhandled napi typed_array_type: %u", - type); -} - -// Returns a vector with the shape values of an array. -inline void ExtractArrayShape(napi_env env, napi_value array_value, - std::vector *result) { - napi_status nstatus; - - uint32_t array_length; - nstatus = napi_get_array_length(env, array_value, &array_length); - ENSURE_NAPI_OK(env, nstatus); - - for (uint32_t i = 0; i < array_length; i++) { - napi_value dimension_value; - nstatus = napi_get_element(env, array_value, i, &dimension_value); - ENSURE_NAPI_OK(env, nstatus); - - int64_t dimension; - nstatus = napi_get_value_int64(env, dimension_value, &dimension); - ENSURE_NAPI_OK(env, nstatus); - - result->push_back(dimension); - } -} - -inline bool IsExceptionPending(napi_env env) { - bool has_exception = false; - ENSURE_NAPI_OK_RETVAL(env, napi_is_exception_pending(env, &has_exception), - has_exception); - return has_exception; -} - -#define ENSURE_VALUE_IS_NOT_NULL(env, value) \ - if (!EnsureValueIsNotNull(env, value, __FILE__, __LINE__)) return; -#define ENSURE_VALUE_IS_NOT_NULL_RETVAL(env, value, retval) \ - if (!EnsureValueIsNotNull(env, value, __FILE__, __LINE__)) return retval; - -inline bool EnsureValueIsNotNull(napi_env env, void *value, const char *file, - const size_t line_number) { - bool is_null = value == nullptr; - if (is_null) { - NapiThrowError(env, file, line_number, "Argument is null!"); - } - return !is_null; -} - -inline napi_status GetStringParam(napi_env env, napi_value string_value, - std::string &string) { - ENSURE_VALUE_IS_STRING_RETVAL(env, string_value, napi_invalid_arg); - - napi_status nstatus; - - size_t str_length; - nstatus = - napi_get_value_string_utf8(env, string_value, nullptr, 0, &str_length); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nstatus); - - char *buffer = (char *)(malloc(sizeof(char) * (str_length + 1))); - ENSURE_VALUE_IS_NOT_NULL_RETVAL(env, buffer, napi_generic_failure); - - nstatus = napi_get_value_string_utf8(env, string_value, buffer, - str_length + 1, &str_length); - ENSURE_NAPI_OK_RETVAL(env, nstatus, nstatus); - - string.assign(buffer, str_length); - free(buffer); - return napi_ok; -} - -// Returns the number of elements in a Tensor. -inline size_t GetTensorNumElements(TF_Tensor *tensor) { - size_t ret = 1; - for (int i = 0; i < TF_NumDims(tensor); ++i) { - ret *= TF_Dim(tensor, i); - } - return ret; -} - -// Split a string into an array of characters array with `,` as delimiter. -inline std::vector splitStringByComma(const std::string &str) { - std::vector tokens; - size_t prev = 0, pos = 0; - do { - pos = str.find(',', prev); - if (pos == std::string::npos) pos = str.length(); - std::string token = str.substr(prev, pos - prev); - if (!token.empty()) { - char *cstr = new char[str.length() + 1]; - std::strcpy(cstr, token.c_str()); - tokens.push_back(cstr); - } - prev = pos + 1; - } while (pos < str.length() && prev < str.length()); - return tokens; -} - -} // namespace tfnodejs - -#endif // TF_NODEJS_UTILS_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Makefile b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Makefile deleted file mode 100644 index 7606ebf0c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Makefile +++ /dev/null @@ -1,329 +0,0 @@ -# We borrow heavily from the kernel build setup, though we are simpler since -# we don't have Kconfig tweaking settings on us. - -# The implicit make rules have it looking for RCS files, among other things. -# We instead explicitly write all the rules we care about. -# It's even quicker (saves ~200ms) to pass -r on the command line. -MAKEFLAGS=-r - -# The source directory tree. -srcdir := .. -abs_srcdir := $(abspath $(srcdir)) - -# The name of the builddir. -builddir_name ?= . - -# The V=1 flag on command line makes us verbosely print command lines. -ifdef V - quiet= -else - quiet=quiet_ -endif - -# Specify BUILDTYPE=Release on the command line for a release build. -BUILDTYPE ?= Release - -# Directory all our build output goes into. -# Note that this must be two directories beneath src/ for unit tests to pass, -# as they reach into the src/ directory for data with relative paths. -builddir ?= $(builddir_name)/$(BUILDTYPE) -abs_builddir := $(abspath $(builddir)) -depsdir := $(builddir)/.deps - -# Object output directory. -obj := $(builddir)/obj -abs_obj := $(abspath $(obj)) - -# We build up a list of every single one of the targets so we can slurp in the -# generated dependency rule Makefiles in one pass. -all_deps := - - - -CC.target ?= $(CC) -CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) -CXX.target ?= $(CXX) -CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) -LINK.target ?= $(LINK) -LDFLAGS.target ?= $(LDFLAGS) -AR.target ?= $(AR) - -# C++ apps need to be linked with g++. -LINK ?= $(CXX.target) - -# TODO(evan): move all cross-compilation logic to gyp-time so we don't need -# to replicate this environment fallback in make as well. -CC.host ?= gcc -CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) -CXX.host ?= g++ -CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) -LINK.host ?= $(CXX.host) -LDFLAGS.host ?= $(LDFLAGS_host) -AR.host ?= ar - -# Define a dir function that can handle spaces. -# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions -# "leading spaces cannot appear in the text of the first argument as written. -# These characters can be put into the argument value by variable substitution." -empty := -space := $(empty) $(empty) - -# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces -replace_spaces = $(subst $(space),?,$1) -unreplace_spaces = $(subst ?,$(space),$1) -dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) - -# Flags to make gcc output dependency info. Note that you need to be -# careful here to use the flags that ccache and distcc can understand. -# We write to a dep file on the side first and then rename at the end -# so we can't end up with a broken dep file. -depfile = $(depsdir)/$(call replace_spaces,$@).d -DEPFLAGS = -MMD -MF $(depfile).raw - -# We have to fixup the deps output in a few ways. -# (1) the file output should mention the proper .o file. -# ccache or distcc lose the path to the target, so we convert a rule of -# the form: -# foobar.o: DEP1 DEP2 -# into -# path/to/foobar.o: DEP1 DEP2 -# (2) we want missing files not to cause us to fail to build. -# We want to rewrite -# foobar.o: DEP1 DEP2 \ -# DEP3 -# to -# DEP1: -# DEP2: -# DEP3: -# so if the files are missing, they're just considered phony rules. -# We have to do some pretty insane escaping to get those backslashes -# and dollar signs past make, the shell, and sed at the same time. -# Doesn't work with spaces, but that's fine: .d files have spaces in -# their names replaced with other characters. -define fixup_dep -# The depfile may not exist if the input file didn't have any #includes. -touch $(depfile).raw -# Fixup path as in (1). -sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef - -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c - -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") - -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group - -# We support two kinds of shared objects (.so): -# 1) shared_library, which is just bundling together many dependent libraries -# into a link line. -# 2) loadable_module, which is generating a module intended for dlopen(). -# -# They differ only slightly: -# In the former case, we want to package all dependent code into the .so. -# In the latter case, we want to package just the API exposed by the -# outermost module. -# This means shared_library uses --whole-archive, while loadable_module doesn't. -# (Note that --whole-archive is incompatible with the --start-group used in -# normal linking.) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) - - -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' - -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain ? instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\ - for p in $(POSTBUILDS); do\ - eval $$p;\ - E=$$?;\ - if [ $$E -ne 0 ]; then\ - break;\ - fi;\ - done;\ - if [ $$E -ne 0 ]; then\ - rm -rf "$@";\ - exit $$E;\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains ? for -# spaces already and dirx strips the ? characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word 1,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "all" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: all -all: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -TOOLSET := target -# Suffix rules, putting all outputs into $(obj). -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - -# Try building from generated source, too. -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - -$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - - -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,action_after_build.target.mk)))),) - include action_after_build.target.mk -endif -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,tfjs_binding.target.mk)))),) - include tfjs_binding.target.mk -endif - -quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /usr/share/nodejs/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build/config.gypi -I/usr/share/nodejs/node-gyp/addon.gypi -I/usr/include/nodejs/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/usr/include/nodejs" "-Dnode_gyp_dir=/usr/share/nodejs/node-gyp" "-Dnode_lib_file=/usr/include/nodejs/<(target_arch)/node.lib" "-Dmodule_root_dir=/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node" "-Dnode_engine=v8" binding.gyp -Makefile: $(srcdir)/../../../../../../../../../../../../usr/include/nodejs/common.gypi $(srcdir)/../../../../../../../../../../../../usr/share/nodejs/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp - $(call do_cmd,regen_makefile) - -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/action_after_build.stamp.d b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/action_after_build.stamp.d deleted file mode 100644 index 71e13c401..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/action_after_build.stamp.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/obj.target/action_after_build.stamp := touch Release/obj.target/action_after_build.stamp diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding.node.d b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding.node.d deleted file mode 100644 index dbb13178e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/obj.target/tfjs_binding.node := g++ -o Release/obj.target/tfjs_binding.node -shared -pthread -rdynamic -m64 -L/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/lib -Wl,-soname=tfjs_binding.node -Wl,--start-group Release/obj.target/tfjs_binding/binding/tfjs_backend.o Release/obj.target/tfjs_binding/binding/tfjs_binding.o -Wl,--end-group -lnode -Wl,-rpath,\$$ORIGIN/../../deps/lib -ltensorflow -ltensorflow_framework diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_backend.o.d b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_backend.o.d deleted file mode 100644 index 1a55a26dc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_backend.o.d +++ /dev/null @@ -1,37 +0,0 @@ -cmd_Release/obj.target/tfjs_binding/binding/tfjs_backend.o := g++ -o Release/obj.target/tfjs_binding/binding/tfjs_backend.o ../binding/tfjs_backend.cc '-DNODE_GYP_MODULE_NAME=tfjs_binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../.. -I/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_backend.o.d.raw -c -Release/obj.target/tfjs_binding/binding/tfjs_backend.o: \ - ../binding/tfjs_backend.cc ../binding/tfjs_backend.h \ - /usr/include/nodejs/src/node_api.h \ - /usr/include/nodejs/src/node_api_types.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h \ - ../binding/napi_auto_ref.h ../binding/utils.h \ - ../binding/tf_auto_status.h ../binding/tf_auto_tensor.h \ - ../binding/tfe_auto_op.h -../binding/tfjs_backend.cc: -../binding/tfjs_backend.h: -/usr/include/nodejs/src/node_api.h: -/usr/include/nodejs/src/node_api_types.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h: -../binding/napi_auto_ref.h: -../binding/utils.h: -../binding/tf_auto_status.h: -../binding/tf_auto_tensor.h: -../binding/tfe_auto_op.h: diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_binding.o.d b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_binding.o.d deleted file mode 100644 index 5bd06f7c7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_binding.o.d +++ /dev/null @@ -1,31 +0,0 @@ -cmd_Release/obj.target/tfjs_binding/binding/tfjs_binding.o := g++ -o Release/obj.target/tfjs_binding/binding/tfjs_binding.o ../binding/tfjs_binding.cc '-DNODE_GYP_MODULE_NAME=tfjs_binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../.. -I/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/tfjs_binding/binding/tfjs_binding.o.d.raw -c -Release/obj.target/tfjs_binding/binding/tfjs_binding.o: \ - ../binding/tfjs_binding.cc /usr/include/nodejs/src/node_api.h \ - /usr/include/nodejs/src/node_api_types.h ../binding/tfjs_backend.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h \ - /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h \ - ../binding/utils.h ../binding/tf_auto_status.h -../binding/tfjs_binding.cc: -/usr/include/nodejs/src/node_api.h: -/usr/include/nodejs/src/node_api_types.h: -../binding/tfjs_backend.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h: -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h: -../binding/utils.h: -../binding/tf_auto_status.h: diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/tfjs_binding.node.d b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/tfjs_binding.node.d deleted file mode 100644 index f7bf9b3fb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/.deps/Release/tfjs_binding.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/tfjs_binding.node := ln -f "Release/obj.target/tfjs_binding.node" "Release/tfjs_binding.node" 2>/dev/null || (rm -rf "Release/tfjs_binding.node" && cp -af "Release/obj.target/tfjs_binding.node" "Release/tfjs_binding.node") diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/action_after_build.stamp b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/action_after_build.stamp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding.node b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding.node deleted file mode 100755 index a656bb9caeb3fe287c12186701d4e8ba024a267f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87424 zcmd3P31C#!_4kBD;}R#RShOzDqJj%0AeyMujAY=A%wRO2xL^n&Kom%XiGUi3CIdXj z(OAXe*2Y#XZCzq57E{q63aC{9tKtrI;XQ-0sDLZq?|1HdZ|*!YcKMe7H%i_+=iPhm zxo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WS&}fMXCNh?Nh3x fTh4J~OXX@Twt-a4|BVin{|p5*Im_$ZAo0HeMg#6; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_backend.o b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_backend.o deleted file mode 100644 index 50a010fe10c4e488b47d26f37fa9a9da67f14390..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87160 zcmeFa3w%`7)iypMsPQ`Sj#levQNe2hh(vA8NCwWpM4|!p)nW)CTr4C=CJI_gBpKm2 zjAAR*UVNKY+frLws$wZE8bE>Cs;ISIt5~%%#S7jLul%32_TDqkOfnGq_WOUo@B4j+ zUpVJHXPvdzUVH7e*S?*Z7m1DNQ&bdiM^WHwf$W__1A*DYvuLHlm4T|jaHTyM_lMx` zQ2YtiVfZ^7fBo=x1pWm368?^|*T>>~oW1@E&i(E6@i?DguTR8zfW01w^GWvlWSmd2 z*Qerqn!P?9=Q4X;j`JXUeJ0Ms>~#gsXW@^Jai0HrcwBgF)c?%8?#+#T0)d#Hn6P8V zj+mdCic?2d{42qMiJ79xw8G zeqtDC%e!K!yDLB6vBOJ6N~8V;z-73LrBVZM`uzt`Nz8x8OC>5nyiyeOfMDwr@;HRs z^@&q(B{>p~xZI4(K>4vf3^Pm zUi+K0Fm3oP7@t}Dv_)b?icwklkl4!DTe=k{C;+?Ij zwuT^a2^8~y*j)JQbT0;Nr0VO!%T|f1Q^a z_p4YcvI2(TKkB8bm#KZ!dj9({e;eeRz-ru3-gSjhM);EOe6)z{`LP}o@ky<}uVri6ous=o4a zfykT=3B<>$P_kc@=A}eoy2Ib__s5)gsLTyzrn{NX(BcRK{BMP^eHr z)L-i*)taK~hnIpV5KWCP1*_6(zo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~~vtH>-X|e7Kmuv2N3M{)be*Tn(XrjV$JG`a4qed&a5%%@qCO zYeN57AO9r4>;GK!&)0TZ)u;M6w_I%B>ffoq>6q{jf1lH0IHT-~Ve>h%Yf^oFb J^QODeKLO{3DR%$> diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_binding.o b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/obj.target/tfjs_binding/binding/tfjs_binding.o deleted file mode 100644 index 14b96b8f39916685cc1c698bc4544f32f5a54045..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19880 zcmd6v4Rn;%naAHS2$T;8saCBnj2~1&Wz0+>1V3s5Ofta@-wy|m@2De&j7nRCB&;6MB&z*S# zTF=?Nhnacb-+k_LpZh$|z4v|JneaVdpk`c2iKR=4^(`xRrm1E1)#i??#9@_nl69hx zoj~UkRrLYq%uoD1$MBgy{h7a~a)b{%+|F5>_`u@&W`Fvf>ZZE%A%CWMuYcqIIqm+Q z@w4Yptv~JC=NZuLdo1T;4{s&Bk6u=FnksyIeW`)u*Zn>9``Z2GQ$?d>vw!2RIn^sy zJ?orh`7_DkK>A((Zr?CB5-q9OaQ|I&MiqgKv@J7@tNlIH;9PN(8VERj1D*lV!ZR@X z198wR?Dctm!6r9XH~BO5LuB<%GCq*;4Uq9wrt!OdJI9em(L6QaOnpKpfgaz^x{U`* zoVPTQa|4-mJN!M#AvP!do)S#fZ``nBymQl?Y?idH|HpJp?vNIew6ZO4^v;x%RFVg( zs#jL8Vjpxn^ur*Zik9Su!Tww5?DP2Hjt=LnCG4r>UNTl2K|%N-+nbDLgH=!U zfAIG-4^hxXcOy-Q4r*f55$&i=Z~sg>ql&^5FSehKZpr0)@;0gOHq>`p|Cygh--u7=F|O}&eyhyO>=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f{qs1@{+}bp z{cAtbp(uT-e}1NcMaNBlzC@M!80Ge;_Q?3yl;wSv_dg>|ti7tei|Vjw`!)L?I$)h< z`-7_e2S$fx`#(|JV*XpJ{8y>kv;TPi(Cu~niuFxm);_-Ip`xGf@^s>qG~4rIOf&X` htevy@-LiJ+3l4c&;6Gk_i?!ccBO6RI#&4Wj{|lngNMis1 diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/tfjs_binding.node b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/Release/tfjs_binding.node deleted file mode 100755 index a656bb9caeb3fe287c12186701d4e8ba024a267f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87424 zcmd3P31C#!_4kBD;}R#RShOzDqJj%0AeyMujAY=A%wRO2xL^n&Kom%XiGUi3CIdXj z(OAXe*2Y#XZCzq57E{q63aC{9tKtrI;XQ-0sDLZq?|1HdZ|*!YcKMe7H%i_+=iPhm zxo5lQF7sw?I6AyrPENr6bPxO@K&azZy?~Wx7w-azxH*? zyH~csPx;63iT_P|Wlp_;-zhr&>$^%!0r%>*cOL3dF8}Vw5oh3hr@d@?SnBlKy*kZ{ zEJ=elGh)=30E%^xm+lS&yg%51`Mmg zSe`P^J-l!8V+%&--hN2W@<48GkNnaRcdvZx;M}86zOc09j(zrH**W;vfPdHFUnBlC z;a@ZU@iPzq=F43mU^-V`lK6L%1K)yc3;x~azzcD`1OI-7e|O^FUHHe(-RdHLe~rJt z!M|340)gK-*ZXlDIimLAf3%HzbnS2co-X|MjHL77YFB^;_#-+uHx$-`{x7vu)jLUw^zK9SZ`R#<&4q2Ro&V5N(L*P{_22;wczW%^(-&uay+n;bi+=q%3;#a_k*?@mmWBV}S=xOyOZnHc^mkL1@+V~B=YlNlK7pXn z75|g7l<$>={;#vh`PW(Op?2S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h*kA{A%KE*oBn z;nvlh^m1VcOKTO^kNhExyN@hh9&BZ6?OeK$?YI9;?9AyYfvxXQDCh25L}r8epo{f1 zkHMLQcnKOoJkj9Q53N4zy^@JWVt8PLt?rAbl$8@hBM-(GOM$DY@mn@*tRGAjUe36Jzo7*yknGPW0 zPlkg!g=0|dS}bhTI&n*_gX$|JlJSdhLO2u948*97Z%Kiff;i@zpKO$qGTk>8o@MQ1 zj50_nlgt~n^gh<8MY0y>QL04F#yRMGsCg~FfvwG^<9J_b)Y^mcDt9mrZu(B~kmleV zI!(E#P%vNtV?zmWMmba-FwC?smoxBz$Plj>$`>#HI)Kl@c#ph%-s|j3)ZgEmKKA+>=&H~W+_5Ml?*ZAbubQ%sK zKbaahq4Q}--_yCv*ZUeZeCTev2L z!#bltKfgDDC)?Ng_5R*nl7FEnhWamEI={Aq+ktbJulE7(U7+gU#<@!W==>V~!I$6J zFT7CY-|JJD&Zi;$LXx|Dy`O&K6qSFlR5Yhd-~C*W5iebTy&rTD{jw6S%lY5ZKV~V( zsS`m)lyyG5&VPXqueho_^oZ^q+jr4kF6B?0s*v~`*jR}_U2knyWS&}fMXCNh?Nh3x fTh4J~OXX@Twt-a4|BVin{|p5*Im_$ZAo0HeMg#6; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/action_after_build.target.mk b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/action_after_build.target.mk deleted file mode 100644 index 788fcba84..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/action_after_build.target.mk +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by gyp; do not edit. - -TOOLSET := target -TARGET := action_after_build -### Generated for copy rule. -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node: TOOLSET := $(TOOLSET) -/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node: $(builddir)/tfjs_binding.node FORCE_DO_CMD - $(call do_cmd,copy) - -all_deps += /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node -binding_gyp_action_after_build_target_copies = /home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node - -### Rules for final target. -# Build our special outputs first. -$(obj).target/action_after_build.stamp: | $(binding_gyp_action_after_build_target_copies) - -# Preserve order dependency of special output on deps. -$(binding_gyp_action_after_build_target_copies): | $(builddir)/tfjs_binding.node - -$(obj).target/action_after_build.stamp: TOOLSET := $(TOOLSET) -$(obj).target/action_after_build.stamp: $(builddir)/tfjs_binding.node FORCE_DO_CMD - $(call do_cmd,touch) - -all_deps += $(obj).target/action_after_build.stamp -# Add target alias -.PHONY: action_after_build -action_after_build: $(obj).target/action_after_build.stamp - -# Add target alias to "all" target. -.PHONY: all -all: action_after_build - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/binding.Makefile b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/binding.Makefile deleted file mode 100644 index 5a3c6a0e9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/binding.Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# This file is generated by gyp; do not edit. - -export builddir_name ?= ./build/. -.PHONY: all -all: - $(MAKE) tfjs_binding action_after_build diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/config.gypi b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/config.gypi deleted file mode 100644 index 86935192d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/config.gypi +++ /dev/null @@ -1,201 +0,0 @@ -# Do not edit. File was generated by node-gyp's "configure" step -{ - "target_defaults": { - "cflags": [], - "default_configuration": "Release", - "defines": [], - "include_dirs": [], - "libraries": [] - }, - "variables": { - "arch_triplet": "x86_64-linux-gnu", - "asan": 0, - "build_v8_with_gn": "false", - "coverage": "false", - "debug_nghttp2": "false", - "enable_lto": "false", - "enable_pgo_generate": "false", - "enable_pgo_use": "false", - "force_dynamic_crt": 1, - "host_arch": "x64", - "icu_gyp_path": "tools/icu/icu-system.gyp", - "icu_small": "false", - "icu_ver_major": "66", - "llvm_version": 0, - "node_byteorder": "little", - "node_debug_lib": "false", - "node_enable_d8": "false", - "node_enable_v8_vtunejit": "false", - "node_install_npm": "false", - "node_module_version": 64, - "node_no_browser_globals": "false", - "node_prefix": "/usr", - "node_relative_path": "lib/x86_64-linux-gnu/nodejs:share/nodejs:lib/nodejs", - "node_release_urlbase": "", - "node_shared": "true", - "node_shared_cares": "true", - "node_shared_http_parser": "false", - "node_shared_libuv": "true", - "node_shared_nghttp2": "true", - "node_shared_openssl": "true", - "node_shared_zlib": "true", - "node_tag": "", - "node_target_type": "shared_library", - "node_use_bundled_v8": "true", - "node_use_dtrace": "false", - "node_use_etw": "false", - "node_use_large_pages": "false", - "node_use_openssl": "true", - "node_use_pch": "false", - "node_use_perfctr": "false", - "node_use_v8_platform": "true", - "node_with_ltcg": "false", - "node_without_node_options": "false", - "openssl_fips": "", - "openssl_no_asm": 0, - "shlib_suffix": "so.64", - "target_arch": "x64", - "v8_enable_gdbjit": 0, - "v8_enable_i18n_support": 1, - "v8_enable_inspector": 1, - "v8_no_strict_aliasing": 1, - "v8_optimized_debug": 0, - "v8_promise_internal_field_count": 1, - "v8_random_seed": 0, - "v8_trace_maps": 0, - "v8_typed_array_max_size_in_heap": 0, - "v8_use_snapshot": "false", - "want_separate_host_toolset": 0, - "nodedir": "/usr/include/nodejs", - "standalone_static_library": 1, - "fallback_to_build": "true", - "module": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node", - "module_name": "tfjs_binding", - "module_path": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5", - "napi_version": "5", - "node_abi_napi": "napi", - "napi_build_version": "5", - "node_napi_label": "napi-v5", - "cache_lock_stale": "60000", - "ham_it_up": "", - "legacy_bundling": "", - "sign_git_tag": "", - "user_agent": "npm/6.14.4 node/v10.19.0 linux x64", - "always_auth": "", - "bin_links": "true", - "key": "", - "allow_same_version": "", - "description": "true", - "fetch_retries": "2", - "heading": "npm", - "if_present": "", - "init_version": "1.0.0", - "user": "", - "prefer_online": "", - "force": "", - "only": "", - "read_only": "", - "cache_min": "10", - "init_license": "ISC", - "editor": "vi", - "rollback": "true", - "tag_version_prefix": "v", - "cache_max": "Infinity", - "timing": "", - "userconfig": "/home/brenden/.npmrc", - "engine_strict": "", - "init_author_name": "", - "init_author_url": "", - "preid": "", - "tmp": "/tmp", - "depth": "Infinity", - "package_lock_only": "", - "save_dev": "", - "usage": "", - "metrics_registry": "https://registry.npmjs.org/", - "otp": "", - "package_lock": "true", - "progress": "true", - "https_proxy": "", - "save_prod": "", - "audit": "true", - "cidr": "", - "onload_script": "", - "sso_type": "oauth", - "rebuild_bundle": "true", - "save_bundle": "", - "shell": "/bin/bash", - "prefix": "/usr/local", - "dry_run": "", - "format_package_lock": "true", - "scope": "", - "browser": "", - "cache_lock_wait": "10000", - "ignore_prepublish": "", - "registry": "https://registry.npmjs.org/", - "save_optional": "", - "searchopts": "", - "versions": "", - "cache": "/home/brenden/.npm", - "send_metrics": "", - "global_style": "", - "ignore_scripts": "", - "version": "", - "local_address": "", - "viewer": "man", - "node_gyp": "/usr/bin/node-gyp", - "audit_level": "low", - "prefer_offline": "", - "color": "true", - "sign_git_commit": "", - "fetch_retry_mintimeout": "10000", - "maxsockets": "50", - "offline": "", - "sso_poll_frequency": "500", - "umask": "0002", - "fund": "true", - "fetch_retry_maxtimeout": "60000", - "logs_max": "10", - "message": "%s", - "ca": "", - "cert": "", - "global": "", - "link": "", - "access": "", - "also": "", - "save": "true", - "unicode": "true", - "before": "", - "long": "", - "production": "", - "searchlimit": "20", - "unsafe_perm": "true", - "update_notifier": "true", - "auth_type": "legacy", - "node_version": "10.19.0", - "tag": "latest", - "git_tag_version": "true", - "commit_hooks": "true", - "script_shell": "", - "shrinkwrap": "true", - "fetch_retry_factor": "10", - "save_exact": "", - "strict_ssl": "true", - "globalconfig": "/etc/npmrc", - "dev": "", - "init_module": "/home/brenden/.npm-init.js", - "parseable": "", - "globalignorefile": "/etc/npmignore", - "cache_lock_retries": "10", - "searchstaleness": "900", - "node_options": "", - "save_prefix": "^", - "scripts_prepend_node_path": "warn-only", - "group": "1000", - "init_author_email": "", - "searchexclude": "", - "git": "git", - "optional": "true", - "json": "" - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/tfjs_binding.target.mk b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/tfjs_binding.target.mk deleted file mode 100644 index 36b2721ec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/build-tmp-napi-v5/tfjs_binding.target.mk +++ /dev/null @@ -1,160 +0,0 @@ -# This file is generated by gyp; do not edit. - -TOOLSET := target -TARGET := tfjs_binding -DEFS_Debug := \ - '-DNODE_GYP_MODULE_NAME=tfjs_binding' \ - '-DUSING_UV_SHARED=1' \ - '-DUSING_V8_SHARED=1' \ - '-DV8_DEPRECATION_WARNINGS=1' \ - '-D_LARGEFILE_SOURCE' \ - '-D_FILE_OFFSET_BITS=64' \ - '-DBUILDING_NODE_EXTENSION' \ - '-DDEBUG' \ - '-D_DEBUG' \ - '-DV8_ENABLE_CHECKS' - -# Flags passed to all source files. -CFLAGS_Debug := \ - -fPIC \ - -pthread \ - -Wall \ - -Wextra \ - -Wno-unused-parameter \ - -m64 \ - -fPIC \ - -g \ - -O0 - -# Flags passed to only C files. -CFLAGS_C_Debug := - -# Flags passed to only C++ files. -CFLAGS_CC_Debug := \ - -fno-rtti \ - -fno-exceptions \ - -std=gnu++1y - -INCS_Debug := \ - -I/usr/include/nodejs/include/node \ - -I/usr/include/nodejs/src \ - -I/usr/include/nodejs/deps/openssl/config \ - -I/usr/include/nodejs/deps/openssl/openssl/include \ - -I/usr/include/nodejs/deps/uv/include \ - -I/usr/include/nodejs/deps/zlib \ - -I/usr/include/nodejs/deps/v8/include \ - -I$(srcdir)/.. \ - -I/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include - -DEFS_Release := \ - '-DNODE_GYP_MODULE_NAME=tfjs_binding' \ - '-DUSING_UV_SHARED=1' \ - '-DUSING_V8_SHARED=1' \ - '-DV8_DEPRECATION_WARNINGS=1' \ - '-D_LARGEFILE_SOURCE' \ - '-D_FILE_OFFSET_BITS=64' \ - '-DBUILDING_NODE_EXTENSION' - -# Flags passed to all source files. -CFLAGS_Release := \ - -fPIC \ - -pthread \ - -Wall \ - -Wextra \ - -Wno-unused-parameter \ - -m64 \ - -fPIC \ - -O3 \ - -fno-omit-frame-pointer - -# Flags passed to only C files. -CFLAGS_C_Release := - -# Flags passed to only C++ files. -CFLAGS_CC_Release := \ - -fno-rtti \ - -fno-exceptions \ - -std=gnu++1y - -INCS_Release := \ - -I/usr/include/nodejs/include/node \ - -I/usr/include/nodejs/src \ - -I/usr/include/nodejs/deps/openssl/config \ - -I/usr/include/nodejs/deps/openssl/openssl/include \ - -I/usr/include/nodejs/deps/uv/include \ - -I/usr/include/nodejs/deps/zlib \ - -I/usr/include/nodejs/deps/v8/include \ - -I$(srcdir)/.. \ - -I/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include - -OBJS := \ - $(obj).target/$(TARGET)/binding/tfjs_backend.o \ - $(obj).target/$(TARGET)/binding/tfjs_binding.o - -# Add to the list of files we specially track dependencies for. -all_deps += $(OBJS) - -# CFLAGS et al overrides must be target-local. -# See "Target-specific Variable Values" in the GNU Make manual. -$(OBJS): TOOLSET := $(TOOLSET) -$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) -$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) - -# Suffix rules, putting all outputs into $(obj). - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -# Try building from generated source, too. - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -# End of this set of suffix rules -### Rules for final target. -LDFLAGS_Debug := \ - -pthread \ - -rdynamic \ - -m64 \ - -L/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/lib - -LDFLAGS_Release := \ - -pthread \ - -rdynamic \ - -m64 \ - -L/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/lib - -LIBS := \ - -lnode \ - -Wl,-rpath,\$$ORIGIN/../../deps/lib \ - -ltensorflow \ - -ltensorflow_framework - -$(obj).target/tfjs_binding.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) -$(obj).target/tfjs_binding.node: LIBS := $(LIBS) -$(obj).target/tfjs_binding.node: TOOLSET := $(TOOLSET) -$(obj).target/tfjs_binding.node: $(OBJS) FORCE_DO_CMD - $(call do_cmd,solink_module) - -all_deps += $(obj).target/tfjs_binding.node -# Add target alias -.PHONY: tfjs_binding -tfjs_binding: $(builddir)/tfjs_binding.node - -# Copy this to the executable output path. -$(builddir)/tfjs_binding.node: TOOLSET := $(TOOLSET) -$(builddir)/tfjs_binding.node: $(obj).target/tfjs_binding.node FORCE_DO_CMD - $(call do_cmd,copy) - -all_deps += $(builddir)/tfjs_binding.node -# Short alias for building this executable. -.PHONY: tfjs_binding.node -tfjs_binding.node: $(obj).target/tfjs_binding.node $(builddir)/tfjs_binding.node - -# Add executable to "all" target. -.PHONY: all -all: $(builddir)/tfjs_binding.node - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/LICENSE deleted file mode 100755 index 40f8c3476..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ -Copyright 2019 The TensorFlow Authors. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES deleted file mode 100755 index 27f058ee4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES +++ /dev/null @@ -1,8963 +0,0 @@ --------------------------------------------------------------------------------- -BEGIN LICENSE FOR third_party/eigen3/LICENSE --------------------------------------------------------------------------------- -Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: - http://www.mozilla.org/MPL/2.0/ - http://www.mozilla.org/MPL/2.0/FAQ.html - -Some files contain third-party code under BSD or LGPL licenses, whence -the other COPYING.* files here. - -All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. -For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. - -If you want to guarantee that the Eigen code that you are #including -is licensed under the MPL2 and possibly more permissive licenses (like -BSD), #define this preprocessor symbol: EIGEN_MPL2_ONLY -For example, with most compilers, you could add this to your project - CXXFLAGS: -DEIGEN_MPL2_ONLY -This will cause a compilation error to be generated if you #include -any code that is LGPL licensed. - ----------------------------------------------------------------------- -Following applies to: -./test/mapstaticmethods.cpp -./test/schur_real.cpp -./test/prec_inverse_4x4.cpp -./test/smallvectors.cpp -./test/redux.cpp -./test/special_numbers.cpp -./test/adjoint.cpp -./test/resize.cpp -./test/mixingtypes.cpp -./test/product_trmv.cpp -./test/sparse_solvers.cpp -./test/cholesky.cpp -./test/geo_quaternion.cpp -./test/miscmatrices.cpp -./test/stddeque.cpp -./test/integer_types.cpp -./test/product_large.cpp -./test/eigensolver_generic.cpp -./test/householder.cpp -./test/geo_orthomethods.cpp -./test/array_for_matrix.cpp -./test/sparseLM.cpp -./test/upperbidiagonalization.cpp -./test/nomalloc.cpp -./test/packetmath.cpp -./test/jacobisvd.cpp -./test/geo_transformations.cpp -./test/swap.cpp -./test/eigensolver_selfadjoint.cpp -./test/inverse.cpp -./test/product_selfadjoint.cpp -./test/product_trsolve.cpp -./test/product_extra.cpp -./test/sparse_solver.h -./test/mapstride.cpp -./test/mapped_matrix.cpp -./test/geo_eulerangles.cpp -./test/eigen2support.cpp -./test/denseLM.cpp -./test/stdvector.cpp -./test/nesting_ops.cpp -./test/sparse_permutations.cpp -./test/zerosized.cpp -./test/exceptions.cpp -./test/vectorwiseop.cpp -./test/cwiseop.cpp -./test/basicstuff.cpp -./test/product_trmm.cpp -./test/linearstructure.cpp -./test/sparse_product.cpp -./test/stdvector_overload.cpp -./test/stable_norm.cpp -./test/umeyama.cpp -./test/unalignedcount.cpp -./test/triangular.cpp -./test/product_mmtr.cpp -./test/sparse_basic.cpp -./test/sparse_vector.cpp -./test/meta.cpp -./test/real_qz.cpp -./test/ref.cpp -./test/eigensolver_complex.cpp -./test/cholmod_support.cpp -./test/conjugate_gradient.cpp -./test/sparse.h -./test/simplicial_cholesky.cpp -./test/bicgstab.cpp -./test/dynalloc.cpp -./test/product_notemporary.cpp -./test/geo_hyperplane.cpp -./test/lu.cpp -./test/qr.cpp -./test/hessenberg.cpp -./test/sizeof.cpp -./test/main.h -./test/selfadjoint.cpp -./test/permutationmatrices.cpp -./test/superlu_support.cpp -./test/qtvector.cpp -./test/geo_homogeneous.cpp -./test/determinant.cpp -./test/array_reverse.cpp -./test/unalignedassert.cpp -./test/stdlist.cpp -./test/product_symm.cpp -./test/corners.cpp -./test/dontalign.cpp -./test/visitor.cpp -./test/geo_alignedbox.cpp -./test/diagonalmatrices.cpp -./test/product_small.cpp -./test/eigensolver_generalized_real.cpp -./test/umfpack_support.cpp -./test/first_aligned.cpp -./test/qr_fullpivoting.cpp -./test/array_replicate.cpp -./test/geo_parametrizedline.cpp -./test/eigen2/eigen2_unalignedassert.cpp -./test/eigen2/eigen2_prec_inverse_4x4.cpp -./test/eigen2/eigen2_alignedbox.cpp -./test/eigen2/eigen2_sparse_product.cpp -./test/eigen2/eigen2_meta.cpp -./test/eigen2/eigen2_nomalloc.cpp -./test/eigen2/eigen2_visitor.cpp -./test/eigen2/eigen2_packetmath.cpp -./test/eigen2/eigen2_svd.cpp -./test/eigen2/eigen2_mixingtypes.cpp -./test/eigen2/eigen2_qr.cpp -./test/eigen2/eigen2_cwiseop.cpp -./test/eigen2/eigen2_geometry_with_eigen2_prefix.cpp -./test/eigen2/eigen2_smallvectors.cpp -./test/eigen2/eigen2_commainitializer.cpp -./test/eigen2/eigen2_sparse_solvers.cpp -./test/eigen2/eigen2_hyperplane.cpp -./test/eigen2/eigen2_eigensolver.cpp -./test/eigen2/eigen2_linearstructure.cpp -./test/eigen2/eigen2_sizeof.cpp -./test/eigen2/eigen2_parametrizedline.cpp -./test/eigen2/eigen2_lu.cpp -./test/eigen2/eigen2_adjoint.cpp -./test/eigen2/eigen2_geometry.cpp -./test/eigen2/eigen2_stdvector.cpp -./test/eigen2/eigen2_newstdvector.cpp -./test/eigen2/eigen2_submatrices.cpp -./test/eigen2/sparse.h -./test/eigen2/eigen2_swap.cpp -./test/eigen2/eigen2_triangular.cpp -./test/eigen2/eigen2_basicstuff.cpp -./test/eigen2/gsl_helper.h -./test/eigen2/eigen2_dynalloc.cpp -./test/eigen2/eigen2_array.cpp -./test/eigen2/eigen2_map.cpp -./test/eigen2/main.h -./test/eigen2/eigen2_miscmatrices.cpp -./test/eigen2/eigen2_product_large.cpp -./test/eigen2/eigen2_first_aligned.cpp -./test/eigen2/eigen2_cholesky.cpp -./test/eigen2/eigen2_determinant.cpp -./test/eigen2/eigen2_sum.cpp -./test/eigen2/eigen2_inverse.cpp -./test/eigen2/eigen2_regression.cpp -./test/eigen2/eigen2_product_small.cpp -./test/eigen2/eigen2_qtvector.cpp -./test/eigen2/eigen2_sparse_vector.cpp -./test/eigen2/product.h -./test/eigen2/eigen2_sparse_basic.cpp -./test/eigen2/eigen2_bug_132.cpp -./test/array.cpp -./test/product_syrk.cpp -./test/commainitializer.cpp -./test/conservative_resize.cpp -./test/qr_colpivoting.cpp -./test/nullary.cpp -./test/bandmatrix.cpp -./test/pastix_support.cpp -./test/product.h -./test/block.cpp -./test/vectorization_logic.cpp -./test/jacobi.cpp -./test/diagonal.cpp -./test/schur_complex.cpp -./test/sizeoverflow.cpp -./bench/BenchTimer.h -./bench/benchFFT.cpp -./bench/eig33.cpp -./bench/spbench/spbenchsolver.h -./bench/spbench/spbenchstyle.h -./lapack/complex_double.cpp -./lapack/cholesky.cpp -./lapack/lapack_common.h -./lapack/eigenvalues.cpp -./lapack/single.cpp -./lapack/lu.cpp -./lapack/complex_single.cpp -./lapack/double.cpp -./demos/mix_eigen_and_c/binary_library.cpp -./demos/mix_eigen_and_c/binary_library.h -./demos/mix_eigen_and_c/example.c -./demos/mandelbrot/mandelbrot.cpp -./demos/mandelbrot/mandelbrot.h -./demos/opengl/icosphere.cpp -./demos/opengl/icosphere.h -./demos/opengl/camera.cpp -./demos/opengl/quaternion_demo.h -./demos/opengl/camera.h -./demos/opengl/trackball.h -./demos/opengl/gpuhelper.h -./demos/opengl/trackball.cpp -./demos/opengl/gpuhelper.cpp -./demos/opengl/quaternion_demo.cpp -./debug/gdb/printers.py -./unsupported/test/minres.cpp -./unsupported/test/openglsupport.cpp -./unsupported/test/jacobisvd.cpp -./unsupported/test/dgmres.cpp -./unsupported/test/matrix_square_root.cpp -./unsupported/test/bdcsvd.cpp -./unsupported/test/matrix_exponential.cpp -./unsupported/test/forward_adolc.cpp -./unsupported/test/polynomialsolver.cpp -./unsupported/test/matrix_function.cpp -./unsupported/test/sparse_extra.cpp -./unsupported/test/matrix_functions.h -./unsupported/test/svd_common.h -./unsupported/test/FFTW.cpp -./unsupported/test/alignedvector3.cpp -./unsupported/test/autodiff.cpp -./unsupported/test/gmres.cpp -./unsupported/test/BVH.cpp -./unsupported/test/levenberg_marquardt.cpp -./unsupported/test/matrix_power.cpp -./unsupported/test/kronecker_product.cpp -./unsupported/test/splines.cpp -./unsupported/test/polynomialutils.cpp -./unsupported/bench/bench_svd.cpp -./unsupported/Eigen/IterativeSolvers -./unsupported/Eigen/src/IterativeSolvers/DGMRES.h -./unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h -./unsupported/Eigen/src/IterativeSolvers/GMRES.h -./unsupported/Eigen/src/IterativeSolvers/IncompleteCholesky.h -./unsupported/Eigen/src/IterativeSolvers/Scaling.h -./unsupported/Eigen/src/IterativeSolvers/MINRES.h -./unsupported/Eigen/src/SparseExtra/RandomSetter.h -./unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h -./unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h -./unsupported/Eigen/src/SparseExtra/MarketIO.h -./unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h -./unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h -./unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h -./unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h -./unsupported/Eigen/src/BVH/BVAlgorithms.h -./unsupported/Eigen/src/BVH/KdBVH.h -./unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h -./unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h -./unsupported/Eigen/src/AutoDiff/AutoDiffVector.h -./unsupported/Eigen/src/Splines/Spline.h -./unsupported/Eigen/src/Splines/SplineFitting.h -./unsupported/Eigen/src/Splines/SplineFwd.h -./unsupported/Eigen/src/SVD/JacobiSVD.h -./unsupported/Eigen/src/SVD/BDCSVD.h -./unsupported/Eigen/src/SVD/SVDBase.h -./unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h -./unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h -./unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h -./unsupported/Eigen/src/MatrixFunctions/StemFunction.h -./unsupported/Eigen/src/MatrixFunctions/MatrixPower.h -./unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h -./unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h -./unsupported/Eigen/src/MoreVectorization/MathFunctions.h -./unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h -./unsupported/Eigen/src/FFT/ei_fftw_impl.h -./unsupported/Eigen/src/FFT/ei_kissfft_impl.h -./unsupported/Eigen/src/Polynomials/PolynomialSolver.h -./unsupported/Eigen/src/Polynomials/Companion.h -./unsupported/Eigen/src/Polynomials/PolynomialUtils.h -./unsupported/Eigen/src/NumericalDiff/NumericalDiff.h -./unsupported/Eigen/src/Skyline/SkylineProduct.h -./unsupported/Eigen/src/Skyline/SkylineMatrixBase.h -./unsupported/Eigen/src/Skyline/SkylineStorage.h -./unsupported/Eigen/src/Skyline/SkylineUtil.h -./unsupported/Eigen/src/Skyline/SkylineInplaceLU.h -./unsupported/Eigen/src/Skyline/SkylineMatrix.h -./unsupported/Eigen/SparseExtra -./unsupported/Eigen/AdolcForward -./unsupported/Eigen/KroneckerProduct -./unsupported/Eigen/NonLinearOptimization -./unsupported/Eigen/BVH -./unsupported/Eigen/OpenGLSupport -./unsupported/Eigen/ArpackSupport -./unsupported/Eigen/AutoDiff -./unsupported/Eigen/Splines -./unsupported/Eigen/MPRealSupport -./unsupported/Eigen/MatrixFunctions -./unsupported/Eigen/MoreVectorization -./unsupported/Eigen/LevenbergMarquardt -./unsupported/Eigen/AlignedVector3 -./unsupported/Eigen/FFT -./unsupported/Eigen/Polynomials -./unsupported/Eigen/NumericalDiff -./unsupported/Eigen/Skyline -./COPYING.README -./COPYING.README -./LICENSE -./LICENSE -./LICENSE -./Eigen/Eigen2Support -./Eigen/src/Eigen2Support/VectorBlock.h -./Eigen/src/Eigen2Support/Cwise.h -./Eigen/src/Eigen2Support/Minor.h -./Eigen/src/Eigen2Support/Lazy.h -./Eigen/src/Eigen2Support/Memory.h -./Eigen/src/Eigen2Support/MathFunctions.h -./Eigen/src/Eigen2Support/Geometry/AlignedBox.h -./Eigen/src/Eigen2Support/Geometry/Hyperplane.h -./Eigen/src/Eigen2Support/Geometry/Quaternion.h -./Eigen/src/Eigen2Support/Geometry/Rotation2D.h -./Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h -./Eigen/src/Eigen2Support/Geometry/RotationBase.h -./Eigen/src/Eigen2Support/Geometry/Translation.h -./Eigen/src/Eigen2Support/Geometry/Scaling.h -./Eigen/src/Eigen2Support/Geometry/AngleAxis.h -./Eigen/src/Eigen2Support/Geometry/Transform.h -./Eigen/src/Eigen2Support/TriangularSolver.h -./Eigen/src/Eigen2Support/LU.h -./Eigen/src/Eigen2Support/QR.h -./Eigen/src/Eigen2Support/SVD.h -./Eigen/src/Eigen2Support/Meta.h -./Eigen/src/Eigen2Support/Block.h -./Eigen/src/Eigen2Support/Macros.h -./Eigen/src/Eigen2Support/LeastSquares.h -./Eigen/src/Eigen2Support/CwiseOperators.h -./Eigen/src/Jacobi/Jacobi.h -./Eigen/src/misc/Kernel.h -./Eigen/src/misc/SparseSolve.h -./Eigen/src/misc/Solve.h -./Eigen/src/misc/Image.h -./Eigen/src/SparseCore/SparseColEtree.h -./Eigen/src/SparseCore/SparseTranspose.h -./Eigen/src/SparseCore/SparseUtil.h -./Eigen/src/SparseCore/SparseCwiseBinaryOp.h -./Eigen/src/SparseCore/SparseDiagonalProduct.h -./Eigen/src/SparseCore/SparseProduct.h -./Eigen/src/SparseCore/SparseDot.h -./Eigen/src/SparseCore/SparseCwiseUnaryOp.h -./Eigen/src/SparseCore/SparseSparseProductWithPruning.h -./Eigen/src/SparseCore/SparseBlock.h -./Eigen/src/SparseCore/SparseDenseProduct.h -./Eigen/src/SparseCore/CompressedStorage.h -./Eigen/src/SparseCore/SparseMatrixBase.h -./Eigen/src/SparseCore/MappedSparseMatrix.h -./Eigen/src/SparseCore/SparseTriangularView.h -./Eigen/src/SparseCore/SparseView.h -./Eigen/src/SparseCore/SparseFuzzy.h -./Eigen/src/SparseCore/TriangularSolver.h -./Eigen/src/SparseCore/SparseSelfAdjointView.h -./Eigen/src/SparseCore/SparseMatrix.h -./Eigen/src/SparseCore/SparseVector.h -./Eigen/src/SparseCore/AmbiVector.h -./Eigen/src/SparseCore/ConservativeSparseSparseProduct.h -./Eigen/src/SparseCore/SparseRedux.h -./Eigen/src/SparseCore/SparsePermutation.h -./Eigen/src/Eigenvalues/RealSchur.h -./Eigen/src/Eigenvalues/ComplexEigenSolver.h -./Eigen/src/Eigenvalues/GeneralizedEigenSolver.h -./Eigen/src/Eigenvalues/ComplexSchur.h -./Eigen/src/Eigenvalues/RealQZ.h -./Eigen/src/Eigenvalues/EigenSolver.h -./Eigen/src/Eigenvalues/HessenbergDecomposition.h -./Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h -./Eigen/src/Eigenvalues/Tridiagonalization.h -./Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h -./Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h -./Eigen/src/SuperLUSupport/SuperLUSupport.h -./Eigen/src/StlSupport/StdDeque.h -./Eigen/src/StlSupport/StdVector.h -./Eigen/src/StlSupport/StdList.h -./Eigen/src/StlSupport/details.h -./Eigen/src/SparseQR/SparseQR.h -./Eigen/src/LU/Inverse.h -./Eigen/src/LU/arch/Inverse_SSE.h -./Eigen/src/LU/Determinant.h -./Eigen/src/LU/PartialPivLU.h -./Eigen/src/LU/FullPivLU.h -./Eigen/src/UmfPackSupport/UmfPackSupport.h -./Eigen/src/OrderingMethods/Ordering.h -./Eigen/src/OrderingMethods/Eigen_Colamd.h -./Eigen/src/QR/HouseholderQR.h -./Eigen/src/QR/ColPivHouseholderQR.h -./Eigen/src/QR/FullPivHouseholderQR.h -./Eigen/src/SVD/JacobiSVD.h -./Eigen/src/SVD/UpperBidiagonalization.h -./Eigen/src/Geometry/OrthoMethods.h -./Eigen/src/Geometry/AlignedBox.h -./Eigen/src/Geometry/Hyperplane.h -./Eigen/src/Geometry/Quaternion.h -./Eigen/src/Geometry/EulerAngles.h -./Eigen/src/Geometry/Rotation2D.h -./Eigen/src/Geometry/ParametrizedLine.h -./Eigen/src/Geometry/RotationBase.h -./Eigen/src/Geometry/arch/Geometry_SSE.h -./Eigen/src/Geometry/Umeyama.h -./Eigen/src/Geometry/Homogeneous.h -./Eigen/src/Geometry/Translation.h -./Eigen/src/Geometry/Scaling.h -./Eigen/src/Geometry/AngleAxis.h -./Eigen/src/Geometry/Transform.h -./Eigen/src/plugins/BlockMethods.h -./Eigen/src/plugins/CommonCwiseUnaryOps.h -./Eigen/src/plugins/CommonCwiseBinaryOps.h -./Eigen/src/plugins/MatrixCwiseUnaryOps.h -./Eigen/src/plugins/MatrixCwiseBinaryOps.h -./Eigen/src/Householder/Householder.h -./Eigen/src/Householder/HouseholderSequence.h -./Eigen/src/Householder/BlockHouseholder.h -./Eigen/src/Core/VectorBlock.h -./Eigen/src/Core/Matrix.h -./Eigen/src/Core/Ref.h -./Eigen/src/Core/SelfAdjointView.h -./Eigen/src/Core/MathFunctions.h -./Eigen/src/Core/GlobalFunctions.h -./Eigen/src/Core/MapBase.h -./Eigen/src/Core/EigenBase.h -./Eigen/src/Core/GenericPacketMath.h -./Eigen/src/Core/NestByValue.h -./Eigen/src/Core/CwiseUnaryOp.h -./Eigen/src/Core/SolveTriangular.h -./Eigen/src/Core/Fuzzy.h -./Eigen/src/Core/Visitor.h -./Eigen/src/Core/Map.h -./Eigen/src/Core/NoAlias.h -./Eigen/src/Core/Diagonal.h -./Eigen/src/Core/StableNorm.h -./Eigen/src/Core/CoreIterators.h -./Eigen/src/Core/products/Parallelizer.h -./Eigen/src/Core/products/SelfadjointMatrixVector.h -./Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h -./Eigen/src/Core/products/TriangularSolverMatrix.h -./Eigen/src/Core/products/GeneralMatrixMatrix.h -./Eigen/src/Core/products/SelfadjointProduct.h -./Eigen/src/Core/products/CoeffBasedProduct.h -./Eigen/src/Core/products/TriangularMatrixVector.h -./Eigen/src/Core/products/SelfadjointMatrixMatrix.h -./Eigen/src/Core/products/TriangularSolverVector.h -./Eigen/src/Core/products/SelfadjointRank2Update.h -./Eigen/src/Core/products/GeneralBlockPanelKernel.h -./Eigen/src/Core/products/GeneralMatrixVector.h -./Eigen/src/Core/products/TriangularMatrixMatrix.h -./Eigen/src/Core/Reverse.h -./Eigen/src/Core/BooleanRedux.h -./Eigen/src/Core/Replicate.h -./Eigen/src/Core/arch/AltiVec/PacketMath.h -./Eigen/src/Core/arch/AltiVec/Complex.h -./Eigen/src/Core/arch/SSE/PacketMath.h -./Eigen/src/Core/arch/SSE/Complex.h -./Eigen/src/Core/arch/SSE/MathFunctions.h -./Eigen/src/Core/arch/NEON/PacketMath.h -./Eigen/src/Core/arch/NEON/Complex.h -./Eigen/src/Core/arch/Default/Settings.h -./Eigen/src/Core/CwiseUnaryView.h -./Eigen/src/Core/Array.h -./Eigen/src/Core/ArrayWrapper.h -./Eigen/src/Core/Swap.h -./Eigen/src/Core/Transpositions.h -./Eigen/src/Core/Random.h -./Eigen/src/Core/IO.h -./Eigen/src/Core/SelfCwiseBinaryOp.h -./Eigen/src/Core/VectorwiseOp.h -./Eigen/src/Core/Select.h -./Eigen/src/Core/ArrayBase.h -./Eigen/src/Core/DenseCoeffsBase.h -./Eigen/src/Core/DiagonalProduct.h -./Eigen/src/Core/Assign.h -./Eigen/src/Core/Redux.h -./Eigen/src/Core/ForceAlignedAccess.h -./Eigen/src/Core/BandMatrix.h -./Eigen/src/Core/PlainObjectBase.h -./Eigen/src/Core/DenseBase.h -./Eigen/src/Core/Flagged.h -./Eigen/src/Core/CwiseBinaryOp.h -./Eigen/src/Core/ProductBase.h -./Eigen/src/Core/TriangularMatrix.h -./Eigen/src/Core/Transpose.h -./Eigen/src/Core/DiagonalMatrix.h -./Eigen/src/Core/Dot.h -./Eigen/src/Core/Functors.h -./Eigen/src/Core/PermutationMatrix.h -./Eigen/src/Core/NumTraits.h -./Eigen/src/Core/MatrixBase.h -./Eigen/src/Core/DenseStorage.h -./Eigen/src/Core/util/Memory.h -./Eigen/src/Core/util/StaticAssert.h -./Eigen/src/Core/util/BlasUtil.h -./Eigen/src/Core/util/MatrixMapper.h -./Eigen/src/Core/util/XprHelper.h -./Eigen/src/Core/util/ForwardDeclarations.h -./Eigen/src/Core/util/Meta.h -./Eigen/src/Core/util/Macros.h -./Eigen/src/Core/util/Constants.h -./Eigen/src/Core/CwiseNullaryOp.h -./Eigen/src/Core/Block.h -./Eigen/src/Core/GeneralProduct.h -./Eigen/src/Core/CommaInitializer.h -./Eigen/src/Core/ReturnByValue.h -./Eigen/src/Core/Stride.h -./Eigen/src/SPQRSupport/SuiteSparseQRSupport.h -./Eigen/src/SparseLU/SparseLU_column_dfs.h -./Eigen/src/SparseLU/SparseLU_panel_dfs.h -./Eigen/src/SparseLU/SparseLU_relax_snode.h -./Eigen/src/SparseLU/SparseLU_panel_bmod.h -./Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h -./Eigen/src/SparseLU/SparseLU_Utils.h -./Eigen/src/SparseLU/SparseLU_gemm_kernel.h -./Eigen/src/SparseLU/SparseLU_kernel_bmod.h -./Eigen/src/SparseLU/SparseLU_pivotL.h -./Eigen/src/SparseLU/SparseLU_Memory.h -./Eigen/src/SparseLU/SparseLU_heap_relax_snode.h -./Eigen/src/SparseLU/SparseLUImpl.h -./Eigen/src/SparseLU/SparseLU_copy_to_ucol.h -./Eigen/src/SparseLU/SparseLU_Structs.h -./Eigen/src/SparseLU/SparseLU.h -./Eigen/src/SparseLU/SparseLU_column_bmod.h -./Eigen/src/SparseLU/SparseLU_pruneL.h -./Eigen/src/IterativeLinearSolvers/IncompleteLUT.h -./Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h -./Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h -./Eigen/src/IterativeLinearSolvers/ConjugateGradient.h -./Eigen/src/IterativeLinearSolvers/BiCGSTAB.h -./Eigen/src/SparseCholesky/SimplicialCholesky.h -./Eigen/src/Cholesky/LDLT.h -./Eigen/src/Cholesky/LLT.h -./Eigen/src/CholmodSupport/CholmodSupport.h -./Eigen/src/PaStiXSupport/PaStiXSupport.h -./Eigen/src/MetisSupport/MetisSupport.h -./Eigen/StdVector -./Eigen/Core -./Eigen/OrderingMethods -./Eigen/SparseLU -./Eigen/StdList -./Eigen/StdDeque -./Eigen/SparseCholesky -./Eigen/SparseCore -./scripts/relicense.py -./scripts/relicense.py -./blas/BandTriangularSolver.h -./blas/PackedTriangularMatrixVector.h -./blas/complex_double.cpp -./blas/level2_real_impl.h -./blas/level1_cplx_impl.h -./blas/level1_impl.h -./blas/level1_real_impl.h -./blas/level3_impl.h -./blas/single.cpp -./blas/level2_cplx_impl.h -./blas/PackedSelfadjointProduct.h -./blas/Rank2Update.h -./blas/complex_single.cpp -./blas/PackedTriangularSolverVector.h -./blas/double.cpp -./blas/common.h -./blas/level2_impl.h -./blas/GeneralRank1Update.h - -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - ----------------------------------------------------------------------- -Following applies to: -./doc/UsingIntelMKL.dox -./doc/UsingIntelMKL.dox -./Eigen/src/Eigenvalues/ComplexSchur_MKL.h -./Eigen/src/Eigenvalues/ComplexSchur_MKL.h -./Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h -./Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h -./Eigen/src/Eigenvalues/RealSchur_MKL.h -./Eigen/src/Eigenvalues/RealSchur_MKL.h -./Eigen/src/LU/arch/Inverse_SSE.h -./Eigen/src/LU/arch/Inverse_SSE.h -./Eigen/src/LU/PartialPivLU_MKL.h -./Eigen/src/LU/PartialPivLU_MKL.h -./Eigen/src/QR/HouseholderQR_MKL.h -./Eigen/src/QR/HouseholderQR_MKL.h -./Eigen/src/QR/ColPivHouseholderQR_MKL.h -./Eigen/src/QR/ColPivHouseholderQR_MKL.h -./Eigen/src/SVD/JacobiSVD_MKL.h -./Eigen/src/SVD/JacobiSVD_MKL.h -./Eigen/src/PardisoSupport/PardisoSupport.h -./Eigen/src/PardisoSupport/PardisoSupport.h -./Eigen/src/Core/Assign_MKL.h -./Eigen/src/Core/Assign_MKL.h -./Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h -./Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h -./Eigen/src/Core/products/GeneralMatrixVector_MKL.h -./Eigen/src/Core/products/GeneralMatrixVector_MKL.h -./Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h -./Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h -./Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h -./Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h -./Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h -./Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h -./Eigen/src/Core/products/TriangularMatrixVector_MKL.h -./Eigen/src/Core/products/TriangularMatrixVector_MKL.h -./Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h -./Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h -./Eigen/src/Core/products/TriangularSolverMatrix_MKL.h -./Eigen/src/Core/products/TriangularSolverMatrix_MKL.h -./Eigen/src/Core/util/MKL_support.h -./Eigen/src/Core/util/MKL_support.h -./Eigen/src/Cholesky/LLT_MKL.h -./Eigen/src/Cholesky/LLT_MKL.h - -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. * Neither the name of Intel Corporation nor the - names of its contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - ----------------------------------------------------------------------- -Following applies to: - everything under ./bench/btl - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds -of works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, -family, or household purposes, or (2) anything designed or sold for -incorporation into a dwelling. In determining whether a product is a -consumer product, doubtful cases shall be resolved in favor of -coverage. For a particular product received by a particular user, -"normally used" refers to a typical or common use of that class of -product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected -to use, the product. A product is a consumer product regardless of -whether the product has substantial commercial, industrial or -non-consumer uses, unless such uses represent the only significant -mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to -install and execute modified versions of a covered work in that User -Product from a modified version of its Corresponding Source. The -information must suffice to ensure that the continued functioning of -the modified object code is in no case prevented or interfered with -solely because modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include -a requirement to continue to provide support service, warranty, or -updates for a work that has been modified or installed by the -recipient, or for the User Product in which it has been modified or -installed. Access to a network may be denied when the modification -itself materially and adversely affects the operation of the network -or violates the rules and protocols for communication across the -network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material -you add to a covered work, you may (if authorized by the copyright -holders of that material) supplement the terms of this License with -terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions - of it) with contractual assumptions of liability to the recipient, - for any liability that these contractual assumptions directly - impose on those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement -or otherwise) that contradict the conditions of this License, they do -not excuse you from the conditions of this License. If you cannot -convey a covered work so as to satisfy simultaneously your obligations -under this License and any other pertinent obligations, then as a -consequence you may not convey it at all. For example, if you agree -to terms that obligate you to collect a royalty for further conveying -from those to whom you convey the Program, the only way you could -satisfy both those terms and this License would be to refrain entirely -from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT -WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES -AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR -DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL -DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER -OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) This program comes - with ABSOLUTELY NO WARRANTY; for details type `show w'. This is - free software, and you are welcome to redistribute it under - certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, your -program's commands might be different; for a GUI interface, you would -use an "about box". - - You should also get your employer (if you work as a programmer) or -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. For more information on this, and how to apply and follow -the GNU GPL, see . - - The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use -the GNU Lesser General Public License instead of this License. But -first, please read . - - ----------------------------------------------------------------------- -Following applies to: -./test/metis_support.cpp -./test/sparselu.cpp -./unsupported/test/mpreal/mpreal.h -./unsupported/Eigen/src/IterativeSolvers/IterationController.h -./unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h -./unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h -./Eigen/src/OrderingMethods/Amd.h -./Eigen/src/SparseCholesky/SimplicialCholesky_impl.h - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the -GNU General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this - license document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this - license document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of - this License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - - ----------------------------------------------------------------------- -Following applies to: -./unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h -./unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h -./unsupported/Eigen/src/LevenbergMarquardt/LMonestep.h -./unsupported/Eigen/src/LevenbergMarquardt/LMpar.h -./unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h - -Minpack Copyright Notice (1999) University of Chicago. All rights -reserved - -Redistribution and use in source and binary forms, with or -without modification, are permitted provided that the -following conditions are met: - -1. Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. - -2. Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials -provided with the distribution. - -3. The end-user documentation included with the -redistribution, if any, must include the following -acknowledgment: - - "This product includes software developed by the - University of Chicago, as Operator of Argonne National - Laboratory. - -Alternately, this acknowledgment may appear in the software -itself, if and wherever such third-party acknowledgments -normally appear. - -4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" -WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE -UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND -THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE -OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY -OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR -USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF -THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) -DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION -UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL -BE CORRECTED. - -5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT -HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF -ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, -INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF -ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF -PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER -SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT -(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, -EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE -POSSIBILITY OF SUCH LOSS OR DAMAGES. --------------------------------------------------------------------------------- -END LICENSE FOR third_party/eigen3/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR third_party/fft2d/LICENSE --------------------------------------------------------------------------------- -Copyright(C) 1997,2001 Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp). -You may use, copy, modify this code for any purpose and -without fee. You may distribute this ORIGINAL package. --------------------------------------------------------------------------------- -END LICENSE FOR third_party/fft2d/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR third_party/hadoop/LICENSE.txt --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - -APACHE HADOOP SUBCOMPONENTS: - -The Apache Hadoop project contains subcomponents with separate copyright -notices and license terms. Your use of the source code for the these -subcomponents is subject to the terms and conditions of the following -licenses. - -For the org.apache.hadoop.util.bloom.* classes: - -/** - * - * Copyright (c) 2005, European Commission project OneLab under contract - * 034819 (http://www.one-lab.org) - * All rights reserved. - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - Neither the name of the University Catholique de Louvain - UCL - * nor the names of its contributors may be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -For portions of the native implementation of slicing-by-8 CRC calculation -in src/main/native/src/org/apache/hadoop/util: - -/** - * Copyright 2008,2009,2010 Massachusetts Institute of Technology. - * All rights reserved. Use of this source code is governed by a - * BSD-style license that can be found in the LICENSE file. - */ - - For src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4.c: - -/* - LZ4 - Fast LZ compression algorithm - Copyright (C) 2011, Yann Collet. - BSD License - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ --------------------------------------------------------------------------------- -END LICENSE FOR third_party/hadoop/LICENSE.txt --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR third_party/icu/data/LICENSE --------------------------------------------------------------------------------- -COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - -Copyright © 1991-2018 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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 THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - ---------------------- - -Third-Party Software Licenses - -This section contains third-party software notices and/or additional -terms for licensed third-party software components included within ICU -libraries. - -1. ICU License - ICU 1.8.1 to ICU 57.1 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -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, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -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 -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL 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. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. - -2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyright (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, 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 tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - -3. Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight - # modifications. - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - -4. Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - -5. Time Zone Database - - ICU uses the public domain data and code derived from Time Zone -Database for its time zone support. The ownership of the TZ database -is explained in BCP 175: Procedure for Maintaining the Time Zone -Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - -6. Google double-conversion - -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR third_party/icu/data/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/boringssl/LICENSE --------------------------------------------------------------------------------- -BoringSSL is a fork of OpenSSL. As such, large parts of it fall under OpenSSL -licensing. Files that are completely new have a Google copyright and an ISC -license. This license is reproduced at the bottom of this file. - -Contributors to BoringSSL are required to follow the CLA rules for Chromium: -https://cla.developers.google.com/clas - -Files in third_party/ have their own licenses, as described therein. The MIT -license, for third_party/fiat, which, unlike other third_party directories, is -compiled into non-test libraries, is included below. - -The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the -OpenSSL License and the original SSLeay license apply to the toolkit. See below -for the actual license texts. Actually both licenses are BSD-style Open Source -licenses. In case of any license issues related to OpenSSL please contact -openssl-core@openssl.org. - -The following are Google-internal bug numbers where explicit permission from -some authors is recorded for use of their work. (This is purely for our own -record keeping.) - 27287199 - 27287880 - 27287883 - - OpenSSL License - --------------- - -/* ==================================================================== - * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - - Original SSLeay License - ----------------------- - -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * 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. */ - - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -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. - - -Licenses for support code -------------------------- - -Parts of the TLS test suite are under the Go license. This code is not included -in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so -distributing code linked against BoringSSL does not trigger this license: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -BoringSSL uses the Chromium test infrastructure to run a continuous build, -trybots etc. The scripts which manage this, and the script for generating build -metadata, are under the Chromium license. Distributing code linked against -BoringSSL does not trigger this license. - -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/boringssl/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/com_google_protobuf/LICENSE --------------------------------------------------------------------------------- -Copyright 2008 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. --------------------------------------------------------------------------------- -END LICENSE FOR external/com_google_protobuf/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/com_googlesource_code_re2/LICENSE --------------------------------------------------------------------------------- -// Copyright (c) 2009 The RE2 Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/com_googlesource_code_re2/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/curl/COPYING --------------------------------------------------------------------------------- -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1996 - 2020, Daniel Stenberg, , and many -contributors, see the THANKS file. - -All rights reserved. - -Permission to use, copy, modify, and distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright -notice and this permission notice appear in all copies. - -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 OF THIRD PARTY RIGHTS. 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. - -Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization of the copyright holder. --------------------------------------------------------------------------------- -END LICENSE FOR external/curl/COPYING --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/double_conversion/LICENSE --------------------------------------------------------------------------------- -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/double_conversion/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/eigen_archive/COPYING.MPL2 --------------------------------------------------------------------------------- -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -END LICENSE FOR external/eigen_archive/COPYING.MPL2 --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/farmhash_archive/COPYING --------------------------------------------------------------------------------- -// Copyright (c) 2014 Google, Inc. -// -// 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/farmhash_archive/COPYING --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/fft2d/readme2d.txt --------------------------------------------------------------------------------- -General Purpose 2D,3D FFT (Fast Fourier Transform) Package - -Files - alloc.c : 2D-array Allocation - alloc.h : 2D-array Allocation - fft4f2d.c : 2D FFT Package in C - Version I (radix 4, 2) - fft4f2d.f : 2D FFT Package in Fortran - Version I (radix 4, 2) - fftsg.c : 1D FFT Package in C - Fast Version (Split-Radix) - fftsg.f : 1D FFT Package in Fortran - Fast Version (Split-Radix) - fftsg2d.c : 2D FFT Package in C - Version II (Split-Radix) - fftsg2d.f : 2D FFT Package in Fortran - Version II (Split-Radix) - fftsg3d.c : 3D FFT Package in C - Version II (Split-Radix) - fftsg3d.f : 3D FFT Package in Fortran - Version II (Split-Radix) - shrtdct.c : 8x8, 16x16 DCT Package - sample2d/ - Makefile : for gcc, cc - Makefile.f77: for Fortran - Makefile.pth: Pthread version - fft4f2dt.c : Test Program for "fft4f2d.c" - fft4f2dt.f : Test Program for "fft4f2d.f" - fftsg2dt.c : Test Program for "fftsg2d.c" - fftsg2dt.f : Test Program for "fftsg2d.f" - fftsg3dt.c : Test Program for "fftsg3d.c" - fftsg3dt.f : Test Program for "fftsg3d.f" - shrtdctt.c : Test Program for "shrtdct.c" - -Difference of Files - C and Fortran versions are equal and - the same routines are in each version. - ---- Difference between "fft4f2d.*" and "fftsg2d.*" ---- - "fft4f2d.*" are optimized for the old machines that - don't have the large size CPU cache. - "fftsg2d.*", "fftsg3d.*" use 1D FFT routines in "fftsg.*". - "fftsg2d.*", "fftsg3d.*" are optimized for the machines that - have the multi-level (L1,L2,etc) cache. - -Routines in the Package - in fft4f2d.*, fftsg2d.* - cdft2d: 2-dim Complex Discrete Fourier Transform - rdft2d: 2-dim Real Discrete Fourier Transform - ddct2d: 2-dim Discrete Cosine Transform - ddst2d: 2-dim Discrete Sine Transform - rdft2dsort: rdft2d input/output ordering (fftsg2d.*) - in fftsg3d.* - cdft3d: 3-dim Complex Discrete Fourier Transform - rdft3d: 3-dim Real Discrete Fourier Transform - ddct3d: 3-dim Discrete Cosine Transform - ddst3d: 3-dim Discrete Sine Transform - rdft3dsort: rdft3d input/output ordering - in fftsg.* - cdft: 1-dim Complex Discrete Fourier Transform - rdft: 1-dim Real Discrete Fourier Transform - ddct: 1-dim Discrete Cosine Transform - ddst: 1-dim Discrete Sine Transform - dfct: 1-dim Real Symmetric DFT - dfst: 1-dim Real Anti-symmetric DFT - (these routines are called by fftsg2d.*, fftsg3d.*) - in shrtdct.c - ddct8x8s : Normalized 8x8 DCT - ddct16x16s: Normalized 16x16 DCT - (faster than ddct2d()) - -Usage - Brief explanations are in block comments of each packages. - The examples are given in the test programs. - -Copyright - Copyright(C) 1997,2001 Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp). - You may use, copy, modify this code for any purpose and - without fee. You may distribute this ORIGINAL package. - -History - ... - Nov. 2001 : Add 3D-FFT routines - Dec. 2006 : Fix a documentation bug in "fftsg3d.*" - Dec. 2006 : Fix a minor bug in "fftsg.f" - --------------------------------------------------------------------------------- -END LICENSE FOR external/fft2d/readme2d.txt --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/gemmlowp/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/gemmlowp/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/gif/COPYING --------------------------------------------------------------------------------- -The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond - -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. --------------------------------------------------------------------------------- -END LICENSE FOR external/gif/COPYING --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/highwayhash/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - --------------------------------------------------------------------------------- -END LICENSE FOR external/highwayhash/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/icu/icu4c/LICENSE --------------------------------------------------------------------------------- -COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - -Copyright © 1991-2019 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in https://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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 THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - ---------------------- - -Third-Party Software Licenses - -This section contains third-party software notices and/or additional -terms for licensed third-party software components included within ICU -libraries. - -1. ICU License - ICU 1.8.1 to ICU 57.1 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -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, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -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 -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL 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. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. - -2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyright (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, 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 tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - -3. Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight - # modifications. - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - -4. Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - -5. Time Zone Database - - ICU uses the public domain data and code derived from Time Zone -Database for its time zone support. The ownership of the TZ database -is explained in BCP 175: Procedure for Maintaining the Time Zone -Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - -6. Google double-conversion - -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/icu/icu4c/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/libjpeg_turbo/LICENSE.md --------------------------------------------------------------------------------- -libjpeg-turbo Licenses -====================== - -libjpeg-turbo is covered by three compatible BSD-style open source licenses: - -- The IJG (Independent JPEG Group) License, which is listed in - [README.ijg](README.ijg) - - This license applies to the libjpeg API library and associated programs - (any code inherited from libjpeg, and any modifications to that code.) - -- The Modified (3-clause) BSD License, which is listed below - - This license covers the TurboJPEG API library and associated programs, as - well as the build system. - -- The [zlib License](https://opensource.org/licenses/Zlib) - - This license is a subset of the other two, and it covers the libjpeg-turbo - SIMD extensions. - - -Complying with the libjpeg-turbo Licenses -========================================= - -This section provides a roll-up of the libjpeg-turbo licensing terms, to the -best of our understanding. - -1. If you are distributing a modified version of the libjpeg-turbo source, - then: - - 1. You cannot alter or remove any existing copyright or license notices - from the source. - - **Origin** - - Clause 1 of the IJG License - - Clause 1 of the Modified BSD License - - Clauses 1 and 3 of the zlib License - - 2. You must add your own copyright notice to the header of each source - file you modified, so others can tell that you modified that file (if - there is not an existing copyright header in that file, then you can - simply add a notice stating that you modified the file.) - - **Origin** - - Clause 1 of the IJG License - - Clause 2 of the zlib License - - 3. You must include the IJG README file, and you must not alter any of the - copyright or license text in that file. - - **Origin** - - Clause 1 of the IJG License - -2. If you are distributing only libjpeg-turbo binaries without the source, or - if you are distributing an application that statically links with - libjpeg-turbo, then: - - 1. Your product documentation must include a message stating: - - This software is based in part on the work of the Independent JPEG - Group. - - **Origin** - - Clause 2 of the IJG license - - 2. If your binary distribution includes or uses the TurboJPEG API, then - your product documentation must include the text of the Modified BSD - License (see below.) - - **Origin** - - Clause 2 of the Modified BSD License - -3. You cannot use the name of the IJG or The libjpeg-turbo Project or the - contributors thereof in advertising, publicity, etc. - - **Origin** - - IJG License - - Clause 3 of the Modified BSD License - -4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be - free of defects, nor do we accept any liability for undesirable - consequences resulting from your use of the software. - - **Origin** - - IJG License - - Modified BSD License - - zlib License - - -The Modified (3-clause) BSD License -=================================== - -Copyright (C)2009-2020 D. R. Commander. All Rights Reserved. -Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -Why Three Licenses? -=================== - -The zlib License could have been used instead of the Modified (3-clause) BSD -License, and since the IJG License effectively subsumes the distribution -conditions of the zlib License, this would have effectively placed -libjpeg-turbo binary distributions under the IJG License. However, the IJG -License specifically refers to the Independent JPEG Group and does not extend -attribution and endorsement protections to other entities. Thus, it was -desirable to choose a license that granted us the same protections for new code -that were granted to the IJG for code derived from their software. --------------------------------------------------------------------------------- -END LICENSE FOR external/libjpeg_turbo/LICENSE.md --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/llvm-project/llvm/LICENSE.TXT --------------------------------------------------------------------------------- -============================================================================== -The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: -============================================================================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - ----- LLVM Exceptions to the Apache 2.0 License ---- - -As an exception, if, as a result of your compiling your source code, portions -of this Software are embedded into an Object form of such source code, you -may redistribute such embedded portions in such Object form without complying -with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - -In addition, if you combine or link compiled forms of this Software with -software that is licensed under the GPLv2 ("Combined Software") and if a -court of competent jurisdiction determines that the patent provision (Section -3), the indemnity provision (Section 9) or other Section of the License -conflicts with the conditions of the GPLv2, you may retroactively and -prospectively choose to deem waived or otherwise exclude such Section(s) of -the License, but only in their entirety and only with respect to the Combined -Software. - -============================================================================== -Software from third parties included in the LLVM Project: -============================================================================== -The LLVM Project contains third party software which is under different license -terms. All such code will be identified clearly using at least one of two -mechanisms: -1) It will be in a separate directory tree with its own `LICENSE.txt` or - `LICENSE` file at the top containing the specific license and restrictions - which apply to that software, or -2) It will contain specific license and restriction terms at the top of every - file. - -============================================================================== -Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): -============================================================================== -University of Illinois/NCSA -Open Source License - -Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. -All rights reserved. - -Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal with -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: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - -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 -CONTRIBUTORS 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 WITH THE -SOFTWARE. - --------------------------------------------------------------------------------- -END LICENSE FOR external/llvm-project/llvm/LICENSE.TXT --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/llvm-project/mlir/LICENSE.TXT --------------------------------------------------------------------------------- -============================================================================== -The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: -============================================================================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - ----- LLVM Exceptions to the Apache 2.0 License ---- - -As an exception, if, as a result of your compiling your source code, portions -of this Software are embedded into an Object form of such source code, you -may redistribute such embedded portions in such Object form without complying -with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - -In addition, if you combine or link compiled forms of this Software with -software that is licensed under the GPLv2 ("Combined Software") and if a -court of competent jurisdiction determines that the patent provision (Section -3), the indemnity provision (Section 9) or other Section of the License -conflicts with the conditions of the GPLv2, you may retroactively and -prospectively choose to deem waived or otherwise exclude such Section(s) of -the License, but only in their entirety and only with respect to the Combined -Software. - -============================================================================== -Software from third parties included in the LLVM Project: -============================================================================== -The LLVM Project contains third party software which is under different license -terms. All such code will be identified clearly using at least one of two -mechanisms: -1) It will be in a separate directory tree with its own `LICENSE.txt` or - `LICENSE` file at the top containing the specific license and restrictions - which apply to that software, or -2) It will contain specific license and restriction terms at the top of every - file. --------------------------------------------------------------------------------- -END LICENSE FOR external/llvm-project/mlir/LICENSE.TXT --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/lmdb/LICENSE --------------------------------------------------------------------------------- -The OpenLDAP Public License - Version 2.8, 17 August 2003 - -Redistribution and use of this software and associated documentation -("Software"), with or without modification, are permitted provided -that the following conditions are met: - -1. Redistributions in source form must retain copyright statements - and notices, - -2. Redistributions in binary form must reproduce applicable copyright - statements and notices, this list of conditions, and the following - disclaimer in the documentation and/or other materials provided - with the distribution, and - -3. Redistributions must contain a verbatim copy of this document. - -The OpenLDAP Foundation may revise this license from time to time. -Each revision is distinguished by a version number. You may use -this Software under terms of this license revision or under the -terms of any subsequent revision of the license. - -THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS -CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S) -OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -The names of the authors and copyright holders must not be used in -advertising or otherwise to promote the sale, use or other dealing -in this Software without specific, written prior permission. Title -to copyright in this Software shall at all times remain with copyright -holders. - -OpenLDAP is a registered trademark of the OpenLDAP Foundation. - -Copyright 1999-2003 The OpenLDAP Foundation, Redwood City, -California, USA. All Rights Reserved. Permission to copy and -distribute verbatim copies of this document is granted. --------------------------------------------------------------------------------- -END LICENSE FOR external/lmdb/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/local_config_tensorrt/LICENSE --------------------------------------------------------------------------------- -Copyright 2018 The TensorFlow Authors. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018, The TensorFlow Authors. - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/local_config_tensorrt/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/nasm/LICENSE --------------------------------------------------------------------------------- -NASM is now licensed under the 2-clause BSD license, also known as the -simplified BSD license. - - Copyright 1996-2010 the NASM Authors - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following - conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/nasm/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/nsync/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/nsync/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/png/LICENSE --------------------------------------------------------------------------------- -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE -========================================= - -PNG Reference Library License version 2 ---------------------------------------- - - * Copyright (c) 1995-2019 The PNG Reference Library Authors. - * Copyright (c) 2018-2019 Cosmin Truta. - * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. - * Copyright (c) 1996-1997 Andreas Dilger. - * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - -The software is supplied "as is", without warranty of any kind, -express or implied, including, without limitation, the warranties -of merchantability, fitness for a particular purpose, title, and -non-infringement. In no event shall the Copyright owners, or -anyone distributing the software, be liable for any damages or -other liability, whether in contract, tort or otherwise, arising -from, out of, or in connection with the software, or the use or -other dealings in the software, even if advised of the possibility -of such damage. - -Permission is hereby granted to use, copy, modify, and distribute -this software, or portions hereof, for any purpose, without fee, -subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you - must not claim that you wrote the original software. If you - use this software in a product, an acknowledgment in the product - documentation would be appreciated, but is not required. - - 2. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - - -PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) ------------------------------------------------------------------------ - -libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are -Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are -derived from libpng-1.0.6, and are distributed according to the same -disclaimer and license as libpng-1.0.6 with the following individuals -added to the list of Contributing Authors: - - Simon-Pierre Cadieux - Eric S. Raymond - Mans Rullgard - Cosmin Truta - Gilles Vollant - James Yu - Mandar Sahastrabuddhe - Google Inc. - Vadim Barkov - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of - the library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is - with the user. - -Some files in the "contrib" directory and some configure-generated -files that are distributed with libpng have other copyright owners, and -are released under other open source licenses. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from -libpng-0.96, and are distributed according to the same disclaimer and -license as libpng-0.96, with the following individuals added to the -list of Contributing Authors: - - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, -and are distributed according to the same disclaimer and license as -libpng-0.88, with the following individuals added to the list of -Contributing Authors: - - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -Some files in the "scripts" directory have other copyright owners, -but are released under this license. - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors" -is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing -Authors and Group 42, Inc. disclaim all warranties, expressed or -implied, including, without limitation, the warranties of -merchantability and of fitness for any purpose. The Contributing -Authors and Group 42, Inc. assume no liability for direct, indirect, -incidental, special, exemplary, or consequential damages, which may -result from the use of the PNG Reference Library, even if advised of -the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, without fee, subject -to the following restrictions: - - 1. The origin of this source code must not be misrepresented. - - 2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, -without fee, and encourage the use of this source code as a component -to supporting the PNG file format in commercial products. If you use -this source code in a product, acknowledgment is not required but would -be appreciated. --------------------------------------------------------------------------------- -END LICENSE FOR external/png/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/snappy/COPYING --------------------------------------------------------------------------------- -Copyright 2011, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -=== - -Some of the benchmark data in testdata/ is licensed differently: - - - fireworks.jpeg is Copyright 2013 Steinar H. Gunderson, and - is licensed under the Creative Commons Attribution 3.0 license - (CC-BY-3.0). See https://creativecommons.org/licenses/by/3.0/ - for more information. - - - kppkn.gtb is taken from the Gaviota chess tablebase set, and - is licensed under the MIT License. See - https://sites.google.com/site/gaviotachessengine/Home/endgame-tablebases-1 - for more information. - - - paper-100k.pdf is an excerpt (bytes 92160 to 194560) from the paper - “Combinatorial Modeling of Chromatin Features Quantitatively Predicts DNA - Replication Timing in _Drosophila_” by Federico Comoglio and Renato Paro, - which is licensed under the CC-BY license. See - http://www.ploscompbiol.org/static/license for more ifnormation. - - - alice29.txt, asyoulik.txt, plrabn12.txt and lcet10.txt are from Project - Gutenberg. The first three have expired copyrights and are in the public - domain; the latter does not have expired copyright, but is still in the - public domain according to the license information - (http://www.gutenberg.org/ebooks/53). --------------------------------------------------------------------------------- -END LICENSE FOR external/snappy/COPYING --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/zlib/zlib.h --------------------------------------------------------------------------------- -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 - (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.11" -#define ZLIB_VERNUM 0x12b0 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 11 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip and raw deflate streams in - memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in the case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total number of input bytes read so far */ - - Bytef *next_out; /* next output byte will go here */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total number of bytes output so far */ - - z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text - for deflate, or the decoding state for inflate */ - uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. In that case, zlib is thread-safe. When zalloc and zfree are - Z_NULL on entry to the initialization function, they are set to internal - routines that use the standard library functions malloc() and free(). - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use by the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field for deflate() */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary. Some output may be provided even if - flush is zero. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. See deflatePending(), - which can be used if desired to determine whether or not there is more ouput - in that case. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed - codes block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this - function must be called again with Z_FINISH and more output space (updated - avail_out) but no more input data, until it returns with Z_STREAM_END or an - error. After deflate has returned Z_STREAM_END, the only possible operations - on the stream are deflateReset or deflateEnd. - - Z_FINISH can be used in the first deflate call after deflateInit if all the - compression is to be done in a single step. In order to complete in one - call, avail_out must be at least the value returned by deflateBound (see - below). Then deflate is guaranteed to return Z_STREAM_END. If not enough - output space is provided, deflate will not return Z_STREAM_END, and it must - be called again as described above. - - deflate() sets strm->adler to the Adler-32 checksum of all input read - so far (that is, total_in bytes). If a gzip stream is being generated, then - strm->adler will be the CRC-32 checksum of the input read so far. (See - deflateInit2 below.) - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is - considered binary. This field is only for information purposes and does not - affect the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL or the state was inadvertently written over - by the application), or Z_BUF_ERROR if no progress is possible (for example - avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and - deflate() can be called again with more input and more output space to - continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. In the current version of inflate, the provided input is not - read or consumed. The allocation of a sliding window will be deferred to - the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression. - Actual decompression will be done by inflate(). So next_in, and avail_in, - next_out, and avail_out are unused and unchanged. The current - implementation of inflateInit() does not process any header information -- - that is deferred until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), then next_in and avail_in are updated - accordingly, and processing will resume at this point for the next call of - inflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. If the - caller of inflate() does not provide both available input and available - output space, it is possible that there will be no progress made. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - To assist in this, on return inflate() always sets strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all of the uncompressed data for the - operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not - required to perform an inflation in one step. However it may be used to - inform inflate that a faster approach can be used for the single inflate() - call. Z_FINISH also informs inflate to not maintain a sliding window if the - stream completes, which reduces inflate's memory footprint. If the stream - does not complete, either because not all of the stream is provided or not - enough output space is provided, then a sliding window will be allocated and - inflate() can be called again to continue the operation as if Z_NO_FLUSH had - been used. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the effects of the flush parameter in this implementation are - on the return value of inflate() as noted below, when inflate() returns early - when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of - memory for a sliding window when Z_FINISH is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the Adler-32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the Adler-32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed Adler-32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained unless inflateGetHeader() is used. When processing - gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - produced so far. The CRC-32 is checked against the gzip trailer, as is the - uncompressed length, modulo 2^32. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value, in which case strm->msg points to a string with a more specific - error), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL, or the state was inadvertently written over - by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR - if no progress was possible or if there was not enough room in the output - buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is to be attempted. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state - was inconsistent. -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - For the current implementation of deflate(), a windowBits value of 8 (a - window size of 256 bytes) is not supported. As a result, a request for 8 - will result in 9 (a 512-byte window). In that case, providing 8 to - inflateInit2() will result in an error when the zlib header with 9 is - checked against the initialization of inflate(). The remedy is to not use 8 - with deflateInit2() with this initialization, or at least in that case use 9 - with inflateInit2(). - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute a check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to the appropriate value, - if the operating system was determined at compile time. If a gzip stream is - being written, strm->adler is a CRC-32 instead of an Adler-32. - - For raw deflate or gzip encoding, a request for a 256-byte window is - rejected as invalid, since only the zlib header provides a means of - transmitting the window size to the decompressor. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. When using the zlib format, this - function must be called immediately after deflateInit, deflateInit2 or - deflateReset, and before any call of deflate. When doing raw deflate, this - function must be called either before any call of deflate, or immediately - after the completion of a deflate block, i.e. after all input has been - consumed and all output has been delivered when using any of the flush - options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The - compressor and decompressor must use exactly the same dictionary (see - inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the Adler-32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The Adler-32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - Adler-32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if not at a block boundary for raw deflate). deflateSetDictionary does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by deflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If deflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. - - deflateGetDictionary() may return a length less than the window size, even - when more than the window size in input has been provided. It may return up - to 258 bytes less in that case, due to how zlib's implementation of deflate - manages the sliding window and lookahead for matches, where matches can be - up to 258 bytes long. If the application needs the last window-size bytes of - input, then that would need to be saved by the application outside of zlib. - - deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, but - does not free and reallocate the internal compression state. The stream - will leave the compression level and any other attributes that may have been - set unchanged. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2(). This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression approach (which is a function of the level) or the - strategy is changed, and if any input has been consumed in a previous - deflate() call, then the input available so far is compressed with the old - level and strategy using deflate(strm, Z_BLOCK). There are three approaches - for the compression levels 0, 1..3, and 4..9 respectively. The new level - and strategy will take effect at the next call of deflate(). - - If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does - not have enough output space to complete, then the parameter change will not - take effect. In this case, deflateParams() can be called again with the - same parameters and more output space to try again. - - In order to assure a change in the parameters on the first try, the - deflate stream should be flushed using deflate() with Z_BLOCK or other flush - request until strm.avail_out is not zero, before calling deflateParams(). - Then no more input data should be provided before the deflateParams() call. - If this is done, the old level and strategy will be applied to the data - compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). - - deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream - state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if - there was not enough output space to complete the compression of the - available input data before a change in the strategy or approach. Note that - in the case of a Z_BUF_ERROR, the parameters are not changed. A return - value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be - retried with more output space. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). If that first deflate() call is provided the - sourceLen input bytes, an output buffer allocated to the size returned by - deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed - to return Z_STREAM_END. Note that it is possible for the compressed size to - be larger than the value returned by deflateBound() if flush options other - than Z_FINISH or Z_NO_FLUSH are used. -*/ - -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); -/* - deflatePending() returns the number of bytes and bits of output that have - been generated, but not yet provided in the available output. The bytes not - provided would be due to the available output space having being consumed. - The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending - or bits are Z_NULL, then those values are not set. - - deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. - */ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough - room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an Adler-32 or a CRC-32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see - below), inflate() will not automatically decode concatenated gzip streams. - inflate() will return Z_STREAM_END at the end of the gzip stream. The state - would need to be reset to continue decoding a subsequent gzip stream. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the Adler-32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called at any - time to set the dictionary. If the provided dictionary is smaller than the - window and there is already data in the window, then the provided dictionary - will amend what's there. The application must insure that the dictionary - that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect Adler-32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by inflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If inflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. - - inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a possible full flush point (see above - for the description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync searches for a 00 00 FF FF pattern in the compressed data. - All full flush points have this pattern, but not all occurrences of this - pattern are full flush points. - - inflateSync returns Z_OK if a possible full flush point has been found, - Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point - has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. If the window size is changed, then the - memory allocated for the window is freed, and the window will be reallocated - by inflate() if needed. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above, or -65536 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the parameters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is potentially more efficient than - inflate() for file i/o applications, in that it avoids copying between the - output and the sliding window by simply making the window itself the output - buffer. inflate() can be faster on modern CPUs when used with large - buffers. inflateBack() trusts the application to not change the output - buffer passed by the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the default - behavior of inflate(), which expects a zlib header and trailer around the - deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero -- buf is ignored in that - case -- and inflateBack() will return a buffer error. inflateBack() will - call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. - out() should return zero on success, or non-zero on failure. If out() - returns non-zero, inflateBack() will return with an error. Neither in() nor - out() are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: ZLIB_DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - -#ifndef Z_SOLO - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. compress() is equivalent to compress2() with a level - parameter of Z_DEFAULT_COMPRESSION. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed data. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In - the case where there is not enough room, uncompress() will fill the output - buffer with the uncompressed data up to that point. -*/ - -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); -/* - Same as uncompress, except that sourceLen is a pointer, where the - length of the source is *sourceLen. On return, *sourceLen is the number of - source bytes consumed. -*/ - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) 'T' will - request transparent writing or appending with no compression and not using - the gzip format. - - "a" can be used instead of "w" to request that the gzip stream that will - be written be appended to the file. "+" will result in an error, since - reading and writing to the same gzip file is not supported. The addition of - "x" when writing will create the file exclusively, which fails if the file - already exists. On systems that support it, the addition of "e" when - reading or writing will set the flag to close the file on an execve() call. - - These functions, as well as gzip, will read and decode a sequence of gzip - streams in a file. The append function of gzopen() can be used to create - such a file. (Also see gzflush() for another way to do this.) When - appending, gzopen does not test whether the file begins with a gzip stream, - nor does it look for the end of the gzip streams to begin appending. gzopen - will simply append a gzip stream to the existing file. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. When - reading, this will be detected automatically by looking for the magic two- - byte gzip header. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. If you are using fileno() to get the - file descriptor from a FILE *, then you will have to use dup() to avoid - double-close()ing the file descriptor. Both gzclose() and fclose() will - close the associated file descriptor, so they need to have different file - descriptors. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Three times that size in buffer space is allocated. A larger buffer - size of, for example, 64K or 128K bytes will noticeably increase the speed - of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. Previously provided - data is flushed before the parameter change. - - gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not - opened for writing, Z_ERRNO if there is an error writing the flushed data, - or Z_MEM_ERROR if there is a memory allocation error. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file is not in gzip format, gzread copies the given number of - bytes into the buffer directly from the file. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream. Any number of gzip streams may be - concatenated in the input file, and will all be decompressed by gzread(). - If something other than a gzip stream is encountered after a gzip stream, - that remaining trailing garbage is ignored (and no error is returned). - - gzread can be used to read a gzip file that is being concurrently written. - Upon reaching the end of the input, gzread will return with the available - data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then - gzclearerr can be used to clear the end of file indicator in order to permit - gzread to be tried again. Z_OK indicates that a gzip stream was completed - on the last gzread. Z_BUF_ERROR indicates that the input file ended in the - middle of a gzip stream. Note that gzread does not return -1 in the event - of an incomplete gzip stream. This error is deferred until gzclose(), which - will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip - stream. Alternatively, gzerror can be used before gzclose to detect this - case. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. If len is too large to fit in an int, - then nothing is read, -1 is returned, and the error state is set to - Z_STREAM_ERROR. -*/ - -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); -/* - Read up to nitems items of size size from file to buf, otherwise operating - as gzread() does. This duplicates the interface of stdio's fread(), with - size_t request and return types. If the library defines size_t, then - z_size_t is identical to size_t. If not, then z_size_t is an unsigned - integer type that can contain a pointer. - - gzfread() returns the number of full items read of size size, or zero if - the end of the file was reached and a full item could not be read, or if - there was an error. gzerror() must be consulted if zero is returned in - order to determine if there was an error. If the multiplication of size and - nitems overflows, i.e. the product does not fit in a z_size_t, then nothing - is read, zero is returned, and the error state is set to Z_STREAM_ERROR. - - In the event that the end of file is reached and only a partial item is - available at the end, i.e. the remaining uncompressed data length is not a - multiple of size, then the final partial item is nevetheless read into buf - and the end-of-file flag is set. The length of the partial item read is not - provided, but could be inferred from the result of gztell(). This behavior - is the same as the behavior of fread() implementations in common libraries, - but it prevents the direct use of gzfread() to read a concurrently written - file, reseting and retrying on end-of-file, when size is not 1. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); -/* - gzfwrite() writes nitems items of size size from buf to file, duplicating - the interface of stdio's fwrite(), with size_t request and return types. If - the library defines size_t, then z_size_t is identical to size_t. If not, - then z_size_t is an unsigned integer type that can contain a pointer. - - gzfwrite() returns the number of full items written of size size, or zero - if there was an error. If the multiplication of size and nitems overflows, - i.e. the product does not fit in a z_size_t, then nothing is written, zero - is returned, and the error state is set to Z_STREAM_ERROR. -*/ - -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or a negative zlib error code in case - of error. The number of uncompressed bytes written is limited to 8191, or - one less than the buffer size given to gzbuffer(). The caller should assure - that this limit is not exceeded. If it is exceeded, then gzprintf() will - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. - This can be determined using zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. This is implemented as a macro for speed. - As such, it does not do all of the checking the other functions do. I.e. - it does not check to see if file is NULL, nor whether the structure file - points to has been clobbered or not. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatenated gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). - - When writing, gzdirect() returns true (1) if transparent writing was - requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: - gzdirect() is not needed when writing. Transparent writing must be - explicitly requested, so the application already knows the answer. When - linking statically, using gzdirect() will include all of the zlib code for - gzip file reading and decompression, which may not be desired.) -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the - last read ended in the middle of a gzip stream, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - -#endif /* !Z_SOLO */ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); -/* - Same as adler32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note - that the z_off_t type (like off_t) is a signed integer. If len2 is - negative, the result has no meaning or utility. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); -/* - Same as crc32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#ifdef Z_PREFIX_SET -# define z_deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define z_inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#else -# define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#endif - -#ifndef Z_SOLO - -/* gzgetc() macro and its supporting function and exposed data structure. Note - * that the real internal state is much larger than the exposed structure. - * This abbreviated structure exposes just enough for the gzgetc() macro. The - * user should not mess with these exposed elements, since their names or - * behavior could change in the future, perhaps even capriciously. They can - * only be used by the gzgetc() macro. You have been warned. - */ -struct gzFile_s { - unsigned have; - unsigned char *next; - z_off64_t pos; -}; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ -#ifdef Z_PREFIX_SET -# undef z_gzgetc -# define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#else -# define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#endif - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) -# ifdef Z_PREFIX_SET -# define z_gzopen z_gzopen64 -# define z_gzseek z_gzseek64 -# define z_gztell z_gztell64 -# define z_gzoffset z_gzoffset64 -# define z_adler32_combine z_adler32_combine64 -# define z_crc32_combine z_crc32_combine64 -# else -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# endif -# ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -#else /* Z_SOLO */ - - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - -#endif /* !Z_SOLO */ - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); -#endif -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); -# endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ --------------------------------------------------------------------------------- -END LICENSE FOR external/zlib/zlib.h --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/aws/LICENSE --------------------------------------------------------------------------------- - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/aws/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/aws-checksums/LICENSE --------------------------------------------------------------------------------- - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/aws-checksums/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/aws-c-event-stream/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/aws-c-event-stream/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/aws-c-common/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/aws-c-common/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/com_github_googlecloudplatform_google_cloud_cpp/LICENSE --------------------------------------------------------------------------------- - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/com_github_googlecloudplatform_google_cloud_cpp/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/com_github_grpc_grpc/LICENSE --------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. --------------------------------------------------------------------------------- -END LICENSE FOR external/com_github_grpc_grpc/LICENSE --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -BEGIN LICENSE FOR external/com_github_grpc_grpc/third_party/address_sorting/LICENSE --------------------------------------------------------------------------------- -Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the project nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -END LICENSE FOR external/com_github_grpc_grpc/third_party/address_sorting/LICENSE --------------------------------------------------------------------------------- diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h deleted file mode 100755 index f550b690e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h +++ /dev/null @@ -1,1591 +0,0 @@ -/* Copyright 2015 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_C_API_H_ -#define TENSORFLOW_C_C_API_H_ - -#include -#include - -#include "tensorflow/c/tf_attrtype.h" -#include "tensorflow/c/tf_datatype.h" -#include "tensorflow/c/tf_status.h" -#include "tensorflow/c/tf_tensor.h" -#include "tensorflow/c/tf_tstring.h" - -// -------------------------------------------------------------------------- -// C API for TensorFlow. -// -// The API leans towards simplicity and uniformity instead of convenience -// since most usage will be by language specific wrappers. -// -// Conventions: -// * We use the prefix TF_ for everything in the API. -// * Objects are always passed around as pointers to opaque structs -// and these structs are allocated/deallocated via the API. -// * TF_Status holds error information. It is an object type -// and therefore is passed around as a pointer to an opaque -// struct as mentioned above. -// * Every call that has a TF_Status* argument clears it on success -// and fills it with error info on failure. -// * unsigned char is used for booleans (instead of the 'bool' type). -// In C++ bool is a keyword while in C99 bool is a macro defined -// in stdbool.h. It is possible for the two to be inconsistent. -// For example, neither the C99 nor the C++11 standard force a byte -// size on the bool type, so the macro defined in stdbool.h could -// be inconsistent with the bool keyword in C++. Thus, the use -// of stdbool.h is avoided and unsigned char is used instead. -// * size_t is used to represent byte sizes of objects that are -// materialized in the address space of the calling process. -// * int is used as an index into arrays. -// * Deletion functions are safe to call on nullptr. -// -// Questions left to address: -// * Might at some point need a way for callers to provide their own Env. -// * Maybe add TF_TensorShape that encapsulates dimension info. -// -// Design decisions made: -// * Backing store for tensor memory has an associated deallocation -// function. This deallocation function will point to client code -// for tensors populated by the client. So the client can do things -// like shadowing a numpy array. -// * We do not provide TF_OK since it is not strictly necessary and we -// are not optimizing for convenience. -// * We make assumption that one session has one graph. This should be -// fine since we have the ability to run sub-graphs. -// * We could allow NULL for some arguments (e.g., NULL options arg). -// However since convenience is not a primary goal, we don't do this. -// * Devices are not in this API. Instead, they are created/used internally -// and the API just provides high level controls over the number of -// devices of each type. - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -// -------------------------------------------------------------------------- -// TF_Version returns a string describing version information of the -// TensorFlow library. TensorFlow using semantic versioning. -TF_CAPI_EXPORT extern const char* TF_Version(void); - -// -------------------------------------------------------------------------- -// TF_Buffer holds a pointer to a block of data and its associated length. -// Typically, the data consists of a serialized protocol buffer, but other data -// may also be held in a buffer. -// -// By default, TF_Buffer itself does not do any memory management of the -// pointed-to block. If need be, users of this struct should specify how to -// deallocate the block by setting the `data_deallocator` function pointer. -typedef struct TF_Buffer { - const void* data; - size_t length; - void (*data_deallocator)(void* data, size_t length); -} TF_Buffer; - -// Makes a copy of the input and sets an appropriate deallocator. Useful for -// passing in read-only, input protobufs. -TF_CAPI_EXPORT extern TF_Buffer* TF_NewBufferFromString(const void* proto, - size_t proto_len); - -// Useful for passing *out* a protobuf. -TF_CAPI_EXPORT extern TF_Buffer* TF_NewBuffer(void); - -TF_CAPI_EXPORT extern void TF_DeleteBuffer(TF_Buffer*); - -TF_CAPI_EXPORT extern TF_Buffer TF_GetBuffer(TF_Buffer* buffer); - -// -------------------------------------------------------------------------- -// Used to return strings across the C API. The caller does not take ownership -// of the underlying data pointer and is not responsible for freeing it. -typedef struct TF_StringView { - const char* data; - size_t len; -} TF_StringView; - -// -------------------------------------------------------------------------- -// TF_SessionOptions holds options that can be passed during session creation. -typedef struct TF_SessionOptions TF_SessionOptions; - -// Return a new options object. -TF_CAPI_EXPORT extern TF_SessionOptions* TF_NewSessionOptions(void); - -// Set the target in TF_SessionOptions.options. -// target can be empty, a single entry, or a comma separated list of entries. -// Each entry is in one of the following formats : -// "local" -// ip:port -// host:port -TF_CAPI_EXPORT extern void TF_SetTarget(TF_SessionOptions* options, - const char* target); - -// Set the config in TF_SessionOptions.options. -// config should be a serialized tensorflow.ConfigProto proto. -// If config was not parsed successfully as a ConfigProto, record the -// error information in *status. -TF_CAPI_EXPORT extern void TF_SetConfig(TF_SessionOptions* options, - const void* proto, size_t proto_len, - TF_Status* status); - -// Destroy an options object. -TF_CAPI_EXPORT extern void TF_DeleteSessionOptions(TF_SessionOptions*); - -// TODO(jeff,sanjay): -// - export functions to set Config fields - -// -------------------------------------------------------------------------- -// The new graph construction API, still under development. - -// Represents a computation graph. Graphs may be shared between sessions. -// Graphs are thread-safe when used as directed below. -typedef struct TF_Graph TF_Graph; - -// Return a new graph object. -TF_CAPI_EXPORT extern TF_Graph* TF_NewGraph(void); - -// Destroy an options object. Graph will be deleted once no more -// TFSession's are referencing it. -TF_CAPI_EXPORT extern void TF_DeleteGraph(TF_Graph*); - -// Operation being built. The underlying graph must outlive this. -typedef struct TF_OperationDescription TF_OperationDescription; - -// Operation that has been added to the graph. Valid until the graph is -// deleted -- in particular adding a new operation to the graph does not -// invalidate old TF_Operation* pointers. -typedef struct TF_Operation TF_Operation; - -// Represents a specific input of an operation. -typedef struct TF_Input { - TF_Operation* oper; - int index; // The index of the input within oper. -} TF_Input; - -// Represents a specific output of an operation. -typedef struct TF_Output { - TF_Operation* oper; - int index; // The index of the output within oper. -} TF_Output; - -// TF_Function is a grouping of operations with defined inputs and outputs. -// Once created and added to graphs, functions can be invoked by creating an -// operation whose operation type matches the function name. -typedef struct TF_Function TF_Function; - -// Function definition options. TODO(iga): Define and implement -typedef struct TF_FunctionOptions TF_FunctionOptions; - -// Sets the shape of the Tensor referenced by `output` in `graph` to -// the shape described by `dims` and `num_dims`. -// -// If the number of dimensions is unknown, `num_dims` must be set to -// -1 and `dims` can be null. If a dimension is unknown, the -// corresponding entry in the `dims` array must be -1. -// -// This does not overwrite the existing shape associated with `output`, -// but merges the input shape with the existing shape. For example, -// setting a shape of [-1, 2] with an existing shape [2, -1] would set -// a final shape of [2, 2] based on shape merging semantics. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -// * An invalid shape is being set (e.g., the shape being set -// is incompatible with the existing shape). -TF_CAPI_EXPORT extern void TF_GraphSetTensorShape(TF_Graph* graph, - TF_Output output, - const int64_t* dims, - const int num_dims, - TF_Status* status); - -// Returns the number of dimensions of the Tensor referenced by `output` -// in `graph`. -// -// If the number of dimensions in the shape is unknown, returns -1. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -TF_CAPI_EXPORT extern int TF_GraphGetTensorNumDims(TF_Graph* graph, - TF_Output output, - TF_Status* status); - -// Returns the shape of the Tensor referenced by `output` in `graph` -// into `dims`. `dims` must be an array large enough to hold `num_dims` -// entries (e.g., the return value of TF_GraphGetTensorNumDims). -// -// If the number of dimensions in the shape is unknown or the shape is -// a scalar, `dims` will remain untouched. Otherwise, each element of -// `dims` will be set corresponding to the size of the dimension. An -// unknown dimension is represented by `-1`. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -// * `num_dims` does not match the actual number of dimensions. -TF_CAPI_EXPORT extern void TF_GraphGetTensorShape(TF_Graph* graph, - TF_Output output, - int64_t* dims, int num_dims, - TF_Status* status); - -// Operation will only be added to *graph when TF_FinishOperation() is -// called (assuming TF_FinishOperation() does not return an error). -// *graph must not be deleted until after TF_FinishOperation() is -// called. -TF_CAPI_EXPORT extern TF_OperationDescription* TF_NewOperation( - TF_Graph* graph, const char* op_type, const char* oper_name); - -// Specify the device for `desc`. Defaults to empty, meaning unconstrained. -TF_CAPI_EXPORT extern void TF_SetDevice(TF_OperationDescription* desc, - const char* device); - -// The calls to TF_AddInput and TF_AddInputList must match (in number, -// order, and type) the op declaration. For example, the "Concat" op -// has registration: -// REGISTER_OP("Concat") -// .Input("concat_dim: int32") -// .Input("values: N * T") -// .Output("output: T") -// .Attr("N: int >= 2") -// .Attr("T: type"); -// that defines two inputs, "concat_dim" and "values" (in that order). -// You must use TF_AddInput() for the first input (since it takes a -// single tensor), and TF_AddInputList() for the second input (since -// it takes a list, even if you were to pass a list with a single -// tensor), as in: -// TF_OperationDescription* desc = TF_NewOperation(graph, "Concat", "c"); -// TF_Output concat_dim_input = {...}; -// TF_AddInput(desc, concat_dim_input); -// TF_Output values_inputs[5] = {{...}, ..., {...}}; -// TF_AddInputList(desc, values_inputs, 5); - -// For inputs that take a single tensor. -TF_CAPI_EXPORT extern void TF_AddInput(TF_OperationDescription* desc, - TF_Output input); - -// For inputs that take a list of tensors. -// inputs must point to TF_Output[num_inputs]. -TF_CAPI_EXPORT extern void TF_AddInputList(TF_OperationDescription* desc, - const TF_Output* inputs, - int num_inputs); - -// Call once per control input to `desc`. -TF_CAPI_EXPORT extern void TF_AddControlInput(TF_OperationDescription* desc, - TF_Operation* input); - -// Request that `desc` be co-located on the device where `op` -// is placed. -// -// Use of this is discouraged since the implementation of device placement is -// subject to change. Primarily intended for internal libraries -TF_CAPI_EXPORT extern void TF_ColocateWith(TF_OperationDescription* desc, - TF_Operation* op); - -// Call some TF_SetAttr*() function for every attr that is not -// inferred from an input and doesn't have a default value you wish to -// keep. - -// `value` must point to a string of length `length` bytes. -TF_CAPI_EXPORT extern void TF_SetAttrString(TF_OperationDescription* desc, - const char* attr_name, - const void* value, size_t length); -// `values` and `lengths` each must have lengths `num_values`. -// `values[i]` must point to a string of length `lengths[i]` bytes. -TF_CAPI_EXPORT extern void TF_SetAttrStringList(TF_OperationDescription* desc, - const char* attr_name, - const void* const* values, - const size_t* lengths, - int num_values); -TF_CAPI_EXPORT extern void TF_SetAttrInt(TF_OperationDescription* desc, - const char* attr_name, int64_t value); -TF_CAPI_EXPORT extern void TF_SetAttrIntList(TF_OperationDescription* desc, - const char* attr_name, - const int64_t* values, - int num_values); -TF_CAPI_EXPORT extern void TF_SetAttrFloat(TF_OperationDescription* desc, - const char* attr_name, float value); -TF_CAPI_EXPORT extern void TF_SetAttrFloatList(TF_OperationDescription* desc, - const char* attr_name, - const float* values, - int num_values); -TF_CAPI_EXPORT extern void TF_SetAttrBool(TF_OperationDescription* desc, - const char* attr_name, - unsigned char value); -TF_CAPI_EXPORT extern void TF_SetAttrBoolList(TF_OperationDescription* desc, - const char* attr_name, - const unsigned char* values, - int num_values); -TF_CAPI_EXPORT extern void TF_SetAttrType(TF_OperationDescription* desc, - const char* attr_name, - TF_DataType value); -TF_CAPI_EXPORT extern void TF_SetAttrTypeList(TF_OperationDescription* desc, - const char* attr_name, - const TF_DataType* values, - int num_values); -TF_CAPI_EXPORT extern void TF_SetAttrPlaceholder(TF_OperationDescription* desc, - const char* attr_name, - const char* placeholder); - -// Set a 'func' attribute to the specified name. -// `value` must point to a string of length `length` bytes. -TF_CAPI_EXPORT extern void TF_SetAttrFuncName(TF_OperationDescription* desc, - const char* attr_name, - const char* value, size_t length); - -// Set `num_dims` to -1 to represent "unknown rank". Otherwise, -// `dims` points to an array of length `num_dims`. `dims[i]` must be -// >= -1, with -1 meaning "unknown dimension". -TF_CAPI_EXPORT extern void TF_SetAttrShape(TF_OperationDescription* desc, - const char* attr_name, - const int64_t* dims, int num_dims); -// `dims` and `num_dims` must point to arrays of length `num_shapes`. -// Set `num_dims[i]` to -1 to represent "unknown rank". Otherwise, -// `dims[i]` points to an array of length `num_dims[i]`. `dims[i][j]` -// must be >= -1, with -1 meaning "unknown dimension". -TF_CAPI_EXPORT extern void TF_SetAttrShapeList(TF_OperationDescription* desc, - const char* attr_name, - const int64_t* const* dims, - const int* num_dims, - int num_shapes); -// `proto` must point to an array of `proto_len` bytes representing a -// binary-serialized TensorShapeProto. -TF_CAPI_EXPORT extern void TF_SetAttrTensorShapeProto( - TF_OperationDescription* desc, const char* attr_name, const void* proto, - size_t proto_len, TF_Status* status); -// `protos` and `proto_lens` must point to arrays of length `num_shapes`. -// `protos[i]` must point to an array of `proto_lens[i]` bytes -// representing a binary-serialized TensorShapeProto. -TF_CAPI_EXPORT extern void TF_SetAttrTensorShapeProtoList( - TF_OperationDescription* desc, const char* attr_name, - const void* const* protos, const size_t* proto_lens, int num_shapes, - TF_Status* status); - -TF_CAPI_EXPORT extern void TF_SetAttrTensor(TF_OperationDescription* desc, - const char* attr_name, - TF_Tensor* value, - TF_Status* status); -TF_CAPI_EXPORT extern void TF_SetAttrTensorList(TF_OperationDescription* desc, - const char* attr_name, - TF_Tensor* const* values, - int num_values, - TF_Status* status); - -// `proto` should point to a sequence of bytes of length `proto_len` -// representing a binary serialization of an AttrValue protocol -// buffer. -TF_CAPI_EXPORT extern void TF_SetAttrValueProto(TF_OperationDescription* desc, - const char* attr_name, - const void* proto, - size_t proto_len, - TF_Status* status); - -// If this function succeeds: -// * *status is set to an OK value, -// * a TF_Operation is added to the graph, -// * a non-null value pointing to the added operation is returned -- -// this value is valid until the underlying graph is deleted. -// Otherwise: -// * *status is set to a non-OK value, -// * the graph is not modified, -// * a null value is returned. -// In either case, it deletes `desc`. -TF_CAPI_EXPORT extern TF_Operation* TF_FinishOperation( - TF_OperationDescription* desc, TF_Status* status); - -// TF_Operation functions. Operations are immutable once created, so -// these are all query functions. - -TF_CAPI_EXPORT extern const char* TF_OperationName(TF_Operation* oper); -TF_CAPI_EXPORT extern const char* TF_OperationOpType(TF_Operation* oper); -TF_CAPI_EXPORT extern const char* TF_OperationDevice(TF_Operation* oper); - -TF_CAPI_EXPORT extern int TF_OperationNumOutputs(TF_Operation* oper); -TF_CAPI_EXPORT extern TF_DataType TF_OperationOutputType(TF_Output oper_out); -TF_CAPI_EXPORT extern int TF_OperationOutputListLength(TF_Operation* oper, - const char* arg_name, - TF_Status* status); - -TF_CAPI_EXPORT extern int TF_OperationNumInputs(TF_Operation* oper); -TF_CAPI_EXPORT extern TF_DataType TF_OperationInputType(TF_Input oper_in); -TF_CAPI_EXPORT extern int TF_OperationInputListLength(TF_Operation* oper, - const char* arg_name, - TF_Status* status); - -// In this code: -// TF_Output producer = TF_OperationInput(consumer); -// There is an edge from producer.oper's output (given by -// producer.index) to consumer.oper's input (given by consumer.index). -TF_CAPI_EXPORT extern TF_Output TF_OperationInput(TF_Input oper_in); - -// Get list of all inputs of a specific operation. `inputs` must point to -// an array of length at least `max_inputs` (ideally set to -// TF_OperationNumInputs(oper)). Beware that a concurrent -// modification of the graph can increase the number of inputs of -// an operation. -TF_CAPI_EXPORT extern void TF_OperationAllInputs(TF_Operation* oper, - TF_Output* inputs, - int max_inputs); - -// Get the number of current consumers of a specific output of an -// operation. Note that this number can change when new operations -// are added to the graph. -TF_CAPI_EXPORT extern int TF_OperationOutputNumConsumers(TF_Output oper_out); - -// Get list of all current consumers of a specific output of an -// operation. `consumers` must point to an array of length at least -// `max_consumers` (ideally set to -// TF_OperationOutputNumConsumers(oper_out)). Beware that a concurrent -// modification of the graph can increase the number of consumers of -// an operation. Returns the number of output consumers (should match -// TF_OperationOutputNumConsumers(oper_out)). -TF_CAPI_EXPORT extern int TF_OperationOutputConsumers(TF_Output oper_out, - TF_Input* consumers, - int max_consumers); - -// Get the number of control inputs to an operation. -TF_CAPI_EXPORT extern int TF_OperationNumControlInputs(TF_Operation* oper); - -// Get list of all control inputs to an operation. `control_inputs` must -// point to an array of length `max_control_inputs` (ideally set to -// TF_OperationNumControlInputs(oper)). Returns the number of control -// inputs (should match TF_OperationNumControlInputs(oper)). -TF_CAPI_EXPORT extern int TF_OperationGetControlInputs( - TF_Operation* oper, TF_Operation** control_inputs, int max_control_inputs); - -// Get the number of operations that have `*oper` as a control input. -// Note that this number can change when new operations are added to -// the graph. -TF_CAPI_EXPORT extern int TF_OperationNumControlOutputs(TF_Operation* oper); - -// Get the list of operations that have `*oper` as a control input. -// `control_outputs` must point to an array of length at least -// `max_control_outputs` (ideally set to -// TF_OperationNumControlOutputs(oper)). Beware that a concurrent -// modification of the graph can increase the number of control -// outputs. Returns the number of control outputs (should match -// TF_OperationNumControlOutputs(oper)). -TF_CAPI_EXPORT extern int TF_OperationGetControlOutputs( - TF_Operation* oper, TF_Operation** control_outputs, - int max_control_outputs); - -// TF_AttrMetadata describes the value of an attribute on an operation. -typedef struct TF_AttrMetadata { - // A boolean: 1 if the attribute value is a list, 0 otherwise. - unsigned char is_list; - - // Length of the list if is_list is true. Undefined otherwise. - int64_t list_size; - - // Type of elements of the list if is_list != 0. - // Type of the single value stored in the attribute if is_list == 0. - TF_AttrType type; - - // Total size the attribute value. - // The units of total_size depend on is_list and type. - // (1) If type == TF_ATTR_STRING and is_list == 0 - // then total_size is the byte size of the string - // valued attribute. - // (2) If type == TF_ATTR_STRING and is_list == 1 - // then total_size is the cumulative byte size - // of all the strings in the list. - // (3) If type == TF_ATTR_SHAPE and is_list == 0 - // then total_size is the number of dimensions - // of the shape valued attribute, or -1 - // if its rank is unknown. - // (4) If type == TF_ATTR_SHAPE and is_list == 1 - // then total_size is the cumulative number - // of dimensions of all shapes in the list. - // (5) Otherwise, total_size is undefined. - int64_t total_size; -} TF_AttrMetadata; - -// Returns metadata about the value of the attribute `attr_name` of `oper`. -TF_CAPI_EXPORT extern TF_AttrMetadata TF_OperationGetAttrMetadata( - TF_Operation* oper, const char* attr_name, TF_Status* status); - -// Fills in `value` with the value of the attribute `attr_name`. `value` must -// point to an array of length at least `max_length` (ideally set to -// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrString(TF_Operation* oper, - const char* attr_name, - void* value, - size_t max_length, - TF_Status* status); - -// Get the list of strings in the value of the attribute `attr_name`. Fills in -// `values` and `lengths`, each of which must point to an array of length at -// least `max_values`. -// -// The elements of values will point to addresses in `storage` which must be at -// least `storage_size` bytes in length. Ideally, max_values would be set to -// TF_AttrMetadata.list_size and `storage` would be at least -// TF_AttrMetadata.total_size, obtained from TF_OperationGetAttrMetadata(oper, -// attr_name). -// -// Fails if storage_size is too small to hold the requested number of strings. -TF_CAPI_EXPORT extern void TF_OperationGetAttrStringList( - TF_Operation* oper, const char* attr_name, void** values, size_t* lengths, - int max_values, void* storage, size_t storage_size, TF_Status* status); - -TF_CAPI_EXPORT extern void TF_OperationGetAttrInt(TF_Operation* oper, - const char* attr_name, - int64_t* value, - TF_Status* status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrIntList(TF_Operation* oper, - const char* attr_name, - int64_t* values, - int max_values, - TF_Status* status); - -TF_CAPI_EXPORT extern void TF_OperationGetAttrFloat(TF_Operation* oper, - const char* attr_name, - float* value, - TF_Status* status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrFloatList(TF_Operation* oper, - const char* attr_name, - float* values, - int max_values, - TF_Status* status); - -TF_CAPI_EXPORT extern void TF_OperationGetAttrBool(TF_Operation* oper, - const char* attr_name, - unsigned char* value, - TF_Status* status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrBoolList(TF_Operation* oper, - const char* attr_name, - unsigned char* values, - int max_values, - TF_Status* status); - -TF_CAPI_EXPORT extern void TF_OperationGetAttrType(TF_Operation* oper, - const char* attr_name, - TF_DataType* value, - TF_Status* status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrTypeList(TF_Operation* oper, - const char* attr_name, - TF_DataType* values, - int max_values, - TF_Status* status); - -// Fills in `value` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `num_dims` (ideally set to -// TF_Attr_Meta.size from TF_OperationGetAttrMetadata(oper, attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrShape(TF_Operation* oper, - const char* attr_name, - int64_t* value, - int num_dims, - TF_Status* status); - -// Fills in `dims` with the list of shapes in the attribute `attr_name` of -// `oper` and `num_dims` with the corresponding number of dimensions. On return, -// for every i where `num_dims[i]` > 0, `dims[i]` will be an array of -// `num_dims[i]` elements. A value of -1 for `num_dims[i]` indicates that the -// i-th shape in the list is unknown. -// -// The elements of `dims` will point to addresses in `storage` which must be -// large enough to hold at least `storage_size` int64_ts. Ideally, `num_shapes` -// would be set to TF_AttrMetadata.list_size and `storage_size` would be set to -// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, -// attr_name). -// -// Fails if storage_size is insufficient to hold the requested shapes. -TF_CAPI_EXPORT extern void TF_OperationGetAttrShapeList( - TF_Operation* oper, const char* attr_name, int64_t** dims, int* num_dims, - int num_shapes, int64_t* storage, int storage_size, TF_Status* status); - -// Sets `value` to the binary-serialized TensorShapeProto of the value of -// `attr_name` attribute of `oper`'. -TF_CAPI_EXPORT extern void TF_OperationGetAttrTensorShapeProto( - TF_Operation* oper, const char* attr_name, TF_Buffer* value, - TF_Status* status); - -// Fills in `values` with binary-serialized TensorShapeProto values of the -// attribute `attr_name` of `oper`. `values` must point to an array of length at -// least `num_values` (ideally set to TF_AttrMetadata.list_size from -// TF_OperationGetAttrMetadata(oper, attr_name)). -TF_CAPI_EXPORT extern void TF_OperationGetAttrTensorShapeProtoList( - TF_Operation* oper, const char* attr_name, TF_Buffer** values, - int max_values, TF_Status* status); - -// Gets the TF_Tensor valued attribute of `attr_name` of `oper`. -// -// Allocates a new TF_Tensor which the caller is expected to take -// ownership of (and can deallocate using TF_DeleteTensor). -TF_CAPI_EXPORT extern void TF_OperationGetAttrTensor(TF_Operation* oper, - const char* attr_name, - TF_Tensor** value, - TF_Status* status); - -// Fills in `values` with the TF_Tensor values of the attribute `attr_name` of -// `oper`. `values` must point to an array of TF_Tensor* of length at least -// `max_values` (ideally set to TF_AttrMetadata.list_size from -// TF_OperationGetAttrMetadata(oper, attr_name)). -// -// The caller takes ownership of all the non-null TF_Tensor* entries in `values` -// (which can be deleted using TF_DeleteTensor(values[i])). -TF_CAPI_EXPORT extern void TF_OperationGetAttrTensorList(TF_Operation* oper, - const char* attr_name, - TF_Tensor** values, - int max_values, - TF_Status* status); - -// Sets `output_attr_value` to the binary-serialized AttrValue proto -// representation of the value of the `attr_name` attr of `oper`. -TF_CAPI_EXPORT extern void TF_OperationGetAttrValueProto( - TF_Operation* oper, const char* attr_name, TF_Buffer* output_attr_value, - TF_Status* status); - -// Returns the operation in the graph with `oper_name`. Returns nullptr if -// no operation found. -TF_CAPI_EXPORT extern TF_Operation* TF_GraphOperationByName( - TF_Graph* graph, const char* oper_name); - -// Iterate through the operations of a graph. To use: -// size_t pos = 0; -// TF_Operation* oper; -// while ((oper = TF_GraphNextOperation(graph, &pos)) != nullptr) { -// DoSomethingWithOperation(oper); -// } -TF_CAPI_EXPORT extern TF_Operation* TF_GraphNextOperation(TF_Graph* graph, - size_t* pos); - -// Write out a serialized representation of `graph` (as a GraphDef protocol -// message) to `output_graph_def` (allocated by TF_NewBuffer()). -// `output_graph_def`'s underlying buffer will be freed when TF_DeleteBuffer() -// is called. -// -// May fail on very large graphs in the future. -TF_CAPI_EXPORT extern void TF_GraphToGraphDef(TF_Graph* graph, - TF_Buffer* output_graph_def, - TF_Status* status); - -// Returns the serialized OpDef proto with name `op_name`, or a bad status if no -// such op exists. This can return OpDefs of functions copied into the graph. -TF_CAPI_EXPORT extern void TF_GraphGetOpDef(TF_Graph* graph, - const char* op_name, - TF_Buffer* output_op_def, - TF_Status* status); - -// Returns the serialized VersionDef proto for this graph. -TF_CAPI_EXPORT extern void TF_GraphVersions(TF_Graph* graph, - TF_Buffer* output_version_def, - TF_Status* status); - -// TF_ImportGraphDefOptions holds options that can be passed to -// TF_GraphImportGraphDef. -typedef struct TF_ImportGraphDefOptions TF_ImportGraphDefOptions; - -TF_CAPI_EXPORT extern TF_ImportGraphDefOptions* TF_NewImportGraphDefOptions( - void); -TF_CAPI_EXPORT extern void TF_DeleteImportGraphDefOptions( - TF_ImportGraphDefOptions* opts); - -// Set the prefix to be prepended to the names of nodes in `graph_def` that will -// be imported into `graph`. `prefix` is copied and has no lifetime -// requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsSetPrefix( - TF_ImportGraphDefOptions* opts, const char* prefix); - -// Set the execution device for nodes in `graph_def`. -// Only applies to nodes where a device was not already explicitly specified. -// `device` is copied and has no lifetime requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsSetDefaultDevice( - TF_ImportGraphDefOptions* opts, const char* device); - -// Set whether to uniquify imported operation names. If true, imported operation -// names will be modified if their name already exists in the graph. If false, -// conflicting names will be treated as an error. Note that this option has no -// effect if a prefix is set, since the prefix will guarantee all names are -// unique. Defaults to false. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsSetUniquifyNames( - TF_ImportGraphDefOptions* opts, unsigned char uniquify_names); - -// If true, the specified prefix will be modified if it already exists as an -// operation name or prefix in the graph. If false, a conflicting prefix will be -// treated as an error. This option has no effect if no prefix is specified. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsSetUniquifyPrefix( - TF_ImportGraphDefOptions* opts, unsigned char uniquify_prefix); - -// Set any imported nodes with input `src_name:src_index` to have that input -// replaced with `dst`. `src_name` refers to a node in the graph to be imported, -// `dst` references a node already existing in the graph being imported into. -// `src_name` is copied and has no lifetime requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsAddInputMapping( - TF_ImportGraphDefOptions* opts, const char* src_name, int src_index, - TF_Output dst); - -// Set any imported nodes with control input `src_name` to have that input -// replaced with `dst`. `src_name` refers to a node in the graph to be imported, -// `dst` references an operation already existing in the graph being imported -// into. `src_name` is copied and has no lifetime requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsRemapControlDependency( - TF_ImportGraphDefOptions* opts, const char* src_name, TF_Operation* dst); - -// Cause the imported graph to have a control dependency on `oper`. `oper` -// should exist in the graph being imported into. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsAddControlDependency( - TF_ImportGraphDefOptions* opts, TF_Operation* oper); - -// Add an output in `graph_def` to be returned via the `return_outputs` output -// parameter of TF_GraphImportGraphDef(). If the output is remapped via an input -// mapping, the corresponding existing tensor in `graph` will be returned. -// `oper_name` is copied and has no lifetime requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsAddReturnOutput( - TF_ImportGraphDefOptions* opts, const char* oper_name, int index); - -// Returns the number of return outputs added via -// TF_ImportGraphDefOptionsAddReturnOutput(). -TF_CAPI_EXPORT extern int TF_ImportGraphDefOptionsNumReturnOutputs( - const TF_ImportGraphDefOptions* opts); - -// Add an operation in `graph_def` to be returned via the `return_opers` output -// parameter of TF_GraphImportGraphDef(). `oper_name` is copied and has no -// lifetime requirements. -TF_CAPI_EXPORT extern void TF_ImportGraphDefOptionsAddReturnOperation( - TF_ImportGraphDefOptions* opts, const char* oper_name); - -// Returns the number of return operations added via -// TF_ImportGraphDefOptionsAddReturnOperation(). -TF_CAPI_EXPORT extern int TF_ImportGraphDefOptionsNumReturnOperations( - const TF_ImportGraphDefOptions* opts); - -// TF_ImportGraphDefResults holds results that are generated by -// TF_GraphImportGraphDefWithResults(). -typedef struct TF_ImportGraphDefResults TF_ImportGraphDefResults; - -// Fetches the return outputs requested via -// TF_ImportGraphDefOptionsAddReturnOutput(). The number of fetched outputs is -// returned in `num_outputs`. The array of return outputs is returned in -// `outputs`. `*outputs` is owned by and has the lifetime of `results`. -TF_CAPI_EXPORT extern void TF_ImportGraphDefResultsReturnOutputs( - TF_ImportGraphDefResults* results, int* num_outputs, TF_Output** outputs); - -// Fetches the return operations requested via -// TF_ImportGraphDefOptionsAddReturnOperation(). The number of fetched -// operations is returned in `num_opers`. The array of return operations is -// returned in `opers`. `*opers` is owned by and has the lifetime of `results`. -TF_CAPI_EXPORT extern void TF_ImportGraphDefResultsReturnOperations( - TF_ImportGraphDefResults* results, int* num_opers, TF_Operation*** opers); - -// Fetches any input mappings requested via -// TF_ImportGraphDefOptionsAddInputMapping() that didn't appear in the GraphDef -// and weren't used as input to any node in the imported graph def. The number -// of fetched mappings is returned in `num_missing_unused_input_mappings`. The -// array of each mapping's source node name is returned in `src_names`, and the -// array of each mapping's source index is returned in `src_indexes`. -// -// `*src_names`, `*src_indexes`, and the memory backing each string in -// `src_names` are owned by and have the lifetime of `results`. -TF_CAPI_EXPORT extern void TF_ImportGraphDefResultsMissingUnusedInputMappings( - TF_ImportGraphDefResults* results, int* num_missing_unused_input_mappings, - const char*** src_names, int** src_indexes); - -// Deletes a results object returned by TF_GraphImportGraphDefWithResults(). -TF_CAPI_EXPORT extern void TF_DeleteImportGraphDefResults( - TF_ImportGraphDefResults* results); - -// Import the graph serialized in `graph_def` into `graph`. Returns nullptr and -// a bad status on error. Otherwise, returns a populated -// TF_ImportGraphDefResults instance. The returned instance must be deleted via -// TF_DeleteImportGraphDefResults(). -TF_CAPI_EXPORT extern TF_ImportGraphDefResults* -TF_GraphImportGraphDefWithResults(TF_Graph* graph, const TF_Buffer* graph_def, - const TF_ImportGraphDefOptions* options, - TF_Status* status); - -// Import the graph serialized in `graph_def` into `graph`. -// Convenience function for when only return outputs are needed. -// -// `num_return_outputs` must be the number of return outputs added (i.e. the -// result of TF_ImportGraphDefOptionsNumReturnOutputs()). If -// `num_return_outputs` is non-zero, `return_outputs` must be of length -// `num_return_outputs`. Otherwise it can be null. -TF_CAPI_EXPORT extern void TF_GraphImportGraphDefWithReturnOutputs( - TF_Graph* graph, const TF_Buffer* graph_def, - const TF_ImportGraphDefOptions* options, TF_Output* return_outputs, - int num_return_outputs, TF_Status* status); - -// Import the graph serialized in `graph_def` into `graph`. -// Convenience function for when no results are needed. -TF_CAPI_EXPORT extern void TF_GraphImportGraphDef( - TF_Graph* graph, const TF_Buffer* graph_def, - const TF_ImportGraphDefOptions* options, TF_Status* status); - -// Adds a copy of function `func` and optionally its gradient function `grad` -// to `g`. Once `func`/`grad` is added to `g`, it can be called by creating -// an operation using the function's name. -// Any changes to `func`/`grad` (including deleting it) done after this method -// returns, won't affect the copy of `func`/`grad` in `g`. -// If `func` or `grad` are already in `g`, TF_GraphCopyFunction has no -// effect on them, but can establish the function->gradient relationship -// between them if `func` does not already have a gradient. If `func` already -// has a gradient different from `grad`, an error is returned. -// -// `func` must not be null. -// If `grad` is null and `func` is not in `g`, `func` is added without a -// gradient. -// If `grad` is null and `func` is in `g`, TF_GraphCopyFunction is a noop. -// `grad` must have appropriate signature as described in the doc of -// GradientDef in tensorflow/core/framework/function.proto. -// -// If successful, status is set to OK and `func` and `grad` are added to `g`. -// Otherwise, status is set to the encountered error and `g` is unmodified. -TF_CAPI_EXPORT extern void TF_GraphCopyFunction(TF_Graph* g, - const TF_Function* func, - const TF_Function* grad, - TF_Status* status); - -// Returns the number of TF_Functions registered in `g`. -TF_CAPI_EXPORT extern int TF_GraphNumFunctions(TF_Graph* g); - -// Fills in `funcs` with the TF_Function* registered in `g`. -// `funcs` must point to an array of TF_Function* of length at least -// `max_func`. In usual usage, max_func should be set to the result of -// TF_GraphNumFunctions(g). In this case, all the functions registered in -// `g` will be returned. Else, an unspecified subset. -// -// If successful, returns the number of TF_Function* successfully set in -// `funcs` and sets status to OK. The caller takes ownership of -// all the returned TF_Functions. They must be deleted with TF_DeleteFunction. -// On error, returns 0, sets status to the encountered error, and the contents -// of funcs will be undefined. -TF_CAPI_EXPORT extern int TF_GraphGetFunctions(TF_Graph* g, TF_Function** funcs, - int max_func, TF_Status* status); - -// Note: The following function may fail on very large protos in the future. - -TF_CAPI_EXPORT extern void TF_OperationToNodeDef(TF_Operation* oper, - TF_Buffer* output_node_def, - TF_Status* status); - -typedef struct TF_WhileParams { - // The number of inputs to the while loop, i.e. the number of loop variables. - // This is the size of cond_inputs, body_inputs, and body_outputs. - const int ninputs; - - // The while condition graph. The inputs are the current values of the loop - // variables. The output should be a scalar boolean. - TF_Graph* const cond_graph; - const TF_Output* const cond_inputs; - TF_Output cond_output; - - // The loop body graph. The inputs are the current values of the loop - // variables. The outputs are the updated values of the loop variables. - TF_Graph* const body_graph; - const TF_Output* const body_inputs; - TF_Output* const body_outputs; - - // Unique null-terminated name for this while loop. This is used as a prefix - // for created operations. - const char* name; -} TF_WhileParams; - -// Creates a TF_WhileParams for creating a while loop in `g`. `inputs` are -// outputs that already exist in `g` used as initial values for the loop -// variables. -// -// The returned TF_WhileParams will have all fields initialized except -// `cond_output`, `body_outputs`, and `name`. The `body_outputs` buffer will be -// allocated to size `ninputs`. The caller should build `cond_graph` and -// `body_graph` starting from the inputs, and store the final outputs in -// `cond_output` and `body_outputs`. -// -// If `status` is OK, the caller must call either TF_FinishWhile or -// TF_AbortWhile on the returned TF_WhileParams. If `status` isn't OK, the -// returned TF_WhileParams is not valid, and the caller should not call -// TF_FinishWhile() or TF_AbortWhile(). -// -// Missing functionality (TODO): -// - Gradients -// - Reference-type inputs -// - Directly referencing external tensors from the cond/body graphs (this is -// possible in the Python API) -TF_CAPI_EXPORT extern TF_WhileParams TF_NewWhile(TF_Graph* g, TF_Output* inputs, - int ninputs, - TF_Status* status); - -// Builds the while loop specified by `params` and returns the output tensors of -// the while loop in `outputs`. `outputs` should be allocated to size -// `params.ninputs`. -// -// `params` is no longer valid once this returns. -// -// Either this or TF_AbortWhile() must be called after a successful -// TF_NewWhile() call. -TF_CAPI_EXPORT extern void TF_FinishWhile(const TF_WhileParams* params, - TF_Status* status, - TF_Output* outputs); - -// Frees `params`s resources without building a while loop. `params` is no -// longer valid after this returns. Either this or TF_FinishWhile() must be -// called after a successful TF_NewWhile() call. -TF_CAPI_EXPORT extern void TF_AbortWhile(const TF_WhileParams* params); - -// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, -// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... -// -// `dx` are used as initial gradients (which represent the symbolic partial -// derivatives of some loss function `L` w.r.t. `y`). -// `dx` must be nullptr or have size `ny`. -// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all -// shapes in `y`. -// The partial derivatives are returned in `dy`. `dy` should be allocated to -// size `nx`. -// -// Gradient nodes are automatically named under the "gradients/" prefix. To -// guarantee name uniqueness, subsequent calls to the same graph will -// append an incremental tag to the prefix: "gradients_1/", "gradients_2/", ... -// See TF_AddGradientsWithPrefix, which provides a means to specify a custom -// name prefix for operations added to a graph to compute the gradients. -// -// WARNING: This function does not yet support all the gradients that python -// supports. See -// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md -// for instructions on how to add C++ more gradients. -TF_CAPI_EXPORT void TF_AddGradients(TF_Graph* g, TF_Output* y, int ny, - TF_Output* x, int nx, TF_Output* dx, - TF_Status* status, TF_Output* dy); - -// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, -// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... -// This is a variant of TF_AddGradients that allows to caller to pass a custom -// name prefix to the operations added to a graph to compute the gradients. -// -// `dx` are used as initial gradients (which represent the symbolic partial -// derivatives of some loss function `L` w.r.t. `y`). -// `dx` must be nullptr or have size `ny`. -// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all -// shapes in `y`. -// The partial derivatives are returned in `dy`. `dy` should be allocated to -// size `nx`. -// `prefix` names the scope into which all gradients operations are being added. -// `prefix` must be unique within the provided graph otherwise this operation -// will fail. If `prefix` is nullptr, the default prefixing behaviour takes -// place, see TF_AddGradients for more details. -// -// WARNING: This function does not yet support all the gradients that python -// supports. See -// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md -// for instructions on how to add C++ more gradients. -TF_CAPI_EXPORT void TF_AddGradientsWithPrefix(TF_Graph* g, const char* prefix, - TF_Output* y, int ny, - TF_Output* x, int nx, - TF_Output* dx, TF_Status* status, - TF_Output* dy); - -// Create a TF_Function from a TF_Graph -// -// Params: -// fn_body - the graph whose operations (or subset of whose operations) will be -// converted to TF_Function. -// fn_name - the name of the new TF_Function. Should match the operation -// name (OpDef.name) regexp [A-Z][A-Za-z0-9_.\\-/]*. -// If `append_hash_to_fn_name` is false, `fn_name` must be distinct -// from other function and operation names (at least those -// registered in graphs where this function will be used). -// append_hash_to_fn_name - Must be 0 or 1. If set to 1, the actual name -// of the function will be `fn_name` appended with -// '_'. -// If set to 0, the function's name will be `fn_name`. -// num_opers - `num_opers` contains the number of elements in the `opers` array -// or a special value of -1 meaning that no array is given. -// The distinction between an empty array of operations and no -// array of operations is necessary to distinguish the case of -// creating a function with no body (e.g. identity or permutation) -// and the case of creating a function whose body contains all -// the nodes in the graph (except for the automatic skipping, see -// below). -// opers - Array of operations to become the body of the function or null. -// - If no array is given (`num_opers` = -1), all the -// operations in `fn_body` will become part of the function -// except operations referenced in `inputs`. These operations -// must have a single output (these operations are typically -// placeholders created for the sole purpose of representing -// an input. We can relax this constraint if there are -// compelling use cases). -// - If an array is given (`num_opers` >= 0), all operations -// in it will become part of the function. In particular, no -// automatic skipping of dummy input operations is performed. -// ninputs - number of elements in `inputs` array -// inputs - array of TF_Outputs that specify the inputs to the function. -// If `ninputs` is zero (the function takes no inputs), `inputs` -// can be null. The names used for function inputs are normalized -// names of the operations (usually placeholders) pointed to by -// `inputs`. These operation names should start with a letter. -// Normalization will convert all letters to lowercase and -// non-alphanumeric characters to '_' to make resulting names match -// the "[a-z][a-z0-9_]*" pattern for operation argument names. -// `inputs` cannot contain the same tensor twice. -// noutputs - number of elements in `outputs` array -// outputs - array of TF_Outputs that specify the outputs of the function. -// If `noutputs` is zero (the function returns no outputs), `outputs` -// can be null. `outputs` can contain the same tensor more than once. -// output_names - The names of the function's outputs. `output_names` array -// must either have the same length as `outputs` -// (i.e. `noutputs`) or be null. In the former case, -// the names should match the regular expression for ArgDef -// names - "[a-z][a-z0-9_]*". In the latter case, -// names for outputs will be generated automatically. -// opts - various options for the function, e.g. XLA's inlining control. -// description - optional human-readable description of this function. -// status - Set to OK on success and an appropriate error on failure. -// -// Note that when the same TF_Output is listed as both an input and an output, -// the corresponding function's output will equal to this input, -// instead of the original node's output. -// -// Callers must also satisfy the following constraints: -// - `inputs` cannot refer to TF_Outputs within a control flow context. For -// example, one cannot use the output of "switch" node as input. -// - `inputs` and `outputs` cannot have reference types. Reference types are -// not exposed through C API and are being replaced with Resources. We support -// reference types inside function's body to support legacy code. Do not -// use them in new code. -// - Every node in the function's body must have all of its inputs (including -// control inputs). In other words, for every node in the body, each input -// must be either listed in `inputs` or must come from another node in -// the body. In particular, it is an error to have a control edge going from -// a node outside of the body into a node in the body. This applies to control -// edges going from nodes referenced in `inputs` to nodes in the body when -// the former nodes are not in the body (automatically skipped or not -// included in explicitly specified body). -// -// Returns: -// On success, a newly created TF_Function instance. It must be deleted by -// calling TF_DeleteFunction. -// -// On failure, null. -TF_CAPI_EXPORT extern TF_Function* TF_GraphToFunction( - const TF_Graph* fn_body, const char* fn_name, - unsigned char append_hash_to_fn_name, int num_opers, - const TF_Operation* const* opers, int ninputs, const TF_Output* inputs, - int noutputs, const TF_Output* outputs, const char* const* output_names, - const TF_FunctionOptions* opts, const char* description, TF_Status* status); - -// Similar to TF_GraphToFunction but allows specifying control outputs of the -// function. -// -// The arguments of TF_GraphToFunction have the same meaning, but the new -// arguments are as follows: -// -// ncontrol_outputs: Number of control outputs of the function. -// control_outputs: vector of TF_Operation objects to be marked as control -// outputs of the function. Operations marked as control outputs are -// guaranteed to execute. -// control_output_names: Optional. If not nullptr, vector of strings, one -// per control output, with their names to be added to the function's -// OpDef. -TF_CAPI_EXPORT extern TF_Function* TF_GraphToFunctionWithControlOutputs( - const TF_Graph* fn_body, const char* fn_name, - unsigned char append_hash_to_fn_name, int num_opers, - const TF_Operation* const* opers, int ninputs, const TF_Output* inputs, - int noutputs, const TF_Output* outputs, const char* const* output_names, - int ncontrol_outputs, const TF_Operation* const* control_outputs, - const char* const* control_output_names, const TF_FunctionOptions* opts, - const char* description, TF_Status* status); - -// Returns the name of the graph function. -// The return value points to memory that is only usable until the next -// mutation to *func. -TF_CAPI_EXPORT extern const char* TF_FunctionName(TF_Function* func); - -// Write out a serialized representation of `func` (as a FunctionDef protocol -// message) to `output_func_def` (allocated by TF_NewBuffer()). -// `output_func_def`'s underlying buffer will be freed when TF_DeleteBuffer() -// is called. -// -// May fail on very large graphs in the future. -TF_CAPI_EXPORT extern void TF_FunctionToFunctionDef(TF_Function* func, - TF_Buffer* output_func_def, - TF_Status* status); - -// Construct and return the function whose FunctionDef representation is -// serialized in `proto`. `proto_len` must equal the number of bytes -// pointed to by `proto`. -// Returns: -// On success, a newly created TF_Function instance. It must be deleted by -// calling TF_DeleteFunction. -// -// On failure, null. -TF_CAPI_EXPORT extern TF_Function* TF_FunctionImportFunctionDef( - const void* proto, size_t proto_len, TF_Status* status); - -// Sets function attribute named `attr_name` to value stored in `proto`. -// If this attribute is already set to another value, it is overridden. -// `proto` should point to a sequence of bytes of length `proto_len` -// representing a binary serialization of an AttrValue protocol -// buffer. -TF_CAPI_EXPORT extern void TF_FunctionSetAttrValueProto(TF_Function* func, - const char* attr_name, - const void* proto, - size_t proto_len, - TF_Status* status); - -// Sets `output_attr_value` to the binary-serialized AttrValue proto -// representation of the value of the `attr_name` attr of `func`. -// If `attr_name` attribute is not present, status is set to an error. -TF_CAPI_EXPORT extern void TF_FunctionGetAttrValueProto( - TF_Function* func, const char* attr_name, TF_Buffer* output_attr_value, - TF_Status* status); - -// Frees the memory used by the `func` struct. -// TF_DeleteFunction is a noop if `func` is null. -// Deleting a function does not remove it from any graphs it was copied to. -TF_CAPI_EXPORT extern void TF_DeleteFunction(TF_Function* func); - -// Attempts to evaluate `output`. This will only be possible if `output` doesn't -// depend on any graph inputs (this function is safe to call if this isn't the -// case though). -// -// If the evaluation is successful, this function returns true and `output`s -// value is returned in `result`. Otherwise returns false. An error status is -// returned if something is wrong with the graph or input. Note that this may -// return false even if no error status is set. -TF_CAPI_EXPORT extern unsigned char TF_TryEvaluateConstant(TF_Graph* graph, - TF_Output output, - TF_Tensor** result, - TF_Status* status); - -// TODO(josh11b): Register OpDef, available to all operations added -// to this graph. - -// -------------------------------------------------------------------------- -// API for driving Graph execution. - -typedef struct TF_Session TF_Session; - -// Return a new execution session with the associated graph, or NULL on -// error. Does not take ownership of any input parameters. -// -// *`graph` must be a valid graph (not deleted or nullptr). `graph` will be be -// kept alive for the lifetime of the returned TF_Session. New nodes can still -// be added to `graph` after this call. -TF_CAPI_EXPORT extern TF_Session* TF_NewSession(TF_Graph* graph, - const TF_SessionOptions* opts, - TF_Status* status); - -// This function creates a new TF_Session (which is created on success) using -// `session_options`, and then initializes state (restoring tensors and other -// assets) using `run_options`. -// -// Any NULL and non-NULL value combinations for (`run_options, `meta_graph_def`) -// are valid. -// -// - `export_dir` must be set to the path of the exported SavedModel. -// - `tags` must include the set of tags used to identify one MetaGraphDef in -// the SavedModel. -// - `graph` must be a graph newly allocated with TF_NewGraph(). -// -// If successful, populates `graph` with the contents of the Graph and -// `meta_graph_def` with the MetaGraphDef of the loaded model. -TF_CAPI_EXPORT extern TF_Session* TF_LoadSessionFromSavedModel( - const TF_SessionOptions* session_options, const TF_Buffer* run_options, - const char* export_dir, const char* const* tags, int tags_len, - TF_Graph* graph, TF_Buffer* meta_graph_def, TF_Status* status); - -// Close a session. -// -// Contacts any other processes associated with the session, if applicable. -// May not be called after TF_DeleteSession(). -TF_CAPI_EXPORT extern void TF_CloseSession(TF_Session*, TF_Status* status); - -// Destroy a session object. -// -// Even if error information is recorded in *status, this call discards all -// local resources associated with the session. The session may not be used -// during or after this call (and the session drops its reference to the -// corresponding graph). -TF_CAPI_EXPORT extern void TF_DeleteSession(TF_Session*, TF_Status* status); - -// Run the graph associated with the session starting with the supplied inputs -// (inputs[0,ninputs-1] with corresponding values in input_values[0,ninputs-1]). -// -// Any NULL and non-NULL value combinations for (`run_options`, -// `run_metadata`) are valid. -// -// - `run_options` may be NULL, in which case it will be ignored; or -// non-NULL, in which case it must point to a `TF_Buffer` containing the -// serialized representation of a `RunOptions` protocol buffer. -// - `run_metadata` may be NULL, in which case it will be ignored; or -// non-NULL, in which case it must point to an empty, freshly allocated -// `TF_Buffer` that may be updated to contain the serialized representation -// of a `RunMetadata` protocol buffer. -// -// The caller retains ownership of `input_values` (which can be deleted using -// TF_DeleteTensor). The caller also retains ownership of `run_options` and/or -// `run_metadata` (when not NULL) and should manually call TF_DeleteBuffer on -// them. -// -// On success, the tensors corresponding to outputs[0,noutputs-1] are placed in -// output_values[]. Ownership of the elements of output_values[] is transferred -// to the caller, which must eventually call TF_DeleteTensor on them. -// -// On failure, output_values[] contains NULLs. -TF_CAPI_EXPORT extern void TF_SessionRun( - TF_Session* session, - // RunOptions - const TF_Buffer* run_options, - // Input tensors - const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs, - // Output tensors - const TF_Output* outputs, TF_Tensor** output_values, int noutputs, - // Target operations - const TF_Operation* const* target_opers, int ntargets, - // RunMetadata - TF_Buffer* run_metadata, - // Output status - TF_Status*); - -// Set up the graph with the intended feeds (inputs) and fetches (outputs) for a -// sequence of partial run calls. -// -// On success, returns a handle that is used for subsequent PRun calls. The -// handle should be deleted with TF_DeletePRunHandle when it is no longer -// needed. -// -// On failure, out_status contains a tensorflow::Status with an error -// message. *handle is set to nullptr. -TF_CAPI_EXPORT extern void TF_SessionPRunSetup( - TF_Session*, - // Input names - const TF_Output* inputs, int ninputs, - // Output names - const TF_Output* outputs, int noutputs, - // Target operations - const TF_Operation* const* target_opers, int ntargets, - // Output handle - const char** handle, - // Output status - TF_Status*); - -// Continue to run the graph with additional feeds and fetches. The -// execution state is uniquely identified by the handle. -TF_CAPI_EXPORT extern void TF_SessionPRun( - TF_Session*, const char* handle, - // Input tensors - const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs, - // Output tensors - const TF_Output* outputs, TF_Tensor** output_values, int noutputs, - // Target operations - const TF_Operation* const* target_opers, int ntargets, - // Output status - TF_Status*); - -// Deletes a handle allocated by TF_SessionPRunSetup. -// Once called, no more calls to TF_SessionPRun should be made. -TF_CAPI_EXPORT extern void TF_DeletePRunHandle(const char* handle); - -// -------------------------------------------------------------------------- -// The deprecated session API. Please switch to the above instead of -// TF_ExtendGraph(). This deprecated API can be removed at any time without -// notice. - -typedef struct TF_DeprecatedSession TF_DeprecatedSession; - -TF_CAPI_EXPORT extern TF_DeprecatedSession* TF_NewDeprecatedSession( - const TF_SessionOptions*, TF_Status* status); -TF_CAPI_EXPORT extern void TF_CloseDeprecatedSession(TF_DeprecatedSession*, - TF_Status* status); -TF_CAPI_EXPORT extern void TF_DeleteDeprecatedSession(TF_DeprecatedSession*, - TF_Status* status); -TF_CAPI_EXPORT extern void TF_Reset(const TF_SessionOptions* opt, - const char** containers, int ncontainers, - TF_Status* status); -// Treat the bytes proto[0,proto_len-1] as a serialized GraphDef and -// add the nodes in that GraphDef to the graph for the session. -// -// Prefer use of TF_Session and TF_GraphImportGraphDef over this. -TF_CAPI_EXPORT extern void TF_ExtendGraph(TF_DeprecatedSession*, - const void* proto, size_t proto_len, - TF_Status*); - -// See TF_SessionRun() above. -TF_CAPI_EXPORT extern void TF_Run(TF_DeprecatedSession*, - const TF_Buffer* run_options, - const char** input_names, TF_Tensor** inputs, - int ninputs, const char** output_names, - TF_Tensor** outputs, int noutputs, - const char** target_oper_names, int ntargets, - TF_Buffer* run_metadata, TF_Status*); - -// See TF_SessionPRunSetup() above. -TF_CAPI_EXPORT extern void TF_PRunSetup(TF_DeprecatedSession*, - const char** input_names, int ninputs, - const char** output_names, int noutputs, - const char** target_oper_names, - int ntargets, const char** handle, - TF_Status*); - -// See TF_SessionPRun above. -TF_CAPI_EXPORT extern void TF_PRun(TF_DeprecatedSession*, const char* handle, - const char** input_names, TF_Tensor** inputs, - int ninputs, const char** output_names, - TF_Tensor** outputs, int noutputs, - const char** target_oper_names, int ntargets, - TF_Status*); - -typedef struct TF_DeviceList TF_DeviceList; - -// Lists all devices in a TF_Session. -// -// Caller takes ownership of the returned TF_DeviceList* which must eventually -// be freed with a call to TF_DeleteDeviceList. -TF_CAPI_EXPORT extern TF_DeviceList* TF_SessionListDevices(TF_Session* session, - TF_Status* status); - -// Lists all devices in a TF_Session. -// -// Caller takes ownership of the returned TF_DeviceList* which must eventually -// be freed with a call to TF_DeleteDeviceList. -TF_CAPI_EXPORT extern TF_DeviceList* TF_DeprecatedSessionListDevices( - TF_DeprecatedSession* session, TF_Status* status); - -// Deallocates the device list. -TF_CAPI_EXPORT extern void TF_DeleteDeviceList(TF_DeviceList* list); - -// Counts the number of elements in the device list. -TF_CAPI_EXPORT extern int TF_DeviceListCount(const TF_DeviceList* list); - -// Retrieves the full name of the device (e.g. /job:worker/replica:0/...) -// The return value will be a pointer to a null terminated string. The caller -// must not modify or delete the string. It will be deallocated upon a call to -// TF_DeleteDeviceList. -// -// If index is out of bounds, an error code will be set in the status object, -// and a null pointer will be returned. -TF_CAPI_EXPORT extern const char* TF_DeviceListName(const TF_DeviceList* list, - int index, - TF_Status* status); - -// Retrieves the type of the device at the given index. -// -// The caller must not modify or delete the string. It will be deallocated upon -// a call to TF_DeleteDeviceList. -// -// If index is out of bounds, an error code will be set in the status object, -// and a null pointer will be returned. -TF_CAPI_EXPORT extern const char* TF_DeviceListType(const TF_DeviceList* list, - int index, - TF_Status* status); - -// Retrieve the amount of memory associated with a given device. -// -// If index is out of bounds, an error code will be set in the status object, -// and -1 will be returned. -TF_CAPI_EXPORT extern int64_t TF_DeviceListMemoryBytes( - const TF_DeviceList* list, int index, TF_Status* status); - -// Retrieve the incarnation number of a given device. -// -// If index is out of bounds, an error code will be set in the status object, -// and 0 will be returned. -TF_CAPI_EXPORT extern uint64_t TF_DeviceListIncarnation( - const TF_DeviceList* list, int index, TF_Status* status); - -// -------------------------------------------------------------------------- -// Load plugins containing custom ops and kernels - -// TF_Library holds information about dynamically loaded TensorFlow plugins. -typedef struct TF_Library TF_Library; - -// Load the library specified by library_filename and register the ops and -// kernels present in that library. -// -// Pass "library_filename" to a platform-specific mechanism for dynamically -// loading a library. The rules for determining the exact location of the -// library are platform-specific and are not documented here. -// -// On success, place OK in status and return the newly created library handle. -// The caller owns the library handle. -// -// On failure, place an error status in status and return NULL. -TF_CAPI_EXPORT extern TF_Library* TF_LoadLibrary(const char* library_filename, - TF_Status* status); - -// Get the OpList of OpDefs defined in the library pointed by lib_handle. -// -// Returns a TF_Buffer. The memory pointed to by the result is owned by -// lib_handle. The data in the buffer will be the serialized OpList proto for -// ops defined in the library. -TF_CAPI_EXPORT extern TF_Buffer TF_GetOpList(TF_Library* lib_handle); - -// Frees the memory associated with the library handle. -// Does NOT unload the library. -TF_CAPI_EXPORT extern void TF_DeleteLibraryHandle(TF_Library* lib_handle); - -// Get the OpList of all OpDefs defined in this address space. -// Returns a TF_Buffer, ownership of which is transferred to the caller -// (and can be freed using TF_DeleteBuffer). -// -// The data in the buffer will be the serialized OpList proto for ops registered -// in this address space. -TF_CAPI_EXPORT extern TF_Buffer* TF_GetAllOpList(void); - -// TF_ApiDefMap encapsulates a collection of API definitions for an operation. -// -// This object maps the name of a TensorFlow operation to a description of the -// API to generate for it, as defined by the ApiDef protocol buffer ( -// https://www.tensorflow.org/code/tensorflow/core/framework/api_def.proto) -// -// The ApiDef messages are typically used to generate convenience wrapper -// functions for TensorFlow operations in various language bindings. -typedef struct TF_ApiDefMap TF_ApiDefMap; - -// Creates a new TF_ApiDefMap instance. -// -// Params: -// op_list_buffer - TF_Buffer instance containing serialized OpList -// protocol buffer. (See -// https://www.tensorflow.org/code/tensorflow/core/framework/op_def.proto -// for the OpList proto definition). -// status - Set to OK on success and an appropriate error on failure. -TF_CAPI_EXPORT extern TF_ApiDefMap* TF_NewApiDefMap(TF_Buffer* op_list_buffer, - TF_Status* status); - -// Deallocates a TF_ApiDefMap. -TF_CAPI_EXPORT extern void TF_DeleteApiDefMap(TF_ApiDefMap* apimap); - -// Add ApiDefs to the map. -// -// `text` corresponds to a text representation of an ApiDefs protocol message. -// (https://www.tensorflow.org/code/tensorflow/core/framework/api_def.proto). -// -// The provided ApiDefs will be merged with existing ones in the map, with -// precedence given to the newly added version in case of conflicts with -// previous calls to TF_ApiDefMapPut. -TF_CAPI_EXPORT extern void TF_ApiDefMapPut(TF_ApiDefMap* api_def_map, - const char* text, size_t text_len, - TF_Status* status); - -// Returns a serialized ApiDef protocol buffer for the TensorFlow operation -// named `name`. -TF_CAPI_EXPORT extern TF_Buffer* TF_ApiDefMapGet(TF_ApiDefMap* api_def_map, - const char* name, - size_t name_len, - TF_Status* status); - -// -------------------------------------------------------------------------- -// Kernel definition information. - -// Returns a serialized KernelList protocol buffer containing KernelDefs for all -// registered kernels. -TF_CAPI_EXPORT extern TF_Buffer* TF_GetAllRegisteredKernels(TF_Status* status); - -// Returns a serialized KernelList protocol buffer containing KernelDefs for all -// kernels registered for the operation named `name`. -TF_CAPI_EXPORT extern TF_Buffer* TF_GetRegisteredKernelsForOp( - const char* name, TF_Status* status); - -// Update edge, switch input/ output in a node -TF_CAPI_EXPORT extern void TF_UpdateEdge(TF_Graph* graph, TF_Output new_src, - TF_Input dst, TF_Status* status); - -// -------------------------------------------------------------------------- -// In-process TensorFlow server functionality, for use in distributed training. -// A Server instance encapsulates a set of devices and a Session target that -// can participate in distributed training. A server belongs to a cluster -// (specified by a ClusterSpec), and corresponds to a particular task in a -// named job. The server can communicate with any other server in the same -// cluster. - -// In-process TensorFlow server. -typedef struct TF_Server TF_Server; - -// Creates a new in-process TensorFlow server configured using a serialized -// ServerDef protocol buffer provided via `proto` and `proto_len`. -// -// The server will not serve any requests until TF_ServerStart is invoked. -// The server will stop serving requests once TF_ServerStop or -// TF_DeleteServer is invoked. -TF_CAPI_EXPORT extern TF_Server* TF_NewServer(const void* proto, - size_t proto_len, - TF_Status* status); - -// Starts an in-process TensorFlow server. -TF_CAPI_EXPORT extern void TF_ServerStart(TF_Server* server, TF_Status* status); - -// Stops an in-process TensorFlow server. -TF_CAPI_EXPORT extern void TF_ServerStop(TF_Server* server, TF_Status* status); - -// Blocks until the server has been successfully stopped (via TF_ServerStop or -// TF_ServerClose). -TF_CAPI_EXPORT extern void TF_ServerJoin(TF_Server* server, TF_Status* status); - -// Returns the target string that can be provided to TF_SetTarget() to connect -// a TF_Session to `server`. -// -// The returned string is valid only until TF_DeleteServer is invoked. -TF_CAPI_EXPORT extern const char* TF_ServerTarget(TF_Server* server); - -// Destroy an in-process TensorFlow server, frees memory. If server is running -// it will be stopped and joined. -TF_CAPI_EXPORT extern void TF_DeleteServer(TF_Server* server); - -// Register a listener method that processes printed messages. -// -// If any listeners are registered, the print operator will call all listeners -// with the printed messages and immediately return without writing to the -// logs. -TF_CAPI_EXPORT extern void TF_RegisterLogListener( - void (*listener)(const char*)); - -// Register a FileSystem plugin from filename `plugin_filename`. -// -// On success, place OK in status. -// On failure, place an error status in status. -TF_CAPI_EXPORT extern void TF_RegisterFilesystemPlugin( - const char* plugin_filename, TF_Status* status); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_C_API_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_experimental.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_experimental.h deleted file mode 100755 index 90e074d23..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_experimental.h +++ /dev/null @@ -1,311 +0,0 @@ -/* Copyright 2018 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_C_API_EXPERIMENTAL_H_ -#define TENSORFLOW_C_C_API_EXPERIMENTAL_H_ - -#include -#include - -#include "tensorflow/c/c_api.h" -#include "tensorflow/c/eager/c_api.h" - -// -------------------------------------------------------------------------- -// Experimental C API for TensorFlow. -// -// The API here is subject to changes in the future. -// -------------------------------------------------------------------------- - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes.$a -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -// When `enable` is true, set -// tensorflow.ConfigProto.OptimizerOptions.global_jit_level to ON_1, and also -// set XLA flag values to prepare for XLA compilation. Otherwise set -// global_jit_level to OFF. -// -// This and the next API are syntax sugar over TF_SetConfig(), and is used by -// clients that cannot read/write the tensorflow.ConfigProto proto. -// TODO: Migrate to TF_CreateConfig() below. -TF_CAPI_EXPORT extern void TF_EnableXLACompilation(TF_SessionOptions* options, - unsigned char enable); - -// Set XLA's internal BuildXlaOpsPassFlags.tf_xla_enable_lazy_compilation to the -// value of 'enabled'. Also returns the original value of that flag. -// -// Use in tests to allow XLA to fallback to TF classic. This has global effect. -TF_CAPI_EXPORT unsigned char TF_SetXlaEnableLazyCompilation( - unsigned char enable); -TF_CAPI_EXPORT unsigned char TF_SetTfXlaCpuGlobalJit(unsigned char enable); - -// Sets XLA's auto jit mode according to the specified string, which is parsed -// as if passed in XLA_FLAGS. This has global effect. -TF_CAPI_EXPORT void TF_SetXlaAutoJitMode(const char* mode); - -// Sets XLA's minimum cluster size. This has global effect. -TF_CAPI_EXPORT void TF_SetXlaMinClusterSize(int size); - -// Gets/Sets TF/XLA flag for whether(true) or not(false) to disable constant -// folding. This is for testing to ensure that XLA is being tested rather than -// Tensorflow's CPU implementation through constant folding. -TF_CAPI_EXPORT unsigned char TF_GetXlaConstantFoldingDisabled(); -TF_CAPI_EXPORT void TF_SetXlaConstantFoldingDisabled( - unsigned char should_enable); - -// Create a serialized tensorflow.ConfigProto proto, where: -// -// a) ConfigProto.optimizer_options.global_jit_level is set to to ON_1 if -// `enable_xla_compilation` is non-zero, and OFF otherwise. -// b) ConfigProto.gpu_options.allow_growth is set to `gpu_memory_allow_growth`. -// c) ConfigProto.device_count is set to `num_cpu_devices`. -TF_CAPI_EXPORT extern TF_Buffer* TF_CreateConfig( - unsigned char enable_xla_compilation, unsigned char gpu_memory_allow_growth, - unsigned int num_cpu_devices); - -// Create a serialized tensorflow.RunOptions proto, where RunOptions.trace_level -// is set to FULL_TRACE if `enable_full_trace` is non-zero, and NO_TRACE -// otherwise. -TF_CAPI_EXPORT extern TF_Buffer* TF_CreateRunOptions( - unsigned char enable_full_trace); - -// Returns the graph content in a human-readable format, with length set in -// `len`. The format is subject to change in the future. -// The returned string is heap-allocated, and caller should call free() on it. -TF_CAPI_EXPORT extern const char* TF_GraphDebugString(TF_Graph* graph, - size_t* len); - -// Returns the function content in a human-readable format, with length set in -// `len`. The format is subject to change in the future. -// The returned string is heap-allocated, and caller should call free() on it. -// -// Do not return const char*, because some foreign language binding -// (e.g. swift) cannot then call free() on the returned pointer. -TF_CAPI_EXPORT extern char* TF_FunctionDebugString(TF_Function* func, - size_t* len); - -// On success, dequeues a tensor from a TF-managed FifoQueue given by -// `tensor_id`, associated with `session`. There must be a graph node named -// "fifo_queue_dequeue_", to be executed by this API call. - -// Caller must call TF_DeleteTensor() over the returned tensor. If the queue is -// empty, this call is blocked. -// -// Tensors are enqueued via the corresponding TF enqueue op. -// TODO(hongm): Add support for `timeout_ms`. -TF_CAPI_EXPORT extern TF_Tensor* TF_DequeueNamedTensor(TF_Session* session, - int tensor_id, - TF_Status* status); - -// On success, enqueues `tensor` into a TF-managed FifoQueue given by -// `tensor_id`, associated with `session`. There must be a graph node named -// "fifo_queue_enqueue_", to be executed by this API call. It reads -// from a placeholder node "arg_tensor_enqueue_". -// -// `tensor` is still owned by the caller. This call will be blocked if the queue -// has reached its capacity, and will be unblocked when the queued tensors again -// drop below the capacity due to dequeuing. -// -// Tensors are dequeued via the corresponding TF dequeue op. -// TODO(hongm): Add support for `timeout_ms`. -TF_CAPI_EXPORT extern void TF_EnqueueNamedTensor(TF_Session* session, - int tensor_id, - TF_Tensor* tensor, - TF_Status* status); -// Create a serialized tensorflow.ServerDef proto. -TF_Buffer* TFE_GetServerDef(const char* text_proto, TF_Status* status); - -TF_CAPI_EXPORT extern void TF_MakeInternalErrorStatus(TF_Status* status, - const char* errMsg); - -// TF_NewCheckpointReader() return the CheckpointReader that can be use to -// investigate or load the variable from the checkpoint file -typedef struct TF_CheckpointReader TF_CheckpointReader; -TF_CAPI_EXPORT extern TF_CheckpointReader* TF_NewCheckpointReader( - const char* filename, TF_Status* status); -TF_CAPI_EXPORT extern void TF_DeleteCheckpointReader( - TF_CheckpointReader* reader); -TF_CAPI_EXPORT extern int TF_CheckpointReaderHasTensor( - TF_CheckpointReader* reader, const char* name); -// Get the variable name at the given index -TF_CAPI_EXPORT extern const char* TF_CheckpointReaderGetVariable( - TF_CheckpointReader* reader, int index); -// Get the number of variable in the checkpoint -TF_CAPI_EXPORT extern int TF_CheckpointReaderSize(TF_CheckpointReader* reader); -// Get the DataType of a variable -TF_CAPI_EXPORT extern TF_DataType TF_CheckpointReaderGetVariableDataType( - TF_CheckpointReader* reader, const char* name); -// Read the shape of a variable and write to `dims` -TF_CAPI_EXPORT extern void TF_CheckpointReaderGetVariableShape( - TF_CheckpointReader* reader, const char* name, int64_t* dims, int num_dims, - TF_Status* status); -// Get the number of dimension of a variable -TF_CAPI_EXPORT extern int TF_CheckpointReaderGetVariableNumDims( - TF_CheckpointReader* reader, const char* name); -// Load the weight of a variable -TF_CAPI_EXPORT extern TF_Tensor* TF_CheckpointReaderGetTensor( - TF_CheckpointReader* reader, const char* name, TF_Status* status); - -// TF_NewAttrBuilder() returns an object that you can set attributes on as -// though it were an op. This allows querying properties of that op for -// type-checking purposes like if the op will run on a particular device type. -typedef struct TF_AttrBuilder TF_AttrBuilder; -TF_CAPI_EXPORT extern TF_AttrBuilder* TF_NewAttrBuilder(const char* op_name); -TF_CAPI_EXPORT extern void TF_DeleteAttrBuilder(TF_AttrBuilder* builder); -TF_CAPI_EXPORT extern void TF_AttrBuilderSetType(TF_AttrBuilder* builder, - const char* attr_name, - TF_DataType value); -TF_CAPI_EXPORT extern void TF_AttrBuilderSetTypeList(TF_AttrBuilder* builder, - const char* attr_name, - const TF_DataType* values, - int num_values); - -// Checks the tensorflow::NodeDef built via the methods above to see if it can -// run on device_type. -TF_CAPI_EXPORT extern void TF_AttrBuilderCheckCanRunOnDevice( - TF_AttrBuilder* builder, const char* device_type, TF_Status* status); - -// For argument number input_index, fetch the corresponding number_attr that -// needs to be updated with the argument length of the input list. -// Returns nullptr if there is any problem like op_name is not found, or the -// argument does not support this attribute type. -TF_CAPI_EXPORT extern const char* TF_GetNumberAttrForOpListInput( - const char* op_name, int input_index, TF_Status* status); - -// Returns 1 if the op is stateful, 0 otherwise. The return value is undefined -// if the status is not ok. -TF_CAPI_EXPORT extern int TF_OpIsStateful(const char* op_type, - TF_Status* status); - -// Platform specific initialization routine. Very few platforms actually require -// this to be called. -TF_CAPI_EXPORT void TF_InitMain(const char* usage, int* argc, char*** argv); - -// Platform-specific implementation to return an unused port. (This should used -// in tests only.) -TF_CAPI_EXPORT int TF_PickUnusedPortOrDie(void); - -// Fast path method that makes constructing a single scalar tensor require less -// overhead and copies. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_NewTensorHandleFromScalar( - TF_DataType data_type, void* data, size_t len, TF_Status* status); - -// Specify the server_def that enables collective ops. -// This is different to the above function in that it doesn't create remote -// contexts, and remotely executing ops is not possible. It just enables -// communication for collective ops. -TF_CAPI_EXPORT extern void TFE_EnableCollectiveOps(TFE_Context* ctx, - const void* proto, - size_t proto_len, - TF_Status* status); - -// Aborts all ongoing collectives with the specified status. After abortion, -// subsequent collectives will error with this status immediately. To reset the -// collectives, create a new EagerContext. -// -// This is intended to be used when a peer failure is detected. -TF_CAPI_EXPORT extern void TFE_AbortCollectiveOps(TFE_Context* ctx, - TF_Status* status); - -// Checks the health of collective ops peers. Explicit health check is needed in -// multi worker collective ops to detect failures in the cluster. If a peer is -// down, collective ops may hang. -TF_CAPI_EXPORT extern void TFE_CollectiveOpsCheckPeerHealth( - TFE_Context* ctx, const char* task, int64_t timeout_in_ms, - TF_Status* status); - -// Information about the shape of a Tensor and its type. -struct TF_ShapeAndType { - // Number of dimensions. -1 indicates unknown rank. - int num_dims; - // Array of dimensions. -1 indicates unknown dim. - int64_t* dims; - // The data type. May be 0 to denote unknown type. - TF_DataType dtype; -}; - -typedef struct TF_ShapeAndType TF_ShapeAndType; - -// A list of TF_ShapeAndType elements.. -struct TF_ShapeAndTypeList { - int num_items; - TF_ShapeAndType* items; -}; -typedef struct TF_ShapeAndTypeList TF_ShapeAndTypeList; - -// API for manipulating TF_ShapeAndTypeList objects. -// -TF_CAPI_EXPORT extern TF_ShapeAndTypeList* TF_NewShapeAndTypeList( - int num_shapes); -TF_CAPI_EXPORT extern void TF_ShapeAndTypeListSetShape( - TF_ShapeAndTypeList* shape_list, int index, const int64_t* dims, - int num_dims); -TF_CAPI_EXPORT extern void TF_ShapeAndTypeListSetUnknownShape( - TF_ShapeAndTypeList* shape_list, int index); -TF_CAPI_EXPORT extern void TF_ShapeAndTypeListSetDtype( - TF_ShapeAndTypeList* shape_list, int index, TF_DataType dtype); -TF_CAPI_EXPORT extern void TF_DeleteShapeAndTypeList( - TF_ShapeAndTypeList* shape_list); -TF_CAPI_EXPORT extern void TF_DeleteShapeAndTypeListArray( - TF_ShapeAndTypeList** shape_list_array, int num_items); - -// Infer shapes for the given `op`. The arguments mimic the arguments of the -// `shape_inference::InferenceContext` constructor. Note the following: -// - The inputs of the `op` are not used for shape inference. So, it is -// OK to not have the inputs properly set in `op`. See `input_tensors` -// if you want shape inference to consider the input tensors of the -// op for shape inference. -// - The types need not be set in `input_shapes` as it is not used. -// - The number of `input_tensors` should be the same as the number of items -// in `input_shapes`. -// -// The results are returned in `output_shapes` and -// `output_resource_shapes_and_types`. The caller is responsible for freeing the -// memory in these buffers by calling `TF_DeleteShapeAndTypeList`. -TF_CAPI_EXPORT extern void TFE_InferShapes( - TFE_Op* op, TF_ShapeAndTypeList* input_shapes, TF_Tensor** input_tensors, - TF_ShapeAndTypeList* input_tensor_as_shapes, - TF_ShapeAndTypeList** input_resource_shapes_and_types, - TF_ShapeAndTypeList** output_shapes, - TF_ShapeAndTypeList*** output_resource_shapes_and_types, TF_Status* status); - -TF_CAPI_EXPORT extern void -TF_ImportGraphDefOptionsSetValidateColocationConstraints( - TF_ImportGraphDefOptions* opts, unsigned char enable); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_C_API_EXPERIMENTAL_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h deleted file mode 100755 index e0c91a0d5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_macros.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2020 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_C_API_MACROS_H_ -#define TENSORFLOW_C_C_API_MACROS_H_ - -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -// TF_Bool is the C API typedef for unsigned char, while TF_BOOL is -// the datatype for boolean tensors. -#ifndef TF_Bool -#define TF_Bool unsigned char -#endif // TF_Bool - -// Macro used to calculate struct size for maintaining ABI stability across -// different struct implementations. -#ifndef TF_OFFSET_OF_END -#define TF_OFFSET_OF_END(TYPE, MEMBER) \ - (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) -#endif // TF_OFFSET_OF_END - -#endif // TENSORFLOW_C_C_API_MACROS_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h deleted file mode 100755 index 0afb69bb8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h +++ /dev/null @@ -1,466 +0,0 @@ -/* Copyright 2017 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_EAGER_C_API_H_ -#define TENSORFLOW_C_EAGER_C_API_H_ - -// C API extensions to experiment with eager execution of kernels. -// WARNING: Unlike tensorflow/c/c_api.h, the API here is not guaranteed to be -// stable and can change without notice. - -#include "tensorflow/c/c_api.h" - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes.$a -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct TFE_ContextOptions TFE_ContextOptions; - -// Return a new options object. -TF_CAPI_EXPORT extern TFE_ContextOptions* TFE_NewContextOptions(void); - -// Set the config in TF_ContextOptions.options. -// config should be a serialized tensorflow.ConfigProto proto. -// If config was not parsed successfully as a ConfigProto, record the -// error information in *status. -TF_CAPI_EXPORT extern void TFE_ContextOptionsSetConfig( - TFE_ContextOptions* options, const void* proto, size_t proto_len, - TF_Status* status); - -// Controls how to act when we try to run an operation on a given device but -// some input tensors are not on that device. -// LINT.IfChange -// Note: Keep in sync with internal copy of enum in eager/context.h. -typedef enum TFE_ContextDevicePlacementPolicy { - // Running operations with input tensors on the wrong device will fail. - TFE_DEVICE_PLACEMENT_EXPLICIT = 0, - // Copy the tensor to the right device but log a warning. - TFE_DEVICE_PLACEMENT_WARN = 1, - // Silently copy the tensor, which has a performance cost since the operation - // will be blocked till the copy completes. This is the default placement - // policy. - TFE_DEVICE_PLACEMENT_SILENT = 2, - // Placement policy which silently copies int32 tensors but not other dtypes. - TFE_DEVICE_PLACEMENT_SILENT_FOR_INT32 = 3, -} TFE_ContextDevicePlacementPolicy; -// LINT.ThenChange(//tensorflow/c/eager/immediate_execution_context.h) - -// Sets the default execution mode (sync/async). Note that this can be -// overridden per thread using TFE_ContextSetExecutorForThread. -TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*, - unsigned char enable); - -TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy( - TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy); - -// Destroy an options object. -TF_CAPI_EXPORT extern void TFE_DeleteContextOptions(TFE_ContextOptions*); - -// "Context" under which operations/functions are executed. It encapsulates -// things like the available devices, resource manager etc. -// TFE_Context must outlive all tensor handles created using it. In other -// words, TFE_DeleteContext() must be called after all tensor handles have -// been deleted (with TFE_DeleteTensorHandle). -// -// TODO(ashankar): Merge with TF_Session? -typedef struct TFE_Context TFE_Context; - -TF_CAPI_EXPORT extern TFE_Context* TFE_NewContext( - const TFE_ContextOptions* opts, TF_Status* status); -TF_CAPI_EXPORT extern void TFE_DeleteContext(TFE_Context* ctx); -TF_CAPI_EXPORT extern TF_DeviceList* TFE_ContextListDevices(TFE_Context* ctx, - TF_Status* status); - -// Clears the internal caches in the TFE context. Useful when reseeding random -// ops. -TF_CAPI_EXPORT extern void TFE_ContextClearCaches(TFE_Context* ctx); - -// Sets a thread-local device placement policy. After this call, other calls to -// TFE_Execute in the same thread will use the device policy specified here -// instead of the device policy used to construct the context. This has no -// effect on the device policy used by other program threads. -TF_CAPI_EXPORT extern void TFE_ContextSetThreadLocalDevicePlacementPolicy( - TFE_Context* ctx, TFE_ContextDevicePlacementPolicy policy); - -// Returns the device placement policy to be used by this context in the current -// thread. -TF_CAPI_EXPORT extern TFE_ContextDevicePlacementPolicy -TFE_ContextGetDevicePlacementPolicy(TFE_Context* ctx); - -// A tensorflow.ServerDef specifies remote workers (in addition to the current -// workers name). Operations created on this context can then be executed on -// any of these remote workers by setting an appropriate device. -// -// If the following is set, all servers identified by the -// ServerDef must be up when the context is created. -TF_CAPI_EXPORT extern void TFE_ContextSetServerDef(TFE_Context* ctx, - int keep_alive_secs, - const void* proto, - size_t proto_len, - TF_Status* status); - -// A handle to a tensor on a device. -// -// Like a TF_Tensor, a TFE_TensorHandle refers to a tensor with a value, shape, -// type etc. Unlike a TF_Tensor, a TFE_TensorHandle may refer to such tensors -// placed in memory of different devices or remote address spaces. -typedef struct TFE_TensorHandle TFE_TensorHandle; - -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_NewTensorHandle(const TF_Tensor* t, - TF_Status* status); -// Indicates that the caller will not be using `h` any more. -TF_CAPI_EXPORT extern void TFE_DeleteTensorHandle(TFE_TensorHandle* h); -TF_CAPI_EXPORT extern TF_DataType TFE_TensorHandleDataType(TFE_TensorHandle* h); -// This function will block till the operation that produces `h` has completed. -TF_CAPI_EXPORT extern int TFE_TensorHandleNumDims(TFE_TensorHandle* h, - TF_Status* status); -TF_CAPI_EXPORT extern int64_t TFE_TensorHandleNumElements(TFE_TensorHandle* h, - TF_Status* status); -// This function will block till the operation that produces `h` has completed. -TF_CAPI_EXPORT extern int64_t TFE_TensorHandleDim(TFE_TensorHandle* h, - int dim_index, - TF_Status* status); - -// Returns the device of the operation that produced `h`. If `h` was produced by -// a copy, returns the destination device of the copy. Note that the returned -// device name is not always the device holding the tensor handle's memory. If -// you want the latter, use TFE_TensorHandleBackingDeviceName. This function -// will block till the operation that produces `h` has completed. -TF_CAPI_EXPORT extern const char* TFE_TensorHandleDeviceName( - TFE_TensorHandle* h, TF_Status* status); - -// Returns the name of the device in whose memory `h` resides. -// -// This function will block till the operation that produces `h` has completed. -TF_CAPI_EXPORT extern const char* TFE_TensorHandleBackingDeviceName( - TFE_TensorHandle* h, TF_Status* status); - -// Return a pointer to a new TFE_TensorHandle that shares the underlying tensor -// with `h`. On success, `status` is set to OK. On failure, `status` reflects -// the error and a nullptr is returned. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_TensorHandleCopySharingTensor( - TFE_TensorHandle* h, TF_Status* status); - -// This function will block till the operation that produces `h` has -// completed. The memory returned might alias the internal memory used by -// TensorFlow. Hence, callers should not mutate this memory (for example by -// modifying the memory region pointed to by TF_TensorData() on the returned -// TF_Tensor). -TF_CAPI_EXPORT extern TF_Tensor* TFE_TensorHandleResolve(TFE_TensorHandle* h, - TF_Status* status); - -// Create a new TFE_TensorHandle with the same contents as 'h' but placed -// in the memory of the device name 'device_name'. -// If source and destination are the same device, then this creates a new handle -// that shares the underlying buffer. Otherwise, it currently requires at least -// one of the source or destination devices to be CPU (i.e., for the source or -// destination tensor to be placed in host memory). -// If async execution is enabled, the copy may be enqueued and the call will -// return "non-ready" handle. Else, this function returns after the copy has -// been done. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_TensorHandleCopyToDevice( - TFE_TensorHandle* h, TFE_Context* ctx, const char* device_name, - TF_Status* status); - -// Debugging/Profiling information for TFE_TensorHandle -// -// TFE_TensorDebugInfo contains information useful for debugging and -// profiling tensors. -typedef struct TFE_TensorDebugInfo TFE_TensorDebugInfo; - -// Retrieves TFE_TensorDebugInfo for `handle`. -// If TFE_TensorHandleTensorDebugInfo succeeds, `status` is set to OK and caller -// is responsible for deleting returned TFE_TensorDebugInfo. -// If TFE_TensorHandleTensorDebugInfo fails, `status` is set to appropriate -// error and nullptr is returned. This function can block till the operation -// that produces `handle` has completed. -TF_CAPI_EXPORT extern TFE_TensorDebugInfo* TFE_TensorHandleTensorDebugInfo( - TFE_TensorHandle* h, TF_Status* status); - -// Deletes `debug_info`. -TF_CAPI_EXPORT extern void TFE_DeleteTensorDebugInfo( - TFE_TensorDebugInfo* debug_info); - -// Returns the number of dimensions used to represent the tensor on its device. -// The number of dimensions used to represent the tensor on device can be -// different from the number returned by TFE_TensorHandleNumDims. -// The return value was current at the time of TFE_TensorDebugInfo creation. -TF_CAPI_EXPORT extern int TFE_TensorDebugInfoOnDeviceNumDims( - TFE_TensorDebugInfo* debug_info); - -// Returns the number of elements in dimension `dim_index`. -// Tensor representation on device can be transposed from its representation -// on host. The data contained in dimension `dim_index` on device -// can correspond to the data contained in another dimension in on-host -// representation. The dimensions are indexed using the standard TensorFlow -// major-to-minor order (slowest varying dimension first), -// not the XLA's minor-to-major order. -// On-device dimensions can be padded. TFE_TensorDebugInfoOnDeviceDim returns -// the number of elements in a dimension after padding. -// The return value was current at the time of TFE_TensorDebugInfo creation. -TF_CAPI_EXPORT extern int64_t TFE_TensorDebugInfoOnDeviceDim( - TFE_TensorDebugInfo* debug_info, int dim_index); - -// Description of the TensorFlow op to execute. -// -// Assumes that the provided 'ctx' outlives the returned TFE_Op, i.e., -// TFE_DeleteOp() is called before TFE_DeleteContext(). -// -// Very similar to TF_OperationDescription with some differences: -// (1) TF_Output or TFE_TensorHandle* as arguments to TF_AddInput, -// TF_AddInputList -// (2) TF_ColocateWith, TF_AddControlInput etc. do not make sense. -// (3) Implementation detail: Avoid use of NodeBuilder/NodeDefBuilder since -// the additional sanity checks there seem unnecessary; -typedef struct TFE_Op TFE_Op; - -TF_CAPI_EXPORT extern TFE_Op* TFE_NewOp(TFE_Context* ctx, - const char* op_or_function_name, - TF_Status* status); -TF_CAPI_EXPORT extern void TFE_DeleteOp(TFE_Op* op); - -// Returns the op or function name `op` will execute. -// -// The returned string remains valid throughout the lifetime of 'op'. -TF_CAPI_EXPORT extern const char* TFE_OpGetName(const TFE_Op* op, - TF_Status* status); -TF_CAPI_EXPORT extern TFE_Context* TFE_OpGetContext(const TFE_Op* op, - TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_OpSetDevice(TFE_Op* op, const char* device_name, - TF_Status* status); -// The returned string remains valid throughout the lifetime of 'op'. -TF_CAPI_EXPORT extern const char* TFE_OpGetDevice(const TFE_Op* op, - TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_OpAddInput(TFE_Op* op, TFE_TensorHandle* input, - TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_OpAddInputList(TFE_Op* op, - TFE_TensorHandle** inputs, - int num_inputs, - TF_Status* status); - -// Fetches the current number of inputs attached to `op`. -// -// Does not use the operation's definition to determine how many inputs should -// be attached. It is intended for use with TFE_OpGetFlatInput to inspect an -// already-finalized operation. -// -// Note that TFE_OpGetFlatInputCount and TFE_OpGetFlatInput operate on a flat -// sequence of inputs, unlike TFE_OpGetInputLength (for getting the length of a -// particular named input list, which may only be part of the op's inputs). -TF_CAPI_EXPORT extern int TFE_OpGetFlatInputCount(const TFE_Op* op, - TF_Status* status); -// Returns a borrowed reference to one of `op`'s inputs. Use -// `TFE_TensorHandleCopySharingTensor` to make a new reference. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_OpGetFlatInput(const TFE_Op* op, - int index, - TF_Status* status); - -TF_CAPI_EXPORT extern TF_AttrType TFE_OpGetAttrType(TFE_Op* op, - const char* attr_name, - unsigned char* is_list, - TF_Status* status); -// Get an attribute type given an op name; a fusion of TFE_NewOp and -// TFE_OpGetAttrType for use from Python without the overhead of the individual -// calls and memory management of TFE_Op. -TF_CAPI_EXPORT extern TF_AttrType TFE_OpNameGetAttrType( - TFE_Context* ctx, const char* op_or_function_name, const char* attr_name, - unsigned char* is_list, TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_OpSetAttrString(TFE_Op* op, - const char* attr_name, - const void* value, - size_t length); -TF_CAPI_EXPORT extern void TFE_OpSetAttrInt(TFE_Op* op, const char* attr_name, - int64_t value); -TF_CAPI_EXPORT extern void TFE_OpSetAttrFloat(TFE_Op* op, const char* attr_name, - float value); -TF_CAPI_EXPORT extern void TFE_OpSetAttrBool(TFE_Op* op, const char* attr_name, - unsigned char value); -TF_CAPI_EXPORT extern void TFE_OpSetAttrType(TFE_Op* op, const char* attr_name, - TF_DataType value); -// If the number of dimensions is unknown, `num_dims` must be set to -// -1 and `dims` can be null. If a dimension is unknown, the -// corresponding entry in the `dims` array must be -1. -TF_CAPI_EXPORT extern void TFE_OpSetAttrShape(TFE_Op* op, const char* attr_name, - const int64_t* dims, - const int num_dims, - TF_Status* out_status); - -// Sets the attribute attr_name to be a function specified by 'function'. -// -// TODO(ashankar,iga): Add this functionality to the C API for graph -// construction. Perhaps we want an AttrValueMap equivalent in the C API? -TF_CAPI_EXPORT extern void TFE_OpSetAttrFunction(TFE_Op* op, - const char* attr_name, - const TFE_Op* value); - -TF_CAPI_EXPORT void TFE_OpSetAttrFunctionName(TFE_Op* op, const char* attr_name, - const char* data, size_t length); - -TF_CAPI_EXPORT extern void TFE_OpSetAttrTensor(TFE_Op* op, - const char* attr_name, - TF_Tensor* tensor, - TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_OpSetAttrStringList(TFE_Op* op, - const char* attr_name, - const void* const* values, - const size_t* lengths, - int num_values); -TF_CAPI_EXPORT extern void TFE_OpSetAttrIntList(TFE_Op* op, - const char* attr_name, - const int64_t* values, - int num_values); -TF_CAPI_EXPORT extern void TFE_OpSetAttrFloatList(TFE_Op* op, - const char* attr_name, - const float* values, - int num_values); -TF_CAPI_EXPORT extern void TFE_OpSetAttrBoolList(TFE_Op* op, - const char* attr_name, - const unsigned char* values, - int num_values); -TF_CAPI_EXPORT extern void TFE_OpSetAttrTypeList(TFE_Op* op, - const char* attr_name, - const TF_DataType* values, - int num_values); -TF_CAPI_EXPORT extern void TFE_OpSetAttrShapeList( - TFE_Op* op, const char* attr_name, const int64_t** dims, - const int* num_dims, int num_values, TF_Status* out_status); -TF_CAPI_EXPORT extern void TFE_OpSetAttrFunctionList(TFE_Op* op, - const char* attr_name, - const TFE_Op** value, - int num_values); - -// Returns the length (number of tensors) of the input argument `input_name` -// found in the provided `op`. -TF_CAPI_EXPORT extern int TFE_OpGetInputLength(TFE_Op* op, - const char* input_name, - TF_Status* status); - -// Returns the length (number of tensors) of the output argument `output_name` -// found in the provided `op`. -TF_CAPI_EXPORT extern int TFE_OpGetOutputLength(TFE_Op* op, - const char* output_name, - TF_Status* status); - -// Execute the operation defined by 'op' and return handles to computed -// tensors in `retvals`. -// -// 'retvals' must point to a pre-allocated array of TFE_TensorHandle* and -// '*num_retvals' should be set to the size of this array. It is an error if -// the size of 'retvals' is less than the number of outputs. This call sets -// *num_retvals to the number of outputs. -// -// If async execution is enabled, the call may simply enqueue the execution -// and return "non-ready" handles in `retvals`. Note that any handles contained -// in 'op' should not be mutated till the kernel execution actually finishes. -// -// For sync execution, if any of the inputs to `op` are not ready, this call -// will block till they become ready and then return when the kernel execution -// is done. -// TODO(agarwal): change num_retvals to int from int*. -TF_CAPI_EXPORT extern void TFE_Execute(TFE_Op* op, TFE_TensorHandle** retvals, - int* num_retvals, TF_Status* status); - -// Add a function (serialized FunctionDef protocol buffer) to ctx so -// that it can be invoked using TFE_Execute. -TF_CAPI_EXPORT extern void TFE_ContextAddFunctionDef( - TFE_Context* ctx, const char* serialized_function_def, size_t size, - TF_Status* status); - -// Adds a function (created from TF_GraphToFunction or -// TF_FunctionImportFunctionDef) to the context, allowing it to be executed with -// TFE_Execute by creating an op with the same name as the function. -TF_CAPI_EXPORT extern void TFE_ContextAddFunction(TFE_Context* ctx, - TF_Function* function, - TF_Status* status); - -// Removes a function from the context. Once removed, you can no longer -// TFE_Execute it or TFE_Execute any TFE_Op which has it as an attribute or any -// other function which calls it as an attribute. -TF_CAPI_EXPORT extern void TFE_ContextRemoveFunction(TFE_Context* ctx, - const char* name, - TF_Status* status); - -// Checks whether a function is registered under `name`. -TF_CAPI_EXPORT unsigned char TFE_ContextHasFunction(TFE_Context* ctx, - const char* name); - -// Enables tracing of RunMetadata on the ops executed from this context. -TF_CAPI_EXPORT extern void TFE_ContextEnableRunMetadata(TFE_Context* ctx); - -// Disables tracing of RunMetadata on the ops executed from this context. -TF_CAPI_EXPORT extern void TFE_ContextDisableRunMetadata(TFE_Context* ctx); - -// Populates the passed-in buffer with a serialized RunMetadata protocol buffer -// containing any run metadata information accumulated so far and clears this -// information. -// If async mode is enabled, this call blocks till all currently pending ops are -// done. -TF_CAPI_EXPORT extern void TFE_ContextExportRunMetadata(TFE_Context* ctx, - TF_Buffer* buf, - TF_Status* status); - -// Some TF ops need a step container to be set to limit the lifetime of some -// resources (mostly TensorArray and Stack, used in while loop gradients in -// graph mode). Calling this on a context tells it to start a step. -TF_CAPI_EXPORT extern void TFE_ContextStartStep(TFE_Context* ctx); - -// Ends a step. When there is no active step (that is, every started step has -// been ended) step containers will be cleared. Note: it is not safe to call -// TFE_ContextEndStep while ops which rely on the step container may be running. -TF_CAPI_EXPORT extern void TFE_ContextEndStep(TFE_Context* ctx); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#ifdef __cplusplus -// A workaround to ease conversion to and from numpy objects and -// TFE_TensorHandle's. -// -// TODO(ashankar): Figure out an alternative scheme that precludes the need for -// these API-boundary breaking methods. -namespace tensorflow { -class Tensor; -} // namespace tensorflow - -TFE_TensorHandle* TFE_NewTensorHandle(const tensorflow::Tensor& t, - TF_Status* status); -#endif - -#endif // TENSORFLOW_C_EAGER_C_API_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api_experimental.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api_experimental.h deleted file mode 100755 index d0739a543..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api_experimental.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Copyright 2018 The TensorFlow Authors. 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. -==============================================================================*/ -#ifndef TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ -#define TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ - -#include "tensorflow/c/c_api.h" -#include "tensorflow/c/eager/c_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Resets `op_to_reset` with `op_or_function_name` and `raw_device_name`. This -// is for performance optimization by reusing an exiting unused op rather than -// creating a new op every time. If `raw_device_name` is `NULL` or empty, it -// does not set the device name. If it's not `NULL`, then it attempts to parse -// and set the device name. It's effectively `TFE_OpSetDevice`, but it is faster -// than separately calling it because if the existing op has the same -// `raw_device_name`, it skips parsing and just leave as it is. -TF_CAPI_EXPORT extern void TFE_OpReset(TFE_Op* op_to_reset, - const char* op_or_function_name, - const char* raw_device_name, - TF_Status* status); - -// Enables only graph collection in RunMetadata on the functions executed from -// this context. -TF_CAPI_EXPORT extern void TFE_ContextEnableGraphCollection(TFE_Context* ctx); - -// Disables only graph collection in RunMetadata on the functions executed from -// this context. -TF_CAPI_EXPORT extern void TFE_ContextDisableGraphCollection(TFE_Context* ctx); - -// TODO(fishx): Move these monitoring APIs into a separate file. -// ----------------------------------------------------------------------------- -// Monitoring Counter APIs. -// These APIs de-templated monitoring Counter for swig. - -typedef struct TFE_MonitoringCounterCell TFE_MonitoringCounterCell; - -// Atomically increments the value of the cell. The value must be non-negative. -TF_CAPI_EXPORT extern void TFE_MonitoringCounterCellIncrementBy( - TFE_MonitoringCounterCell* cell, int64_t value); - -// Retrieves the current value of the cell. -TF_CAPI_EXPORT extern int64_t TFE_MonitoringCounterCellValue( - TFE_MonitoringCounterCell* cell); - -// APIs for Counter without label. -typedef struct TFE_MonitoringCounter0 TFE_MonitoringCounter0; -// Returns a new Counter metric object. The caller should manage lifetime of -// the object. Using duplicate metric name will crash the program with fatal -// error. -TF_CAPI_EXPORT extern TFE_MonitoringCounter0* TFE_MonitoringNewCounter0( - const char* name, TF_Status* status, const char* description); -// Deletes the Counter object. -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteCounter0( - TFE_MonitoringCounter0* counter); -// Retrieves the cell from the Counter object. The Counter object will manage -// lifetime of the cell. -TF_CAPI_EXPORT extern TFE_MonitoringCounterCell* TFE_MonitoringGetCellCounter0( - TFE_MonitoringCounter0* counter); - -// APIs for Counter with 1 label. -typedef struct TFE_MonitoringCounter1 TFE_MonitoringCounter1; -TF_CAPI_EXPORT extern TFE_MonitoringCounter1* TFE_MonitoringNewCounter1( - const char* name, TF_Status* status, const char* description, - const char* label1); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteCounter1( - TFE_MonitoringCounter1* counter); -TF_CAPI_EXPORT extern TFE_MonitoringCounterCell* TFE_MonitoringGetCellCounter1( - TFE_MonitoringCounter1* counter, const char* label1); - -// APIs for Counter with 2 labels. -typedef struct TFE_MonitoringCounter2 TFE_MonitoringCounter2; -TF_CAPI_EXPORT extern TFE_MonitoringCounter2* TFE_MonitoringNewCounter2( - const char* name, TF_Status* status, const char* description, - const char* label1, const char* label2); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteCounter2( - TFE_MonitoringCounter2* counter); -TF_CAPI_EXPORT extern TFE_MonitoringCounterCell* TFE_MonitoringGetCellCounter2( - TFE_MonitoringCounter2* counter, const char* label1, const char* label2); - -// ----------------------------------------------------------------------------- -// Monitoring Gauge APIs. -// These APIs de-templated monitoring Gauge for swig. - -typedef struct TFE_MonitoringIntGaugeCell TFE_MonitoringIntGaugeCell; - -// Atomically set the value of the cell. -TF_CAPI_EXPORT extern void TFE_MonitoringIntGaugeCellSet( - TFE_MonitoringIntGaugeCell* cell, int64_t value); - -// Retrieves the current value of the cell. -TF_CAPI_EXPORT extern int64_t TFE_MonitoringIntGaugeCellValue( - TFE_MonitoringIntGaugeCell* cell); - -// APIs for Int Gauge without label. -typedef struct TFE_MonitoringIntGauge0 TFE_MonitoringIntGauge0; -TF_CAPI_EXPORT extern TFE_MonitoringIntGauge0* TFE_MonitoringNewIntGauge0( - const char* name, TF_Status* out_status, const char* description); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteIntGauge0( - TFE_MonitoringIntGauge0* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringIntGaugeCell* -TFE_MonitoringGetCellIntGauge0(TFE_MonitoringIntGauge0* gauge); - -// APIs for Int Gauge with 1 label. -typedef struct TFE_MonitoringIntGauge1 TFE_MonitoringIntGauge1; -TF_CAPI_EXPORT extern TFE_MonitoringIntGauge1* TFE_MonitoringNewIntGauge1( - const char* name, TF_Status* out_status, const char* description, - const char* label1); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteIntGauge1( - TFE_MonitoringIntGauge1* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringIntGaugeCell* -TFE_MonitoringGetCellIntGauge1(TFE_MonitoringIntGauge1* gauge, - const char* label1); - -// APIs for Int Gauge with 2 label. -typedef struct TFE_MonitoringIntGauge2 TFE_MonitoringIntGauge2; -TF_CAPI_EXPORT extern TFE_MonitoringIntGauge2* TFE_MonitoringNewIntGauge2( - const char* name, TF_Status* out_status, const char* description, - const char* label1, const char* label2); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteIntGauge2( - TFE_MonitoringIntGauge2* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringIntGaugeCell* -TFE_MonitoringGetCellIntGauge2(TFE_MonitoringIntGauge2* gauge, - const char* label1, const char* label2); - -typedef struct TFE_MonitoringStringGaugeCell TFE_MonitoringStringGaugeCell; -TF_CAPI_EXPORT extern void TFE_MonitoringStringGaugeCellSet( - TFE_MonitoringStringGaugeCell* cell, const char* value); -// Retrieves the string value and saves it in buffer. -TF_CAPI_EXPORT extern const void TFE_MonitoringStringGaugeCellValue( - TFE_MonitoringStringGaugeCell* cell, TF_Buffer* buf); - -// APIs for String Gauge without label. -typedef struct TFE_MonitoringStringGauge0 TFE_MonitoringStringGauge0; -TF_CAPI_EXPORT extern TFE_MonitoringStringGauge0* TFE_MonitoringNewStringGauge0( - const char* name, TF_Status* out_status, const char* description); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteStringGauge0( - TFE_MonitoringStringGauge0* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringStringGaugeCell* -TFE_MonitoringGetCellStringGauge0(TFE_MonitoringStringGauge0* gauge); - -// APIs for String Gauge with 1 label. -typedef struct TFE_MonitoringStringGauge1 TFE_MonitoringStringGauge1; -TF_CAPI_EXPORT extern TFE_MonitoringStringGauge1* TFE_MonitoringNewStringGauge1( - const char* name, TF_Status* out_status, const char* description, - const char* label1); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteStringGauge1( - TFE_MonitoringStringGauge1* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringStringGaugeCell* -TFE_MonitoringGetCellStringGauge1(TFE_MonitoringStringGauge1* gauge, - const char* label1); - -// APIs for String Gauge with 2 label. -typedef struct TFE_MonitoringStringGauge2 TFE_MonitoringStringGauge2; -TF_CAPI_EXPORT extern TFE_MonitoringStringGauge2* TFE_MonitoringNewStringGauge2( - const char* name, TF_Status* out_status, const char* description, - const char* label1, const char* label2); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteStringGauge2( - TFE_MonitoringStringGauge2* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringStringGaugeCell* -TFE_MonitoringGetCellStringGauge2(TFE_MonitoringStringGauge2* gauge, - const char* label1, const char* label2); - -typedef struct TFE_MonitoringBoolGaugeCell TFE_MonitoringBoolGaugeCell; -TF_CAPI_EXPORT extern void TFE_MonitoringBoolGaugeCellSet( - TFE_MonitoringBoolGaugeCell* cell, bool value); -TF_CAPI_EXPORT extern bool TFE_MonitoringBoolGaugeCellValue( - TFE_MonitoringBoolGaugeCell* cell); - -// APIs for Bool Gauge without label. -typedef struct TFE_MonitoringBoolGauge0 TFE_MonitoringBoolGauge0; -TF_CAPI_EXPORT extern TFE_MonitoringBoolGauge0* TFE_MonitoringNewBoolGauge0( - const char* name, TF_Status* out_status, const char* description); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteBoolGauge0( - TFE_MonitoringBoolGauge0* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringBoolGaugeCell* -TFE_MonitoringGetCellBoolGauge0(TFE_MonitoringBoolGauge0* gauge); - -// APIs for Bool Gauge with 1 label. -typedef struct TFE_MonitoringBoolGauge1 TFE_MonitoringBoolGauge1; -TF_CAPI_EXPORT extern TFE_MonitoringBoolGauge1* TFE_MonitoringNewBoolGauge1( - const char* name, TF_Status* out_status, const char* description, - const char* label1); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteBoolGauge1( - TFE_MonitoringBoolGauge1* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringBoolGaugeCell* -TFE_MonitoringGetCellBoolGauge1(TFE_MonitoringBoolGauge1* gauge, - const char* label1); - -// APIs for Bool Gauge with 2 label. -typedef struct TFE_MonitoringBoolGauge2 TFE_MonitoringBoolGauge2; -TF_CAPI_EXPORT extern TFE_MonitoringBoolGauge2* TFE_MonitoringNewBoolGauge2( - const char* name, TF_Status* out_status, const char* description, - const char* label1, const char* label2); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteBoolGauge2( - TFE_MonitoringBoolGauge2* gauge); -TF_CAPI_EXPORT extern TFE_MonitoringBoolGaugeCell* -TFE_MonitoringGetCellBoolGauge2(TFE_MonitoringBoolGauge2* gauge, - const char* label1, const char* label2); - -// ----------------------------------------------------------------------------- -// Monitoring Sampler APIs. -// These APIs de-templated monitoring Sampler for swig. - -typedef struct TFE_MonitoringSamplerCell TFE_MonitoringSamplerCell; - -// Atomically add the value of the cell. -TF_CAPI_EXPORT extern void TFE_MonitoringSamplerCellAdd( - TFE_MonitoringSamplerCell* cell, double value); - -// Retrieves the current value of the cell. The return value is a HistogramProto -// saved in buffer. -TF_CAPI_EXPORT extern void TFE_MonitoringSamplerCellValue( - TFE_MonitoringSamplerCell* cell, TF_Buffer* buf); - -// APIs for sampler buckets -typedef struct TFE_MonitoringBuckets TFE_MonitoringBuckets; -TF_CAPI_EXPORT extern TFE_MonitoringBuckets* -TFE_MonitoringNewExponentialBuckets(double scale, double growth_factor, - int bucket_count); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteBuckets( - TFE_MonitoringBuckets* buckets); - -// APIs for Sampler without label. -typedef struct TFE_MonitoringSampler0 TFE_MonitoringSampler0; -TF_CAPI_EXPORT extern TFE_MonitoringSampler0* TFE_MonitoringNewSampler0( - const char* name, TFE_MonitoringBuckets* buckets, TF_Status* out_status, - const char* description); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteSampler0( - TFE_MonitoringSampler0* sampler); -TF_CAPI_EXPORT extern TFE_MonitoringSamplerCell* TFE_MonitoringGetCellSampler0( - TFE_MonitoringSampler0* sampler); - -// APIs for Sampler with 1 label. -typedef struct TFE_MonitoringSampler1 TFE_MonitoringSampler1; -TF_CAPI_EXPORT extern TFE_MonitoringSampler1* TFE_MonitoringNewSampler1( - const char* name, TFE_MonitoringBuckets* buckets, TF_Status* out_status, - const char* description, const char* label1); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteSampler1( - TFE_MonitoringSampler1* sampler); -TF_CAPI_EXPORT extern TFE_MonitoringSamplerCell* TFE_MonitoringGetCellSampler1( - TFE_MonitoringSampler1* sampler, const char* label1); - -// APIs for Sampler with 2 label. -typedef struct TFE_MonitoringSampler2 TFE_MonitoringSampler2; -TF_CAPI_EXPORT extern TFE_MonitoringSampler2* TFE_MonitoringNewSampler2( - const char* name, TFE_MonitoringBuckets* buckets, TF_Status* out_status, - const char* description, const char* label1, const char* label2); -TF_CAPI_EXPORT extern void TFE_MonitoringDeleteSampler2( - TFE_MonitoringSampler2* sampler); -TF_CAPI_EXPORT extern TFE_MonitoringSamplerCell* TFE_MonitoringGetCellSampler2( - TFE_MonitoringSampler2* sampler, const char* label1, const char* label2); - -// Sets whether to copy the remote inputs of a function lazily. -TF_CAPI_EXPORT extern void TFE_ContextOptionsSetLazyRemoteInputsCopy( - TFE_ContextOptions*, bool lazy_copy); - -// Sets whether to use TFRT -TF_CAPI_EXPORT extern void TFE_ContextOptionsSetTfrt(TFE_ContextOptions*, - bool use_tfrt); - -// Returns the context_id from the EagerContext which is used by the -// EagerService to maintain consistency between client and worker. The -// context_id is initialized with a dummy value and is later set when the worker -// is initialized (either locally or remotely). The context_id can change during -// the process lifetime although this should cause the worker to be -// reinitialized (e.g. cleared caches) as well. -TF_CAPI_EXPORT extern uint64_t TFE_GetContextId(TFE_Context* ctx); - -// ----------------------------------------------------------------------------- -// Cancellation APIs. - -typedef struct TFE_CancellationManager TFE_CancellationManager; -TF_CAPI_EXPORT extern TFE_CancellationManager* TFE_NewCancellationManager(); -TF_CAPI_EXPORT extern bool TFE_CancellationManagerIsCancelled( - TFE_CancellationManager*); -TF_CAPI_EXPORT extern void TFE_CancellationManagerStartCancel( - TFE_CancellationManager*); -TF_CAPI_EXPORT extern void TFE_DeleteCancellationManager( - TFE_CancellationManager*); - -// Associates the given `cancellation_manager` with `op`, so that invoking -// `TFE_CancellationManagerStartCancel(cancellation_manager)` will cancel the -// execution of `op`. -typedef struct TFE_CancellationManager TFE_CancellationManager; -TF_CAPI_EXPORT extern void TFE_OpSetCancellationManager( - TFE_Op* op, TFE_CancellationManager* cancellation_manager, - TF_Status* status); - -// ----------------------------------------------------------------------------- -// Eager Executor APIs. -typedef struct TFE_Executor TFE_Executor; - -// Creates a new eager Executor. Nodes in one executor are guaranteed to be -// executed in sequence. Assigning nodes to different executors allows executing -// nodes in parallel. -TF_CAPI_EXPORT extern TFE_Executor* TFE_NewExecutor(bool is_async); - -// Deletes the eager Executor without waiting for enqueued nodes. Please call -// TFE_ExecutorWaitForAllPendingNodes before calling this API if you want to -// make sure all nodes are finished. -TF_CAPI_EXPORT extern void TFE_DeleteExecutor(TFE_Executor*); - -// Returns true if the executor is in async mode. -TF_CAPI_EXPORT extern bool TFE_ExecutorIsAsync(TFE_Executor*); - -// Causes the calling thread to block till all ops dispatched in this executor -// have been executed. Note that "execution" here refers to kernel execution / -// scheduling of copies, etc. Similar to sync execution, it doesn't guarantee -// that lower level device queues (like GPU streams) have been flushed. -// -// This call may not block for execution of ops enqueued concurrently with this -// call. -TF_CAPI_EXPORT extern void TFE_ExecutorWaitForAllPendingNodes( - TFE_Executor*, TF_Status* status); - -// When an error happens, any pending operations are discarded and newly issued -// ops return an error. This call clears the error state and re-enables -// execution of newly issued ops. -// -// Note that outputs of discarded ops remain in a corrupt state and should not -// be used for future calls. -// TODO(agarwal): mark the affected handles and raise errors if they are used. -TF_CAPI_EXPORT extern void TFE_ExecutorClearError(TFE_Executor*); - -// Sets a custom Executor for current thread. All nodes created by this thread -// will be added to this Executor. It will override current executor. -TF_CAPI_EXPORT extern void TFE_ContextSetExecutorForThread(TFE_Context*, - TFE_Executor*); - -// Returns the Executor for current thread. -TF_CAPI_EXPORT extern TFE_Executor* TFE_ContextGetExecutorForThread( - TFE_Context*); - -// ----------------------------------------------------------------------------- -// Dynamic cluster API. - -// Update an existing context with a new set of servers defined in a ServerDef -// proto. Servers can be added to and removed from the list of remote workers -// in the context. New set of servers identified by the ServerDef must be up -// when the context is updated. -// -// This API is for experimental usage and may be subject to change. -TF_CAPI_EXPORT extern void TFE_ContextUpdateServerDef(TFE_Context* ctx, - int keep_alive_secs, - const void* proto, - size_t proto_len, - TF_Status* status); - -// Checks whether a remote worker is alive or not. This will return true even if -// the context doesn't exist on the remote worker. -TF_CAPI_EXPORT extern bool TFE_ContextCheckAlive(TFE_Context* ctx, - const char* worker_name, - TF_Status* status); - -// Sync pending nodes in local executors (including the context default executor -// and thread executors) and streaming requests to remote executors, and get the -// combined status. -TF_CAPI_EXPORT extern void TFE_ContextAsyncWait(TFE_Context* ctx, - TF_Status* status); - -// This function will block till the operation that produces `h` has -// completed. This is only valid on local TFE_TensorHandles. The pointer -// returned will be on the device in which the TFE_TensorHandle resides (so e.g. -// for a GPU tensor this will return a pointer to GPU memory). The pointer is -// only guaranteed to be valid until TFE_DeleteTensorHandle is called on this -// TensorHandle. Only supports POD data types. -TF_CAPI_EXPORT extern void* TFE_TensorHandleDevicePointer(TFE_TensorHandle*, - TF_Status*); - -// This function will block till the operation that produces `h` has -// completed. This is only valid on local TFE_TensorHandles. Returns the size in -// bytes of the memory pointed to by the device pointer returned above. -TF_CAPI_EXPORT extern size_t TFE_TensorHandleDeviceMemorySize(TFE_TensorHandle*, - TF_Status*); - -// Creates a new TensorHandle from memory residing in device_name. Takes -// ownership of the memory, and will call deleter to release it after TF -// no longer needs it or in case of error. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_NewTensorHandleFromDeviceMemory( - TFE_Context* ctx, const char* device_name, TF_DataType, const int64_t* dims, - int num_dims, void* data, size_t len, - void (*deallocator)(void* data, size_t len, void* arg), - void* deallocator_arg, TF_Status* status); - -// Retrieves the address space (i.e. job, replia, task) of the local host and -// saves it in the buffer. -TF_CAPI_EXPORT extern void TFE_HostAddressSpace(TFE_Context* ctx, - TF_Buffer* buf); - -// APIs for generically dealing with op attributes (e.g. when forwarding them -// through custom device implementations). -// -// TODO(allenl): Currently these are black boxes, but we should have some way to -// inspect values. This would let people e.g. copy over most attributes and then -// modify some based on their values. - -// A reference to an op's name -> attribute mapping -typedef struct TFE_OpAttrs TFE_OpAttrs; - -// Fetch a reference to `op`'s attributes. The returned reference is only valid -// while `op` is alive. -TF_CAPI_EXPORT extern const TFE_OpAttrs* TFE_OpGetAttrs(const TFE_Op* op); -// Add attributes in `attrs` to `op`. -// -// Does not overwrite or update existing attributes, but adds new ones. -TF_CAPI_EXPORT extern void TFE_OpAddAttrs(TFE_Op* op, const TFE_OpAttrs* attrs); - -// Serialize `attrs` as a tensorflow::NameAttrList protocol buffer (into `buf`), -// containing the op name and a map of its attributes. -TF_CAPI_EXPORT extern void TFE_OpAttrsSerialize(const TFE_OpAttrs* attrs, - TF_Buffer* buf, - TF_Status* status); - -// Set an op's attribute from a serialized AttrValue protocol buffer. -// -// Analogous to TF_SetAttrValueProto for building graph operations. -TF_CAPI_EXPORT extern void TFE_OpSetAttrValueProto(const TFE_Op* op, - const char* attr_name, - const void* proto, - size_t proto_len, - TF_Status* status); - -// TODO(b/166642410): It would be nice, for custom devices and for other users, -// to have a non-string representation of devices (TF_Device) extracted from -// tensors/ops/etc. and usable in APIs like OpSetDevice/ResetOp/etc. - -#define TFE_CUSTOM_DEVICE_VERSION 3 - -// Struct to be filled in -typedef struct TFE_CustomDevice { - int version = TFE_CUSTOM_DEVICE_VERSION; - // Method to copy a tensor to the custom device. - TFE_TensorHandle* (*copy_tensor_to_device)(TFE_Context* context, - TFE_TensorHandle* tensor, - TF_Status* status, - void* device_info) = nullptr; - - // Method to copy a tensor from the custom device to a target device. - TFE_TensorHandle* (*copy_tensor_from_device)(TFE_Context* context, - TFE_TensorHandle* tensor, - const char* target_device_name, - TF_Status* status, - void* device_info); - - // Method to execute an operation. - // - // Arguments provide enough information to reconstruct the original `TFE_Op`, - // or construct a transformed version, by inspecting the passed `op`. - // - // TFE_OpGetDevice(op) records the original placement of the operation. It may - // be an empty string if no device was explicitly requested, but will - // otherwise be the name of this custom device. Ops are placed onto a custom - // device if any of their inputs are on that custom device, but custom devices - // are free to set a bad status in order to require explicit placement. - void (*execute)(const TFE_Op* op, int* num_outputs, - TFE_TensorHandle** outputs, TF_Status* s, void* device_info); - - // Method to delete a device. - void (*delete_device)(void* device_info); -} TFE_CustomDevice; - -// Registers a custom device for use with eager execution. -// -// Eager operations may be placed on this device, e.g. `with -// tf.device("CUSTOM"):` from Python if `device_name` for this call is -// "/job:localhost/replica:0/task:0/device:CUSTOM:0". -// -// The custom device defines copy operations for moving TensorHandles on and -// off, and an an execution operation for named operations. Often execution will -// simply wrap op execution on one or more physical devices. -// -// device_info is an opaque caller-defined type stored with the custom device -// which is passed to the functions referenced in the TFE_CustomDevice struct -// `device` (execute, delete_device, etc.). It can for example contain the -// names of wrapped devices. -// -// There are currently no graph semantics implemented for registered custom -// devices, so executing tf.functions which contain operations placed on custom -// devices will fail. -// -// `device_name` must not name an existing physical or custom device. It must -// follow the format: -// -// /job:/replica:/task:/device:: -// -// If the device is successfully registered, `status` is set to TF_OK. Otherwise -// the device is not usable. In case of a bad status, `device.delete_device` is -// still called on `device_info` (i.e. the caller does not retain ownership). -// -// This API is highly experimental, and in particular is expected to change when -// it starts supporting operations with attributes and when tf.function support -// is added. -TF_CAPI_EXPORT extern void TFE_RegisterCustomDevice(TFE_Context* ctx, - TFE_CustomDevice device, - const char* device_name, - void* device_info, - TF_Status* status); - -TF_CAPI_EXPORT extern void TFE_ContextGetFunctionDef(TFE_Context* ctx, - const char* function_name, - TF_Buffer* buf, - TF_Status* status); - -// Allocate and return a new Tensor on the host. -// -// The caller must set the Tensor values by writing them to the pointer returned -// by TF_TensorData with length TF_TensorByteSize. -TF_CAPI_EXPORT extern TF_Tensor* TFE_AllocateHostTensor(TFE_Context* ctx, - TF_DataType dtype, - const int64_t* dims, - int num_dims, - TF_Status* status); - -// Given a Tensor, wrap it with a TensorHandle -// -// Similar to TFE_NewTensorHandle, but includes a pointer to the TFE_Context. -// The context should be identical to that of the Tensor. -TF_CAPI_EXPORT TFE_TensorHandle* TFE_NewTensorHandleFromTensor( - TFE_Context* ctx, TF_Tensor* t, TF_Status* status); - -// Create a packed TensorHandle with the given list of TensorHandles. -// If `handles` are on the same device, assign the same device to the packed -// handle; if `handles` are on different deivces, assign a CompositeDevice to -// it. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_CreatePackedTensorHandle( - TFE_Context* ctx, TFE_TensorHandle** handles, int* num_handles, - TF_Status* status); - -// Configure soft device placement policy for the eager executor. Note this -// policy is applied to any subsequent op executions. -TF_CAPI_EXPORT void TFE_ContextSetSoftDevicePlacement(TFE_Context* ctx, - unsigned char enable, - TF_Status* status); - -// Configure device placement policy logging for the eager executor. Note this -// policy is applied to any subsequent op executions. -TF_CAPI_EXPORT void TFE_ContextSetLogDevicePlacement(TFE_Context* ctx, - unsigned char enable, - TF_Status* status); - -// Returns the device type of the operation that produced `h`. -TF_CAPI_EXPORT extern const char* TFE_TensorHandleDeviceType( - TFE_TensorHandle* h, TF_Status* status); - -// Returns the device ID of the operation that produced `h`. -TF_CAPI_EXPORT extern int TFE_TensorHandleDeviceID(TFE_TensorHandle* h, - TF_Status* status); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/dlpack.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/dlpack.h deleted file mode 100755 index 8c85dee62..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/dlpack.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2020 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_EAGER_DLPACK_H_ -#define TENSORFLOW_C_EAGER_DLPACK_H_ - -#include "tensorflow/c/eager/c_api.h" - -namespace tensorflow { - -// PyCapsule name for DLPack Tensor -const char* const kDlTensorCapsuleName = "dltensor"; - -// Converts eager tensor handle to DLPack (DLManagedTensor*), and return the -// void* for further PyCapsule construction. -TF_CAPI_EXPORT extern void* TFE_HandleToDLPack(TFE_TensorHandle* h, - TF_Status* status); - -// Converts DLPack (DLManagedTensor*) to eager tensor handle. -TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_HandleFromDLPack(void* dlm, - TF_Status* status, - TFE_Context* ctx); - -// Calls the destructor of DLManagedTensor, used in the destructor of PyCapsule. -TF_CAPI_EXPORT extern void TFE_CallDLManagedTensorDeleter(void* dlm_ptr); -} // namespace tensorflow - -#endif // TENSORFLOW_C_EAGER_DLPACK_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tensor_interface.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tensor_interface.h deleted file mode 100755 index d165c8498..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tensor_interface.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2020 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_TENSOR_INTERFACE_H_ -#define TENSORFLOW_C_TENSOR_INTERFACE_H_ - -#include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/platform/status.h" - -namespace tensorflow { - -// Abstract interface to a Tensor. -// -// This allows us to hide concrete implementations of Tensor from header -// files. The interface lists the common functionality that must be provided by -// any concrete implementation. However, in cases where the true concrete class -// is needed a static_cast can be applied. -class AbstractTensorInterface { - public: - // Release any underlying resources, including the interface object. - virtual void Release() = 0; - - // Returns tensor dtype. - virtual DataType Type() const = 0; - // Returns number of dimensions. - virtual int NumDims() const = 0; - // Returns size of specified dimension - virtual int64_t Dim(int dim_index) const = 0; - // Returns number of elements across all dimensions. - virtual int64_t NumElements() const = 0; - // Return size in bytes of the Tensor - virtual size_t ByteSize() const = 0; - // Returns a pointer to tensor data - virtual void* Data() const = 0; - - // Returns if the tensor is aligned - virtual bool IsAligned() const = 0; - // Returns if their is sole ownership of this Tensor and thus it can be moved. - virtual bool CanMove() const = 0; - - protected: - virtual ~AbstractTensorInterface() {} -}; - -namespace internal { -struct AbstractTensorInterfaceDeleter { - void operator()(AbstractTensorInterface* p) const { - if (p != nullptr) { - p->Release(); - } - } -}; -} // namespace internal - -using AbstractTensorPtr = - std::unique_ptr; - -} // namespace tensorflow - -#endif // TENSORFLOW_C_TENSOR_INTERFACE_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h deleted file mode 100755 index 0c1545db2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ -#ifndef TENSORFLOW_C_TF_ATTRTYPE_H_ -#define TENSORFLOW_C_TF_ATTRTYPE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// TF_AttrType describes the type of the value of an attribute on an operation. -typedef enum TF_AttrType { - TF_ATTR_STRING = 0, - TF_ATTR_INT = 1, - TF_ATTR_FLOAT = 2, - TF_ATTR_BOOL = 3, - TF_ATTR_TYPE = 4, - TF_ATTR_SHAPE = 5, - TF_ATTR_TENSOR = 6, - TF_ATTR_PLACEHOLDER = 7, - TF_ATTR_FUNC = 8, -} TF_AttrType; - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_TF_ATTRTYPE_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h deleted file mode 100755 index 3e6121bf9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_TF_DATATYPE_H_ -#define TENSORFLOW_C_TF_DATATYPE_H_ - -#include - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -// -------------------------------------------------------------------------- -// TF_DataType holds the type for a scalar value. E.g., one slot in a tensor. -// The enum values here are identical to corresponding values in types.proto. -typedef enum TF_DataType { - TF_FLOAT = 1, - TF_DOUBLE = 2, - TF_INT32 = 3, // Int32 tensors are always in 'host' memory. - TF_UINT8 = 4, - TF_INT16 = 5, - TF_INT8 = 6, - TF_STRING = 7, - TF_COMPLEX64 = 8, // Single-precision complex - TF_COMPLEX = 8, // Old identifier kept for API backwards compatibility - TF_INT64 = 9, - TF_BOOL = 10, - TF_QINT8 = 11, // Quantized int8 - TF_QUINT8 = 12, // Quantized uint8 - TF_QINT32 = 13, // Quantized int32 - TF_BFLOAT16 = 14, // Float32 truncated to 16 bits. Only for cast ops. - TF_QINT16 = 15, // Quantized int16 - TF_QUINT16 = 16, // Quantized uint16 - TF_UINT16 = 17, - TF_COMPLEX128 = 18, // Double-precision complex - TF_HALF = 19, - TF_RESOURCE = 20, - TF_VARIANT = 21, - TF_UINT32 = 22, - TF_UINT64 = 23, -} TF_DataType; - -// TF_DataTypeSize returns the sizeof() for the underlying type corresponding -// to the given TF_DataType enum value. Returns 0 for variable length types -// (eg. TF_STRING) or on failure. -TF_CAPI_EXPORT extern size_t TF_DataTypeSize(TF_DataType dt); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_TF_DATATYPE_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_file_statistics.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_file_statistics.h deleted file mode 100755 index bbf23831f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_file_statistics.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_TF_FILE_STATISTICS_H_ -#define TENSORFLOW_C_TF_FILE_STATISTICS_H_ - -#include - -typedef struct TF_FileStatistics { - // The length of the file in bytes. - int64_t length; - // The last modified time in nanoseconds. - int64_t mtime_nsec; - // Whether the name refers to a directory. - bool is_directory; -} TF_FileStatistics; - -// TODO(mihaimaruseac): `tensorflow::FileStatistics` from -// `core/platform/file_statistics.h` is a duplicate of this so maybe try to -// remove duplication later? - -#endif // TENSORFLOW_C_TF_FILE_STATISTICS_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h deleted file mode 100755 index 614f660ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_TF_STATUS_H_ -#define TENSORFLOW_C_TF_STATUS_H_ - -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct TF_Status TF_Status; - -// -------------------------------------------------------------------------- -// TF_Code holds an error code. The enum values here are identical to -// corresponding values in error_codes.proto. -typedef enum TF_Code { - TF_OK = 0, - TF_CANCELLED = 1, - TF_UNKNOWN = 2, - TF_INVALID_ARGUMENT = 3, - TF_DEADLINE_EXCEEDED = 4, - TF_NOT_FOUND = 5, - TF_ALREADY_EXISTS = 6, - TF_PERMISSION_DENIED = 7, - TF_UNAUTHENTICATED = 16, - TF_RESOURCE_EXHAUSTED = 8, - TF_FAILED_PRECONDITION = 9, - TF_ABORTED = 10, - TF_OUT_OF_RANGE = 11, - TF_UNIMPLEMENTED = 12, - TF_INTERNAL = 13, - TF_UNAVAILABLE = 14, - TF_DATA_LOSS = 15, -} TF_Code; - -// -------------------------------------------------------------------------- - -// Return a new status object. -TF_CAPI_EXPORT extern TF_Status* TF_NewStatus(void); - -// Delete a previously created status object. -TF_CAPI_EXPORT extern void TF_DeleteStatus(TF_Status*); - -// Record in *s. Any previous information is lost. -// A common use is to clear a status: TF_SetStatus(s, TF_OK, ""); -TF_CAPI_EXPORT extern void TF_SetStatus(TF_Status* s, TF_Code code, - const char* msg); - -// Convert from an I/O error code (e.g., errno) to a TF_Status value. -// Any previous information is lost. Prefer to use this instead of TF_SetStatus -// when the error comes from I/O operations. -TF_CAPI_EXPORT extern void TF_SetStatusFromIOError(TF_Status* s, int error_code, - const char* context); - -// Return the code record in *s. -TF_CAPI_EXPORT extern TF_Code TF_GetCode(const TF_Status* s); - -// Return a pointer to the (null-terminated) error message in *s. The -// return value points to memory that is only usable until the next -// mutation to *s. Always returns an empty string if TF_GetCode(s) is -// TF_OK. -TF_CAPI_EXPORT extern const char* TF_Message(const TF_Status* s); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_TF_STATUS_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h deleted file mode 100755 index e0a026f98..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_C_TF_TENSOR_H_ -#define TENSORFLOW_C_TF_TENSOR_H_ - -#include -#include - -#include "tensorflow/c/c_api_macros.h" -#include "tensorflow/c/tf_datatype.h" -#include "tensorflow/c/tf_status.h" - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -#ifdef SWIG -#define TF_CAPI_EXPORT -#else -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_CAPI_EXPORT __declspec(dllexport) -#else -#define TF_CAPI_EXPORT __declspec(dllimport) -#endif // TF_COMPILE_LIBRARY -#else -#define TF_CAPI_EXPORT __attribute__((visibility("default"))) -#endif // _WIN32 -#endif // SWIG - -#ifdef __cplusplus -extern "C" { -#endif - -// Allocator Attributes used for tensor allocation. -typedef struct TF_AllocatorAttributes { - size_t struct_size; - // Set boolean to 1 for CPU allocation, else 0. - TF_Bool on_host; -} TF_AllocatorAttributes; - -#define TF_ALLOCATOR_ATTRIBUTES_STRUCT_SIZE \ - TF_OFFSET_OF_END(TF_AllocatorAttributes, on_host) - -// -------------------------------------------------------------------------- -// TF_Tensor holds a multi-dimensional array of elements of a single data type. -// For all types other than TF_STRING, the data buffer stores elements -// in row major order. E.g. if data is treated as a vector of TF_DataType: -// -// element 0: index (0, ..., 0) -// element 1: index (0, ..., 1) -// ... -// -// The format for TF_STRING tensors is: -// start_offset: array[uint64] -// data: byte[...] -// -// The string length (as a varint, start_offset[i + 1] - start_offset[i]), -// followed by the contents of the string is encoded at data[start_offset[i]]. -// TF_StringEncode and TF_StringDecode facilitate this encoding. - -typedef struct TF_Tensor TF_Tensor; - -// Return a new tensor that holds the bytes data[0,len-1]. -// -// The data will be deallocated by a subsequent call to TF_DeleteTensor via: -// (*deallocator)(data, len, deallocator_arg) -// Clients must provide a custom deallocator function so they can pass in -// memory managed by something like numpy. -// -// May return NULL (and invoke the deallocator) if the provided data buffer -// (data, len) is inconsistent with a tensor of the given TF_DataType -// and the shape specified by (dima, num_dims). -TF_CAPI_EXPORT extern TF_Tensor* TF_NewTensor( - TF_DataType, const int64_t* dims, int num_dims, void* data, size_t len, - void (*deallocator)(void* data, size_t len, void* arg), - void* deallocator_arg); - -// Allocate and return a new Tensor. -// -// This function is an alternative to TF_NewTensor and should be used when -// memory is allocated to pass the Tensor to the C API. The allocated memory -// satisfies TensorFlow's memory alignment preferences and should be preferred -// over calling malloc and free. -// -// The caller must set the Tensor values by writing them to the pointer returned -// by TF_TensorData with length TF_TensorByteSize. -TF_CAPI_EXPORT extern TF_Tensor* TF_AllocateTensor(TF_DataType, - const int64_t* dims, - int num_dims, size_t len); - -// Deletes `tensor` and returns a new TF_Tensor with the same content if -// possible. Returns nullptr and leaves `tensor` untouched if not. -TF_CAPI_EXPORT extern TF_Tensor* TF_TensorMaybeMove(TF_Tensor* tensor); - -// Destroy a tensor. -TF_CAPI_EXPORT extern void TF_DeleteTensor(TF_Tensor*); - -// Return the type of a tensor element. -TF_CAPI_EXPORT extern TF_DataType TF_TensorType(const TF_Tensor*); - -// Return the number of dimensions that the tensor has. -TF_CAPI_EXPORT extern int TF_NumDims(const TF_Tensor*); - -// Return the length of the tensor in the "dim_index" dimension. -// REQUIRES: 0 <= dim_index < TF_NumDims(tensor) -TF_CAPI_EXPORT extern int64_t TF_Dim(const TF_Tensor* tensor, int dim_index); - -// Return the size of the underlying data in bytes. -TF_CAPI_EXPORT extern size_t TF_TensorByteSize(const TF_Tensor*); - -// Return a pointer to the underlying data buffer. -TF_CAPI_EXPORT extern void* TF_TensorData(const TF_Tensor*); - -// Returns the number of elements in the tensor. -TF_CAPI_EXPORT extern int64_t TF_TensorElementCount(const TF_Tensor* tensor); - -// Copy the internal data representation of `from` to `to`. `new_dims` and -// `num_new_dims` specify the new shape of the `to` tensor, `type` specifies its -// data type. On success, *status is set to TF_OK and the two tensors share the -// same data buffer. -// -// This call requires that the `from` tensor and the given type and shape (dims -// and num_dims) are "compatible" (i.e. they occupy the same number of bytes). -// Specifically, given from_type_size = TF_DataTypeSize(TF_TensorType(from)): -// -// ShapeElementCount(dims, num_dims) * TF_DataTypeSize(type) -// -// must equal -// -// TF_TensorElementCount(from) * from_type_size -// -// where TF_ShapeElementCount would be the number of elements in a tensor with -// the given shape. -// -// In addition, this function requires: -// * TF_DataTypeSize(TF_TensorType(from)) != 0 -// * TF_DataTypeSize(type) != 0 -// -// If any of the requirements are not met, *status is set to -// TF_INVALID_ARGUMENT. -TF_CAPI_EXPORT extern void TF_TensorBitcastFrom(const TF_Tensor* from, - TF_DataType type, TF_Tensor* to, - const int64_t* new_dims, - int num_new_dims, - TF_Status* status); - -// Returns bool iff this tensor is aligned. -TF_CAPI_EXPORT extern bool TF_TensorIsAligned(const TF_Tensor*); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif // TENSORFLOW_C_TF_TENSOR_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h deleted file mode 100755 index 8b576ff81..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tstring.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 2020 The TensorFlow Authors. 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. -==============================================================================*/ -#ifndef TENSORFLOW_C_TF_TSTRING_H_ -#define TENSORFLOW_C_TF_TSTRING_H_ - -#include "tensorflow/core/platform/ctstring.h" - -#endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h deleted file mode 100755 index 3209a8e73..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ -#define TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ - -#include -#include - -#include "tensorflow/core/platform/ctstring_internal.h" - -// Initialize a new tstring. This must be called before using any function -// below. -inline void TF_TString_Init(TF_TString *str); -// Deallocate a tstring. -inline void TF_TString_Dealloc(TF_TString *str); - -// Resizes `str' to `new_size'. This function will appropriately grow or shrink -// the string buffer to fit a `new_size' string. Grown regions of the string -// will be initialized with `c'. -inline char *TF_TString_Resize(TF_TString *str, size_t new_size, char c); -// Similar to TF_TString_Resize, except the newly allocated regions will remain -// uninitialized. This is useful if you plan on overwriting the newly grown -// regions immediately after allocation; doing so will elide a superfluous -// initialization of the new buffer. -inline char *TF_TString_ResizeUninitialized(TF_TString *str, size_t new_size); -// Reserves a string buffer with a capacity of at least `new_cap'. -// ResizeUninitialized will not change the size, or the contents of the existing -// string. This is useful if you have a rough idea of `str's upperbound in -// size, and want to avoid allocations as you append to `str'. It should not be -// considered safe to write in the region between size and capacity; explicitly -// resize before doing so. -inline void TF_TString_Reserve(TF_TString *str, size_t new_cap); - -// Returns the size of the string. -inline size_t TF_TString_GetSize(const TF_TString *str); -// Returns the capacity of the string buffer. It should not be considered safe -// to write in the region between size and capacity---call Resize or -// ResizeUninitialized before doing so. -inline size_t TF_TString_GetCapacity(const TF_TString *str); -// Returns the underlying type of the tstring: -// TF_TSTR_SMALL: -// Small string optimization; the contents of strings -// less than 22-bytes are stored in the TF_TString struct. This avoids any -// heap allocations. -// TF_TSTR_LARGE: -// Heap allocated string. -// TF_TSTR_OFFSET: (currently unused) -// An offset defined string. The string buffer begins at an internally -// defined little-endian offset from `str'; i.e. GetDataPointer() = str + -// offset. This type is useful for memory mapping or reading string tensors -// directly from file, without the need to deserialize the data. For -// security reasons, it is imperative that OFFSET based string tensors are -// validated before use, or are from a trusted source. -// TF_TSTR_VIEW: -// A view into an unowned character string. -// -// NOTE: -// VIEW and OFFSET types are immutable, so any modifcation via Append, -// AppendN, or GetMutableDataPointer of a VIEW/OFFSET based tstring will -// result in a conversion to an owned type (SMALL/LARGE). -inline TF_TString_Type TF_TString_GetType(const TF_TString *str); - -// Returns a const char pointer to the start of the underlying string. The -// underlying character buffer may not be null-terminated. -inline const char *TF_TString_GetDataPointer(const TF_TString *str); -// Returns a char pointer to a mutable representation of the underlying string. -// In the case of VIEW and OFFSET types, `src' is converted to an owned type -// (SMALL/LARGE). The underlying character buffer may not be null-terminated. -inline char *TF_TString_GetMutableDataPointer(TF_TString *str); - -// Sets `dst' as a VIEW type to `src'. `dst' will not take ownership of `src'. -// It is the user's responsibility to ensure that the lifetime of `src' exceeds -// `dst'. Any mutations to `dst' via Append, AppendN, or GetMutableDataPointer, -// will result in a copy into an owned SMALL or LARGE type, and will not modify -// `src'. -inline void TF_TString_AssignView(TF_TString *dst, const char *src, - size_t size); - -// Appends `src' onto `dst'. If `dst' is a VIEW or OFFSET type, it will first -// be converted to an owned LARGE or SMALL type. `dst' should not point to -// memory owned by `src'. -inline void TF_TString_Append(TF_TString *dst, const TF_TString *src); -inline void TF_TString_AppendN(TF_TString *dst, const char *src, size_t size); - -// Copy/Move/Assign semantics -// -// | src | dst | complexity -// Copy | * | SMALL/LARGE | fixed/O(size) -// Assign | SMALL | SMALL | fixed -// Assign | OFFSET | VIEW | fixed -// Assign | VIEW | VIEW | fixed -// Assign | LARGE | LARGE | O(size) -// Move | * | same as src | fixed - -// Copies `src' to `dst'. `dst' will be an owned type (SMALL/LARGE). `src' -// should not point to memory owned by `dst'. -inline void TF_TString_Copy(TF_TString *dst, const char *src, size_t size); -// Assigns a `src' tstring to `dst'. An OFFSET `src' type will yield a `VIEW' -// `dst'. LARGE `src' types will be copied to a new buffer; all other `src' -// types will incur a fixed cost. -inline void TF_TString_Assign(TF_TString *dst, const TF_TString *src); -// Moves a `src' tstring to `dst'. Moving a LARGE `src' to `dst' will result in -// a valid but unspecified `src'. This function incurs a fixed cost for all -// inputs. -inline void TF_TString_Move(TF_TString *dst, TF_TString *src); - -#endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h deleted file mode 100755 index 952426717..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/core/platform/ctstring_internal.h +++ /dev/null @@ -1,449 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. 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. -==============================================================================*/ - -#ifndef TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ -#define TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ - -#include -#include -#include -#include - -#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ - defined(_WIN32) -#define TF_TSTRING_LITTLE_ENDIAN 1 -#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define TF_TSTRING_LITTLE_ENDIAN 0 -#else -#error "Unable to detect endianness." -#endif - -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ >= 5)) -static inline uint32_t TF_swap32(uint32_t host_int) { - return __builtin_bswap32(host_int); -} - -#elif defined(_MSC_VER) -static inline uint32_t TF_swap32(uint32_t host_int) { - return _byteswap_ulong(host_int); -} - -#elif defined(__APPLE__) -static inline uint32_t TF_swap32(uint32_t host_int) { - return OSSwapInt32(host_int); -} - -#else -static inline uint32_t TF_swap32(uint32_t host_int) { -#if defined(__GLIBC__) - return bswap_32(host_int); -#else // defined(__GLIBC__) - return (((host_int & uint32_t{0xFF}) << 24) | - ((host_int & uint32_t{0xFF00}) << 8) | - ((host_int & uint32_t{0xFF0000}) >> 8) | - ((host_int & uint32_t{0xFF000000}) >> 24)); -#endif // defined(__GLIBC__) -} -#endif - -#if TF_TSTRING_LITTLE_ENDIAN -#define TF_le32toh(x) TF_swap32(x) -#else // TF_TSTRING_LITTLE_ENDIAN -#define TF_le32toh(x) x -#endif // TF_TSTRING_LITTLE_ENDIAN - -static inline size_t TF_align16(size_t i) { return (i + 0xF) & ~0xF; } - -static inline size_t TF_max(size_t a, size_t b) { return a > b ? a : b; } -static inline size_t TF_min(size_t a, size_t b) { return a < b ? a : b; } - -typedef enum TF_TString_Type { // NOLINT - TF_TSTR_SMALL = 0x00, - TF_TSTR_LARGE = 0x01, - TF_TSTR_OFFSET = 0x02, - TF_TSTR_VIEW = 0x03, - TF_TSTR_TYPE_MASK = 0x03 -} TF_TString_Type; - -typedef struct TF_TString_Large { // NOLINT - size_t size; - size_t cap; - char *ptr; -} TF_TString_Large; - -typedef struct TF_TString_Offset { // NOLINT - uint32_t size; - uint32_t offset; - uint32_t count; -} TF_TString_Offset; - -typedef struct TF_TString_View { // NOLINT - size_t size; - const char *ptr; -} TF_TString_View; - -typedef struct TF_TString_Raw { // NOLINT - uint8_t raw[24]; -} TF_TString_Raw; - -typedef union TF_TString_Union { // NOLINT - TF_TString_Large large; - TF_TString_Offset offset; - TF_TString_View view; - TF_TString_Raw raw; -} TF_TString_Union; - -enum { - TF_TString_SmallCapacity = - (sizeof(TF_TString_Union) - sizeof(/* null delim */ char) - - sizeof(/* uint8_t size */ uint8_t)), -}; - -typedef struct TF_TString_Small { // NOLINT - uint8_t size; - char str[TF_TString_SmallCapacity + sizeof(/* null delim */ char)]; -} TF_TString_Small; - -typedef struct TF_TString { // NOLINT - union { - // small conflicts with '#define small char' in RpcNdr.h for MSVC, so we use - // smll instead. - TF_TString_Small smll; - TF_TString_Large large; - TF_TString_Offset offset; - TF_TString_View view; - TF_TString_Raw raw; - } u; -} TF_TString; - -// TODO(dero): Fix for OSS, and add C only build test. -// _Static_assert(CHAR_BIT == 8); -// _Static_assert(sizeof(TF_TString) == 24); - -static inline TF_TString_Type TF_TString_GetType(const TF_TString *str) { - return (TF_TString_Type)(str->u.raw.raw[0] & TF_TSTR_TYPE_MASK); // NOLINT -} - -// XXX(dero): For the big-endian case, this function could potentially be more -// performant and readable by always storing the string size as little-endian -// and always byte-swapping on big endian, resulting in a simple 'bswap'+'shr' -// (for architectures that have a bswap op). -static inline size_t TF_TString_ToActualSizeT(size_t size) { -#if TF_TSTRING_LITTLE_ENDIAN - return size >> 2; -#else // TF_TSTRING_LITTLE_ENDIAN - // 0xFF000000 or 0xFF00000000000000 depending on platform - static const size_t mask = ~((~(size_t)0) >> 8); - - return (((mask << 2) & size) >> 2) | (~mask & size); -#endif // TF_TSTRING_LITTLE_ENDIAN -} - -static inline size_t TF_TString_ToInternalSizeT(size_t size, - TF_TString_Type type) { -#if TF_TSTRING_LITTLE_ENDIAN - return (size << 2) | type; -#else // TF_TSTRING_LITTLE_ENDIAN - // 0xFF000000 or 0xFF00000000000000 depending on platform - static const size_t mask = ~((~(size_t)0) >> 8); - - return (mask & (size << 2)) | (~mask & size) | - ((size_t)type << ((sizeof(size_t) - 1) * 8)); // NOLINT -#endif // TF_TSTRING_LITTLE_ENDIAN -} - -static inline void TF_TString_Init(TF_TString *str) { - memset(str->u.raw.raw, 0, sizeof(TF_TString_Raw)); -} - -static inline void TF_TString_Dealloc(TF_TString *str) { - if (TF_TString_GetType(str) == TF_TSTR_LARGE && - str->u.large.ptr != NULL) { // NOLINT - free(str->u.large.ptr); - TF_TString_Init(str); - } -} - -static inline size_t TF_TString_GetSize(const TF_TString *str) { - switch (TF_TString_GetType(str)) { - case TF_TSTR_SMALL: - return str->u.smll.size >> 2; - case TF_TSTR_LARGE: - return TF_TString_ToActualSizeT(str->u.large.size); - case TF_TSTR_OFFSET: - return TF_le32toh(str->u.offset.size) >> 2; - case TF_TSTR_VIEW: - return TF_TString_ToActualSizeT(str->u.view.size); - default: - return 0; // Unreachable. - } -} - -static inline size_t TF_TString_GetCapacity(const TF_TString *str) { - switch (TF_TString_GetType(str)) { - case TF_TSTR_SMALL: - return TF_TString_SmallCapacity; - case TF_TSTR_LARGE: - return str->u.large.cap; - case TF_TSTR_OFFSET: - case TF_TSTR_VIEW: - default: - return 0; - } -} - -static inline const char *TF_TString_GetDataPointer(const TF_TString *str) { - switch (TF_TString_GetType(str)) { - case TF_TSTR_SMALL: - return str->u.smll.str; - case TF_TSTR_LARGE: - return str->u.large.ptr; - case TF_TSTR_OFFSET: - return (const char *)str + str->u.offset.offset; // NOLINT - case TF_TSTR_VIEW: - return str->u.view.ptr; - default: - // Unreachable. - return NULL; // NOLINT - } -} - -static inline char *TF_TString_ResizeUninitialized(TF_TString *str, - size_t new_size) { - size_t curr_size = TF_TString_GetSize(str); - size_t copy_size = TF_min(new_size, curr_size); - - TF_TString_Type curr_type = TF_TString_GetType(str); - const char *curr_ptr = TF_TString_GetDataPointer(str); - - // Case: SMALL/LARGE/VIEW/OFFSET -> SMALL - if (new_size <= TF_TString_SmallCapacity) { - str->u.smll.size = (uint8_t)((new_size << 2) | TF_TSTR_SMALL); // NOLINT - str->u.smll.str[new_size] = '\0'; - - if (curr_type != TF_TSTR_SMALL && copy_size) { - memcpy(str->u.smll.str, curr_ptr, copy_size); - } - - if (curr_type == TF_TSTR_LARGE) { - free((void *)curr_ptr); // NOLINT - } - - // We do not clear out the newly excluded region. - - return str->u.smll.str; - } - - // Case: SMALL/LARGE/VIEW/OFFSET -> LARGE - size_t new_cap; - size_t curr_cap = TF_TString_GetCapacity(str); - // We assume SIZE_MAX % 16 == 0. - size_t curr_cap_x2 = curr_cap >= SIZE_MAX / 2 ? SIZE_MAX - 1 : curr_cap * 2; - - if (new_size < curr_size && new_size < curr_cap / 2) { - // TODO(dero): Replace with shrink_to_fit flag. - new_cap = TF_align16(curr_cap / 2 + 1) - 1; - } else if (new_size > curr_cap_x2) { - new_cap = TF_align16(new_size + 1) - 1; - } else if (new_size > curr_cap) { - new_cap = TF_align16(curr_cap_x2 + 1) - 1; - } else { - new_cap = curr_cap; - } - - char *new_ptr; - if (new_cap == curr_cap) { - new_ptr = str->u.large.ptr; - } else if (curr_type == TF_TSTR_LARGE) { - new_ptr = (char *)realloc(str->u.large.ptr, new_cap + 1); // NOLINT - } else { - new_ptr = (char *)malloc(new_cap + 1); // NOLINT - if (copy_size) { - memcpy(new_ptr, curr_ptr, copy_size); - } - } - - str->u.large.size = TF_TString_ToInternalSizeT(new_size, TF_TSTR_LARGE); - str->u.large.ptr = new_ptr; - str->u.large.ptr[new_size] = '\0'; - str->u.large.cap = new_cap; - - return str->u.large.ptr; -} - -static inline char *TF_TString_GetMutableDataPointer(TF_TString *str) { - switch (TF_TString_GetType(str)) { - case TF_TSTR_SMALL: - return str->u.smll.str; - case TF_TSTR_OFFSET: - case TF_TSTR_VIEW: - // Convert OFFSET/VIEW to SMALL/LARGE - TF_TString_ResizeUninitialized(str, TF_TString_GetSize(str)); - return (TF_TString_GetType(str) == TF_TSTR_SMALL) ? str->u.smll.str - : str->u.large.ptr; - case TF_TSTR_LARGE: - return str->u.large.ptr; - default: - // Unreachable. - return NULL; // NOLINT - } -} - -static inline void TF_TString_Reserve(TF_TString *str, size_t new_cap) { - TF_TString_Type curr_type = TF_TString_GetType(str); - - if (new_cap <= TF_TString_SmallCapacity) { - // We do nothing, we let Resize/GetMutableDataPointer handle the - // conversion to SMALL from VIEW/OFFSET when the need arises. - // In the degenerate case, where new_cap <= TF_TString_SmallCapacity, - // curr_size > TF_TString_SmallCapacity, and the type is VIEW/OFFSET, we - // defer the malloc to Resize/GetMutableDataPointer. - return; - } - - if (curr_type == TF_TSTR_LARGE && new_cap <= str->u.large.cap) { - // We handle reduced cap in resize. - return; - } - - // Case: VIEW/OFFSET -> LARGE or grow an existing LARGE type - size_t curr_size = TF_TString_GetSize(str); - const char *curr_ptr = TF_TString_GetDataPointer(str); - - // Since VIEW and OFFSET types are read-only, their capacity is effectively 0. - // So we make sure we have enough room in the VIEW and OFFSET cases. - new_cap = TF_align16(TF_max(new_cap, curr_size) + 1) - 1; - - if (curr_type == TF_TSTR_LARGE) { - str->u.large.ptr = - (char *)realloc(str->u.large.ptr, new_cap + 1); // NOLINT - } else { - // Convert to Large - char *new_ptr = (char *)malloc(new_cap + 1); // NOLINT - memcpy(new_ptr, curr_ptr, curr_size); - - str->u.large.size = TF_TString_ToInternalSizeT(curr_size, TF_TSTR_LARGE); - str->u.large.ptr = new_ptr; - str->u.large.ptr[curr_size] = '\0'; - } - - str->u.large.cap = new_cap; -} - -static inline char *TF_TString_Resize(TF_TString *str, size_t new_size, - char c) { - size_t curr_size = TF_TString_GetSize(str); - char *cstr = TF_TString_ResizeUninitialized(str, new_size); - - if (new_size > curr_size) { - memset(cstr + curr_size, c, new_size - curr_size); - } - - return cstr; -} - -static inline void TF_TString_AssignView(TF_TString *dst, const char *src, - size_t size) { - TF_TString_Dealloc(dst); - - dst->u.view.size = TF_TString_ToInternalSizeT(size, TF_TSTR_VIEW); - dst->u.view.ptr = src; -} - -static inline void TF_TString_AppendN(TF_TString *dst, const char *src, - size_t src_size) { - if (!src_size) return; - - size_t dst_size = TF_TString_GetSize(dst); - - char *dst_c = TF_TString_ResizeUninitialized(dst, dst_size + src_size); - - memcpy(dst_c + dst_size, src, src_size); -} - -static inline void TF_TString_Append(TF_TString *dst, const TF_TString *src) { - const char *src_c = TF_TString_GetDataPointer(src); - size_t size = TF_TString_GetSize(src); - - TF_TString_AppendN(dst, src_c, size); -} - -static inline void TF_TString_Copy(TF_TString *dst, const char *src, - size_t size) { - char *dst_c = TF_TString_ResizeUninitialized(dst, size); - - if (size) memcpy(dst_c, src, size); -} - -static inline void TF_TString_Assign(TF_TString *dst, const TF_TString *src) { - if (dst == src) return; - - TF_TString_Dealloc(dst); - - switch (TF_TString_GetType(src)) { - case TF_TSTR_SMALL: - case TF_TSTR_VIEW: - *dst = *src; - return; - case TF_TSTR_LARGE: { - const char *src_c = TF_TString_GetDataPointer(src); - size_t size = TF_TString_GetSize(src); - - TF_TString_Copy(dst, src_c, size); - } - return; - case TF_TSTR_OFFSET: { - const char *src_c = TF_TString_GetDataPointer(src); - size_t size = TF_TString_GetSize(src); - - TF_TString_AssignView(dst, src_c, size); - } - return; - default: - return; // Unreachable. - } -} - -static inline void TF_TString_Move(TF_TString *dst, TF_TString *src) { - if (dst == src) return; - - TF_TString_Dealloc(dst); - - switch (TF_TString_GetType(src)) { - case TF_TSTR_SMALL: - case TF_TSTR_VIEW: - *dst = *src; - return; - case TF_TSTR_LARGE: - *dst = *src; - TF_TString_Init(src); - return; - case TF_TSTR_OFFSET: { - const char *src_c = TF_TString_GetDataPointer(src); - size_t size = TF_TString_GetSize(src); - - TF_TString_AssignView(dst, src_c, size); - } - return; - default: - return; // Unreachable. - } -} - -#endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.d.ts deleted file mode 100644 index b3dde449b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.d.ts +++ /dev/null @@ -1,144 +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 { CustomCallback } from '@tensorflow/tfjs'; -export declare const progressBarHelper: { - ProgressBar: any; - log: Function; -}; -/** - * Terminal-based progress bar callback for tf.Model.fit(). - */ -export declare class ProgbarLogger extends CustomCallback { - private numTrainBatchesPerEpoch; - private progressBar; - private currentEpochBegin; - private epochDurationMillis; - private usPerStep; - private batchesInLatestEpoch; - private terminalWidth; - private readonly RENDER_THROTTLE_MS; - /** - * Construtor of LoggingCallback. - */ - constructor(); - private formatLogsAsMetricsContent; - private isFieldRelevant; -} -/** - * Get a succint string representation of a number. - * - * Uses decimal notation if the number isn't too small. - * Otherwise, use engineering notation. - * - * @param x Input number. - * @return Succinct string representing `x`. - */ -export declare function getSuccinctNumberDisplay(x: number): string; -/** - * Determine the number of decimal places to display. - * - * @param x Number to display. - * @return Number of decimal places to display for `x`. - */ -export declare function getDisplayDecimalPlaces(x: number): number; -export interface TensorBoardCallbackArgs { - /** - * The frequency at which loss and metric values are written to logs. - * - * Currently supported options are: - * - * - 'batch': Write logs at the end of every batch of training, in addition - * to the end of every epoch of training. - * - 'epoch': Write logs at the end of every epoch of training. - * - * Note that writing logs too often slows down the training. - * - * Default: 'epoch'. - */ - updateFreq?: 'batch' | 'epoch'; -} -/** - * Callback for logging to TensorBoard during training. - * - * Users are expected to access this class through the `tensorBoardCallback()` - * factory method instead. - */ -export declare class TensorBoardCallback extends CustomCallback { - readonly logdir: string; - private trainWriter; - private valWriter; - private batchesSeen; - private readonly args; - constructor(logdir?: string, args?: TensorBoardCallbackArgs); - private logMetrics; - private ensureTrainWriterCreated; - private ensureValWriterCreated; -} -/** - * Callback for logging to TensorBoard during training. - * - * Writes the loss and metric values (if any) to the specified log directory - * (`logdir`) which can be ingested and visualized by TensorBoard. - * This callback is usually passed as a callback to `tf.Model.fit()` or - * `tf.Model.fitDataset()` calls during model training. The frequency at which - * the values are logged can be controlled with the `updateFreq` field of the - * configuration object (2nd argument). - * - * Usage example: - * ```js - * // Constructor a toy multilayer-perceptron regressor for demo purpose. - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, activation: 'relu', inputShape: [200]})); - * model.add(tf.layers.dense({units: 1})); - * model.compile({ - * loss: 'meanSquaredError', - * optimizer: 'sgd', - * metrics: ['MAE'] - * }); - * - * // Generate some random fake data for demo purpose. - * const xs = tf.randomUniform([10000, 200]); - * const ys = tf.randomUniform([10000, 1]); - * const valXs = tf.randomUniform([1000, 200]); - * const valYs = tf.randomUniform([1000, 1]); - * - * // Start model training process. - * await model.fit(xs, ys, { - * epochs: 100, - * validationData: [valXs, valYs], - * // Add the tensorBoard callback here. - * callbacks: tf.node.tensorBoard('/tmp/fit_logs_1') - * }); - * ``` - * - * Then you can use the following commands to point tensorboard - * to the logdir: - * - * ```sh - * pip install tensorboard # Unless you've already installed it. - * tensorboard --logdir /tmp/fit_logs_1 - * ``` - * - * @param logdir Directory to which the logs will be written. - * @param args Optional configuration arguments. - * @returns An instance of `TensorBoardCallback`, which is a subclass of - * `tf.CustomCallback`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -export declare function tensorBoard(logdir?: string, args?: TensorBoardCallbackArgs): TensorBoardCallback; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.js deleted file mode 100644 index d638be721..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks.js +++ /dev/null @@ -1,371 +0,0 @@ -"use strict"; -/** - * @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 __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var path = require("path"); -var ProgressBar = require("progress"); -var tensorboard_1 = require("./tensorboard"); -// A helper class created for testing with the jasmine `spyOn` method, which -// operates only on member methods of objects. -// tslint:disable-next-line:no-any -exports.progressBarHelper = { - ProgressBar: ProgressBar, - log: console.log -}; -/** - * Terminal-based progress bar callback for tf.Model.fit(). - */ -var ProgbarLogger = /** @class */ (function (_super) { - __extends(ProgbarLogger, _super); - /** - * Construtor of LoggingCallback. - */ - function ProgbarLogger() { - var _this = _super.call(this, { - onTrainBegin: function (logs) { return __awaiter(_this, void 0, void 0, function () { - var samples, batchSize, steps; - return __generator(this, function (_a) { - samples = this.params.samples; - batchSize = this.params.batchSize; - steps = this.params.steps; - if (samples != null || steps != null) { - this.numTrainBatchesPerEpoch = - samples != null ? Math.ceil(samples / batchSize) : steps; - } - else { - // Undetermined number of batches per epoch, e.g., due to - // `fitDataset()` without `batchesPerEpoch`. - this.numTrainBatchesPerEpoch = 0; - } - return [2 /*return*/]; - }); - }); }, - onEpochBegin: function (epoch, logs) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - exports.progressBarHelper.log("Epoch " + (epoch + 1) + " / " + this.params.epochs); - this.currentEpochBegin = tfjs_1.util.now(); - this.epochDurationMillis = null; - this.usPerStep = null; - this.batchesInLatestEpoch = 0; - this.terminalWidth = process.stderr.columns; - return [2 /*return*/]; - }); - }); }, - onBatchEnd: function (batch, logs) { return __awaiter(_this, void 0, void 0, function () { - var maxMetricsStringLength, tickTokens; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.batchesInLatestEpoch++; - if (batch === 0) { - this.progressBar = new exports.progressBarHelper.ProgressBar('eta=:eta :bar :placeholderForLossesAndMetrics', { - width: Math.floor(0.5 * this.terminalWidth), - total: this.numTrainBatchesPerEpoch + 1, - head: ">", - renderThrottle: this.RENDER_THROTTLE_MS - }); - } - maxMetricsStringLength = Math.floor(this.terminalWidth * 0.5 - 12); - tickTokens = { - placeholderForLossesAndMetrics: this.formatLogsAsMetricsContent(logs, maxMetricsStringLength) - }; - if (this.numTrainBatchesPerEpoch === 0) { - // Undetermined number of batches per epoch. - this.progressBar.tick(0, tickTokens); - } - else { - this.progressBar.tick(tickTokens); - } - return [4 /*yield*/, tfjs_1.nextFrame()]; - case 1: - _a.sent(); - if (batch === this.numTrainBatchesPerEpoch - 1) { - this.epochDurationMillis = tfjs_1.util.now() - this.currentEpochBegin; - this.usPerStep = this.params.samples != null ? - this.epochDurationMillis / this.params.samples * 1e3 : - this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; - } - return [2 /*return*/]; - } - }); - }); }, - onEpochEnd: function (epoch, logs) { return __awaiter(_this, void 0, void 0, function () { - var lossesAndMetricsString; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.epochDurationMillis == null) { - // In cases where the number of batches per epoch is not determined, - // the calculation of the per-step duration is done at the end of the - // epoch. N.B., this includes the time spent on validation. - this.epochDurationMillis = tfjs_1.util.now() - this.currentEpochBegin; - this.usPerStep = - this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; - } - this.progressBar.tick({ placeholderForLossesAndMetrics: '' }); - lossesAndMetricsString = this.formatLogsAsMetricsContent(logs); - exports.progressBarHelper.log(this.epochDurationMillis.toFixed(0) + "ms " + - (this.usPerStep.toFixed(0) + "us/step - ") + - ("" + lossesAndMetricsString)); - return [4 /*yield*/, tfjs_1.nextFrame()]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); }, - }) || this; - _this.RENDER_THROTTLE_MS = 50; - return _this; - } - ProgbarLogger.prototype.formatLogsAsMetricsContent = function (logs, maxMetricsLength) { - var metricsContent = ''; - var keys = Object.keys(logs).sort(); - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (this.isFieldRelevant(key)) { - var value = logs[key]; - metricsContent += key + "=" + getSuccinctNumberDisplay(value) + " "; - } - } - if (maxMetricsLength != null && metricsContent.length > maxMetricsLength) { - // Cut off metrics strings that are too long to avoid new lines being - // constantly created. - metricsContent = metricsContent.slice(0, maxMetricsLength - 3) + '...'; - } - return metricsContent; - }; - ProgbarLogger.prototype.isFieldRelevant = function (key) { - return key !== 'batch' && key !== 'size'; - }; - return ProgbarLogger; -}(tfjs_1.CustomCallback)); -exports.ProgbarLogger = ProgbarLogger; -var BASE_NUM_DIGITS = 2; -var MAX_NUM_DECIMAL_PLACES = 4; -/** - * Get a succint string representation of a number. - * - * Uses decimal notation if the number isn't too small. - * Otherwise, use engineering notation. - * - * @param x Input number. - * @return Succinct string representing `x`. - */ -function getSuccinctNumberDisplay(x) { - var decimalPlaces = getDisplayDecimalPlaces(x); - return decimalPlaces > MAX_NUM_DECIMAL_PLACES ? - x.toExponential(BASE_NUM_DIGITS) : - x.toFixed(decimalPlaces); -} -exports.getSuccinctNumberDisplay = getSuccinctNumberDisplay; -/** - * Determine the number of decimal places to display. - * - * @param x Number to display. - * @return Number of decimal places to display for `x`. - */ -function getDisplayDecimalPlaces(x) { - if (!Number.isFinite(x) || x === 0 || x > 1 || x < -1) { - return BASE_NUM_DIGITS; - } - else { - return BASE_NUM_DIGITS - Math.floor(Math.log10(Math.abs(x))); - } -} -exports.getDisplayDecimalPlaces = getDisplayDecimalPlaces; -/** - * Callback for logging to TensorBoard during training. - * - * Users are expected to access this class through the `tensorBoardCallback()` - * factory method instead. - */ -var TensorBoardCallback = /** @class */ (function (_super) { - __extends(TensorBoardCallback, _super); - function TensorBoardCallback(logdir, args) { - if (logdir === void 0) { logdir = './logs'; } - var _this = _super.call(this, { - onBatchEnd: function (batch, logs) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.batchesSeen++; - if (this.args.updateFreq !== 'epoch') { - this.logMetrics(logs, 'batch_', this.batchesSeen); - } - return [2 /*return*/]; - }); - }); }, - onEpochEnd: function (epoch, logs) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.logMetrics(logs, 'epoch_', epoch + 1); - return [2 /*return*/]; - }); - }); }, - onTrainEnd: function (logs) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.trainWriter != null) { - this.trainWriter.flush(); - } - if (this.valWriter != null) { - this.valWriter.flush(); - } - return [2 /*return*/]; - }); - }); } - }) || this; - _this.logdir = logdir; - _this.args = args == null ? {} : args; - if (_this.args.updateFreq == null) { - _this.args.updateFreq = 'epoch'; - } - tfjs_1.util.assert(['batch', 'epoch'].indexOf(_this.args.updateFreq) !== -1, function () { return "Expected updateFreq to be 'batch' or 'epoch', but got " + - ("" + _this.args.updateFreq); }); - _this.batchesSeen = 0; - return _this; - } - TensorBoardCallback.prototype.logMetrics = function (logs, prefix, step) { - for (var key in logs) { - if (key === 'batch' || key === 'size' || key === 'num_steps') { - continue; - } - var VAL_PREFIX = 'val_'; - if (key.startsWith(VAL_PREFIX)) { - this.ensureValWriterCreated(); - var scalarName = prefix + key.slice(VAL_PREFIX.length); - this.valWriter.scalar(scalarName, logs[key], step); - } - else { - this.ensureTrainWriterCreated(); - this.trainWriter.scalar("" + prefix + key, logs[key], step); - } - } - }; - TensorBoardCallback.prototype.ensureTrainWriterCreated = function () { - this.trainWriter = tensorboard_1.summaryFileWriter(path.join(this.logdir, 'train')); - }; - TensorBoardCallback.prototype.ensureValWriterCreated = function () { - this.valWriter = tensorboard_1.summaryFileWriter(path.join(this.logdir, 'val')); - }; - return TensorBoardCallback; -}(tfjs_1.CustomCallback)); -exports.TensorBoardCallback = TensorBoardCallback; -/** - * Callback for logging to TensorBoard during training. - * - * Writes the loss and metric values (if any) to the specified log directory - * (`logdir`) which can be ingested and visualized by TensorBoard. - * This callback is usually passed as a callback to `tf.Model.fit()` or - * `tf.Model.fitDataset()` calls during model training. The frequency at which - * the values are logged can be controlled with the `updateFreq` field of the - * configuration object (2nd argument). - * - * Usage example: - * ```js - * // Constructor a toy multilayer-perceptron regressor for demo purpose. - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, activation: 'relu', inputShape: [200]})); - * model.add(tf.layers.dense({units: 1})); - * model.compile({ - * loss: 'meanSquaredError', - * optimizer: 'sgd', - * metrics: ['MAE'] - * }); - * - * // Generate some random fake data for demo purpose. - * const xs = tf.randomUniform([10000, 200]); - * const ys = tf.randomUniform([10000, 1]); - * const valXs = tf.randomUniform([1000, 200]); - * const valYs = tf.randomUniform([1000, 1]); - * - * // Start model training process. - * await model.fit(xs, ys, { - * epochs: 100, - * validationData: [valXs, valYs], - * // Add the tensorBoard callback here. - * callbacks: tf.node.tensorBoard('/tmp/fit_logs_1') - * }); - * ``` - * - * Then you can use the following commands to point tensorboard - * to the logdir: - * - * ```sh - * pip install tensorboard # Unless you've already installed it. - * tensorboard --logdir /tmp/fit_logs_1 - * ``` - * - * @param logdir Directory to which the logs will be written. - * @param args Optional configuration arguments. - * @returns An instance of `TensorBoardCallback`, which is a subclass of - * `tf.CustomCallback`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -function tensorBoard(logdir, args) { - if (logdir === void 0) { logdir = './logs'; } - return new TensorBoardCallback(logdir, args); -} -exports.tensorBoard = tensorBoard; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.js deleted file mode 100644 index 9f16ac447..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/callbacks_test.js +++ /dev/null @@ -1,391 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var callbacks_1 = require("./callbacks"); -describe('progbarLogger', function () { - // Fake progbar class written for testing. - var FakeProgbar = /** @class */ (function () { - function FakeProgbar(specs, config) { - this.specs = specs; - this.config = config; - this.tickConfigs = []; - } - FakeProgbar.prototype.tick = function (tickConfig) { - this.tickConfigs.push(tickConfig); - }; - return FakeProgbar; - }()); - var originalStderrColumns; - beforeEach(function () { - // In some CI environments, process.stderr.columns has a null value. - originalStderrColumns = process.stderr.columns; - process.stderr.columns = 100; - }); - afterEach(function () { - process.stderr.columns = originalStderrColumns; - }); - it('Model.fit with loss, no metric, no validation, verobse = 1', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, model, numSamples, epochs, batchSize, xs, ys, _i, fakeProgbars_1, fakeProgbar, tickConfigs, i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 10, inputShape: [8], activation: 'relu' })); - model.add(tf.layers.dense({ units: 1 })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd' }); - numSamples = 14; - epochs = 3; - batchSize = 8; - xs = tf.randomNormal([numSamples, 8]); - ys = tf.randomNormal([numSamples, 1]); - return [4 /*yield*/, model.fit(xs, ys, { epochs: epochs, batchSize: batchSize, verbose: 1 })]; - case 1: - _a.sent(); - // A progbar object is created for each epoch. - expect(fakeProgbars.length).toEqual(3); - for (_i = 0, fakeProgbars_1 = fakeProgbars; _i < fakeProgbars_1.length; _i++) { - fakeProgbar = fakeProgbars_1[_i]; - tickConfigs = fakeProgbar.tickConfigs; - // There are ceil(14 / 8) = 2 batchs per epoch. There should be 1 tick - // for epoch batch, plus a tick at the end of the epoch. - expect(tickConfigs.length).toEqual(3); - for (i = 0; i < 2; ++i) { - expect(Object.keys(tickConfigs[i])).toEqual([ - 'placeholderForLossesAndMetrics' - ]); - expect(tickConfigs[i]['placeholderForLossesAndMetrics']) - .toMatch(/^loss=.*/); - } - expect(tickConfigs[2]).toEqual({ placeholderForLossesAndMetrics: '' }); - } - expect(consoleMessages.length).toEqual(6); - expect(consoleMessages[0]).toEqual('Epoch 1 / 3'); - expect(consoleMessages[1]).toMatch(/.*ms .*us\/step - loss=.*/); - expect(consoleMessages[2]).toEqual('Epoch 2 / 3'); - expect(consoleMessages[3]).toMatch(/.*ms .*us\/step - loss=.*/); - expect(consoleMessages[4]).toEqual('Epoch 3 / 3'); - expect(consoleMessages[5]).toMatch(/.*ms .*us\/step - loss=.*/); - return [2 /*return*/]; - } - }); - }); }); - it('Model.fit with loss, metric and validation, verbose = 2', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, model, numSamples, epochs, batchSize, validationSplit, xs, ys, _i, fakeProgbars_2, fakeProgbar, tickConfigs, i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 10, inputShape: [8], activation: 'relu' })); - model.add(tf.layers.dense({ units: 1 })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc'] }); - numSamples = 40; - epochs = 2; - batchSize = 8; - validationSplit = 0.15; - xs = tf.randomNormal([numSamples, 8]); - ys = tf.randomNormal([numSamples, 1]); - return [4 /*yield*/, model.fit(xs, ys, { epochs: epochs, batchSize: batchSize, validationSplit: validationSplit, verbose: 2 })]; - case 1: - _a.sent(); - // A progbar object is created for each epoch. - expect(fakeProgbars.length).toEqual(2); - for (_i = 0, fakeProgbars_2 = fakeProgbars; _i < fakeProgbars_2.length; _i++) { - fakeProgbar = fakeProgbars_2[_i]; - tickConfigs = fakeProgbar.tickConfigs; - // There are 5 batchs per epoch. There should be 1 tick for epoch batch, - // plus a tick at the end of the epoch. - expect(tickConfigs.length).toEqual(6); - for (i = 0; i < 5; ++i) { - expect(Object.keys(tickConfigs[i])).toEqual([ - 'placeholderForLossesAndMetrics' - ]); - expect(tickConfigs[i]['placeholderForLossesAndMetrics']) - .toMatch(/^acc=.* loss=.*/); - } - expect(tickConfigs[5]).toEqual({ placeholderForLossesAndMetrics: '' }); - } - expect(consoleMessages.length).toEqual(4); - expect(consoleMessages[0]).toEqual('Epoch 1 / 2'); - expect(consoleMessages[1]) - .toMatch(/.*ms .*us\/step - acc=.* loss=.* val_acc=.* val_loss=.*/); - expect(consoleMessages[2]).toEqual('Epoch 2 / 2'); - expect(consoleMessages[3]) - .toMatch(/.*ms .*us\/step - acc=.* loss=.* val_acc=.* val_loss=.*/); - return [2 /*return*/]; - } - }); - }); }); - it('Model.fit does not create ProgbarLogger if verbose is 0', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, model, numSamples, epochs, batchSize, validationSplit, xs, ys; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 10, inputShape: [8], activation: 'relu' })); - model.add(tf.layers.dense({ units: 1 })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['acc'] }); - numSamples = 40; - epochs = 2; - batchSize = 8; - validationSplit = 0.15; - xs = tf.randomNormal([numSamples, 8]); - ys = tf.randomNormal([numSamples, 1]); - return [4 /*yield*/, model.fit(xs, ys, { epochs: epochs, batchSize: batchSize, validationSplit: validationSplit, verbose: 0 })]; - case 1: - _a.sent(); - expect(fakeProgbars.length).toEqual(0); - return [2 /*return*/]; - } - }); - }); }); - it('Model.fitDataset: batchesPerEpoch specified, verbose = 1', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, epochs, xDataset, yDataset, dataset, model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - epochs = 2; - xDataset = tf.data.array([[1, 2], [3, 4], [5, 6], [7, 8]]) - .map(function (x) { return tf.tensor2d(x, [1, 2]); }); - yDataset = tf.data.array([[1], [2], [3], [4]]).map(function (y) { return tf.tensor2d(y, [1, 1]); }); - dataset = tf.data.zip({ xs: xDataset, ys: yDataset }).repeat(epochs); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 1, inputShape: [2] })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd' }); - return [4 /*yield*/, model.fitDataset(dataset, { batchesPerEpoch: 4, epochs: epochs, verbose: 1 })]; - case 1: - _a.sent(); - expect(consoleMessages.length).toEqual(4); - expect(consoleMessages[0]).toEqual('Epoch 1 / 2'); - expect(consoleMessages[1]).toMatch(/.*ms .*us\/step - loss=.*/); - expect(consoleMessages[2]).toEqual('Epoch 2 / 2'); - expect(consoleMessages[3]).toMatch(/.*ms .*us\/step - loss=.*/); - return [2 /*return*/]; - } - }); - }); }); - it('Model.fitDataset: batchesPerEpoch unavailable, verbose = 1', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, epochs, xDataset, yDataset, dataset, model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - epochs = 2; - xDataset = tf.data.array([[1, 2], [3, 4], [5, 6], [7, 8]]) - .map(function (x) { return tf.tensor2d(x, [1, 2]); }); - yDataset = tf.data.array([[1], [2], [3], [4]]).map(function (y) { return tf.tensor2d(y, [1, 1]); }); - dataset = tf.data.zip({ xs: xDataset, ys: yDataset }).repeat(epochs); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 1, inputShape: [2] })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd' }); - // `batchesPerEpoch` is not specified. Instead, `fitDataset()` relies on - // the `done` field being `true` to terminate the epoch(s). - return [4 /*yield*/, model.fitDataset(dataset, { epochs: epochs, verbose: 1 })]; - case 1: - // `batchesPerEpoch` is not specified. Instead, `fitDataset()` relies on - // the `done` field being `true` to terminate the epoch(s). - _a.sent(); - expect(consoleMessages.length).toEqual(4); - expect(consoleMessages[0]).toEqual('Epoch 1 / 2'); - expect(consoleMessages[1]).toMatch(/.*ms .*us\/step - loss=.*/); - expect(consoleMessages[2]).toEqual('Epoch 2 / 2'); - expect(consoleMessages[3]).toMatch(/.*ms .*us\/step - loss=.*/); - return [2 /*return*/]; - } - }); - }); }); - it('Model.fitDataset: verbose = 0 leads to no logging', function () { return __awaiter(_this, void 0, void 0, function () { - var fakeProgbars, consoleMessages, xDataset, yDataset, dataset, model, history; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - fakeProgbars = []; - spyOn(callbacks_1.progressBarHelper, 'ProgressBar') - .and.callFake(function (specs, config) { - var fakeProgbar = new FakeProgbar(specs, config); - fakeProgbars.push(fakeProgbar); - return fakeProgbar; - }); - consoleMessages = []; - spyOn(callbacks_1.progressBarHelper, 'log').and.callFake(function (message) { - consoleMessages.push(message); - }); - xDataset = tf.data.array([[1, 2], [3, 4], [5, 6], [7, 8]]) - .map(function (x) { return tf.tensor2d(x, [1, 2]); }); - yDataset = tf.data.array([[1], [2], [3], [4]]).map(function (y) { return tf.tensor2d(y, [1, 1]); }); - dataset = tf.data.zip({ xs: xDataset, ys: yDataset }); - model = tf.sequential(); - model.add(tf.layers.dense({ units: 1, inputShape: [2] })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd' }); - return [4 /*yield*/, model.fitDataset(dataset, { epochs: 1, verbose: 0 })]; - case 1: - history = _a.sent(); - expect(history.history.loss.length).toEqual(1); - expect(consoleMessages.length) - .toEqual(0); // No logging should have happened. - return [2 /*return*/]; - } - }); - }); }); -}); -describe('getSuccinctNumberDisplay', function () { - it('Not finite', function () { - expect(callbacks_1.getSuccinctNumberDisplay(Infinity)).toEqual('Infinity'); - expect(callbacks_1.getSuccinctNumberDisplay(-Infinity)).toEqual('-Infinity'); - expect(callbacks_1.getSuccinctNumberDisplay(NaN)).toEqual('NaN'); - }); - it('zero', function () { - expect(callbacks_1.getSuccinctNumberDisplay(0)).toEqual('0.00'); - }); - it('Finite and positive', function () { - expect(callbacks_1.getSuccinctNumberDisplay(300)).toEqual('300.00'); - expect(callbacks_1.getSuccinctNumberDisplay(30)).toEqual('30.00'); - expect(callbacks_1.getSuccinctNumberDisplay(1)).toEqual('1.00'); - expect(callbacks_1.getSuccinctNumberDisplay(1e-2)).toEqual('0.0100'); - expect(callbacks_1.getSuccinctNumberDisplay(1e-3)).toEqual('1.00e-3'); - expect(callbacks_1.getSuccinctNumberDisplay(4e-3)).toEqual('4.00e-3'); - expect(callbacks_1.getSuccinctNumberDisplay(1e-6)).toEqual('1.00e-6'); - }); - it('Finite and negative', function () { - expect(callbacks_1.getSuccinctNumberDisplay(-300)).toEqual('-300.00'); - expect(callbacks_1.getSuccinctNumberDisplay(-30)).toEqual('-30.00'); - expect(callbacks_1.getSuccinctNumberDisplay(-1)).toEqual('-1.00'); - expect(callbacks_1.getSuccinctNumberDisplay(-1e-2)).toEqual('-0.0100'); - expect(callbacks_1.getSuccinctNumberDisplay(-1e-3)).toEqual('-1.00e-3'); - expect(callbacks_1.getSuccinctNumberDisplay(-4e-3)).toEqual('-4.00e-3'); - expect(callbacks_1.getSuccinctNumberDisplay(-1e-6)).toEqual('-1.00e-6'); - }); -}); -describe('getDisplayDecimalPlaces', function () { - it('Not finite', function () { - expect(callbacks_1.getDisplayDecimalPlaces(Infinity)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(-Infinity)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(NaN)).toEqual(2); - }); - it('zero', function () { - expect(callbacks_1.getDisplayDecimalPlaces(0)).toEqual(2); - }); - it('Finite and positive', function () { - expect(callbacks_1.getDisplayDecimalPlaces(300)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(30)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(1)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(1e-2)).toEqual(4); - expect(callbacks_1.getDisplayDecimalPlaces(1e-3)).toEqual(5); - expect(callbacks_1.getDisplayDecimalPlaces(4e-3)).toEqual(5); - expect(callbacks_1.getDisplayDecimalPlaces(1e-6)).toEqual(8); - }); - it('Finite and negative', function () { - expect(callbacks_1.getDisplayDecimalPlaces(-300)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(-30)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(-1)).toEqual(2); - expect(callbacks_1.getDisplayDecimalPlaces(-1e-2)).toEqual(4); - expect(callbacks_1.getDisplayDecimalPlaces(-1e-3)).toEqual(5); - expect(callbacks_1.getDisplayDecimalPlaces(-4e-3)).toEqual(5); - expect(callbacks_1.getDisplayDecimalPlaces(-1e-6)).toEqual(8); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.js deleted file mode 100644 index ad63b4dbd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/canvas_test.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var MockContext = /** @class */ (function () { - function MockContext() { - } - MockContext.prototype.getImageData = function (x, y, width, height) { - var data = new Uint8ClampedArray(width * height * 4); - for (var i = 0; i < data.length; ++i) { - data[i] = i + 1; - } - return { data: data }; - }; - return MockContext; -}()); -var MockCanvas = /** @class */ (function () { - function MockCanvas(width, height) { - this.width = width; - this.height = height; - } - MockCanvas.prototype.getContext = function (type) { - return new MockContext(); - }; - return MockCanvas; -}()); -describe('tf.browser.fromPixels with polyfills', function () { - it('accepts a canvas-like element', function () { return __awaiter(_this, void 0, void 0, function () { - var c, t, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - c = new MockCanvas(2, 2); - t = tf.browser.fromPixels(c); - expect(t.dtype).toBe('int32'); - expect(t.shape).toEqual([2, 2, 3]); - _b = (_a = tf.test_util).expectArraysEqual; - return [4 /*yield*/, t.data()]; - case 1: - _b.apply(_a, [_c.sent(), [1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15]]); - return [2 /*return*/]; - } - }); - }); }); - it('accepts a canvas-like element, numChannels=4', function () { return __awaiter(_this, void 0, void 0, function () { - var c, t, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - c = new MockCanvas(2, 2); - t = tf.browser.fromPixels(c, 4); - expect(t.dtype).toBe('int32'); - expect(t.shape).toEqual([2, 2, 4]); - _b = (_a = tf.test_util).expectArraysEqual; - return [4 /*yield*/, t.data()]; - case 1: - _b.apply(_a, [_c.sent(), - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]]); - return [2 /*return*/]; - } - }); - }); }); - it('errors when passed a non-canvas object', function () { - var c = 5; - // tslint:disable-next-line:no-any - expect(function () { return tf.browser.fromPixels(c); }) - .toThrowError(/pixels passed to tf\.browser\.fromPixels\(\) must be either an/); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.d.ts deleted file mode 100644 index f7658977d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.d.ts +++ /dev/null @@ -1,163 +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 { Tensor3D, Tensor4D } from '@tensorflow/tfjs'; -export declare enum ImageType { - JPEG = "jpeg", - PNG = "png", - GIF = "gif", - BMP = "BMP" -} -/** - * Decode a JPEG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The JPEG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the JPEG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * @param ratio An optional int. Defaults to 1. Downscaling ratio. It is used - * when image is type Jpeg. - * @param fancyUpscaling An optional bool. Defaults to True. If true use a - * slower but nicer upscaling of the chroma planes. It is used when image is - * type Jpeg. - * @param tryRecoverTruncated An optional bool. Defaults to False. If true try - * to recover an image from truncated input. It is used when image is type - * Jpeg. - * @param acceptableFraction An optional float. Defaults to 1. The minimum - * required fraction of lines before a truncated input is accepted. It is - * used when image is type Jpeg. - * @param dctMethod An optional string. Defaults to "". string specifying a hint - * about the algorithm used for decompression. Defaults to "" which maps to - * a system-specific default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg - * library changes to a version that does not have that specific option.) It - * is used when image is type Jpeg. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function decodeJpeg(contents: Uint8Array, channels?: number, ratio?: number, fancyUpscaling?: boolean, tryRecoverTruncated?: boolean, acceptableFraction?: number, dctMethod?: string): Tensor3D; -/** - * Decode a PNG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The PNG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the PNG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function decodePng(contents: Uint8Array, channels?: number, dtype?: string): Tensor3D; -/** - * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype - * `int32`. - * - * @param contents The BMP-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the BMP-encoded image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function decodeBmp(contents: Uint8Array, channels?: number): Tensor3D; -/** - * Decode the frame(s) of a GIF-encoded image to a 4D Tensor of dtype `int32`. - * - * @param contents The GIF-encoded image in an Uint8Array. - * @returns A 4D Tensor of dtype `int32` with shape [num_frames, height, width, - * 3]. RGB channel order. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function decodeGif(contents: Uint8Array): Tensor4D; -/** - * Given the encoded bytes of an image, it returns a 3D or 4D tensor of the - * decoded image. Supports BMP, GIF, JPEG and PNG formats. - * - * @param content The encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0, use the number of channels in - * the image. Number of color channels for the decoded image. It is used - * when image is type Png, Bmp, or Jpeg. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @param expandAnimations A boolean which controls the shape of the returned - * op's output. If True, the returned op will produce a 3-D tensor for PNG, - * JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or - * not. If, False, the returned op will produce a 3-D tensor for all file - * types and will truncate animated GIFs to the first frame. - * @returns A Tensor with dtype `int32` and a 3- or 4-dimensional shape, - * depending on the file type. For gif file the returned Tensor shape is - * [num_frames, height, width, 3], and for jpeg/png/bmp the returned Tensor - * shape is [height, width, channels] - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function decodeImage(content: Uint8Array, channels?: number, dtype?: string, expandAnimations?: boolean): Tensor3D | Tensor4D; -/** - * Encodes an image tensor to JPEG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param format An optional string from: "", "grayscale", "rgb". - * Defaults to "". Per pixel image format. - * - '': Use a default format based on the number of channels in the image. - * - grayscale: Output a grayscale JPEG image. The channels dimension of - * image must be 1. - * - rgb: Output an RGB JPEG image. The channels dimension of image must - * be 3. - * @param quality An optional int. Defaults to 95. Quality of the compression - * from 0 to 100 (higher is better and slower). - * @param progressive An optional bool. Defaults to False. If True, create a - * JPEG that loads progressively (coarse to fine). - * @param optimizeSize An optional bool. Defaults to False. If True, spend - * CPU/RAM to reduce size with no quality change. - * @param chromaDownsampling An optional bool. Defaults to True. - * See http://en.wikipedia.org/wiki/Chroma_subsampling. - * @param densityUnit An optional string from: "in", "cm". Defaults to "in". - * Unit used to specify x_density and y_density: pixels per inch ('in') or - * centimeter ('cm'). - * @param xDensity An optional int. Defaults to 300. Horizontal pixels per - * density unit. - * @param yDensity An optional int. Defaults to 300. Vertical pixels per - * density unit. - * @param xmpMetadata An optional string. Defaults to "". If not empty, embed - * this XMP metadata in the image header. - * @returns The JPEG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function encodeJpeg(image: Tensor3D, format?: '' | 'grayscale' | 'rgb', quality?: number, progressive?: boolean, optimizeSize?: boolean, chromaDownsampling?: boolean, densityUnit?: 'in' | 'cm', xDensity?: number, yDensity?: number, xmpMetadata?: string): Promise; -/** - * Encodes an image tensor to PNG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param compression An optional int. Defaults to 1. Compression level. - * @returns The PNG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export declare function encodePng(image: Tensor3D, compression?: number): Promise; -/** - * Helper function to get image type based on starting bytes of the image file. - */ -export declare function getImageType(content: Uint8Array): string; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.js deleted file mode 100644 index ab153f23e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image.js +++ /dev/null @@ -1,355 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -var ImageType; -(function (ImageType) { - ImageType["JPEG"] = "jpeg"; - ImageType["PNG"] = "png"; - ImageType["GIF"] = "gif"; - ImageType["BMP"] = "BMP"; -})(ImageType = exports.ImageType || (exports.ImageType = {})); -/** - * Decode a JPEG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The JPEG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the JPEG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * @param ratio An optional int. Defaults to 1. Downscaling ratio. It is used - * when image is type Jpeg. - * @param fancyUpscaling An optional bool. Defaults to True. If true use a - * slower but nicer upscaling of the chroma planes. It is used when image is - * type Jpeg. - * @param tryRecoverTruncated An optional bool. Defaults to False. If true try - * to recover an image from truncated input. It is used when image is type - * Jpeg. - * @param acceptableFraction An optional float. Defaults to 1. The minimum - * required fraction of lines before a truncated input is accepted. It is - * used when image is type Jpeg. - * @param dctMethod An optional string. Defaults to "". string specifying a hint - * about the algorithm used for decompression. Defaults to "" which maps to - * a system-specific default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg - * library changes to a version that does not have that specific option.) It - * is used when image is type Jpeg. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function decodeJpeg(contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, acceptableFraction, dctMethod) { - if (channels === void 0) { channels = 0; } - if (ratio === void 0) { ratio = 1; } - if (fancyUpscaling === void 0) { fancyUpscaling = true; } - if (tryRecoverTruncated === void 0) { tryRecoverTruncated = false; } - if (acceptableFraction === void 0) { acceptableFraction = 1; } - if (dctMethod === void 0) { dctMethod = ''; } - nodejs_kernel_backend_1.ensureTensorflowBackend(); - return tfjs_1.tidy(function () { - return nodejs_kernel_backend_1.nodeBackend() - .decodeJpeg(contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, acceptableFraction, dctMethod) - .toInt(); - }); -} -exports.decodeJpeg = decodeJpeg; -/** - * Decode a PNG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The PNG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the PNG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function decodePng(contents, channels, dtype) { - if (channels === void 0) { channels = 0; } - if (dtype === void 0) { dtype = 'int32'; } - tfjs_1.util.assert(dtype === 'int32', function () { return 'decodeImage could only return Tensor of type `int32` for now.'; }); - nodejs_kernel_backend_1.ensureTensorflowBackend(); - return tfjs_1.tidy(function () { - return nodejs_kernel_backend_1.nodeBackend().decodePng(contents, channels).toInt(); - }); -} -exports.decodePng = decodePng; -/** - * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype - * `int32`. - * - * @param contents The BMP-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the BMP-encoded image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function decodeBmp(contents, channels) { - if (channels === void 0) { channels = 0; } - nodejs_kernel_backend_1.ensureTensorflowBackend(); - return tfjs_1.tidy(function () { - return nodejs_kernel_backend_1.nodeBackend().decodeBmp(contents, channels).toInt(); - }); -} -exports.decodeBmp = decodeBmp; -/** - * Decode the frame(s) of a GIF-encoded image to a 4D Tensor of dtype `int32`. - * - * @param contents The GIF-encoded image in an Uint8Array. - * @returns A 4D Tensor of dtype `int32` with shape [num_frames, height, width, - * 3]. RGB channel order. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function decodeGif(contents) { - nodejs_kernel_backend_1.ensureTensorflowBackend(); - return tfjs_1.tidy(function () { - return nodejs_kernel_backend_1.nodeBackend().decodeGif(contents).toInt(); - }); -} -exports.decodeGif = decodeGif; -/** - * Given the encoded bytes of an image, it returns a 3D or 4D tensor of the - * decoded image. Supports BMP, GIF, JPEG and PNG formats. - * - * @param content The encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0, use the number of channels in - * the image. Number of color channels for the decoded image. It is used - * when image is type Png, Bmp, or Jpeg. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @param expandAnimations A boolean which controls the shape of the returned - * op's output. If True, the returned op will produce a 3-D tensor for PNG, - * JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or - * not. If, False, the returned op will produce a 3-D tensor for all file - * types and will truncate animated GIFs to the first frame. - * @returns A Tensor with dtype `int32` and a 3- or 4-dimensional shape, - * depending on the file type. For gif file the returned Tensor shape is - * [num_frames, height, width, 3], and for jpeg/png/bmp the returned Tensor - * shape is [height, width, channels] - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function decodeImage(content, channels, dtype, expandAnimations) { - if (channels === void 0) { channels = 0; } - if (dtype === void 0) { dtype = 'int32'; } - if (expandAnimations === void 0) { expandAnimations = true; } - tfjs_1.util.assert(dtype === 'int32', function () { return 'decodeImage could only return Tensor of type `int32` for now.'; }); - var imageType = getImageType(content); - // The return tensor has dtype uint8, which is not supported in - // TensorFlow.js, casting it to int32 which is the default dtype for image - // tensor. If the image is BMP, JPEG or PNG type, expanding the tensors - // shape so it becomes Tensor4D, which is the default tensor shape for image - // ([batch,imageHeight,imageWidth, depth]). - switch (imageType) { - case ImageType.JPEG: - return decodeJpeg(content, channels); - case ImageType.PNG: - return decodePng(content, channels); - case ImageType.GIF: - // If not to expand animations, take first frame of the gif and return - // as a 3D tensor. - return tfjs_1.tidy(function () { - var img = decodeGif(content); - return expandAnimations ? img : img.slice(0, 1).squeeze([0]); - }); - case ImageType.BMP: - return decodeBmp(content, channels); - default: - return null; - } -} -exports.decodeImage = decodeImage; -/** - * Encodes an image tensor to JPEG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param format An optional string from: "", "grayscale", "rgb". - * Defaults to "". Per pixel image format. - * - '': Use a default format based on the number of channels in the image. - * - grayscale: Output a grayscale JPEG image. The channels dimension of - * image must be 1. - * - rgb: Output an RGB JPEG image. The channels dimension of image must - * be 3. - * @param quality An optional int. Defaults to 95. Quality of the compression - * from 0 to 100 (higher is better and slower). - * @param progressive An optional bool. Defaults to False. If True, create a - * JPEG that loads progressively (coarse to fine). - * @param optimizeSize An optional bool. Defaults to False. If True, spend - * CPU/RAM to reduce size with no quality change. - * @param chromaDownsampling An optional bool. Defaults to True. - * See http://en.wikipedia.org/wiki/Chroma_subsampling. - * @param densityUnit An optional string from: "in", "cm". Defaults to "in". - * Unit used to specify x_density and y_density: pixels per inch ('in') or - * centimeter ('cm'). - * @param xDensity An optional int. Defaults to 300. Horizontal pixels per - * density unit. - * @param yDensity An optional int. Defaults to 300. Vertical pixels per - * density unit. - * @param xmpMetadata An optional string. Defaults to "". If not empty, embed - * this XMP metadata in the image header. - * @returns The JPEG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function encodeJpeg(image, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata) { - if (format === void 0) { format = ''; } - if (quality === void 0) { quality = 95; } - if (progressive === void 0) { progressive = false; } - if (optimizeSize === void 0) { optimizeSize = false; } - if (chromaDownsampling === void 0) { chromaDownsampling = true; } - if (densityUnit === void 0) { densityUnit = 'in'; } - if (xDensity === void 0) { xDensity = 300; } - if (yDensity === void 0) { yDensity = 300; } - if (xmpMetadata === void 0) { xmpMetadata = ''; } - return __awaiter(this, void 0, void 0, function () { - var backendEncodeImage; - return __generator(this, function (_a) { - nodejs_kernel_backend_1.ensureTensorflowBackend(); - backendEncodeImage = function (imageData) { - return nodejs_kernel_backend_1.nodeBackend().encodeJpeg(imageData, image.shape, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata); - }; - return [2 /*return*/, encodeImage(image, backendEncodeImage)]; - }); - }); -} -exports.encodeJpeg = encodeJpeg; -/** - * Encodes an image tensor to PNG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param compression An optional int. Defaults to 1. Compression level. - * @returns The PNG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -function encodePng(image, compression) { - if (compression === void 0) { compression = 1; } - return __awaiter(this, void 0, void 0, function () { - var backendEncodeImage; - return __generator(this, function (_a) { - nodejs_kernel_backend_1.ensureTensorflowBackend(); - backendEncodeImage = function (imageData) { - return nodejs_kernel_backend_1.nodeBackend().encodePng(imageData, image.shape, compression); - }; - return [2 /*return*/, encodeImage(image, backendEncodeImage)]; - }); - }); -} -exports.encodePng = encodePng; -function encodeImage(image, backendEncodeImage) { - return __awaiter(this, void 0, void 0, function () { - var encodedDataTensor, _a, _b, encodedPngData; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = backendEncodeImage; - _b = Uint8Array.bind; - return [4 /*yield*/, image.data()]; - case 1: - encodedDataTensor = _a.apply(void 0, [new (_b.apply(Uint8Array, [void 0, _c.sent()]))()]); - // tslint:disable-next-line:no-any - return [4 /*yield*/, encodedDataTensor.data()]; - case 2: - encodedPngData = ( - // tslint:disable-next-line:no-any - _c.sent())[0]; - encodedDataTensor.dispose(); - return [2 /*return*/, encodedPngData]; - } - }); - }); -} -/** - * Helper function to get image type based on starting bytes of the image file. - */ -function getImageType(content) { - // Classify the contents of a file based on starting bytes (aka magic number: - // https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) - // This aligns with TensorFlow Core code: - // https://github.com/tensorflow/tensorflow/blob/4213d5c1bd921f8d5b7b2dc4bbf1eea78d0b5258/tensorflow/core/kernels/decode_image_op.cc#L44 - if (content.length > 3 && content[0] === 255 && content[1] === 216 && - content[2] === 255) { - // JPEG byte chunk starts with `ff d8 ff` - return ImageType.JPEG; - } - else if (content.length > 4 && content[0] === 71 && content[1] === 73 && - content[2] === 70 && content[3] === 56) { - // GIF byte chunk starts with `47 49 46 38` - return ImageType.GIF; - } - else if (content.length > 8 && content[0] === 137 && content[1] === 80 && - content[2] === 78 && content[3] === 71 && content[4] === 13 && - content[5] === 10 && content[6] === 26 && content[7] === 10) { - // PNG byte chunk starts with `\211 P N G \r \n \032 \n (89 50 4E 47 0D 0A - // 1A 0A)` - return ImageType.PNG; - } - else if (content.length > 3 && content[0] === 66 && content[1] === 77) { - // BMP byte chunk starts with `42 4d` - return ImageType.BMP; - } - else { - throw new Error('Expected image (BMP, JPEG, PNG, or GIF), but got unsupported ' + - 'image type'); - } -} -exports.getImageType = getImageType; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.d.ts deleted file mode 100644 index cb0ff5c3b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.js deleted file mode 100644 index 0c8320b8c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/image_test.js +++ /dev/null @@ -1,560 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * @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. - * ============================================================================= - */ -var tfjs_1 = require("@tensorflow/tfjs"); -// tslint:disable-next-line: no-imports-from-dist -var jasmine_util_1 = require("@tensorflow/tfjs-core/dist/jasmine_util"); -var fs = require("fs"); -var util_1 = require("util"); -var image_1 = require("./image"); -var tf = require("./index"); -var readFile = util_1.promisify(fs.readFile); -describe('decode images', function () { - it('decode png', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_test.png')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodePng(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode png 1 channels', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_test.png')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array, 1); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 1]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), [130, 50, 59, 124]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode png 3 channels', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_test.png')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode png 4 channels', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_4_channel_test.png')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array, 4); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 4]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), [ - 238, 101, 0, 255, 50, 50, 50, 255, 100, 50, 0, 255, 200, 100, 50, 255 - ]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode bmp', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_bmp_test.bmp')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeBmp(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode bmp through decodeImage', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_bmp_test.bmp')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode jpg', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_jpeg_test.jpeg')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeJpeg(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode jpg 1 channel', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_jpeg_test.jpeg')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array, 1); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 1]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), [130, 47, 56, 121]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode jpg 3 channels', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_jpeg_test.jpeg')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array, 3); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode jpg with 0 channels, use the number of channels in the ' + - 'JPEG-encoded image', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_jpeg_test.jpeg')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode jpg with downscale', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_jpeg_test.jpeg')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeJpeg(uint8array, 0, 2); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([1, 1, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), [147, 75, 25]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode gif', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/gif_test.gif')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), [ - 238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50, - 200, 100, 50, 34, 68, 102, 170, 0, 102, 255, 255, 255 - ]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('decode gif with no expandAnimation', function () { return __awaiter(_this, void 0, void 0, function () { - var beforeNumTensors, uint8array, imageTensor, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/gif_test.gif')]; - case 1: - uint8array = _c.sent(); - imageTensor = tf.node.decodeImage(uint8array, 3, 'int32', false); - expect(imageTensor.dtype).toBe('int32'); - expect(imageTensor.shape).toEqual([2, 2, 3]); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 2: - _b.apply(_a, [_c.sent(), - [238, 101, 0, 50, 50, 50, 100, 50, 0, 200, 100, 50]]); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors + 1); - return [2 /*return*/]; - } - }); - }); }); - it('throw error if request non int32 dtype', function (done) { return __awaiter(_this, void 0, void 0, function () { - var uint8array, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_test.png')]; - case 1: - uint8array = _a.sent(); - tf.node.decodeImage(uint8array, 0, 'uint8'); - done.fail(); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - expect(error_1.message) - .toBe('decodeImage could only return Tensor of type `int32` for now.'); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - it('throw error if decode invalid image type', function (done) { return __awaiter(_this, void 0, void 0, function () { - var uint8array, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, getUint8ArrayFromImage('package.json')]; - case 1: - uint8array = _a.sent(); - tf.node.decodeImage(uint8array); - done.fail(); - return [3 /*break*/, 3]; - case 2: - error_2 = _a.sent(); - expect(error_2.message) - .toBe('Expected image (BMP, JPEG, PNG, or GIF), ' + - 'but got unsupported image type'); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - it('throw error if backend is not tensorflow', function (done) { return __awaiter(_this, void 0, void 0, function () { - var testBackend_1, uint8array, err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - testBackend_1 = new jasmine_util_1.TestKernelBackend(); - tfjs_1.registerBackend('fake', function () { return testBackend_1; }); - tfjs_1.setBackend('fake'); - return [4 /*yield*/, getUint8ArrayFromImage('test_objects/images/image_png_test.png')]; - case 1: - uint8array = _a.sent(); - tf.node.decodeImage(uint8array); - done.fail(); - return [3 /*break*/, 3]; - case 2: - err_1 = _a.sent(); - expect(err_1.message) - .toBe('Expect the current backend to be "tensorflow", but got "fake"'); - tfjs_1.setBackend('tensorflow'); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); -}); -describe('encode images', function () { - it('encodeJpeg', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, beforeNumTensors, jpegEncodedData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]), [2, 2, 3]); - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodeJpeg(imageTensor)]; - case 1: - jpegEncodedData = _a.sent(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(jpegEncodedData)).toEqual(image_1.ImageType.JPEG); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('encodeJpeg grayscale', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, beforeNumTensors, jpegEncodedData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 0, 47, 0]), [2, 2, 1]); - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodeJpeg(imageTensor, 'grayscale')]; - case 1: - jpegEncodedData = _a.sent(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(jpegEncodedData)).toEqual(image_1.ImageType.JPEG); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('encodeJpeg with parameters', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity, beforeNumTensors, jpegEncodedData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]), [2, 2, 3]); - format = 'rgb'; - quality = 50; - progressive = true; - optimizeSize = true; - chromaDownsampling = false; - densityUnit = 'cm'; - xDensity = 500; - yDensity = 500; - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodeJpeg(imageTensor, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity)]; - case 1: - jpegEncodedData = _a.sent(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(jpegEncodedData)).toEqual(image_1.ImageType.JPEG); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('encodePng', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, beforeNumTensors, pngEncodedData, pngDecodedTensor, pngDecodedData, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]), [2, 2, 3]); - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodePng(imageTensor)]; - case 1: - pngEncodedData = _c.sent(); - return [4 /*yield*/, tf.node.decodePng(pngEncodedData)]; - case 2: - pngDecodedTensor = _c.sent(); - return [4 /*yield*/, pngDecodedTensor.data()]; - case 3: - pngDecodedData = _c.sent(); - pngDecodedTensor.dispose(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(pngEncodedData)).toEqual(image_1.ImageType.PNG); - _b = (_a = tfjs_1.test_util).expectArraysEqual; - return [4 /*yield*/, imageTensor.data()]; - case 4: - _b.apply(_a, [_c.sent(), pngDecodedData]); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('encodePng grayscale', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, beforeNumTensors, pngEncodedData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 0, 47, 0]), [2, 2, 1]); - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodePng(imageTensor)]; - case 1: - pngEncodedData = _a.sent(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(pngEncodedData)).toEqual(image_1.ImageType.PNG); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('encodePng with parameters', function () { return __awaiter(_this, void 0, void 0, function () { - var imageTensor, compression, beforeNumTensors, pngEncodedData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - imageTensor = tf.tensor3d(new Uint8Array([239, 100, 0, 46, 48, 47, 92, 49, 0, 194, 98, 47]), [2, 2, 3]); - compression = 4; - beforeNumTensors = tfjs_1.memory().numTensors; - return [4 /*yield*/, tf.node.encodePng(imageTensor, compression)]; - case 1: - pngEncodedData = _a.sent(); - expect(tfjs_1.memory().numTensors).toBe(beforeNumTensors); - expect(image_1.getImageType(pngEncodedData)).toEqual(image_1.ImageType.PNG); - imageTensor.dispose(); - return [2 /*return*/]; - } - }); - }); }); -}); -function getUint8ArrayFromImage(path) { - return __awaiter(this, void 0, void 0, function () { - var image, buf; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, readFile(path)]; - case 1: - image = _a.sent(); - buf = Buffer.from(image); - return [2 /*return*/, new Uint8Array(buf)]; - } - }); - }); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.d.ts deleted file mode 100644 index c180dd4e3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.d.ts +++ /dev/null @@ -1,55 +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 './register_all_kernels'; -import * as tf from '@tensorflow/tfjs'; -import * as nodeIo from './io/index'; -export declare const version: { - 'tfjs-node': string; - 'tfjs-core': string; - 'tfjs-backend-cpu': string; - 'tfjs-backend-webgl': string; - 'tfjs-data': string; - 'tfjs-layers': string; - 'tfjs-converter': string; - 'tfjs': string; -}; -export declare const io: { - fileSystem: typeof nodeIo.fileSystem; - nodeHTTPRequest: typeof nodeIo.nodeHTTPRequest; - copyModel: typeof import("@tensorflow/tfjs-core/dist/io/model_management").copyModel; - listModels: typeof import("@tensorflow/tfjs-core/dist/io/model_management").listModels; - moveModel: typeof import("@tensorflow/tfjs-core/dist/io/model_management").moveModel; - removeModel: typeof import("@tensorflow/tfjs-core/dist/io/model_management").removeModel; - browserFiles: typeof import("@tensorflow/tfjs-core/dist/io/browser_files").browserFiles; - browserHTTPRequest: typeof import("@tensorflow/tfjs-core/dist/io/http").browserHTTPRequest; - concatenateArrayBuffers: typeof import("@tensorflow/tfjs-core/dist/io/io_utils").concatenateArrayBuffers; - decodeWeights: typeof import("@tensorflow/tfjs-core/dist/io/io_utils").decodeWeights; - encodeWeights: typeof import("@tensorflow/tfjs-core/dist/io/io_utils").encodeWeights; - fromMemory: typeof import("@tensorflow/tfjs-core/dist/io/passthrough").fromMemory; - getLoadHandlers: (url: string | string[], loadOptions?: tf.io.LoadOptions) => tf.io.IOHandler[]; - getModelArtifactsInfoForJSON: typeof import("@tensorflow/tfjs-core/dist/io/io_utils").getModelArtifactsInfoForJSON; - getSaveHandlers: (url: string | string[]) => tf.io.IOHandler[]; - http: typeof import("@tensorflow/tfjs-core/dist/io/http").http; - isHTTPScheme: typeof import("@tensorflow/tfjs-core/dist/io/http").isHTTPScheme; - loadWeights: typeof import("@tensorflow/tfjs-core/dist/io/weights_loader").loadWeights; - registerLoadRouter: (loudRouter: import("@tensorflow/tfjs-core/dist/io/router_registry").IORouter) => void; - registerSaveRouter: (loudRouter: import("@tensorflow/tfjs-core/dist/io/router_registry").IORouter) => void; - weightsLoaderFactory: typeof import("@tensorflow/tfjs-core/dist/io/weights_loader").weightsLoaderFactory; - withSaveHandler: typeof import("@tensorflow/tfjs-core/dist/io/passthrough").withSaveHandler; -}; -export * from '@tensorflow/tfjs'; -export * from './node'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.js deleted file mode 100644 index 8c8ec0dd5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -/** - * @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 __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -// Register all kernels. -require("./register_all_kernels"); -var tf = require("@tensorflow/tfjs"); -var path = require("path"); -var callbacks_1 = require("./callbacks"); -var file_system_1 = require("./io/file_system"); -var nodeIo = require("./io/index"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -var nodeVersion = require("./version"); -// tslint:disable-next-line:no-require-imports -var binary = require('node-pre-gyp'); -var bindingPath = binary.find(path.resolve(path.join(__dirname, '/../package.json'))); -// Check if the node native addon module exists. -// tslint:disable-next-line:no-require-imports -var fs = require('fs'); -if (!fs.existsSync(bindingPath)) { - throw new Error("The Node.js native addon module (tfjs_binding.node) can not " + - "be found at path: " + String(bindingPath) + ". \nPlease run command " + - "'npm rebuild @tensorflow/tfjs-node" + - (String(bindingPath).indexOf('tfjs-node-gpu') > 0 ? "-gpu" : "") + - " --build-addon-from-source' to " + - "rebuild the native addon module. \nIf you have problem with building " + - "the addon module, please check " + - "https://github.com/tensorflow/tfjs/blob/master/tfjs-node/" + - "WINDOWS_TROUBLESHOOTING.md or file an issue."); -} -// tslint:disable-next-line:no-require-imports -var bindings = require(bindingPath); -// Merge version and io namespaces. -exports.version = __assign({}, tf.version, { 'tfjs-node': nodeVersion.version }); -exports.io = __assign({}, tf.io, nodeIo); -// Export all union package symbols -__export(require("@tensorflow/tfjs")); -__export(require("./node")); -// tslint:disable-next-line:no-require-imports -var pjson = require('../package.json'); -// Side effects for default initialization of Node backend. -tf.registerBackend('tensorflow', function () { - return new nodejs_kernel_backend_1.NodeJSKernelBackend(bindings, pjson.name); -}, 3 /* priority */); -var success = tf.setBackend('tensorflow'); -if (!success) { - throw new Error("Could not initialize TensorFlow backend."); -} -// Register the model saving and loading handlers for the 'file://' URL scheme. -tf.io.registerLoadRouter(file_system_1.nodeFileSystemRouter); -tf.io.registerSaveRouter(file_system_1.nodeFileSystemRouter); -// Register the ProgbarLogger for Model.fit() at verbosity level 1. -tf.registerCallbackConstructor(1, callbacks_1.ProgbarLogger); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.js deleted file mode 100644 index ab1bacda4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/index_test.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("./index"); -describe('Ops are exported from index and work', function () { - it('tf.mul works', function () { return __awaiter(_this, void 0, void 0, function () { - var a, b, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - a = tf.tensor1d([1, 2, 3]); - b = tf.tensor1d([3, 4, 5]); - _b = (_a = tf.test_util).expectArraysClose; - return [4 /*yield*/, a.mul(b).data()]; - case 1: - _b.apply(_a, [_c.sent(), [3, 8, 15]]); - return [2 /*return*/]; - } - }); - }); }); -}); -describe('packages merge', function () { - it('versions', function () { - expect(tf.version['tfjs']).toBeDefined(); - expect(tf.version['tfjs-core']).toBeDefined(); - var expectedNodeVersion = - // tslint:disable-next-line:no-require-imports - require('../package.json').version; - expect(tf.version['tfjs-node']).toBe(expectedNodeVersion); - }); - it('symbols merge', function () { - expect(tf.mul).toBeDefined(); - expect(tf.layers.dense).toBeDefined(); - expect(tf.io.listModels).toBeDefined(); - expect(tf.io.nodeHTTPRequest).toBeDefined(); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.d.ts deleted file mode 100644 index 4929310b8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.d.ts +++ /dev/null @@ -1,45 +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 { Shape } from '@tensorflow/tfjs'; -/** - * Node.js-specific tensor type: int64-type scalar. - * - * This class is created for a specific purpose: to support - * writing `step`s to TensorBoard via op-kernel bindings. - * `step` is required to have an int64 dtype, but TensorFlow.js - * (tfjs-core) doesn't have a built-in int64 dtype. This is - * related to a lack of `Int64Array` or `Uint64Array` typed - * array in basic JavaScript. - * - * This class is introduced as a workaround. - */ -export declare class Int64Scalar { - readonly value: number; - readonly dtype: string; - readonly rank: number; - private valueArray_; - private static endiannessOkay_; - constructor(value: number); - readonly shape: Shape; - /** Get the Int32Array that represents the int64 value. */ - readonly valueArray: Int32Array; -} -/** - * This method encodes a Int32Array as Int64 layout in order to create TF_INT64 - * tensor through binding. - */ -export declare function encodeInt32ArrayAsInt64(value: Int32Array): Int32Array; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.js deleted file mode 100644 index 3cccb15ff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var os_1 = require("os"); -var INT32_MAX = 2147483648; -/** - * Node.js-specific tensor type: int64-type scalar. - * - * This class is created for a specific purpose: to support - * writing `step`s to TensorBoard via op-kernel bindings. - * `step` is required to have an int64 dtype, but TensorFlow.js - * (tfjs-core) doesn't have a built-in int64 dtype. This is - * related to a lack of `Int64Array` or `Uint64Array` typed - * array in basic JavaScript. - * - * This class is introduced as a workaround. - */ -var Int64Scalar = /** @class */ (function () { - function Int64Scalar(value) { - this.value = value; - this.dtype = 'int64'; - this.rank = 1; - // The reason why we need to check endianness of the machine here is - // negative int64 values and the way in which we represent them - // using Int32Arrays in JavaScript. We represent each int64 value with - // two consecutive elements of an Int32Array. For positive values, - // the high part is simply zero; for negative values, the high part - // should be -1. The ordering of the low and high parts assumes - // little endian (i.e., least significant digits appear first). - // This assumption is checked by the lines below. - if (Int64Scalar.endiannessOkay_ == null) { - if (os_1.endianness() !== 'LE') { - throw new Error("Int64Scalar does not support endianness of this machine: " + - ("" + os_1.endianness())); - } - Int64Scalar.endiannessOkay_ = true; - } - tfjs_1.util.assert(value > -INT32_MAX && value < INT32_MAX - 1, function () { - return "Got a value outside of the bound of values supported for int64 " + - ("dtype ([-" + INT32_MAX + ", " + (INT32_MAX - 1) + "]): " + value); - }); - tfjs_1.util.assert(Number.isInteger(value), function () { return "Expected value to be an integer, but got " + value; }); - // We use two int32 elements to represent a int64 value. This assumes - // little endian, which is checked above. - var highPart = value >= 0 ? 0 : -1; - var lowPart = value % INT32_MAX; - this.valueArray_ = new Int32Array([lowPart, highPart]); - } - Object.defineProperty(Int64Scalar.prototype, "shape", { - get: function () { - return []; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Int64Scalar.prototype, "valueArray", { - /** Get the Int32Array that represents the int64 value. */ - get: function () { - return this.valueArray_; - }, - enumerable: true, - configurable: true - }); - return Int64Scalar; -}()); -exports.Int64Scalar = Int64Scalar; -/** - * This method encodes a Int32Array as Int64 layout in order to create TF_INT64 - * tensor through binding. - */ -function encodeInt32ArrayAsInt64(value) { - if (os_1.endianness() !== 'LE') { - throw new Error("Int64Scalar does not support endianness of this machine: " + - ("" + os_1.endianness())); - } - var buffer = new Int32Array(value.length * 2); - for (var i = 0; i < value.length; i++) { - buffer[i * 2] = value[i]; - } - return buffer; -} -exports.encodeInt32ArrayAsInt64 = encodeInt32ArrayAsInt64; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.js deleted file mode 100644 index 2f3e904a6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/int64_tensors_test.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var int64_tensors_1 = require("./int64_tensors"); -describe('int64 tensors', function () { - it('positive value', function () { - var x = new int64_tensors_1.Int64Scalar(42); - expect(x.dtype).toEqual('int64'); - var valueArray = x.valueArray; - expect(valueArray.constructor.name).toEqual('Int32Array'); - expect(valueArray.length).toEqual(2); - expect(valueArray[0]).toEqual(42); - expect(valueArray[1]).toEqual(0); - }); - it('zero value', function () { - var x = new int64_tensors_1.Int64Scalar(0); - expect(x.dtype).toEqual('int64'); - var valueArray = x.valueArray; - expect(valueArray.constructor.name).toEqual('Int32Array'); - expect(valueArray.length).toEqual(2); - expect(valueArray[0]).toEqual(0); - expect(valueArray[1]).toEqual(0); - }); - it('negative value', function () { - var x = new int64_tensors_1.Int64Scalar(-3); - expect(x.dtype).toEqual('int64'); - var valueArray = x.valueArray; - expect(valueArray.constructor.name).toEqual('Int32Array'); - expect(valueArray.length).toEqual(2); - expect(valueArray[0]).toEqual(-3); - expect(valueArray[1]).toEqual(-1); - }); - it('Non-integer value leads to error', function () { - expect(function () { return new int64_tensors_1.Int64Scalar(0.4); }).toThrowError(/integer/); - expect(function () { return new int64_tensors_1.Int64Scalar(-3.2); }).toThrowError(/integer/); - }); - it('Out-of-bound value leads to error', function () { - expect(function () { return new int64_tensors_1.Int64Scalar(2147483648); }).toThrowError(/bound/); - expect(function () { return new int64_tensors_1.Int64Scalar(2147483648 * 2); }).toThrowError(/bound/); - expect(function () { return new int64_tensors_1.Int64Scalar(-2147483648 - 1); }).toThrowError(/bound/); - }); - it('encode int32array as int64 layout', function () { - var input = Int32Array.from([2, 10]); - var valueArray = int64_tensors_1.encodeInt32ArrayAsInt64(input); - expect(valueArray.length).toEqual(4); - expect(valueArray[0]).toEqual(2); - expect(valueArray[1]).toEqual(0); - expect(valueArray[2]).toEqual(10); - expect(valueArray[3]).toEqual(0); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.d.ts deleted file mode 100644 index 46058af46..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.d.ts +++ /dev/null @@ -1,74 +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'; -export declare class NodeFileSystem implements tf.io.IOHandler { - static readonly URL_SCHEME = "file://"; - protected readonly path: string | string[]; - readonly MODEL_JSON_FILENAME = "model.json"; - readonly WEIGHTS_BINARY_FILENAME = "weights.bin"; - readonly MODEL_BINARY_FILENAME = "tensorflowjs.pb"; - /** - * Constructor of the NodeFileSystem IOHandler. - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ - constructor(path: string | string[]); - save(modelArtifacts: tf.io.ModelArtifacts): Promise; - load(): Promise; - protected loadBinaryModel(): Promise; - protected loadJSONModel(): Promise; - private loadWeights; - /** - * For each item in `this.path`, creates a directory at the path or verify - * that the path exists as a directory. - */ - protected createOrVerifyDirectory(): Promise; -} -export declare const nodeFileSystemRouter: (url: string | string[]) => NodeFileSystem; -/** - * Factory function for Node.js native file system IO Handler. - * - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ -export declare function fileSystem(path: string | string[]): NodeFileSystem; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.js deleted file mode 100644 index ab00112e9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system.js +++ /dev/null @@ -1,383 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var fs = require("fs"); -var path_1 = require("path"); -var util_1 = require("util"); -var io_utils_1 = require("./io_utils"); -var stat = util_1.promisify(fs.stat); -var writeFile = util_1.promisify(fs.writeFile); -var readFile = util_1.promisify(fs.readFile); -var mkdir = util_1.promisify(fs.mkdir); -function doesNotExistHandler(name) { - return function (e) { - switch (e.code) { - case 'ENOENT': - throw new Error(name + " " + e.path + " does not exist: loading failed"); - default: - throw e; - } - }; -} -var NodeFileSystem = /** @class */ (function () { - /** - * Constructor of the NodeFileSystem IOHandler. - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ - function NodeFileSystem(path) { - this.MODEL_JSON_FILENAME = 'model.json'; - this.WEIGHTS_BINARY_FILENAME = 'weights.bin'; - this.MODEL_BINARY_FILENAME = 'tensorflowjs.pb'; - if (Array.isArray(path)) { - tf.util.assert(path.length === 2, function () { return 'file paths must have a length of 2, ' + - ("(actual length is " + path.length + ")."); }); - this.path = path.map(function (p) { return path_1.resolve(p); }); - } - else { - this.path = path_1.resolve(path); - } - } - NodeFileSystem.prototype.save = function (modelArtifacts) { - return __awaiter(this, void 0, void 0, function () { - var weightsBinPath, weightsManifest, modelJSON, modelJSONPath; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (Array.isArray(this.path)) { - throw new Error('Cannot perform saving to multiple paths.'); - } - return [4 /*yield*/, this.createOrVerifyDirectory()]; - case 1: - _a.sent(); - if (!(modelArtifacts.modelTopology instanceof ArrayBuffer)) return [3 /*break*/, 2]; - throw new Error('NodeFileSystem.save() does not support saving model topology ' + - 'in binary format yet.'); - case 2: - weightsBinPath = path_1.join(this.path, this.WEIGHTS_BINARY_FILENAME); - weightsManifest = [{ - paths: [this.WEIGHTS_BINARY_FILENAME], - weights: modelArtifacts.weightSpecs - }]; - modelJSON = { - modelTopology: modelArtifacts.modelTopology, - weightsManifest: weightsManifest, - format: modelArtifacts.format, - generatedBy: modelArtifacts.generatedBy, - convertedBy: modelArtifacts.convertedBy - }; - if (modelArtifacts.trainingConfig != null) { - modelJSON.trainingConfig = modelArtifacts.trainingConfig; - } - if (modelArtifacts.signature != null) { - modelJSON.signature = modelArtifacts.signature; - } - if (modelArtifacts.userDefinedMetadata != null) { - modelJSON.userDefinedMetadata = modelArtifacts.userDefinedMetadata; - } - modelJSONPath = path_1.join(this.path, this.MODEL_JSON_FILENAME); - return [4 /*yield*/, writeFile(modelJSONPath, JSON.stringify(modelJSON), 'utf8')]; - case 3: - _a.sent(); - return [4 /*yield*/, writeFile(weightsBinPath, Buffer.from(modelArtifacts.weightData), 'binary')]; - case 4: - _a.sent(); - return [2 /*return*/, { - // TODO(cais): Use explicit tf.io.ModelArtifactsInfo type below once it - // is available. - // tslint:disable-next-line:no-any - modelArtifactsInfo: io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts) - }]; - } - }); - }); - }; - NodeFileSystem.prototype.load = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, Array.isArray(this.path) ? this.loadBinaryModel() : - this.loadJSONModel()]; - }); - }); - }; - NodeFileSystem.prototype.loadBinaryModel = function () { - return __awaiter(this, void 0, void 0, function () { - var topologyPath, weightManifestPath, topology, weightManifest, modelTopology, weightsManifest, _a, _b, modelArtifacts, _c, weightSpecs, weightData; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - topologyPath = this.path[0]; - weightManifestPath = this.path[1]; - return [4 /*yield*/, stat(topologyPath).catch(doesNotExistHandler('Topology Path'))]; - case 1: - topology = _d.sent(); - return [4 /*yield*/, stat(weightManifestPath) - .catch(doesNotExistHandler('Weight Manifest Path'))]; - case 2: - weightManifest = _d.sent(); - // `this.path` can be either a directory or a file. If it is a file, assume - // it is model.json file. - if (!topology.isFile()) { - throw new Error('File specified for topology is not a file!'); - } - if (!weightManifest.isFile()) { - throw new Error('File specified for the weight manifest is not a file!'); - } - return [4 /*yield*/, readFile(this.path[0])]; - case 3: - modelTopology = _d.sent(); - _b = (_a = JSON).parse; - return [4 /*yield*/, readFile(this.path[1], 'utf8')]; - case 4: - weightsManifest = _b.apply(_a, [_d.sent()]); - modelArtifacts = { - modelTopology: modelTopology, - }; - return [4 /*yield*/, this.loadWeights(weightsManifest, this.path[1])]; - case 5: - _c = _d.sent(), weightSpecs = _c[0], weightData = _c[1]; - modelArtifacts.weightSpecs = weightSpecs; - modelArtifacts.weightData = weightData; - return [2 /*return*/, modelArtifacts]; - } - }); - }); - }; - NodeFileSystem.prototype.loadJSONModel = function () { - return __awaiter(this, void 0, void 0, function () { - var path, info, modelJSON, _a, _b, modelArtifacts, _c, weightSpecs, weightData; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - path = this.path; - return [4 /*yield*/, stat(path).catch(doesNotExistHandler('Path'))]; - case 1: - info = _d.sent(); - if (!info.isFile()) return [3 /*break*/, 5]; - _b = (_a = JSON).parse; - return [4 /*yield*/, readFile(path, 'utf8')]; - case 2: - modelJSON = _b.apply(_a, [_d.sent()]); - modelArtifacts = { - modelTopology: modelJSON.modelTopology, - format: modelJSON.format, - generatedBy: modelJSON.generatedBy, - convertedBy: modelJSON.convertedBy - }; - if (!(modelJSON.weightsManifest != null)) return [3 /*break*/, 4]; - return [4 /*yield*/, this.loadWeights(modelJSON.weightsManifest, path)]; - case 3: - _c = _d.sent(), weightSpecs = _c[0], weightData = _c[1]; - modelArtifacts.weightSpecs = weightSpecs; - modelArtifacts.weightData = weightData; - _d.label = 4; - case 4: - if (modelJSON.trainingConfig != null) { - modelArtifacts.trainingConfig = modelJSON.trainingConfig; - } - if (modelJSON.signature != null) { - modelArtifacts.signature = modelJSON.signature; - } - if (modelJSON.userDefinedMetadata != null) { - modelArtifacts.userDefinedMetadata = modelJSON.userDefinedMetadata; - } - return [2 /*return*/, modelArtifacts]; - case 5: throw new Error('The path to load from must be a file. Loading from a directory ' + - 'is not supported.'); - } - }); - }); - }; - NodeFileSystem.prototype.loadWeights = function (weightsManifest, path) { - return __awaiter(this, void 0, void 0, function () { - var dirName, buffers, weightSpecs, _i, weightsManifest_1, group, _a, _b, path_2, weightFilePath, buffer; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - dirName = path_1.dirname(path); - buffers = []; - weightSpecs = []; - _i = 0, weightsManifest_1 = weightsManifest; - _c.label = 1; - case 1: - if (!(_i < weightsManifest_1.length)) return [3 /*break*/, 7]; - group = weightsManifest_1[_i]; - _a = 0, _b = group.paths; - _c.label = 2; - case 2: - if (!(_a < _b.length)) return [3 /*break*/, 5]; - path_2 = _b[_a]; - weightFilePath = path_1.join(dirName, path_2); - return [4 /*yield*/, readFile(weightFilePath) - .catch(doesNotExistHandler('Weight file'))]; - case 3: - buffer = _c.sent(); - buffers.push(buffer); - _c.label = 4; - case 4: - _a++; - return [3 /*break*/, 2]; - case 5: - weightSpecs.push.apply(weightSpecs, group.weights); - _c.label = 6; - case 6: - _i++; - return [3 /*break*/, 1]; - case 7: return [2 /*return*/, [weightSpecs, io_utils_1.toArrayBuffer(buffers)]]; - } - }); - }); - }; - /** - * For each item in `this.path`, creates a directory at the path or verify - * that the path exists as a directory. - */ - NodeFileSystem.prototype.createOrVerifyDirectory = function () { - return __awaiter(this, void 0, void 0, function () { - var paths, _i, paths_1, path, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - paths = Array.isArray(this.path) ? this.path : [this.path]; - _i = 0, paths_1 = paths; - _a.label = 1; - case 1: - if (!(_i < paths_1.length)) return [3 /*break*/, 9]; - path = paths_1[_i]; - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 8]); - return [4 /*yield*/, mkdir(path)]; - case 3: - _a.sent(); - return [3 /*break*/, 8]; - case 4: - e_1 = _a.sent(); - if (!(e_1.code === 'EEXIST')) return [3 /*break*/, 6]; - return [4 /*yield*/, stat(path)]; - case 5: - if ((_a.sent()).isFile()) { - throw new Error("Path " + path + " exists as a file. The path must be " + - "nonexistent or point to a directory."); - } - return [3 /*break*/, 7]; - case 6: throw e_1; - case 7: return [3 /*break*/, 8]; - case 8: - _i++; - return [3 /*break*/, 1]; - case 9: return [2 /*return*/]; - } - }); - }); - }; - NodeFileSystem.URL_SCHEME = 'file://'; - return NodeFileSystem; -}()); -exports.NodeFileSystem = NodeFileSystem; -exports.nodeFileSystemRouter = function (url) { - if (Array.isArray(url)) { - if (url.every(function (urlElement) { return urlElement.startsWith(NodeFileSystem.URL_SCHEME); })) { - return new NodeFileSystem(url.map(function (urlElement) { return urlElement.slice(NodeFileSystem.URL_SCHEME.length); })); - } - else { - return null; - } - } - else { - if (url.startsWith(NodeFileSystem.URL_SCHEME)) { - return new NodeFileSystem(url.slice(NodeFileSystem.URL_SCHEME.length)); - } - else { - return null; - } - } -}; -// Registration of `nodeFileSystemRouter` is done in index.ts. -/** - * Factory function for Node.js native file system IO Handler. - * - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ -function fileSystem(path) { - return new NodeFileSystem(path); -} -exports.fileSystem = fileSystem; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.js deleted file mode 100644 index b3b5656fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/file_system_test.js +++ /dev/null @@ -1,578 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var fs = require("fs"); -var path = require("path"); -var rimraf = require("rimraf"); -var util_1 = require("util"); -var tfn = require("../index"); -var file_system_1 = require("./file_system"); -describe('File system IOHandler', function () { - var mkdtemp = util_1.promisify(fs.mkdtemp); - var readFile = util_1.promisify(fs.readFile); - var writeFile = util_1.promisify(fs.writeFile); - var rimrafPromise = util_1.promisify(rimraf); - var modelTopology1 = { - 'class_name': 'Sequential', - 'keras_version': '2.1.6', - 'config': [{ - 'class_name': 'Dense', - 'config': { - 'kernel_initializer': { - 'class_name': 'VarianceScaling', - 'config': { - 'distribution': 'uniform', - 'scale': 1.0, - 'seed': null, - 'mode': 'fan_avg' - } - }, - 'name': 'dense', - 'kernel_constraint': null, - 'bias_regularizer': null, - 'bias_constraint': null, - 'dtype': 'float32', - 'activation': 'linear', - 'trainable': true, - 'kernel_regularizer': null, - 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, - 'units': 1, - 'batch_input_shape': [null, 3], - 'use_bias': true, - 'activity_regularizer': null - } - }], - 'backend': 'tensorflow' - }; - var weightSpecs1 = [ - { - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }, - { - name: 'dense/bias', - shape: [1], - dtype: 'float32', - } - ]; - var weightData1 = new ArrayBuffer(16); - var testDir; - beforeEach(function (done) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, mkdtemp('tfjs_node_fs_test')]; - case 1: - testDir = _a.sent(); - done(); - return [2 /*return*/]; - } - }); - }); }); - afterEach(function (done) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, rimrafPromise(testDir)]; - case 1: - _a.sent(); - done(); - return [2 /*return*/]; - } - }); - }); }); - it('save succeeds with newly created directory', function (done) { return __awaiter(_this, void 0, void 0, function () { - var t0, dir, handler; - var _this = this; - return __generator(this, function (_a) { - t0 = new Date(); - dir = path.join(testDir, 'save-destination'); - handler = tf.io.getSaveHandlers("file://" + dir)[0]; - handler - .save({ - modelTopology: modelTopology1, - weightSpecs: weightSpecs1, - weightData: weightData1, - }) - .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () { - var modelJSONPath, weightsBinPath, modelJSON, _a, _b, weightData, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) - .toBeGreaterThanOrEqual(t0.getTime()); - expect(saveResult.modelArtifactsInfo.modelTopologyType) - .toEqual('JSON'); - modelJSONPath = path.join(dir, 'model.json'); - weightsBinPath = path.join(dir, 'weights.bin'); - _b = (_a = JSON).parse; - return [4 /*yield*/, readFile(modelJSONPath, 'utf8')]; - case 1: - modelJSON = _b.apply(_a, [_d.sent()]); - expect(modelJSON.modelTopology).toEqual(modelTopology1); - expect(modelJSON.weightsManifest.length).toEqual(1); - expect(modelJSON.weightsManifest[0].paths).toEqual(['weights.bin']); - expect(modelJSON.weightsManifest[0].weights).toEqual(weightSpecs1); - _c = Uint8Array.bind; - return [4 /*yield*/, readFile(weightsBinPath)]; - case 2: - weightData = new (_c.apply(Uint8Array, [void 0, _d.sent()]))(); - expect(weightData.length).toEqual(16); - weightData.forEach(function (value) { return expect(value).toEqual(0); }); - // Verify the content of the files. - done(); - return [2 /*return*/]; - } - }); - }); }) - .catch(function (err) { return done.fail(err.stack); }); - return [2 /*return*/]; - }); - }); }); - it('save fails if path exists as a file', function (done) { return __awaiter(_this, void 0, void 0, function () { - var dir, handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - dir = path.join(testDir, 'save-destination'); - // Create a file at the locatin. - return [4 /*yield*/, writeFile(dir, 'foo')]; - case 1: - // Create a file at the locatin. - _a.sent(); - handler = tf.io.getSaveHandlers("file://" + dir)[0]; - handler - .save({ - modelTopology: modelTopology1, - weightSpecs: weightSpecs1, - weightData: weightData1, - }) - .then(function (saveResult) { - done.fail('Saving to path of existing file succeeded unexpectedly.'); - }) - .catch(function (err) { - expect(err.message).toMatch(/.*exists as a file.*directory.*/); - done(); - }); - return [2 /*return*/]; - } - }); - }); }); - it('save-load round trip: one weight file', function (done) { - var handler1 = tf.io.getSaveHandlers("file://" + testDir)[0]; - handler1 - .save({ - modelTopology: modelTopology1, - weightSpecs: weightSpecs1, - weightData: weightData1, - }) - .then(function (saveResult) { - var modelJSONPath = path.join(testDir, 'model.json'); - var handler2 = tf.io.getLoadHandlers("file://" + modelJSONPath)[0]; - handler2.load() - .then(function (modelArtifacts) { - expect(modelArtifacts.modelTopology).toEqual(modelTopology1); - expect(modelArtifacts.weightSpecs).toEqual(weightSpecs1); - expect(new Float32Array(modelArtifacts.weightData)) - .toEqual(new Float32Array([0, 0, 0, 0])); - done(); - }) - .catch(function (err) { return done.fail(err.stack); }); - }) - .catch(function (err) { return done.fail(err.stack); }); - }); - describe('load json model', function () { - it('load: two weight files', function (done) { return __awaiter(_this, void 0, void 0, function () { - var weightsManifest, modelJSON, modelJSONPath, weightsData1, weightsData2, handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightsManifest = [ - { - paths: ['weights.1.bin'], - weights: [{ - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }], - }, - { - paths: ['weights.2.bin'], - weights: [{ - name: 'dense/bias', - shape: [1], - dtype: 'float32', - }] - } - ]; - modelJSON = { - modelTopology: modelTopology1, - weightsManifest: weightsManifest, - }; - modelJSONPath = path.join(testDir, 'model.json'); - return [4 /*yield*/, writeFile(modelJSONPath, JSON.stringify(modelJSON), 'utf8')]; - case 1: - _a.sent(); - weightsData1 = Buffer.from(new Float32Array([-1.1, -3.3, -3.3]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.1.bin'), weightsData1, 'binary')]; - case 2: - _a.sent(); - weightsData2 = Buffer.from(new Float32Array([-7.7]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.2.bin'), weightsData2, 'binary')]; - case 3: - _a.sent(); - handler = tf.io.getLoadHandlers("file://" + modelJSONPath)[0]; - handler.load() - .then(function (modelArtifacts) { - expect(modelArtifacts.modelTopology).toEqual(modelTopology1); - expect(modelArtifacts.weightSpecs).toEqual([ - { - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }, - { - name: 'dense/bias', - shape: [1], - dtype: 'float32', - } - ]); - tf.test_util.expectArraysClose(new Float32Array(modelArtifacts.weightData), new Float32Array([-1.1, -3.3, -3.3, -7.7])); - done(); - }) - .catch(function (err) { return done.fail(err.stack); }); - return [2 /*return*/]; - } - }); - }); }); - it('loading from nonexistent model.json path fails', function (done) { - var handler = tf.io.getLoadHandlers("file://" + testDir + "/foo/model.json")[0]; - handler.load() - .then(function (getModelArtifactsInfoForJSON) { - done.fail('Loading from nonexisting model.json path succeeded ' + - 'unexpectedly.'); - }) - .catch(function (err) { - expect(err.message) - .toMatch(/model\.json.*does not exist.*loading failed/); - done(); - }); - }); - it('loading from missing weights path fails', function (done) { return __awaiter(_this, void 0, void 0, function () { - var weightsManifest, modelJSON, modelJSONPath, weightsData1, handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightsManifest = [ - { - paths: ['weights.1.bin'], - weights: [{ - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }], - }, - { - paths: ['weights.2.bin'], - weights: [{ - name: 'dense/bias', - shape: [1], - dtype: 'float32', - }] - } - ]; - modelJSON = { - modelTopology: modelTopology1, - weightsManifest: weightsManifest, - }; - modelJSONPath = path.join(testDir, 'model.json'); - return [4 /*yield*/, writeFile(modelJSONPath, JSON.stringify(modelJSON), 'utf8')]; - case 1: - _a.sent(); - weightsData1 = Buffer.from(new Float32Array([-1.1, -3.3, -3.3]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.1.bin'), weightsData1, 'binary')]; - case 2: - _a.sent(); - handler = tf.io.getLoadHandlers("file://" + modelJSONPath)[0]; - handler.load() - .then(function (modelArtifacts) { - done.fail('Loading with missing weights file succeeded ' + - 'unexpectedly.'); - }) - .catch(function (err) { - expect(err.message) - .toMatch(/Weight file .*weights\.2\.bin does not exist/); - done(); - }); - return [2 /*return*/]; - } - }); - }); }); - }); - describe('load binary model', function () { - it('load: two weight files', function (done) { return __awaiter(_this, void 0, void 0, function () { - var weightsManifest, modelPath, modelData, modelManifestJSONPath, weightsData1, weightsData2, handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightsManifest = [ - { - paths: ['weights.1.bin'], - weights: [{ - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }], - }, - { - paths: ['weights.2.bin'], - weights: [{ - name: 'dense/bias', - shape: [1], - dtype: 'float32', - }] - } - ]; - modelPath = path.join(testDir, 'model.pb'); - modelData = Buffer.from(new Uint8Array([1, 2, 3]).buffer); - return [4 /*yield*/, writeFile(modelPath, modelData, 'binary')]; - case 1: - _a.sent(); - modelManifestJSONPath = path.join(testDir, 'manifest.json'); - return [4 /*yield*/, writeFile(modelManifestJSONPath, JSON.stringify(weightsManifest), 'utf8')]; - case 2: - _a.sent(); - weightsData1 = Buffer.from(new Float32Array([-1.1, -3.3, -3.3]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.1.bin'), weightsData1, 'binary')]; - case 3: - _a.sent(); - weightsData2 = Buffer.from(new Float32Array([-7.7]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.2.bin'), weightsData2, 'binary')]; - case 4: - _a.sent(); - handler = new file_system_1.NodeFileSystem(["" + modelPath, "" + modelManifestJSONPath]); - handler.load() - .then(function (modelArtifacts) { - tf.test_util.expectArraysClose(new Uint8Array(modelArtifacts.modelTopology), new Uint8Array(modelData)); - expect(modelArtifacts.weightSpecs).toEqual([ - { - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }, - { - name: 'dense/bias', - shape: [1], - dtype: 'float32', - } - ]); - tf.test_util.expectArraysClose(new Float32Array(modelArtifacts.weightData), new Float32Array([-1.1, -3.3, -3.3, -7.7])); - done(); - }) - .catch(function (err) { return done.fail(err.stack); }); - return [2 /*return*/]; - } - }); - }); }); - it('path length does not equal 2 fails', function () { - expect(function () { return new file_system_1.NodeFileSystem([testDir + "/foo/model.pb"]); }) - .toThrowError(/file paths must have a length of 2.*actual length is 1.*/); - }); - it('loading from nonexistent model.json path fails', function (done) { - var handler = new file_system_1.NodeFileSystem([testDir + "/foo/model.pb", testDir + "/foo/manifest.json"]); - handler.load() - .then(function (getModelArtifactsInfoForJSON) { - done.fail('Loading from nonexisting model.pb path succeeded ' + - 'unexpectedly.'); - }) - .catch(function (err) { - expect(err.message) - .toMatch(/model\.pb.*does not exist.*loading failed/); - done(); - }); - }); - it('loading from missing weights path fails', function (done) { return __awaiter(_this, void 0, void 0, function () { - var weightsManifest, modelPath, modelData, modelManifestJSONPath, weightsData1, handler; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightsManifest = [ - { - paths: ['weights.1.bin'], - weights: [{ - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }], - }, - { - paths: ['weights.2.bin'], - weights: [{ - name: 'dense/bias', - shape: [1], - dtype: 'float32', - }] - } - ]; - modelPath = path.join(testDir, 'model.pb'); - modelData = Buffer.from(new Uint8Array([1, 2, 3]).buffer); - return [4 /*yield*/, writeFile(modelPath, modelData, 'binary')]; - case 1: - _a.sent(); - modelManifestJSONPath = path.join(testDir, 'manifest.json'); - return [4 /*yield*/, writeFile(modelManifestJSONPath, JSON.stringify(weightsManifest), 'utf8')]; - case 2: - _a.sent(); - weightsData1 = Buffer.from(new Float32Array([-1.1, -3.3, -3.3]).buffer); - return [4 /*yield*/, writeFile(path.join(testDir, 'weights.1.bin'), weightsData1, 'binary')]; - case 3: - _a.sent(); - handler = new file_system_1.NodeFileSystem(["" + modelPath, "" + modelManifestJSONPath]); - handler.load() - .then(function (modelArtifacts) { - done.fail('Loading with missing weights file succeeded ' + - 'unexpectedly.'); - }) - .catch(function (err) { - expect(err.message) - .toMatch(/Weight file .*weights\.2\.bin does not exist/); - done(); - }); - return [2 /*return*/]; - } - }); - }); }); - }); - it('Exported file-system handler class exists', function () { - var handler = tfn.io.fileSystem(testDir); - expect(typeof handler.save).toEqual('function'); - expect(typeof handler.load).toEqual('function'); - }); - it('Save and load model with loss and optimizer', function () { return __awaiter(_this, void 0, void 0, function () { - var model, xs, ys, saveURL, loadURL, model2, optimizerConfig, history2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - model = tf.sequential(); - model.add(tf.layers.dense({ units: 1, kernelInitializer: 'zeros', inputShape: [1] })); - model.compile({ loss: 'meanSquaredError', optimizer: tf.train.adam(2.5e-2) }); - xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); - ys = tf.tensor2d([-1, -3, -5, -7], [4, 1]); - return [4 /*yield*/, model.fit(xs, ys, { epochs: 2, shuffle: false, verbose: 0 })]; - case 1: - _a.sent(); - saveURL = "file://" + testDir; - loadURL = "file://" + testDir + "/model.json"; - return [4 /*yield*/, model.save(saveURL, { includeOptimizer: true })]; - case 2: - _a.sent(); - return [4 /*yield*/, tf.loadLayersModel(loadURL)]; - case 3: - model2 = _a.sent(); - optimizerConfig = model2.optimizer.getConfig(); - expect(model2.optimizer.getClassName()).toEqual('Adam'); - expect(optimizerConfig['learningRate']).toEqual(2.5e-2); - return [4 /*yield*/, model2.fit(xs, ys, { epochs: 2, shuffle: false, verbose: 0 })]; - case 4: - history2 = _a.sent(); - // The final loss value from training the model twice, 2 epochs - // at a time, should be equal to the final loss of trainig the - // model only once with 4 epochs. - expect(history2.history.loss[1]).toBeCloseTo(18.603); - return [2 /*return*/]; - } - }); - }); }); - it('Save and load model with user-defined metadata', function () { return __awaiter(_this, void 0, void 0, function () { - var model, saveURL, loadURL, model2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - model = tf.sequential(); - model.add(tf.layers.dense({ units: 3, inputShape: [4] })); - model.setUserDefinedMetadata({ 'outputLabels': ['Label1', 'Label2', 'Label3'] }); - saveURL = "file://" + testDir; - loadURL = "file://" + testDir + "/model.json"; - return [4 /*yield*/, model.save(saveURL)]; - case 1: - _a.sent(); - return [4 /*yield*/, tf.loadLayersModel(loadURL)]; - case 2: - model2 = _a.sent(); - expect(model2.getUserDefinedMetadata()).toEqual({ - 'outputLabels': ['Label1', 'Label2', 'Label3'] - }); - return [2 /*return*/]; - } - }); - }); }); - describe('nodeFileSystemRouter', function () { - it('should handle single path', function () { - expect(file_system_1.nodeFileSystemRouter('file://model.json')).toBeDefined(); - }); - it('should handle multiple paths', function () { - expect(file_system_1.nodeFileSystemRouter([ - 'file://model.json', 'file://weights.json' - ])).toBeDefined(); - }); - it('should return null for non file path', function () { - expect(file_system_1.nodeFileSystemRouter('http://model.json')).toBeNull(); - }); - it('should return null for multiple paths with mismatched scheme', function () { - expect(file_system_1.nodeFileSystemRouter([ - 'file://model.json', 'http://weights.json' - ])).toBeNull(); - }); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.d.ts deleted file mode 100644 index da4e47d7d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.d.ts +++ /dev/null @@ -1,21 +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. - * ============================================================================= - */ -/** - * Public exports from the `io` module. - */ -export { fileSystem } from './file_system'; -export { nodeHTTPRequest } from './node_http'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.js deleted file mode 100644 index bd7d3867f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/index.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Public exports from the `io` module. - */ -var file_system_1 = require("./file_system"); -exports.fileSystem = file_system_1.fileSystem; -var node_http_1 = require("./node_http"); -exports.nodeHTTPRequest = node_http_1.nodeHTTPRequest; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.d.ts deleted file mode 100644 index 46904dede..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.d.ts +++ /dev/null @@ -1,41 +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'; -/** - * Convert an ArrayBuffer to a Buffer. - */ -export declare function toBuffer(ab: ArrayBuffer): Buffer; -/** - * Convert a Buffer or an Array of Buffers to an ArrayBuffer. - * - * If the input is an Array of Buffers, they will be concatenated in the - * specified order to form the output ArrayBuffer. - */ -export declare function toArrayBuffer(buf: Buffer | Buffer[]): ArrayBuffer; -/** - * Populate ModelArtifactsInfo fields for a model with JSON topology. - * @param modelArtifacts - * @returns A ModelArtifactsInfo object. - */ -export declare function getModelArtifactsInfoForJSON(modelArtifacts: tf.io.ModelArtifacts): { - dateSaved: Date; - modelTopologyType: string; - modelTopologyBytes: number; - weightSpecsBytes: number; - weightDataBytes: number; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.js deleted file mode 100644 index 666a150c3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Convert an ArrayBuffer to a Buffer. - */ -function toBuffer(ab) { - var view = new Uint8Array(ab); - return Buffer.from(view); // copies data -} -exports.toBuffer = toBuffer; -/** - * Convert a Buffer or an Array of Buffers to an ArrayBuffer. - * - * If the input is an Array of Buffers, they will be concatenated in the - * specified order to form the output ArrayBuffer. - */ -function toArrayBuffer(buf) { - if (Array.isArray(buf)) { - // An Array of Buffers. - var totalLength = 0; - for (var _i = 0, buf_1 = buf; _i < buf_1.length; _i++) { - var buffer = buf_1[_i]; - totalLength += buffer.length; - } - var ab = new ArrayBuffer(totalLength); - var view = new Uint8Array(ab); - var pos = 0; - for (var _a = 0, buf_2 = buf; _a < buf_2.length; _a++) { - var buffer = buf_2[_a]; - pos += buffer.copy(view, pos); - } - return ab; - } - else { - // A single Buffer. Return a copy of the underlying ArrayBuffer slice. - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - } -} -exports.toArrayBuffer = toArrayBuffer; -// TODO(cais): Use explicit tf.io.ModelArtifactsInfo return type below once it -// is available. -/** - * Populate ModelArtifactsInfo fields for a model with JSON topology. - * @param modelArtifacts - * @returns A ModelArtifactsInfo object. - */ -function getModelArtifactsInfoForJSON(modelArtifacts) { - if (modelArtifacts.modelTopology instanceof ArrayBuffer) { - throw new Error('Expected JSON model topology, received ArrayBuffer.'); - } - return { - dateSaved: new Date(), - modelTopologyType: 'JSON', - modelTopologyBytes: modelArtifacts.modelTopology == null ? - 0 : - Buffer.byteLength(JSON.stringify(modelArtifacts.modelTopology), 'utf8'), - weightSpecsBytes: modelArtifacts.weightSpecs == null ? - 0 : - Buffer.byteLength(JSON.stringify(modelArtifacts.weightSpecs), 'utf8'), - weightDataBytes: modelArtifacts.weightData == null ? - 0 : - modelArtifacts.weightData.byteLength, - }; -} -exports.getModelArtifactsInfoForJSON = getModelArtifactsInfoForJSON; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.js deleted file mode 100644 index a03a44d58..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/io_utils_test.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var io_utils_1 = require("./io_utils"); -describe('toBuffer', function () { - it('Simple case', function () { - var ab = new Uint8Array([3, 2, 1]).buffer; - var buffer = io_utils_1.toBuffer(ab); - expect(new Uint8Array(buffer)).toEqual(new Uint8Array([3, 2, 1])); - }); -}); -describe('toArrayBuffer', function () { - it('Single Buffer', function () { - var buf = Buffer.from([10, 20, 30]); - var ab = io_utils_1.toArrayBuffer(buf); - expect(new Uint8Array(ab)).toEqual(new Uint8Array([10, 20, 30])); - }); - it('Two Buffers', function () { - var buf1 = Buffer.from([10, 20, 30]); - var buf2 = Buffer.from([40, 50, 60]); - var ab = io_utils_1.toArrayBuffer([buf1, buf2]); - expect(new Uint8Array(ab)).toEqual(new Uint8Array([ - 10, 20, 30, 40, 50, 60 - ])); - }); - it('Three Buffers', function () { - var buf1 = Buffer.from([10, 20, 30]); - var buf2 = Buffer.from([40, 50, 60]); - var buf3 = Buffer.from([3, 2, 1]); - var ab = io_utils_1.toArrayBuffer([buf1, buf2, buf3]); - expect(new Uint8Array(ab)).toEqual(new Uint8Array([ - 10, 20, 30, 40, 50, 60, 3, 2, 1 - ])); - }); - it('Zero buffers', function () { - var ab = io_utils_1.toArrayBuffer([]); - expect(new Uint8Array(ab)).toEqual(new Uint8Array([])); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.d.ts deleted file mode 100644 index 4a38da0ce..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.d.ts +++ /dev/null @@ -1,27 +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 { io } from '@tensorflow/tfjs'; -/** - * Factory function for HTTP IO Handler in Node.js. - * - * @param path URL path or an array of them. - * @param requestInit Request init for the HTTP IOHandler. May include fields - * such as "credentials" and "cache". (Optional) - * @param weightPathPrefix A path prefix for weight loading . (Optional). - */ -export declare function nodeHTTPRequest(path: string, requestInit?: RequestInit, weightPathPrefix?: string): io.IOHandler; -export declare const nodeHTTPRequestRouter: (url: string) => io.IOHandler; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.js deleted file mode 100644 index df1f2e8b5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -/** - * Factory function for HTTP IO Handler in Node.js. - * - * @param path URL path or an array of them. - * @param requestInit Request init for the HTTP IOHandler. May include fields - * such as "credentials" and "cache". (Optional) - * @param weightPathPrefix A path prefix for weight loading . (Optional). - */ -function nodeHTTPRequest(path, requestInit, weightPathPrefix) { - return tfjs_1.io.browserHTTPRequest(path, { requestInit: requestInit, weightPathPrefix: weightPathPrefix }); -} -exports.nodeHTTPRequest = nodeHTTPRequest; -exports.nodeHTTPRequestRouter = function (url) { - var isHTTP = true; - if (Array.isArray(url)) { - isHTTP = url.every(function (urlItem) { return tfjs_1.io.isHTTPScheme(urlItem); }); - } - else { - isHTTP = tfjs_1.io.isHTTPScheme(url); - } - if (isHTTP) { - return nodeHTTPRequest(url); - } - return null; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.js deleted file mode 100644 index 273f1a9ec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/io/node_http_test.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var tfn = require("../index"); -// We still need node-fetch so that we can mock the core -// tf.env().platform.fetch call and return a valid response. -// tslint:disable-next-line:no-require-imports -var fetch = require('node-fetch'); -var OCTET_STREAM_TYPE = 'application/octet-stream'; -var JSON_TYPE = 'application/json'; -// Test data; -var modelTopology1 = { - 'class_name': 'Sequential', - 'keras_version': '2.1.4', - 'config': [{ - 'class_name': 'Dense', - 'config': { - 'kernel_initializer': { - 'class_name': 'VarianceScaling', - 'config': { - 'distribution': 'uniform', - 'scale': 1.0, - 'seed': null, - 'mode': 'fan_avg' - } - }, - 'name': 'dense', - 'kernel_constraint': null, - 'bias_regularizer': null, - 'bias_constraint': null, - 'dtype': 'float32', - 'activation': 'linear', - 'trainable': true, - 'kernel_regularizer': null, - 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, - 'units': 1, - 'batch_input_shape': [null, 3], - 'use_bias': true, - 'activity_regularizer': null - } - }], - 'backend': 'tensorflow' -}; -describe('nodeHTTPRequest-load', function () { - var requestInits; - var setupFakeWeightFiles = function (fileBufferMap) { - spyOn(tf.env().platform, 'fetch') - .and.callFake(function (path, init) { - return new Promise(function (resolve, reject) { - var contentType = ''; - if (path.endsWith('model.json')) { - contentType = JSON_TYPE; - } - else if (path.endsWith('weightfile0') || path.endsWith('weightfile1')) { - contentType = OCTET_STREAM_TYPE; - } - else { - reject(new Error("Invalid path: " + path)); - } - requestInits.push(init); - resolve(new fetch.Response(fileBufferMap[path], { 'headers': { 'Content-Type': contentType } })); - }); - }); - }; - beforeEach(function () { - requestInits = []; - }); - it('Constructor', function () { - var handler = tfn.io.nodeHTTPRequest('./foo_model.json'); - expect(handler == null).toEqual(false); - expect(typeof handler.load).toEqual('function'); - expect(typeof handler.save).toEqual('function'); - }); - it('Load through NodeHTTPRequest object', function () { return __awaiter(_this, void 0, void 0, function () { - var weightManifest1, floatData, handler, modelArtifacts; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightManifest1 = [{ - paths: ['weightfile0'], - weights: [ - { - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }, - { - name: 'dense/bias', - shape: [1], - dtype: 'float32', - } - ] - }]; - floatData = new Float32Array([1, 3, 3, 7]); - setupFakeWeightFiles({ - 'http://localhost/model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), - 'http://localhost/weightfile0': floatData, - }); - handler = tfn.io.nodeHTTPRequest('http://localhost/model.json', { credentials: 'include', cache: 'no-cache' }); - return [4 /*yield*/, handler.load()]; - case 1: - modelArtifacts = _a.sent(); - expect(modelArtifacts.modelTopology).toEqual(modelTopology1); - expect(modelArtifacts.weightSpecs).toEqual(weightManifest1[0].weights); - expect(new Float32Array(modelArtifacts.weightData)).toEqual(floatData); - expect(requestInits).toEqual([ - { credentials: 'include', cache: 'no-cache' }, - { credentials: 'include', cache: 'no-cache' } - ]); - return [2 /*return*/]; - } - }); - }); }); - it('Load through registered handler', function () { return __awaiter(_this, void 0, void 0, function () { - var weightManifest1, floatData, model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - weightManifest1 = [{ - paths: ['weightfile0'], - weights: [ - { - name: 'dense/kernel', - shape: [3, 1], - dtype: 'float32', - }, - { - name: 'dense/bias', - shape: [1], - dtype: 'float32', - } - ] - }]; - floatData = new Float32Array([1, 3, 3, 7]); - setupFakeWeightFiles({ - 'https://localhost/model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), - 'https://localhost/weightfile0': floatData, - }); - return [4 /*yield*/, tf.loadLayersModel('https://localhost/model.json')]; - case 1: - model = _a.sent(); - expect(model.inputs.length).toEqual(1); - expect(model.inputs[0].shape).toEqual([null, 3]); - expect(model.outputs.length).toEqual(1); - expect(model.outputs[0].shape).toEqual([null, 1]); - return [2 /*return*/]; - } - }); - }); }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.d.ts deleted file mode 100644 index b97998546..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const absConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.js deleted file mode 100644 index 06abcd389..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Abs.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.absConfig = { - kernelName: tfjs_1.Abs, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - if (x.dtype === 'complex64') { - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tout', 'float32') - ]; - return backend.executeSingleOutput('ComplexAbs', opAttrs, [x]); - } - return backend.executeSingleInput(tfjs_1.Abs, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.d.ts deleted file mode 100644 index 673738cfb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const acosConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.js deleted file mode 100644 index a408c5167..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acos.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.acosConfig = { - kernelName: tfjs_1.Acos, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Acos, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.d.ts deleted file mode 100644 index 4a0749689..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const acoshConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.js deleted file mode 100644 index 05a645ce9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Acosh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.acoshConfig = { - kernelName: tfjs_1.Acosh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Acosh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.d.ts deleted file mode 100644 index 6206aa3fa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const addConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.js deleted file mode 100644 index f42401c57..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Add.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.addConfig = { - kernelName: tfjs_1.Add, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Add, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.d.ts deleted file mode 100644 index 6e146fd9f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const addNConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.js deleted file mode 100644 index 0a9625ebe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AddN.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.addNConfig = { - kernelName: tfjs_1.AddN, - backendName: 'tensorflow', - kernelFunc: function (args) { - var tensors = args.inputs; - var backend = args.backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tensors[0].dtype), - { name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length } - ]; - return backend.executeSingleOutput(tfjs_1.AddN, opAttrs, tensors); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.d.ts deleted file mode 100644 index 67abab515..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const allConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.js deleted file mode 100644 index 325992620..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/All.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.allConfig = { - kernelName: tfjs_1.All, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var origAxes = tfjs_1.util.parseAxisParam(axis, x.shape); - var opAttrs = [ - { name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') - ]; - var axesTensor = tfjs_1.tensor1d(origAxes, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.All, opAttrs, [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.d.ts deleted file mode 100644 index 22f046c6a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const anyConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.js deleted file mode 100644 index c86e721fe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Any.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.anyConfig = { - kernelName: tfjs_1.Any, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var origAxes = tfjs_1.util.parseAxisParam(axis, x.shape); - var opAttrs = [ - { name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') - ]; - var axesTensor = tfjs_1.tensor1d(origAxes, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Any, opAttrs, [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.d.ts deleted file mode 100644 index 2639cde83..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const argMaxConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.js deleted file mode 100644 index f7f460bff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMax.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.argMaxConfig = { - kernelName: tfjs_1.ArgMax, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var axis = args.attrs.axis; - var toDispose = []; - var xInput = x; - if (x.dtype === 'bool') { - xInput = x.toInt(); - toDispose.push(xInput); - } - var axisScalar = tfjs_1.scalar(axis, 'int32'); - toDispose.push(axisScalar); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', xInput.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('output_type', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.ArgMax, opAttrs, [xInput, axisScalar]); - toDispose.forEach(function (t) { return t.dispose(); }); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.d.ts deleted file mode 100644 index a6cd071ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const argMinConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.js deleted file mode 100644 index 89a1d3215..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ArgMin.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.argMinConfig = { - kernelName: tfjs_1.ArgMin, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var axis = args.attrs.axis; - var toDispose = []; - var xInput = x; - if (x.dtype === 'bool') { - xInput = x.toInt(); - toDispose.push(xInput); - } - var axisScalar = tfjs_1.scalar(axis, 'int32'); - toDispose.push(axisScalar); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', xInput.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('output_type', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.ArgMin, opAttrs, [xInput, axisScalar]); - toDispose.forEach(function (t) { return t.dispose(); }); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.d.ts deleted file mode 100644 index 016a3f37d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const asinConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.js deleted file mode 100644 index d23664e0c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asin.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.asinConfig = { - kernelName: tfjs_1.Asin, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Asin, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.d.ts deleted file mode 100644 index a37a806db..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const asinhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.js deleted file mode 100644 index 1dd2a4adc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Asinh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.asinhConfig = { - kernelName: tfjs_1.Asinh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Asinh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.d.ts deleted file mode 100644 index 0431ab768..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const atanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.js deleted file mode 100644 index b4b95e2e6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.atanConfig = { - kernelName: tfjs_1.Atan, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Atan, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.d.ts deleted file mode 100644 index 4196923dd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const atan2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.js deleted file mode 100644 index b325de945..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atan2.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.atan2Config = { - kernelName: tfjs_1.Atan2, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype)]; - return backend.executeSingleOutput(tfjs_1.Atan2, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.d.ts deleted file mode 100644 index 6f233d787..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const atanhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.js deleted file mode 100644 index 7d8da12f5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Atanh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.atanhConfig = { - kernelName: tfjs_1.Atanh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Atanh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.d.ts deleted file mode 100644 index 332432a46..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const avgPoolConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.js deleted file mode 100644 index dbf9e092e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.avgPoolConfig = { - kernelName: tfjs_1.AvgPool, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dimRoundingMode = _a.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool2DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - return backend.executeSingleOutput(tfjs_1.AvgPool, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.d.ts deleted file mode 100644 index 237f78ab3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const avgPool3DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.js deleted file mode 100644 index ff95d1a4d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3D.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.avgPool3DConfig = { - kernelName: tfjs_1.AvgPool3D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dimRoundingMode = _a.dimRoundingMode, dataFormat = _a.dataFormat; - var convInfo = tfjs_1.backend_util.computePool3DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var $dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: $dataFormat - }, - ]; - return backend.executeSingleOutput(tfjs_1.AvgPool3D, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.d.ts deleted file mode 100644 index 52e2b6998..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const avgPool3DGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.js deleted file mode 100644 index 527305618..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPool3DGrad.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.avgPool3DGradConfig = { - kernelName: tfjs_1.AvgPool3DGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, input = _a.input; - var backend = args.backend; - var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool3DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding type was " + convInfo.padInfo.type)); - } - var ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - var origInputShape = tfjs_1.tensor1d(input.shape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.AvgPool3DGrad, opAttrs, [origInputShape, dy]); - origInputShape.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.d.ts deleted file mode 100644 index 3a2a06021..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const avgPoolGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.js deleted file mode 100644 index bdccdb911..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/AvgPoolGrad.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.avgPoolGradConfig = { - kernelName: tfjs_1.AvgPoolGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, input = _a.input; - var backend = args.backend; - var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad; - var convInfo = tfjs_1.backend_util.computePool2DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding type was " + convInfo.padInfo.type)); - } - var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - var origInputShape = tfjs_1.tensor1d(input.shape, 'int32'); - var ret = backend.executeSingleOutput(tfjs_1.AvgPoolGrad, opAttrs, [origInputShape, dy]); - origInputShape.dispose(); - return ret; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.d.ts deleted file mode 100644 index d432a61f5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const batchMatMulConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.js deleted file mode 100644 index 5bd84da7e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchMatMul.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.batchMatMulConfig = { - kernelName: tfjs_1.BatchMatMul, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var _b = args.attrs, transposeA = _b.transposeA, transposeB = _b.transposeB; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype), - { name: 'adj_x', type: backend.binding.TF_ATTR_BOOL, value: transposeA }, - { name: 'adj_y', type: backend.binding.TF_ATTR_BOOL, value: transposeB } - ]; - return backend.executeSingleOutput(tfjs_1.BatchMatMul, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.d.ts deleted file mode 100644 index 142ff6e21..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const batchToSpaceNDConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.js deleted file mode 100644 index 5677f6f03..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/BatchToSpaceND.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.batchToSpaceNDConfig = { - kernelName: tfjs_1.BatchToSpaceND, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, blockShape = _a.blockShape, crops = _a.crops; - var blockShapeTensor = tfjs_1.tensor1d(blockShape, 'int32'); - var cropsTensor = tfjs_1.tensor2d(crops, [crops.length, crops[0].length], 'int32'); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tblock_shape', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tcrops', cropsTensor.dtype) - ]; - var res = backend.executeSingleOutput(tfjs_1.BatchToSpaceND, opAttrs, [x, blockShapeTensor, cropsTensor]); - cropsTensor.dispose(); - blockShapeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.d.ts deleted file mode 100644 index 4b122edc0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const bincountConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.js deleted file mode 100644 index 96901b226..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Bincount.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.bincountConfig = { - kernelName: tfjs_1.Bincount, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, x = _b.x, weights = _b.weights; - var size = attrs.size; - var nodeBackend = backend; - var $size = tfjs_1.scalar(size, 'int32'); - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', weights.dtype)]; - var result = nodeBackend.executeSingleOutput(tfjs_1.Bincount, opAttrs, [x, $size, weights]); - $size.dispose(); - return result; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.d.ts deleted file mode 100644 index cc74c701f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const castConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.js deleted file mode 100644 index d2cdbcf0d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cast.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.castConfig = { - kernelName: tfjs_1.Cast, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var dtype = args.attrs.dtype; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('SrcT', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('DstT', dtype), - { name: 'Truncate', type: backend.binding.TF_ATTR_BOOL, value: false } - ]; - return backend.executeSingleOutput(tfjs_1.Cast, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.d.ts deleted file mode 100644 index c9a667b44..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const ceilConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.js deleted file mode 100644 index e5a4413ce..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Ceil.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.ceilConfig = { - kernelName: tfjs_1.Ceil, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Ceil, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.d.ts deleted file mode 100644 index 2e089d551..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const clipByValueConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.js deleted file mode 100644 index 95011c93e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ClipByValue.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.clipByValueConfig = { - kernelName: tfjs_1.ClipByValue, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var _a = args.attrs, clipValueMin = _a.clipValueMin, clipValueMax = _a.clipValueMax; - return tfjs_1.tidy(function () { - var xMin = tfjs_1.minimum(x, tfjs_1.scalar(clipValueMax, x.dtype)); - return tfjs_1.maximum(xMin, tfjs_1.scalar(clipValueMin, x.dtype)); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.d.ts deleted file mode 100644 index 1053003cf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const complexConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.js deleted file mode 100644 index 65e7b560d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Complex.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.complexConfig = { - kernelName: tfjs_1.Complex, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, real = _a.real, imag = _a.imag; - var backend = args.backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', real), - { - name: 'Tout', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_COMPLEX64 - }, - ]; - var inputs = [real, imag]; - return backend.executeSingleOutput(tfjs_1.Complex, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.d.ts deleted file mode 100644 index 7fcb06aad..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const complexAbsConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.js deleted file mode 100644 index 091b2535a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ComplexAbs.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.complexAbsConfig = { - kernelName: tfjs_1.ComplexAbs, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tout', 'float32') - ]; - return backend.executeSingleOutput(tfjs_1.ComplexAbs, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.d.ts deleted file mode 100644 index 4b9e87c0d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const concatConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.js deleted file mode 100644 index c7c1b459a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Concat.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.concatConfig = { - kernelName: tfjs_1.Concat, - backendName: 'tensorflow', - kernelFunc: function (args) { - var tensors = args.inputs; - var backend = args.backend; - var axis = args.attrs.axis; - var opAttrs = [ - { name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length }, { - name: 'Tidx', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_INT32 - }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tensors) - ]; - var inputs = Array.from(tensors); - var axisTensor = tfjs_1.scalar(axis, 'int32'); - inputs.push(axisTensor); - var res = backend.executeSingleOutput('ConcatV2', opAttrs, inputs); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.d.ts deleted file mode 100644 index adf5b22ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.d.ts +++ /dev/null @@ -1,20 +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 { backend_util, KernelConfig, Tensor4D, TensorInfo } from '@tensorflow/tfjs'; -import { NodeJSKernelBackend } from '../nodejs_kernel_backend'; -export declare const conv2DConfig: KernelConfig; -export declare function conv2dImpl(x: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, backend: NodeJSKernelBackend): Tensor4D; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.js deleted file mode 100644 index 78544717b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2D.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv2DConfig = { - kernelName: tfjs_1.Conv2D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dataFormat = _b.dataFormat, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode; - var $dataFormat = tfjs_1.backend_util.convertConv2DDataFormat(dataFormat); - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false /* depthwise */, $dataFormat); - return conv2dImpl(x, filter, convInfo, backend); - } -}; -function conv2dImpl(x, filter, convInfo, backend) { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && - convInfo.padInfo.type !== 'EXPLICIT') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations }, - ]; - if (padding === 'EXPLICIT') { - var padValue = [ - convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, - convInfo.padInfo.right - ]; - opAttrs.push({ - name: 'explicit_paddings', - type: backend.binding.TF_ATTR_INT, - value: dataFormat === 'NHWC' ? [0, 0].concat(padValue, [0, 0]) : [0, 0, 0, 0].concat(padValue) - }); - } - return backend.executeSingleOutput(tfjs_1.Conv2D, opAttrs, [x, filter]); -} -exports.conv2dImpl = conv2dImpl; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.d.ts deleted file mode 100644 index 9ec6d8af6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const conv2DBackpropFilterConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.js deleted file mode 100644 index 6d39f6882..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropFilter.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv2DBackpropFilterConfig = { - kernelName: tfjs_1.Conv2DBackpropFilter, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, dy = _a.dy; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dataFormat = _b.dataFormat, dimRoundingMode = _b.dimRoundingMode, filterShape = _b.filterShape; - var $dataFormat = tfjs_1.backend_util.convertConv2DDataFormat(dataFormat); - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filterShape, strides, 1 /* dilations */, pad, dimRoundingMode, false /* depthwise */, $dataFormat); - return conv2DBackpropFilterImpl(dy, x, convInfo, backend); - } -}; -function conv2DBackpropFilterImpl(dy, filter, convInfo, backend) { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations } - ]; - var filterSizes = tfjs_1.tensor1d(convInfo.filterShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Conv2DBackpropFilter, opAttrs, [filter, filterSizes, dy]); - filterSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.d.ts deleted file mode 100644 index b8db12131..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const conv2DBackpropInputConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.js deleted file mode 100644 index 9209fa2b0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv2DBackpropInput.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv2DBackpropInputConfig = { - kernelName: tfjs_1.Conv2DBackpropInput, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dataFormat = _b.dataFormat, dimRoundingMode = _b.dimRoundingMode, inputShape = _b.inputShape; - var $dataFormat = tfjs_1.backend_util.convertConv2DDataFormat(dataFormat); - var convInfo = tfjs_1.backend_util.computeConv2DInfo(inputShape, filter.shape, strides, 1 /* dilations */, pad, dimRoundingMode, false, $dataFormat); - return conv2DBackpropInputImpl(dy, filter, convInfo, backend); - } -}; -function conv2DBackpropInputImpl(dy, filter, convInfo, backend) { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations } - ]; - var inputSizes = tfjs_1.tensor1d(convInfo.inShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Conv2DBackpropInput, opAttrs, [inputSizes, filter, dy]); - inputSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.d.ts deleted file mode 100644 index a578c63b8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const conv3DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.js deleted file mode 100644 index 14896b965..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3D.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv3DConfig = { - kernelName: tfjs_1.Conv3D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dilations = _b.dilations; - var convInfo = tfjs_1.backend_util.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad); - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var $dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - var $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: $dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations } - ]; - return backend.executeSingleOutput(tfjs_1.Conv3D, opAttrs, [x, filter]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.d.ts deleted file mode 100644 index fc3735af7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const conv3DBackpropFilterV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.js deleted file mode 100644 index 9596c7afe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropFilterV2.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv3DBackpropFilterV2Config = { - kernelName: tfjs_1.Conv3DBackpropFilterV2, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, dy = _a.dy; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, filterShape = _b.filterShape; - var dilations = 1; - var convInfo = tfjs_1.backend_util.computeConv3DInfo(x.shape, filterShape, strides, dilations, pad); - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - var $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations } - ]; - var filterSizes = tfjs_1.tensor1d(filterShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Conv3DBackpropFilterV2, opAttrs, [x, filterSizes, dy]); - filterSizes.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.d.ts deleted file mode 100644 index bcc7970c1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const conv3DBackpropInputV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.js deleted file mode 100644 index 0a65bce33..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Conv3DBackpropInputV2.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.conv3DBackpropInputV2Config = { - kernelName: tfjs_1.Conv3DBackpropInputV2, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, inputShape = _b.inputShape; - var dilations = 1; - var convInfo = tfjs_1.backend_util.computeConv3DInfo(inputShape, filter.shape, strides, dilations, pad); - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - var $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', dy.dtype), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tshape', 'int32') - ]; - var inputSizes = tfjs_1.tensor1d(inputShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Conv3DBackpropInputV2, opAttrs, [inputSizes, filter, dy]); - inputSizes.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.d.ts deleted file mode 100644 index 79f5b120f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const cosConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.js deleted file mode 100644 index 3759353d6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cos.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.cosConfig = { - kernelName: tfjs_1.Cos, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Cos, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.d.ts deleted file mode 100644 index 207327652..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const coshConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.js deleted file mode 100644 index 64daef7a0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cosh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.coshConfig = { - kernelName: tfjs_1.Cosh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Cosh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.d.ts deleted file mode 100644 index aa23f965b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const cropAndResizeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.js deleted file mode 100644 index 30566358c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/CropAndResize.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.cropAndResizeConfig = { - kernelName: tfjs_1.CropAndResize, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, image = _a.image, boxes = _a.boxes, boxInd = _a.boxInd; - var backend = args.backend; - var _b = args.attrs, cropSize = _b.cropSize, method = _b.method, extrapolationValue = _b.extrapolationValue; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', image.dtype), - { name: 'method', type: backend.binding.TF_ATTR_STRING, value: method }, { - name: 'extrapolation_value', - type: backend.binding.TF_ATTR_FLOAT, - value: extrapolationValue - } - ]; - var cropSizeTensor = tfjs_1.tensor1d(cropSize, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.CropAndResize, opAttrs, [image, boxes, boxInd, cropSizeTensor]); - cropSizeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.d.ts deleted file mode 100644 index 5491c6c61..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const cumsumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.js deleted file mode 100644 index fc528d2c8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Cumsum.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.cumsumConfig = { - kernelName: tfjs_1.Cumsum, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, exclusive = _a.exclusive, reverse = _a.reverse; - var axisTensor = tfjs_1.scalar(axis, 'int32'); - var opAttrs = [ - { name: 'exclusive', type: backend.binding.TF_ATTR_BOOL, value: exclusive }, - { name: 'reverse', type: backend.binding.TF_ATTR_BOOL, value: reverse }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.Cumsum, opAttrs, [x, axisTensor]); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.d.ts deleted file mode 100644 index 5695688b7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const depthToSpaceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.js deleted file mode 100644 index 55ce2bbcf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthToSpace.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.depthToSpaceConfig = { - kernelName: tfjs_1.DepthToSpace, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, blockSize = _a.blockSize, dataFormat = _a.dataFormat; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x), { - name: 'block_size', - type: backend.binding.TF_ATTR_INT, - value: blockSize < 2 ? 2 : blockSize - }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - } - ]; - var inputs = [x]; - return backend.executeSingleOutput(tfjs_1.DepthToSpace, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.d.ts deleted file mode 100644 index 76c3dff93..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.d.ts +++ /dev/null @@ -1,20 +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 { backend_util, KernelConfig, Tensor4D, TensorInfo } from '@tensorflow/tfjs'; -import { NodeJSKernelBackend } from '../nodejs_kernel_backend'; -export declare const depthwiseConv2dNativeConfig: KernelConfig; -export declare function depthwiseConv2dNativeImpl(input: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, backend: NodeJSKernelBackend): Tensor4D; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.js deleted file mode 100644 index 15b9fc9b8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNative.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.depthwiseConv2dNativeConfig = { - kernelName: tfjs_1.DepthwiseConv2dNative, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode; - var $dilations = dilations; - if ($dilations == null) { - $dilations = [1, 1]; - } - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); - return depthwiseConv2dNativeImpl(x, filter, convInfo, backend); - } -}; -function depthwiseConv2dNativeImpl(input, filter, convInfo, backend) { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && - convInfo.padInfo.type !== 'EXPLICIT') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations } - ]; - if (padding === 'EXPLICIT') { - var padValue = [ - convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, - convInfo.padInfo.right - ]; - opAttrs.push({ - name: 'explicit_paddings', - type: backend.binding.TF_ATTR_INT, - value: dataFormat === 'NHWC' ? [0, 0].concat(padValue, [0, 0]) : [0, 0, 0, 0].concat(padValue) - }); - } - return backend.executeSingleOutput(tfjs_1.DepthwiseConv2dNative, opAttrs, [input, filter]); -} -exports.depthwiseConv2dNativeImpl = depthwiseConv2dNativeImpl; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.d.ts deleted file mode 100644 index 313293dff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const depthwiseConv2dNativeBackpropFilterConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js deleted file mode 100644 index e2f470ad5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.depthwiseConv2dNativeBackpropFilterConfig = { - kernelName: tfjs_1.DepthwiseConv2dNativeBackpropFilter, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, dy = _a.dy; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, dilations = _b.dilations, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode, filterShape = _b.filterShape; - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad, dimRoundingMode, true /* depthwise */); - return depthwiseConv2dNativeBackpropFilterImpl(x, dy, convInfo, backend); - } -}; -function depthwiseConv2dNativeBackpropFilterImpl(x, dy, convInfo, backend) { - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations } - ]; - var filterSizes = tfjs_1.tensor1d(convInfo.filterShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.DepthwiseConv2dNativeBackpropFilter, opAttrs, [x, filterSizes, dy]); - filterSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.d.ts deleted file mode 100644 index 21aef1fdd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const depthwiseConv2dNativeBackpropInputConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.js deleted file mode 100644 index af68a1aeb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/DepthwiseConv2dNativeBackpropInput.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.depthwiseConv2dNativeBackpropInputConfig = { - kernelName: tfjs_1.DepthwiseConv2dNativeBackpropInput, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, filter = _a.filter; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, dilations = _b.dilations, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode, inputShape = _b.inputShape; - var convInfo = tfjs_1.backend_util.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad, dimRoundingMode, true /* depthwise */); - return depthwiseConv2dNativeBackpropInputImpl(dy, filter, convInfo, backend); - } -}; -function depthwiseConv2dNativeBackpropInputImpl(dy, filter, convInfo, backend) { - var strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations } - ]; - var inputSizes = tfjs_1.tensor1d(convInfo.inShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.DepthwiseConv2dNativeBackpropInput, opAttrs, [inputSizes, filter, dy]); - inputSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.d.ts deleted file mode 100644 index 8c0967293..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const diagConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.js deleted file mode 100644 index f93d32857..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Diag.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.diagConfig = { - kernelName: tfjs_1.Diag, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Diag, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.d.ts deleted file mode 100644 index 74431f886..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const dilation2dConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.js deleted file mode 100644 index 20f9a0d94..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2D.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.dilation2dConfig = { - kernelName: tfjs_1.Dilation2D, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, x = _b.x, filter = _b.filter; - var _c = attrs, strides = _c.strides, pad = _c.pad, dilations = _c.dilations; - var _d = tfjs_1.backend_util.computeDilation2DInfo(x.shape, filter.shape, strides, pad, 'NHWC' /* dataFormat */, dilations), dilationHeight = _d.dilationHeight, dilationWidth = _d.dilationWidth, padInfo = _d.padInfo, strideHeight = _d.strideHeight, strideWidth = _d.strideWidth; - var $strides = [1, strideHeight, strideWidth, 1]; - var $dilations = [1, dilationHeight, dilationWidth, 1]; - var nodeBackend = backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides }, - { name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations }, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - return nodeBackend.executeSingleOutput(tfjs_1.Dilation2D, opAttrs, [x, filter]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.d.ts deleted file mode 100644 index 644d886ee..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const dilation2dBackpropFilterConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.js deleted file mode 100644 index 792b2ce37..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropFilter.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.dilation2dBackpropFilterConfig = { - kernelName: tfjs_1.Dilation2DBackpropFilter, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, x = _b.x, filter = _b.filter, dy = _b.dy; - var _c = attrs, strides = _c.strides, pad = _c.pad, dilations = _c.dilations; - var _d = tfjs_1.backend_util.computeDilation2DInfo(x.shape, filter.shape, strides, pad, 'NHWC' /* dataFormat */, dilations), dilationHeight = _d.dilationHeight, dilationWidth = _d.dilationWidth, padInfo = _d.padInfo, strideHeight = _d.strideHeight, strideWidth = _d.strideWidth; - var $strides = [1, strideHeight, strideWidth, 1]; - var $dilations = [1, dilationHeight, dilationWidth, 1]; - var nodeBackend = backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides }, - { name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations }, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - return nodeBackend.executeSingleOutput(tfjs_1.Dilation2DBackpropFilter, opAttrs, [x, filter, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.d.ts deleted file mode 100644 index 2a11b0471..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const dilation2dBackpropInputConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.js deleted file mode 100644 index 3ab781f29..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Dilation2DBackpropInput.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.dilation2dBackpropInputConfig = { - kernelName: tfjs_1.Dilation2DBackpropInput, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, x = _b.x, filter = _b.filter, dy = _b.dy; - var _c = attrs, strides = _c.strides, pad = _c.pad, dilations = _c.dilations; - var _d = tfjs_1.backend_util.computeDilation2DInfo(x.shape, filter.shape, strides, pad, 'NHWC' /* dataFormat */, dilations), dilationHeight = _d.dilationHeight, dilationWidth = _d.dilationWidth, padInfo = _d.padInfo, strideHeight = _d.strideHeight, strideWidth = _d.strideWidth; - var $strides = [1, strideHeight, strideWidth, 1]; - var $dilations = [1, dilationHeight, dilationWidth, 1]; - var nodeBackend = backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides }, - { name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations }, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - return nodeBackend.executeSingleOutput(tfjs_1.Dilation2DBackpropInput, opAttrs, [x, filter, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.d.ts deleted file mode 100644 index 3bdb3a299..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const eluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.js deleted file mode 100644 index b538ff58d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Elu.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.eluConfig = { - kernelName: tfjs_1.Elu, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Elu, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.d.ts deleted file mode 100644 index 86b737b33..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const eluGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.js deleted file mode 100644 index c24a06e4f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/EluGrad.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.eluGradConfig = { - kernelName: tfjs_1.EluGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, y = _a.y; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', y.dtype)]; - return backend.executeSingleOutput(tfjs_1.EluGrad, opAttrs, [dy, y]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.d.ts deleted file mode 100644 index 0638afc27..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const equalConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.js deleted file mode 100644 index e50383538..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Equal.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.equalConfig = { - kernelName: tfjs_1.Equal, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Equal, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.d.ts deleted file mode 100644 index 0eb9003c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const erfConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.js deleted file mode 100644 index 19baaf71e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Erf.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.erfConfig = { - kernelName: tfjs_1.Erf, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Erf, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts deleted file mode 100644 index d0b08039e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const expConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js deleted file mode 100644 index bfd3ebfc6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.expConfig = { - kernelName: tfjs_1.Exp, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var xTensor = x.dtype === 'int32' ? x.toFloat() : x; - return backend.executeSingleInput(tfjs_1.Exp, xTensor); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts deleted file mode 100644 index 27b314df9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const expandDimsConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js deleted file mode 100644 index 051b8ee1e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.expandDimsConfig = { - kernelName: tfjs_1.ExpandDims, - backendName: 'tensorflow', - kernelFunc: function (args) { - var input = args.inputs.input; - var backend = args.backend; - var dim = args.attrs.dim; - var dimTensor = tfjs_1.scalar(dim, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.ExpandDims, [], [input, dimTensor]); - dimTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts deleted file mode 100644 index eb795a69f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const expm1Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js deleted file mode 100644 index 4e32cfac8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.expm1Config = { - kernelName: tfjs_1.Expm1, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Expm1, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts deleted file mode 100644 index d44def8eb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const FFTConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js deleted file mode 100644 index 5327f6805..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// tslint:disable-next-line: variable-name -exports.FFTConfig = { - kernelName: tfjs_1.FFT, - backendName: 'tensorflow', - kernelFunc: function (args) { - var input = args.inputs.input; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tcomplex', input.dtype)]; - return backend.executeSingleOutput(tfjs_1.FFT, opAttrs, [input]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts deleted file mode 100644 index 408811b26..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const fillConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js deleted file mode 100644 index 4db78f4ad..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.fillConfig = { - kernelName: tfjs_1.Fill, - backendName: 'tensorflow', - kernelFunc: function (args) { - var backend = args.backend; - var _a = args.attrs, shape = _a.shape, value = _a.value; - var dtype = args.attrs.dtype; - // TODO(cais, nkreeger): Investigate whether backend can be made into - // a dtype helper method. The underlying op kernel doesn't accept undefined - // or null dtype. - if (dtype == null) { - if (typeof value === 'number') { - dtype = 'float32'; - } - else { - dtype = 'string'; - } - } - var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); - var valueTensor = tfjs_1.scalar(value, dtype); - var opAttrs = [ - { - name: 'T', - type: backend.binding.TF_ATTR_TYPE, - value: backend.getDTypeInteger(dtype) - }, - { - name: 'index_type', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_INT32 - } - ]; - var res = backend.executeSingleOutput(tfjs_1.Fill, opAttrs, [shapeTensor, valueTensor]); - shapeTensor.dispose(); - valueTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts deleted file mode 100644 index bb1f5e020..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const floorConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js deleted file mode 100644 index da9aac91e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.floorConfig = { - kernelName: tfjs_1.Floor, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Floor, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts deleted file mode 100644 index d593bccd3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const floorDivConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js deleted file mode 100644 index c420be721..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.floorDivConfig = { - kernelName: tfjs_1.FloorDiv, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.FloorDiv, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts deleted file mode 100644 index 7ec1febb6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const fusedBatchNormConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js deleted file mode 100644 index 9634cc622..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.fusedBatchNormConfig = { - kernelName: tfjs_1.FusedBatchNorm, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, mean = _a.mean, variance = _a.variance; - var _b = args.inputs, scale = _b.scale, offset = _b.offset; - var backend = args.backend; - var varianceEpsilon = args.attrs.varianceEpsilon; - return tfjs_1.tidy(function () { - if (mean.rank > 1) { - // Fused batch norm doesn't work with high-dim mean/var/scale/offset. - var inv = tfjs_1.rsqrt(tfjs_1.add(variance, tfjs_1.scalar(varianceEpsilon))); - if (scale != null) { - inv = tfjs_1.mul(inv, scale); - } - var xNorm = tfjs_1.mul(tfjs_1.sub(x, mean), inv); - return offset != null ? tfjs_1.add(xNorm, offset) : xNorm; - } - var dataFormat = 'NHWC'; - var depth = x.shape[3]; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { - name: 'epsilon', - type: backend.binding.TF_ATTR_FLOAT, - value: varianceEpsilon - }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - { name: 'is_training', type: backend.binding.TF_ATTR_BOOL, value: false }, - ]; - var numOutputs = 5; - if (scale == null) { - scale = tfjs_1.fill([depth], 1); - } - if (offset == null) { - offset = tfjs_1.fill([depth], 0); - } - return backend.executeMultipleOutputs(tfjs_1.FusedBatchNorm, opAttrs, [x, scale, offset, mean, variance], numOutputs)[0]; - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts deleted file mode 100644 index 79bef995a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const fusedConv2DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js deleted file mode 100644 index 98b7eec15..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var Conv2D_1 = require("./Conv2D"); -exports.fusedConv2DConfig = { - kernelName: tfjs_1.FusedConv2D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, filter = _a.filter, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dataFormat = _b.dataFormat, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; - var $dataFormat = tfjs_1.backend_util.convertConv2DDataFormat(dataFormat); - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false /* depthwise */, $dataFormat); - var result = Conv2D_1.conv2dImpl(x, filter, convInfo, backend); - var toDispose = []; - if (bias != null) { - toDispose.push(result); - result = tfjs_1.add(result, bias); - } - var temp = result; - result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); - if (temp !== result) { - toDispose.push(temp); - } - toDispose.forEach(function (t) { return t.dispose(); }); - return result; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts deleted file mode 100644 index d3ba58165..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const fusedDepthwiseConv2DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js deleted file mode 100644 index af855878a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var DepthwiseConv2dNative_1 = require("./DepthwiseConv2dNative"); -exports.fusedDepthwiseConv2DConfig = { - kernelName: tfjs_1.FusedDepthwiseConv2D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, filter = _a.filter, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; - var backend = args.backend; - var _b = args.attrs, strides = _b.strides, pad = _b.pad, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; - var $dilations = dilations; - if ($dilations == null) { - $dilations = [1, 1]; - } - var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); - var result = DepthwiseConv2dNative_1.depthwiseConv2dNativeImpl(x, filter, convInfo, backend); - var toDispose = []; - if (bias != null) { - toDispose.push(result); - result = tfjs_1.add(result, bias); - } - var temp = result; - result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); - if (temp !== result) { - toDispose.push(temp); - } - toDispose.forEach(function (t) { return t.dispose(); }); - return result; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts deleted file mode 100644 index d1d63bf1f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const gatherNdConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js deleted file mode 100644 index 49f526d93..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.gatherNdConfig = { - kernelName: tfjs_1.GatherNd, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, params = _a.params, indices = _a.indices; - var backend = args.backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tparams', params.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32') - ]; - return backend.executeSingleOutput(tfjs_1.GatherNd, opAttrs, [params, indices]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts deleted file mode 100644 index c5cc97f31..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const gatherV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js deleted file mode 100644 index 4ed5969b4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.gatherV2Config = { - kernelName: tfjs_1.GatherV2, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, indices = _a.indices; - var backend = args.backend; - var _b = args.attrs, axis = _b.axis, batchDims = _b.batchDims; - // validate the inputs - tfjs_1.backend_util.segment_util.collectGatherOpShapeInfo(x, indices, axis, batchDims); - var axisTensor = tfjs_1.scalar(axis, 'int32'); - var opAttrs = [ - { name: 'batch_dims', type: backend.binding.TF_ATTR_INT, value: batchDims }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tparams', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', indices.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Taxis', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.GatherV2, opAttrs, [x, indices, axisTensor]); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts deleted file mode 100644 index 8a1df7103..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const greaterConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js deleted file mode 100644 index 6bef0d177..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.greaterConfig = { - kernelName: tfjs_1.Greater, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Greater, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts deleted file mode 100644 index 26f7798ef..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const greaterEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js deleted file mode 100644 index 476aee8b0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.greaterEqualConfig = { - kernelName: tfjs_1.GreaterEqual, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.GreaterEqual, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts deleted file mode 100644 index d6a8a4764..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const IFFTConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js deleted file mode 100644 index 982aeb393..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// tslint:disable-next-line: variable-name -exports.IFFTConfig = { - kernelName: tfjs_1.IFFT, - backendName: 'tensorflow', - kernelFunc: function (args) { - var input = args.inputs.input; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tcomplex', input.dtype)]; - return backend.executeSingleOutput(tfjs_1.IFFT, opAttrs, [input]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts deleted file mode 100644 index 1dc8e921f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const identityConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js deleted file mode 100644 index 3ba359c62..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.identityConfig = { - kernelName: tfjs_1.Identity, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - // Backend needs to track refCount for the dataId for identity op - args.backend.incRef(x.dataId); - return { dataId: x.dataId, shape: x.shape, dtype: x.dtype }; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts deleted file mode 100644 index c3b0f5c5f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const imagConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js deleted file mode 100644 index b7e71c623..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.imagConfig = { - kernelName: tfjs_1.Imag, - backendName: 'tensorflow', - kernelFunc: function (args) { - var input = args.inputs.input; - var backend = args.backend; - var opAttrs = [ - { - name: 'T', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_COMPLEX64 - }, - { - name: 'Tout', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_FLOAT - } - ]; - var inputs = [input]; - return backend.executeSingleOutput(tfjs_1.Imag, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts deleted file mode 100644 index c3c56256e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const isFiniteConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js deleted file mode 100644 index 65a73a176..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.isFiniteConfig = { - kernelName: tfjs_1.IsFinite, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.IsFinite, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts deleted file mode 100644 index 5d45cdd99..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const isInfConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js deleted file mode 100644 index 36bdf6b25..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.isInfConfig = { - kernelName: tfjs_1.IsInf, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.IsInf, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts deleted file mode 100644 index d2fb05a24..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const isNanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js deleted file mode 100644 index 75ac69c7b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.isNanConfig = { - kernelName: tfjs_1.IsNan, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.IsNan, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts deleted file mode 100644 index 7934d16ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const LRNConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js deleted file mode 100644 index 7547e6390..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// tslint:disable-next-line: variable-name -exports.LRNConfig = { - kernelName: tfjs_1.LRN, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, depthRadius = _a.depthRadius, bias = _a.bias, alpha = _a.alpha, beta = _a.beta; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { - name: 'depth_radius', - type: backend.binding.TF_ATTR_INT, - value: depthRadius - }, - { name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias }, - { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, - { name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta }, - ]; - return backend.executeSingleOutput(tfjs_1.LRN, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts deleted file mode 100644 index 1e9425877..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const LRNGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js deleted file mode 100644 index b6a86c0f9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// tslint:disable-next-line: variable-name -exports.LRNGradConfig = { - kernelName: tfjs_1.LRNGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, y = _a.y, dy = _a.dy; - var backend = args.backend; - var _b = args.attrs, depthRadius = _b.depthRadius, bias = _b.bias, alpha = _b.alpha, beta = _b.beta; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', dy.dtype), - { - name: 'depth_radius', - type: backend.binding.TF_ATTR_INT, - value: depthRadius - }, - { name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias }, - { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, - { name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta }, - ]; - return backend.executeSingleOutput(tfjs_1.LRNGrad, opAttrs, [dy, x, y]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts deleted file mode 100644 index 4dd598f0a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const leakyReluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js deleted file mode 100644 index eccf79ab2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.leakyReluConfig = { - kernelName: tfjs_1.LeakyRelu, - backendName: 'tensorflow', - kernelFunc: function (args) { - var inputs = args.inputs; - var attrs = args.attrs; - var backend = args.backend; - var x = inputs.x; - var alpha = attrs.alpha; - var opAttrs = [ - { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype) - ]; - return backend.executeSingleOutput(tfjs_1.LeakyRelu, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts deleted file mode 100644 index 04f834593..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const lessConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js deleted file mode 100644 index 95a42d555..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.lessConfig = { - kernelName: tfjs_1.Less, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Less, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts deleted file mode 100644 index 6a0a3aa2e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const lessEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js deleted file mode 100644 index a9e12a09c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.lessEqualConfig = { - kernelName: tfjs_1.LessEqual, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.LessEqual, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts deleted file mode 100644 index 8e423b256..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const linSpaceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js deleted file mode 100644 index c467c30e9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.linSpaceConfig = { - kernelName: tfjs_1.LinSpace, - backendName: 'tensorflow', - kernelFunc: function (args) { - var backend = args.backend; - var _a = args.attrs, start = _a.start, stop = _a.stop, num = _a.num; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') - ]; - return tfjs_1.tidy(function () { - var inputs = [ - tfjs_1.scalar(start, 'float32'), tfjs_1.scalar(stop, 'float32'), tfjs_1.scalar(num, 'int32') - ]; - return backend.executeSingleOutput(tfjs_1.LinSpace, opAttrs, inputs); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts deleted file mode 100644 index fd3a921ad..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const logConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js deleted file mode 100644 index d9efecb70..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.logConfig = { - kernelName: tfjs_1.Log, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Log, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts deleted file mode 100644 index 38cbae1a8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const log1pConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js deleted file mode 100644 index b72381262..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.log1pConfig = { - kernelName: tfjs_1.Log1p, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Log1p, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts deleted file mode 100644 index 9522780c2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const logicalAndConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js deleted file mode 100644 index c0005c10c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.logicalAndConfig = { - kernelName: tfjs_1.LogicalAnd, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - return backend.executeSingleOutput(tfjs_1.LogicalAnd, [], [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts deleted file mode 100644 index 678f95132..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const logicalNotConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js deleted file mode 100644 index cfddbe25e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.logicalNotConfig = { - kernelName: tfjs_1.LogicalNot, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleOutput(tfjs_1.LogicalNot, [], [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts deleted file mode 100644 index 9ea4f6c5a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const logicalOrConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js deleted file mode 100644 index f918b8cb9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.logicalOrConfig = { - kernelName: tfjs_1.LogicalOr, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - return backend.executeSingleOutput(tfjs_1.LogicalOr, [], [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts deleted file mode 100644 index be6cc3267..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maxConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js deleted file mode 100644 index 2e1aea1bb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.maxConfig = { - kernelName: tfjs_1.Max, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, reductionIndices = _a.reductionIndices, keepDims = _a.keepDims; - var axes = tfjs_1.util.parseAxisParam(reductionIndices, x.shape); - var axesTensor = tfjs_1.tensor1d(axes, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Max, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts deleted file mode 100644 index e6a7d5d0e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maxPoolConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js deleted file mode 100644 index c9d653ca7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.maxPoolConfig = { - kernelName: tfjs_1.MaxPool, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dimRoundingMode = _a.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool2DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - } - ]; - return backend.executeSingleOutput(tfjs_1.MaxPool, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts deleted file mode 100644 index 278b1cc47..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maxPool3DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js deleted file mode 100644 index a2483b001..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.maxPool3DConfig = { - kernelName: tfjs_1.MaxPool3D, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dataFormat = _a.dataFormat, dimRoundingMode = _a.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool3DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding was " + convInfo.padInfo.type)); - } - var ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var $dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: $dataFormat - } - ]; - return backend.executeSingleOutput(tfjs_1.MaxPool3D, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts deleted file mode 100644 index 54e7a34a1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maxPool3DGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js deleted file mode 100644 index aec0ca281..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.maxPool3DGradConfig = { - kernelName: tfjs_1.MaxPool3DGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, input = _a.input, output = _a.output; - var backend = args.backend; - var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool3DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding type was " + convInfo.padInfo.type)); - } - var ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - var $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - return backend.executeSingleOutput(tfjs_1.MaxPool3DGrad, opAttrs, [input, output, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts deleted file mode 100644 index 8324ed935..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maxPoolGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js deleted file mode 100644 index c6d77cca5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.maxPoolGradConfig = { - kernelName: tfjs_1.MaxPoolGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, dy = _a.dy, input = _a.input, output = _a.output; - var backend = args.backend; - var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode; - var convInfo = tfjs_1.backend_util.computePool2DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error("TF Backend supports only 'valid' and 'same' padding " + - ("while padding type was " + convInfo.padInfo.type)); - } - var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - var padding = convInfo.padInfo.type; - var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), - { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, - { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, - { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - return backend.executeSingleOutput(tfjs_1.MaxPoolGrad, opAttrs, [input, output, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts deleted file mode 100644 index 23a653d94..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const maximumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js deleted file mode 100644 index cc1593f6f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.maximumConfig = { - kernelName: tfjs_1.Maximum, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Maximum, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts deleted file mode 100644 index 517d22542..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const meanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js deleted file mode 100644 index 4d8028673..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.meanConfig = { - kernelName: tfjs_1.Mean, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var axes = tfjs_1.util.parseAxisParam(axis, x.shape); - var axesTensor = tfjs_1.tensor1d(axes, 'int32'); - // Cast to float32 to match existing tfjs implementation/tests. - var asFloat32 = tfjs_1.cast(x, 'float32'); - var res = backend.executeSingleOutput(tfjs_1.Mean, backend.createReductionOpAttrs(x, keepDims), [asFloat32, axesTensor]); - asFloat32.dispose(); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts deleted file mode 100644 index c25780c57..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const minConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js deleted file mode 100644 index eb27a4c83..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.minConfig = { - kernelName: tfjs_1.Min, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var axes = tfjs_1.util.parseAxisParam(axis, x.shape); - var axesTensor = tfjs_1.tensor1d(axes, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Min, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts deleted file mode 100644 index c66a2992a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const minimumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js deleted file mode 100644 index 87423ea8a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.minimumConfig = { - kernelName: tfjs_1.Minimum, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Minimum, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts deleted file mode 100644 index f08dd0d3f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const mirrorPadConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js deleted file mode 100644 index 9ea7f9561..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.mirrorPadConfig = { - kernelName: tfjs_1.MirrorPad, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var x = inputs.x; - var _b = attrs, paddings = _b.paddings, mode = _b.mode; - var nodeBackend = backend; - var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, 2], 'int32'); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype), { - name: 'mode', - type: nodeBackend.binding.TF_ATTR_STRING, - value: mode.toUpperCase() - } - ]; - var output = nodeBackend.executeSingleOutput('MirrorPad', opAttrs, [x, paddingsTensor]); - paddingsTensor.dispose(); - return output; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts deleted file mode 100644 index 44e932168..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const modConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js deleted file mode 100644 index 5697340e9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.modConfig = { - kernelName: tfjs_1.Mod, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype)]; - return backend.executeSingleOutput('FloorMod', opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts deleted file mode 100644 index 04efe4e1e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const multinomialConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js deleted file mode 100644 index 27a5d3e10..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.multinomialConfig = { - kernelName: tfjs_1.Multinomial, - backendName: 'tensorflow', - kernelFunc: function (args) { - var logits = args.inputs.logits; - var backend = args.backend; - var _a = args.attrs, numSamples = _a.numSamples, seed = _a.seed, normalized = _a.normalized; - if (normalized) { - throw new Error('TF Node backend does not support normalized logits ' + - 'passed to multinomial'); - } - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', logits.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('output_dtype', 'int32'), - { name: 'seed', type: backend.binding.TF_ATTR_INT, value: seed }, - { name: 'seed2', type: backend.binding.TF_ATTR_INT, value: seed * seed }, - ]; - var numSamplesTensor = tfjs_1.scalar(numSamples, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Multinomial, opAttrs, [logits, numSamplesTensor]); - numSamplesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts deleted file mode 100644 index c185cf567..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const multiplyConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js deleted file mode 100644 index 11b41c36e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.multiplyConfig = { - kernelName: tfjs_1.Multiply, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput('Mul', opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts deleted file mode 100644 index e4a4f106f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const negConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js deleted file mode 100644 index 2bebc8e8a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.negConfig = { - kernelName: tfjs_1.Neg, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Neg, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts deleted file mode 100644 index 358e88523..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const nonMaxSuppressionV3Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js deleted file mode 100644 index d33b8f4c5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.nonMaxSuppressionV3Config = { - kernelName: tfjs_1.NonMaxSuppressionV3, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, boxes = _a.boxes, scores = _a.scores; - var backend = args.backend; - var _b = args.attrs, maxOutputSize = _b.maxOutputSize, iouThreshold = _b.iouThreshold, scoreThreshold = _b.scoreThreshold; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype)]; - var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); - var iouThresholdTensor = tfjs_1.scalar(iouThreshold); - var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold); - var res = backend.executeSingleOutput(tfjs_1.NonMaxSuppressionV3, opAttrs, [ - boxes, scores, maxOutputSizeTensor, iouThresholdTensor, - scoreThresholdTensor - ]); - maxOutputSizeTensor.dispose(); - iouThresholdTensor.dispose(); - scoreThresholdTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts deleted file mode 100644 index 9b2d2211c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const nonMaxSuppressionV4Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js deleted file mode 100644 index d89722f5f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. -exports.nonMaxSuppressionV4Config = { - kernelName: tfjs_1.NonMaxSuppressionV4, - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, boxes = _b.boxes, scores = _b.scores; - var _c = attrs, maxOutputSize = _c.maxOutputSize, iouThreshold = _c.iouThreshold, scoreThreshold = _c.scoreThreshold, padToMaxOutputSize = _c.padToMaxOutputSize; - var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); - var iouThresholdTensor = tfjs_1.scalar(iouThreshold, 'float32'); - var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold, 'float32'); - var nodeBackend = backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T_threshold', 'float32'), { - name: 'pad_to_max_output_size', - type: nodeBackend.binding.TF_ATTR_BOOL, - value: padToMaxOutputSize - } - ]; - var _d = nodeBackend.executeMultipleOutputs('NonMaxSuppressionV4', opAttrs, [ - boxes, scores, maxOutputSizeTensor, - iouThresholdTensor, scoreThresholdTensor - ], 2), selectedIndices = _d[0], validOutputs = _d[1]; - maxOutputSizeTensor.dispose(); - iouThresholdTensor.dispose(); - scoreThresholdTensor.dispose(); - return [selectedIndices, validOutputs]; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts deleted file mode 100644 index e347b3ab0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const nonMaxSuppressionV5Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js deleted file mode 100644 index 23c3e9f97..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. -exports.nonMaxSuppressionV5Config = { - kernelName: 'NonMaxSuppressionV5', - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; - var _b = inputs, boxes = _b.boxes, scores = _b.scores; - var _c = attrs, maxOutputSize = _c.maxOutputSize, iouThreshold = _c.iouThreshold, scoreThreshold = _c.scoreThreshold, softNmsSigma = _c.softNmsSigma; - var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); - var iouThresholdTensor = tfjs_1.scalar(iouThreshold); - var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold); - var softNmsSigmaTensor = tfjs_1.scalar(softNmsSigma); - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype)]; - var nodeBackend = backend; - var _d = nodeBackend.executeMultipleOutputs('NonMaxSuppressionV5', opAttrs, [ - boxes, scores, maxOutputSizeTensor, - iouThresholdTensor, scoreThresholdTensor, softNmsSigmaTensor - ], 3), selectedIndices = _d[0], selectedScores = _d[1], validOutputs = _d[2]; - maxOutputSizeTensor.dispose(); - iouThresholdTensor.dispose(); - scoreThresholdTensor.dispose(); - softNmsSigmaTensor.dispose(); - validOutputs.dispose(); - return [selectedIndices, selectedScores]; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts deleted file mode 100644 index e9148a15c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const notEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js deleted file mode 100644 index eece111db..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.notEqualConfig = { - kernelName: tfjs_1.NotEqual, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.NotEqual, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts deleted file mode 100644 index cb59c1d26..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const oneHotConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js deleted file mode 100644 index 4b45622f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.oneHotConfig = { - kernelName: tfjs_1.OneHot, - backendName: 'tensorflow', - kernelFunc: function (args) { - var indices = args.inputs.indices; - var backend = args.backend; - var _a = args.attrs, depth = _a.depth, onValue = _a.onValue, offValue = _a.offValue; - var depthTensor = tfjs_1.scalar(depth, 'int32'); - var onValueTensor = tfjs_1.scalar(onValue, 'int32'); - var offValueTensor = tfjs_1.scalar(offValue, 'int32'); - var opAttrs = [ - { name: 'axis', type: backend.binding.TF_ATTR_INT, value: -1 }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', indices.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('TI', indices.dtype) - ]; - var res = backend.executeSingleOutput(tfjs_1.OneHot, opAttrs, [indices, depthTensor, onValueTensor, offValueTensor]); - depthTensor.dispose(); - onValueTensor.dispose(); - offValueTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts deleted file mode 100644 index 01d2e7c35..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const onesLikeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js deleted file mode 100644 index ae5cd7152..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.onesLikeConfig = { - kernelName: tfjs_1.OnesLike, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var opAttrs = [{ - name: 'T', - type: backend.binding.TF_ATTR_TYPE, - value: backend.getDTypeInteger(x.dtype) - }]; - return backend.executeSingleOutput(tfjs_1.OnesLike, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts deleted file mode 100644 index 1c53c4b6d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts +++ /dev/null @@ -1,24 +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 { KernelConfig, PackAttrs, PackInputs, TensorInfo } from '@tensorflow/tfjs'; -import { NodeJSKernelBackend } from '../nodejs_kernel_backend'; -export declare function pack(args: { - inputs: PackInputs; - backend: NodeJSKernelBackend; - attrs: PackAttrs; -}): TensorInfo; -export declare const packConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js deleted file mode 100644 index a163b9f2a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -function pack(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - var axis = attrs.axis; - var opAttrs = [ - { name: 'N', type: backend.binding.TF_ATTR_INT, value: inputs.length }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', inputs), - { name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis } - ]; - var res = backend.executeSingleOutput(tfjs_1.Pack, opAttrs, inputs); - return res; -} -exports.pack = pack; -exports.packConfig = { - kernelName: tfjs_1.Pack, - backendName: 'tensorflow', - kernelFunc: pack -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts deleted file mode 100644 index e297ae2cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const padV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js deleted file mode 100644 index 3bdef6e18..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.padV2Config = { - kernelName: tfjs_1.PadV2, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, paddings = _a.paddings, constantValue = _a.constantValue; - // Bind tensor values - var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, 2], 'int32'); - var constantTensor = tfjs_1.scalar(constantValue, x.dtype); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) - ]; - var res = backend.executeSingleOutput(tfjs_1.PadV2, opAttrs, [x, paddingsTensor, constantTensor]); - paddingsTensor.dispose(); - constantTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts deleted file mode 100644 index 5f728e2e6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const powConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js deleted file mode 100644 index deabdc582..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.powConfig = { - kernelName: tfjs_1.Pow, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var dtype = tfjs_1.backend_util.upcastType(a.dtype, b.dtype); - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', dtype)]; - return tfjs_1.tidy(function () { - return backend.executeSingleOutput(tfjs_1.Pow, opAttrs, [tfjs_1.cast(a, dtype), tfjs_1.cast(b, dtype)]); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts deleted file mode 100644 index c1fbeab78..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const preluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js deleted file mode 100644 index ce674b22f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.preluConfig = { - kernelName: tfjs_1.Prelu, - backendName: 'tensorflow', - kernelFunc: function (args) { - var inputs = args.inputs; - var x = inputs.x; - var alpha = inputs.alpha; - return tfjs_1.tidy(function () { - var pos = tfjs_1.relu(x); - var neg = alpha.mul(x.sub(tfjs_1.abs(x))).mul(0.5); - return pos.add(neg); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts deleted file mode 100644 index aae550640..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const prodConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js deleted file mode 100644 index 572f4f0fe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.prodConfig = { - kernelName: tfjs_1.Prod, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var axes = tfjs_1.util.parseAxisParam(axis, x.shape); - var axesTensor = tfjs_1.tensor1d(axes, 'int32'); - var opAttrs = [ - { name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.Prod, opAttrs, [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts deleted file mode 100644 index ea84dc4dc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const rangeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js deleted file mode 100644 index c079a9a02..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.rangeConfig = { - kernelName: tfjs_1.Range, - backendName: 'tensorflow', - kernelFunc: function (args) { - var backend = args.backend; - var _a = args.attrs, start = _a.start, stop = _a.stop, dtype = _a.dtype; - var step = args.attrs.step; - // TensorFlow.js specific allowances - var sameStartStop = start === stop; - var increasingRangeNegativeStep = start < stop && step < 0; - var decreasingRangePositiveStep = stop < start && step > 1; - if (sameStartStop || increasingRangeNegativeStep || - decreasingRangePositiveStep) { - return tfjs_1.zeros([0], dtype); - } - if (stop < start && step === 1) { - // Auto adjust the step's sign if it hasn't been set - // (or was set to 1) - step = -1; - } - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', dtype)]; - var startTensor = tfjs_1.scalar(start); - var stopTensor = tfjs_1.scalar(stop); - var stepTensor = tfjs_1.scalar(step); - var res = backend.executeSingleOutput(tfjs_1.Range, opAttrs, [startTensor, stopTensor, stepTensor]); - var castedRes = res.cast(dtype); - startTensor.dispose(); - stopTensor.dispose(); - stepTensor.dispose(); - res.dispose(); - return castedRes; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts deleted file mode 100644 index bfad23440..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const realConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js deleted file mode 100644 index b7b8c7b94..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.realConfig = { - kernelName: tfjs_1.Real, - backendName: 'tensorflow', - kernelFunc: function (args) { - var input = args.inputs.input; - var backend = args.backend; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input), { - name: 'Tout', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_FLOAT - } - ]; - var inputs = [input]; - return backend.executeSingleOutput(tfjs_1.Real, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts deleted file mode 100644 index 0d47935b3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const realDivConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js deleted file mode 100644 index 4406042c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.realDivConfig = { - kernelName: tfjs_1.RealDiv, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.RealDiv, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts deleted file mode 100644 index f79756b05..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const reciprocalConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js deleted file mode 100644 index 40279f140..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.reciprocalConfig = { - kernelName: tfjs_1.Reciprocal, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Reciprocal, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts deleted file mode 100644 index 1cd331fd2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const reluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js deleted file mode 100644 index 26fb3587e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.reluConfig = { - kernelName: tfjs_1.Relu, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Relu, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts deleted file mode 100644 index 8260e07a9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const relu6Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js deleted file mode 100644 index 5fbce31d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.relu6Config = { - kernelName: tfjs_1.Relu6, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Relu6, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts deleted file mode 100644 index 075fbc4f7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const reshapeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js deleted file mode 100644 index 0d77bf558..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.reshapeConfig = { - kernelName: tfjs_1.Reshape, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var shape = args.attrs.shape; - var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tshape', shapeTensor.dtype) - ]; - var res = backend.executeSingleOutput(tfjs_1.Reshape, opAttrs, [x, shapeTensor]); - shapeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts deleted file mode 100644 index cf007f0f4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const resizeBilinearConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js deleted file mode 100644 index 333fbf29a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.resizeBilinearConfig = { - kernelName: tfjs_1.ResizeBilinear, - backendName: 'tensorflow', - kernelFunc: function (args) { - var images = args.inputs.images; - var backend = args.backend; - var _a = args.attrs, alignCorners = _a.alignCorners, halfPixelCenters = _a.halfPixelCenters, size = _a.size; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), - { - name: 'align_corners', - type: backend.binding.TF_ATTR_BOOL, - value: alignCorners - }, - { - name: 'half_pixel_centers', - type: backend.binding.TF_ATTR_BOOL, - value: halfPixelCenters - }, - ]; - var newHeight = size[0], newWidth = size[1]; - var sizeTensor = tfjs_1.tensor1d([newHeight, newWidth], 'int32'); - var ret = backend.executeSingleOutput(tfjs_1.ResizeBilinear, opAttrs, [images, sizeTensor]); - sizeTensor.dispose(); - return ret; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts deleted file mode 100644 index 4cf98fb46..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const resizeBilinearGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js deleted file mode 100644 index 2c305847a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.resizeBilinearGradConfig = { - kernelName: tfjs_1.ResizeBilinearGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, images = _a.images, dy = _a.dy; - var backend = args.backend; - var alignCorners = args.attrs.alignCorners; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), { - name: 'align_corners', - type: backend.binding.TF_ATTR_BOOL, - value: alignCorners - } - ]; - return backend.executeSingleOutput(tfjs_1.ResizeBilinearGrad, opAttrs, [dy, images]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts deleted file mode 100644 index 24ca2a34e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const resizeNearestNeighborConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js deleted file mode 100644 index a5f55007c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.resizeNearestNeighborConfig = { - kernelName: tfjs_1.ResizeNearestNeighbor, - backendName: 'tensorflow', - kernelFunc: function (args) { - var images = args.inputs.images; - var backend = args.backend; - var _a = args.attrs, alignCorners = _a.alignCorners, halfPixelCenters = _a.halfPixelCenters, size = _a.size; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), - { - name: 'align_corners', - type: backend.binding.TF_ATTR_BOOL, - value: alignCorners - }, - { - name: 'half_pixel_centers', - type: backend.binding.TF_ATTR_BOOL, - value: halfPixelCenters - }, - ]; - var newHeight = size[0], newWidth = size[1]; - var sizeTensor = tfjs_1.tensor1d([newHeight, newWidth], 'int32'); - var res = backend.executeSingleOutput(tfjs_1.ResizeNearestNeighbor, opAttrs, [images, sizeTensor]); - sizeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts deleted file mode 100644 index 63c939d83..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const resizeNearestNeighborGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js deleted file mode 100644 index 0f67c4ba9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.resizeNearestNeighborGradConfig = { - kernelName: tfjs_1.ResizeNearestNeighborGrad, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, images = _a.images, dy = _a.dy; - var backend = args.backend; - var alignCorners = args.attrs.alignCorners; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), { - name: 'align_corners', - type: backend.binding.TF_ATTR_BOOL, - value: alignCorners - } - ]; - var _b = images.shape, origHeight = _b[1], origWidth = _b[2]; - var sizeTensor = tfjs_1.tensor1d([origHeight, origWidth], 'int32'); - var res = backend.executeSingleOutput(tfjs_1.ResizeNearestNeighborGrad, opAttrs, [dy, sizeTensor]); - sizeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts deleted file mode 100644 index 8b8b8fe61..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const reverseConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js deleted file mode 100644 index a03d18b49..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.reverseConfig = { - kernelName: tfjs_1.Reverse, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var dims = args.attrs.dims; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype) - ]; - var axes = tfjs_1.util.parseAxisParam(dims, x.shape); - var axisTensor = tfjs_1.tensor1d(axes, 'int32'); - var res = backend.executeSingleOutput('ReverseV2', opAttrs, [x, axisTensor]); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts deleted file mode 100644 index c09ce60d3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const roundConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js deleted file mode 100644 index 70964efd8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.roundConfig = { - kernelName: tfjs_1.Round, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Round, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts deleted file mode 100644 index d7a6a18e1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const rsqrtConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js deleted file mode 100644 index 70211b3c8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.rsqrtConfig = { - kernelName: tfjs_1.Rsqrt, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Rsqrt, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts deleted file mode 100644 index 991cdec30..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const scatterNdConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js deleted file mode 100644 index 123df0a51..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.scatterNdConfig = { - kernelName: tfjs_1.ScatterNd, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, indices = _a.indices, updates = _a.updates; - var backend = args.backend; - var shape = args.attrs.shape; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', updates.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32') - ]; - var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); - var ret = backend.executeSingleOutput(tfjs_1.ScatterNd, opAttrs, [indices, updates, shapeTensor]); - shapeTensor.dispose(); - return ret; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts deleted file mode 100644 index 37ce6635e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const selectConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js deleted file mode 100644 index 424392732..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.selectConfig = { - kernelName: tfjs_1.Select, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, condition = _a.condition, t = _a.t, e = _a.e; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(t.dtype, e.dtype))]; - return backend.executeSingleOutput(tfjs_1.Select, opAttrs, [condition, t, e]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts deleted file mode 100644 index b026150ee..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const seluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js deleted file mode 100644 index 48289f9b8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.seluConfig = { - kernelName: tfjs_1.Selu, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Selu, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts deleted file mode 100644 index 3ed66e9af..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sigmoidConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js deleted file mode 100644 index 47d213a97..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.sigmoidConfig = { - kernelName: tfjs_1.Sigmoid, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Sigmoid, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts deleted file mode 100644 index 45ec8a935..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const signConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js deleted file mode 100644 index c3d7f8378..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.signConfig = { - kernelName: tfjs_1.Sign, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Sign, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts deleted file mode 100644 index e7a3c77ec..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sinConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js deleted file mode 100644 index e15623658..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.sinConfig = { - kernelName: tfjs_1.Sin, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Sin, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts deleted file mode 100644 index f297afd86..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sinhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js deleted file mode 100644 index 4e4325fb4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.sinhConfig = { - kernelName: tfjs_1.Sinh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Sinh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts deleted file mode 100644 index 39f341a9a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sliceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js deleted file mode 100644 index b91407d79..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.sliceConfig = { - kernelName: tfjs_1.Slice, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, begin = _a.begin, size = _a.size; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Index', 'int32') - ]; - // Bind tensor values - var _b = tfjs_1.backend_util.slice_util.parseSliceParams(x, begin, size), begin_ = _b[0], size_ = _b[1]; - var beginTensor = tfjs_1.tensor1d(begin_, 'int32'); - var sizeTensor = tfjs_1.tensor1d(size_, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Slice, opAttrs, [x, beginTensor, sizeTensor]); - beginTensor.dispose(); - sizeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts deleted file mode 100644 index 37b8b3408..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const softmaxConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js deleted file mode 100644 index 63ab9d9f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.softmaxConfig = { - kernelName: 'Softmax', - backendName: 'tensorflow', - kernelFunc: function (_a) { - var inputs = _a.inputs, backend = _a.backend; - var logits = inputs.logits; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', logits.dtype)]; - var nodeBackend = backend; - return nodeBackend.executeSingleOutput('Softmax', opAttrs, [logits]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts deleted file mode 100644 index 6fe82a069..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const softplusConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js deleted file mode 100644 index 0996422c5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.softplusConfig = { - kernelName: tfjs_1.Softplus, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Softplus, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts deleted file mode 100644 index 34ce1b5f8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const spaceToBatchNDConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js deleted file mode 100644 index 24daa4539..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.spaceToBatchNDConfig = { - kernelName: tfjs_1.SpaceToBatchND, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, blockShape = _a.blockShape, paddings = _a.paddings; - var blockShapeTensor = tfjs_1.tensor1d(blockShape, 'int32'); - var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, paddings[0].length], 'int32'); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tblock_shape', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) - ]; - var res = backend.executeSingleOutput(tfjs_1.SpaceToBatchND, opAttrs, [x, blockShapeTensor, paddingsTensor]); - blockShapeTensor.dispose(); - paddingsTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts deleted file mode 100644 index 96dddde53..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sparseToDenseConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js deleted file mode 100644 index b6d5923f6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.sparseToDenseConfig = { - kernelName: tfjs_1.SparseToDense, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, sparseIndices = _a.sparseIndices, sparseValues = _a.sparseValues, defaultValue = _a.defaultValue; - var backend = args.backend; - var outputShape = args.attrs.outputShape; - var opAttrs = [ - { - name: 'validate_indices', - type: backend.binding.TF_ATTR_BOOL, - value: true - }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', sparseValues.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', sparseIndices.dtype) - ]; - var outputShapeTensor = tfjs_1.tensor1d(outputShape, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.SparseToDense, opAttrs, [sparseIndices, outputShapeTensor, sparseValues, defaultValue]); - outputShapeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts deleted file mode 100644 index df93fe243..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const splitVConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js deleted file mode 100644 index 4756aba37..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.splitVConfig = { - kernelName: tfjs_1.SplitV, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, numOrSizeSplits = _a.numOrSizeSplits, axis = _a.axis; - var $axis = tfjs_1.util.parseAxisParam(axis, x.shape)[0]; - var splitSizes = tfjs_1.backend_util.prepareSplitSize(x, numOrSizeSplits, $axis); - var opAttrs = [ - { - name: 'num_split', - type: backend.binding.TF_ATTR_INT, - value: splitSizes.length - }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x), { - name: 'Tlen', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_INT32 - } - ]; - var inputs = [x]; - return tfjs_1.tidy(function () { - inputs.push(tfjs_1.tensor1d(splitSizes, 'int32')); - inputs.push(tfjs_1.scalar($axis, 'int32')); - return backend.executeMultipleOutputs(tfjs_1.SplitV, opAttrs, inputs, splitSizes.length); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts deleted file mode 100644 index 7927da0bc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sqrtConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js deleted file mode 100644 index 0db05727f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.sqrtConfig = { - kernelName: tfjs_1.Sqrt, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Sqrt, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts deleted file mode 100644 index 13ff3b31f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const squareConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js deleted file mode 100644 index 9242ce267..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.squareConfig = { - kernelName: tfjs_1.Square, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Square, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts deleted file mode 100644 index 228da9e04..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const squaredDifferenceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js deleted file mode 100644 index 92896f7ff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.squaredDifferenceConfig = { - kernelName: tfjs_1.SquaredDifference, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype)]; - return backend.executeSingleOutput(tfjs_1.SquaredDifference, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts deleted file mode 100644 index c1b3699fb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const stepConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js deleted file mode 100644 index c1d004155..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.stepConfig = { - kernelName: tfjs_1.Step, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var alpha = args.attrs.alpha; - var dtype = x.dtype; - return tfjs_1.tidy(function () { - var nans = tfjs_1.isNaN(x); - var stepNoNans = tfjs_1.where(tfjs_1.greater(x, tfjs_1.scalar(0, dtype)), tfjs_1.ones(x.shape), tfjs_1.fill(x.shape, alpha, dtype)); - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(x.dtype, stepNoNans.dtype))]; - return backend.executeSingleOutput('Select', opAttrs, [nans, x, stepNoNans]); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts deleted file mode 100644 index f9eef24cd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const stridedSliceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js deleted file mode 100644 index 64b3e19e1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.stridedSliceConfig = { - kernelName: tfjs_1.StridedSlice, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, beginMask = _a.beginMask, endMask = _a.endMask, ellipsisMask = _a.ellipsisMask, newAxisMask = _a.newAxisMask, shrinkAxisMask = _a.shrinkAxisMask; - var _b = args.attrs, begin = _b.begin, end = _b.end, strides = _b.strides; - // make a copy because it may be modified in-place further down. - begin = begin.slice(); - end = end.slice(); - if (strides == null) { - strides = new Array(begin.length); - } - var ellipsisAxes = tfjs_1.backend_util.slice_util.maskToAxes(ellipsisMask); - if (ellipsisAxes.length > 1) { - throw new Error('Multiple ellipses in slice is not allowed.'); - } - if (ellipsisMask !== 0 && newAxisMask !== 0) { - throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.'); - } - if (ellipsisMask !== 0 && shrinkAxisMask !== 0) { - throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.'); - } - return tfjs_1.tidy(function () { - var numInterpolatedAxes = x.rank - begin.length; - // Expand the dims of x based on the newAxisMask. - var expandAxes = tfjs_1.backend_util.slice_util.maskToAxes(newAxisMask); - var newShape = x.shape.slice(); - expandAxes.forEach(function (axis) { - begin[axis] = 0; - end[axis] = 1; - newShape.splice(axis, 0, 1); - }); - x = tfjs_1.reshape(x, newShape); - var _a = tfjs_1.backend_util.slice_util.getNormalizedAxes(x.shape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask), normalizedBegin = _a.begin, normalizedEnd = _a.end, normalizedStrides = _a.strides; - begin = normalizedBegin; - end = normalizedEnd; - strides = normalizedStrides; - var shrinkAxes = tfjs_1.backend_util.slice_util.maskToAxes(shrinkAxisMask); - // Adjust the ends based on the shrink mask. - shrinkAxes.forEach(function (axis) { - end[axis] = begin[axis] + 1; - strides[axis] = 1; - }); - // Figure out the output shape. - var size = tfjs_1.backend_util.slice_util.computeOutShape(begin, end, strides); - // Remove the axes based on shrinkMask. - var outShape = size.filter(function (_, axis) { return shrinkAxes.indexOf(axis) === -1; }); - var nonStrided = strides.every(function (v) { return v === 1; }); - if (nonStrided) { - return tfjs_1.reshape(tfjs_1.slice(x, begin, size), outShape); - } - var beginTensor = tfjs_1.tensor1d(begin, 'int32'); - for (var axis = 0; axis < end.length; axis++) { - // Unlike Numpy, when the strides are negative, TF C uses -n-1 instead - // of -1 as the "end" in order to include the first element. - if (strides[axis] < 0 && end[axis] === -1) { - end[axis] -= x.shape[axis]; - } - } - var endTensor = tfjs_1.tensor1d(end, 'int32'); - var stridesTensor = tfjs_1.tensor1d(strides, 'int32'); - // Because tfjs allows begin, end and strides to be of different lengths - // It has custom code (see above to handle the masking), so we do not - // pass the mask info to the tensorflow backend. - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Index', 'int32'), - { name: 'begin_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, - { name: 'end_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, - { name: 'ellipsis_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, - { name: 'new_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, - { name: 'shrink_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0 } - ]; - var res = backend.executeSingleOutput(tfjs_1.StridedSlice, opAttrs, [x, beginTensor, endTensor, stridesTensor]); - return tfjs_1.reshape(res, outShape); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts deleted file mode 100644 index 241a478fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const subConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js deleted file mode 100644 index 8ce3f5ab2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.subConfig = { - kernelName: tfjs_1.Sub, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b; - var backend = args.backend; - var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(tfjs_1.Sub, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts deleted file mode 100644 index 7afb1ec8a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const sumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js deleted file mode 100644 index fc1127dbc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.sumConfig = { - kernelName: tfjs_1.Sum, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; - var axes = tfjs_1.util.parseAxisParam(axis, x.shape); - var axisTensor = tfjs_1.tensor1d(axes, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Sum, backend.createReductionOpAttrs(x, keepDims), [x, axisTensor]); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts deleted file mode 100644 index 8ad63abe8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const tanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js deleted file mode 100644 index 507527171..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.tanConfig = { - kernelName: tfjs_1.Tan, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Tan, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts deleted file mode 100644 index 47b92dd8b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const tanhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js deleted file mode 100644 index 159aeeef9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.tanhConfig = { - kernelName: tfjs_1.Tanh, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - return backend.executeSingleInput(tfjs_1.Tanh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts deleted file mode 100644 index 33cf0482f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const tileConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js deleted file mode 100644 index 9e2eb1edd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.tileConfig = { - kernelName: tfjs_1.Tile, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var reps = args.attrs.reps; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tmultiples', 'int32') - ]; - var multiples = tfjs_1.tensor1d(reps, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.Tile, opAttrs, [x, multiples]); - multiples.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts deleted file mode 100644 index 7e2029e0c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const topKConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js deleted file mode 100644 index 5a360c5e0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var util_1 = require("util"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.topKConfig = { - kernelName: tfjs_1.TopK, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var _a = args.attrs, k = _a.k, sorted = _a.sorted; - var kCount = util_1.isNullOrUndefined(k) ? 1 : k; - var isSorted = util_1.isNullOrUndefined(sorted) ? true : sorted; - var opAttrs = [ - { name: 'sorted', type: backend.binding.TF_ATTR_BOOL, value: isSorted }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - ]; - var kTensor = tfjs_1.scalar(kCount, 'int32'); - // 'TopKV2' has two-hard coded output attributes: - // TODO(yassogba) consider renamine constant in kernel names; - var res = backend.executeMultipleOutputs('TopKV2', opAttrs, [x, kTensor], 2); - kTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts deleted file mode 100644 index 199b13686..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const transposeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js deleted file mode 100644 index 4fc5faba1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.transposeConfig = { - kernelName: tfjs_1.Transpose, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var perm = args.attrs.perm; - var permTensor = tfjs_1.tensor1d(perm, 'int32'); - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tperm', 'int32') - ]; - var res = backend.executeSingleOutput(tfjs_1.Transpose, opAttrs, [x, permTensor]); - permTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts deleted file mode 100644 index 97f9fa19a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const unpackConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js deleted file mode 100644 index 26d34e115..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.unpackConfig = { - kernelName: tfjs_1.Unpack, - backendName: 'tensorflow', - kernelFunc: function (args) { - var value = args.inputs.value; - var backend = args.backend; - var axis = args.attrs.axis; - if (axis < 0) { - axis += value.shape.length; - } - if (axis >= value.shape.length) { - throw new Error("Invalid axis supplied: " + axis + " shape length: " + value.shape.length); - } - var num = value.shape[axis]; - var opAttrs = [ - { name: 'num', type: backend.binding.TF_ATTR_INT, value: num }, - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', value.dtype), - { name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis } - ]; - return backend.executeMultipleOutputs(tfjs_1.Unpack, opAttrs, [value], num); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts deleted file mode 100644 index 9fc96a6ed..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const unsortedSegmentSumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js deleted file mode 100644 index aa14cf88b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); -exports.unsortedSegmentSumConfig = { - kernelName: tfjs_1.UnsortedSegmentSum, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, x = _a.x, segmentIds = _a.segmentIds; - var backend = args.backend; - var numSegments = args.attrs.numSegments; - var opAttrs = [ - nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32'), - nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tnumsegments', 'int32') - ]; - var numSegmentsT = tfjs_1.scalar(numSegments, 'int32'); - var res = backend.executeSingleOutput(tfjs_1.UnsortedSegmentSum, opAttrs, [x, segmentIds, numSegmentsT]); - numSegmentsT.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts deleted file mode 100644 index 31415b63c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const zerosLikeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js deleted file mode 100644 index 8ea88d8bd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports.zerosLikeConfig = { - kernelName: tfjs_1.ZerosLike, - backendName: 'tensorflow', - kernelFunc: function (args) { - var x = args.inputs.x; - var backend = args.backend; - var opAttrs = [{ - name: 'T', - type: backend.binding.TF_ATTR_TYPE, - value: backend.getDTypeInteger(x.dtype) - }]; - return backend.executeSingleOutput(tfjs_1.ZerosLike, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts deleted file mode 100644 index d7976022d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts +++ /dev/null @@ -1,18 +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 { KernelConfig } from '@tensorflow/tfjs'; -export declare const _fusedMatMulConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js deleted file mode 100644 index fc9ab3824..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -exports._fusedMatMulConfig = { - kernelName: tfjs_1._FusedMatMul, - backendName: 'tensorflow', - kernelFunc: function (args) { - var _a = args.inputs, a = _a.a, b = _a.b, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; - var backend = args.backend; - var _b = args.attrs, transposeA = _b.transposeA, transposeB = _b.transposeB, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; - // Core TensorFlow does not have a fused BatchMatMul op. Combine calls to - // achieve the same results: - return tfjs_1.tidy(function () { - var result = tfjs_1.matMul(a, b, transposeA, transposeB); - if (bias != null) { - result = tfjs_1.add(result, bias); - } - result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); - return result; - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts deleted file mode 100644 index d892fcd71..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts +++ /dev/null @@ -1,37 +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. - * ============================================================================= - */ -/** - * Public API symbols under the tf.node.* namespace. - */ -import { tensorBoard } from './callbacks'; -import { decodeBmp, decodeGif, decodeImage, decodeJpeg, decodePng, encodeJpeg, encodePng } from './image'; -import { getMetaGraphsFromSavedModel, getNumOfSavedModels, loadSavedModel } from './saved_model'; -import { summaryFileWriter } from './tensorboard'; -export declare const node: { - decodeImage: typeof decodeImage; - decodeBmp: typeof decodeBmp; - decodeGif: typeof decodeGif; - decodePng: typeof decodePng; - decodeJpeg: typeof decodeJpeg; - encodeJpeg: typeof encodeJpeg; - encodePng: typeof encodePng; - summaryFileWriter: typeof summaryFileWriter; - tensorBoard: typeof tensorBoard; - getMetaGraphsFromSavedModel: typeof getMetaGraphsFromSavedModel; - getNumOfSavedModels: typeof getNumOfSavedModels; - loadSavedModel: typeof loadSavedModel; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js deleted file mode 100644 index 08e8938fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Public API symbols under the tf.node.* namespace. - */ -var callbacks_1 = require("./callbacks"); -var image_1 = require("./image"); -var saved_model_1 = require("./saved_model"); -var tensorboard_1 = require("./tensorboard"); -exports.node = { - decodeImage: image_1.decodeImage, - decodeBmp: image_1.decodeBmp, - decodeGif: image_1.decodeGif, - decodePng: image_1.decodePng, - decodeJpeg: image_1.decodeJpeg, - encodeJpeg: image_1.encodeJpeg, - encodePng: image_1.encodePng, - summaryFileWriter: tensorboard_1.summaryFileWriter, - tensorBoard: callbacks_1.tensorBoard, - getMetaGraphsFromSavedModel: saved_model_1.getMetaGraphsFromSavedModel, - getNumOfSavedModels: saved_model_1.getNumOfSavedModels, - loadSavedModel: saved_model_1.loadSavedModel -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts deleted file mode 100644 index 76a090969..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts +++ /dev/null @@ -1,112 +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'; -import { backend_util, BackendTimingInfo, DataId, DataType, KernelBackend, ModelTensorInfo, Scalar, ScalarLike, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorInfo } from '@tensorflow/tfjs'; -import { TFEOpAttr, TFJSBinding } from './tfjs_binding'; -export declare class NodeJSKernelBackend extends KernelBackend { - binding: TFJSBinding; - isGPUPackage: boolean; - isUsingGpuDevice: boolean; - private tensorMap; - constructor(binding: TFJSBinding, packageName: string); - getDTypeInteger(dtype: DataType): number; - private typeAttributeFromTensor; - private createOutputTensor; - private getInputTensorIds; - createReductionOpAttrs(tensor: TensorInfo, keepDims?: boolean): TFEOpAttr[]; - floatPrecision(): 16 | 32; - epsilon(): number; - /** - * Executes an op that has a single input and output. - * - * Helper function to wrap executeSingleOutput in a particular case. - * @param name The name of the Op to execute. - * @param input The input Tensor for the Op. - */ - executeSingleInput(name: string, input: TensorInfo): Tensor; - /** - * Executes a TensorFlow Eager Op that provides one output Tensor. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @return A resulting Tensor from Op execution. - */ - executeSingleOutput(name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[]): Tensor; - /** - * Executes a TensorFlow Eager Op that provides multiple output Tensors. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @param numOutputs The number of output Tensors for Op execution. - * @return A resulting Tensor array from Op execution. - */ - executeMultipleOutputs(name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[], numOutputs: number): Tensor[]; - numDataIds(): number; - dispose(): void; - read(dataId: DataId): Promise; - readSync(dataId: DataId): backend_util.BackendValues; - /** - * Dispose the memory if the dataId has 0 refCount. Return true if the memory - * is released, false otherwise. - * @param dataId - * @oaram force Optional, remove the data regardless of refCount - */ - disposeData(dataId: DataId, force?: boolean): boolean; - /** Return refCount of a `TensorData`. */ - refCount(dataId: DataId): number; - incRef(dataId: DataId): void; - move(dataId: DataId, values: backend_util.BackendValues, shape: number[], dtype: DataType, refCount: number): void; - write(values: backend_util.BackendValues, shape: number[], dtype: DataType): DataId; - applyActivation(input: T, activation: string, preluActivationWeights?: Tensor, leakyreluAlpha?: number): T; - divide(a: Tensor, b: Tensor): Tensor; - divNoNan(a: Tensor, b: Tensor): Tensor; - where(condition: Tensor): Tensor2D; - topKValues(x: T, k: number): Tensor1D; - topKIndices(x: Tensor, k: number): Tensor1D; - int(x: T): T; - decodeJpeg(contents: Uint8Array, channels: number, ratio: number, fancyUpscaling: boolean, tryRecoverTruncated: boolean, acceptableFraction: number, dctMethod: string): Tensor3D; - decodePng(contents: Uint8Array, channels: number): Tensor3D; - decodeBmp(contents: Uint8Array, channels: number): Tensor3D; - decodeGif(contents: Uint8Array): Tensor4D; - executeEncodeImageOp(name: string, opAttrs: TFEOpAttr[], imageData: Uint8Array, imageShape: number[]): Tensor; - encodeJpeg(imageData: Uint8Array, imageShape: number[], format: '' | 'grayscale' | 'rgb', quality: number, progressive: boolean, optimizeSize: boolean, chromaDownsampling: boolean, densityUnit: 'in' | 'cm', xDensity: number, yDensity: number, xmpMetadata: string): Tensor; - encodePng(imageData: Uint8Array, imageShape: number[], compression: number): Tensor; - deleteSavedModel(id: number): void; - loadSavedModelMetaGraph(path: string, tags: string): number; - private getMappedInputTensorIds; - runSavedModel(id: number, inputs: Tensor[], inputTensorInfos: ModelTensorInfo[], outputOpNames: string[]): Tensor[]; - summaryWriter(logdir: string): Tensor1D; - createSummaryFileWriter(resourceHandle: Tensor, logdir: string, maxQueue?: number, flushMillis?: number, filenameSuffix?: string): void; - writeScalarSummary(resourceHandle: Tensor, step: number, name: string, value: Scalar | number): void; - flushSummaryWriter(resourceHandle: Tensor): void; - memory(): { - unreliable: boolean; - }; - time(f: () => void): Promise; - getNumOfSavedModels(): number; -} -/** Returns an instance of the Node.js backend. */ -export declare function nodeBackend(): NodeJSKernelBackend; -/** Returns the TF dtype for a given DataType. */ -export declare function getTFDType(dataType: tf.DataType): number; -/** - * Creates a TFEOpAttr for a 'type' OpDef attribute from a Tensor or list of - * Tensors. - */ -export declare function createTensorsTypeOpAttr(attrName: string, tensorsOrDtype: tf.Tensor | tf.Tensor[] | tf.DataType): TFEOpAttr; -export declare function createOpAttr(attrName: string, tensorsOrDtype: tf.Tensor | tf.Tensor[] | tf.DataType, value: ScalarLike): TFEOpAttr; -export declare function ensureTensorflowBackend(): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js deleted file mode 100644 index 4a7966086..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js +++ /dev/null @@ -1,600 +0,0 @@ -"use strict"; -/** - * @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 __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -var tfjs_1 = require("@tensorflow/tfjs"); -var util_1 = require("util"); -var int64_tensors_1 = require("./int64_tensors"); -var NodeJSKernelBackend = /** @class */ (function (_super) { - __extends(NodeJSKernelBackend, _super); - function NodeJSKernelBackend(binding, packageName) { - var _this = _super.call(this) || this; - _this.binding = binding; - _this.isGPUPackage = packageName === '@tensorflow/tfjs-node-gpu'; - _this.isUsingGpuDevice = _this.binding.isUsingGpuDevice(); - _this.tensorMap = new tf.DataStorage(_this, tf.engine()); - return _this; - } - NodeJSKernelBackend.prototype.getDTypeInteger = function (dtype) { - switch (dtype) { - case 'float32': - return this.binding.TF_FLOAT; - case 'int32': - return this.binding.TF_INT32; - case 'bool': - return this.binding.TF_BOOL; - case 'complex64': - return this.binding.TF_COMPLEX64; - case 'string': - return this.binding.TF_STRING; - default: - throw new Error("Unsupported DType: " + dtype); - } - }; - NodeJSKernelBackend.prototype.typeAttributeFromTensor = function (value) { - return this.getDTypeInteger(value.dtype); - }; - // Creates a new Tensor and maps the dataId to the passed in ID. - NodeJSKernelBackend.prototype.createOutputTensor = function (metadata) { - var newId = {}; - this.tensorMap.set(newId, { - shape: metadata.shape, - dtype: metadata.dtype, - id: metadata.id, - values: null, - refCount: 1 - }); - var dtype; - switch (metadata.dtype) { - case this.binding.TF_FLOAT: - dtype = 'float32'; - break; - case this.binding.TF_INT32: - dtype = 'int32'; - break; - case this.binding.TF_INT64: - console.warn('INT64 output tensor will be stored as BigInt64Array.'); - // INT64 is not supported in TFJS yet, cast it to int32. - dtype = 'int32'; - break; - case this.binding.TF_BOOL: - dtype = 'bool'; - break; - case this.binding.TF_COMPLEX64: - dtype = 'complex64'; - break; - case this.binding.TF_STRING: - dtype = 'string'; - break; - case this.binding.TF_RESOURCE: - // NOTE(cais): We currently represent resource-type Tensors - // as string of ubytes. - dtype = 'string'; - break; - case this.binding.TF_UINT8: - // TensorFlow uses UINT8 as dtype for image tensor. UINT8 is not - // supported in TFJS yet, cast it to int32. - dtype = 'int32'; - break; - default: - throw new Error("Unknown dtype enum " + metadata.dtype); - } - // TODO(yassogba) Enable this once all the kernels are removed from backend. - // We can then change the return type from Tensor to TensorInfo. - // return {dataId: newId, shape: metadata.shape, dtype}; - return tf.engine().makeTensorFromDataId(newId, metadata.shape, dtype); - }; - // Prepares Tensor instances for Op execution. - NodeJSKernelBackend.prototype.getInputTensorIds = function (tensors) { - var ids = []; - for (var i = 0; i < tensors.length; i++) { - if (tensors[i] instanceof int64_tensors_1.Int64Scalar) { - // Then `tensors[i]` is a Int64Scalar, which we currently represent - // using an `Int32Array`. - var value = tensors[i].valueArray; - var id = this.binding.createTensor([], this.binding.TF_INT64, value); - ids.push(id); - } - else { - var info = this.tensorMap.get(tensors[i].dataId); - // TODO - what about ID in this case? Handle in write()?? - if (info.values != null) { - // Values were delayed to write into the TensorHandle. Do that before - // Op execution and clear stored values. - info.id = - this.binding.createTensor(info.shape, info.dtype, info.values); - info.values = null; - } - ids.push(info.id); - } - } - return ids; - }; - NodeJSKernelBackend.prototype.createReductionOpAttrs = function (tensor, keepDims) { - if (keepDims === void 0) { keepDims = false; } - return [ - { name: 'keep_dims', type: this.binding.TF_ATTR_BOOL, value: keepDims }, - createTensorsTypeOpAttr('T', tensor.dtype), - createTensorsTypeOpAttr('Tidx', 'int32') - ]; - }; - NodeJSKernelBackend.prototype.floatPrecision = function () { - return 32; - }; - NodeJSKernelBackend.prototype.epsilon = function () { - return _super.prototype.epsilon.call(this); - }; - /** - * Executes an op that has a single input and output. - * - * Helper function to wrap executeSingleOutput in a particular case. - * @param name The name of the Op to execute. - * @param input The input Tensor for the Op. - */ - NodeJSKernelBackend.prototype.executeSingleInput = function (name, input) { - var opAttrs = [createTensorsTypeOpAttr('T', input.dtype)]; - return this.executeSingleOutput(name, opAttrs, [input]); - }; - /** - * Executes a TensorFlow Eager Op that provides one output Tensor. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @return A resulting Tensor from Op execution. - */ - NodeJSKernelBackend.prototype.executeSingleOutput = function (name, opAttrs, inputs) { - var outputMetadata = this.binding.executeOp(name, opAttrs, this.getInputTensorIds(inputs), 1); - return this.createOutputTensor(outputMetadata[0]); - }; - /** - * Executes a TensorFlow Eager Op that provides multiple output Tensors. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @param numOutputs The number of output Tensors for Op execution. - * @return A resulting Tensor array from Op execution. - */ - NodeJSKernelBackend.prototype.executeMultipleOutputs = function (name, opAttrs, inputs, numOutputs) { - var _this = this; - var outputMetadata = this.binding.executeOp(name, opAttrs, this.getInputTensorIds(inputs), numOutputs); - return outputMetadata.map(function (m) { return _this.createOutputTensor(m); }); - }; - NodeJSKernelBackend.prototype.numDataIds = function () { - return this.tensorMap.numDataIds(); - }; - NodeJSKernelBackend.prototype.dispose = function () { }; - NodeJSKernelBackend.prototype.read = function (dataId) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.readSync(dataId)]; - }); - }); - }; - NodeJSKernelBackend.prototype.readSync = function (dataId) { - if (!this.tensorMap.has(dataId)) { - throw new Error("Tensor " + dataId + " was not registered!"); - } - var info = this.tensorMap.get(dataId); - if (info.values != null) { - return info.values; - } - else { - return this.binding.tensorDataSync(info.id); - } - }; - /** - * Dispose the memory if the dataId has 0 refCount. Return true if the memory - * is released, false otherwise. - * @param dataId - * @oaram force Optional, remove the data regardless of refCount - */ - NodeJSKernelBackend.prototype.disposeData = function (dataId, force) { - if (force === void 0) { force = false; } - // No-op if already disposed. - if (this.tensorMap.has(dataId)) { - var id = this.tensorMap.get(dataId).id; - this.tensorMap.get(dataId).refCount--; - if (!force && this.tensorMap.get(dataId).refCount > 0) { - return false; - } - if (id != null && id >= 0) { - this.binding.deleteTensor(id); - } - this.tensorMap.delete(dataId); - } - return true; - }; - /** Return refCount of a `TensorData`. */ - NodeJSKernelBackend.prototype.refCount = function (dataId) { - if (this.tensorMap.has(dataId)) { - var tensorData = this.tensorMap.get(dataId); - return tensorData.refCount; - } - return 0; - }; - NodeJSKernelBackend.prototype.incRef = function (dataId) { - this.tensorMap.get(dataId).refCount++; - }; - NodeJSKernelBackend.prototype.move = function (dataId, values, shape, dtype, refCount) { - this.tensorMap.set(dataId, { shape: shape, dtype: getTFDType(dtype), values: values, id: -1, refCount: refCount }); - }; - NodeJSKernelBackend.prototype.write = function (values, shape, dtype) { - var dataId = {}; - this.move(dataId, values, shape, dtype, 1); - return dataId; - }; - NodeJSKernelBackend.prototype.applyActivation = function (input, activation, preluActivationWeights, leakyreluAlpha) { - var result = input; - if (activation != null) { - if (activation === 'linear') { - // No-op - } - else if (activation === 'relu') { - result = tf.relu(result); - } - else if (activation === 'prelu') { - result = tf.prelu(result, preluActivationWeights); - } - else if (activation === 'leakyrelu') { - result = tf.leakyRelu(result, leakyreluAlpha); - } - else if (activation === 'elu') { - result = tf.elu(result); - } - else if (activation === 'relu6') { - result = tf.relu6(result); - } - else if (activation === 'sigmoid') { - result = tf.sigmoid(result); - } - else { - throw new Error("Activation: " + activation + " has not been implemented for the Node.js backend"); - } - } - return result; - }; - NodeJSKernelBackend.prototype.divide = function (a, b) { - var opAttrs = [createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return this.executeSingleOutput('Div', opAttrs, [a, b]); - }; - NodeJSKernelBackend.prototype.divNoNan = function (a, b) { - var opAttrs = [createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; - return this.executeSingleOutput('DivNoNan', opAttrs, [a, b]); - }; - NodeJSKernelBackend.prototype.where = function (condition) { - return this.executeSingleOutput('Where', [], [condition]); - }; - NodeJSKernelBackend.prototype.topKValues = function (x, k) { - throw new Error('Method not implemented.'); - }; - NodeJSKernelBackend.prototype.topKIndices = function (x, k) { - throw new Error('Method not implemented.'); - }; - NodeJSKernelBackend.prototype.int = function (x) { - throw new Error('Method not implemented.'); - }; - NodeJSKernelBackend.prototype.decodeJpeg = function (contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, acceptableFraction, dctMethod) { - var opAttrs = [ - { name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }, - { name: 'ratio', type: this.binding.TF_ATTR_INT, value: ratio }, { - name: 'fancy_upscaling', - type: this.binding.TF_ATTR_BOOL, - value: fancyUpscaling - }, - { - name: 'try_recover_truncated', - type: this.binding.TF_ATTR_BOOL, - value: tryRecoverTruncated - }, - { - name: 'acceptable_fraction', - type: this.binding.TF_ATTR_FLOAT, - value: acceptableFraction - }, - { name: 'dct_method', type: this.binding.TF_ATTR_STRING, value: dctMethod } - ]; - var inputArgs = [tfjs_1.scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeJpeg', opAttrs, inputArgs); - }; - NodeJSKernelBackend.prototype.decodePng = function (contents, channels) { - var opAttrs = [{ name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }]; - var inputArgs = [tfjs_1.scalar(contents, 'string')]; - return this.executeSingleOutput('DecodePng', opAttrs, inputArgs); - }; - NodeJSKernelBackend.prototype.decodeBmp = function (contents, channels) { - var opAttrs = [{ name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }]; - var inputArgs = [tfjs_1.scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeBmp', opAttrs, inputArgs); - }; - NodeJSKernelBackend.prototype.decodeGif = function (contents) { - var inputArgs = [tfjs_1.scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeGif', [], inputArgs); - }; - NodeJSKernelBackend.prototype.executeEncodeImageOp = function (name, opAttrs, imageData, imageShape) { - var inputTensorId = this.binding.createTensor(imageShape, this.binding.TF_UINT8, imageData); - var outputMetadata = this.binding.executeOp(name, opAttrs, [inputTensorId], 1); - var outputTensorInfo = outputMetadata[0]; - // prevent the tensor data from being converted to a UTF8 string, since - // the encoded data is not valid UTF8 - outputTensorInfo.dtype = this.binding.TF_UINT8; - return this.createOutputTensor(outputTensorInfo); - }; - NodeJSKernelBackend.prototype.encodeJpeg = function (imageData, imageShape, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata) { - var opAttrs = [ - { name: 'format', type: this.binding.TF_ATTR_STRING, value: format }, - { name: 'quality', type: this.binding.TF_ATTR_INT, value: quality }, { - name: 'progressive', - type: this.binding.TF_ATTR_BOOL, - value: progressive - }, - { - name: 'optimize_size', - type: this.binding.TF_ATTR_BOOL, - value: optimizeSize - }, - { - name: 'chroma_downsampling', - type: this.binding.TF_ATTR_BOOL, - value: chromaDownsampling - }, - { - name: 'density_unit', - type: this.binding.TF_ATTR_STRING, - value: densityUnit - }, - { name: 'x_density', type: this.binding.TF_ATTR_INT, value: xDensity }, - { name: 'y_density', type: this.binding.TF_ATTR_INT, value: yDensity }, { - name: 'xmp_metadata', - type: this.binding.TF_ATTR_STRING, - value: xmpMetadata - } - ]; - return this.executeEncodeImageOp('EncodeJpeg', opAttrs, imageData, imageShape); - }; - NodeJSKernelBackend.prototype.encodePng = function (imageData, imageShape, compression) { - var opAttrs = [ - { name: 'compression', type: this.binding.TF_ATTR_INT, value: compression } - ]; - return this.executeEncodeImageOp('EncodePng', opAttrs, imageData, imageShape); - }; - NodeJSKernelBackend.prototype.deleteSavedModel = function (id) { - this.binding.deleteSavedModel(id); - }; - NodeJSKernelBackend.prototype.loadSavedModelMetaGraph = function (path, tags) { - return this.binding.loadSavedModel(path, tags); - }; - NodeJSKernelBackend.prototype.getMappedInputTensorIds = function (inputs, inputTensorInfos) { - var tensorIds = this.getInputTensorIds(inputs); - for (var i = 0; i < inputs.length; i++) { - if (inputTensorInfos[i] != null) { - if (inputTensorInfos[i].tfDtype === 'DT_UINT8') { - var data = Uint8Array.from(inputs[i].dataSync()); - var inputTensorId = this.binding.createTensor(inputs[i].shape, this.binding.TF_UINT8, data); - tensorIds[i] = inputTensorId; - } - else if (inputTensorInfos[i].tfDtype === 'DT_INT64') { - var data = int64_tensors_1.encodeInt32ArrayAsInt64(inputs[i].dataSync()); - var inputTensorId = this.binding.createTensor(inputs[i].shape, this.binding.TF_INT64, data); - tensorIds[i] = inputTensorId; - } - } - } - return tensorIds; - }; - NodeJSKernelBackend.prototype.runSavedModel = function (id, inputs, inputTensorInfos, outputOpNames) { - var _this = this; - var outputMetadata = this.binding.runSavedModel(id, this.getMappedInputTensorIds(inputs, inputTensorInfos), inputTensorInfos.map(function (info) { return info.name; }).join(','), outputOpNames.join(',')); - return outputMetadata.map(function (m) { return _this.createOutputTensor(m); }); - }; - // ------------------------------------------------------------ - // TensorBoard-related (tfjs-node-specific) backend kernels. - NodeJSKernelBackend.prototype.summaryWriter = function (logdir) { - var opAttrs = [ - { - name: 'shared_name', - type: this.binding.TF_ATTR_STRING, - value: "logdir:" + logdir - }, - { name: 'container', type: this.binding.TF_ATTR_STRING, value: '' } - ]; - var writerResource = this.executeSingleOutput('SummaryWriter', opAttrs, []); - return writerResource; - }; - NodeJSKernelBackend.prototype.createSummaryFileWriter = function (resourceHandle, logdir, maxQueue, flushMillis, filenameSuffix) { - var inputArgs = [ - resourceHandle, tfjs_1.scalar(logdir), - tfjs_1.scalar(maxQueue == null ? 10 : maxQueue, 'int32'), - tfjs_1.scalar(flushMillis == null ? 2 * 60 * 1000 : flushMillis, 'int32'), - tfjs_1.scalar(filenameSuffix == null ? '.v2' : filenameSuffix) - ]; - this.executeMultipleOutputs('CreateSummaryFileWriter', [], inputArgs, 0); - }; - NodeJSKernelBackend.prototype.writeScalarSummary = function (resourceHandle, step, name, value) { - var _this = this; - tfjs_1.tidy(function () { - tfjs_1.util.assert(Number.isInteger(step), function () { return "step is expected to be an integer, but is instead " + step; }); - var inputArgs = [resourceHandle, new int64_tensors_1.Int64Scalar(step), tfjs_1.scalar(name, 'string')]; - var typeAttr; - if (typeof value === 'number') { - inputArgs.push(tfjs_1.scalar(value)); - typeAttr = _this.binding.TF_FLOAT; - } - else { - // `value` is a Scalar. - tfjs_1.util.assert(value.rank === 0, function () { return "A non-scalar tensor (rank " + value.rank + ") is passed to " + - "writeScalarSummary()"; }); - inputArgs.push(value); - typeAttr = _this.typeAttributeFromTensor(value); - } - var opAttrs = [{ name: 'T', type: _this.binding.TF_ATTR_TYPE, value: typeAttr }]; - _this.binding.executeOp('WriteScalarSummary', opAttrs, _this.getInputTensorIds(inputArgs), 0); - }); - }; - NodeJSKernelBackend.prototype.flushSummaryWriter = function (resourceHandle) { - var inputArgs = [resourceHandle]; - this.executeMultipleOutputs('FlushSummaryWriter', [], inputArgs, 0); - }; - // ~ TensorBoard-related (tfjs-node-specific) backend kernels. - // ------------------------------------------------------------ - NodeJSKernelBackend.prototype.memory = function () { - // Due to automatic garbage collection, the numbers are unreliable. - // TODO(kreeger): Since there is finalization in C, count the true - // number of undisposed tensors. - return { unreliable: true }; - }; - NodeJSKernelBackend.prototype.time = function (f) { - return __awaiter(this, void 0, void 0, function () { - var start, elapsed; - return __generator(this, function (_a) { - start = process.hrtime(); - f(); - elapsed = process.hrtime(start); - return [2 /*return*/, { kernelMs: elapsed[0] * 1000 + elapsed[1] / 1000000 }]; - }); - }); - }; - NodeJSKernelBackend.prototype.getNumOfSavedModels = function () { - return this.binding.getNumOfSavedModels(); - }; - return NodeJSKernelBackend; -}(tfjs_1.KernelBackend)); -exports.NodeJSKernelBackend = NodeJSKernelBackend; -/** Returns an instance of the Node.js backend. */ -function nodeBackend() { - return tf.findBackend('tensorflow'); -} -exports.nodeBackend = nodeBackend; -/** Returns the TF dtype for a given DataType. */ -function getTFDType(dataType) { - var binding = nodeBackend().binding; - switch (dataType) { - case 'float32': - return binding.TF_FLOAT; - case 'int32': - return binding.TF_INT32; - case 'bool': - return binding.TF_BOOL; - case 'complex64': - return binding.TF_COMPLEX64; - case 'string': - return binding.TF_STRING; - // tslint:disable-next-line:no-any - case 'int64': - // int64 is not a generally supported dtype in TensorFlow.js - // (tfjs-core). However, it needs to be included here for the purpose of - // writing the `step` value to TensorBoard via WriteScalarSummary and - // other op kernels. - return binding.TF_INT64; - default: - var errorMessage = "Unknown dtype: " + dataType; - throw new Error(errorMessage); - } -} -exports.getTFDType = getTFDType; -/** - * Creates a TFEOpAttr for a 'type' OpDef attribute from a Tensor or list of - * Tensors. - */ -function createTensorsTypeOpAttr(attrName, tensorsOrDtype) { - if (util_1.isNullOrUndefined(tensorsOrDtype)) { - throw new Error('Invalid input tensors value.'); - } - return { - name: attrName, - type: nodeBackend().binding.TF_ATTR_TYPE, - value: (tensorsOrDtype instanceof tf.Tensor || Array.isArray(tensorsOrDtype)) ? - getTFDTypeForInputs(tensorsOrDtype) : - getTFDType(tensorsOrDtype) - }; -} -exports.createTensorsTypeOpAttr = createTensorsTypeOpAttr; -// TODO(yassogba) remove? who uses this? -function createOpAttr(attrName, tensorsOrDtype, value) { - if (util_1.isNullOrUndefined(tensorsOrDtype)) { - throw new Error('Invalid input tensors value.'); - } - return { name: attrName, type: nodeBackend().binding.TF_BOOL, value: value }; -} -exports.createOpAttr = createOpAttr; -/** Returns the dtype number for a single or list of input Tensors. */ -function getTFDTypeForInputs(tensors) { - if (util_1.isNullOrUndefined(tensors)) { - throw new Error('Invalid input tensors value.'); - } - if (util_1.isArray(tensors)) { - for (var i = 0; i < tensors.length; i++) { - return getTFDType(tensors[i].dtype); - } - return -1; - } - else { - return getTFDType(tensors.dtype); - } -} -function ensureTensorflowBackend() { - tf.util.assert(tf.getBackend() === 'tensorflow', function () { return "Expect the current backend to be \"tensorflow\", but got \"" + tf.getBackend() + "\""; }); -} -exports.ensureTensorflowBackend = ensureTensorflowBackend; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js deleted file mode 100644 index a3f0ea1f1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js +++ /dev/null @@ -1,188 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tf = require("@tensorflow/tfjs"); -// tslint:disable-next-line: no-imports-from-dist -var jasmine_util_1 = require("@tensorflow/tfjs-core/dist/jasmine_util"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -describe('delayed upload', function () { - it('should handle data before op execution', function () { return __awaiter(_this, void 0, void 0, function () { - var t, _a, _b, r, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - t = tf.tensor1d([1, 2, 3]); - _b = (_a = tf.test_util).expectArraysClose; - return [4 /*yield*/, t.data()]; - case 1: - _b.apply(_a, [_e.sent(), [1, 2, 3]]); - r = t.add(tf.tensor1d([4, 5, 6])); - _d = (_c = tf.test_util).expectArraysClose; - return [4 /*yield*/, r.data()]; - case 2: - _d.apply(_c, [_e.sent(), [5, 7, 9]]); - return [2 /*return*/]; - } - }); - }); }); - it('Should not cache tensors in the tensor map for device support. ', function () { - var logits = tf.tensor1d([1, 2, 3]); - var softmaxLogits = tf.softmax(logits); - var data = softmaxLogits.dataSync(); - expect(softmaxLogits.dataSync()[0]).toEqual(data[0]); - expect(softmaxLogits.dataSync()[1]).toEqual(data[1]); - expect(softmaxLogits.dataSync()[2]).toEqual(data[2]); - }); -}); -describe('type casting', function () { - it('exp support int32', function () { - tf.exp(tf.scalar(2, 'int32')); - }); -}); -describe('conv3d dilations', function () { - it('CPU should throw error on dilations >1', function () { - var input = tf.ones([1, 2, 2, 2, 1]); - var filter = tf.ones([1, 1, 1, 1, 1]); - expect(function () { - tf.conv3d(input, filter, 1, 'same', 'NDHWC', [2, 2, 2]); - }).toThrowError(); - }); - it('GPU should handle dilations >1', function () { - // This test can only run locally with CUDA bindings and GPU package - // installed. - if (tf.backend().isUsingGpuDevice) { - var input = tf.ones([1, 2, 2, 2, 1]); - var filter = tf.ones([1, 1, 1, 1, 1]); - tf.conv3d(input, filter, 1, 'same', 'NDHWC', [2, 2, 2]); - } - }); -}); -describe('Exposes Backend for internal Op execution.', function () { - it('Provides the Node backend over a function', function () { - var backend = nodejs_kernel_backend_1.nodeBackend(); - expect(backend instanceof nodejs_kernel_backend_1.NodeJSKernelBackend).toBeTruthy(); - }); - it('Provides internal access to the binding', function () { - expect(nodejs_kernel_backend_1.nodeBackend().binding).toBeDefined(); - }); - it('throw error if backend is not tensorflow', function (done) { return __awaiter(_this, void 0, void 0, function () { - var testBackend_1; - return __generator(this, function (_a) { - try { - testBackend_1 = new jasmine_util_1.TestKernelBackend(); - tf.registerBackend('fake', function () { return testBackend_1; }); - tf.setBackend('fake'); - nodejs_kernel_backend_1.ensureTensorflowBackend(); - done.fail(); - } - catch (err) { - expect(err.message) - .toBe('Expect the current backend to be "tensorflow", but got "fake"'); - tf.setBackend('tensorflow'); - done(); - } - return [2 /*return*/]; - }); - }); }); -}); -describe('getTFDType()', function () { - var binding = nodejs_kernel_backend_1.nodeBackend().binding; - it('handles float32', function () { - expect(nodejs_kernel_backend_1.getTFDType('float32')).toBe(binding.TF_FLOAT); - }); - it('handles int32', function () { - expect(nodejs_kernel_backend_1.getTFDType('int32')).toBe(binding.TF_INT32); - }); - it('handles bool', function () { - expect(nodejs_kernel_backend_1.getTFDType('bool')).toBe(binding.TF_BOOL); - }); - it('handles unknown types', function () { - expect(function () { return nodejs_kernel_backend_1.getTFDType(null); }).toThrowError(); - }); -}); -describe('createTypeOpAttr()', function () { - var binding = nodejs_kernel_backend_1.nodeBackend().binding; - it('Creates a valid type attribute', function () { - var attr = nodejs_kernel_backend_1.createTensorsTypeOpAttr('foo', 'float32'); - expect(attr.name).toBe('foo'); - expect(attr.type).toBe(binding.TF_ATTR_TYPE); - expect(attr.value).toBe(binding.TF_FLOAT); - }); - it('handles unknown dtypes', function () { - expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('foo', null); }).toThrowError(); - }); -}); -describe('Returns TFEOpAttr for a Tensor or list of Tensors', function () { - var binding = nodejs_kernel_backend_1.nodeBackend().binding; - it('handles a single Tensor', function () { - var result = nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tf.scalar(13, 'float32')); - expect(result.name).toBe('T'); - expect(result.type).toBe(binding.TF_ATTR_TYPE); - expect(result.value).toBe(binding.TF_FLOAT); - }); - it('handles a list of Tensors', function () { - var tensors = [tf.scalar(1, 'int32'), tf.scalar(20.1, 'float32')]; - var result = nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tensors); - expect(result.name).toBe('T'); - expect(result.type).toBe(binding.TF_ATTR_TYPE); - expect(result.value).toBe(binding.TF_INT32); - }); - it('handles null', function () { - expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', null); }).toThrowError(); - }); - it('handles list of null', function () { - var inputs = [null, null]; - expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', inputs); }).toThrowError(); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js deleted file mode 100644 index 7088a13a2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js +++ /dev/null @@ -1,9136 +0,0 @@ -// source: api.proto -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.tensorflow.Any', null, global); -goog.exportSymbol('proto.tensorflow.AssetFileDef', null, global); -goog.exportSymbol('proto.tensorflow.AttrValue', null, global); -goog.exportSymbol('proto.tensorflow.AttrValue.ListValue', null, global); -goog.exportSymbol('proto.tensorflow.AttrValue.ValueCase', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.AnyList', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.BytesList', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.FloatList', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.Int64List', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.KindCase', null, global); -goog.exportSymbol('proto.tensorflow.CollectionDef.NodeList', null, global); -goog.exportSymbol('proto.tensorflow.DataType', null, global); -goog.exportSymbol('proto.tensorflow.FunctionDef', null, global); -goog.exportSymbol('proto.tensorflow.FunctionDefLibrary', null, global); -goog.exportSymbol('proto.tensorflow.GradientDef', null, global); -goog.exportSymbol('proto.tensorflow.GraphDef', null, global); -goog.exportSymbol('proto.tensorflow.MetaGraphDef', null, global); -goog.exportSymbol('proto.tensorflow.MetaGraphDef.MetaInfoDef', null, global); -goog.exportSymbol('proto.tensorflow.NameAttrList', null, global); -goog.exportSymbol('proto.tensorflow.NodeDef', null, global); -goog.exportSymbol('proto.tensorflow.OpDef', null, global); -goog.exportSymbol('proto.tensorflow.OpDef.ArgDef', null, global); -goog.exportSymbol('proto.tensorflow.OpDef.AttrDef', null, global); -goog.exportSymbol('proto.tensorflow.OpDef.OpDeprecation', null, global); -goog.exportSymbol('proto.tensorflow.OpList', null, global); -goog.exportSymbol('proto.tensorflow.SavedModel', null, global); -goog.exportSymbol('proto.tensorflow.SaverDef', null, global); -goog.exportSymbol('proto.tensorflow.SaverDef.CheckpointFormatVersion', null, global); -goog.exportSymbol('proto.tensorflow.SignatureDef', null, global); -goog.exportSymbol('proto.tensorflow.Tensor', null, global); -goog.exportSymbol('proto.tensorflow.TensorInfo', null, global); -goog.exportSymbol('proto.tensorflow.TensorInfo.CooSparse', null, global); -goog.exportSymbol('proto.tensorflow.TensorInfo.EncodingCase', null, global); -goog.exportSymbol('proto.tensorflow.TensorShape', null, global); -goog.exportSymbol('proto.tensorflow.TensorShape.Dim', null, global); -goog.exportSymbol('proto.tensorflow.VersionDef', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.Any = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.Any, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.Any.displayName = 'proto.tensorflow.Any'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.TensorShape = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.TensorShape.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.TensorShape, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.TensorShape.displayName = 'proto.tensorflow.TensorShape'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.TensorShape.Dim = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.TensorShape.Dim, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.TensorShape.Dim.displayName = 'proto.tensorflow.TensorShape.Dim'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.Tensor = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.Tensor.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.Tensor, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.Tensor.displayName = 'proto.tensorflow.Tensor'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.AttrValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.AttrValue.oneofGroups_); -}; -goog.inherits(proto.tensorflow.AttrValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.AttrValue.displayName = 'proto.tensorflow.AttrValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.AttrValue.ListValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.AttrValue.ListValue.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.AttrValue.ListValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.AttrValue.ListValue.displayName = 'proto.tensorflow.AttrValue.ListValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.NameAttrList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.NameAttrList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.NameAttrList.displayName = 'proto.tensorflow.NameAttrList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.NodeDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.NodeDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.NodeDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.NodeDef.displayName = 'proto.tensorflow.NodeDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.VersionDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.VersionDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.VersionDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.VersionDef.displayName = 'proto.tensorflow.VersionDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.GraphDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.GraphDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.GraphDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.GraphDef.displayName = 'proto.tensorflow.GraphDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.CollectionDef.oneofGroups_); -}; -goog.inherits(proto.tensorflow.CollectionDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.displayName = 'proto.tensorflow.CollectionDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef.NodeList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.NodeList.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.CollectionDef.NodeList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.NodeList.displayName = 'proto.tensorflow.CollectionDef.NodeList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef.BytesList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.BytesList.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.CollectionDef.BytesList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.BytesList.displayName = 'proto.tensorflow.CollectionDef.BytesList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef.Int64List = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.Int64List.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.CollectionDef.Int64List, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.Int64List.displayName = 'proto.tensorflow.CollectionDef.Int64List'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef.FloatList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.FloatList.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.CollectionDef.FloatList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.FloatList.displayName = 'proto.tensorflow.CollectionDef.FloatList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.CollectionDef.AnyList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.AnyList.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.CollectionDef.AnyList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.CollectionDef.AnyList.displayName = 'proto.tensorflow.CollectionDef.AnyList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.SaverDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.SaverDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.SaverDef.displayName = 'proto.tensorflow.SaverDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.TensorInfo = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.TensorInfo.oneofGroups_); -}; -goog.inherits(proto.tensorflow.TensorInfo, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.TensorInfo.displayName = 'proto.tensorflow.TensorInfo'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.TensorInfo.CooSparse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.TensorInfo.CooSparse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.TensorInfo.CooSparse.displayName = 'proto.tensorflow.TensorInfo.CooSparse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.SignatureDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.SignatureDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.SignatureDef.displayName = 'proto.tensorflow.SignatureDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.AssetFileDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.AssetFileDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.AssetFileDef.displayName = 'proto.tensorflow.AssetFileDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.OpDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.OpDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.OpDef.displayName = 'proto.tensorflow.OpDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.OpDef.ArgDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.OpDef.ArgDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.OpDef.ArgDef.displayName = 'proto.tensorflow.OpDef.ArgDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.OpDef.AttrDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.OpDef.AttrDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.OpDef.AttrDef.displayName = 'proto.tensorflow.OpDef.AttrDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.OpDef.OpDeprecation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.OpDef.OpDeprecation, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.OpDef.OpDeprecation.displayName = 'proto.tensorflow.OpDef.OpDeprecation'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.OpList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpList.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.OpList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.OpList.displayName = 'proto.tensorflow.OpList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.MetaGraphDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.MetaGraphDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.MetaGraphDef.displayName = 'proto.tensorflow.MetaGraphDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.MetaGraphDef.MetaInfoDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.MetaGraphDef.MetaInfoDef.displayName = 'proto.tensorflow.MetaGraphDef.MetaInfoDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.SavedModel = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.SavedModel.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.SavedModel, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.SavedModel.displayName = 'proto.tensorflow.SavedModel'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.FunctionDefLibrary = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDefLibrary.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.FunctionDefLibrary, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.FunctionDefLibrary.displayName = 'proto.tensorflow.FunctionDefLibrary'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.FunctionDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDef.repeatedFields_, null); -}; -goog.inherits(proto.tensorflow.FunctionDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.FunctionDef.displayName = 'proto.tensorflow.FunctionDef'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.tensorflow.GradientDef = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.tensorflow.GradientDef, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.tensorflow.GradientDef.displayName = 'proto.tensorflow.GradientDef'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.Any.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.Any.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.Any} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.Any.toObject = function(includeInstance, msg) { - var f, obj = { - typeUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), - value: msg.getValue_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.Any} - */ -proto.tensorflow.Any.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.Any; - return proto.tensorflow.Any.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.Any} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.Any} - */ -proto.tensorflow.Any.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setTypeUrl(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.Any.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.Any.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.Any} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.Any.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTypeUrl(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getValue_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } -}; - - -/** - * optional string type_url = 1; - * @return {string} - */ -proto.tensorflow.Any.prototype.getTypeUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.Any.prototype.setTypeUrl = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional bytes value = 2; - * @return {!(string|Uint8Array)} - */ -proto.tensorflow.Any.prototype.getValue = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes value = 2; - * This is a type-conversion wrapper around `getValue()` - * @return {string} - */ -proto.tensorflow.Any.prototype.getValue_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getValue())); -}; - - -/** - * optional bytes value = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getValue()` - * @return {!Uint8Array} - */ -proto.tensorflow.Any.prototype.getValue_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getValue())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.tensorflow.Any.prototype.setValue = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.TensorShape.repeatedFields_ = [2]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.TensorShape.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.TensorShape.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.TensorShape} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorShape.toObject = function(includeInstance, msg) { - var f, obj = { - dimList: jspb.Message.toObjectList(msg.getDimList(), - proto.tensorflow.TensorShape.Dim.toObject, includeInstance), - unknownRank: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.TensorShape} - */ -proto.tensorflow.TensorShape.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.TensorShape; - return proto.tensorflow.TensorShape.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.TensorShape} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.TensorShape} - */ -proto.tensorflow.TensorShape.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 2: - var value = new proto.tensorflow.TensorShape.Dim; - reader.readMessage(value,proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader); - msg.addDim(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUnknownRank(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.TensorShape.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.TensorShape.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.TensorShape} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorShape.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDimList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter - ); - } - f = message.getUnknownRank(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.TensorShape.Dim.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.TensorShape.Dim.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.TensorShape.Dim} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorShape.Dim.toObject = function(includeInstance, msg) { - var f, obj = { - size: jspb.Message.getFieldWithDefault(msg, 1, 0), - name: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.TensorShape.Dim} - */ -proto.tensorflow.TensorShape.Dim.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.TensorShape.Dim; - return proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.TensorShape.Dim} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.TensorShape.Dim} - */ -proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setSize(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.TensorShape.Dim.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.TensorShape.Dim} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSize(); - if (f !== 0) { - writer.writeInt64( - 1, - f - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional int64 size = 1; - * @return {number} - */ -proto.tensorflow.TensorShape.Dim.prototype.getSize = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.TensorShape.Dim.prototype.setSize = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string name = 2; - * @return {string} - */ -proto.tensorflow.TensorShape.Dim.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.TensorShape.Dim.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated Dim dim = 2; - * @return {!Array} - */ -proto.tensorflow.TensorShape.prototype.getDimList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape.Dim, 2)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.TensorShape.prototype.setDimList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.tensorflow.TensorShape.Dim=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.TensorShape.Dim} - */ -proto.tensorflow.TensorShape.prototype.addDim = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.TensorShape.Dim, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.TensorShape.prototype.clearDimList = function() { - this.setDimList([]); -}; - - -/** - * optional bool unknown_rank = 3; - * @return {boolean} - */ -proto.tensorflow.TensorShape.prototype.getUnknownRank = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.TensorShape.prototype.setUnknownRank = function(value) { - jspb.Message.setProto3BooleanField(this, 3, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.Tensor.repeatedFields_ = [5,6,7,8,9,10,11,16,17]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.Tensor.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.Tensor.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.Tensor} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.Tensor.toObject = function(includeInstance, msg) { - var f, obj = { - dtype: jspb.Message.getFieldWithDefault(msg, 1, 0), - tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), - versionNumber: jspb.Message.getFieldWithDefault(msg, 3, 0), - tensorContent: msg.getTensorContent_asB64(), - floatValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 5)) == null ? undefined : f, - doubleValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 6)) == null ? undefined : f, - intValList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - stringValList: msg.getStringValList_asB64(), - scomplexValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 9)) == null ? undefined : f, - int64ValList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, - boolValList: (f = jspb.Message.getRepeatedBooleanField(msg, 11)) == null ? undefined : f, - uint32ValList: (f = jspb.Message.getRepeatedField(msg, 16)) == null ? undefined : f, - uint64ValList: (f = jspb.Message.getRepeatedField(msg, 17)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.Tensor} - */ -proto.tensorflow.Tensor.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.Tensor; - return proto.tensorflow.Tensor.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.Tensor} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.Tensor} - */ -proto.tensorflow.Tensor.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); - msg.setDtype(value); - break; - case 2: - var value = new proto.tensorflow.TensorShape; - reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); - msg.setTensorShape(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt32()); - msg.setVersionNumber(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTensorContent(value); - break; - case 5: - var value = /** @type {!Array} */ (reader.readPackedFloat()); - msg.setFloatValList(value); - break; - case 6: - var value = /** @type {!Array} */ (reader.readPackedDouble()); - msg.setDoubleValList(value); - break; - case 7: - var value = /** @type {!Array} */ (reader.readPackedInt32()); - msg.setIntValList(value); - break; - case 8: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addStringVal(value); - break; - case 9: - var value = /** @type {!Array} */ (reader.readPackedFloat()); - msg.setScomplexValList(value); - break; - case 10: - var value = /** @type {!Array} */ (reader.readPackedInt64()); - msg.setInt64ValList(value); - break; - case 11: - var value = /** @type {!Array} */ (reader.readPackedBool()); - msg.setBoolValList(value); - break; - case 16: - var value = /** @type {!Array} */ (reader.readPackedUint32()); - msg.setUint32ValList(value); - break; - case 17: - var value = /** @type {!Array} */ (reader.readPackedUint64()); - msg.setUint64ValList(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.Tensor.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.Tensor.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.Tensor} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.Tensor.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDtype(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getTensorShape(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.tensorflow.TensorShape.serializeBinaryToWriter - ); - } - f = message.getVersionNumber(); - if (f !== 0) { - writer.writeInt32( - 3, - f - ); - } - f = message.getTensorContent_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f - ); - } - f = message.getFloatValList(); - if (f.length > 0) { - writer.writePackedFloat( - 5, - f - ); - } - f = message.getDoubleValList(); - if (f.length > 0) { - writer.writePackedDouble( - 6, - f - ); - } - f = message.getIntValList(); - if (f.length > 0) { - writer.writePackedInt32( - 7, - f - ); - } - f = message.getStringValList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 8, - f - ); - } - f = message.getScomplexValList(); - if (f.length > 0) { - writer.writePackedFloat( - 9, - f - ); - } - f = message.getInt64ValList(); - if (f.length > 0) { - writer.writePackedInt64( - 10, - f - ); - } - f = message.getBoolValList(); - if (f.length > 0) { - writer.writePackedBool( - 11, - f - ); - } - f = message.getUint32ValList(); - if (f.length > 0) { - writer.writePackedUint32( - 16, - f - ); - } - f = message.getUint64ValList(); - if (f.length > 0) { - writer.writePackedUint64( - 17, - f - ); - } -}; - - -/** - * optional DataType dtype = 1; - * @return {!proto.tensorflow.DataType} - */ -proto.tensorflow.Tensor.prototype.getDtype = function() { - return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {!proto.tensorflow.DataType} value */ -proto.tensorflow.Tensor.prototype.setDtype = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional TensorShape tensor_shape = 2; - * @return {?proto.tensorflow.TensorShape} - */ -proto.tensorflow.Tensor.prototype.getTensorShape = function() { - return /** @type{?proto.tensorflow.TensorShape} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 2)); -}; - - -/** @param {?proto.tensorflow.TensorShape|undefined} value */ -proto.tensorflow.Tensor.prototype.setTensorShape = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.Tensor.prototype.clearTensorShape = function() { - this.setTensorShape(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.Tensor.prototype.hasTensorShape = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional int32 version_number = 3; - * @return {number} - */ -proto.tensorflow.Tensor.prototype.getVersionNumber = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.Tensor.prototype.setVersionNumber = function(value) { - jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional bytes tensor_content = 4; - * @return {!(string|Uint8Array)} - */ -proto.tensorflow.Tensor.prototype.getTensorContent = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * optional bytes tensor_content = 4; - * This is a type-conversion wrapper around `getTensorContent()` - * @return {string} - */ -proto.tensorflow.Tensor.prototype.getTensorContent_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTensorContent())); -}; - - -/** - * optional bytes tensor_content = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTensorContent()` - * @return {!Uint8Array} - */ -proto.tensorflow.Tensor.prototype.getTensorContent_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTensorContent())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.tensorflow.Tensor.prototype.setTensorContent = function(value) { - jspb.Message.setProto3BytesField(this, 4, value); -}; - - -/** - * repeated float float_val = 5; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getFloatValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 5)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setFloatValList = function(value) { - jspb.Message.setField(this, 5, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addFloatVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearFloatValList = function() { - this.setFloatValList([]); -}; - - -/** - * repeated double double_val = 6; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getDoubleValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 6)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setDoubleValList = function(value) { - jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addDoubleVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearDoubleValList = function() { - this.setDoubleValList([]); -}; - - -/** - * repeated int32 int_val = 7; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getIntValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setIntValList = function(value) { - jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addIntVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearIntValList = function() { - this.setIntValList([]); -}; - - -/** - * repeated bytes string_val = 8; - * @return {!(Array|Array)} - */ -proto.tensorflow.Tensor.prototype.getStringValList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 8)); -}; - - -/** - * repeated bytes string_val = 8; - * This is a type-conversion wrapper around `getStringValList()` - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getStringValList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getStringValList())); -}; - - -/** - * repeated bytes string_val = 8; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStringValList()` - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getStringValList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getStringValList())); -}; - - -/** @param {!(Array|Array)} value */ -proto.tensorflow.Tensor.prototype.setStringValList = function(value) { - jspb.Message.setField(this, 8, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addStringVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 8, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearStringValList = function() { - this.setStringValList([]); -}; - - -/** - * repeated float scomplex_val = 9; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getScomplexValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 9)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setScomplexValList = function(value) { - jspb.Message.setField(this, 9, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addScomplexVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 9, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearScomplexValList = function() { - this.setScomplexValList([]); -}; - - -/** - * repeated int64 int64_val = 10; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getInt64ValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setInt64ValList = function(value) { - jspb.Message.setField(this, 10, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addInt64Val = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 10, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearInt64ValList = function() { - this.setInt64ValList([]); -}; - - -/** - * repeated bool bool_val = 11; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getBoolValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 11)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setBoolValList = function(value) { - jspb.Message.setField(this, 11, value || []); -}; - - -/** - * @param {boolean} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addBoolVal = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 11, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearBoolValList = function() { - this.setBoolValList([]); -}; - - -/** - * repeated uint32 uint32_val = 16; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getUint32ValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 16)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setUint32ValList = function(value) { - jspb.Message.setField(this, 16, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addUint32Val = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 16, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearUint32ValList = function() { - this.setUint32ValList([]); -}; - - -/** - * repeated uint64 uint64_val = 17; - * @return {!Array} - */ -proto.tensorflow.Tensor.prototype.getUint64ValList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 17)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.Tensor.prototype.setUint64ValList = function(value) { - jspb.Message.setField(this, 17, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.Tensor.prototype.addUint64Val = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 17, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.Tensor.prototype.clearUint64ValList = function() { - this.setUint64ValList([]); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.tensorflow.AttrValue.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10]]; - -/** - * @enum {number} - */ -proto.tensorflow.AttrValue.ValueCase = { - VALUE_NOT_SET: 0, - LIST: 1, - S: 2, - I: 3, - F: 4, - B: 5, - TYPE: 6, - SHAPE: 7, - TENSOR: 8, - PLACEHOLDER: 9, - FUNC: 10 -}; - -/** - * @return {proto.tensorflow.AttrValue.ValueCase} - */ -proto.tensorflow.AttrValue.prototype.getValueCase = function() { - return /** @type {proto.tensorflow.AttrValue.ValueCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.AttrValue.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.AttrValue.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.AttrValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.AttrValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AttrValue.toObject = function(includeInstance, msg) { - var f, obj = { - list: (f = msg.getList()) && proto.tensorflow.AttrValue.ListValue.toObject(includeInstance, f), - s: msg.getS_asB64(), - i: jspb.Message.getFieldWithDefault(msg, 3, 0), - f: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), - b: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - type: jspb.Message.getFieldWithDefault(msg, 6, 0), - shape: (f = msg.getShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), - tensor: (f = msg.getTensor()) && proto.tensorflow.Tensor.toObject(includeInstance, f), - placeholder: jspb.Message.getFieldWithDefault(msg, 9, ""), - func: (f = msg.getFunc()) && proto.tensorflow.NameAttrList.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.AttrValue} - */ -proto.tensorflow.AttrValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.AttrValue; - return proto.tensorflow.AttrValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.AttrValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.AttrValue} - */ -proto.tensorflow.AttrValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.AttrValue.ListValue; - reader.readMessage(value,proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader); - msg.setList(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setS(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setI(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFloat()); - msg.setF(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setB(value); - break; - case 6: - var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); - msg.setType(value); - break; - case 7: - var value = new proto.tensorflow.TensorShape; - reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); - msg.setShape(value); - break; - case 8: - var value = new proto.tensorflow.Tensor; - reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); - msg.setTensor(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setPlaceholder(value); - break; - case 10: - var value = new proto.tensorflow.NameAttrList; - reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); - msg.setFunc(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.AttrValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.AttrValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.AttrValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AttrValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getList(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeBytes( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeInt64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeFloat( - 4, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeBool( - 5, - f - ); - } - f = /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeEnum( - 6, - f - ); - } - f = message.getShape(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.tensorflow.TensorShape.serializeBinaryToWriter - ); - } - f = message.getTensor(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.tensorflow.Tensor.serializeBinaryToWriter - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 9)); - if (f != null) { - writer.writeString( - 9, - f - ); - } - f = message.getFunc(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.tensorflow.NameAttrList.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.AttrValue.ListValue.repeatedFields_ = [2,3,4,5,6,7,8,9]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.AttrValue.ListValue.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.AttrValue.ListValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.AttrValue.ListValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AttrValue.ListValue.toObject = function(includeInstance, msg) { - var f, obj = { - sList: msg.getSList_asB64(), - iList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, - fList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 4)) == null ? undefined : f, - bList: (f = jspb.Message.getRepeatedBooleanField(msg, 5)) == null ? undefined : f, - typeList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - shapeList: jspb.Message.toObjectList(msg.getShapeList(), - proto.tensorflow.TensorShape.toObject, includeInstance), - tensorList: jspb.Message.toObjectList(msg.getTensorList(), - proto.tensorflow.Tensor.toObject, includeInstance), - funcList: jspb.Message.toObjectList(msg.getFuncList(), - proto.tensorflow.NameAttrList.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.AttrValue.ListValue} - */ -proto.tensorflow.AttrValue.ListValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.AttrValue.ListValue; - return proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.AttrValue.ListValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.AttrValue.ListValue} - */ -proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addS(value); - break; - case 3: - var value = /** @type {!Array} */ (reader.readPackedInt64()); - msg.setIList(value); - break; - case 4: - var value = /** @type {!Array} */ (reader.readPackedFloat()); - msg.setFList(value); - break; - case 5: - var value = /** @type {!Array} */ (reader.readPackedBool()); - msg.setBList(value); - break; - case 6: - var value = /** @type {!Array} */ (reader.readPackedEnum()); - msg.setTypeList(value); - break; - case 7: - var value = new proto.tensorflow.TensorShape; - reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); - msg.addShape(value); - break; - case 8: - var value = new proto.tensorflow.Tensor; - reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); - msg.addTensor(value); - break; - case 9: - var value = new proto.tensorflow.NameAttrList; - reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); - msg.addFunc(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.AttrValue.ListValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 2, - f - ); - } - f = message.getIList(); - if (f.length > 0) { - writer.writePackedInt64( - 3, - f - ); - } - f = message.getFList(); - if (f.length > 0) { - writer.writePackedFloat( - 4, - f - ); - } - f = message.getBList(); - if (f.length > 0) { - writer.writePackedBool( - 5, - f - ); - } - f = message.getTypeList(); - if (f.length > 0) { - writer.writePackedEnum( - 6, - f - ); - } - f = message.getShapeList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - proto.tensorflow.TensorShape.serializeBinaryToWriter - ); - } - f = message.getTensorList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 8, - f, - proto.tensorflow.Tensor.serializeBinaryToWriter - ); - } - f = message.getFuncList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 9, - f, - proto.tensorflow.NameAttrList.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated bytes s = 2; - * @return {!(Array|Array)} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getSList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * repeated bytes s = 2; - * This is a type-conversion wrapper around `getSList()` - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getSList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getSList())); -}; - - -/** - * repeated bytes s = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSList()` - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getSList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getSList())); -}; - - -/** @param {!(Array|Array)} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setSList = function(value) { - jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - */ -proto.tensorflow.AttrValue.ListValue.prototype.addS = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearSList = function() { - this.setSList([]); -}; - - -/** - * repeated int64 i = 3; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getIList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setIList = function(value) { - jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.AttrValue.ListValue.prototype.addI = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearIList = function() { - this.setIList([]); -}; - - -/** - * repeated float f = 4; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getFList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 4)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setFList = function(value) { - jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.AttrValue.ListValue.prototype.addF = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearFList = function() { - this.setFList([]); -}; - - -/** - * repeated bool b = 5; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getBList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 5)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setBList = function(value) { - jspb.Message.setField(this, 5, value || []); -}; - - -/** - * @param {boolean} value - * @param {number=} opt_index - */ -proto.tensorflow.AttrValue.ListValue.prototype.addB = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearBList = function() { - this.setBList([]); -}; - - -/** - * repeated DataType type = 6; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getTypeList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setTypeList = function(value) { - jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {!proto.tensorflow.DataType} value - * @param {number=} opt_index - */ -proto.tensorflow.AttrValue.ListValue.prototype.addType = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearTypeList = function() { - this.setTypeList([]); -}; - - -/** - * repeated TensorShape shape = 7; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getShapeList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape, 7)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setShapeList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - - -/** - * @param {!proto.tensorflow.TensorShape=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.TensorShape} - */ -proto.tensorflow.AttrValue.ListValue.prototype.addShape = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.tensorflow.TensorShape, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearShapeList = function() { - this.setShapeList([]); -}; - - -/** - * repeated Tensor tensor = 8; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getTensorList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Tensor, 8)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setTensorList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 8, value); -}; - - -/** - * @param {!proto.tensorflow.Tensor=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.Tensor} - */ -proto.tensorflow.AttrValue.ListValue.prototype.addTensor = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.tensorflow.Tensor, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearTensorList = function() { - this.setTensorList([]); -}; - - -/** - * repeated NameAttrList func = 9; - * @return {!Array} - */ -proto.tensorflow.AttrValue.ListValue.prototype.getFuncList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NameAttrList, 9)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.AttrValue.ListValue.prototype.setFuncList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 9, value); -}; - - -/** - * @param {!proto.tensorflow.NameAttrList=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.NameAttrList} - */ -proto.tensorflow.AttrValue.ListValue.prototype.addFunc = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.tensorflow.NameAttrList, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.AttrValue.ListValue.prototype.clearFuncList = function() { - this.setFuncList([]); -}; - - -/** - * optional ListValue list = 1; - * @return {?proto.tensorflow.AttrValue.ListValue} - */ -proto.tensorflow.AttrValue.prototype.getList = function() { - return /** @type{?proto.tensorflow.AttrValue.ListValue} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue.ListValue, 1)); -}; - - -/** @param {?proto.tensorflow.AttrValue.ListValue|undefined} value */ -proto.tensorflow.AttrValue.prototype.setList = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearList = function() { - this.setList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasList = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bytes s = 2; - * @return {!(string|Uint8Array)} - */ -proto.tensorflow.AttrValue.prototype.getS = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes s = 2; - * This is a type-conversion wrapper around `getS()` - * @return {string} - */ -proto.tensorflow.AttrValue.prototype.getS_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getS())); -}; - - -/** - * optional bytes s = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getS()` - * @return {!Uint8Array} - */ -proto.tensorflow.AttrValue.prototype.getS_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getS())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.tensorflow.AttrValue.prototype.setS = function(value) { - jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearS = function() { - jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasS = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional int64 i = 3; - * @return {number} - */ -proto.tensorflow.AttrValue.prototype.getI = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.AttrValue.prototype.setI = function(value) { - jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearI = function() { - jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasI = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional float f = 4; - * @return {number} - */ -proto.tensorflow.AttrValue.prototype.getF = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); -}; - - -/** @param {number} value */ -proto.tensorflow.AttrValue.prototype.setF = function(value) { - jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearF = function() { - jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasF = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional bool b = 5; - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.getB = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.AttrValue.prototype.setB = function(value) { - jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearB = function() { - jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasB = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional DataType type = 6; - * @return {!proto.tensorflow.DataType} - */ -proto.tensorflow.AttrValue.prototype.getType = function() { - return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** @param {!proto.tensorflow.DataType} value */ -proto.tensorflow.AttrValue.prototype.setType = function(value) { - jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearType = function() { - jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasType = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional TensorShape shape = 7; - * @return {?proto.tensorflow.TensorShape} - */ -proto.tensorflow.AttrValue.prototype.getShape = function() { - return /** @type{?proto.tensorflow.TensorShape} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 7)); -}; - - -/** @param {?proto.tensorflow.TensorShape|undefined} value */ -proto.tensorflow.AttrValue.prototype.setShape = function(value) { - jspb.Message.setOneofWrapperField(this, 7, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearShape = function() { - this.setShape(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasShape = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional Tensor tensor = 8; - * @return {?proto.tensorflow.Tensor} - */ -proto.tensorflow.AttrValue.prototype.getTensor = function() { - return /** @type{?proto.tensorflow.Tensor} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.Tensor, 8)); -}; - - -/** @param {?proto.tensorflow.Tensor|undefined} value */ -proto.tensorflow.AttrValue.prototype.setTensor = function(value) { - jspb.Message.setOneofWrapperField(this, 8, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearTensor = function() { - this.setTensor(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasTensor = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional string placeholder = 9; - * @return {string} - */ -proto.tensorflow.AttrValue.prototype.getPlaceholder = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.AttrValue.prototype.setPlaceholder = function(value) { - jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearPlaceholder = function() { - jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasPlaceholder = function() { - return jspb.Message.getField(this, 9) != null; -}; - - -/** - * optional NameAttrList func = 10; - * @return {?proto.tensorflow.NameAttrList} - */ -proto.tensorflow.AttrValue.prototype.getFunc = function() { - return /** @type{?proto.tensorflow.NameAttrList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.NameAttrList, 10)); -}; - - -/** @param {?proto.tensorflow.NameAttrList|undefined} value */ -proto.tensorflow.AttrValue.prototype.setFunc = function(value) { - jspb.Message.setOneofWrapperField(this, 10, proto.tensorflow.AttrValue.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.AttrValue.prototype.clearFunc = function() { - this.setFunc(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AttrValue.prototype.hasFunc = function() { - return jspb.Message.getField(this, 10) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.NameAttrList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.NameAttrList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.NameAttrList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.NameAttrList.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.NameAttrList} - */ -proto.tensorflow.NameAttrList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.NameAttrList; - return proto.tensorflow.NameAttrList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.NameAttrList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.NameAttrList} - */ -proto.tensorflow.NameAttrList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = msg.getAttrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.NameAttrList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.NameAttrList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.NameAttrList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.NameAttrList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAttrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.NameAttrList.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.NameAttrList.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * map attr = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.NameAttrList.prototype.getAttrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 2, opt_noLazyCreate, - proto.tensorflow.AttrValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.NameAttrList.prototype.clearAttrMap = function() { - this.getAttrMap().clear(); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.NodeDef.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.NodeDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.NodeDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.NodeDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.NodeDef.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - op: jspb.Message.getFieldWithDefault(msg, 2, ""), - inputList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, - device: jspb.Message.getFieldWithDefault(msg, 4, ""), - attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.NodeDef} - */ -proto.tensorflow.NodeDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.NodeDef; - return proto.tensorflow.NodeDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.NodeDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.NodeDef} - */ -proto.tensorflow.NodeDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setOp(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.addInput(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setDevice(value); - break; - case 5: - var value = msg.getAttrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.NodeDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.NodeDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.NodeDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.NodeDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getOp(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getInputList(); - if (f.length > 0) { - writer.writeRepeatedString( - 3, - f - ); - } - f = message.getDevice(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getAttrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.NodeDef.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.NodeDef.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string op = 2; - * @return {string} - */ -proto.tensorflow.NodeDef.prototype.getOp = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.NodeDef.prototype.setOp = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated string input = 3; - * @return {!Array} - */ -proto.tensorflow.NodeDef.prototype.getInputList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.NodeDef.prototype.setInputList = function(value) { - jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.tensorflow.NodeDef.prototype.addInput = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.NodeDef.prototype.clearInputList = function() { - this.setInputList([]); -}; - - -/** - * optional string device = 4; - * @return {string} - */ -proto.tensorflow.NodeDef.prototype.getDevice = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.NodeDef.prototype.setDevice = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * map attr = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.NodeDef.prototype.getAttrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - proto.tensorflow.AttrValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.NodeDef.prototype.clearAttrMap = function() { - this.getAttrMap().clear(); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.VersionDef.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.VersionDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.VersionDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.VersionDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.VersionDef.toObject = function(includeInstance, msg) { - var f, obj = { - producer: jspb.Message.getFieldWithDefault(msg, 1, 0), - minConsumer: jspb.Message.getFieldWithDefault(msg, 2, 0), - badConsumersList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.VersionDef} - */ -proto.tensorflow.VersionDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.VersionDef; - return proto.tensorflow.VersionDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.VersionDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.VersionDef} - */ -proto.tensorflow.VersionDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setProducer(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setMinConsumer(value); - break; - case 3: - var value = /** @type {!Array} */ (reader.readPackedInt32()); - msg.setBadConsumersList(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.VersionDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.VersionDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.VersionDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.VersionDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProducer(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } - f = message.getMinConsumer(); - if (f !== 0) { - writer.writeInt32( - 2, - f - ); - } - f = message.getBadConsumersList(); - if (f.length > 0) { - writer.writePackedInt32( - 3, - f - ); - } -}; - - -/** - * optional int32 producer = 1; - * @return {number} - */ -proto.tensorflow.VersionDef.prototype.getProducer = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.VersionDef.prototype.setProducer = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional int32 min_consumer = 2; - * @return {number} - */ -proto.tensorflow.VersionDef.prototype.getMinConsumer = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.VersionDef.prototype.setMinConsumer = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * repeated int32 bad_consumers = 3; - * @return {!Array} - */ -proto.tensorflow.VersionDef.prototype.getBadConsumersList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.VersionDef.prototype.setBadConsumersList = function(value) { - jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.VersionDef.prototype.addBadConsumers = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.VersionDef.prototype.clearBadConsumersList = function() { - this.setBadConsumersList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.GraphDef.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.GraphDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.GraphDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.GraphDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.GraphDef.toObject = function(includeInstance, msg) { - var f, obj = { - nodeList: jspb.Message.toObjectList(msg.getNodeList(), - proto.tensorflow.NodeDef.toObject, includeInstance), - versions: (f = msg.getVersions()) && proto.tensorflow.VersionDef.toObject(includeInstance, f), - library: (f = msg.getLibrary()) && proto.tensorflow.FunctionDefLibrary.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.GraphDef} - */ -proto.tensorflow.GraphDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.GraphDef; - return proto.tensorflow.GraphDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.GraphDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.GraphDef} - */ -proto.tensorflow.GraphDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.NodeDef; - reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); - msg.addNode(value); - break; - case 4: - var value = new proto.tensorflow.VersionDef; - reader.readMessage(value,proto.tensorflow.VersionDef.deserializeBinaryFromReader); - msg.setVersions(value); - break; - case 2: - var value = new proto.tensorflow.FunctionDefLibrary; - reader.readMessage(value,proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader); - msg.setLibrary(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.GraphDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.GraphDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.GraphDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.GraphDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNodeList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.tensorflow.NodeDef.serializeBinaryToWriter - ); - } - f = message.getVersions(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.tensorflow.VersionDef.serializeBinaryToWriter - ); - } - f = message.getLibrary(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated NodeDef node = 1; - * @return {!Array} - */ -proto.tensorflow.GraphDef.prototype.getNodeList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.GraphDef.prototype.setNodeList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.tensorflow.NodeDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.NodeDef} - */ -proto.tensorflow.GraphDef.prototype.addNode = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.NodeDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.GraphDef.prototype.clearNodeList = function() { - this.setNodeList([]); -}; - - -/** - * optional VersionDef versions = 4; - * @return {?proto.tensorflow.VersionDef} - */ -proto.tensorflow.GraphDef.prototype.getVersions = function() { - return /** @type{?proto.tensorflow.VersionDef} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.VersionDef, 4)); -}; - - -/** @param {?proto.tensorflow.VersionDef|undefined} value */ -proto.tensorflow.GraphDef.prototype.setVersions = function(value) { - jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.GraphDef.prototype.clearVersions = function() { - this.setVersions(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.GraphDef.prototype.hasVersions = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional FunctionDefLibrary library = 2; - * @return {?proto.tensorflow.FunctionDefLibrary} - */ -proto.tensorflow.GraphDef.prototype.getLibrary = function() { - return /** @type{?proto.tensorflow.FunctionDefLibrary} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.FunctionDefLibrary, 2)); -}; - - -/** @param {?proto.tensorflow.FunctionDefLibrary|undefined} value */ -proto.tensorflow.GraphDef.prototype.setLibrary = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.GraphDef.prototype.clearLibrary = function() { - this.setLibrary(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.GraphDef.prototype.hasLibrary = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.tensorflow.CollectionDef.oneofGroups_ = [[1,2,3,4,5]]; - -/** - * @enum {number} - */ -proto.tensorflow.CollectionDef.KindCase = { - KIND_NOT_SET: 0, - NODE_LIST: 1, - BYTES_LIST: 2, - INT64_LIST: 3, - FLOAT_LIST: 4, - ANY_LIST: 5 -}; - -/** - * @return {proto.tensorflow.CollectionDef.KindCase} - */ -proto.tensorflow.CollectionDef.prototype.getKindCase = function() { - return /** @type {proto.tensorflow.CollectionDef.KindCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.CollectionDef.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.toObject = function(includeInstance, msg) { - var f, obj = { - nodeList: (f = msg.getNodeList()) && proto.tensorflow.CollectionDef.NodeList.toObject(includeInstance, f), - bytesList: (f = msg.getBytesList()) && proto.tensorflow.CollectionDef.BytesList.toObject(includeInstance, f), - int64List: (f = msg.getInt64List()) && proto.tensorflow.CollectionDef.Int64List.toObject(includeInstance, f), - floatList: (f = msg.getFloatList()) && proto.tensorflow.CollectionDef.FloatList.toObject(includeInstance, f), - anyList: (f = msg.getAnyList()) && proto.tensorflow.CollectionDef.AnyList.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef} - */ -proto.tensorflow.CollectionDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef; - return proto.tensorflow.CollectionDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef} - */ -proto.tensorflow.CollectionDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.CollectionDef.NodeList; - reader.readMessage(value,proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader); - msg.setNodeList(value); - break; - case 2: - var value = new proto.tensorflow.CollectionDef.BytesList; - reader.readMessage(value,proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader); - msg.setBytesList(value); - break; - case 3: - var value = new proto.tensorflow.CollectionDef.Int64List; - reader.readMessage(value,proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader); - msg.setInt64List(value); - break; - case 4: - var value = new proto.tensorflow.CollectionDef.FloatList; - reader.readMessage(value,proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader); - msg.setFloatList(value); - break; - case 5: - var value = new proto.tensorflow.CollectionDef.AnyList; - reader.readMessage(value,proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader); - msg.setAnyList(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNodeList(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter - ); - } - f = message.getBytesList(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter - ); - } - f = message.getInt64List(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter - ); - } - f = message.getFloatList(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter - ); - } - f = message.getAnyList(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.CollectionDef.NodeList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.NodeList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.NodeList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef.NodeList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.NodeList.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef.NodeList} - */ -proto.tensorflow.CollectionDef.NodeList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef.NodeList; - return proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef.NodeList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef.NodeList} - */ -proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.addValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.NodeList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef.NodeList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string value = 1; - * @return {!Array} - */ -proto.tensorflow.CollectionDef.NodeList.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.CollectionDef.NodeList.prototype.setValueList = function(value) { - jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.tensorflow.CollectionDef.NodeList.prototype.addValue = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.CollectionDef.NodeList.prototype.clearValueList = function() { - this.setValueList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.CollectionDef.BytesList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.BytesList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.BytesList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef.BytesList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.BytesList.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: msg.getValueList_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef.BytesList} - */ -proto.tensorflow.CollectionDef.BytesList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef.BytesList; - return proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef.BytesList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef.BytesList} - */ -proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.BytesList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef.BytesList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } -}; - - -/** - * repeated bytes value = 1; - * @return {!(Array|Array)} - */ -proto.tensorflow.CollectionDef.BytesList.prototype.getValueList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * repeated bytes value = 1; - * This is a type-conversion wrapper around `getValueList()` - * @return {!Array} - */ -proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getValueList())); -}; - - -/** - * repeated bytes value = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getValueList()` - * @return {!Array} - */ -proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getValueList())); -}; - - -/** @param {!(Array|Array)} value */ -proto.tensorflow.CollectionDef.BytesList.prototype.setValueList = function(value) { - jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - */ -proto.tensorflow.CollectionDef.BytesList.prototype.addValue = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.CollectionDef.BytesList.prototype.clearValueList = function() { - this.setValueList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.CollectionDef.Int64List.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.Int64List.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.Int64List.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef.Int64List} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.Int64List.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef.Int64List} - */ -proto.tensorflow.CollectionDef.Int64List.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef.Int64List; - return proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef.Int64List} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef.Int64List} - */ -proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Array} */ (reader.readPackedInt64()); - msg.setValueList(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.Int64List.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef.Int64List} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writePackedInt64( - 1, - f - ); - } -}; - - -/** - * repeated int64 value = 1; - * @return {!Array} - */ -proto.tensorflow.CollectionDef.Int64List.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.CollectionDef.Int64List.prototype.setValueList = function(value) { - jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.CollectionDef.Int64List.prototype.addValue = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.CollectionDef.Int64List.prototype.clearValueList = function() { - this.setValueList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.CollectionDef.FloatList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.FloatList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.FloatList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef.FloatList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.FloatList.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 1)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef.FloatList} - */ -proto.tensorflow.CollectionDef.FloatList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef.FloatList; - return proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef.FloatList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef.FloatList} - */ -proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Array} */ (reader.readPackedFloat()); - msg.setValueList(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.FloatList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef.FloatList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writePackedFloat( - 1, - f - ); - } -}; - - -/** - * repeated float value = 1; - * @return {!Array} - */ -proto.tensorflow.CollectionDef.FloatList.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.CollectionDef.FloatList.prototype.setValueList = function(value) { - jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - */ -proto.tensorflow.CollectionDef.FloatList.prototype.addValue = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.CollectionDef.FloatList.prototype.clearValueList = function() { - this.setValueList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.CollectionDef.AnyList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.CollectionDef.AnyList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.CollectionDef.AnyList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.CollectionDef.AnyList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.AnyList.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: jspb.Message.toObjectList(msg.getValueList(), - proto.tensorflow.Any.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.CollectionDef.AnyList} - */ -proto.tensorflow.CollectionDef.AnyList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.CollectionDef.AnyList; - return proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.CollectionDef.AnyList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.CollectionDef.AnyList} - */ -proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.Any; - reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); - msg.addValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.CollectionDef.AnyList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.CollectionDef.AnyList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.tensorflow.Any.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Any value = 1; - * @return {!Array} - */ -proto.tensorflow.CollectionDef.AnyList.prototype.getValueList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Any, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.CollectionDef.AnyList.prototype.setValueList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.tensorflow.Any=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.Any} - */ -proto.tensorflow.CollectionDef.AnyList.prototype.addValue = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.Any, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.CollectionDef.AnyList.prototype.clearValueList = function() { - this.setValueList([]); -}; - - -/** - * optional NodeList node_list = 1; - * @return {?proto.tensorflow.CollectionDef.NodeList} - */ -proto.tensorflow.CollectionDef.prototype.getNodeList = function() { - return /** @type{?proto.tensorflow.CollectionDef.NodeList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.NodeList, 1)); -}; - - -/** @param {?proto.tensorflow.CollectionDef.NodeList|undefined} value */ -proto.tensorflow.CollectionDef.prototype.setNodeList = function(value) { - jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.CollectionDef.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.CollectionDef.prototype.clearNodeList = function() { - this.setNodeList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.CollectionDef.prototype.hasNodeList = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional BytesList bytes_list = 2; - * @return {?proto.tensorflow.CollectionDef.BytesList} - */ -proto.tensorflow.CollectionDef.prototype.getBytesList = function() { - return /** @type{?proto.tensorflow.CollectionDef.BytesList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.BytesList, 2)); -}; - - -/** @param {?proto.tensorflow.CollectionDef.BytesList|undefined} value */ -proto.tensorflow.CollectionDef.prototype.setBytesList = function(value) { - jspb.Message.setOneofWrapperField(this, 2, proto.tensorflow.CollectionDef.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.CollectionDef.prototype.clearBytesList = function() { - this.setBytesList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.CollectionDef.prototype.hasBytesList = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional Int64List int64_list = 3; - * @return {?proto.tensorflow.CollectionDef.Int64List} - */ -proto.tensorflow.CollectionDef.prototype.getInt64List = function() { - return /** @type{?proto.tensorflow.CollectionDef.Int64List} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.Int64List, 3)); -}; - - -/** @param {?proto.tensorflow.CollectionDef.Int64List|undefined} value */ -proto.tensorflow.CollectionDef.prototype.setInt64List = function(value) { - jspb.Message.setOneofWrapperField(this, 3, proto.tensorflow.CollectionDef.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.CollectionDef.prototype.clearInt64List = function() { - this.setInt64List(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.CollectionDef.prototype.hasInt64List = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional FloatList float_list = 4; - * @return {?proto.tensorflow.CollectionDef.FloatList} - */ -proto.tensorflow.CollectionDef.prototype.getFloatList = function() { - return /** @type{?proto.tensorflow.CollectionDef.FloatList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.FloatList, 4)); -}; - - -/** @param {?proto.tensorflow.CollectionDef.FloatList|undefined} value */ -proto.tensorflow.CollectionDef.prototype.setFloatList = function(value) { - jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.CollectionDef.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.CollectionDef.prototype.clearFloatList = function() { - this.setFloatList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.CollectionDef.prototype.hasFloatList = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional AnyList any_list = 5; - * @return {?proto.tensorflow.CollectionDef.AnyList} - */ -proto.tensorflow.CollectionDef.prototype.getAnyList = function() { - return /** @type{?proto.tensorflow.CollectionDef.AnyList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.AnyList, 5)); -}; - - -/** @param {?proto.tensorflow.CollectionDef.AnyList|undefined} value */ -proto.tensorflow.CollectionDef.prototype.setAnyList = function(value) { - jspb.Message.setOneofWrapperField(this, 5, proto.tensorflow.CollectionDef.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.CollectionDef.prototype.clearAnyList = function() { - this.setAnyList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.CollectionDef.prototype.hasAnyList = function() { - return jspb.Message.getField(this, 5) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.SaverDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.SaverDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.SaverDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SaverDef.toObject = function(includeInstance, msg) { - var f, obj = { - filenameTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), - saveTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), - restoreOpName: jspb.Message.getFieldWithDefault(msg, 3, ""), - maxToKeep: jspb.Message.getFieldWithDefault(msg, 4, 0), - sharded: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - keepCheckpointEveryNHours: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), - version: jspb.Message.getFieldWithDefault(msg, 7, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.SaverDef} - */ -proto.tensorflow.SaverDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.SaverDef; - return proto.tensorflow.SaverDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.SaverDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.SaverDef} - */ -proto.tensorflow.SaverDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setFilenameTensorName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setSaveTensorName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setRestoreOpName(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setMaxToKeep(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSharded(value); - break; - case 6: - var value = /** @type {number} */ (reader.readFloat()); - msg.setKeepCheckpointEveryNHours(value); - break; - case 7: - var value = /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (reader.readEnum()); - msg.setVersion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.SaverDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.SaverDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.SaverDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SaverDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getFilenameTensorName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getSaveTensorName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getRestoreOpName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getMaxToKeep(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } - f = message.getSharded(); - if (f) { - writer.writeBool( - 5, - f - ); - } - f = message.getKeepCheckpointEveryNHours(); - if (f !== 0.0) { - writer.writeFloat( - 6, - f - ); - } - f = message.getVersion(); - if (f !== 0.0) { - writer.writeEnum( - 7, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.tensorflow.SaverDef.CheckpointFormatVersion = { - LEGACY: 0, - V1: 1, - V2: 2 -}; - -/** - * optional string filename_tensor_name = 1; - * @return {string} - */ -proto.tensorflow.SaverDef.prototype.getFilenameTensorName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.SaverDef.prototype.setFilenameTensorName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string save_tensor_name = 2; - * @return {string} - */ -proto.tensorflow.SaverDef.prototype.getSaveTensorName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.SaverDef.prototype.setSaveTensorName = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string restore_op_name = 3; - * @return {string} - */ -proto.tensorflow.SaverDef.prototype.getRestoreOpName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.SaverDef.prototype.setRestoreOpName = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional int32 max_to_keep = 4; - * @return {number} - */ -proto.tensorflow.SaverDef.prototype.getMaxToKeep = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.SaverDef.prototype.setMaxToKeep = function(value) { - jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * optional bool sharded = 5; - * @return {boolean} - */ -proto.tensorflow.SaverDef.prototype.getSharded = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.SaverDef.prototype.setSharded = function(value) { - jspb.Message.setProto3BooleanField(this, 5, value); -}; - - -/** - * optional float keep_checkpoint_every_n_hours = 6; - * @return {number} - */ -proto.tensorflow.SaverDef.prototype.getKeepCheckpointEveryNHours = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); -}; - - -/** @param {number} value */ -proto.tensorflow.SaverDef.prototype.setKeepCheckpointEveryNHours = function(value) { - jspb.Message.setProto3FloatField(this, 6, value); -}; - - -/** - * optional CheckpointFormatVersion version = 7; - * @return {!proto.tensorflow.SaverDef.CheckpointFormatVersion} - */ -proto.tensorflow.SaverDef.prototype.getVersion = function() { - return /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); -}; - - -/** @param {!proto.tensorflow.SaverDef.CheckpointFormatVersion} value */ -proto.tensorflow.SaverDef.prototype.setVersion = function(value) { - jspb.Message.setProto3EnumField(this, 7, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.tensorflow.TensorInfo.oneofGroups_ = [[1,4]]; - -/** - * @enum {number} - */ -proto.tensorflow.TensorInfo.EncodingCase = { - ENCODING_NOT_SET: 0, - NAME: 1, - COO_SPARSE: 4 -}; - -/** - * @return {proto.tensorflow.TensorInfo.EncodingCase} - */ -proto.tensorflow.TensorInfo.prototype.getEncodingCase = function() { - return /** @type {proto.tensorflow.TensorInfo.EncodingCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.TensorInfo.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.TensorInfo.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.TensorInfo.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.TensorInfo} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorInfo.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - cooSparse: (f = msg.getCooSparse()) && proto.tensorflow.TensorInfo.CooSparse.toObject(includeInstance, f), - dtype: jspb.Message.getFieldWithDefault(msg, 2, 0), - tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.TensorInfo} - */ -proto.tensorflow.TensorInfo.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.TensorInfo; - return proto.tensorflow.TensorInfo.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.TensorInfo} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.TensorInfo} - */ -proto.tensorflow.TensorInfo.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 4: - var value = new proto.tensorflow.TensorInfo.CooSparse; - reader.readMessage(value,proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader); - msg.setCooSparse(value); - break; - case 2: - var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); - msg.setDtype(value); - break; - case 3: - var value = new proto.tensorflow.TensorShape; - reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); - msg.setTensorShape(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.TensorInfo.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.TensorInfo.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.TensorInfo} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorInfo.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = message.getCooSparse(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter - ); - } - f = message.getDtype(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getTensorShape(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.tensorflow.TensorShape.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.TensorInfo.CooSparse.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.TensorInfo.CooSparse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorInfo.CooSparse.toObject = function(includeInstance, msg) { - var f, obj = { - valuesTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), - indicesTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), - denseShapeTensorName: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.TensorInfo.CooSparse} - */ -proto.tensorflow.TensorInfo.CooSparse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.TensorInfo.CooSparse; - return proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.TensorInfo.CooSparse} - */ -proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setValuesTensorName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setIndicesTensorName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDenseShapeTensorName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.TensorInfo.CooSparse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.TensorInfo.CooSparse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValuesTensorName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getIndicesTensorName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDenseShapeTensorName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string values_tensor_name = 1; - * @return {string} - */ -proto.tensorflow.TensorInfo.CooSparse.prototype.getValuesTensorName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.TensorInfo.CooSparse.prototype.setValuesTensorName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string indices_tensor_name = 2; - * @return {string} - */ -proto.tensorflow.TensorInfo.CooSparse.prototype.getIndicesTensorName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.TensorInfo.CooSparse.prototype.setIndicesTensorName = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string dense_shape_tensor_name = 3; - * @return {string} - */ -proto.tensorflow.TensorInfo.CooSparse.prototype.getDenseShapeTensorName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.TensorInfo.CooSparse.prototype.setDenseShapeTensorName = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.TensorInfo.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.TensorInfo.prototype.setName = function(value) { - jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - */ -proto.tensorflow.TensorInfo.prototype.clearName = function() { - jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.TensorInfo.prototype.hasName = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional CooSparse coo_sparse = 4; - * @return {?proto.tensorflow.TensorInfo.CooSparse} - */ -proto.tensorflow.TensorInfo.prototype.getCooSparse = function() { - return /** @type{?proto.tensorflow.TensorInfo.CooSparse} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo.CooSparse, 4)); -}; - - -/** @param {?proto.tensorflow.TensorInfo.CooSparse|undefined} value */ -proto.tensorflow.TensorInfo.prototype.setCooSparse = function(value) { - jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.TensorInfo.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.TensorInfo.prototype.clearCooSparse = function() { - this.setCooSparse(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.TensorInfo.prototype.hasCooSparse = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional DataType dtype = 2; - * @return {!proto.tensorflow.DataType} - */ -proto.tensorflow.TensorInfo.prototype.getDtype = function() { - return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {!proto.tensorflow.DataType} value */ -proto.tensorflow.TensorInfo.prototype.setDtype = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional TensorShape tensor_shape = 3; - * @return {?proto.tensorflow.TensorShape} - */ -proto.tensorflow.TensorInfo.prototype.getTensorShape = function() { - return /** @type{?proto.tensorflow.TensorShape} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 3)); -}; - - -/** @param {?proto.tensorflow.TensorShape|undefined} value */ -proto.tensorflow.TensorInfo.prototype.setTensorShape = function(value) { - jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.TensorInfo.prototype.clearTensorShape = function() { - this.setTensorShape(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.TensorInfo.prototype.hasTensorShape = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.SignatureDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.SignatureDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.SignatureDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SignatureDef.toObject = function(includeInstance, msg) { - var f, obj = { - inputsMap: (f = msg.getInputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], - outputsMap: (f = msg.getOutputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], - methodName: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.SignatureDef} - */ -proto.tensorflow.SignatureDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.SignatureDef; - return proto.tensorflow.SignatureDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.SignatureDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.SignatureDef} - */ -proto.tensorflow.SignatureDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getInputsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); - }); - break; - case 2: - var value = msg.getOutputsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); - }); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMethodName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.SignatureDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.SignatureDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.SignatureDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SignatureDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getInputsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); - } - f = message.getOutputsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); - } - f = message.getMethodName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * map inputs = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.SignatureDef.prototype.getInputsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.tensorflow.TensorInfo)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.SignatureDef.prototype.clearInputsMap = function() { - this.getInputsMap().clear(); -}; - - -/** - * map outputs = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.SignatureDef.prototype.getOutputsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 2, opt_noLazyCreate, - proto.tensorflow.TensorInfo)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.SignatureDef.prototype.clearOutputsMap = function() { - this.getOutputsMap().clear(); -}; - - -/** - * optional string method_name = 3; - * @return {string} - */ -proto.tensorflow.SignatureDef.prototype.getMethodName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.SignatureDef.prototype.setMethodName = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.AssetFileDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.AssetFileDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.AssetFileDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AssetFileDef.toObject = function(includeInstance, msg) { - var f, obj = { - tensorInfo: (f = msg.getTensorInfo()) && proto.tensorflow.TensorInfo.toObject(includeInstance, f), - filename: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.AssetFileDef} - */ -proto.tensorflow.AssetFileDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.AssetFileDef; - return proto.tensorflow.AssetFileDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.AssetFileDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.AssetFileDef} - */ -proto.tensorflow.AssetFileDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.TensorInfo; - reader.readMessage(value,proto.tensorflow.TensorInfo.deserializeBinaryFromReader); - msg.setTensorInfo(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setFilename(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.AssetFileDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.AssetFileDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.AssetFileDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.AssetFileDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTensorInfo(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.tensorflow.TensorInfo.serializeBinaryToWriter - ); - } - f = message.getFilename(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional TensorInfo tensor_info = 1; - * @return {?proto.tensorflow.TensorInfo} - */ -proto.tensorflow.AssetFileDef.prototype.getTensorInfo = function() { - return /** @type{?proto.tensorflow.TensorInfo} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo, 1)); -}; - - -/** @param {?proto.tensorflow.TensorInfo|undefined} value */ -proto.tensorflow.AssetFileDef.prototype.setTensorInfo = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.AssetFileDef.prototype.clearTensorInfo = function() { - this.setTensorInfo(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.AssetFileDef.prototype.hasTensorInfo = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string filename = 2; - * @return {string} - */ -proto.tensorflow.AssetFileDef.prototype.getFilename = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.AssetFileDef.prototype.setFilename = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.OpDef.repeatedFields_ = [2,3,4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.OpDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.OpDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.OpDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - inputArgList: jspb.Message.toObjectList(msg.getInputArgList(), - proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), - outputArgList: jspb.Message.toObjectList(msg.getOutputArgList(), - proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), - attrList: jspb.Message.toObjectList(msg.getAttrList(), - proto.tensorflow.OpDef.AttrDef.toObject, includeInstance), - deprecation: (f = msg.getDeprecation()) && proto.tensorflow.OpDef.OpDeprecation.toObject(includeInstance, f), - summary: jspb.Message.getFieldWithDefault(msg, 5, ""), - description: jspb.Message.getFieldWithDefault(msg, 6, ""), - isCommutative: jspb.Message.getBooleanFieldWithDefault(msg, 18, false), - isAggregate: jspb.Message.getBooleanFieldWithDefault(msg, 16, false), - isStateful: jspb.Message.getBooleanFieldWithDefault(msg, 17, false), - allowsUninitializedInput: jspb.Message.getBooleanFieldWithDefault(msg, 19, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.OpDef} - */ -proto.tensorflow.OpDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.OpDef; - return proto.tensorflow.OpDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.OpDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.OpDef} - */ -proto.tensorflow.OpDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = new proto.tensorflow.OpDef.ArgDef; - reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); - msg.addInputArg(value); - break; - case 3: - var value = new proto.tensorflow.OpDef.ArgDef; - reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); - msg.addOutputArg(value); - break; - case 4: - var value = new proto.tensorflow.OpDef.AttrDef; - reader.readMessage(value,proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader); - msg.addAttr(value); - break; - case 8: - var value = new proto.tensorflow.OpDef.OpDeprecation; - reader.readMessage(value,proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader); - msg.setDeprecation(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setSummary(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 18: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsCommutative(value); - break; - case 16: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsAggregate(value); - break; - case 17: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsStateful(value); - break; - case 19: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAllowsUninitializedInput(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.OpDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.OpDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.OpDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getInputArgList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter - ); - } - f = message.getOutputArgList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter - ); - } - f = message.getAttrList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter - ); - } - f = message.getDeprecation(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter - ); - } - f = message.getSummary(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getIsCommutative(); - if (f) { - writer.writeBool( - 18, - f - ); - } - f = message.getIsAggregate(); - if (f) { - writer.writeBool( - 16, - f - ); - } - f = message.getIsStateful(); - if (f) { - writer.writeBool( - 17, - f - ); - } - f = message.getAllowsUninitializedInput(); - if (f) { - writer.writeBool( - 19, - f - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.OpDef.ArgDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.OpDef.ArgDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.OpDef.ArgDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.ArgDef.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - description: jspb.Message.getFieldWithDefault(msg, 2, ""), - type: jspb.Message.getFieldWithDefault(msg, 3, 0), - typeAttr: jspb.Message.getFieldWithDefault(msg, 4, ""), - numberAttr: jspb.Message.getFieldWithDefault(msg, 5, ""), - typeListAttr: jspb.Message.getFieldWithDefault(msg, 6, ""), - isRef: jspb.Message.getBooleanFieldWithDefault(msg, 16, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.OpDef.ArgDef} - */ -proto.tensorflow.OpDef.ArgDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.OpDef.ArgDef; - return proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.OpDef.ArgDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.OpDef.ArgDef} - */ -proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 3: - var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); - msg.setType(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setTypeAttr(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setNumberAttr(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setTypeListAttr(value); - break; - case 16: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsRef(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.OpDef.ArgDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.OpDef.ArgDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); - } - f = message.getTypeAttr(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getNumberAttr(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getTypeListAttr(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getIsRef(); - if (f) { - writer.writeBool( - 16, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string description = 2; - * @return {string} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setDescription = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional DataType type = 3; - * @return {!proto.tensorflow.DataType} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getType = function() { - return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** @param {!proto.tensorflow.DataType} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 3, value); -}; - - -/** - * optional string type_attr = 4; - * @return {string} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getTypeAttr = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setTypeAttr = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string number_attr = 5; - * @return {string} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getNumberAttr = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setNumberAttr = function(value) { - jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string type_list_attr = 6; - * @return {string} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getTypeListAttr = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setTypeListAttr = function(value) { - jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional bool is_ref = 16; - * @return {boolean} - */ -proto.tensorflow.OpDef.ArgDef.prototype.getIsRef = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.ArgDef.prototype.setIsRef = function(value) { - jspb.Message.setProto3BooleanField(this, 16, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.OpDef.AttrDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.OpDef.AttrDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.OpDef.AttrDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.AttrDef.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - type: jspb.Message.getFieldWithDefault(msg, 2, ""), - defaultValue: (f = msg.getDefaultValue()) && proto.tensorflow.AttrValue.toObject(includeInstance, f), - description: jspb.Message.getFieldWithDefault(msg, 4, ""), - hasMinimum: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - minimum: jspb.Message.getFieldWithDefault(msg, 6, 0), - allowedValues: (f = msg.getAllowedValues()) && proto.tensorflow.AttrValue.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.OpDef.AttrDef} - */ -proto.tensorflow.OpDef.AttrDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.OpDef.AttrDef; - return proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.OpDef.AttrDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.OpDef.AttrDef} - */ -proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setType(value); - break; - case 3: - var value = new proto.tensorflow.AttrValue; - reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); - msg.setDefaultValue(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setHasMinimum(value); - break; - case 6: - var value = /** @type {number} */ (reader.readInt64()); - msg.setMinimum(value); - break; - case 7: - var value = new proto.tensorflow.AttrValue; - reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); - msg.setAllowedValues(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.OpDef.AttrDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.OpDef.AttrDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDefaultValue(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.tensorflow.AttrValue.serializeBinaryToWriter - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getHasMinimum(); - if (f) { - writer.writeBool( - 5, - f - ); - } - f = message.getMinimum(); - if (f !== 0) { - writer.writeInt64( - 6, - f - ); - } - f = message.getAllowedValues(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.tensorflow.AttrValue.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string type = 2; - * @return {string} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setType = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional AttrValue default_value = 3; - * @return {?proto.tensorflow.AttrValue} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getDefaultValue = function() { - return /** @type{?proto.tensorflow.AttrValue} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 3)); -}; - - -/** @param {?proto.tensorflow.AttrValue|undefined} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setDefaultValue = function(value) { - jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.OpDef.AttrDef.prototype.clearDefaultValue = function() { - this.setDefaultValue(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.OpDef.AttrDef.prototype.hasDefaultValue = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional string description = 4; - * @return {string} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setDescription = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional bool has_minimum = 5; - * @return {boolean} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getHasMinimum = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setHasMinimum = function(value) { - jspb.Message.setProto3BooleanField(this, 5, value); -}; - - -/** - * optional int64 minimum = 6; - * @return {number} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getMinimum = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setMinimum = function(value) { - jspb.Message.setProto3IntField(this, 6, value); -}; - - -/** - * optional AttrValue allowed_values = 7; - * @return {?proto.tensorflow.AttrValue} - */ -proto.tensorflow.OpDef.AttrDef.prototype.getAllowedValues = function() { - return /** @type{?proto.tensorflow.AttrValue} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 7)); -}; - - -/** @param {?proto.tensorflow.AttrValue|undefined} value */ -proto.tensorflow.OpDef.AttrDef.prototype.setAllowedValues = function(value) { - jspb.Message.setWrapperField(this, 7, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.OpDef.AttrDef.prototype.clearAllowedValues = function() { - this.setAllowedValues(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.OpDef.AttrDef.prototype.hasAllowedValues = function() { - return jspb.Message.getField(this, 7) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.OpDef.OpDeprecation.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.OpDef.OpDeprecation.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.OpDeprecation.toObject = function(includeInstance, msg) { - var f, obj = { - version: jspb.Message.getFieldWithDefault(msg, 1, 0), - explanation: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.OpDef.OpDeprecation} - */ -proto.tensorflow.OpDef.OpDeprecation.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.OpDef.OpDeprecation; - return proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.OpDef.OpDeprecation} - */ -proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setVersion(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setExplanation(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.OpDef.OpDeprecation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.OpDef.OpDeprecation} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVersion(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } - f = message.getExplanation(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional int32 version = 1; - * @return {number} - */ -proto.tensorflow.OpDef.OpDeprecation.prototype.getVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.OpDef.OpDeprecation.prototype.setVersion = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string explanation = 2; - * @return {string} - */ -proto.tensorflow.OpDef.OpDeprecation.prototype.getExplanation = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.OpDeprecation.prototype.setExplanation = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.tensorflow.OpDef.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.prototype.setName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * repeated ArgDef input_arg = 2; - * @return {!Array} - */ -proto.tensorflow.OpDef.prototype.getInputArgList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 2)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.OpDef.prototype.setInputArgList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.OpDef.ArgDef} - */ -proto.tensorflow.OpDef.prototype.addInputArg = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.OpDef.prototype.clearInputArgList = function() { - this.setInputArgList([]); -}; - - -/** - * repeated ArgDef output_arg = 3; - * @return {!Array} - */ -proto.tensorflow.OpDef.prototype.getOutputArgList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 3)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.OpDef.prototype.setOutputArgList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.OpDef.ArgDef} - */ -proto.tensorflow.OpDef.prototype.addOutputArg = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.OpDef.prototype.clearOutputArgList = function() { - this.setOutputArgList([]); -}; - - -/** - * repeated AttrDef attr = 4; - * @return {!Array} - */ -proto.tensorflow.OpDef.prototype.getAttrList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.AttrDef, 4)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.OpDef.prototype.setAttrList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.tensorflow.OpDef.AttrDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.OpDef.AttrDef} - */ -proto.tensorflow.OpDef.prototype.addAttr = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.tensorflow.OpDef.AttrDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.OpDef.prototype.clearAttrList = function() { - this.setAttrList([]); -}; - - -/** - * optional OpDeprecation deprecation = 8; - * @return {?proto.tensorflow.OpDef.OpDeprecation} - */ -proto.tensorflow.OpDef.prototype.getDeprecation = function() { - return /** @type{?proto.tensorflow.OpDef.OpDeprecation} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.OpDef.OpDeprecation, 8)); -}; - - -/** @param {?proto.tensorflow.OpDef.OpDeprecation|undefined} value */ -proto.tensorflow.OpDef.prototype.setDeprecation = function(value) { - jspb.Message.setWrapperField(this, 8, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.OpDef.prototype.clearDeprecation = function() { - this.setDeprecation(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.OpDef.prototype.hasDeprecation = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional string summary = 5; - * @return {string} - */ -proto.tensorflow.OpDef.prototype.getSummary = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.prototype.setSummary = function(value) { - jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string description = 6; - * @return {string} - */ -proto.tensorflow.OpDef.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.OpDef.prototype.setDescription = function(value) { - jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional bool is_commutative = 18; - * @return {boolean} - */ -proto.tensorflow.OpDef.prototype.getIsCommutative = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 18, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.prototype.setIsCommutative = function(value) { - jspb.Message.setProto3BooleanField(this, 18, value); -}; - - -/** - * optional bool is_aggregate = 16; - * @return {boolean} - */ -proto.tensorflow.OpDef.prototype.getIsAggregate = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.prototype.setIsAggregate = function(value) { - jspb.Message.setProto3BooleanField(this, 16, value); -}; - - -/** - * optional bool is_stateful = 17; - * @return {boolean} - */ -proto.tensorflow.OpDef.prototype.getIsStateful = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 17, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.prototype.setIsStateful = function(value) { - jspb.Message.setProto3BooleanField(this, 17, value); -}; - - -/** - * optional bool allows_uninitialized_input = 19; - * @return {boolean} - */ -proto.tensorflow.OpDef.prototype.getAllowsUninitializedInput = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 19, false)); -}; - - -/** @param {boolean} value */ -proto.tensorflow.OpDef.prototype.setAllowsUninitializedInput = function(value) { - jspb.Message.setProto3BooleanField(this, 19, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.OpList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.OpList.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.OpList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.OpList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpList.toObject = function(includeInstance, msg) { - var f, obj = { - opList: jspb.Message.toObjectList(msg.getOpList(), - proto.tensorflow.OpDef.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.OpList} - */ -proto.tensorflow.OpList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.OpList; - return proto.tensorflow.OpList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.OpList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.OpList} - */ -proto.tensorflow.OpList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.OpDef; - reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); - msg.addOp(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.OpList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.OpList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.OpList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.OpList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getOpList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.tensorflow.OpDef.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated OpDef op = 1; - * @return {!Array} - */ -proto.tensorflow.OpList.prototype.getOpList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.OpList.prototype.setOpList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.tensorflow.OpDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.OpDef} - */ -proto.tensorflow.OpList.prototype.addOp = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.OpDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.OpList.prototype.clearOpList = function() { - this.setOpList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.MetaGraphDef.repeatedFields_ = [6]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.MetaGraphDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.MetaGraphDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.MetaGraphDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.MetaGraphDef.toObject = function(includeInstance, msg) { - var f, obj = { - metaInfoDef: (f = msg.getMetaInfoDef()) && proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(includeInstance, f), - graphDef: (f = msg.getGraphDef()) && proto.tensorflow.GraphDef.toObject(includeInstance, f), - saverDef: (f = msg.getSaverDef()) && proto.tensorflow.SaverDef.toObject(includeInstance, f), - collectionDefMap: (f = msg.getCollectionDefMap()) ? f.toObject(includeInstance, proto.tensorflow.CollectionDef.toObject) : [], - signatureDefMap: (f = msg.getSignatureDefMap()) ? f.toObject(includeInstance, proto.tensorflow.SignatureDef.toObject) : [], - assetFileDefList: jspb.Message.toObjectList(msg.getAssetFileDefList(), - proto.tensorflow.AssetFileDef.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.MetaGraphDef} - */ -proto.tensorflow.MetaGraphDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.MetaGraphDef; - return proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.MetaGraphDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.MetaGraphDef} - */ -proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.MetaGraphDef.MetaInfoDef; - reader.readMessage(value,proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader); - msg.setMetaInfoDef(value); - break; - case 2: - var value = new proto.tensorflow.GraphDef; - reader.readMessage(value,proto.tensorflow.GraphDef.deserializeBinaryFromReader); - msg.setGraphDef(value); - break; - case 3: - var value = new proto.tensorflow.SaverDef; - reader.readMessage(value,proto.tensorflow.SaverDef.deserializeBinaryFromReader); - msg.setSaverDef(value); - break; - case 4: - var value = msg.getCollectionDefMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.CollectionDef.deserializeBinaryFromReader, ""); - }); - break; - case 5: - var value = msg.getSignatureDefMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.SignatureDef.deserializeBinaryFromReader, ""); - }); - break; - case 6: - var value = new proto.tensorflow.AssetFileDef; - reader.readMessage(value,proto.tensorflow.AssetFileDef.deserializeBinaryFromReader); - msg.addAssetFileDef(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.MetaGraphDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.MetaGraphDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.MetaGraphDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.MetaGraphDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMetaInfoDef(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter - ); - } - f = message.getGraphDef(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.tensorflow.GraphDef.serializeBinaryToWriter - ); - } - f = message.getSaverDef(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.tensorflow.SaverDef.serializeBinaryToWriter - ); - } - f = message.getCollectionDefMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.CollectionDef.serializeBinaryToWriter); - } - f = message.getSignatureDefMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.SignatureDef.serializeBinaryToWriter); - } - f = message.getAssetFileDefList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 6, - f, - proto.tensorflow.AssetFileDef.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject = function(includeInstance, msg) { - var f, obj = { - metaGraphVersion: jspb.Message.getFieldWithDefault(msg, 1, ""), - strippedOpList: (f = msg.getStrippedOpList()) && proto.tensorflow.OpList.toObject(includeInstance, f), - anyInfo: (f = msg.getAnyInfo()) && proto.tensorflow.Any.toObject(includeInstance, f), - tagsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - tensorflowVersion: jspb.Message.getFieldWithDefault(msg, 5, ""), - tensorflowGitVersion: jspb.Message.getFieldWithDefault(msg, 6, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.MetaGraphDef.MetaInfoDef; - return proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMetaGraphVersion(value); - break; - case 2: - var value = new proto.tensorflow.OpList; - reader.readMessage(value,proto.tensorflow.OpList.deserializeBinaryFromReader); - msg.setStrippedOpList(value); - break; - case 3: - var value = new proto.tensorflow.Any; - reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); - msg.setAnyInfo(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addTags(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setTensorflowVersion(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setTensorflowGitVersion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMetaGraphVersion(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getStrippedOpList(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.tensorflow.OpList.serializeBinaryToWriter - ); - } - f = message.getAnyInfo(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.tensorflow.Any.serializeBinaryToWriter - ); - } - f = message.getTagsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); - } - f = message.getTensorflowVersion(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getTensorflowGitVersion(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } -}; - - -/** - * optional string meta_graph_version = 1; - * @return {string} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getMetaGraphVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setMetaGraphVersion = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional OpList stripped_op_list = 2; - * @return {?proto.tensorflow.OpList} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getStrippedOpList = function() { - return /** @type{?proto.tensorflow.OpList} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.OpList, 2)); -}; - - -/** @param {?proto.tensorflow.OpList|undefined} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setStrippedOpList = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearStrippedOpList = function() { - this.setStrippedOpList(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasStrippedOpList = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional Any any_info = 3; - * @return {?proto.tensorflow.Any} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getAnyInfo = function() { - return /** @type{?proto.tensorflow.Any} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.Any, 3)); -}; - - -/** @param {?proto.tensorflow.Any|undefined} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setAnyInfo = function(value) { - jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearAnyInfo = function() { - this.setAnyInfo(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasAnyInfo = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * repeated string tags = 4; - * @return {!Array} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTagsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTagsList = function(value) { - jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.addTags = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearTagsList = function() { - this.setTagsList([]); -}; - - -/** - * optional string tensorflow_version = 5; - * @return {string} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowVersion = function(value) { - jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string tensorflow_git_version = 6; - * @return {string} - */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowGitVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowGitVersion = function(value) { - jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional MetaInfoDef meta_info_def = 1; - * @return {?proto.tensorflow.MetaGraphDef.MetaInfoDef} - */ -proto.tensorflow.MetaGraphDef.prototype.getMetaInfoDef = function() { - return /** @type{?proto.tensorflow.MetaGraphDef.MetaInfoDef} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.MetaGraphDef.MetaInfoDef, 1)); -}; - - -/** @param {?proto.tensorflow.MetaGraphDef.MetaInfoDef|undefined} value */ -proto.tensorflow.MetaGraphDef.prototype.setMetaInfoDef = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.MetaGraphDef.prototype.clearMetaInfoDef = function() { - this.setMetaInfoDef(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.MetaGraphDef.prototype.hasMetaInfoDef = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional GraphDef graph_def = 2; - * @return {?proto.tensorflow.GraphDef} - */ -proto.tensorflow.MetaGraphDef.prototype.getGraphDef = function() { - return /** @type{?proto.tensorflow.GraphDef} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.GraphDef, 2)); -}; - - -/** @param {?proto.tensorflow.GraphDef|undefined} value */ -proto.tensorflow.MetaGraphDef.prototype.setGraphDef = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.MetaGraphDef.prototype.clearGraphDef = function() { - this.setGraphDef(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.MetaGraphDef.prototype.hasGraphDef = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional SaverDef saver_def = 3; - * @return {?proto.tensorflow.SaverDef} - */ -proto.tensorflow.MetaGraphDef.prototype.getSaverDef = function() { - return /** @type{?proto.tensorflow.SaverDef} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.SaverDef, 3)); -}; - - -/** @param {?proto.tensorflow.SaverDef|undefined} value */ -proto.tensorflow.MetaGraphDef.prototype.setSaverDef = function(value) { - jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.MetaGraphDef.prototype.clearSaverDef = function() { - this.setSaverDef(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.MetaGraphDef.prototype.hasSaverDef = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * map collection_def = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.MetaGraphDef.prototype.getCollectionDefMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 4, opt_noLazyCreate, - proto.tensorflow.CollectionDef)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.MetaGraphDef.prototype.clearCollectionDefMap = function() { - this.getCollectionDefMap().clear(); -}; - - -/** - * map signature_def = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.MetaGraphDef.prototype.getSignatureDefMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - proto.tensorflow.SignatureDef)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.MetaGraphDef.prototype.clearSignatureDefMap = function() { - this.getSignatureDefMap().clear(); -}; - - -/** - * repeated AssetFileDef asset_file_def = 6; - * @return {!Array} - */ -proto.tensorflow.MetaGraphDef.prototype.getAssetFileDefList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.AssetFileDef, 6)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.MetaGraphDef.prototype.setAssetFileDefList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 6, value); -}; - - -/** - * @param {!proto.tensorflow.AssetFileDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.AssetFileDef} - */ -proto.tensorflow.MetaGraphDef.prototype.addAssetFileDef = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.tensorflow.AssetFileDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.MetaGraphDef.prototype.clearAssetFileDefList = function() { - this.setAssetFileDefList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.SavedModel.repeatedFields_ = [2]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.SavedModel.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.SavedModel.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.SavedModel} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SavedModel.toObject = function(includeInstance, msg) { - var f, obj = { - savedModelSchemaVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), - metaGraphsList: jspb.Message.toObjectList(msg.getMetaGraphsList(), - proto.tensorflow.MetaGraphDef.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.SavedModel} - */ -proto.tensorflow.SavedModel.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.SavedModel; - return proto.tensorflow.SavedModel.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.SavedModel} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.SavedModel} - */ -proto.tensorflow.SavedModel.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setSavedModelSchemaVersion(value); - break; - case 2: - var value = new proto.tensorflow.MetaGraphDef; - reader.readMessage(value,proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader); - msg.addMetaGraphs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.SavedModel.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.SavedModel.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.SavedModel} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.SavedModel.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSavedModelSchemaVersion(); - if (f !== 0) { - writer.writeInt64( - 1, - f - ); - } - f = message.getMetaGraphsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.tensorflow.MetaGraphDef.serializeBinaryToWriter - ); - } -}; - - -/** - * optional int64 saved_model_schema_version = 1; - * @return {number} - */ -proto.tensorflow.SavedModel.prototype.getSavedModelSchemaVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.tensorflow.SavedModel.prototype.setSavedModelSchemaVersion = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * repeated MetaGraphDef meta_graphs = 2; - * @return {!Array} - */ -proto.tensorflow.SavedModel.prototype.getMetaGraphsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.MetaGraphDef, 2)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.SavedModel.prototype.setMetaGraphsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.tensorflow.MetaGraphDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.MetaGraphDef} - */ -proto.tensorflow.SavedModel.prototype.addMetaGraphs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.MetaGraphDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.SavedModel.prototype.clearMetaGraphsList = function() { - this.setMetaGraphsList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.FunctionDefLibrary.repeatedFields_ = [1,2]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.FunctionDefLibrary.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.FunctionDefLibrary.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.FunctionDefLibrary} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.FunctionDefLibrary.toObject = function(includeInstance, msg) { - var f, obj = { - functionList: jspb.Message.toObjectList(msg.getFunctionList(), - proto.tensorflow.FunctionDef.toObject, includeInstance), - gradientList: jspb.Message.toObjectList(msg.getGradientList(), - proto.tensorflow.GradientDef.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.FunctionDefLibrary} - */ -proto.tensorflow.FunctionDefLibrary.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.FunctionDefLibrary; - return proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.FunctionDefLibrary} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.FunctionDefLibrary} - */ -proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.FunctionDef; - reader.readMessage(value,proto.tensorflow.FunctionDef.deserializeBinaryFromReader); - msg.addFunction(value); - break; - case 2: - var value = new proto.tensorflow.GradientDef; - reader.readMessage(value,proto.tensorflow.GradientDef.deserializeBinaryFromReader); - msg.addGradient(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.FunctionDefLibrary.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.FunctionDefLibrary} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getFunctionList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.tensorflow.FunctionDef.serializeBinaryToWriter - ); - } - f = message.getGradientList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.tensorflow.GradientDef.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated FunctionDef function = 1; - * @return {!Array} - */ -proto.tensorflow.FunctionDefLibrary.prototype.getFunctionList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.FunctionDef, 1)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.FunctionDefLibrary.prototype.setFunctionList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.tensorflow.FunctionDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.FunctionDef} - */ -proto.tensorflow.FunctionDefLibrary.prototype.addFunction = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.FunctionDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.FunctionDefLibrary.prototype.clearFunctionList = function() { - this.setFunctionList([]); -}; - - -/** - * repeated GradientDef gradient = 2; - * @return {!Array} - */ -proto.tensorflow.FunctionDefLibrary.prototype.getGradientList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.GradientDef, 2)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.FunctionDefLibrary.prototype.setGradientList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.tensorflow.GradientDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.GradientDef} - */ -proto.tensorflow.FunctionDefLibrary.prototype.addGradient = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.GradientDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.FunctionDefLibrary.prototype.clearGradientList = function() { - this.setGradientList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.tensorflow.FunctionDef.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.FunctionDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.FunctionDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.FunctionDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.FunctionDef.toObject = function(includeInstance, msg) { - var f, obj = { - signature: (f = msg.getSignature()) && proto.tensorflow.OpDef.toObject(includeInstance, f), - attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [], - nodeDefList: jspb.Message.toObjectList(msg.getNodeDefList(), - proto.tensorflow.NodeDef.toObject, includeInstance), - retMap: (f = msg.getRetMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.FunctionDef} - */ -proto.tensorflow.FunctionDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.FunctionDef; - return proto.tensorflow.FunctionDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.FunctionDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.FunctionDef} - */ -proto.tensorflow.FunctionDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.tensorflow.OpDef; - reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); - msg.setSignature(value); - break; - case 5: - var value = msg.getAttrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); - }); - break; - case 3: - var value = new proto.tensorflow.NodeDef; - reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); - msg.addNodeDef(value); - break; - case 4: - var value = msg.getRetMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.FunctionDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.FunctionDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.FunctionDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.FunctionDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSignature(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.tensorflow.OpDef.serializeBinaryToWriter - ); - } - f = message.getAttrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); - } - f = message.getNodeDefList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.tensorflow.NodeDef.serializeBinaryToWriter - ); - } - f = message.getRetMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional OpDef signature = 1; - * @return {?proto.tensorflow.OpDef} - */ -proto.tensorflow.FunctionDef.prototype.getSignature = function() { - return /** @type{?proto.tensorflow.OpDef} */ ( - jspb.Message.getWrapperField(this, proto.tensorflow.OpDef, 1)); -}; - - -/** @param {?proto.tensorflow.OpDef|undefined} value */ -proto.tensorflow.FunctionDef.prototype.setSignature = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.tensorflow.FunctionDef.prototype.clearSignature = function() { - this.setSignature(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.tensorflow.FunctionDef.prototype.hasSignature = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * map attr = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.FunctionDef.prototype.getAttrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - proto.tensorflow.AttrValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.FunctionDef.prototype.clearAttrMap = function() { - this.getAttrMap().clear(); -}; - - -/** - * repeated NodeDef node_def = 3; - * @return {!Array} - */ -proto.tensorflow.FunctionDef.prototype.getNodeDefList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 3)); -}; - - -/** @param {!Array} value */ -proto.tensorflow.FunctionDef.prototype.setNodeDefList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.tensorflow.NodeDef=} opt_value - * @param {number=} opt_index - * @return {!proto.tensorflow.NodeDef} - */ -proto.tensorflow.FunctionDef.prototype.addNodeDef = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.NodeDef, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.tensorflow.FunctionDef.prototype.clearNodeDefList = function() { - this.setNodeDefList([]); -}; - - -/** - * map ret = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.tensorflow.FunctionDef.prototype.getRetMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 4, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.tensorflow.FunctionDef.prototype.clearRetMap = function() { - this.getRetMap().clear(); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.tensorflow.GradientDef.prototype.toObject = function(opt_includeInstance) { - return proto.tensorflow.GradientDef.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.tensorflow.GradientDef} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.GradientDef.toObject = function(includeInstance, msg) { - var f, obj = { - functionName: jspb.Message.getFieldWithDefault(msg, 1, ""), - gradientFunc: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.tensorflow.GradientDef} - */ -proto.tensorflow.GradientDef.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.tensorflow.GradientDef; - return proto.tensorflow.GradientDef.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.tensorflow.GradientDef} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.tensorflow.GradientDef} - */ -proto.tensorflow.GradientDef.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setFunctionName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setGradientFunc(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.tensorflow.GradientDef.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.tensorflow.GradientDef.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.tensorflow.GradientDef} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.tensorflow.GradientDef.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getFunctionName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getGradientFunc(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string function_name = 1; - * @return {string} - */ -proto.tensorflow.GradientDef.prototype.getFunctionName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.GradientDef.prototype.setFunctionName = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string gradient_func = 2; - * @return {string} - */ -proto.tensorflow.GradientDef.prototype.getGradientFunc = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.tensorflow.GradientDef.prototype.setGradientFunc = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * @enum {number} - */ -proto.tensorflow.DataType = { - DT_INVALID: 0, - DT_FLOAT: 1, - DT_DOUBLE: 2, - DT_INT32: 3, - DT_UINT8: 4, - DT_INT16: 5, - DT_INT8: 6, - DT_STRING: 7, - DT_COMPLEX64: 8, - DT_INT64: 9, - DT_BOOL: 10, - DT_QINT8: 11, - DT_QUINT8: 12, - DT_QINT32: 13, - DT_BFLOAT16: 14, - DT_FLOAT_REF: 101, - DT_DOUBLE_REF: 102, - DT_INT32_REF: 103, - DT_UINT8_REF: 104, - DT_INT16_REF: 105, - DT_INT8_REF: 106, - DT_STRING_REF: 107, - DT_COMPLEX64_REF: 108, - DT_INT64_REF: 109, - DT_BOOL_REF: 110, - DT_QINT8_REF: 111, - DT_QUINT8_REF: 112, - DT_QINT32_REF: 113, - DT_BFLOAT16_REF: 114 -}; - -goog.object.extend(exports, proto.tensorflow); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts deleted file mode 100644 index cb0ff5c3b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js deleted file mode 100644 index 8c4e4df5a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js +++ /dev/null @@ -1,325 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * @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. - * ============================================================================= - */ -// We explicitly import the modular kernels so they get registered in the -// global registry when we compile the library. A modular build would replace -// the contents of this file and import only the kernels that are needed. -var tfjs_1 = require("@tensorflow/tfjs"); -var _FusedMatMul_1 = require("./kernels/_FusedMatMul"); -var Abs_1 = require("./kernels/Abs"); -var Acos_1 = require("./kernels/Acos"); -var Acosh_1 = require("./kernels/Acosh"); -var Add_1 = require("./kernels/Add"); -var AddN_1 = require("./kernels/AddN"); -var All_1 = require("./kernels/All"); -var Any_1 = require("./kernels/Any"); -var ArgMax_1 = require("./kernels/ArgMax"); -var ArgMin_1 = require("./kernels/ArgMin"); -var Asin_1 = require("./kernels/Asin"); -var Asinh_1 = require("./kernels/Asinh"); -var Atan_1 = require("./kernels/Atan"); -var Atan2_1 = require("./kernels/Atan2"); -var Atanh_1 = require("./kernels/Atanh"); -var AvgPool_1 = require("./kernels/AvgPool"); -var AvgPool3D_1 = require("./kernels/AvgPool3D"); -var AvgPool3DGrad_1 = require("./kernels/AvgPool3DGrad"); -var AvgPoolGrad_1 = require("./kernels/AvgPoolGrad"); -var BatchMatMul_1 = require("./kernels/BatchMatMul"); -var BatchToSpaceND_1 = require("./kernels/BatchToSpaceND"); -var Bincount_1 = require("./kernels/Bincount"); -var Cast_1 = require("./kernels/Cast"); -var Ceil_1 = require("./kernels/Ceil"); -var ClipByValue_1 = require("./kernels/ClipByValue"); -var Complex_1 = require("./kernels/Complex"); -var ComplexAbs_1 = require("./kernels/ComplexAbs"); -var Concat_1 = require("./kernels/Concat"); -var Conv2D_1 = require("./kernels/Conv2D"); -var Conv2DBackpropFilter_1 = require("./kernels/Conv2DBackpropFilter"); -var Conv2DBackpropInput_1 = require("./kernels/Conv2DBackpropInput"); -var Conv3D_1 = require("./kernels/Conv3D"); -var Conv3DBackpropFilterV2_1 = require("./kernels/Conv3DBackpropFilterV2"); -var Conv3DBackpropInputV2_1 = require("./kernels/Conv3DBackpropInputV2"); -var Cos_1 = require("./kernels/Cos"); -var Cosh_1 = require("./kernels/Cosh"); -var CropAndResize_1 = require("./kernels/CropAndResize"); -var Cumsum_1 = require("./kernels/Cumsum"); -var DepthToSpace_1 = require("./kernels/DepthToSpace"); -var DepthwiseConv2dNative_1 = require("./kernels/DepthwiseConv2dNative"); -var DepthwiseConv2dNativeBackpropFilter_1 = require("./kernels/DepthwiseConv2dNativeBackpropFilter"); -var DepthwiseConv2dNativeBackpropInput_1 = require("./kernels/DepthwiseConv2dNativeBackpropInput"); -var Diag_1 = require("./kernels/Diag"); -var Dilation2D_1 = require("./kernels/Dilation2D"); -var Dilation2DBackpropFilter_1 = require("./kernels/Dilation2DBackpropFilter"); -var Dilation2DBackpropInput_1 = require("./kernels/Dilation2DBackpropInput"); -var Elu_1 = require("./kernels/Elu"); -var EluGrad_1 = require("./kernels/EluGrad"); -var Equal_1 = require("./kernels/Equal"); -var Erf_1 = require("./kernels/Erf"); -var Exp_1 = require("./kernels/Exp"); -var ExpandDims_1 = require("./kernels/ExpandDims"); -var Expm1_1 = require("./kernels/Expm1"); -var FFT_1 = require("./kernels/FFT"); -var Fill_1 = require("./kernels/Fill"); -var Floor_1 = require("./kernels/Floor"); -var FloorDiv_1 = require("./kernels/FloorDiv"); -var FusedBatchNorm_1 = require("./kernels/FusedBatchNorm"); -var FusedConv2D_1 = require("./kernels/FusedConv2D"); -var FusedDepthwiseConv2D_1 = require("./kernels/FusedDepthwiseConv2D"); -var GatherNd_1 = require("./kernels/GatherNd"); -var GatherV2_1 = require("./kernels/GatherV2"); -var Greater_1 = require("./kernels/Greater"); -var GreaterEqual_1 = require("./kernels/GreaterEqual"); -var Identity_1 = require("./kernels/Identity"); -var IFFT_1 = require("./kernels/IFFT"); -var Imag_1 = require("./kernels/Imag"); -var IsFinite_1 = require("./kernels/IsFinite"); -var IsInf_1 = require("./kernels/IsInf"); -var IsNan_1 = require("./kernels/IsNan"); -var LeakyRelu_1 = require("./kernels/LeakyRelu"); -var Less_1 = require("./kernels/Less"); -var LessEqual_1 = require("./kernels/LessEqual"); -var LinSpace_1 = require("./kernels/LinSpace"); -var Log_1 = require("./kernels/Log"); -var Log1p_1 = require("./kernels/Log1p"); -var LogicalAnd_1 = require("./kernels/LogicalAnd"); -var LogicalNot_1 = require("./kernels/LogicalNot"); -var LogicalOr_1 = require("./kernels/LogicalOr"); -var LRN_1 = require("./kernels/LRN"); -var LRNGrad_1 = require("./kernels/LRNGrad"); -var Max_1 = require("./kernels/Max"); -var Maximum_1 = require("./kernels/Maximum"); -var MaxPool_1 = require("./kernels/MaxPool"); -var MaxPool3D_1 = require("./kernels/MaxPool3D"); -var MaxPool3DGrad_1 = require("./kernels/MaxPool3DGrad"); -var MaxPoolGrad_1 = require("./kernels/MaxPoolGrad"); -var Mean_1 = require("./kernels/Mean"); -var Min_1 = require("./kernels/Min"); -var Minimum_1 = require("./kernels/Minimum"); -var MirrorPad_1 = require("./kernels/MirrorPad"); -var Mod_1 = require("./kernels/Mod"); -var Multinomial_1 = require("./kernels/Multinomial"); -var Multiply_1 = require("./kernels/Multiply"); -var Neg_1 = require("./kernels/Neg"); -var NonMaxSuppressionV3_1 = require("./kernels/NonMaxSuppressionV3"); -var NonMaxSuppressionV4_1 = require("./kernels/NonMaxSuppressionV4"); -var NonMaxSuppressionV5_1 = require("./kernels/NonMaxSuppressionV5"); -var NotEqual_1 = require("./kernels/NotEqual"); -var OneHot_1 = require("./kernels/OneHot"); -var OnesLike_1 = require("./kernels/OnesLike"); -var Pack_1 = require("./kernels/Pack"); -var PadV2_1 = require("./kernels/PadV2"); -var Pow_1 = require("./kernels/Pow"); -var Prelu_1 = require("./kernels/Prelu"); -var Prod_1 = require("./kernels/Prod"); -var Range_1 = require("./kernels/Range"); -var Real_1 = require("./kernels/Real"); -var RealDiv_1 = require("./kernels/RealDiv"); -var Reciprocal_1 = require("./kernels/Reciprocal"); -var Relu_1 = require("./kernels/Relu"); -var Relu6_1 = require("./kernels/Relu6"); -var Reshape_1 = require("./kernels/Reshape"); -var ResizeBilinear_1 = require("./kernels/ResizeBilinear"); -var ResizeBilinearGrad_1 = require("./kernels/ResizeBilinearGrad"); -var ResizeNearestNeighbor_1 = require("./kernels/ResizeNearestNeighbor"); -var ResizeNearestNeighborGrad_1 = require("./kernels/ResizeNearestNeighborGrad"); -var Reverse_1 = require("./kernels/Reverse"); -var Round_1 = require("./kernels/Round"); -var Rsqrt_1 = require("./kernels/Rsqrt"); -var ScatterNd_1 = require("./kernels/ScatterNd"); -var Select_1 = require("./kernels/Select"); -var Selu_1 = require("./kernels/Selu"); -var Sigmoid_1 = require("./kernels/Sigmoid"); -var Sign_1 = require("./kernels/Sign"); -var Sin_1 = require("./kernels/Sin"); -var Sinh_1 = require("./kernels/Sinh"); -var Slice_1 = require("./kernels/Slice"); -var Softmax_1 = require("./kernels/Softmax"); -var Softplus_1 = require("./kernels/Softplus"); -var SpaceToBatchND_1 = require("./kernels/SpaceToBatchND"); -var SparseToDense_1 = require("./kernels/SparseToDense"); -var SplitV_1 = require("./kernels/SplitV"); -var Sqrt_1 = require("./kernels/Sqrt"); -var Square_1 = require("./kernels/Square"); -var SquaredDifference_1 = require("./kernels/SquaredDifference"); -var Step_1 = require("./kernels/Step"); -var StridedSlice_1 = require("./kernels/StridedSlice"); -var Sub_1 = require("./kernels/Sub"); -var Sum_1 = require("./kernels/Sum"); -var Tan_1 = require("./kernels/Tan"); -var Tanh_1 = require("./kernels/Tanh"); -var Tile_1 = require("./kernels/Tile"); -var TopK_1 = require("./kernels/TopK"); -var Transpose_1 = require("./kernels/Transpose"); -var Unpack_1 = require("./kernels/Unpack"); -var UnsortedSegmentSum_1 = require("./kernels/UnsortedSegmentSum"); -var ZerosLike_1 = require("./kernels/ZerosLike"); -// List all kernel configs here -var kernelConfigs = [ - FFT_1.FFTConfig, - IFFT_1.IFFTConfig, - LRN_1.LRNConfig, - LRNGrad_1.LRNGradConfig, - _FusedMatMul_1._fusedMatMulConfig, - Abs_1.absConfig, - Acos_1.acosConfig, - Acosh_1.acoshConfig, - Add_1.addConfig, - AddN_1.addNConfig, - All_1.allConfig, - Any_1.anyConfig, - ArgMax_1.argMaxConfig, - ArgMin_1.argMinConfig, - Asin_1.asinConfig, - Asinh_1.asinhConfig, - Atan2_1.atan2Config, - Atan_1.atanConfig, - Atanh_1.atanhConfig, - AvgPool3D_1.avgPool3DConfig, - AvgPool3DGrad_1.avgPool3DGradConfig, - AvgPool_1.avgPoolConfig, - AvgPoolGrad_1.avgPoolGradConfig, - BatchMatMul_1.batchMatMulConfig, - BatchToSpaceND_1.batchToSpaceNDConfig, - Cast_1.castConfig, - Ceil_1.ceilConfig, - ClipByValue_1.clipByValueConfig, - ComplexAbs_1.complexAbsConfig, - Complex_1.complexConfig, - Concat_1.concatConfig, - Conv2DBackpropFilter_1.conv2DBackpropFilterConfig, - Conv2DBackpropInput_1.conv2DBackpropInputConfig, - Conv2D_1.conv2DConfig, - Conv3DBackpropFilterV2_1.conv3DBackpropFilterV2Config, - Conv3DBackpropInputV2_1.conv3DBackpropInputV2Config, - Conv3D_1.conv3DConfig, - Cos_1.cosConfig, - Cosh_1.coshConfig, - CropAndResize_1.cropAndResizeConfig, - Cumsum_1.cumsumConfig, - Bincount_1.bincountConfig, - DepthToSpace_1.depthToSpaceConfig, - DepthwiseConv2dNativeBackpropFilter_1.depthwiseConv2dNativeBackpropFilterConfig, - DepthwiseConv2dNativeBackpropInput_1.depthwiseConv2dNativeBackpropInputConfig, - DepthwiseConv2dNative_1.depthwiseConv2dNativeConfig, - Diag_1.diagConfig, - Dilation2DBackpropFilter_1.dilation2dBackpropFilterConfig, - Dilation2DBackpropInput_1.dilation2dBackpropInputConfig, - Dilation2D_1.dilation2dConfig, - Elu_1.eluConfig, - EluGrad_1.eluGradConfig, - Equal_1.equalConfig, - Erf_1.erfConfig, - Exp_1.expConfig, - ExpandDims_1.expandDimsConfig, - Expm1_1.expm1Config, - Fill_1.fillConfig, - Floor_1.floorConfig, - FloorDiv_1.floorDivConfig, - FusedBatchNorm_1.fusedBatchNormConfig, - FusedConv2D_1.fusedConv2DConfig, - FusedDepthwiseConv2D_1.fusedDepthwiseConv2DConfig, - GatherNd_1.gatherNdConfig, - GatherV2_1.gatherV2Config, - Greater_1.greaterConfig, - GreaterEqual_1.greaterEqualConfig, - Identity_1.identityConfig, - Imag_1.imagConfig, - IsFinite_1.isFiniteConfig, - IsInf_1.isInfConfig, - IsNan_1.isNanConfig, - LeakyRelu_1.leakyReluConfig, - Less_1.lessConfig, - LessEqual_1.lessEqualConfig, - LinSpace_1.linSpaceConfig, - Log1p_1.log1pConfig, - Log_1.logConfig, - LogicalAnd_1.logicalAndConfig, - LogicalNot_1.logicalNotConfig, - LogicalOr_1.logicalOrConfig, - Max_1.maxConfig, - MaxPool3D_1.maxPool3DConfig, - MaxPool3DGrad_1.maxPool3DGradConfig, - MaxPool_1.maxPoolConfig, - MaxPoolGrad_1.maxPoolGradConfig, - Maximum_1.maximumConfig, - Mean_1.meanConfig, - Min_1.minConfig, - Minimum_1.minimumConfig, - MirrorPad_1.mirrorPadConfig, - Mod_1.modConfig, - Multinomial_1.multinomialConfig, - Multiply_1.multiplyConfig, - Neg_1.negConfig, - NonMaxSuppressionV3_1.nonMaxSuppressionV3Config, - NonMaxSuppressionV4_1.nonMaxSuppressionV4Config, - NonMaxSuppressionV5_1.nonMaxSuppressionV5Config, - NotEqual_1.notEqualConfig, - OneHot_1.oneHotConfig, - OnesLike_1.onesLikeConfig, - Pack_1.packConfig, - PadV2_1.padV2Config, - Pow_1.powConfig, - Prelu_1.preluConfig, - Prod_1.prodConfig, - Range_1.rangeConfig, - Real_1.realConfig, - RealDiv_1.realDivConfig, - Reciprocal_1.reciprocalConfig, - Relu6_1.relu6Config, - Relu_1.reluConfig, - Reshape_1.reshapeConfig, - ResizeBilinear_1.resizeBilinearConfig, - ResizeBilinearGrad_1.resizeBilinearGradConfig, - ResizeNearestNeighbor_1.resizeNearestNeighborConfig, - ResizeNearestNeighborGrad_1.resizeNearestNeighborGradConfig, - Reverse_1.reverseConfig, - Round_1.roundConfig, - Rsqrt_1.rsqrtConfig, - ScatterNd_1.scatterNdConfig, - Select_1.selectConfig, - Selu_1.seluConfig, - Sigmoid_1.sigmoidConfig, - Sign_1.signConfig, - Sin_1.sinConfig, - Sinh_1.sinhConfig, - Slice_1.sliceConfig, - Softmax_1.softmaxConfig, - Softplus_1.softplusConfig, - SpaceToBatchND_1.spaceToBatchNDConfig, - SparseToDense_1.sparseToDenseConfig, - SplitV_1.splitVConfig, - Sqrt_1.sqrtConfig, - Square_1.squareConfig, - SquaredDifference_1.squaredDifferenceConfig, - Step_1.stepConfig, - StridedSlice_1.stridedSliceConfig, - Sub_1.subConfig, - Sum_1.sumConfig, - Tan_1.tanConfig, - Tanh_1.tanhConfig, - Tile_1.tileConfig, - TopK_1.topKConfig, - Transpose_1.transposeConfig, - Unpack_1.unpackConfig, - UnsortedSegmentSum_1.unsortedSegmentSumConfig, - ZerosLike_1.zerosLikeConfig -]; -for (var _i = 0, kernelConfigs_1 = kernelConfigs; _i < kernelConfigs_1.length; _i++) { - var kernelConfig = kernelConfigs_1[_i]; - tfjs_1.registerKernel(kernelConfig); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts deleted file mode 100644 index 7bcbd5871..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts +++ /dev/null @@ -1,20 +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 './index'; -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -import '@tensorflow/tfjs-core/dist/tests'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js deleted file mode 100644 index 3442d80b5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js +++ /dev/null @@ -1,138 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -// We import index.ts so that the Node backend gets registered. -require("./index"); -// tslint:disable-next-line: no-imports-from-dist -require("@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops"); -// tslint:disable-next-line: no-imports-from-dist -require("@tensorflow/tfjs-core/dist/register_all_gradients"); -var tf = require("@tensorflow/tfjs"); -// tslint:disable-next-line:no-imports-from-dist -var jasmine_util = require("@tensorflow/tfjs-core/dist/jasmine_util"); -var yargs_1 = require("yargs"); -Error.stackTraceLimit = Infinity; -// tslint:disable-next-line:no-require-imports -var jasmineCtor = require('jasmine'); -// tslint:disable-next-line:no-require-imports -process.on('unhandledRejection', function (e) { - throw e; -}); -jasmine_util.setTestEnvs([{ - name: 'test-tensorflow', - backendName: 'tensorflow', - flags: {}, - isDataSync: true - }]); -var IGNORE_LIST = [ - // Always ignore version tests: - 'version version', - 'unreliable is true due to both auto gc and string tensors', - 'unreliable is true due to auto gc', - // See https://github.com/tensorflow/tfjs/issues/161 - 'depthwiseConv2D', - 'separableConv2d', - 'complex64 memory', - // See https://github.com/tensorflow/tfjs-core/pull/1270 - 'depthToSpace test-tensorflow {} throws when blocksize < 2', - // tslint:disable-next-line:max-line-length - 'depthToSpace test-tensorflow {} throws when CPU backend used with data format NCHW', - // See https://github.com/tensorflow/tfjs/issues/806 - 'scatterND test-tensorflow {} should work for 2d', - 'scatterND test-tensorflow {} should work for simple 1d', - 'scatterND test-tensorflow {} should work for multiple 1d', - 'scatterND test-tensorflow {} should sum the duplicated indices', - 'scatterND test-tensorflow {} should work for tensorLike input', - // https://github.com/tensorflow/tfjs/issues/1077 - 'maxPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', - 'avgPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', - // tslint:disable-next-line:max-line-length - 'avgPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', - // tslint:disable-next-line:max-line-length - 'maxPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', - // libtensorflow doesn't support 6D ArgMax yet. - 'argmax test-tensorflow {} 6D, axis=0', 'diag test-tensorflow {} complex', - 'diag test-tensorflow {} bool', - // See https://github.com/tensorflow/tfjs/issues/1891 - 'conv2d test-tensorflow {} x=[2,1,2,2] f=[1,1,1,1] s=1 d=1 p=0 NCHW', - 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=explicit NCHW', - 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} x=[2,2,2] f=[2,2,2,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} x=[2,1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} gradient x=[1,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', - 'conv2d test-tensorflow {} gradient x=[2,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', - 'maxPoolWithArgmax', 'rotate', 'flipLeftRight', 'unique', - // libtensorflow does not yet support tf.matmul with broadcast - 'broadcast with unequal batch dims', 'broadcast with unequal ranks', - // tslint:disable-next-line:max-line-length - 'pool test-tensorflow {} max x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', - // tslint:disable-next-line:max-line-length - 'pool test-tensorflow {} avg x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', - // not available in tf yet. - 'denseBincount', - // only available in tf addon. - 'image.transform', - // Breaking change in NaN processing - // See https://github.com/tensorflow/tfjs/issues/4883 - 'max test-tensorflow {} ignores NaNs', 'min test-tensorflow {} ignores NaNs', - 'sign test-tensorflow {} basic', - 'sign test-tensorflow {} does not propagate NaNs', - 'sign test-tensorflow {} accepts a tensor-like object', - // Node kernel for einsum is yet to be implemented. - // See: ttps://github.com/tensorflow/tfjs/issues/2349 - 'einsum', 'sparseFillEmptyRows', 'sparseReshape' -]; -if (process.platform === 'win32') { - // Ignore tensorboard on windows because tmp folder cleanup used in tests - // fails with tmp folder cleanup: - // https://github.com/tensorflow/tfjs/issues/1692 - IGNORE_LIST.push('tensorboard'); - IGNORE_LIST.push('tensorBoard'); - // Windows has two failing tests: - // https://github.com/tensorflow/tfjs/issues/598 - IGNORE_LIST.push('clip test-tensorflow {} propagates NaNs'); - IGNORE_LIST.push('maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs'); -} -var runner = new jasmineCtor(); -runner.loadConfig({ spec_files: ['src/**/*_test.ts'], random: false }); -// Also import tests from core. -// tslint:disable-next-line: no-imports-from-dist -require("@tensorflow/tfjs-core/dist/tests"); -if (process.env.JASMINE_SEED) { - runner.seed(process.env.JASMINE_SEED); -} -var env = jasmine.getEnv(); -var grepRegex = new RegExp(yargs_1.argv.grep); -// Filter method that returns boolean, if a given test should return. -env.specFilter = function (spec) { - // Filter based on the grep flag. - if (!grepRegex.test(spec.getFullName())) { - return false; - } - // Return false (skip the test) if the test is in the ignore list. - for (var i = 0; i < IGNORE_LIST.length; ++i) { - if (spec.getFullName().indexOf(IGNORE_LIST[i]) > -1) { - return false; - } - } - // Otherwise run the test. - return true; -}; -// TODO(kreeger): Consider moving to C-code. -console.log("Running tests against TensorFlow: " + tf.backend().binding.TF_Version); -runner.execute(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts deleted file mode 100644 index 0a9c6d973..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts +++ /dev/null @@ -1,158 +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 { InferenceModel, MetaGraph, ModelPredictConfig, ModelTensorInfo, NamedTensorMap, SignatureDefEntry, Tensor } from '@tensorflow/tfjs'; -import { NodeJSKernelBackend } from './nodejs_kernel_backend'; -/** - * Get a key in an object by its value. This is used to get protobuf enum value - * from index. - * - * @param object - * @param value - */ -export declare function getEnumKeyFromValue(object: any, value: number): string; -/** - * Read SavedModel proto message from path. - * - * @param path Path to SavedModel folder. - */ -export declare function readSavedModelProto(path: string): Promise; -/** - * Inspect the MetaGraphs of the SavedModel from the provided path. This - * function will return an array of `MetaGraphInfo` objects. - * - * @param path Path to SavedModel folder. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export declare function getMetaGraphsFromSavedModel(path: string): Promise; -/** - * Get SignatureDefEntry from SavedModel metagraphs info. The SignatureDefEntry - * will be used when executing a SavedModel signature. - * - * @param savedModelInfo The MetaGraphInfo array loaded through - * getMetaGraphsFromSavedModel(). - * @param tags The tags of the MetaGraph to get input/output node names from. - * @param signature The signature to get input/output node names from. - */ -export declare function getSignatureDefEntryFromMetaGraphInfo(savedModelInfo: MetaGraph[], tags: string[], signature: string): SignatureDefEntry; -/** - * A `tf.TFSavedModel` is a signature loaded from a SavedModel - * metagraph, and allows inference execution. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export declare class TFSavedModel implements InferenceModel { - private sessionId; - private jsid; - private signature; - private backend; - private disposed; - private outputNodeNames_; - constructor(sessionId: number, jsid: number, signature: SignatureDefEntry, backend: NodeJSKernelBackend); - /** - * Return the array of input tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - readonly inputs: ModelTensorInfo[]; - /** - * Return the array of output tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - readonly outputs: ModelTensorInfo[]; - /** - * Delete the SavedModel from nodeBackend and delete corresponding session in - * the C++ backend if the session is only used by this TFSavedModel. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - dispose(): void; - readonly outputNodeNames: { - [key: string]: string; - }; - /** - * Execute the inference for the input tensors. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. The keys in the NamedTensorMap are the - * name of input tensors in SavedModel signatureDef. It can be found through - * `tf.node.getMetaGraphsFromSavedModel()`. - * - * For batch inference execution, the tensors for each input need to be - * concatenated together. For example with mobilenet, the required input shape - * is [1, 244, 244, 3], which represents the [batch, height, width, channel]. - * If we are provide a batched data of 100 images, the input tensor should be - * in the shape of [100, 244, 244, 3]. - * - * @param config Prediction configuration for specifying the batch size. - * - * @returns Inference result tensors. The output would be single Tensor if - * model has single output node, otherwise Tensor[] or NamedTensorMap[] will - * be returned for model with multiple outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - predict(inputs: Tensor | Tensor[] | NamedTensorMap, config?: ModelPredictConfig): Tensor | Tensor[] | NamedTensorMap; - /** - * Execute the inference for the input tensors and return activation - * values for specified output node names without batching. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. - * - * @param outputs string|string[]. List of output node names to retrieve - * activation from. - * - * @returns Activation values for the output nodes result tensors. The return - * type matches specified parameter outputs type. The output would be single - * Tensor if single output is specified, otherwise Tensor[] for multiple - * outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - execute(inputs: Tensor | Tensor[] | NamedTensorMap, outputs: string | string[]): Tensor | Tensor[]; -} -/** - * Load a TensorFlow SavedModel from disk. TensorFlow SavedModel is different - * from TensorFlow.js model format. A SavedModel is a directory containing - * serialized signatures and the states needed to run them. The directory has a - * saved_model.pb (or saved_model.pbtxt) file storing the actual TensorFlow - * program, or model, and a set of named signatures, each identifying a - * function. The directory also has a variables directory contains a standard - * training checkpoint. The directory may also has a assets directory contains - * files used by the TensorFlow graph, for example text files used to initialize - * vocabulary tables. These are supported datatypes: float32, int32, complex64, - * string.For more information, see this guide: - * https://www.tensorflow.org/guide/saved_model. - * - * @param path The path to the SavedModel. - * @param tags The tags of the MetaGraph to load. The available tags of a - * SavedModel can be retrieved through tf.node.getMetaGraphsFromSavedModel() - * API. Defaults to ['serve']. - * @param signature The name of the SignatureDef to load. The available - * SignatureDefs of a SavedModel can be retrieved through - * tf.node.getMetaGraphsFromSavedModel() API. Defaults to 'serving_default'. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export declare function loadSavedModel(path: string, tags?: string[], signature?: string): Promise; -export declare function getNumOfSavedModels(): number; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js deleted file mode 100644 index 19ed851ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js +++ /dev/null @@ -1,493 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var fs = require("fs"); -var util_1 = require("util"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -var readFile = util_1.promisify(fs.readFile); -// tslint:disable-next-line:no-require-imports -var messages = require('./proto/api_pb'); -var SAVED_MODEL_FILE_NAME = '/saved_model.pb'; -var SAVED_MODEL_INIT_OP_KEY = '__saved_model_init_op'; -// This map is used to keep track of loaded SavedModel metagraph mapping -// information. The map key is TFSavedModel id in JavaScript, value is -// an object of path to the SavedModel, metagraph tags, and loaded Session ID in -// the c++ bindings. When user loads a SavedModel signature, it will go through -// entries in this map to find if the corresponding SavedModel session has -// already been loaded in C++ addon and will reuse it if existing. -var loadedSavedModelPathMap = new Map(); -// The ID of loaded TFSavedModel. This ID is used to keep track of loaded -// TFSavedModel, so the loaded session in c++ bindings for the corresponding -// TFSavedModel can be properly reused/disposed. -var nextTFSavedModelId = 0; -/** - * Get a key in an object by its value. This is used to get protobuf enum value - * from index. - * - * @param object - * @param value - */ -// tslint:disable-next-line:no-any -function getEnumKeyFromValue(object, value) { - return Object.keys(object).find(function (key) { return object[key] === value; }); -} -exports.getEnumKeyFromValue = getEnumKeyFromValue; -/** - * Read SavedModel proto message from path. - * - * @param path Path to SavedModel folder. - */ -function readSavedModelProto(path) { - return __awaiter(this, void 0, void 0, function () { - var modelFile, array; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // Load the SavedModel pb file and deserialize it into message. - try { - fs.accessSync(path + SAVED_MODEL_FILE_NAME, fs.constants.R_OK); - } - catch (error) { - throw new Error('There is no saved_model.pb file in the directory: ' + path); - } - return [4 /*yield*/, readFile(path + SAVED_MODEL_FILE_NAME)]; - case 1: - modelFile = _a.sent(); - array = new Uint8Array(modelFile); - return [2 /*return*/, messages.SavedModel.deserializeBinary(array)]; - } - }); - }); -} -exports.readSavedModelProto = readSavedModelProto; -/** - * Inspect the MetaGraphs of the SavedModel from the provided path. This - * function will return an array of `MetaGraphInfo` objects. - * - * @param path Path to SavedModel folder. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -function getMetaGraphsFromSavedModel(path) { - return __awaiter(this, void 0, void 0, function () { - var result, modelMessage, metaGraphList, i, metaGraph, tags, signatureDef, signatureDefMap, signatureDefKeys, key, signatureDefEntry, inputsMapMessage, inputsMapKeys, inputs, inputsMapKey, inputTensor, inputTensorInfo, dtype, outputsMapMessage, outputsMapKeys, outputs, outputsMapKey, outputTensor, outputTensorInfo, dtype; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - result = []; - return [4 /*yield*/, readSavedModelProto(path)]; - case 1: - modelMessage = _a.sent(); - metaGraphList = modelMessage.getMetaGraphsList(); - for (i = 0; i < metaGraphList.length; i++) { - metaGraph = {}; - tags = metaGraphList[i].getMetaInfoDef().getTagsList(); - metaGraph.tags = tags; - signatureDef = {}; - signatureDefMap = metaGraphList[i].getSignatureDefMap(); - signatureDefKeys = signatureDefMap.keys(); - // Go through all signatureDefs - while (true) { - key = signatureDefKeys.next(); - if (key.done) { - break; - } - // Skip TensorFlow internal Signature '__saved_model_init_op'. - if (key.value === SAVED_MODEL_INIT_OP_KEY) { - continue; - } - signatureDefEntry = signatureDefMap.get(key.value); - inputsMapMessage = signatureDefEntry.getInputsMap(); - inputsMapKeys = inputsMapMessage.keys(); - inputs = {}; - while (true) { - inputsMapKey = inputsMapKeys.next(); - if (inputsMapKey.done) { - break; - } - inputTensor = inputsMapMessage.get(inputsMapKey.value); - inputTensorInfo = {}; - dtype = getEnumKeyFromValue(messages.DataType, inputTensor.getDtype()); - inputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); - inputTensorInfo.tfDtype = dtype; - inputTensorInfo.name = inputTensor.getName(); - inputTensorInfo.shape = inputTensor.getTensorShape().getDimList(); - inputs[inputsMapKey.value] = inputTensorInfo; - } - outputsMapMessage = signatureDefEntry.getOutputsMap(); - outputsMapKeys = outputsMapMessage.keys(); - outputs = {}; - while (true) { - outputsMapKey = outputsMapKeys.next(); - if (outputsMapKey.done) { - break; - } - outputTensor = outputsMapMessage.get(outputsMapKey.value); - outputTensorInfo = {}; - dtype = getEnumKeyFromValue(messages.DataType, outputTensor.getDtype()); - outputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); - outputTensorInfo.tfDtype = dtype; - outputTensorInfo.name = outputTensor.getName(); - outputTensorInfo.shape = outputTensor.getTensorShape().getDimList(); - outputs[outputsMapKey.value] = outputTensorInfo; - } - signatureDef[key.value] = { inputs: inputs, outputs: outputs }; - } - metaGraph.signatureDefs = signatureDef; - result.push(metaGraph); - } - return [2 /*return*/, result]; - } - }); - }); -} -exports.getMetaGraphsFromSavedModel = getMetaGraphsFromSavedModel; -/** - * Get SignatureDefEntry from SavedModel metagraphs info. The SignatureDefEntry - * will be used when executing a SavedModel signature. - * - * @param savedModelInfo The MetaGraphInfo array loaded through - * getMetaGraphsFromSavedModel(). - * @param tags The tags of the MetaGraph to get input/output node names from. - * @param signature The signature to get input/output node names from. - */ -function getSignatureDefEntryFromMetaGraphInfo(savedModelInfo, tags, signature) { - for (var i = 0; i < savedModelInfo.length; i++) { - var metaGraphInfo = savedModelInfo[i]; - if (stringArraysHaveSameElements(tags, metaGraphInfo.tags)) { - if (metaGraphInfo.signatureDefs[signature] == null) { - throw new Error('The SavedModel does not have signature: ' + signature); - } - return metaGraphInfo.signatureDefs[signature]; - } - } - throw new Error("The SavedModel does not have tags: " + tags); -} -exports.getSignatureDefEntryFromMetaGraphInfo = getSignatureDefEntryFromMetaGraphInfo; -/** - * A `tf.TFSavedModel` is a signature loaded from a SavedModel - * metagraph, and allows inference execution. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -var TFSavedModel = /** @class */ (function () { - function TFSavedModel(sessionId, jsid, signature, backend) { - this.sessionId = sessionId; - this.jsid = jsid; - this.signature = signature; - this.backend = backend; - this.disposed = false; - } - Object.defineProperty(TFSavedModel.prototype, "inputs", { - /** - * Return the array of input tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - get: function () { - var entries = this.signature.inputs; - var results = Object.keys(entries).map(function (key) { return entries[key]; }); - results.forEach(function (info) { - info.name = info.name.replace(/:0$/, ''); - }); - return results; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TFSavedModel.prototype, "outputs", { - /** - * Return the array of output tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - get: function () { - var entries = this.signature.outputs; - var results = Object.keys(entries).map(function (key) { return entries[key]; }); - results.forEach(function (info) { - info.name = info.name.replace(/:0$/, ''); - }); - return results; - }, - enumerable: true, - configurable: true - }); - /** - * Delete the SavedModel from nodeBackend and delete corresponding session in - * the C++ backend if the session is only used by this TFSavedModel. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - TFSavedModel.prototype.dispose = function () { - if (!this.disposed) { - this.disposed = true; - loadedSavedModelPathMap.delete(this.jsid); - for (var _i = 0, _a = Array.from(loadedSavedModelPathMap.keys()); _i < _a.length; _i++) { - var id = _a[_i]; - var value = loadedSavedModelPathMap.get(id); - if (value.sessionId === this.sessionId) { - return; - } - } - this.backend.deleteSavedModel(this.sessionId); - } - else { - throw new Error('This SavedModel has already been deleted.'); - } - }; - Object.defineProperty(TFSavedModel.prototype, "outputNodeNames", { - get: function () { - var _this = this; - if (this.outputNodeNames_ != null) { - return this.outputNodeNames_; - } - this.outputNodeNames_ = - Object.keys(this.signature.outputs) - .reduce(function (names, key) { - names[key] = _this.signature.outputs[key].name; - return names; - }, {}); - return this.outputNodeNames_; - }, - enumerable: true, - configurable: true - }); - /** - * Execute the inference for the input tensors. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. The keys in the NamedTensorMap are the - * name of input tensors in SavedModel signatureDef. It can be found through - * `tf.node.getMetaGraphsFromSavedModel()`. - * - * For batch inference execution, the tensors for each input need to be - * concatenated together. For example with mobilenet, the required input shape - * is [1, 244, 244, 3], which represents the [batch, height, width, channel]. - * If we are provide a batched data of 100 images, the input tensor should be - * in the shape of [100, 244, 244, 3]. - * - * @param config Prediction configuration for specifying the batch size. - * - * @returns Inference result tensors. The output would be single Tensor if - * model has single output node, otherwise Tensor[] or NamedTensorMap[] will - * be returned for model with multiple outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - TFSavedModel.prototype.predict = function (inputs, config) { - var _this = this; - if (this.disposed) { - throw new Error('The TFSavedModel has already been deleted!'); - } - else { - var inputTensors = []; - if (inputs instanceof tfjs_1.Tensor) { - inputTensors.push(inputs); - var result = this.backend.runSavedModel(this.sessionId, inputTensors, Object.values(this.signature.inputs), Object.values(this.outputNodeNames)); - return result.length > 1 ? result : result[0]; - } - else if (Array.isArray(inputs)) { - inputTensors = inputs; - return this.backend.runSavedModel(this.sessionId, inputTensors, Object.values(this.signature.inputs), Object.values(this.outputNodeNames)); - } - else { - var inputTensorNames = Object.keys(this.signature.inputs); - var providedInputNames = Object.keys(inputs); - if (!stringArraysHaveSameElements(inputTensorNames, providedInputNames)) { - throw new Error("The model signatureDef input names are " + inputTensorNames.join() + ", however the provided input names are " + providedInputNames.join() + "."); - } - var inputNodeNamesArray = []; - for (var i = 0; i < inputTensorNames.length; i++) { - inputTensors.push(inputs[inputTensorNames[i]]); - inputNodeNamesArray.push(this.signature.inputs[inputTensorNames[i]]); - } - var outputTensorNames = Object.keys(this.outputNodeNames); - var outputNodeNamesArray = []; - for (var i = 0; i < outputTensorNames.length; i++) { - outputNodeNamesArray.push(this.outputNodeNames[outputTensorNames[i]]); - } - var outputTensors_1 = this.backend.runSavedModel(this.sessionId, inputTensors, inputNodeNamesArray, outputNodeNamesArray); - tfjs_1.util.assert(outputTensors_1.length === outputNodeNamesArray.length, function () { return 'Output tensors do not match output node names, ' + - ("receive " + outputTensors_1.length + ") output tensors but ") + - ("there are " + _this.outputNodeNames.length + " output nodes."); }); - var outputMap = {}; - for (var i = 0; i < outputTensorNames.length; i++) { - outputMap[outputTensorNames[i]] = outputTensors_1[i]; - } - return outputMap; - } - } - }; - /** - * Execute the inference for the input tensors and return activation - * values for specified output node names without batching. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. - * - * @param outputs string|string[]. List of output node names to retrieve - * activation from. - * - * @returns Activation values for the output nodes result tensors. The return - * type matches specified parameter outputs type. The output would be single - * Tensor if single output is specified, otherwise Tensor[] for multiple - * outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - TFSavedModel.prototype.execute = function (inputs, outputs) { - throw new Error('execute() of TFSavedModel is not supported yet.'); - }; - return TFSavedModel; -}()); -exports.TFSavedModel = TFSavedModel; -/** - * Load a TensorFlow SavedModel from disk. TensorFlow SavedModel is different - * from TensorFlow.js model format. A SavedModel is a directory containing - * serialized signatures and the states needed to run them. The directory has a - * saved_model.pb (or saved_model.pbtxt) file storing the actual TensorFlow - * program, or model, and a set of named signatures, each identifying a - * function. The directory also has a variables directory contains a standard - * training checkpoint. The directory may also has a assets directory contains - * files used by the TensorFlow graph, for example text files used to initialize - * vocabulary tables. These are supported datatypes: float32, int32, complex64, - * string.For more information, see this guide: - * https://www.tensorflow.org/guide/saved_model. - * - * @param path The path to the SavedModel. - * @param tags The tags of the MetaGraph to load. The available tags of a - * SavedModel can be retrieved through tf.node.getMetaGraphsFromSavedModel() - * API. Defaults to ['serve']. - * @param signature The name of the SignatureDef to load. The available - * SignatureDefs of a SavedModel can be retrieved through - * tf.node.getMetaGraphsFromSavedModel() API. Defaults to 'serving_default'. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -function loadSavedModel(path, tags, signature) { - if (tags === void 0) { tags = ['serve']; } - if (signature === void 0) { signature = 'serving_default'; } - return __awaiter(this, void 0, void 0, function () { - var backend, savedModelInfo, signatureDefEntry, sessionId, _i, _a, id_1, modelInfo, tagsString, id, savedModel; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - nodejs_kernel_backend_1.ensureTensorflowBackend(); - backend = nodejs_kernel_backend_1.nodeBackend(); - return [4 /*yield*/, getMetaGraphsFromSavedModel(path)]; - case 1: - savedModelInfo = _b.sent(); - signatureDefEntry = getSignatureDefEntryFromMetaGraphInfo(savedModelInfo, tags, signature); - for (_i = 0, _a = Array.from(loadedSavedModelPathMap.keys()); _i < _a.length; _i++) { - id_1 = _a[_i]; - modelInfo = loadedSavedModelPathMap.get(id_1); - if (modelInfo.path === path && - stringArraysHaveSameElements(modelInfo.tags, tags)) { - sessionId = modelInfo.sessionId; - } - } - if (sessionId == null) { - tagsString = tags.join(','); - sessionId = backend.loadSavedModelMetaGraph(path, tagsString); - } - id = nextTFSavedModelId++; - savedModel = new TFSavedModel(sessionId, id, signatureDefEntry, backend); - loadedSavedModelPathMap.set(id, { path: path, tags: tags, sessionId: sessionId }); - return [2 /*return*/, savedModel]; - } - }); - }); -} -exports.loadSavedModel = loadSavedModel; -/** - * Compare if two unsorted arrays of string have the same elements. - * @param arrayA - * @param arrayB - */ -function stringArraysHaveSameElements(arrayA, arrayB) { - if (arrayA.length === arrayB.length && - arrayA.sort().join() === arrayB.sort().join()) { - return true; - } - return false; -} -function mapTFDtypeToJSDtype(tfDtype) { - switch (tfDtype) { - case 'DT_FLOAT': - return 'float32'; - case 'DT_INT64': - case 'DT_INT32': - case 'DT_UINT8': - return 'int32'; - case 'DT_BOOL': - return 'bool'; - case 'DT_COMPLEX64': - return 'complex64'; - case 'DT_STRING': - return 'string'; - default: - throw new Error('Unsupported tensor DataType: ' + tfDtype + - ', try to modify the model in python to convert the datatype'); - } -} -function getNumOfSavedModels() { - nodejs_kernel_backend_1.ensureTensorflowBackend(); - var backend = nodejs_kernel_backend_1.nodeBackend(); - return backend.getNumOfSavedModels(); -} -exports.getNumOfSavedModels = getNumOfSavedModels; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts deleted file mode 100644 index 1c3c75a12..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts +++ /dev/null @@ -1,17 +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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js deleted file mode 100644 index 59abe285f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js +++ /dev/null @@ -1,700 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var tf = require("./index"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -var saved_model_1 = require("./saved_model"); -// tslint:disable-next-line:no-require-imports -var messages = require('./proto/api_pb'); -describe('SavedModel', function () { - it('deserialize SavedModel pb file', function () { return __awaiter(_this, void 0, void 0, function () { - var modelMessage, signatureDefMapMessage, inputsMapMessage, inputsMapKeys, inputsMapKey1, inputTensorMessage, outputsMapMessage, outputsMapKeys, outputsMapKey1, outputTensorMessage; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, saved_model_1.readSavedModelProto('./test_objects/saved_model/times_three_float')]; - case 1: - modelMessage = _a.sent(); - // This SavedModel has one MetaGraph with tag serve - expect(modelMessage.getMetaGraphsList().length).toBe(1); - expect(modelMessage.getMetaGraphsList()[0] - .getMetaInfoDef() - .getTagsList() - .length) - .toBe(1); - expect(modelMessage.getMetaGraphsList()[0].getMetaInfoDef().getTagsList()[0]) - .toBe('serve'); - signatureDefMapMessage = modelMessage.getMetaGraphsList()[0].getSignatureDefMap(); - expect(signatureDefMapMessage.has('serving_default')); - inputsMapMessage = signatureDefMapMessage.get('serving_default').getInputsMap(); - expect(inputsMapMessage.getLength()).toBe(1); - inputsMapKeys = inputsMapMessage.keys(); - inputsMapKey1 = inputsMapKeys.next(); - expect(inputsMapKey1.done).toBe(false); - expect(inputsMapKey1.value).toBe('x'); - inputTensorMessage = inputsMapMessage.get(inputsMapKey1.value); - expect(inputTensorMessage.getName()).toBe('serving_default_x:0'); - expect(saved_model_1.getEnumKeyFromValue(messages.DataType, inputTensorMessage.getDtype())) - .toBe('DT_FLOAT'); - outputsMapMessage = signatureDefMapMessage.get('serving_default').getOutputsMap(); - expect(outputsMapMessage.getLength()).toBe(1); - outputsMapKeys = outputsMapMessage.keys(); - outputsMapKey1 = outputsMapKeys.next(); - expect(outputsMapKey1.done).toBe(false); - expect(outputsMapKey1.value).toBe('output_0'); - outputTensorMessage = outputsMapMessage.get(outputsMapKey1.value); - expect(outputTensorMessage.getName()).toBe('StatefulPartitionedCall:0'); - expect(saved_model_1.getEnumKeyFromValue(messages.DataType, outputTensorMessage.getDtype())) - .toBe('DT_FLOAT'); - return [2 /*return*/]; - } - }); - }); }); - it('get enum key based on value', function () { - var DataType = messages.DataType; - var enumKey0 = saved_model_1.getEnumKeyFromValue(DataType, 0); - expect(enumKey0).toBe('DT_INVALID'); - var enumKey1 = saved_model_1.getEnumKeyFromValue(DataType, 1); - expect(enumKey1).toBe('DT_FLOAT'); - var enumKey2 = saved_model_1.getEnumKeyFromValue(DataType, 2); - expect(enumKey2).toBe('DT_DOUBLE'); - }); - it('read non-exist file', function (done) { return __awaiter(_this, void 0, void 0, function () { - var err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, saved_model_1.readSavedModelProto('/not-exist')]; - case 1: - _a.sent(); - done.fail(); - return [3 /*break*/, 3]; - case 2: - err_1 = _a.sent(); - expect(err_1.message) - .toBe("There is no saved_model.pb file in the directory: /not-exist"); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - it('inspect SavedModel metagraphs', function () { return __awaiter(_this, void 0, void 0, function () { - var modelInfo; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.getMetaGraphsFromSavedModel('./test_objects/saved_model/times_three_float')]; - case 1: - modelInfo = _a.sent(); - /** - * The inspection output should be - * [{ - * 'tags': ['serve'], - * 'signatureDefs': { - * '__saved_model_init_op': { - * 'inputs': {}, - * 'outputs': { - * '__saved_model_init_op': { - * 'dtype': 'DT_INVALID', - * 'name': 'NoOp', - * 'shape': [] - * } - * } - * }, - * 'serving_default': { - * 'inputs': { - * 'x': { - * 'dtype': 'DT_FLOAT', - * 'name': 'serving_default_x:0', - * 'shape':[] - * } - * }, - * 'outputs': { - * 'output_0': { - * 'dtype': 'DT_FLOAT', - * 'name': 'StatefulPartitionedCall:0', - * 'shape': [] - * } - * } - * } - * } - * }] - */ - expect(modelInfo.length).toBe(1); - expect(modelInfo[0].tags.length).toBe(1); - expect(modelInfo[0].tags[0]).toBe('serve'); - expect(Object.keys(modelInfo[0].signatureDefs).length).toBe(1); - expect(Object.keys(modelInfo[0].signatureDefs)[0]).toBe('serving_default'); - expect(Object.keys(modelInfo[0].signatureDefs['serving_default'].inputs) - .length) - .toBe(1); - expect(modelInfo[0].signatureDefs['serving_default'].inputs['x'].name) - .toBe('serving_default_x:0'); - expect(modelInfo[0].signatureDefs['serving_default'].inputs['x'].dtype) - .toBe('float32'); - expect(Object.keys(modelInfo[0].signatureDefs['serving_default'].outputs) - .length) - .toBe(1); - expect(modelInfo[0].signatureDefs['serving_default'].outputs['output_0'].name) - .toBe('StatefulPartitionedCall:0'); - expect(modelInfo[0].signatureDefs['serving_default'].outputs['output_0'].dtype) - .toBe('float32'); - return [2 /*return*/]; - } - }); - }); }); - it('get input and output node names from SavedModel metagraphs', function () { return __awaiter(_this, void 0, void 0, function () { - var modelInfo, signature; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.getMetaGraphsFromSavedModel('./test_objects/saved_model/times_three_float')]; - case 1: - modelInfo = _a.sent(); - signature = saved_model_1.getSignatureDefEntryFromMetaGraphInfo(modelInfo, ['serve'], 'serving_default'); - expect(Object.keys(signature).length).toBe(2); - expect(signature.inputs['x'].name).toBe('serving_default_x:0'); - expect(signature.outputs['output_0'].name) - .toBe('StatefulPartitionedCall:0'); - return [2 /*return*/]; - } - }); - }); }); - it('load TFSavedModel', function () { return __awaiter(_this, void 0, void 0, function () { - var loadSavedModelMetaGraphSpy, model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - loadSavedModelMetaGraphSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'loadSavedModelMetaGraph').and.callThrough(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('load TFSavedModel with wrong tags throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { - var error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve', 'gpu'], 'serving_default')]; - case 1: - _a.sent(); - done.fail(); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - expect(error_1.message) - .toBe('The SavedModel does not have tags: serve,gpu'); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - it('load TFSavedModel with wrong signature throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { - var error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'wrong_signature')]; - case 1: - _a.sent(); - done.fail(); - return [3 /*break*/, 3]; - case 2: - error_2 = _a.sent(); - expect(error_2.message) - .toBe('The SavedModel does not have signature: wrong_signature'); - done(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }); - it('load TFSavedModel and delete', function () { return __awaiter(_this, void 0, void 0, function () { - var loadSavedModelMetaGraphSpy, deleteSavedModelSpy, model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - expect(tf.node.getNumOfSavedModels()).toBe(0); - loadSavedModelMetaGraphSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'loadSavedModelMetaGraph').and.callThrough(); - deleteSavedModelSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'deleteSavedModel').and.callThrough(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); - expect(deleteSavedModelSpy).toHaveBeenCalledTimes(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - expect(deleteSavedModelSpy).toHaveBeenCalledTimes(0); - expect(tf.node.getNumOfSavedModels()).toBe(1); - model.dispose(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - expect(deleteSavedModelSpy).toHaveBeenCalledTimes(1); - expect(tf.node.getNumOfSavedModels()).toBe(0); - return [2 /*return*/]; - } - }); - }); }); - it('delete TFSavedModel multiple times throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { - var model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - model.dispose(); - try { - model.dispose(); - done.fail(); - } - catch (error) { - expect(error.message).toBe('This SavedModel has already been deleted.'); - done(); - } - return [2 /*return*/]; - } - }); - }); }); - it('load multiple signatures from the same metagraph only call binding once', function () { return __awaiter(_this, void 0, void 0, function () { - var backend, loadSavedModelMetaGraphSpy, model1, model2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - expect(tf.node.getNumOfSavedModels()).toBe(0); - backend = nodejs_kernel_backend_1.nodeBackend(); - loadSavedModelMetaGraphSpy = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; - case 1: - model1 = _a.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - expect(tf.node.getNumOfSavedModels()).toBe(1); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; - case 2: - model2 = _a.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - expect(tf.node.getNumOfSavedModels()).toBe(1); - model1.dispose(); - expect(tf.node.getNumOfSavedModels()).toBe(1); - model2.dispose(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - expect(tf.node.getNumOfSavedModels()).toBe(0); - return [2 /*return*/]; - } - }); - }); }); - it('load signature after delete call binding', function () { return __awaiter(_this, void 0, void 0, function () { - var backend, spyOnCallBindingLoad, spyOnNodeBackendDelete, model1, model2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - backend = nodejs_kernel_backend_1.nodeBackend(); - spyOnCallBindingLoad = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); - spyOnNodeBackendDelete = spyOn(backend, 'deleteSavedModel').and.callThrough(); - expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(0); - expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; - case 1: - model1 = _a.sent(); - expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(1); - expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(0); - model1.dispose(); - expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(1); - expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(1); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; - case 2: - model2 = _a.sent(); - expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(2); - expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(1); - model2.dispose(); - expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(2); - expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(2); - return [2 /*return*/]; - } - }); - }); }); - it('throw error when input tensors do not match input ops', function (done) { return __awaiter(_this, void 0, void 0, function () { - var model, input1, input2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - input1 = tf.tensor1d([1.0, 2, 3]); - input2 = tf.tensor1d([1.0, 2, 3]); - try { - model.predict([input1, input2]); - done.fail(); - } - catch (error) { - expect(error.message) - .toBe('Length of input op names (1) does not match the ' + - 'length of input tensors (2).'); - model.dispose(); - done(); - } - return [2 /*return*/]; - } - }); - }); }); - it('execute model float times three', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, output, _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _d.sent(); - input = tf.tensor1d([1.0, 2, 3]); - output = model.predict(input); - expect(output.shape).toEqual(input.shape); - expect(output.dtype).toBe(input.dtype); - expect(output.dtype).toBe('float32'); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output.data()]; - case 2: - _c = [_d.sent()]; - return [4 /*yield*/, input.mul(3).data()]; - case 3: - _b.apply(_a, _c.concat([_d.sent()])); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with tensor array as input', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, outputArray, output, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _c.sent(); - input = tf.tensor1d([1.0, 2, 3]); - outputArray = model.predict([input]); - expect(outputArray.length).toBe(1); - output = outputArray[0]; - expect(output.shape).toEqual(input.shape); - expect(output.dtype).toBe(input.dtype); - expect(output.dtype).toBe('float32'); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output.data()]; - case 2: - _b.apply(_a, [_c.sent(), [3.0, 6.0, 9.0]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with tensor map as input', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, outputMap, output, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _c.sent(); - input = tf.tensor1d([1.0, 2, 3]); - outputMap = model.predict({ 'x': input }); - output = outputMap['output_0']; - expect(output.shape).toEqual(input.shape); - expect(output.dtype).toBe(input.dtype); - expect(output.dtype).toBe('float32'); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output.data()]; - case 2: - _b.apply(_a, [_c.sent(), [3.0, 6.0, 9.0]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with wrong tensor name', function (done) { return __awaiter(_this, void 0, void 0, function () { - var model, input; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - input = tf.tensor1d([1.0, 2, 3]); - try { - model.predict({ 'xyz': input }); - done.fail(); - } - catch (error) { - expect(error.message) - .toBe('The model signatureDef input names are x, however ' + - 'the provided input names are xyz.'); - model.dispose(); - done(); - } - return [2 /*return*/]; - } - }); - }); }); - it('execute model with uint8 input', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, output, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/uint8_multiply', ['serve'], 'serving_default')]; - case 1: - model = _c.sent(); - input = tf.scalar(3, 'int32'); - output = model.predict(input); - expect(output.shape).toEqual([]); - expect(output.dtype).toBe('int32'); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output.data()]; - case 2: - _b.apply(_a, [_c.sent(), [18]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with int64 input', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, output, data; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/int64_multiply', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - input = tf.tensor1d([3, 4], 'int32'); - output = model.predict(input); - expect(output.shape).toEqual([2]); - expect(output.dtype).toBe('int32'); - return [4 /*yield*/, output.data()]; - case 2: - data = _a.sent(); - expect(Number(data[0])).toEqual(18); - expect(Number(data[1])).toEqual(24); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model int times two', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, output, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_two_int', ['serve'], 'serving_default')]; - case 1: - model = _c.sent(); - input = tf.tensor1d([1, 2, 3], 'int32'); - output = model.predict(input); - expect(output.shape).toEqual(input.shape); - expect(output.dtype).toBe(input.dtype); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output.data()]; - case 2: - _b.apply(_a, [_c.sent(), [2, 4, 6]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute multiple signatures from the same model', function () { return __awaiter(_this, void 0, void 0, function () { - var backend, loadSavedModelMetaGraphSpy, model1, input1, output1, _a, _b, model2, input2, output2, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - backend = nodejs_kernel_backend_1.nodeBackend(); - loadSavedModelMetaGraphSpy = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; - case 1: - model1 = _e.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - input1 = tf.tensor1d([1, 2, 3]); - output1 = model1.predict(input1); - expect(output1.shape).toEqual(input1.shape); - expect(output1.dtype).toBe(input1.dtype); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output1.data()]; - case 2: - _b.apply(_a, [_e.sent(), [3.0, 6.0, 9.0]]); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; - case 3: - model2 = _e.sent(); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - input2 = tf.tensor1d([1, 2, 3]); - output2 = model2.predict(input2); - expect(output2.shape).toEqual(input2.shape); - expect(output2.dtype).toBe(input2.dtype); - _d = (_c = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output2.data()]; - case 4: - _d.apply(_c, [_e.sent(), [2.0, 4.0, 6.0]]); - expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); - model1.dispose(); - model2.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with single input and multiple outputs', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input, output, output1, output2, _a, _b, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_single_input_multi_output', ['serve'], 'serving_default')]; - case 1: - model = _e.sent(); - input = tf.tensor1d([1, 2, 3], 'int32'); - output = model.predict(input); - output1 = output[0]; - output2 = output[1]; - expect(output1.shape).toEqual(input.shape); - expect(output1.dtype).toBe(input.dtype); - expect(output2.shape).toEqual(input.shape); - expect(output2.dtype).toBe(input.dtype); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output1.data()]; - case 2: - _b.apply(_a, [_e.sent(), [2, 4, 6]]); - _d = (_c = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output2.data()]; - case 3: - _d.apply(_c, [_e.sent(), [1, 2, 3]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('execute model with multiple inputs and multiple outputs', function () { return __awaiter(_this, void 0, void 0, function () { - var model, input1, input2, output, output1, output2, _a, _b, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; - case 1: - model = _e.sent(); - input1 = tf.tensor1d([1, 2, 3], 'int32'); - input2 = tf.tensor1d([1, 2, 3], 'int32'); - output = model.predict({ 'x': input1, 'y': input2 }); - output1 = output['output_0']; - output2 = output['output_1']; - expect(output1.shape).toEqual(input1.shape); - expect(output1.dtype).toBe(input1.dtype); - expect(output2.shape).toEqual(input2.shape); - expect(output2.dtype).toBe(input2.dtype); - _b = (_a = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output1.data()]; - case 2: - _b.apply(_a, [_e.sent(), [2, 4, 6]]); - _d = (_c = tfjs_1.test_util).expectArraysClose; - return [4 /*yield*/, output2.data()]; - case 3: - _d.apply(_c, [_e.sent(), [1, 2, 3]]); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); - it('load multiple models', function () { return __awaiter(_this, void 0, void 0, function () { - var model1, model2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - expect(tf.node.getNumOfSavedModels()).toBe(0); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; - case 1: - model1 = _a.sent(); - expect(tf.node.getNumOfSavedModels()).toBe(1); - return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; - case 2: - model2 = _a.sent(); - expect(tf.node.getNumOfSavedModels()).toBe(2); - model1.dispose(); - expect(tf.node.getNumOfSavedModels()).toBe(1); - model2.dispose(); - expect(tf.node.getNumOfSavedModels()).toBe(0); - return [2 /*return*/]; - } - }); - }); }); - it('return inputs and outputs', function () { return __awaiter(_this, void 0, void 0, function () { - var model; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; - case 1: - model = _a.sent(); - expect(model.inputs.length).toBe(2); - expect(model.outputs.length).toBe(2); - expect(model.inputs[0].name).toBe('serving_default_x'); - expect(model.inputs[0].dtype).toBe('int32'); - expect(model.inputs[0].tfDtype).toBe('DT_INT32'); - expect(model.inputs[0].shape.length).toBe(0); - expect(model.inputs[1].name).toBe('serving_default_y'); - expect(model.inputs[1].dtype).toBe('int32'); - expect(model.inputs[1].tfDtype).toBe('DT_INT32'); - expect(model.inputs[1].shape.length).toBe(0); - expect(model.outputs[0].name).toBe('StatefulPartitionedCall'); - expect(model.outputs[0].dtype).toBe('int32'); - expect(model.outputs[0].tfDtype).toBe('DT_INT32'); - expect(model.outputs[0].shape.length).toBe(0); - expect(model.outputs[1].name).toBe('StatefulPartitionedCall:1'); - expect(model.outputs[1].dtype).toBe('int32'); - expect(model.outputs[1].tfDtype).toBe('DT_INT32'); - expect(model.outputs[1].shape.length).toBe(0); - model.dispose(); - return [2 /*return*/]; - } - }); - }); }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts deleted file mode 100644 index bf9c718cd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts +++ /dev/null @@ -1,64 +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 { Scalar, Tensor } from '@tensorflow/tfjs'; -import { NodeJSKernelBackend } from './nodejs_kernel_backend'; -export declare class SummaryFileWriter { - private readonly resourceHandle; - backend: NodeJSKernelBackend; - constructor(resourceHandle: Tensor); - /** - * Write a scalar summary. - * - * @param name A name of the summary. The summary tag for TensorBoard will be - * this name. - * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript - * `number`. - * @param step Required `int64`-castable, monotically-increasing step value. - * @param description Optinal long-form description for this summary, as a - * `string`. *Not implemented yet*. - */ - scalar(name: string, value: Scalar | number, step: number, description?: string): void; - /** - * Force summary writer to send all buffered data to storage. - */ - flush(): void; -} -/** - * Create a summary file writer for TensorBoard. - * - * Example: - * ```js - * const tf = require('@tensorflow/tfjs-node'); - * - * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir'); - * - * for (let step = 0; step < 100; ++step) { - * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step); - * } - * ``` - * - * @param logdir Log directory in which the summary data will be written. - * @param maxQueue Maximum queue length (default: `10`). - * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e, - * `120` seconds). - * @param filenameSuffix Suffix of the protocol buffer file names to be - * written in the `logdir` (default: `.v2`). - * @returns An instance of `SummaryFileWriter`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -export declare function summaryFileWriter(logdir: string, maxQueue?: number, flushMillis?: number, filenameSuffix?: string): SummaryFileWriter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js deleted file mode 100644 index 09d6718ff..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); -var SummaryFileWriter = /** @class */ (function () { - function SummaryFileWriter(resourceHandle) { - this.resourceHandle = resourceHandle; - nodejs_kernel_backend_1.ensureTensorflowBackend(); - this.backend = nodejs_kernel_backend_1.nodeBackend(); - } - /** - * Write a scalar summary. - * - * @param name A name of the summary. The summary tag for TensorBoard will be - * this name. - * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript - * `number`. - * @param step Required `int64`-castable, monotically-increasing step value. - * @param description Optinal long-form description for this summary, as a - * `string`. *Not implemented yet*. - */ - SummaryFileWriter.prototype.scalar = function (name, value, step, description) { - // N.B.: Unlike the Python TensorFlow API, step is a required parameter, - // because the construct of global step does not exist in TensorFlow.js. - if (description != null) { - throw new Error('scalar() does not support description yet'); - } - this.backend.writeScalarSummary(this.resourceHandle, step, name, value); - }; - /** - * Force summary writer to send all buffered data to storage. - */ - SummaryFileWriter.prototype.flush = function () { - this.backend.flushSummaryWriter(this.resourceHandle); - }; - return SummaryFileWriter; -}()); -exports.SummaryFileWriter = SummaryFileWriter; -/** - * Use a cache for `SummaryFileWriter` instance. - * - * Using multiple instances of `SummaryFileWriter` pointing to the same - * logdir has potential problems. Using this cache avoids those problems. - */ -var summaryFileWriterCache = {}; -/** - * Create a summary file writer for TensorBoard. - * - * Example: - * ```js - * const tf = require('@tensorflow/tfjs-node'); - * - * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir'); - * - * for (let step = 0; step < 100; ++step) { - * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step); - * } - * ``` - * - * @param logdir Log directory in which the summary data will be written. - * @param maxQueue Maximum queue length (default: `10`). - * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e, - * `120` seconds). - * @param filenameSuffix Suffix of the protocol buffer file names to be - * written in the `logdir` (default: `.v2`). - * @returns An instance of `SummaryFileWriter`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -function summaryFileWriter(logdir, maxQueue, flushMillis, filenameSuffix) { - if (maxQueue === void 0) { maxQueue = 10; } - if (flushMillis === void 0) { flushMillis = 120000; } - if (filenameSuffix === void 0) { filenameSuffix = '.v2'; } - tfjs_1.util.assert(logdir != null && typeof logdir === 'string' && logdir.length > 0, function () { - return "Invalid logdir: " + logdir + ". Expected a non-empty string for logdir."; - }); - if (!(logdir in summaryFileWriterCache)) { - nodejs_kernel_backend_1.ensureTensorflowBackend(); - var backend = nodejs_kernel_backend_1.nodeBackend(); - var writerResource = backend.summaryWriter(logdir); - backend.createSummaryFileWriter(writerResource, logdir, maxQueue, flushMillis, filenameSuffix); - summaryFileWriterCache[logdir] = new SummaryFileWriter(writerResource); - } - return summaryFileWriterCache[logdir]; -} -exports.summaryFileWriter = summaryFileWriter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js deleted file mode 100644 index 922f9122c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js +++ /dev/null @@ -1,390 +0,0 @@ -"use strict"; -/** - * @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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (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 _this = this; -Object.defineProperty(exports, "__esModule", { value: true }); -var tfjs_1 = require("@tensorflow/tfjs"); -var fs = require("fs"); -var path = require("path"); -var util_1 = require("util"); -var tfn = require("./index"); -// tslint:disable-next-line:no-require-imports -var rimraf = require('rimraf'); -// tslint:disable-next-line:no-require-imports -var tmp = require('tmp'); -var rimrafPromise = util_1.promisify(rimraf); -describe('tensorboard', function () { - var tmpLogDir; - beforeEach(function () { - tmpLogDir = tmp.dirSync().name; - }); - afterEach(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(tmpLogDir != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, rimrafPromise(tmpLogDir)]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); }); - it('Create summaryFileWriter and write scalar', function () { - var writer = tfn.node.summaryFileWriter(tmpLogDir); - writer.scalar('foo', 42, 0); - writer.flush(); - // Currently, we only verify that the file exists and the size - // increases in a sensible way as we write more scalars to it. - // The difficulty is in reading the protobuf contents of the event - // file in JavaScript/TypeScript. - var fileNames = fs.readdirSync(tmpLogDir); - expect(fileNames.length).toEqual(1); - var eventFilePath = path.join(tmpLogDir, fileNames[0]); - var fileSize0 = fs.statSync(eventFilePath).size; - writer.scalar('foo', 43, 1); - writer.flush(); - var fileSize1 = fs.statSync(eventFilePath).size; - var incrementPerScalar = fileSize1 - fileSize0; - expect(incrementPerScalar).toBeGreaterThan(0); - writer.scalar('foo', 44, 2); - writer.scalar('foo', 45, 3); - writer.flush(); - var fileSize2 = fs.statSync(eventFilePath).size; - expect(fileSize2 - fileSize1).toEqual(2 * incrementPerScalar); - }); - it('Writing tf.Scalar works', function () { - var writer = tfn.node.summaryFileWriter(tmpLogDir); - writer.scalar('foo', tfjs_1.scalar(42), 0); - writer.flush(); - // Currently, we only verify that the file exists and the size - // increases in a sensible way as we write more scalars to it. - // The difficulty is in reading the protobuf contents of the event - // file in JavaScript/TypeScript. - var fileNames = fs.readdirSync(tmpLogDir); - expect(fileNames.length).toEqual(1); - }); - it('No crosstalk between two summary writers', function () { - var logDir1 = path.join(tmpLogDir, '1'); - var writer1 = tfn.node.summaryFileWriter(logDir1); - writer1.scalar('foo', 42, 0); - writer1.flush(); - var logDir2 = path.join(tmpLogDir, '2'); - var writer2 = tfn.node.summaryFileWriter(logDir2); - writer2.scalar('foo', 1.337, 0); - writer2.flush(); - // Currently, we only verify that the file exists and the size - // increases in a sensible way as we write more scalars to it. - // The difficulty is in reading the protobuf contents of the event - // file in JavaScript/TypeScript. - var fileNames = fs.readdirSync(logDir1); - expect(fileNames.length).toEqual(1); - var eventFilePath1 = path.join(logDir1, fileNames[0]); - var fileSize1Num0 = fs.statSync(eventFilePath1).size; - fileNames = fs.readdirSync(logDir2); - expect(fileNames.length).toEqual(1); - var eventFilePath2 = path.join(logDir2, fileNames[0]); - var fileSize2Num0 = fs.statSync(eventFilePath2).size; - expect(fileSize2Num0).toBeGreaterThan(0); - writer1.scalar('foo', 43, 1); - writer1.flush(); - var fileSize1Num1 = fs.statSync(eventFilePath1).size; - var incrementPerScalar = fileSize1Num1 - fileSize1Num0; - expect(incrementPerScalar).toBeGreaterThan(0); - writer1.scalar('foo', 44, 2); - writer1.scalar('foo', 45, 3); - writer1.flush(); - var fileSize1Num2 = fs.statSync(eventFilePath1).size; - expect(fileSize1Num2 - fileSize1Num1).toEqual(2 * incrementPerScalar); - var fileSize2Num1 = fs.statSync(eventFilePath2).size; - expect(fileSize2Num1).toEqual(fileSize2Num0); - writer2.scalar('foo', 1.336, 1); - writer2.scalar('foo', 1.335, 2); - writer2.flush(); - var fileSize1Num3 = fs.statSync(eventFilePath1).size; - expect(fileSize1Num3).toEqual(fileSize1Num2); - var fileSize2Num2 = fs.statSync(eventFilePath2).size; - expect(fileSize2Num2 - fileSize2Num1).toEqual(2 * incrementPerScalar); - }); - it('Writing into existing directory works', function () { - fs.mkdirSync(tmpLogDir, { recursive: true }); - var writer = tfn.node.summaryFileWriter(path.join(tmpLogDir, '22')); - writer.scalar('foo', 42, 0); - writer.flush(); - var fileNames = fs.readdirSync(tmpLogDir); - expect(fileNames.length).toEqual(1); - }); - it('empty logdir leads to error', function () { - expect(function () { return tfn.node.summaryFileWriter(''); }).toThrowError(/empty string/); - }); -}); -describe('tensorBoard callback', function () { - var tmpLogDir; - beforeEach(function () { - tmpLogDir = tmp.dirSync().name; - }); - afterEach(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(tmpLogDir != null)) return [3 /*break*/, 2]; - return [4 /*yield*/, rimrafPromise(tmpLogDir)]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); }); - function createModelForTest() { - var model = tfn.sequential(); - model.add(tfn.layers.dense({ units: 5, activation: 'relu', inputShape: [10] })); - model.add(tfn.layers.dense({ units: 1 })); - model.compile({ loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['MAE'] }); - return model; - } - it('fit(): default epoch updateFreq, with validation', function () { return __awaiter(_this, void 0, void 0, function () { - var model, xs, ys, valXs, valYs, subDirs, trainLogDir, trainFiles, trainFileSize0, valLogDir, valFiles, valFileSize0, history, trainFileSize1, valFileSize1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - model = createModelForTest(); - xs = tfn.randomUniform([100, 10]); - ys = tfn.randomUniform([100, 1]); - valXs = tfn.randomUniform([10, 10]); - valYs = tfn.randomUniform([10, 1]); - // Warm-up training. - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 1, - verbose: 0, - validationData: [valXs, valYs], - callbacks: tfn.node.tensorBoard(tmpLogDir) - })]; - case 1: - // Warm-up training. - _a.sent(); - subDirs = fs.readdirSync(tmpLogDir); - expect(subDirs).toContain('train'); - expect(subDirs).toContain('val'); - trainLogDir = path.join(tmpLogDir, 'train'); - trainFiles = fs.readdirSync(trainLogDir); - trainFileSize0 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; - expect(trainFileSize0).toBeGreaterThan(0); - valLogDir = path.join(tmpLogDir, 'val'); - valFiles = fs.readdirSync(valLogDir); - valFileSize0 = fs.statSync(path.join(valLogDir, valFiles[0])).size; - expect(valFileSize0).toBeGreaterThan(0); - // With updateFreq === epoch, the train and val subset should have generated - // the same amount of logs. - expect(valFileSize0).toEqual(trainFileSize0); - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 3, - verbose: 0, - validationData: [valXs, valYs], - callbacks: tfn.node.tensorBoard(tmpLogDir) - })]; - case 2: - history = _a.sent(); - expect(history.history.loss.length).toEqual(3); - expect(history.history.val_loss.length).toEqual(3); - expect(history.history.MAE.length).toEqual(3); - expect(history.history.val_MAE.length).toEqual(3); - trainFileSize1 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; - valFileSize1 = fs.statSync(path.join(valLogDir, valFiles[0])).size; - // We currently only assert that new content has been written to the log - // file. - expect(trainFileSize1).toBeGreaterThan(trainFileSize0); - expect(valFileSize1).toBeGreaterThan(valFileSize0); - // With updateFreq === epoch, the train and val subset should have generated - // the same amount of logs. - expect(valFileSize1).toEqual(trainFileSize1); - return [2 /*return*/]; - } - }); - }); }); - it('fit(): batch updateFreq, with validation', function () { return __awaiter(_this, void 0, void 0, function () { - var model, xs, ys, valXs, valYs, subDirs, trainLogDir, trainFiles, trainFileSize0, valLogDir, valFiles, valFileSize0, history, trainFileSize1, valFileSize1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - model = createModelForTest(); - xs = tfn.randomUniform([100, 10]); - ys = tfn.randomUniform([100, 1]); - valXs = tfn.randomUniform([10, 10]); - valYs = tfn.randomUniform([10, 1]); - // Warm-up training. - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 1, - verbose: 0, - validationData: [valXs, valYs], - // Use batch updateFreq here. - callbacks: tfn.node.tensorBoard(tmpLogDir, { updateFreq: 'batch' }) - })]; - case 1: - // Warm-up training. - _a.sent(); - subDirs = fs.readdirSync(tmpLogDir); - expect(subDirs).toContain('train'); - expect(subDirs).toContain('val'); - trainLogDir = path.join(tmpLogDir, 'train'); - trainFiles = fs.readdirSync(trainLogDir); - trainFileSize0 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; - expect(trainFileSize0).toBeGreaterThan(0); - valLogDir = path.join(tmpLogDir, 'val'); - valFiles = fs.readdirSync(valLogDir); - valFileSize0 = fs.statSync(path.join(valLogDir, valFiles[0])).size; - expect(valFileSize0).toBeGreaterThan(0); - // The train subset should have generated more logs than the val subset, - // because the train subset gets logged every batch, while the val subset - // gets logged every epoch. - expect(trainFileSize0).toBeGreaterThan(valFileSize0); - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 3, - verbose: 0, - validationData: [valXs, valYs], - callbacks: tfn.node.tensorBoard(tmpLogDir) - })]; - case 2: - history = _a.sent(); - expect(history.history.loss.length).toEqual(3); - expect(history.history.val_loss.length).toEqual(3); - expect(history.history.MAE.length).toEqual(3); - expect(history.history.val_MAE.length).toEqual(3); - trainFileSize1 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; - valFileSize1 = fs.statSync(path.join(valLogDir, valFiles[0])).size; - // We currently only assert that new content has been written to the log - // file. - expect(trainFileSize1).toBeGreaterThan(trainFileSize0); - expect(valFileSize1).toBeGreaterThan(valFileSize0); - // The train subset should have generated more logs than the val subset, - // because the train subset gets logged every batch, while the val subset - // gets logged every epoch. - expect(trainFileSize1).toBeGreaterThan(valFileSize1); - return [2 /*return*/]; - } - }); - }); }); - it('fit(): with initialEpoch', function () { return __awaiter(_this, void 0, void 0, function () { - var model, xs, ys, valXs, valYs, callback, trainWriterScalarSpy, valWriterScalarSpy, trainCallArgs, valCallArgs; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - model = createModelForTest(); - xs = tfn.randomUniform([100, 10]); - ys = tfn.randomUniform([100, 1]); - valXs = tfn.randomUniform([10, 10]); - valYs = tfn.randomUniform([10, 1]); - // Warm-up training. Also ensures that `callback.trainWriter` and - // `callback.valWriter` are created. - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 2, - validationData: [valXs, valYs], - verbose: 0, - })]; - case 1: - // Warm-up training. Also ensures that `callback.trainWriter` and - // `callback.valWriter` are created. - _a.sent(); - callback = tfn.node.tensorBoard(tmpLogDir, { updateFreq: 'epoch' }); - // tslint:disable-next-line:no-any - callback.ensureTrainWriterCreated(); - // tslint:disable-next-line:no-any - callback.ensureValWriterCreated(); - trainWriterScalarSpy = spyOn(callback.trainWriter, 'scalar'); - valWriterScalarSpy = spyOn(callback.valWriter, 'scalar'); - // Train for 2 more epochs, using initialEpoch and callback. - return [4 /*yield*/, model.fit(xs, ys, { - epochs: 4, - initialEpoch: 2, - validationData: [valXs, valYs], - callbacks: [callback], - })]; - case 2: - // Train for 2 more epochs, using initialEpoch and callback. - _a.sent(); - expect(trainWriterScalarSpy).toHaveBeenCalledTimes(4); - trainCallArgs = trainWriterScalarSpy.calls.allArgs(); - // Assert that the epoch numbers used to log the epoch-end loss and metric - // reflect initialEpoch. - expect(trainCallArgs[0][0]).toEqual('epoch_loss'); - expect(trainCallArgs[0][2]).toEqual(3); - expect(trainCallArgs[1][0]).toEqual('epoch_MAE'); - expect(trainCallArgs[1][2]).toEqual(3); - expect(trainCallArgs[2][0]).toEqual('epoch_loss'); - expect(trainCallArgs[2][2]).toEqual(4); - expect(trainCallArgs[3][0]).toEqual('epoch_MAE'); - expect(trainCallArgs[3][2]).toEqual(4); - expect(valWriterScalarSpy).toHaveBeenCalledTimes(4); - valCallArgs = valWriterScalarSpy.calls.allArgs(); - expect(valCallArgs[0][0]).toEqual('epoch_loss'); - expect(valCallArgs[0][2]).toEqual(3); - expect(valCallArgs[1][0]).toEqual('epoch_MAE'); - expect(valCallArgs[1][2]).toEqual(3); - expect(valCallArgs[2][0]).toEqual('epoch_loss'); - expect(valCallArgs[2][2]).toEqual(4); - expect(valCallArgs[3][0]).toEqual('epoch_MAE'); - expect(valCallArgs[3][2]).toEqual(4); - return [2 /*return*/]; - } - }); - }); }); - it('Invalid updateFreq value causes error', function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - expect(function () { return tfn.node.tensorBoard(tmpLogDir, { - // tslint:disable-next-line:no-any - updateFreq: 'foo' - }); }).toThrowError(/Expected updateFreq/); - return [2 /*return*/]; - }); - }); }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts deleted file mode 100644 index 9fd4bb199..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts +++ /dev/null @@ -1,56 +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 { backend_util } from '@tensorflow/tfjs'; -export declare class TensorMetadata { - id: number; - shape: number[]; - dtype: number; -} -export declare class TFEOpAttr { - name: string; - type: number; - value: boolean | number | object | string | number[]; -} -export interface TFJSBinding { - TensorMetadata: typeof TensorMetadata; - TFEOpAttr: typeof TFEOpAttr; - createTensor(shape: number[], dtype: number, buffer: backend_util.BackendValues): number; - deleteTensor(tensorId: number): void; - tensorDataSync(tensorId: number): Float32Array | Int32Array | Uint8Array; - executeOp(opName: string, opAttrs: TFEOpAttr[], inputTensorIds: number[], numOutputs: number): TensorMetadata[]; - loadSavedModel(exportDir: string, tags: string): number; - deleteSavedModel(savedModelId: number): void; - runSavedModel(savedModelId: number, inputTensorIds: number[], inputOpNames: string, outputOpNames: string): TensorMetadata[]; - getNumOfSavedModels(): number; - isUsingGpuDevice(): boolean; - TF_FLOAT: number; - TF_INT32: number; - TF_INT64: number; - TF_BOOL: number; - TF_COMPLEX64: number; - TF_STRING: number; - TF_RESOURCE: number; - TF_UINT8: number; - TF_ATTR_STRING: number; - TF_ATTR_INT: number; - TF_ATTR_FLOAT: number; - TF_ATTR_BOOL: number; - TF_ATTR_TYPE: number; - TF_ATTR_SHAPE: number; - TF_ATTR_RESOURCE: number; - TF_Version: string; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js deleted file mode 100644 index 7c826123e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts deleted file mode 100644 index 4a6d69728..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.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. - * ============================================================================= - */ -export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js deleted file mode 100644 index 84e44ffea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js +++ /dev/null @@ -1,255 +0,0 @@ -"use strict"; -/** - * @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. - * ============================================================================= - */ -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -// tslint:disable-next-line:no-require-imports -var binary = require('node-pre-gyp'); -var bindingPath = binary.find(path.resolve(path.join(__dirname, '../package.json'))); -// tslint:disable-next-line:no-require-imports -var bindings = require(bindingPath); -var binding = bindings; -describe('Exposes TF_DataType enum values', function () { - it('contains TF_FLOAT', function () { - expect(binding.TF_FLOAT).toEqual(1); - }); - it('contains TF_INT32', function () { - expect(binding.TF_INT32).toEqual(3); - }); - it('contains TF_BOOL', function () { - expect(binding.TF_BOOL).toEqual(10); - }); - it('contains TF_COMPLEX64', function () { - expect(binding.TF_COMPLEX64).toEqual(8); - }); - it('contains TF_STRING', function () { - expect(binding.TF_STRING).toEqual(7); - }); -}); -describe('Exposes TF_AttrType enum values', function () { - it('contains TF_ATTR_STRING', function () { - expect(binding.TF_ATTR_STRING).toEqual(0); - }); - it('contains TF_ATTR_INT', function () { - expect(binding.TF_ATTR_INT).toEqual(1); - }); - it('contains TF_ATTR_FLOAT', function () { - expect(binding.TF_ATTR_FLOAT).toEqual(2); - }); - it('contains TF_ATTR_BOOL', function () { - expect(binding.TF_ATTR_BOOL).toEqual(3); - }); - it('contains TF_ATTR_TYPE', function () { - expect(binding.TF_ATTR_TYPE).toEqual(4); - }); - it('contains TF_ATTR_SHAPE', function () { - expect(binding.TF_ATTR_SHAPE).toEqual(5); - }); -}); -describe('Exposes TF Version', function () { - it('contains a version string', function () { - expect(binding.TF_Version).toBeDefined(); - }); -}); -describe('tensor management', function () { - it('Creates and deletes a valid tensor', function () { - var values = new Int32Array([1, 2]); - var id = binding.createTensor([2], binding.TF_INT32, values); - expect(id).toBeDefined(); - binding.deleteTensor(id); - }); - it('throws exception when shape does not match data', function () { - expect(function () { - binding.createTensor([2], binding.TF_INT32, new Int32Array([1, 2, 3])); - }).toThrowError(); - expect(function () { - binding.createTensor([4], binding.TF_INT32, new Int32Array([1, 2, 3])); - }).toThrowError(); - }); - it('throws exception with invalid dtype', function () { - expect(function () { - // tslint:disable-next-line:no-unused-expression - binding.createTensor([1], 1000, new Int32Array([1])); - }).toThrowError(); - }); - it('works with 0-dim tensors', function () { - // Reduce op (e.g 'Max') will produce a 0-dim TFE_Tensor. - var inputId = binding.createTensor([3], binding.TF_INT32, new Int32Array([1, 2, 3])); - var axesId = binding.createTensor([1], binding.TF_INT32, new Int32Array([0])); - var attrs = [ - { name: 'keep_dims', type: binding.TF_ATTR_BOOL, value: false }, - { name: 'T', type: binding.TF_ATTR_TYPE, value: binding.TF_INT32 }, - { name: 'Tidx', type: binding.TF_ATTR_TYPE, value: binding.TF_INT32 } - ]; - var outputMetadata = binding.executeOp('Max', attrs, [inputId, axesId], 1); - expect(outputMetadata.length).toBe(1); - expect(outputMetadata[0].id).toBeDefined(); - expect(outputMetadata[0].shape).toEqual([]); - expect(outputMetadata[0].dtype).toEqual(binding.TF_INT32); - expect(binding.tensorDataSync(outputMetadata[0].id)) - .toEqual(new Int32Array([3])); - }); -}); -describe('executeOp', function () { - var name = 'MatMul'; - var matMulOpAttrs = [ - { name: 'transpose_a', type: binding.TF_ATTR_BOOL, value: false }, - { name: 'transpose_b', type: binding.TF_ATTR_BOOL, value: false }, - { name: 'T', type: binding.TF_ATTR_TYPE, value: binding.TF_FLOAT } - ]; - var aId = binding.createTensor([2, 2], binding.TF_FLOAT, new Float32Array([1, 2, 3, 4])); - var bId = binding.createTensor([2, 2], binding.TF_FLOAT, new Float32Array([4, 3, 2, 1])); - var matMulInput = [aId, bId]; - it('throws exception with invalid Op Name', function () { - expect(function () { - binding.executeOp(null, [], [], null); - }).toThrowError(); - }); - it('throws exception with invalid TFEOpAttr', function () { - expect(function () { - binding.executeOp('Equal', null, [], null); - }).toThrowError(); - }); - it('throws excpetion with invalid inputs', function () { - expect(function () { - binding.executeOp(name, matMulOpAttrs, [], null); - }).toThrowError(); - }); - it('throws exception with invalid output number', function () { - expect(function () { - binding.executeOp(name, matMulOpAttrs, matMulInput, null); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_STRING op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: false }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: 1 }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: [1, 2, 3] }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_INT op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: false }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: 'test' }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_FLOAT op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: false }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: 'test' }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_BOOL op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: 10 }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: 'test' }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: [1, 2, 3] }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_TYPE op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: 'test' }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: [1, 2, 3] }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('throws exception with invalid TF_ATTR_SHAPE op attr', function () { - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: null }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: new Object() }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - expect(function () { - var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: 'test' }]; - binding.executeOp(name, badOpAttrs, matMulInput, 1); - }).toThrowError(); - }); - it('should work for matmul', function () { - var output = binding.executeOp(name, matMulOpAttrs, matMulInput, 1); - expect(binding.tensorDataSync(output[0].id)).toEqual(new Float32Array([ - 8, 5, 20, 13 - ])); - }); -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts deleted file mode 100644 index 35cb42ada..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** @license See the LICENSE file. */ -declare const version = "3.6.1"; -export { version }; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js deleted file mode 100644 index 6ec1b9a17..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -/** @license See the LICENSE file. */ -Object.defineProperty(exports, "__esModule", { value: true }); -// This code is auto-generated, do not modify this file! -var version = '3.6.1'; -exports.version = version; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node deleted file mode 100755 index a656bb9caeb3fe287c12186701d4e8ba024a267f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87424 zcmd3P31C#!_4kBD;}R#RShOzDqJj%0AeyM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Xx|Dy`O&K6qSFlR5Yhd-~C*W5iebTy&rTD{jw6S%lY5ZKV~V( zsS`m)lyyG5&VPXqueho_^oZ^q+jr4kF6B?0s*v~`*jR}_U2knyWS&}fMXCNh?Nh3x fTh4J~OXX@Twt-a4|BVin{|p5*Im_$ZAo0HeMg#6; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json deleted file mode 100644 index 98daf908d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "_from": "@tensorflow/tfjs-node", - "_id": "@tensorflow/tfjs-node@3.6.1", - "_inBundle": false, - "_integrity": "sha512-JA6GE7AYx+zoXiKQmEdMc848HDOurrI3vFyiLk/8bXJDEv7L7oW5y6Q1Ja+Bz5ul7UmOxNG89hyYhfGqJK8qKw==", - "_location": "/@tensorflow/tfjs-node", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "@tensorflow/tfjs-node", - "name": "@tensorflow/tfjs-node", - "escapedName": "@tensorflow%2ftfjs-node", - "scope": "@tensorflow", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.6.1.tgz", - "_shasum": "a1452076fe6da48f5648ca33f85d1127e6881244", - "_spec": "@tensorflow/tfjs-node", - "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", - "binary": { - "module_name": "tfjs_binding", - "module_path": "./lib/napi-v{napi_build_version}", - "host": "https://storage.googleapis.com/tf-builds/pre-built-binary", - "remote_path": "./napi-v{napi_build_version}/{version}/", - "napi_versions": [ - 3, - 4, - 5, - 6, - 7, - 8 - ] - }, - "bugs": { - "url": "https://github.com/tensorflow/tfjs/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@tensorflow/tfjs": "3.6.0", - "adm-zip": "^0.4.11", - "google-protobuf": "^3.9.2", - "https-proxy-agent": "^2.2.1", - "node-pre-gyp": "0.14.0", - "progress": "^2.0.0", - "rimraf": "^2.6.2", - "tar": "^4.4.6" - }, - "deprecated": false, - "description": "This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, accelerated by the TensorFlow C binary under the hood. It provides the same API as [TensorFlow.js](https://js.tensorflow.org/api/latest/).", - "devDependencies": { - "@tensorflow/tfjs-core": "3.6.0", - "@types/jasmine": "~2.8.6", - "@types/node": "^10.5.1", - "@types/progress": "^2.0.1", - "@types/rimraf": "~2.0.2", - "@types/yargs": "^13.0.3", - "clang-format": "~1.2.2", - "jasmine": "~3.1.0", - "node-fetch": "~2.6.1", - "nyc": "^15.1.0", - "tmp": "^0.0.33", - "ts-node": "^5.0.1", - "tslint": "~6.1.3", - "tslint-no-circular-imports": "^0.7.0", - "typescript": "3.5.3", - "yalc": "~1.0.0-pre.50", - "yargs": "^16.2.0" - }, - "engines": { - "node": ">=8.11.0" - }, - "gypfile": true, - "homepage": "https://github.com/tensorflow/tfjs#readme", - "license": "Apache-2.0", - "main": "dist/index.js", - "name": "@tensorflow/tfjs-node", - "repository": { - "type": "git", - "url": "git+https://github.com/tensorflow/tfjs.git" - }, - "scripts": { - "build": "tsc && npx mkdirp dist/proto && cp src/proto/api_pb.js dist/proto/api_pb.js", - "build-addon": "./scripts/build-and-upload-addon.sh", - "build-addon-from-source": "node-pre-gyp install --build-from-source", - "build-backend-cpu": "cd ../tfjs-backend-cpu && yarn && yarn build", - "build-backend-cpu-ci": "cd ../tfjs-backend-cpu && yarn && yarn build-ci", - "build-backend-webgl": "cd ../tfjs-backend-webgl && yarn && yarn build", - "build-backend-webgl-ci": "cd ../tfjs-backend-webgl && yarn && yarn build-ci", - "build-ci": "tsc && npx mkdirp dist/proto && cp src/proto/api_pb.js dist/proto/api_pb.js", - "build-converter": "cd ../tfjs-converter && yarn && yarn build", - "build-converter-ci": "cd ../tfjs-converter && yarn && yarn build-ci", - "build-core": "cd ../tfjs-core && yarn && yarn build", - "build-core-ci": "cd ../tfjs-core && yarn && yarn build-ci", - "build-data": "cd ../tfjs-data && yarn && yarn build", - "build-data-ci": "cd ../tfjs-data && yarn && yarn build-ci", - "build-deps": "yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl && yarn build-layers && yarn build-converter && yarn build-data && yarn build-union", - "build-deps-ci": "yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-union-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", - "build-union": "cd ../tfjs && yarn && yarn build", - "build-union-ci": "cd ../tfjs && yarn && yarn build-ci", - "clean-deps": "rm -rf deps && rm -rf lib", - "coverage": "nyc yarn ts-node -P tsconfig.test.json src/run_tests.ts", - "enable-gpu": "node scripts/install.js gpu download && yarn && yarn build-addon-from-source", - "ensure-cpu-gpu-packages-align": "node scripts/ensure-cpu-gpu-packages-align.js", - "format": "clang-format -i -style=Google binding/*.cc binding/*.h", - "install": "node scripts/install.js", - "install-from-source": "yarn clean-deps && yarn && yarn build-addon-from-source", - "link-local": "yalc link", - "lint": "tslint -p . -t verbose", - "prep": "cd node_modules/@tensorflow/tfjs-core && yarn && yarn build", - "publish-local": "yarn prep && yalc push", - "publish-npm": "npm publish", - "test": "yarn && yarn build-deps && yarn build && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts", - "test-ci": "ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts", - "test-dev": "tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts", - "upload-windows-addon": "./scripts/build-and-upload-windows-addon.bat" - }, - "types": "dist/index.d.ts", - "version": "3.6.1" -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py deleted file mode 100644 index 827f88a0a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py +++ /dev/null @@ -1,36 +0,0 @@ - # Copyright 2020 Google LLC -# -# 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. -# ============================================================================== -"""Python script for creating Tensorflow SavedModel with UINT64 input.""" - -import os - -import tensorflow as tf -from tensorflow.python.eager import def_function -from tensorflow.python.framework import constant_op -from tensorflow.python.framework import dtypes -from tensorflow.python.ops import variables -from tensorflow.python.training.tracking import tracking -from tensorflow.python.saved_model.save import save - -"""Test a basic model with functions to make sure functions are inlined.""" -input_data = constant_op.constant(1, shape=[2], dtype=tf.int64) -root = tracking.AutoTrackable() -root.v1 = variables.Variable(3, dtype=tf.int64) -root.v2 = variables.Variable(2, dtype=tf.int64) -root.f = def_function.function(lambda x: root.v1 * root.v2 * x) -to_save = root.f.get_concrete_function(input_data) - -save_dir = os.path.join('..', 'test_objects', 'saved_model', 'int64_multiply') -save(root, save_dir, to_save) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py deleted file mode 100644 index 733e68fc2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py +++ /dev/null @@ -1,35 +0,0 @@ - # Copyright 2020 Google LLC -# -# 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. -# ============================================================================== -"""Python script for creating Tensorflow SavedModel with UINT8 input.""" - -import os - -import tensorflow as tf -from tensorflow.python.eager import def_function -from tensorflow.python.framework import constant_op -from tensorflow.python.ops import variables -from tensorflow.python.training.tracking import tracking -from tensorflow.python.saved_model.save import save - -"""Test a basic model with functions to make sure functions are inlined.""" -input_data = constant_op.constant(1, shape=[1], dtype=tf.uint8) -root = tracking.AutoTrackable() -root.v1 = variables.Variable(3) -root.v2 = variables.Variable(2) -root.f = def_function.function(lambda x: root.v1 * root.v2 * tf.cast(x, tf.int32)) -to_save = root.f.get_concrete_function(input_data) - -save_dir = os.path.join('..', 'test_objects', 'saved_model', 'uint8_multiply') -save(root, save_dir, to_save) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh deleted file mode 100755 index a1ac2e4b3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# ============================================================================= - -# The following commands do these steps: -# 1) Remove the existing pre-built addon tarball. -# 2) Run `yarn install-from-source` to build binding from source -# 3) Compress and upload the pre-built addon tarball. -# Please read DEVELOPMENT.md before developing and publishing. - -set -e - -# get package name based on os and processor -PACKAGE_NAME=$(node scripts/get-addon-name.js) -# get NAPI version -NAPI_VERSION=`node -p "process.versions.napi"` -# remove the pre-built addon tarball if it already exist -rm -f $PACKAGE_NAME -yarn install-from-source -if [ "$1" = "for-publish" ]; then - # build a new pre-built addon tarball - tar -czvf $PACKAGE_NAME -C lib napi-v$NAPI_VERSION/tfjs_binding.node - # upload pre-built addon tarball to gcloud - PACKAGE_HOST=`node -p "require('./package.json').binary.host.split('.com/')[1] + '/napi-v' + process.versions.napi + '/' + require('./package.json').version + '/'"` - gsutil cp $PACKAGE_NAME gs://$PACKAGE_HOST -fi diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json deleted file mode 100644 index 1e1eee11d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "tf-lib": "url-to-download-customized-binary", - "addon": { - "host": "host-of-pre-compiled-addon", - "remote_path": "remote-path-of-pre-compiled-addon", - "package_name": "file-name-of-pre-compile-addon" - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js deleted file mode 100644 index f9d28d7eb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js +++ /dev/null @@ -1,121 +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. - * ============================================================================= - */ -const os = require('os'); -const fs = require('fs'); -const join = require('path').join; -const module_path_napi = require('../package.json').binary.module_path; -const modulePath = - module_path_napi.replace('{napi_build_version}', process.versions.napi); - -/** Version of the libtensorflow shared library to depend on. */ -const LIBTENSORFLOW_VERSION = '2.4.1'; - -/** Map the os.arch() to arch string in a file name */ -const ARCH_MAPPING = { - 'x64': 'x86_64' -}; -/** Map the os.platform() to the platform value in a file name */ -const PLATFORM_MAPPING = { - 'darwin': 'darwin', - 'linux': 'linux', - 'win32': 'windows' -}; -/** The extension of a compressed file */ -const PLATFORM_EXTENSION = os.platform() === 'win32' ? 'zip' : 'tar.gz'; -/** - * Current supported type, platform and architecture combinations - * `tf-lib` represents tensorflow shared libraries and `binding` represents - * node binding. - */ -const ALL_SUPPORTED_COMBINATION = [ - 'cpu-darwin-x86_64', 'gpu-linux-x86_64', 'cpu-linux-x86_64', - 'cpu-windows-x86_64', 'gpu-windows-x86_64' -]; - -/** Get the MAJOR.MINOR-only version of libtensorflow. */ -function getLibTensorFlowMajorDotMinorVersion() { - const items = LIBTENSORFLOW_VERSION.split('.'); - if (items.length < 3) { - throw new Error( - `Invalid version string for libtensorflow: ${LIBTENSORFLOW_VERSION}`); - } - return `${items[0]}.${items[1]}`; -} - -// Determine constants for deps folder names and destination (build) path names. -let depsLibTensorFlowName = 'libtensorflow'; -let depsLibTensorFlowFrameworkName = 'libtensorflow_framework'; - -let destLibTensorFlowName = depsLibTensorFlowName; -let destLibTensorFlowFrameworkName = depsLibTensorFlowFrameworkName; - -if (os.platform() === 'win32') { - depsLibTensorFlowName = 'tensorflow.dll'; - depsLibTensorFlowFrameworkName = ''; // Not supported on Windows - - destLibTensorFlowName = depsLibTensorFlowName; - destLibTensorFlowFrameworkName = ''; // Not supported on Windows -} else if (os.platform() === 'darwin') { - depsLibTensorFlowName += '.dylib'; - depsLibTensorFlowFrameworkName += '.dylib'; - - destLibTensorFlowName = depsLibTensorFlowName; - destLibTensorFlowFrameworkName = depsLibTensorFlowFrameworkName; -} else if (os.platform() === 'linux') { - // Linux has a hard-coded version number, make the destination name simpler: - depsLibTensorFlowName += `.so.${LIBTENSORFLOW_VERSION}`; - depsLibTensorFlowFrameworkName += `.so.${LIBTENSORFLOW_VERSION}`; - destLibTensorFlowName += '.so'; - destLibTensorFlowFrameworkName += '.so'; -} else { - throw Exception('Unsupported platform: ' + os.platform()); -} - -const depsPath = join(__dirname, '..', 'deps'); -const depsLibPath = join(depsPath, 'lib'); - -const depsLibTensorFlowPath = join(depsLibPath, depsLibTensorFlowName); -const depsLibTensorFlowFrameworkPath = - join(depsLibPath, depsLibTensorFlowFrameworkName); - -// Get information for custom binary -const CUSTOM_BINARY_FILENAME = 'custom-binary.json'; -function loadCustomBinary() { - const cfg = join(__dirname, CUSTOM_BINARY_FILENAME); - return fs.existsSync(cfg) ? require(cfg) : {}; -} -const customBinaries = loadCustomBinary(); - -module.exports = { - depsPath, - depsLibPath, - depsLibTensorFlowFrameworkName, - depsLibTensorFlowFrameworkPath, - depsLibTensorFlowName, - depsLibTensorFlowPath, - destLibTensorFlowFrameworkName, - destLibTensorFlowName, - getLibTensorFlowMajorDotMinorVersion, - modulePath, - LIBTENSORFLOW_VERSION, - ARCH_MAPPING, - PLATFORM_MAPPING, - PLATFORM_EXTENSION, - ALL_SUPPORTED_COMBINATION, - customTFLibUri: customBinaries['tf-lib'], - customAddon: customBinaries['addon'] -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js deleted file mode 100644 index a9e146b1f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js +++ /dev/null @@ -1,97 +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. - * ============================================================================= - */ -const fs = require('fs'); -const path = require('path'); -const util = require('util'); - -const copy = util.promisify(fs.copyFile); -const os = require('os'); -const rename = util.promisify(fs.rename); -const symlink = util.promisify(fs.symlink); -const { - depsLibTensorFlowFrameworkPath, - depsLibTensorFlowPath, - destLibTensorFlowFrameworkName, - destLibTensorFlowName -} = require('./deps-constants.js'); - -const action = process.argv[2]; -let targetDir = process.argv[3]; - -// This file is Windows only - the libraries must be placed in the correct -// directory to work. -if (os.platform() !== 'win32') { - throw new Exception('Dep staging is only supported on Windows'); -} - -// Some windows machines contain a trailing " char: -if (targetDir != undefined && targetDir.endsWith('"')) { - targetDir = targetDir.substr(0, targetDir.length - 1); -} - -// Setup dest binary paths: -const destLibTensorFlowPath = path.join(targetDir, destLibTensorFlowName); -const destLibTensorFlowFrameworkPath = - path.join(targetDir, destLibTensorFlowFrameworkName); - -/** - * Symlinks the extracted libtensorflow library to the destination path. If the - * symlink fails, a copy is made. - */ -async function symlinkDepsLib() { - if (destLibTensorFlowPath === undefined) { - throw new Error('Destination path not supplied!'); - } - try { - await symlink( - path.relative( - path.dirname(destLibTensorFlowPath), depsLibTensorFlowPath), - destLibTensorFlowPath); - } catch (e) { - console.error(` * Symlink of ${ - destLibTensorFlowPath} failed, creating a copy on disk.`); - await copy(depsLibTensorFlowPath, destLibTensorFlowPath); - } -} - -/** - * Moves the deps library path to the destination path. - */ -async function moveDepsLib() { - await rename(depsLibTensorFlowPath, destLibTensorFlowPath); - if (os.platform() !== 'win32') { - await rename( - depsLibTensorFlowFrameworkPath, destLibTensorFlowFrameworkPath); - } -} - -/** - * Symlink or move libtensorflow for building the binding. - */ -async function run(action) { - if (action.endsWith('symlink')) { - // Symlink will happen during `node-gyp rebuild` - await symlinkDepsLib(); - } else if (action.endsWith('move')) { - // Move action is used when installing this module as a package. - await moveDepsLib(); - } else { - throw new Error('Invalid action: ' + action); - } -} - -run(action); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js deleted file mode 100644 index f28de82a3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js +++ /dev/null @@ -1,79 +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. - * ============================================================================= - */ - -/** - * Ensures that the GPU and CPU packages align. - */ -const fs = require('fs'); -const cpuPackage = require('../../tfjs-node/package.json'); -const gpuPackage = require('../../tfjs-node-gpu/package.json'); - -process.on('unhandledRejection', e => { - throw e; -}); - -/** - * Ensure package.json aligns. - */ -const FIELDS_TO_IGNORE = [ - 'name', 'scripts/install', 'scripts/test', 'scripts/prepare', 'scripts/prep', - 'scripts/upload-windows-addon', 'scripts/build-npm', - 'scripts/prep-gpu-windows' -]; - -const cpuPackageKeys = Object.keys(cpuPackage); -const gpuPackageKeys = Object.keys(gpuPackage); -cpuPackageKeys.forEach((key, i) => { - if (gpuPackageKeys[i] != cpuPackageKeys[i]) { - throw new Error( - `CPU and GPU package have different keys: ` + - `${gpuPackageKeys[i]} and ${cpuPackageKeys[i]}.`); - } -}); -if (cpuPackageKeys.length != gpuPackageKeys.length) { - throw new Error(`CPU and GPU package.jsons have different top-level fields.`); -} - -// Ensure the cpu and gpu packages have the same keys. -cpuPackageKeys.forEach(key => { - const cpuPackageValue = cpuPackage[key]; - const gpuPackageValue = gpuPackage[key]; - - if (typeof cpuPackageValue !== 'object') { - if (cpuPackageValue != gpuPackageValue && - FIELDS_TO_IGNORE.indexOf(key) === -1) { - throw new Error( - `CPU package key '${key}' with value ` + - `${JSON.stringify(cpuPackageValue)} does not match GPU value ` + - `${JSON.stringify(gpuPackageValue)}.`); - } - } else { - const cpuFieldKeys = Object.keys(cpuPackageValue); - cpuFieldKeys.forEach(fieldKey => { - const cpuFieldValue = '' + cpuPackageValue[fieldKey]; - const gpuFieldValue = '' + gpuPackageValue[fieldKey]; - const deepKey = `${key}/${fieldKey}`; - if (cpuFieldValue !== gpuFieldValue && - FIELDS_TO_IGNORE.indexOf(deepKey) === -1) { - throw new Error( - `CPU package key '${deepKey}' with value ` + - `${JSON.stringify(cpuFieldValue)} does not match GPU value ` + - `${JSON.stringify(gpuFieldValue)}.`); - } - }); - } -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js deleted file mode 100644 index 65066599f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js +++ /dev/null @@ -1,35 +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. - * ============================================================================= - */ -const os = require('os'); -const name = require('../package.json').name; -const version = require('../package.json').version; - -const platform = os.platform(); - -const {PLATFORM_MAPPING, PLATFORM_EXTENSION} = require('./deps-constants.js'); - -const type = name.includes('gpu') ? 'GPU' : 'CPU'; -const addonName = `${type}-${PLATFORM_MAPPING[platform]}-` + - `${version}.${PLATFORM_EXTENSION}`; - -// Print out the addon tarball name so that it can be used in bash script when -// uploading the tarball to GCP bucket. -console.log(addonName); - -module.exports = { - addonName: addonName -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js deleted file mode 100644 index 17352d547..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js +++ /dev/null @@ -1,207 +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. - * ============================================================================= - */ - -const fs = require('fs'); -let path = require('path'); -const rimraf = require('rimraf'); -const util = require('util'); -const cp = require('child_process'); -const os = require('os'); -const { - depsPath, - depsLibPath, - depsLibTensorFlowPath, - LIBTENSORFLOW_VERSION, - PLATFORM_MAPPING, - ARCH_MAPPING, - PLATFORM_EXTENSION, - ALL_SUPPORTED_COMBINATION, - modulePath, - customTFLibUri, - customAddon -} = require('./deps-constants.js'); -const resources = require('./resources'); -const {addonName} = require('./get-addon-name.js'); - -const exists = util.promisify(fs.exists); -const mkdir = util.promisify(fs.mkdir); -const rename = util.promisify(fs.rename); -const rimrafPromise = util.promisify(rimraf); - -const CDN_STORAGE = process.env.TFJS_NODE_CDN_STORAGE || process.env.npm_config_TFJS_NODE_CDN_STORAGE - || process.env.CDN_STORAGE; -const BASE_HOST = CDN_STORAGE || 'https://storage.googleapis.com/'; -const BASE_URI = process.env.TFJS_NODE_BASE_URI || process.env.npm_config_TFJS_NODE_BASE_URI - || `${BASE_HOST}tensorflow/libtensorflow/libtensorflow-`; - -const platform = os.platform(); -// Use windows path -if (platform === 'win32') { - path = path.win32; -} -let libType = process.argv[2] === undefined ? 'cpu' : process.argv[2]; -let system = `${libType}-${PLATFORM_MAPPING[platform]}-` + - `${ARCH_MAPPING[os.arch()]}`; -let forceDownload = process.argv[3] === undefined ? undefined : process.argv[3]; - -let packageJsonFile; - -function setPackageJsonFile() { - packageJsonFile = - JSON.parse(fs.readFileSync(`${__dirname}/../package.json`).toString()); -} - -function updateAddonName() { - if (customAddon !== undefined) { - Object.assign(packageJsonFile['binary'], customAddon); - } else { - packageJsonFile['binary']['package_name'] = addonName; - } - const stringFile = JSON.stringify(packageJsonFile, null, 2); - fs.writeFileSync((`${__dirname}/../package.json`), stringFile); -} - -function revertAddonName(orig) { - packageJsonFile['binary'] = orig; - const stringFile = JSON.stringify(packageJsonFile, null, 2).concat('\n'); - fs.writeFileSync((`${__dirname}/../package.json`), stringFile); -} - -/** - * Returns the libtensorflow hosted path of the current platform. - */ -function getPlatformLibtensorflowUri() { - // Exception for mac+gpu user - if (platform === 'darwin') { - system = `cpu-${PLATFORM_MAPPING[platform]}-${ARCH_MAPPING[os.arch()]}`; - } - - if (customTFLibUri !== undefined) { - return customTFLibUri; - } - - if (platform === 'linux' && os.arch() === 'arm') { - return `${BASE_HOST}tf-builds/libtensorflow_r1_14_linux_arm.tar.gz`; - } - - if (ALL_SUPPORTED_COMBINATION.indexOf(system) === -1) { - throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`); - } - - return `${BASE_URI}${system}-${LIBTENSORFLOW_VERSION}.${PLATFORM_EXTENSION}`; -} - -/** - * Ensures a directory exists, creates as needed. - */ -async function ensureDir(dirPath) { - if (!await exists(dirPath)) { - await mkdir(dirPath); - } -} - -/** - * Deletes the deps directory if it exists, and creates a fresh deps folder. - */ -async function cleanDeps() { - if (await exists(depsPath)) { - await rimrafPromise(depsPath); - } - await mkdir(depsPath); -} - -/** - * Downloads libtensorflow and notifies via a callback when unpacked. - */ -async function downloadLibtensorflow(callback) { - // Ensure dependencies staged directory is available: - await ensureDir(depsPath); - - console.warn('* Downloading libtensorflow'); - resources.downloadAndUnpackResource( - getPlatformLibtensorflowUri(), depsPath, async () => { - if (platform === 'win32') { - // Some windows libtensorflow zip files are missing structure and the - // eager headers. Check, restructure, and download resources as - // needed. - if (!await exists(depsLibTensorFlowPath)) { - // Verify that tensorflow.dll exists - const libtensorflowDll = path.join(depsPath, 'tensorflow.dll'); - if (!await exists(libtensorflowDll)) { - throw new Error('Could not find libtensorflow.dll'); - } - - await ensureDir(depsLibPath); - await rename(libtensorflowDll, depsLibTensorFlowPath); - } - } - // No other work is required on other platforms. - if (callback !== undefined) { - callback(); - } - }); -} - -/** - * Calls node-gyp for Node.js Tensorflow binding after lib is downloaded. - */ -async function build() { - // Load package.json file - setPackageJsonFile(); - // Update addon name in package.json file - const origBinary = JSON.parse(JSON.stringify(packageJsonFile['binary'])); - updateAddonName(); - console.error('* Building TensorFlow Node.js bindings'); - let buildOption = '--fallback-to-build'; - if (customTFLibUri !== undefined && customAddon === undefined) { - // Has custom tensorflow shared libs but no addon. Then build it from source - buildOption = '--build-from-source'; - } - cp.exec(`node-pre-gyp install ${buildOption}`, (err) => { - if (err) { - console.log('node-pre-gyp install failed with error: ' + err); - process.exit(1); - } - if (platform === 'win32') { - // Move libtensorflow to module path, where tfjs_binding.node locates. - cp.exec('node scripts/deps-stage.js symlink ' + modulePath, (error) => { - if (error) { - console.error('symlink ' + modulePath + ' failed: ', error); - process.exit(1); - } - }); - } - revertAddonName(origBinary); - }); -} - -/** - * Ensures libtensorflow requirements are met for building the binding. - */ -async function run() { - // First check if deps library exists: - if (forceDownload !== 'download' && await exists(depsLibTensorFlowPath)) { - // Library has already been downloaded, then compile and simlink: - await build(); - } else { - // Library has not been downloaded, download, then compile and symlink: - await cleanDeps(); - await downloadLibtensorflow(build); - } -} - -run(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js deleted file mode 100644 index 0447d63cd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js +++ /dev/null @@ -1,9 +0,0 @@ -// This file generate and print out the full path of the pre-compiled addon in -// GCP bucket. It is used by bash script when uploading pre-compiled addon to -// GCP bucket. -console.log( - require('../package.json').binary.host.split('.com/')[1] + - '/napi-v' + - process.versions.napi + - '/' + - require('../package.json').version + '/'); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh deleted file mode 100755 index b621ab347..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 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. -# ============================================================================= - -# Before you run this script, do this: -# 1) Update the version in package.json -# 2) Run ./scripts/make-version from the base dir of the project. -# 3) Run `yarn` to update `yarn.lock`, in case you updated dependencies -# 4) Commit to the master branch. - -# Then: -# 5) Checkout the master branch of this repo. -# 6) Run this script as `./scripts/publish-npm-gpu.sh` from the project base dir. - -set -e - -BRANCH=`git rev-parse --abbrev-ref HEAD` -ORIGIN=`git config --get remote.origin.url` - -if [ "$BRANCH" != "master" ] && [ "$BRANCH" != "0.3.x" ]; then - echo "Error: Switch to the master or a release branch before publishing." - exit -fi - -if ! [[ "$ORIGIN" =~ tensorflow/tfjs-node ]]; then - echo "Error: Switch to the main repo (tensorflow/tfjs-node) before publishing." - exit -fi - -./scripts/make-version # This is for safety in case you forgot to do 2). -yarn build-npm-gpu upload - -GPU_TARBALLS=$(ls tensorflow-tfjs-node-gpu*.tgz) -GPU_TARBALL_COUNT=$(echo $GPU_TARBALLS | wc -w | xargs) -if [ "$GPU_TARBALL_COUNT" != "1" ]; then - echo "Error: Please make sure there is exactly one GPU tarball, found:" - echo $GPU_TARBALLS - exit -fi - -# Publish the GPU package -npm publish $GPU_TARBALLS - -# Cleanup -git checkout . - -echo 'Yay! Published the tfjs-node-gpu package to npm.' diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js deleted file mode 100644 index 817486335..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js +++ /dev/null @@ -1,93 +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. - * ============================================================================= - */ - -const fs = require('fs'); -const https = require('https'); -const HttpsProxyAgent = require('https-proxy-agent'); -const path = require('os').platform() === 'win32' ? require('path') : - require('path').win32; -const ProgressBar = require('progress'); -const tar = require('tar'); -const url = require('url'); -const util = require('util'); -const zip = require('adm-zip'); - -const unlink = util.promisify(fs.unlink); - -/** - * Downloads and unpacks a given tarball or zip file at a given path. - * @param {string} uri The path of the compressed file to download and extract. - * @param {string} destPath The destination path for the compressed content. - * @param {Function} callback Handler for when downloading and extraction is - * complete. - */ -async function downloadAndUnpackResource(uri, destPath, callback) { - // If HTTPS_PROXY, https_proxy, HTTP_PROXY, or http_proxy is set - const proxy = process.env['HTTPS_PROXY'] || process.env['https_proxy'] || - process.env['HTTP_PROXY'] || process.env['http_proxy'] || ''; - - // Using object destructuring to construct the options object for the - // http request. the '...url.parse(targetUri)' part fills in the host, - // path, protocol, etc from the targetUri and then we set the agent to the - // default agent which is overridden a few lines down if there is a proxy - const options = {...url.parse(uri), agent: https.globalAgent}; - - if (proxy !== '') { - options.agent = new HttpsProxyAgent(proxy); - } - - const request = https.get(options, response => { - const bar = new ProgressBar('[:bar] :rate/bps :percent :etas', { - complete: '=', - incomplete: ' ', - width: 30, - total: parseInt(response.headers['content-length'], 10) - }); - - if (uri.endsWith('.zip')) { - // Save zip file to disk, extract, and delete the downloaded zip file. - const tempFileName = path.join(__dirname, '_tmp.zip'); - const outputFile = fs.createWriteStream(tempFileName); - - response.on('data', chunk => bar.tick(chunk.length)) - .pipe(outputFile) - .on('close', async () => { - const zipFile = new zip(tempFileName); - zipFile.extractAllTo(destPath, true /* overwrite */); - - await unlink(tempFileName); - - if (callback !== undefined) { - callback(); - } - }); - } else if (uri.endsWith('.tar.gz')) { - response.on('data', chunk => bar.tick(chunk.length)) - .pipe(tar.x({C: destPath, strict: true})) - .on('close', () => { - if (callback !== undefined) { - callback(); - } - }); - } else { - throw new Error(`Unsupported packed resource: ${uri}`); - } - }); - request.end(); -} - -module.exports = {downloadAndUnpackResource}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json deleted file mode 100644 index c5e8c9340..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tsconfig.test", - "compilerOptions": { - "module": "commonjs" - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts deleted file mode 100644 index 532681568..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts +++ /dev/null @@ -1,325 +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 {CustomCallback, Logs, nextFrame, util} from '@tensorflow/tfjs'; -import * as path from 'path'; -import * as ProgressBar from 'progress'; - -import {summaryFileWriter, SummaryFileWriter} from './tensorboard'; - -// A helper class created for testing with the jasmine `spyOn` method, which -// operates only on member methods of objects. -// tslint:disable-next-line:no-any -export const progressBarHelper: {ProgressBar: any, log: Function} = { - ProgressBar, - log: console.log -}; - -/** - * Terminal-based progress bar callback for tf.Model.fit(). - */ -export class ProgbarLogger extends CustomCallback { - private numTrainBatchesPerEpoch: number; - private progressBar: ProgressBar; - private currentEpochBegin: number; - private epochDurationMillis: number; - private usPerStep: number; - private batchesInLatestEpoch: number; - - private terminalWidth: number; - - private readonly RENDER_THROTTLE_MS = 50; - - /** - * Construtor of LoggingCallback. - */ - constructor() { - super({ - onTrainBegin: async (logs?: Logs) => { - const samples = this.params.samples as number; - const batchSize = this.params.batchSize as number; - const steps = this.params.steps as number; - if (samples != null || steps != null) { - this.numTrainBatchesPerEpoch = - samples != null ? Math.ceil(samples / batchSize) : steps; - } else { - // Undetermined number of batches per epoch, e.g., due to - // `fitDataset()` without `batchesPerEpoch`. - this.numTrainBatchesPerEpoch = 0; - } - }, - onEpochBegin: async (epoch: number, logs?: Logs) => { - progressBarHelper.log(`Epoch ${epoch + 1} / ${this.params.epochs}`); - this.currentEpochBegin = util.now(); - this.epochDurationMillis = null; - this.usPerStep = null; - this.batchesInLatestEpoch = 0; - this.terminalWidth = process.stderr.columns; - }, - onBatchEnd: async (batch: number, logs?: Logs) => { - this.batchesInLatestEpoch++; - if (batch === 0) { - this.progressBar = new progressBarHelper.ProgressBar( - 'eta=:eta :bar :placeholderForLossesAndMetrics', { - width: Math.floor(0.5 * this.terminalWidth), - total: this.numTrainBatchesPerEpoch + 1, - head: `>`, - renderThrottle: this.RENDER_THROTTLE_MS - }); - } - const maxMetricsStringLength = - Math.floor(this.terminalWidth * 0.5 - 12); - const tickTokens = { - placeholderForLossesAndMetrics: - this.formatLogsAsMetricsContent(logs, maxMetricsStringLength) - }; - if (this.numTrainBatchesPerEpoch === 0) { - // Undetermined number of batches per epoch. - this.progressBar.tick(0, tickTokens); - } else { - this.progressBar.tick(tickTokens); - } - await nextFrame(); - if (batch === this.numTrainBatchesPerEpoch - 1) { - this.epochDurationMillis = util.now() - this.currentEpochBegin; - this.usPerStep = this.params.samples != null ? - this.epochDurationMillis / (this.params.samples as number) * 1e3 : - this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; - } - }, - onEpochEnd: async (epoch: number, logs?: Logs) => { - if (this.epochDurationMillis == null) { - // In cases where the number of batches per epoch is not determined, - // the calculation of the per-step duration is done at the end of the - // epoch. N.B., this includes the time spent on validation. - this.epochDurationMillis = util.now() - this.currentEpochBegin; - this.usPerStep = - this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; - } - this.progressBar.tick({placeholderForLossesAndMetrics: ''}); - const lossesAndMetricsString = this.formatLogsAsMetricsContent(logs); - progressBarHelper.log( - `${this.epochDurationMillis.toFixed(0)}ms ` + - `${this.usPerStep.toFixed(0)}us/step - ` + - `${lossesAndMetricsString}`); - await nextFrame(); - }, - }); - } - - private formatLogsAsMetricsContent(logs: Logs, maxMetricsLength?: number): - string { - let metricsContent = ''; - const keys = Object.keys(logs).sort(); - for (const key of keys) { - if (this.isFieldRelevant(key)) { - const value = logs[key]; - metricsContent += `${key}=${getSuccinctNumberDisplay(value)} `; - } - } - - if (maxMetricsLength != null && metricsContent.length > maxMetricsLength) { - // Cut off metrics strings that are too long to avoid new lines being - // constantly created. - metricsContent = metricsContent.slice(0, maxMetricsLength - 3) + '...'; - } - return metricsContent; - } - - private isFieldRelevant(key: string) { - return key !== 'batch' && key !== 'size'; - } -} - -const BASE_NUM_DIGITS = 2; -const MAX_NUM_DECIMAL_PLACES = 4; - -/** - * Get a succint string representation of a number. - * - * Uses decimal notation if the number isn't too small. - * Otherwise, use engineering notation. - * - * @param x Input number. - * @return Succinct string representing `x`. - */ -export function getSuccinctNumberDisplay(x: number): string { - const decimalPlaces = getDisplayDecimalPlaces(x); - return decimalPlaces > MAX_NUM_DECIMAL_PLACES ? - x.toExponential(BASE_NUM_DIGITS) : - x.toFixed(decimalPlaces); -} - -/** - * Determine the number of decimal places to display. - * - * @param x Number to display. - * @return Number of decimal places to display for `x`. - */ -export function getDisplayDecimalPlaces(x: number): number { - if (!Number.isFinite(x) || x === 0 || x > 1 || x < -1) { - return BASE_NUM_DIGITS; - } else { - return BASE_NUM_DIGITS - Math.floor(Math.log10(Math.abs(x))); - } -} - -export interface TensorBoardCallbackArgs { - /** - * The frequency at which loss and metric values are written to logs. - * - * Currently supported options are: - * - * - 'batch': Write logs at the end of every batch of training, in addition - * to the end of every epoch of training. - * - 'epoch': Write logs at the end of every epoch of training. - * - * Note that writing logs too often slows down the training. - * - * Default: 'epoch'. - */ - updateFreq?: 'batch'|'epoch'; -} - -/** - * Callback for logging to TensorBoard during training. - * - * Users are expected to access this class through the `tensorBoardCallback()` - * factory method instead. - */ -export class TensorBoardCallback extends CustomCallback { - private trainWriter: SummaryFileWriter; - private valWriter: SummaryFileWriter; - private batchesSeen: number; - private readonly args: TensorBoardCallbackArgs; - - constructor(readonly logdir = './logs', args?: TensorBoardCallbackArgs) { - super({ - onBatchEnd: async (batch: number, logs?: Logs) => { - this.batchesSeen++; - if (this.args.updateFreq !== 'epoch') { - this.logMetrics(logs, 'batch_', this.batchesSeen); - } - }, - onEpochEnd: async (epoch: number, logs?: Logs) => { - this.logMetrics(logs, 'epoch_', epoch + 1); - }, - onTrainEnd: async (logs?: Logs) => { - if (this.trainWriter != null) { - this.trainWriter.flush(); - } - if (this.valWriter != null) { - this.valWriter.flush(); - } - } - }); - - this.args = args == null ? {} : args; - if (this.args.updateFreq == null) { - this.args.updateFreq = 'epoch'; - } - util.assert( - ['batch', 'epoch'].indexOf(this.args.updateFreq) !== -1, - () => `Expected updateFreq to be 'batch' or 'epoch', but got ` + - `${this.args.updateFreq}`); - this.batchesSeen = 0; - } - - private logMetrics(logs: Logs, prefix: string, step: number) { - for (const key in logs) { - if (key === 'batch' || key === 'size' || key === 'num_steps') { - continue; - } - - const VAL_PREFIX = 'val_'; - if (key.startsWith(VAL_PREFIX)) { - this.ensureValWriterCreated(); - const scalarName = prefix + key.slice(VAL_PREFIX.length); - this.valWriter.scalar(scalarName, logs[key], step); - } else { - this.ensureTrainWriterCreated(); - this.trainWriter.scalar(`${prefix}${key}`, logs[key], step); - } - } - } - - private ensureTrainWriterCreated() { - this.trainWriter = summaryFileWriter(path.join(this.logdir, 'train')); - } - - private ensureValWriterCreated() { - this.valWriter = summaryFileWriter(path.join(this.logdir, 'val')); - } -} - -/** - * Callback for logging to TensorBoard during training. - * - * Writes the loss and metric values (if any) to the specified log directory - * (`logdir`) which can be ingested and visualized by TensorBoard. - * This callback is usually passed as a callback to `tf.Model.fit()` or - * `tf.Model.fitDataset()` calls during model training. The frequency at which - * the values are logged can be controlled with the `updateFreq` field of the - * configuration object (2nd argument). - * - * Usage example: - * ```js - * // Constructor a toy multilayer-perceptron regressor for demo purpose. - * const model = tf.sequential(); - * model.add( - * tf.layers.dense({units: 100, activation: 'relu', inputShape: [200]})); - * model.add(tf.layers.dense({units: 1})); - * model.compile({ - * loss: 'meanSquaredError', - * optimizer: 'sgd', - * metrics: ['MAE'] - * }); - * - * // Generate some random fake data for demo purpose. - * const xs = tf.randomUniform([10000, 200]); - * const ys = tf.randomUniform([10000, 1]); - * const valXs = tf.randomUniform([1000, 200]); - * const valYs = tf.randomUniform([1000, 1]); - * - * // Start model training process. - * await model.fit(xs, ys, { - * epochs: 100, - * validationData: [valXs, valYs], - * // Add the tensorBoard callback here. - * callbacks: tf.node.tensorBoard('/tmp/fit_logs_1') - * }); - * ``` - * - * Then you can use the following commands to point tensorboard - * to the logdir: - * - * ```sh - * pip install tensorboard # Unless you've already installed it. - * tensorboard --logdir /tmp/fit_logs_1 - * ``` - * - * @param logdir Directory to which the logs will be written. - * @param args Optional configuration arguments. - * @returns An instance of `TensorBoardCallback`, which is a subclass of - * `tf.CustomCallback`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -export function tensorBoard( - logdir = './logs', args?: TensorBoardCallbackArgs): TensorBoardCallback { - return new TensorBoardCallback(logdir, args); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts deleted file mode 100644 index 2d40ece62..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts +++ /dev/null @@ -1,299 +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 {Tensor, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs'; -import {ensureTensorflowBackend, nodeBackend} from './nodejs_kernel_backend'; - -export enum ImageType { - JPEG = 'jpeg', - PNG = 'png', - GIF = 'gif', - BMP = 'BMP' -} - -/** - * Decode a JPEG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The JPEG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the JPEG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * @param ratio An optional int. Defaults to 1. Downscaling ratio. It is used - * when image is type Jpeg. - * @param fancyUpscaling An optional bool. Defaults to True. If true use a - * slower but nicer upscaling of the chroma planes. It is used when image is - * type Jpeg. - * @param tryRecoverTruncated An optional bool. Defaults to False. If true try - * to recover an image from truncated input. It is used when image is type - * Jpeg. - * @param acceptableFraction An optional float. Defaults to 1. The minimum - * required fraction of lines before a truncated input is accepted. It is - * used when image is type Jpeg. - * @param dctMethod An optional string. Defaults to "". string specifying a hint - * about the algorithm used for decompression. Defaults to "" which maps to - * a system-specific default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg - * library changes to a version that does not have that specific option.) It - * is used when image is type Jpeg. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export function decodeJpeg( - contents: Uint8Array, channels = 0, ratio = 1, fancyUpscaling = true, - tryRecoverTruncated = false, acceptableFraction = 1, - dctMethod = ''): Tensor3D { - ensureTensorflowBackend(); - return tidy(() => { - return nodeBackend() - .decodeJpeg( - contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, - acceptableFraction, dctMethod) - .toInt(); - }); -} - -/** - * Decode a PNG-encoded image to a 3D Tensor of dtype `int32`. - * - * @param contents The PNG-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the PNG-encoded image. - * 1: output a grayscale image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export function decodePng( - contents: Uint8Array, channels = 0, dtype = 'int32'): Tensor3D { - util.assert( - dtype === 'int32', - () => 'decodeImage could only return Tensor of type `int32` for now.'); - ensureTensorflowBackend(); - return tidy(() => { - return nodeBackend().decodePng(contents, channels).toInt(); - }); -} - -/** - * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype - * `int32`. - * - * @param contents The BMP-encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0. Accepted values are - * 0: use the number of channels in the BMP-encoded image. - * 3: output an RGB image. - * 4: output an RGBA image. - * @returns A 3D Tensor of dtype `int32` with shape [height, width, 3/4]. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export function decodeBmp(contents: Uint8Array, channels = 0): Tensor3D { - ensureTensorflowBackend(); - return tidy(() => { - return nodeBackend().decodeBmp(contents, channels).toInt(); - }); -} - -/** - * Decode the frame(s) of a GIF-encoded image to a 4D Tensor of dtype `int32`. - * - * @param contents The GIF-encoded image in an Uint8Array. - * @returns A 4D Tensor of dtype `int32` with shape [num_frames, height, width, - * 3]. RGB channel order. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export function decodeGif(contents: Uint8Array): Tensor4D { - ensureTensorflowBackend(); - return tidy(() => { - return nodeBackend().decodeGif(contents).toInt(); - }); -} - -/** - * Given the encoded bytes of an image, it returns a 3D or 4D tensor of the - * decoded image. Supports BMP, GIF, JPEG and PNG formats. - * - * @param content The encoded image in an Uint8Array. - * @param channels An optional int. Defaults to 0, use the number of channels in - * the image. Number of color channels for the decoded image. It is used - * when image is type Png, Bmp, or Jpeg. - * @param dtype The data type of the result. Only `int32` is supported at this - * time. - * @param expandAnimations A boolean which controls the shape of the returned - * op's output. If True, the returned op will produce a 3-D tensor for PNG, - * JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or - * not. If, False, the returned op will produce a 3-D tensor for all file - * types and will truncate animated GIFs to the first frame. - * @returns A Tensor with dtype `int32` and a 3- or 4-dimensional shape, - * depending on the file type. For gif file the returned Tensor shape is - * [num_frames, height, width, 3], and for jpeg/png/bmp the returned Tensor - * shape is [height, width, channels] - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export function decodeImage( - content: Uint8Array, channels = 0, dtype = 'int32', - expandAnimations = true): Tensor3D|Tensor4D { - util.assert( - dtype === 'int32', - () => 'decodeImage could only return Tensor of type `int32` for now.'); - - const imageType = getImageType(content); - - // The return tensor has dtype uint8, which is not supported in - // TensorFlow.js, casting it to int32 which is the default dtype for image - // tensor. If the image is BMP, JPEG or PNG type, expanding the tensors - // shape so it becomes Tensor4D, which is the default tensor shape for image - // ([batch,imageHeight,imageWidth, depth]). - switch (imageType) { - case ImageType.JPEG: - return decodeJpeg(content, channels); - case ImageType.PNG: - return decodePng(content, channels); - case ImageType.GIF: - // If not to expand animations, take first frame of the gif and return - // as a 3D tensor. - return tidy(() => { - const img = decodeGif(content); - return expandAnimations ? img : img.slice(0, 1).squeeze([0]); - }); - case ImageType.BMP: - return decodeBmp(content, channels); - default: - return null; - } -} - -/** - * Encodes an image tensor to JPEG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param format An optional string from: "", "grayscale", "rgb". - * Defaults to "". Per pixel image format. - * - '': Use a default format based on the number of channels in the image. - * - grayscale: Output a grayscale JPEG image. The channels dimension of - * image must be 1. - * - rgb: Output an RGB JPEG image. The channels dimension of image must - * be 3. - * @param quality An optional int. Defaults to 95. Quality of the compression - * from 0 to 100 (higher is better and slower). - * @param progressive An optional bool. Defaults to False. If True, create a - * JPEG that loads progressively (coarse to fine). - * @param optimizeSize An optional bool. Defaults to False. If True, spend - * CPU/RAM to reduce size with no quality change. - * @param chromaDownsampling An optional bool. Defaults to True. - * See http://en.wikipedia.org/wiki/Chroma_subsampling. - * @param densityUnit An optional string from: "in", "cm". Defaults to "in". - * Unit used to specify x_density and y_density: pixels per inch ('in') or - * centimeter ('cm'). - * @param xDensity An optional int. Defaults to 300. Horizontal pixels per - * density unit. - * @param yDensity An optional int. Defaults to 300. Vertical pixels per - * density unit. - * @param xmpMetadata An optional string. Defaults to "". If not empty, embed - * this XMP metadata in the image header. - * @returns The JPEG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export async function encodeJpeg( - image: Tensor3D, format: ''|'grayscale'|'rgb' = '', quality = 95, - progressive = false, optimizeSize = false, chromaDownsampling = true, - densityUnit: 'in'|'cm' = 'in', xDensity = 300, yDensity = 300, - xmpMetadata = ''): Promise { - ensureTensorflowBackend(); - - const backendEncodeImage = (imageData: Uint8Array) => - nodeBackend().encodeJpeg( - imageData, image.shape, format, quality, progressive, optimizeSize, - chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata); - - return encodeImage(image, backendEncodeImage); -} - -/** - * Encodes an image tensor to PNG. - * - * @param image A 3-D uint8 Tensor of shape [height, width, channels]. - * @param compression An optional int. Defaults to 1. Compression level. - * @returns The PNG encoded data as an Uint8Array. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} - */ -export async function encodePng( - image: Tensor3D, compression = 1): Promise { - ensureTensorflowBackend(); - - const backendEncodeImage = (imageData: Uint8Array) => - nodeBackend().encodePng(imageData, image.shape, compression); - return encodeImage(image, backendEncodeImage); -} - -async function encodeImage( - image: Tensor3D, backendEncodeImage: (imageData: Uint8Array) => Tensor): - Promise { - const encodedDataTensor = - backendEncodeImage(new Uint8Array(await image.data())); - - const encodedPngData = - ( - // tslint:disable-next-line:no-any - await encodedDataTensor.data())[0] as any as Uint8Array; - encodedDataTensor.dispose(); - return encodedPngData; -} - -/** - * Helper function to get image type based on starting bytes of the image file. - */ -export function getImageType(content: Uint8Array): string { - // Classify the contents of a file based on starting bytes (aka magic number: - // https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) - // This aligns with TensorFlow Core code: - // https://github.com/tensorflow/tensorflow/blob/4213d5c1bd921f8d5b7b2dc4bbf1eea78d0b5258/tensorflow/core/kernels/decode_image_op.cc#L44 - if (content.length > 3 && content[0] === 255 && content[1] === 216 && - content[2] === 255) { - // JPEG byte chunk starts with `ff d8 ff` - return ImageType.JPEG; - } else if ( - content.length > 4 && content[0] === 71 && content[1] === 73 && - content[2] === 70 && content[3] === 56) { - // GIF byte chunk starts with `47 49 46 38` - return ImageType.GIF; - } else if ( - content.length > 8 && content[0] === 137 && content[1] === 80 && - content[2] === 78 && content[3] === 71 && content[4] === 13 && - content[5] === 10 && content[6] === 26 && content[7] === 10) { - // PNG byte chunk starts with `\211 P N G \r \n \032 \n (89 50 4E 47 0D 0A - // 1A 0A)` - return ImageType.PNG; - } else if (content.length > 3 && content[0] === 66 && content[1] === 77) { - // BMP byte chunk starts with `42 4d` - return ImageType.BMP; - } else { - throw new Error( - 'Expected image (BMP, JPEG, PNG, or GIF), but got unsupported ' + - 'image type'); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts deleted file mode 100644 index 9756a5a7b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts +++ /dev/null @@ -1,86 +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. - * ============================================================================= - */ - -// Register all kernels. -import './register_all_kernels'; - -import * as tf from '@tensorflow/tfjs'; -import * as path from 'path'; - -import {ProgbarLogger} from './callbacks'; -import {nodeFileSystemRouter} from './io/file_system'; -import * as nodeIo from './io/index'; -import {NodeJSKernelBackend} from './nodejs_kernel_backend'; -import {TFJSBinding} from './tfjs_binding'; -import * as nodeVersion from './version'; - -// tslint:disable-next-line:no-require-imports -const binary = require('node-pre-gyp'); -const bindingPath = - binary.find(path.resolve(path.join(__dirname, '/../package.json'))); - -// Check if the node native addon module exists. -// tslint:disable-next-line:no-require-imports -const fs = require('fs'); -if (!fs.existsSync(bindingPath)) { - throw new Error( - `The Node.js native addon module (tfjs_binding.node) can not ` + - `be found at path: ` + String(bindingPath) + `. \nPlease run command ` + - `'npm rebuild @tensorflow/tfjs-node`+ - (String(bindingPath).indexOf('tfjs-node-gpu') > 0 ? `-gpu` : ``) + - ` --build-addon-from-source' to ` + - `rebuild the native addon module. \nIf you have problem with building ` + - `the addon module, please check ` + - `https://github.com/tensorflow/tfjs/blob/master/tfjs-node/` + - `WINDOWS_TROUBLESHOOTING.md or file an issue.`); -} -// tslint:disable-next-line:no-require-imports -const bindings = require(bindingPath); - -// Merge version and io namespaces. -export const version = { - ...tf.version, - 'tfjs-node': nodeVersion.version -}; -export const io = { - ...tf.io, - ...nodeIo -}; - -// Export all union package symbols -export * from '@tensorflow/tfjs'; -export * from './node'; - -// tslint:disable-next-line:no-require-imports -const pjson = require('../package.json'); - -// Side effects for default initialization of Node backend. -tf.registerBackend('tensorflow', () => { - return new NodeJSKernelBackend(bindings as TFJSBinding, pjson.name); -}, 3 /* priority */); - -const success = tf.setBackend('tensorflow'); -if (!success) { - throw new Error(`Could not initialize TensorFlow backend.`); -} - -// Register the model saving and loading handlers for the 'file://' URL scheme. -tf.io.registerLoadRouter(nodeFileSystemRouter); -tf.io.registerSaveRouter(nodeFileSystemRouter); - -// Register the ProgbarLogger for Model.fit() at verbosity level 1. -tf.registerCallbackConstructor(1, ProgbarLogger); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts deleted file mode 100644 index 406d9ccbd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts +++ /dev/null @@ -1,102 +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 {Shape, util} from '@tensorflow/tfjs'; -import {endianness} from 'os'; - -const INT32_MAX = 2147483648; - -/** - * Node.js-specific tensor type: int64-type scalar. - * - * This class is created for a specific purpose: to support - * writing `step`s to TensorBoard via op-kernel bindings. - * `step` is required to have an int64 dtype, but TensorFlow.js - * (tfjs-core) doesn't have a built-in int64 dtype. This is - * related to a lack of `Int64Array` or `Uint64Array` typed - * array in basic JavaScript. - * - * This class is introduced as a workaround. - */ -export class Int64Scalar { - readonly dtype: string = 'int64'; - readonly rank: number = 1; - private valueArray_: Int32Array; - - private static endiannessOkay_: boolean; - - constructor(readonly value: number) { - // The reason why we need to check endianness of the machine here is - // negative int64 values and the way in which we represent them - // using Int32Arrays in JavaScript. We represent each int64 value with - // two consecutive elements of an Int32Array. For positive values, - // the high part is simply zero; for negative values, the high part - // should be -1. The ordering of the low and high parts assumes - // little endian (i.e., least significant digits appear first). - // This assumption is checked by the lines below. - if (Int64Scalar.endiannessOkay_ == null) { - if (endianness() !== 'LE') { - throw new Error( - `Int64Scalar does not support endianness of this machine: ` + - `${endianness()}`); - } - Int64Scalar.endiannessOkay_ = true; - } - - util.assert( - value > -INT32_MAX && value < INT32_MAX - 1, - () => - `Got a value outside of the bound of values supported for int64 ` + - `dtype ([-${INT32_MAX}, ${INT32_MAX - 1}]): ${value}`); - util.assert( - Number.isInteger(value), - () => `Expected value to be an integer, but got ${value}`); - - // We use two int32 elements to represent a int64 value. This assumes - // little endian, which is checked above. - const highPart = value >= 0 ? 0 : -1; - const lowPart = value % INT32_MAX; - this.valueArray_ = new Int32Array([lowPart, highPart]); - } - - get shape(): Shape { - return []; - } - - /** Get the Int32Array that represents the int64 value. */ - get valueArray(): Int32Array { - return this.valueArray_; - } -} - -/** - * This method encodes a Int32Array as Int64 layout in order to create TF_INT64 - * tensor through binding. - */ -export function encodeInt32ArrayAsInt64(value: Int32Array): Int32Array { - if (endianness() !== 'LE') { - throw new Error( - `Int64Scalar does not support endianness of this machine: ` + - `${endianness()}`); - } - - const buffer = new Int32Array(value.length * 2); - for (let i = 0; i < value.length; i++) { - buffer[i * 2] = value[i]; - } - return buffer; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts deleted file mode 100644 index 4d2d33276..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts +++ /dev/null @@ -1,288 +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'; -import * as fs from 'fs'; -import {dirname, join, resolve} from 'path'; -import {promisify} from 'util'; - -import {getModelArtifactsInfoForJSON, toArrayBuffer} from './io_utils'; - -const stat = promisify(fs.stat); -const writeFile = promisify(fs.writeFile); -const readFile = promisify(fs.readFile); -const mkdir = promisify(fs.mkdir); - -function doesNotExistHandler(name: string): (e: NodeJS.ErrnoException) => - never { - return e => { - switch (e.code) { - case 'ENOENT': - throw new Error(`${name} ${e.path} does not exist: loading failed`); - default: - throw e; - } - }; -} - -export class NodeFileSystem implements tf.io.IOHandler { - static readonly URL_SCHEME = 'file://'; - - protected readonly path: string|string[]; - - readonly MODEL_JSON_FILENAME = 'model.json'; - readonly WEIGHTS_BINARY_FILENAME = 'weights.bin'; - readonly MODEL_BINARY_FILENAME = 'tensorflowjs.pb'; - - /** - * Constructor of the NodeFileSystem IOHandler. - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ - constructor(path: string|string[]) { - if (Array.isArray(path)) { - tf.util.assert( - path.length === 2, - () => 'file paths must have a length of 2, ' + - `(actual length is ${path.length}).`); - this.path = path.map(p => resolve(p)); - } else { - this.path = resolve(path); - } - } - - async save(modelArtifacts: tf.io.ModelArtifacts): Promise { - if (Array.isArray(this.path)) { - throw new Error('Cannot perform saving to multiple paths.'); - } - - await this.createOrVerifyDirectory(); - - if (modelArtifacts.modelTopology instanceof ArrayBuffer) { - throw new Error( - 'NodeFileSystem.save() does not support saving model topology ' + - 'in binary format yet.'); - // TODO(cais, nkreeger): Implement this. See - // https://github.com/tensorflow/tfjs/issues/343 - } else { - const weightsBinPath = join(this.path, this.WEIGHTS_BINARY_FILENAME); - const weightsManifest = [{ - paths: [this.WEIGHTS_BINARY_FILENAME], - weights: modelArtifacts.weightSpecs - }]; - const modelJSON: tf.io.ModelJSON = { - modelTopology: modelArtifacts.modelTopology, - weightsManifest, - format: modelArtifacts.format, - generatedBy: modelArtifacts.generatedBy, - convertedBy: modelArtifacts.convertedBy - }; - if (modelArtifacts.trainingConfig != null) { - modelJSON.trainingConfig = modelArtifacts.trainingConfig; - } - if (modelArtifacts.signature != null) { - modelJSON.signature = modelArtifacts.signature; - } - if (modelArtifacts.userDefinedMetadata != null) { - modelJSON.userDefinedMetadata = modelArtifacts.userDefinedMetadata; - } - const modelJSONPath = join(this.path, this.MODEL_JSON_FILENAME); - await writeFile(modelJSONPath, JSON.stringify(modelJSON), 'utf8'); - await writeFile( - weightsBinPath, Buffer.from(modelArtifacts.weightData), 'binary'); - - return { - // TODO(cais): Use explicit tf.io.ModelArtifactsInfo type below once it - // is available. - // tslint:disable-next-line:no-any - modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts) as any - }; - } - } - async load(): Promise { - return Array.isArray(this.path) ? this.loadBinaryModel() : - this.loadJSONModel(); - } - - protected async loadBinaryModel(): Promise { - const topologyPath = this.path[0]; - const weightManifestPath = this.path[1]; - const topology = - await stat(topologyPath).catch(doesNotExistHandler('Topology Path')); - const weightManifest = - await stat(weightManifestPath) - .catch(doesNotExistHandler('Weight Manifest Path')); - - // `this.path` can be either a directory or a file. If it is a file, assume - // it is model.json file. - if (!topology.isFile()) { - throw new Error('File specified for topology is not a file!'); - } - if (!weightManifest.isFile()) { - throw new Error('File specified for the weight manifest is not a file!'); - } - - const modelTopology = await readFile(this.path[0]); - const weightsManifest = JSON.parse(await readFile(this.path[1], 'utf8')); - - const modelArtifacts: tf.io.ModelArtifacts = { - modelTopology, - }; - const [weightSpecs, weightData] = - await this.loadWeights(weightsManifest, this.path[1]); - - modelArtifacts.weightSpecs = weightSpecs; - modelArtifacts.weightData = weightData; - - return modelArtifacts; - } - - protected async loadJSONModel(): Promise { - const path = this.path as string; - const info = await stat(path).catch(doesNotExistHandler('Path')); - - // `path` can be either a directory or a file. If it is a file, assume - // it is model.json file. - if (info.isFile()) { - const modelJSON = JSON.parse(await readFile(path, 'utf8')); - - const modelArtifacts: tf.io.ModelArtifacts = { - modelTopology: modelJSON.modelTopology, - format: modelJSON.format, - generatedBy: modelJSON.generatedBy, - convertedBy: modelJSON.convertedBy - }; - if (modelJSON.weightsManifest != null) { - const [weightSpecs, weightData] = - await this.loadWeights(modelJSON.weightsManifest, path); - modelArtifacts.weightSpecs = weightSpecs; - modelArtifacts.weightData = weightData; - } - if (modelJSON.trainingConfig != null) { - modelArtifacts.trainingConfig = modelJSON.trainingConfig; - } - if (modelJSON.signature != null) { - modelArtifacts.signature = modelJSON.signature; - } - if (modelJSON.userDefinedMetadata != null) { - modelArtifacts.userDefinedMetadata = modelJSON.userDefinedMetadata; - } - return modelArtifacts; - } else { - throw new Error( - 'The path to load from must be a file. Loading from a directory ' + - 'is not supported.'); - } - } - - private async loadWeights( - weightsManifest: tf.io.WeightsManifestConfig, - path: string): Promise<[tf.io.WeightsManifestEntry[], ArrayBuffer]> { - const dirName = dirname(path); - const buffers: Buffer[] = []; - const weightSpecs: tf.io.WeightsManifestEntry[] = []; - for (const group of weightsManifest) { - for (const path of group.paths) { - const weightFilePath = join(dirName, path); - const buffer = await readFile(weightFilePath) - .catch(doesNotExistHandler('Weight file')); - buffers.push(buffer); - } - weightSpecs.push(...group.weights); - } - return [weightSpecs, toArrayBuffer(buffers)]; - } - - /** - * For each item in `this.path`, creates a directory at the path or verify - * that the path exists as a directory. - */ - protected async createOrVerifyDirectory() { - const paths = Array.isArray(this.path) ? this.path : [this.path]; - for (const path of paths) { - try { - await mkdir(path); - } catch (e) { - if (e.code === 'EEXIST') { - if ((await stat(path)).isFile()) { - throw new Error( - `Path ${path} exists as a file. The path must be ` + - `nonexistent or point to a directory.`); - } - // else continue, the directory exists - } else { - throw e; - } - } - } - } -} - -export const nodeFileSystemRouter = (url: string|string[]) => { - if (Array.isArray(url)) { - if (url.every( - urlElement => urlElement.startsWith(NodeFileSystem.URL_SCHEME))) { - return new NodeFileSystem(url.map( - urlElement => urlElement.slice(NodeFileSystem.URL_SCHEME.length))); - } else { - return null; - } - } else { - if (url.startsWith(NodeFileSystem.URL_SCHEME)) { - return new NodeFileSystem(url.slice(NodeFileSystem.URL_SCHEME.length)); - } else { - return null; - } - } -}; -// Registration of `nodeFileSystemRouter` is done in index.ts. - -/** - * Factory function for Node.js native file system IO Handler. - * - * @param path A single path or an Array of paths. - * For saving: expects a single path pointing to an existing or nonexistent - * directory. If the directory does not exist, it will be - * created. - * For loading: - * - If the model has JSON topology (e.g., `tf.Model`), a single path - * pointing to the JSON file (usually named `model.json`) is expected. - * The JSON file is expected to contain `modelTopology` and/or - * `weightsManifest`. If `weightManifest` exists, the values of the - * weights will be loaded from relative paths (relative to the directory - * of `model.json`) as contained in `weightManifest`. - * - If the model has binary (protocol buffer GraphDef) topology, - * an Array of two paths is expected: the first path should point to the - * .pb file and the second path should point to the weight manifest - * JSON file. - */ -export function fileSystem(path: string|string[]): NodeFileSystem { - return new NodeFileSystem(path); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts deleted file mode 100644 index 019ea6a45..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts +++ /dev/null @@ -1,23 +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. - * ============================================================================= - */ - -/** - * Public exports from the `io` module. - */ - -export {fileSystem} from './file_system'; -export {nodeHTTPRequest} from './node_http'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts deleted file mode 100644 index 74582196e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts +++ /dev/null @@ -1,80 +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'; - -/** - * Convert an ArrayBuffer to a Buffer. - */ -export function toBuffer(ab: ArrayBuffer): Buffer { - const view = new Uint8Array(ab); - return Buffer.from(view); // copies data -} - -/** - * Convert a Buffer or an Array of Buffers to an ArrayBuffer. - * - * If the input is an Array of Buffers, they will be concatenated in the - * specified order to form the output ArrayBuffer. - */ -export function toArrayBuffer(buf: Buffer|Buffer[]): ArrayBuffer { - if (Array.isArray(buf)) { - // An Array of Buffers. - let totalLength = 0; - for (const buffer of buf) { - totalLength += buffer.length; - } - - const ab = new ArrayBuffer(totalLength); - const view = new Uint8Array(ab); - let pos = 0; - for (const buffer of buf) { - pos += buffer.copy(view, pos); - } - return ab; - } else { - // A single Buffer. Return a copy of the underlying ArrayBuffer slice. - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - } -} - -// TODO(cais): Use explicit tf.io.ModelArtifactsInfo return type below once it -// is available. -/** - * Populate ModelArtifactsInfo fields for a model with JSON topology. - * @param modelArtifacts - * @returns A ModelArtifactsInfo object. - */ -export function getModelArtifactsInfoForJSON( - modelArtifacts: tf.io.ModelArtifacts) { - if (modelArtifacts.modelTopology instanceof ArrayBuffer) { - throw new Error('Expected JSON model topology, received ArrayBuffer.'); - } - return { - dateSaved: new Date(), - modelTopologyType: 'JSON', - modelTopologyBytes: modelArtifacts.modelTopology == null ? - 0 : - Buffer.byteLength(JSON.stringify(modelArtifacts.modelTopology), 'utf8'), - weightSpecsBytes: modelArtifacts.weightSpecs == null ? - 0 : - Buffer.byteLength(JSON.stringify(modelArtifacts.weightSpecs), 'utf8'), - weightDataBytes: modelArtifacts.weightData == null ? - 0 : - modelArtifacts.weightData.byteLength, - }; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts deleted file mode 100644 index 5fef3dbdd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts +++ /dev/null @@ -1,45 +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 {io} from '@tensorflow/tfjs'; - -/** - * Factory function for HTTP IO Handler in Node.js. - * - * @param path URL path or an array of them. - * @param requestInit Request init for the HTTP IOHandler. May include fields - * such as "credentials" and "cache". (Optional) - * @param weightPathPrefix A path prefix for weight loading . (Optional). - */ -export function nodeHTTPRequest( - path: string, requestInit?: RequestInit, - weightPathPrefix?: string): io.IOHandler { - return io.browserHTTPRequest(path, {requestInit, weightPathPrefix}); -} - -export const nodeHTTPRequestRouter = (url: string) => { - let isHTTP = true; - if (Array.isArray(url)) { - isHTTP = url.every(urlItem => io.isHTTPScheme(urlItem)); - } else { - isHTTP = io.isHTTPScheme(url); - } - if (isHTTP) { - return nodeHTTPRequest(url); - } - return null; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts deleted file mode 100644 index 074618e4c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.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 {Abs, AbsInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const absConfig: KernelConfig = { - kernelName: Abs, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AbsInputs; - const backend = args.backend as NodeJSKernelBackend; - - if (x.dtype === 'complex64') { - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - createTensorsTypeOpAttr('Tout', 'float32') - ]; - return backend.executeSingleOutput('ComplexAbs', opAttrs, [x]); - } - return backend.executeSingleInput(Abs, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts deleted file mode 100644 index 6beea67e0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.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 {Acos, AcosInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const acosConfig: KernelConfig = { - kernelName: Acos, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AcosInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Acos, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts deleted file mode 100644 index 47de82f80..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.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 {Acosh, AcoshInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const acoshConfig: KernelConfig = { - kernelName: Acosh, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AcoshInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Acosh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts deleted file mode 100644 index d08ecf9e4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.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 {Add, AddInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const addConfig: KernelConfig = { - kernelName: Add, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {a, b} = args.inputs as AddInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [createTensorsTypeOpAttr( - 'T', backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(Add, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts deleted file mode 100644 index b628fb1c0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.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 {AddN, AddNInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const addNConfig: KernelConfig = { - kernelName: AddN, - backendName: 'tensorflow', - kernelFunc: (args) => { - const tensors = args.inputs as {} as AddNInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', tensors[0].dtype), - {name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length} - ]; - return backend.executeSingleOutput(AddN, opAttrs, tensors); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts deleted file mode 100644 index 69e19ed70..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.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 {All, AllAttrs, AllInputs, KernelConfig, tensor1d, util} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const allConfig: KernelConfig = { - kernelName: All, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AllInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis, keepDims} = args.attrs as {} as AllAttrs; - - const origAxes = util.parseAxisParam(axis, x.shape); - const opAttrs = [ - {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, - createTensorsTypeOpAttr('Tidx', 'int32') - ]; - const axesTensor = tensor1d(origAxes, 'int32'); - const res = backend.executeSingleOutput(All, opAttrs, [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts deleted file mode 100644 index ec59359ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.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 {Any, AnyAttrs, AnyInputs, KernelConfig, tensor1d, util} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const anyConfig: KernelConfig = { - kernelName: Any, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AnyInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis, keepDims} = args.attrs as {} as AnyAttrs; - - const origAxes = util.parseAxisParam(axis, x.shape); - const opAttrs = [ - {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, - createTensorsTypeOpAttr('Tidx', 'int32') - ]; - const axesTensor = tensor1d(origAxes, 'int32'); - const res = backend.executeSingleOutput(Any, opAttrs, [x, axesTensor]); - axesTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts deleted file mode 100644 index 1ab79a295..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts +++ /dev/null @@ -1,49 +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, ArgMaxAttrs, ArgMaxInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const argMaxConfig: KernelConfig = { - kernelName: ArgMax, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as ArgMaxInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis} = args.attrs as {} as ArgMaxAttrs; - - const toDispose: Tensor[] = []; - let xInput = x; - if (x.dtype === 'bool') { - xInput = (x as Tensor).toInt(); - toDispose.push(xInput as Tensor); - } - const axisScalar = scalar(axis, 'int32'); - toDispose.push(axisScalar); - const opAttrs = [ - createTensorsTypeOpAttr('T', xInput.dtype), - createTensorsTypeOpAttr('Tidx', 'int32'), - createTensorsTypeOpAttr('output_type', 'int32') - ]; - - const res = - backend.executeSingleOutput(ArgMax, opAttrs, [xInput, axisScalar]); - toDispose.forEach(t => t.dispose()); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts deleted file mode 100644 index 9c3aabf64..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts +++ /dev/null @@ -1,49 +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, ArgMinAttrs, ArgMinInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const argMinConfig: KernelConfig = { - kernelName: ArgMin, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as ArgMinInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis} = args.attrs as {} as ArgMinAttrs; - - const toDispose: Tensor[] = []; - let xInput = x; - if (x.dtype === 'bool') { - xInput = (x as Tensor).toInt(); - toDispose.push(xInput as Tensor); - } - const axisScalar = scalar(axis, 'int32'); - toDispose.push(axisScalar); - const opAttrs = [ - createTensorsTypeOpAttr('T', xInput.dtype), - createTensorsTypeOpAttr('Tidx', 'int32'), - createTensorsTypeOpAttr('output_type', 'int32') - ]; - - const res = - backend.executeSingleOutput(ArgMin, opAttrs, [xInput, axisScalar]); - toDispose.forEach(t => t.dispose()); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts deleted file mode 100644 index b8005fc2f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.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 {Asin, AsinInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const asinConfig: KernelConfig = { - kernelName: Asin, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AsinInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Asin, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts deleted file mode 100644 index 13a27901e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.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 {Asinh, AsinhInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const asinhConfig: KernelConfig = { - kernelName: Asinh, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AsinhInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Asinh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts deleted file mode 100644 index e1463c46d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.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 {Atan, AtanInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const atanConfig: KernelConfig = { - kernelName: Atan, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AtanInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Atan, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts deleted file mode 100644 index d5e19da47..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.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 {Atan2, Atan2Inputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const atan2Config: KernelConfig = { - kernelName: Atan2, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {a, b} = args.inputs as Atan2Inputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; - return backend.executeSingleOutput(Atan2, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts deleted file mode 100644 index d7a6c8188..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.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 {Atanh, AtanhInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const atanhConfig: KernelConfig = { - kernelName: Atanh, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AtanhInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Atanh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts deleted file mode 100644 index 3a76b92da..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts +++ /dev/null @@ -1,57 +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, AvgPoolAttrs, AvgPoolInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const avgPoolConfig: KernelConfig = { - kernelName: AvgPool, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AvgPoolInputs; - const backend = args.backend as NodeJSKernelBackend; - const {filterSize, strides, pad, dimRoundingMode} = - args.attrs as {} as AvgPoolAttrs; - - const convInfo = backend_util.computePool2DInfo( - x.shape as [number, number, number, number], filterSize, strides, - 1 /* dilations */, pad, dimRoundingMode); - - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - return backend.executeSingleOutput(AvgPool, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts deleted file mode 100644 index 6df0d06e3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts +++ /dev/null @@ -1,62 +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 {AvgPool3D, AvgPool3DAttrs, AvgPool3DInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const avgPool3DConfig: KernelConfig = { - kernelName: AvgPool3D, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as AvgPool3DInputs; - const backend = args.backend as NodeJSKernelBackend; - const {filterSize, strides, pad, dimRoundingMode, dataFormat} = - args.attrs as {} as AvgPool3DAttrs; - - const convInfo = backend_util.computePool3DInfo( - x.shape as [number, number, number, number, number], filterSize, - strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); - - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - const $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - const padding = convInfo.padInfo.type; - const $dataFormat = - convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: $dataFormat - }, - ]; - return backend.executeSingleOutput(AvgPool3D, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts deleted file mode 100644 index e60734708..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts +++ /dev/null @@ -1,65 +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 {AvgPool3DGrad, AvgPool3DGradAttrs, AvgPool3DGradInputs, backend_util, KernelConfig, tensor1d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const avgPool3DGradConfig: KernelConfig = { - kernelName: AvgPool3DGrad, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, input} = args.inputs as AvgPool3DGradInputs; - const backend = args.backend as NodeJSKernelBackend; - const {filterSize, strides, pad, dimRoundingMode} = - args.attrs as {} as AvgPool3DGradAttrs; - - const convInfo = backend_util.computePool3DInfo( - input.shape as [number, number, number, number, number], filterSize, - strides, 1 /* dilations */, pad, dimRoundingMode); - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding type was ${convInfo.padInfo.type}`); - } - const ksize = [ - 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 - ]; - const $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - const padding = convInfo.padInfo.type; - const dataFormat = - convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - const opAttrs = [ - createTensorsTypeOpAttr('T', input.dtype), - {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - const origInputShape = tensor1d(input.shape, 'int32'); - const res = backend.executeSingleOutput( - AvgPool3DGrad, opAttrs, [origInputShape, dy]); - origInputShape.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts deleted file mode 100644 index df7914406..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts +++ /dev/null @@ -1,60 +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 {AvgPoolGrad, AvgPoolGradAttrs, AvgPoolGradInputs, backend_util, KernelConfig, tensor1d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const avgPoolGradConfig: KernelConfig = { - kernelName: AvgPoolGrad, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, input} = args.inputs as AvgPoolGradInputs; - const backend = args.backend as NodeJSKernelBackend; - const {filterSize, strides, pad} = args.attrs as {} as AvgPoolGradAttrs; - - const convInfo = backend_util.computePool2DInfo( - input.shape as [number, number, number, number], filterSize, strides, - 1 /* dilations */, pad); - - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding type was ${convInfo.padInfo.type}`); - } - const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; - const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const opAttrs = [ - createTensorsTypeOpAttr('T', input.dtype), - {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - ]; - const origInputShape = tensor1d(input.shape, 'int32'); - const ret = - backend.executeSingleOutput(AvgPoolGrad, opAttrs, [origInputShape, dy]); - origInputShape.dispose(); - return ret; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts deleted file mode 100644 index 96a726ce7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.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 {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const batchMatMulConfig: KernelConfig = { - kernelName: BatchMatMul, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {a, b} = args.inputs as BatchMatMulInputs; - const backend = args.backend as NodeJSKernelBackend; - const {transposeA, transposeB} = args.attrs as {} as BatchMatMulAttrs; - - const opAttrs = [ - createTensorsTypeOpAttr('T', a.dtype), - {name: 'adj_x', type: backend.binding.TF_ATTR_BOOL, value: transposeA}, - {name: 'adj_y', type: backend.binding.TF_ATTR_BOOL, value: transposeB} - ]; - return backend.executeSingleOutput(BatchMatMul, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts deleted file mode 100644 index fac53d108..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.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 {BatchToSpaceND, BatchToSpaceNDAttrs, BatchToSpaceNDInputs, KernelConfig, tensor1d, tensor2d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const batchToSpaceNDConfig: KernelConfig = { - kernelName: BatchToSpaceND, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as BatchToSpaceNDInputs; - const backend = args.backend as NodeJSKernelBackend; - const {blockShape, crops} = args.attrs as {} as BatchToSpaceNDAttrs; - - const blockShapeTensor = tensor1d(blockShape, 'int32'); - const cropsTensor = - tensor2d(crops, [crops.length, crops[0].length], 'int32'); - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - createTensorsTypeOpAttr('Tblock_shape', 'int32'), - createTensorsTypeOpAttr('Tcrops', cropsTensor.dtype) - ]; - const res = backend.executeSingleOutput( - BatchToSpaceND, opAttrs, [x, blockShapeTensor, cropsTensor]); - - cropsTensor.dispose(); - blockShapeTensor.dispose(); - - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts deleted file mode 100644 index 6052fe184..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.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 {Bincount, BincountAttrs, BincountInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const bincountConfig: KernelConfig = { - kernelName: Bincount, - backendName: 'tensorflow', - kernelFunc: ({inputs, backend, attrs}) => { - const {x, weights} = inputs as BincountInputs; - const {size} = attrs as {} as BincountAttrs; - const nodeBackend = backend as NodeJSKernelBackend; - - const $size = scalar(size, 'int32'); - - const opAttrs = [createTensorsTypeOpAttr('T', weights.dtype)]; - - const result = - nodeBackend.executeSingleOutput(Bincount, opAttrs, [x, $size, weights]); - - $size.dispose(); - - return result; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts deleted file mode 100644 index 93663896b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.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 {Cast, CastAttrs, CastInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const castConfig: KernelConfig = { - kernelName: Cast, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as CastInputs; - const backend = args.backend as NodeJSKernelBackend; - const {dtype} = args.attrs as {} as CastAttrs; - - const opAttrs = [ - createTensorsTypeOpAttr('SrcT', x.dtype), - createTensorsTypeOpAttr('DstT', dtype), - {name: 'Truncate', type: backend.binding.TF_ATTR_BOOL, value: false} - ]; - return backend.executeSingleOutput(Cast, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts deleted file mode 100644 index 9ebbd545f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.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 {Ceil, CeilInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const ceilConfig: KernelConfig = { - kernelName: Ceil, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as CeilInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Ceil, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts deleted file mode 100644 index f76a71294..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.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 {ClipByValue, ClipByValueAttrs, ClipByValueInputs, KernelConfig, maximum, minimum, scalar, Tensor, tidy} from '@tensorflow/tfjs'; - -export const clipByValueConfig: KernelConfig = { - kernelName: ClipByValue, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as ClipByValueInputs; - const {clipValueMin, clipValueMax} = args.attrs as {} as ClipByValueAttrs; - - return tidy(() => { - const xMin = minimum(x as Tensor, scalar(clipValueMax, x.dtype)); - return maximum(xMin, scalar(clipValueMin, x.dtype)); - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts deleted file mode 100644 index 4ef544b20..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.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 {Complex, ComplexInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const complexConfig: KernelConfig = { - kernelName: Complex, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {real, imag} = args.inputs as ComplexInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', real as Tensor), - { - name: 'Tout', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_COMPLEX64 - }, - ]; - const inputs = [real, imag]; - return backend.executeSingleOutput(Complex, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts deleted file mode 100644 index 41fb32d9a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.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 {ComplexAbs, ComplexAbsInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const complexAbsConfig: KernelConfig = { - kernelName: ComplexAbs, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as ComplexAbsInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - createTensorsTypeOpAttr('Tout', 'float32') - ]; - return backend.executeSingleOutput(ComplexAbs, opAttrs, [x]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts deleted file mode 100644 index e59b28dfa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.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 {Concat, ConcatAttrs, ConcatInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const concatConfig: KernelConfig = { - kernelName: Concat, - backendName: 'tensorflow', - kernelFunc: (args) => { - const tensors = args.inputs as {} as ConcatInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis} = args.attrs as {} as ConcatAttrs; - - const opAttrs = [ - {name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length}, { - name: 'Tidx', - type: backend.binding.TF_ATTR_TYPE, - value: backend.binding.TF_INT32 - }, - createTensorsTypeOpAttr('T', tensors as Tensor[]) - ]; - - const inputs = Array.from(tensors); - const axisTensor = scalar(axis, 'int32'); - inputs.push(axisTensor); - const res = backend.executeSingleOutput('ConcatV2', opAttrs, inputs); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts deleted file mode 100644 index 0948cf500..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts +++ /dev/null @@ -1,79 +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 {backend_util, Conv2D, Conv2DAttrs, Conv2DInputs, KernelConfig, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv2DConfig: KernelConfig = { - kernelName: Conv2D, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, filter} = args.inputs as Conv2DInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, dataFormat, dilations, dimRoundingMode} = - args.attrs as {} as Conv2DAttrs; - - const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util.computeConv2DInfo( - x.shape as [number, number, number, number], - filter.shape as [number, number, number, number], strides, dilations, - pad, dimRoundingMode, false /* depthwise */, $dataFormat); - - return conv2dImpl(x, filter, convInfo, backend); - } -}; - -export function conv2dImpl( - x: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && - convInfo.padInfo.type !== 'EXPLICIT') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations}, - ]; - if (padding === 'EXPLICIT') { - const padValue = [ - convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, - convInfo.padInfo.right - ]; - opAttrs.push({ - name: 'explicit_paddings', - type: backend.binding.TF_ATTR_INT, - value: dataFormat === 'NHWC' ? [0, 0, ...padValue, 0, 0] : - [0, 0, 0, 0, ...padValue] - }); - } - return backend.executeSingleOutput(Conv2D, opAttrs, [x, filter]) as Tensor4D; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts deleted file mode 100644 index dcb984f9f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts +++ /dev/null @@ -1,70 +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 {backend_util, Conv2DBackpropFilter, Conv2DBackpropFilterAttrs, Conv2DBackpropFilterInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv2DBackpropFilterConfig: KernelConfig = { - kernelName: Conv2DBackpropFilter, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, dy} = args.inputs as Conv2DBackpropFilterInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, dataFormat, dimRoundingMode, filterShape} = - args.attrs as {} as Conv2DBackpropFilterAttrs; - - const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util.computeConv2DInfo( - x.shape as [number, number, number, number], filterShape, strides, - 1 /* dilations */, pad, dimRoundingMode, false /* depthwise */, - $dataFormat); - - return conv2DBackpropFilterImpl(dy, x, convInfo, backend); - } -}; - -function conv2DBackpropFilterImpl( - dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', 'float32'), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} - ]; - const filterSizes = tensor1d(convInfo.filterShape, 'int32'); - const res = - backend.executeSingleOutput( - Conv2DBackpropFilter, opAttrs, [filter, filterSizes, dy]) as Tensor4D; - filterSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts deleted file mode 100644 index 7974044c0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts +++ /dev/null @@ -1,69 +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 {backend_util, Conv2DBackpropInput, Conv2DBackpropInputAttrs, Conv2DBackpropInputInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv2DBackpropInputConfig: KernelConfig = { - kernelName: Conv2DBackpropInput, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, filter} = args.inputs as Conv2DBackpropInputInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, dataFormat, dimRoundingMode, inputShape} = - args.attrs as {} as Conv2DBackpropInputAttrs; - - const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util.computeConv2DInfo( - inputShape, filter.shape as [number, number, number, number], strides, - 1 /* dilations */, pad, dimRoundingMode, false, $dataFormat); - - return conv2DBackpropInputImpl(dy, filter, convInfo, backend); - } -}; - -function conv2DBackpropInputImpl( - dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', 'float32'), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} - ]; - const inputSizes = tensor1d(convInfo.inShape, 'int32'); - const res = - backend.executeSingleOutput( - Conv2DBackpropInput, opAttrs, [inputSizes, filter, dy]) as Tensor4D; - inputSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts deleted file mode 100644 index c89eff980..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts +++ /dev/null @@ -1,62 +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 {backend_util, Conv3D, Conv3DAttrs, Conv3DInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv3DConfig: KernelConfig = { - kernelName: Conv3D, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, filter} = args.inputs as Conv3DInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, dilations} = args.attrs as {} as Conv3DAttrs; - - const convInfo = backend_util.computeConv3DInfo( - x.shape as [number, number, number, number, number], - filter.shape as [number, number, number, number, number], strides, - dilations, pad); - - const $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - const padding = convInfo.padInfo.type; - const $dataFormat = - convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - const $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: $dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations} - ]; - return backend.executeSingleOutput(Conv3D, opAttrs, [x, filter]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts deleted file mode 100644 index 65fe202f4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts +++ /dev/null @@ -1,67 +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 {backend_util, Conv3DBackpropFilterV2, Conv3DBackpropFilterV2Attrs, Conv3DBackpropFilterV2Inputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv3DBackpropFilterV2Config: KernelConfig = { - kernelName: Conv3DBackpropFilterV2, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, dy} = args.inputs as Conv3DBackpropFilterV2Inputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, filterShape} = - args.attrs as {} as Conv3DBackpropFilterV2Attrs; - - const dilations = 1; - - const convInfo = backend_util.computeConv3DInfo( - x.shape as [number, number, number, number, number], filterShape, - strides, dilations, pad); - - const $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - const padding = convInfo.padInfo.type; - const dataFormat = - convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - const $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations} - ]; - const filterSizes = tensor1d(filterShape, 'int32'); - const res = backend.executeSingleOutput( - Conv3DBackpropFilterV2, opAttrs, [x, filterSizes, dy]); - filterSizes.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts deleted file mode 100644 index a93e5f6d3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts +++ /dev/null @@ -1,67 +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 {backend_util, Conv3DBackpropInputV2, Conv3DBackpropInputV2Attrs, Conv3DBackpropInputV2Inputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const conv3DBackpropInputV2Config: KernelConfig = { - kernelName: Conv3DBackpropInputV2, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, filter} = args.inputs as Conv3DBackpropInputV2Inputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, inputShape} = - args.attrs as {} as Conv3DBackpropInputV2Attrs; - - const dilations = 1; - - const convInfo = backend_util.computeConv3DInfo( - inputShape, filter.shape as [number, number, number, number, number], - strides, dilations, pad); - - const $strides = [ - 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 - ]; - const padding = convInfo.padInfo.type; - const dataFormat = - convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; - if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { - throw new Error('CPU Dilation depth must be 1'); - } - const $dilations = [ - 1, convInfo.dilationDepth, convInfo.dilationHeight, - convInfo.dilationWidth, 1 - ]; - const opAttrs = [ - createTensorsTypeOpAttr('T', dy.dtype), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations}, - createTensorsTypeOpAttr('Tshape', 'int32') - ]; - const inputSizes = tensor1d(inputShape, 'int32'); - const res = backend.executeSingleOutput( - Conv3DBackpropInputV2, opAttrs, [inputSizes, filter, dy]); - inputSizes.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts deleted file mode 100644 index 972830ef5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.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 {Cos, CosInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const cosConfig: KernelConfig = { - kernelName: Cos, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as CosInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Cos, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts deleted file mode 100644 index 0bcb0a9f7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.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 {Cosh, CoshInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const coshConfig: KernelConfig = { - kernelName: Cosh, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as CoshInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Cosh, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts deleted file mode 100644 index dad226f5a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts +++ /dev/null @@ -1,45 +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 {CropAndResize, CropAndResizeAttrs, CropAndResizeInputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const cropAndResizeConfig: KernelConfig = { - kernelName: CropAndResize, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {image, boxes, boxInd} = args.inputs as CropAndResizeInputs; - const backend = args.backend as NodeJSKernelBackend; - const {cropSize, method, extrapolationValue} = - args.attrs as {} as CropAndResizeAttrs; - - const opAttrs = [ - createTensorsTypeOpAttr('T', image.dtype), - {name: 'method', type: backend.binding.TF_ATTR_STRING, value: method}, { - name: 'extrapolation_value', - type: backend.binding.TF_ATTR_FLOAT, - value: extrapolationValue - } - ]; - const cropSizeTensor = tensor1d(cropSize, 'int32'); - const res = backend.executeSingleOutput( - CropAndResize, opAttrs, [image, boxes, boxInd, cropSizeTensor]); - cropSizeTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts deleted file mode 100644 index 57a6344d2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.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 {Cumsum, CumsumAttrs, CumsumInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const cumsumConfig: KernelConfig = { - kernelName: Cumsum, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as CumsumInputs; - const backend = args.backend as NodeJSKernelBackend; - const {axis, exclusive, reverse} = args.attrs as {} as CumsumAttrs; - - const axisTensor = scalar(axis, 'int32'); - const opAttrs = [ - {name: 'exclusive', type: backend.binding.TF_ATTR_BOOL, value: exclusive}, - {name: 'reverse', type: backend.binding.TF_ATTR_BOOL, value: reverse}, - createTensorsTypeOpAttr('T', x.dtype), - createTensorsTypeOpAttr('Tidx', 'int32') - ]; - const res = backend.executeSingleOutput(Cumsum, opAttrs, [x, axisTensor]); - axisTensor.dispose(); - return res; - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts deleted file mode 100644 index cc43eda54..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts +++ /dev/null @@ -1,45 +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, DepthToSpaceAttrs, DepthToSpaceInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const depthToSpaceConfig: KernelConfig = { - kernelName: DepthToSpace, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as DepthToSpaceInputs; - const backend = args.backend as NodeJSKernelBackend; - const {blockSize, dataFormat} = args.attrs as {} as DepthToSpaceAttrs; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x as Tensor), { - name: 'block_size', - type: backend.binding.TF_ATTR_INT, - value: blockSize < 2 ? 2 : blockSize - }, - { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - } - ]; - const inputs = [x]; - return backend.executeSingleOutput(DepthToSpace, opAttrs, inputs); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts deleted file mode 100644 index 85baf6212..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts +++ /dev/null @@ -1,82 +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 {backend_util, DepthwiseConv2dNative, DepthwiseConv2dNativeAttrs, DepthwiseConv2dNativeInputs, KernelConfig, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const depthwiseConv2dNativeConfig: KernelConfig = { - kernelName: DepthwiseConv2dNative, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, filter} = args.inputs as DepthwiseConv2dNativeInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, pad, dilations, dimRoundingMode} = - args.attrs as {} as DepthwiseConv2dNativeAttrs; - - let $dilations = dilations; - if ($dilations == null) { - $dilations = [1, 1]; - } - - const convInfo = backend_util.computeConv2DInfo( - x.shape as [number, number, number, number], - filter.shape as [number, number, number, number], strides, $dilations, - pad, dimRoundingMode, true /* depthwise */); - - return depthwiseConv2dNativeImpl(x, filter, convInfo, backend); - } -}; - -export function depthwiseConv2dNativeImpl( - input: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && - convInfo.padInfo.type !== 'EXPLICIT') { - throw new Error( - `TF Backend supports only 'valid' and 'same' padding ` + - `while padding was ${convInfo.padInfo.type}`); - } - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', input.dtype), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} - ]; - if (padding === 'EXPLICIT') { - const padValue = [ - convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, - convInfo.padInfo.right - ]; - opAttrs.push({ - name: 'explicit_paddings', - type: backend.binding.TF_ATTR_INT, - value: dataFormat === 'NHWC' ? [0, 0, ...padValue, 0, 0] : - [0, 0, 0, 0, ...padValue] - }); - } - return backend.executeSingleOutput( - DepthwiseConv2dNative, opAttrs, [input, filter]) as Tensor4D; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts deleted file mode 100644 index 7efcd07a4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts +++ /dev/null @@ -1,62 +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 {backend_util, DepthwiseConv2dNativeBackpropFilter, DepthwiseConv2dNativeBackpropFilterAttrs, DepthwiseConv2dNativeBackpropFilterInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const depthwiseConv2dNativeBackpropFilterConfig: KernelConfig = { - kernelName: DepthwiseConv2dNativeBackpropFilter, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x, dy} = args.inputs as DepthwiseConv2dNativeBackpropFilterInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, dilations, pad, dimRoundingMode, filterShape} = - args.attrs as {} as DepthwiseConv2dNativeBackpropFilterAttrs; - - const convInfo = backend_util.computeConv2DInfo( - x.shape as [number, number, number, number], filterShape, strides, - dilations, pad, dimRoundingMode, true /* depthwise */); - - return depthwiseConv2dNativeBackpropFilterImpl(x, dy, convInfo, backend); - } -}; - -function depthwiseConv2dNativeBackpropFilterImpl( - x: TensorInfo, dy: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', 'float32'), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} - ]; - const filterSizes = tensor1d(convInfo.filterShape, 'int32'); - const res = backend.executeSingleOutput( - DepthwiseConv2dNativeBackpropFilter, opAttrs, - [x, filterSizes, dy]) as Tensor4D; - filterSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts deleted file mode 100644 index f1f54202a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts +++ /dev/null @@ -1,65 +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 {backend_util, DepthwiseConv2dNativeBackpropInput, DepthwiseConv2dNativeBackpropInputAttrs, DepthwiseConv2dNativeBackpropInputInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const depthwiseConv2dNativeBackpropInputConfig: KernelConfig = { - kernelName: DepthwiseConv2dNativeBackpropInput, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, filter} = - args.inputs as DepthwiseConv2dNativeBackpropInputInputs; - const backend = args.backend as NodeJSKernelBackend; - const {strides, dilations, pad, dimRoundingMode, inputShape} = - args.attrs as {} as DepthwiseConv2dNativeBackpropInputAttrs; - - const convInfo = backend_util.computeConv2DInfo( - inputShape, filter.shape as [number, number, number, number], strides, - dilations, pad, dimRoundingMode, true /* depthwise */); - - return depthwiseConv2dNativeBackpropInputImpl( - dy, filter, convInfo, backend); - } -}; - -function depthwiseConv2dNativeBackpropInputImpl( - dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, - backend: NodeJSKernelBackend): Tensor4D { - const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; - const padding = convInfo.padInfo.type; - const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; - const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; - const opAttrs = [ - createTensorsTypeOpAttr('T', 'float32'), - {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, - {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { - name: 'data_format', - type: backend.binding.TF_ATTR_STRING, - value: dataFormat - }, - {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} - ]; - - const inputSizes = tensor1d(convInfo.inShape, 'int32'); - const res = backend.executeSingleOutput( - DepthwiseConv2dNativeBackpropInput, opAttrs, - [inputSizes, filter, dy]) as Tensor4D; - inputSizes.dispose(); - return res; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts deleted file mode 100644 index 5462a29e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.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 {Diag, DiagInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const diagConfig: KernelConfig = { - kernelName: Diag, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as DiagInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Diag, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts deleted file mode 100644 index 609fb7b9c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts +++ /dev/null @@ -1,51 +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 {backend_util, Dilation2D, Dilation2DAttrs, Dilation2DInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const dilation2dConfig: KernelConfig = { - kernelName: Dilation2D, - backendName: 'tensorflow', - kernelFunc: ({inputs, backend, attrs}) => { - const {x, filter} = inputs as Dilation2DInputs; - const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; - const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = - backend_util.computeDilation2DInfo( - x.shape as [number, number, number, number], - filter.shape as [number, number, number], strides, pad, - 'NHWC' /* dataFormat */, dilations); - const $strides = [1, strideHeight, strideWidth, 1]; - const $dilations = [1, dilationHeight, dilationWidth, 1]; - - const nodeBackend = backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, - {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - - return nodeBackend.executeSingleOutput(Dilation2D, opAttrs, [x, filter]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts deleted file mode 100644 index 7896e03cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts +++ /dev/null @@ -1,52 +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 {backend_util, Dilation2DAttrs, Dilation2DBackpropFilter, Dilation2DBackpropFilterInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const dilation2dBackpropFilterConfig: KernelConfig = { - kernelName: Dilation2DBackpropFilter, - backendName: 'tensorflow', - kernelFunc: ({inputs, backend, attrs}) => { - const {x, filter, dy} = inputs as Dilation2DBackpropFilterInputs; - const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; - const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = - backend_util.computeDilation2DInfo( - x.shape as [number, number, number, number], - filter.shape as [number, number, number], strides, pad, - 'NHWC' /* dataFormat */, dilations); - const $strides = [1, strideHeight, strideWidth, 1]; - const $dilations = [1, dilationHeight, dilationWidth, 1]; - - const nodeBackend = backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, - {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - - return nodeBackend.executeSingleOutput( - Dilation2DBackpropFilter, opAttrs, [x, filter, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts deleted file mode 100644 index 61c931dd6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts +++ /dev/null @@ -1,52 +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 {backend_util, Dilation2DAttrs, Dilation2DBackpropInput, Dilation2DBackpropInputInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const dilation2dBackpropInputConfig: KernelConfig = { - kernelName: Dilation2DBackpropInput, - backendName: 'tensorflow', - kernelFunc: ({inputs, backend, attrs}) => { - const {x, filter, dy} = inputs as Dilation2DBackpropInputInputs; - const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; - const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = - backend_util.computeDilation2DInfo( - x.shape as [number, number, number, number], - filter.shape as [number, number, number], strides, pad, - 'NHWC' /* dataFormat */, dilations); - const $strides = [1, strideHeight, strideWidth, 1]; - const $dilations = [1, dilationHeight, dilationWidth, 1]; - - const nodeBackend = backend as NodeJSKernelBackend; - - const opAttrs = [ - createTensorsTypeOpAttr('T', x.dtype), - {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, - {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, - { - name: 'padding', - type: nodeBackend.binding.TF_ATTR_STRING, - value: padInfo.type - } - ]; - - return nodeBackend.executeSingleOutput( - Dilation2DBackpropInput, opAttrs, [x, filter, dy]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts deleted file mode 100644 index a9b7684e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.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 {Elu, EluInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const eluConfig: KernelConfig = { - kernelName: Elu, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as EluInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Elu, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts deleted file mode 100644 index 93640f9c5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.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 {EluGrad, EluGradInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const eluGradConfig: KernelConfig = { - kernelName: EluGrad, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {dy, y} = args.inputs as EluGradInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [createTensorsTypeOpAttr('T', y.dtype)]; - return backend.executeSingleOutput(EluGrad, opAttrs, [dy, y]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts deleted file mode 100644 index 1b2d0b5e6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.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 {backend_util, Equal, EqualInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const equalConfig: KernelConfig = { - kernelName: Equal, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {a, b} = args.inputs as EqualInputs; - const backend = args.backend as NodeJSKernelBackend; - - const opAttrs = [createTensorsTypeOpAttr( - 'T', backend_util.upcastType(a.dtype, b.dtype))]; - return backend.executeSingleOutput(Equal, opAttrs, [a, b]); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts deleted file mode 100644 index 681e90ed7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.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 {Erf, ErfInputs, KernelConfig} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const erfConfig: KernelConfig = { - kernelName: Erf, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {x} = args.inputs as ErfInputs; - const backend = args.backend as NodeJSKernelBackend; - - return backend.executeSingleInput(Erf, x); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/_FusedMatMul.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/_FusedMatMul.ts deleted file mode 100644 index d782467ad..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/_FusedMatMul.ts +++ /dev/null @@ -1,47 +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 {_FusedMatMul, _FusedMatMulAttrs, _FusedMatMulInputs, add, KernelConfig, matMul, Tensor, Tensor3D, tidy} from '@tensorflow/tfjs'; - -import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; - -export const _fusedMatMulConfig: KernelConfig = { - kernelName: _FusedMatMul, - backendName: 'tensorflow', - kernelFunc: (args) => { - const {a, b, bias, preluActivationWeights} = - args.inputs as _FusedMatMulInputs; - const backend = args.backend as NodeJSKernelBackend; - const {transposeA, transposeB, activation, leakyreluAlpha} = - args.attrs as {} as _FusedMatMulAttrs; - - // Core TensorFlow does not have a fused BatchMatMul op. Combine calls to - // achieve the same results: - return tidy(() => { - let result: Tensor3D = - matMul(a as Tensor, b as Tensor, transposeA, transposeB); - if (bias != null) { - result = add(result, bias as Tensor); - } - - result = backend.applyActivation( - result, activation, preluActivationWeights as Tensor, leakyreluAlpha); - - return result; - }); - } -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/node.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/node.ts deleted file mode 100644 index db867ea10..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/node.ts +++ /dev/null @@ -1,40 +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. - * ============================================================================= - */ - -/** - * Public API symbols under the tf.node.* namespace. - */ - -import {tensorBoard} from './callbacks'; -import {decodeBmp, decodeGif, decodeImage, decodeJpeg, decodePng, encodeJpeg, encodePng} from './image'; -import {getMetaGraphsFromSavedModel, getNumOfSavedModels, loadSavedModel} from './saved_model'; -import {summaryFileWriter} from './tensorboard'; - -export const node = { - decodeImage, - decodeBmp, - decodeGif, - decodePng, - decodeJpeg, - encodeJpeg, - encodePng, - summaryFileWriter, - tensorBoard, - getMetaGraphsFromSavedModel, - getNumOfSavedModels, - loadSavedModel -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/nodejs_kernel_backend.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/nodejs_kernel_backend.ts deleted file mode 100644 index 76eb52b14..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/nodejs_kernel_backend.ts +++ /dev/null @@ -1,656 +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'; -import {backend_util, BackendTimingInfo, DataId, DataType, KernelBackend, ModelTensorInfo, Rank, Scalar, scalar, ScalarLike, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorInfo, tidy, util} from '@tensorflow/tfjs'; -import {isArray, isNullOrUndefined} from 'util'; - -import {encodeInt32ArrayAsInt64, Int64Scalar} from './int64_tensors'; -import {TensorMetadata, TFEOpAttr, TFJSBinding} from './tfjs_binding'; - -type TensorData = { - shape: number[], - dtype: number, - values: backend_util.BackendValues, - id: number, - refCount: number; -}; - -export class NodeJSKernelBackend extends KernelBackend { - binding: TFJSBinding; - isGPUPackage: boolean; - isUsingGpuDevice: boolean; - private tensorMap: tf.DataStorage; - - constructor(binding: TFJSBinding, packageName: string) { - super(); - this.binding = binding; - this.isGPUPackage = packageName === '@tensorflow/tfjs-node-gpu'; - this.isUsingGpuDevice = this.binding.isUsingGpuDevice(); - this.tensorMap = new tf.DataStorage(this, tf.engine()); - } - - getDTypeInteger(dtype: DataType): number { - switch (dtype) { - case 'float32': - return this.binding.TF_FLOAT; - case 'int32': - return this.binding.TF_INT32; - case 'bool': - return this.binding.TF_BOOL; - case 'complex64': - return this.binding.TF_COMPLEX64; - case 'string': - return this.binding.TF_STRING; - default: - throw new Error(`Unsupported DType: ${dtype}`); - } - } - - private typeAttributeFromTensor(value: Tensor): number { - return this.getDTypeInteger(value.dtype); - } - - // Creates a new Tensor and maps the dataId to the passed in ID. - private createOutputTensor(metadata: TensorMetadata): Tensor { - const newId = {}; - - this.tensorMap.set(newId, { - shape: metadata.shape, - dtype: metadata.dtype, - id: metadata.id, - values: null, - refCount: 1 - }); - - let dtype: DataType; - switch (metadata.dtype) { - case this.binding.TF_FLOAT: - dtype = 'float32'; - break; - case this.binding.TF_INT32: - dtype = 'int32'; - break; - case this.binding.TF_INT64: - console.warn('INT64 output tensor will be stored as BigInt64Array.'); - // INT64 is not supported in TFJS yet, cast it to int32. - dtype = 'int32'; - break; - case this.binding.TF_BOOL: - dtype = 'bool'; - break; - case this.binding.TF_COMPLEX64: - dtype = 'complex64'; - break; - case this.binding.TF_STRING: - dtype = 'string'; - break; - case this.binding.TF_RESOURCE: - // NOTE(cais): We currently represent resource-type Tensors - // as string of ubytes. - dtype = 'string'; - break; - case this.binding.TF_UINT8: - // TensorFlow uses UINT8 as dtype for image tensor. UINT8 is not - // supported in TFJS yet, cast it to int32. - dtype = 'int32'; - break; - default: - throw new Error(`Unknown dtype enum ${metadata.dtype}`); - } - - // TODO(yassogba) Enable this once all the kernels are removed from backend. - // We can then change the return type from Tensor to TensorInfo. - // return {dataId: newId, shape: metadata.shape, dtype}; - - return tf.engine().makeTensorFromDataId(newId, metadata.shape, dtype); - } - - // Prepares Tensor instances for Op execution. - private getInputTensorIds(tensors: Array): number[] { - const ids: number[] = []; - for (let i = 0; i < tensors.length; i++) { - if (tensors[i] instanceof Int64Scalar) { - // Then `tensors[i]` is a Int64Scalar, which we currently represent - // using an `Int32Array`. - const value = (tensors[i] as Int64Scalar).valueArray; - const id = this.binding.createTensor([], this.binding.TF_INT64, value); - ids.push(id); - } else { - const info = this.tensorMap.get((tensors[i] as TensorInfo).dataId); - // TODO - what about ID in this case? Handle in write()?? - if (info.values != null) { - // Values were delayed to write into the TensorHandle. Do that before - // Op execution and clear stored values. - info.id = - this.binding.createTensor(info.shape, info.dtype, info.values); - info.values = null; - } - ids.push(info.id); - } - } - return ids; - } - - createReductionOpAttrs(tensor: TensorInfo, keepDims = false): TFEOpAttr[] { - return [ - {name: 'keep_dims', type: this.binding.TF_ATTR_BOOL, value: keepDims}, - createTensorsTypeOpAttr('T', tensor.dtype), - createTensorsTypeOpAttr('Tidx', 'int32') - ]; - } - - floatPrecision(): 16|32 { - return 32; - } - - epsilon(): number { - return super.epsilon(); - } - - /** - * Executes an op that has a single input and output. - * - * Helper function to wrap executeSingleOutput in a particular case. - * @param name The name of the Op to execute. - * @param input The input Tensor for the Op. - */ - executeSingleInput(name: string, input: TensorInfo): Tensor { - const opAttrs = [createTensorsTypeOpAttr('T', input.dtype)]; - return this.executeSingleOutput(name, opAttrs, [input]); - } - - /** - * Executes a TensorFlow Eager Op that provides one output Tensor. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @return A resulting Tensor from Op execution. - */ - executeSingleOutput(name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[]): - Tensor { - const outputMetadata = this.binding.executeOp( - name, opAttrs, this.getInputTensorIds(inputs), 1); - return this.createOutputTensor(outputMetadata[0]); - } - - /** - * Executes a TensorFlow Eager Op that provides multiple output Tensors. - * @param name The name of the Op to execute. - * @param opAttrs The list of Op attributes required to execute. - * @param inputs The list of input Tensors for the Op. - * @param numOutputs The number of output Tensors for Op execution. - * @return A resulting Tensor array from Op execution. - */ - executeMultipleOutputs( - name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[], - numOutputs: number): Tensor[] { - const outputMetadata = this.binding.executeOp( - name, opAttrs, this.getInputTensorIds(inputs), numOutputs); - return outputMetadata.map(m => this.createOutputTensor(m)); - } - - numDataIds(): number { - return this.tensorMap.numDataIds(); - } - - dispose(): void {} - - async read(dataId: DataId): Promise { - return this.readSync(dataId); - } - - readSync(dataId: DataId): backend_util.BackendValues { - if (!this.tensorMap.has(dataId)) { - throw new Error(`Tensor ${dataId} was not registered!`); - } - const info = this.tensorMap.get(dataId); - if (info.values != null) { - return info.values; - } else { - return this.binding.tensorDataSync(info.id); - } - } - - /** - * Dispose the memory if the dataId has 0 refCount. Return true if the memory - * is released, false otherwise. - * @param dataId - * @oaram force Optional, remove the data regardless of refCount - */ - disposeData(dataId: DataId, force = false): boolean { - // No-op if already disposed. - if (this.tensorMap.has(dataId)) { - const id = this.tensorMap.get(dataId).id; - this.tensorMap.get(dataId).refCount--; - if (!force && this.tensorMap.get(dataId).refCount > 0) { - return false; - } - - if (id != null && id >= 0) { - this.binding.deleteTensor(id); - } - this.tensorMap.delete(dataId); - } - return true; - } - /** Return refCount of a `TensorData`. */ - refCount(dataId: DataId): number { - if (this.tensorMap.has(dataId)) { - const tensorData = this.tensorMap.get(dataId); - return tensorData.refCount; - } - return 0; - } - - incRef(dataId: DataId) { - this.tensorMap.get(dataId).refCount++; - } - - move( - dataId: DataId, values: backend_util.BackendValues, shape: number[], - dtype: DataType, refCount: number): void { - this.tensorMap.set( - dataId, {shape, dtype: getTFDType(dtype), values, id: -1, refCount}); - } - - write(values: backend_util.BackendValues, shape: number[], dtype: DataType): - DataId { - const dataId = {}; - this.move(dataId, values, shape, dtype, 1); - return dataId; - } - - applyActivation( - input: T, activation: string, preluActivationWeights?: Tensor, - leakyreluAlpha?: number): T { - let result = input; - if (activation != null) { - if (activation === 'linear') { - // No-op - } else if (activation === 'relu') { - result = tf.relu(result); - } else if (activation === 'prelu') { - result = tf.prelu(result, preluActivationWeights) as T; - } else if (activation === 'leakyrelu') { - result = tf.leakyRelu(result, leakyreluAlpha); - } else if (activation === 'elu') { - result = tf.elu(result); - } else if (activation === 'relu6') { - result = tf.relu6(result); - } else if (activation === 'sigmoid') { - result = tf.sigmoid(result); - } else { - throw new Error(`Activation: ${ - activation} has not been implemented for the Node.js backend`); - } - } - return result; - } - - divide(a: Tensor, b: Tensor): Tensor { - const opAttrs = [createTensorsTypeOpAttr( - 'T', backend_util.upcastType(a.dtype, b.dtype))]; - return this.executeSingleOutput('Div', opAttrs, [a, b]); - } - - divNoNan(a: Tensor, b: Tensor): Tensor { - const opAttrs = [createTensorsTypeOpAttr( - 'T', backend_util.upcastType(a.dtype, b.dtype))]; - return this.executeSingleOutput('DivNoNan', opAttrs, [a, b]); - } - - where(condition: Tensor): Tensor2D { - return this.executeSingleOutput('Where', [], [condition]) as Tensor2D; - } - - topKValues(x: T, k: number): Tensor1D { - throw new Error('Method not implemented.'); - } - - topKIndices(x: Tensor, k: number): Tensor1D { - throw new Error('Method not implemented.'); - } - - int(x: T): T { - throw new Error('Method not implemented.'); - } - - decodeJpeg( - contents: Uint8Array, channels: number, ratio: number, - fancyUpscaling: boolean, tryRecoverTruncated: boolean, - acceptableFraction: number, dctMethod: string): Tensor3D { - const opAttrs = [ - {name: 'channels', type: this.binding.TF_ATTR_INT, value: channels}, - {name: 'ratio', type: this.binding.TF_ATTR_INT, value: ratio}, { - name: 'fancy_upscaling', - type: this.binding.TF_ATTR_BOOL, - value: fancyUpscaling - }, - { - name: 'try_recover_truncated', - type: this.binding.TF_ATTR_BOOL, - value: tryRecoverTruncated - }, - { - name: 'acceptable_fraction', - type: this.binding.TF_ATTR_FLOAT, - value: acceptableFraction - }, - {name: 'dct_method', type: this.binding.TF_ATTR_STRING, value: dctMethod} - ]; - const inputArgs = [scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeJpeg', opAttrs, inputArgs) as - Tensor; - } - - decodePng(contents: Uint8Array, channels: number): Tensor3D { - const opAttrs = - [{name: 'channels', type: this.binding.TF_ATTR_INT, value: channels}]; - const inputArgs = [scalar(contents, 'string')]; - - return this.executeSingleOutput('DecodePng', opAttrs, inputArgs) as - Tensor; - } - - decodeBmp(contents: Uint8Array, channels: number): Tensor3D { - const opAttrs = - [{name: 'channels', type: this.binding.TF_ATTR_INT, value: channels}]; - const inputArgs = [scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeBmp', opAttrs, inputArgs) as - Tensor; - } - - decodeGif(contents: Uint8Array): Tensor4D { - const inputArgs = [scalar(contents, 'string')]; - return this.executeSingleOutput('DecodeGif', [], inputArgs) as - Tensor; - } - - executeEncodeImageOp( - name: string, opAttrs: TFEOpAttr[], imageData: Uint8Array, - imageShape: number[]): Tensor { - const inputTensorId = - this.binding.createTensor(imageShape, this.binding.TF_UINT8, imageData); - const outputMetadata = - this.binding.executeOp(name, opAttrs, [inputTensorId], 1); - const outputTensorInfo = outputMetadata[0]; - // prevent the tensor data from being converted to a UTF8 string, since - // the encoded data is not valid UTF8 - outputTensorInfo.dtype = this.binding.TF_UINT8; - return this.createOutputTensor(outputTensorInfo); - } - - encodeJpeg( - imageData: Uint8Array, imageShape: number[], format: ''|'grayscale'|'rgb', - quality: number, progressive: boolean, optimizeSize: boolean, - chromaDownsampling: boolean, densityUnit: 'in'|'cm', xDensity: number, - yDensity: number, xmpMetadata: string): Tensor { - const opAttrs = [ - {name: 'format', type: this.binding.TF_ATTR_STRING, value: format}, - {name: 'quality', type: this.binding.TF_ATTR_INT, value: quality}, { - name: 'progressive', - type: this.binding.TF_ATTR_BOOL, - value: progressive - }, - { - name: 'optimize_size', - type: this.binding.TF_ATTR_BOOL, - value: optimizeSize - }, - { - name: 'chroma_downsampling', - type: this.binding.TF_ATTR_BOOL, - value: chromaDownsampling - }, - { - name: 'density_unit', - type: this.binding.TF_ATTR_STRING, - value: densityUnit - }, - {name: 'x_density', type: this.binding.TF_ATTR_INT, value: xDensity}, - {name: 'y_density', type: this.binding.TF_ATTR_INT, value: yDensity}, { - name: 'xmp_metadata', - type: this.binding.TF_ATTR_STRING, - value: xmpMetadata - } - ]; - return this.executeEncodeImageOp( - 'EncodeJpeg', opAttrs, imageData, imageShape); - } - - encodePng(imageData: Uint8Array, imageShape: number[], compression: number): - Tensor { - const opAttrs = [ - {name: 'compression', type: this.binding.TF_ATTR_INT, value: compression} - ]; - return this.executeEncodeImageOp( - 'EncodePng', opAttrs, imageData, imageShape); - } - - deleteSavedModel(id: number): void { - this.binding.deleteSavedModel(id); - } - - loadSavedModelMetaGraph(path: string, tags: string): number { - return this.binding.loadSavedModel(path, tags); - } - - private getMappedInputTensorIds( - inputs: Tensor[], inputTensorInfos: ModelTensorInfo[]) { - const tensorIds = this.getInputTensorIds(inputs); - for (let i = 0; i < inputs.length; i++) { - if (inputTensorInfos[i] != null) { - if (inputTensorInfos[i].tfDtype === 'DT_UINT8') { - const data = Uint8Array.from(inputs[i].dataSync()); - const inputTensorId = this.binding.createTensor( - inputs[i].shape, this.binding.TF_UINT8, data); - tensorIds[i] = inputTensorId; - } else if (inputTensorInfos[i].tfDtype === 'DT_INT64') { - const data = - encodeInt32ArrayAsInt64(inputs[i].dataSync() as Int32Array); - const inputTensorId = this.binding.createTensor( - inputs[i].shape, this.binding.TF_INT64, data); - tensorIds[i] = inputTensorId; - } - } - } - return tensorIds; - } - - runSavedModel( - id: number, inputs: Tensor[], inputTensorInfos: ModelTensorInfo[], - outputOpNames: string[]): Tensor[] { - const outputMetadata = this.binding.runSavedModel( - id, this.getMappedInputTensorIds(inputs, inputTensorInfos), - inputTensorInfos.map(info => info.name).join(','), - outputOpNames.join(',')); - return outputMetadata.map(m => this.createOutputTensor(m)); - } - - // ------------------------------------------------------------ - // TensorBoard-related (tfjs-node-specific) backend kernels. - - summaryWriter(logdir: string): Tensor1D { - const opAttrs = [ - { - name: 'shared_name', - type: this.binding.TF_ATTR_STRING, - value: `logdir:${logdir}` - }, - {name: 'container', type: this.binding.TF_ATTR_STRING, value: ''} - ]; - const writerResource = - this.executeSingleOutput('SummaryWriter', opAttrs, []); - return writerResource as Tensor1D; - } - - createSummaryFileWriter( - resourceHandle: Tensor, logdir: string, maxQueue?: number, - flushMillis?: number, filenameSuffix?: string): void { - const inputArgs = [ - resourceHandle, scalar(logdir), - scalar(maxQueue == null ? 10 : maxQueue, 'int32'), - scalar(flushMillis == null ? 2 * 60 * 1000 : flushMillis, 'int32'), - scalar(filenameSuffix == null ? '.v2' : filenameSuffix) - ]; - this.executeMultipleOutputs('CreateSummaryFileWriter', [], inputArgs, 0); - } - - writeScalarSummary( - resourceHandle: Tensor, step: number, name: string, - value: Scalar|number): void { - tidy(() => { - util.assert( - Number.isInteger(step), - () => `step is expected to be an integer, but is instead ${step}`); - const inputArgs: Array = - [resourceHandle, new Int64Scalar(step), scalar(name, 'string')]; - - let typeAttr: number; - if (typeof value === 'number') { - inputArgs.push(scalar(value)); - typeAttr = this.binding.TF_FLOAT; - } else { - // `value` is a Scalar. - util.assert( - value.rank === 0, - () => `A non-scalar tensor (rank ${value.rank}) is passed to ` + - `writeScalarSummary()`); - inputArgs.push(value); - typeAttr = this.typeAttributeFromTensor(value); - } - const opAttrs: TFEOpAttr[] = - [{name: 'T', type: this.binding.TF_ATTR_TYPE, value: typeAttr}]; - - this.binding.executeOp( - 'WriteScalarSummary', opAttrs, this.getInputTensorIds(inputArgs), 0); - }); - } - - flushSummaryWriter(resourceHandle: Tensor): void { - const inputArgs: Tensor[] = [resourceHandle]; - this.executeMultipleOutputs('FlushSummaryWriter', [], inputArgs, 0); - } - - // ~ TensorBoard-related (tfjs-node-specific) backend kernels. - // ------------------------------------------------------------ - - memory() { - // Due to automatic garbage collection, the numbers are unreliable. - // TODO(kreeger): Since there is finalization in C, count the true - // number of undisposed tensors. - return {unreliable: true}; - } - - async time(f: () => void): Promise { - const start = process.hrtime(); - f(); - // hrtime() returns tuple of [seconds, nanoseconds], and we need to return - // milliseconds. - const elapsed = process.hrtime(start); - return {kernelMs: elapsed[0] * 1000 + elapsed[1] / 1000000}; - } - - getNumOfSavedModels() { - return this.binding.getNumOfSavedModels(); - } -} - -/** Returns an instance of the Node.js backend. */ -export function nodeBackend(): NodeJSKernelBackend { - return tf.findBackend('tensorflow') as NodeJSKernelBackend; -} - -/** Returns the TF dtype for a given DataType. */ -export function getTFDType(dataType: tf.DataType): number { - const binding = nodeBackend().binding; - switch (dataType) { - case 'float32': - return binding.TF_FLOAT; - case 'int32': - return binding.TF_INT32; - case 'bool': - return binding.TF_BOOL; - case 'complex64': - return binding.TF_COMPLEX64; - case 'string': - return binding.TF_STRING; - // tslint:disable-next-line:no-any - case 'int64' as any: - // int64 is not a generally supported dtype in TensorFlow.js - // (tfjs-core). However, it needs to be included here for the purpose of - // writing the `step` value to TensorBoard via WriteScalarSummary and - // other op kernels. - return binding.TF_INT64; - default: - const errorMessage = `Unknown dtype: ${dataType}`; - throw new Error(errorMessage); - } -} - -/** - * Creates a TFEOpAttr for a 'type' OpDef attribute from a Tensor or list of - * Tensors. - */ -export function createTensorsTypeOpAttr( - attrName: string, - tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType): TFEOpAttr { - if (isNullOrUndefined(tensorsOrDtype)) { - throw new Error('Invalid input tensors value.'); - } - return { - name: attrName, - type: nodeBackend().binding.TF_ATTR_TYPE, - value: - (tensorsOrDtype instanceof tf.Tensor || Array.isArray(tensorsOrDtype)) ? - getTFDTypeForInputs(tensorsOrDtype) : - getTFDType(tensorsOrDtype) - }; -} - -// TODO(yassogba) remove? who uses this? -export function createOpAttr( - attrName: string, tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType, - value: ScalarLike): TFEOpAttr { - if (isNullOrUndefined(tensorsOrDtype)) { - throw new Error('Invalid input tensors value.'); - } - return {name: attrName, type: nodeBackend().binding.TF_BOOL, value}; -} - -/** Returns the dtype number for a single or list of input Tensors. */ -function getTFDTypeForInputs(tensors: tf.Tensor|tf.Tensor[]): number { - if (isNullOrUndefined(tensors)) { - throw new Error('Invalid input tensors value.'); - } - if (isArray(tensors)) { - for (let i = 0; i < tensors.length; i++) { - return getTFDType(tensors[i].dtype); - } - return -1; - } else { - return getTFDType(tensors.dtype); - } -} - -export function ensureTensorflowBackend() { - tf.util.assert( - tf.getBackend() === 'tensorflow', - () => `Expect the current backend to be "tensorflow", but got "${ - tf.getBackend()}"`); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/register_all_kernels.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/register_all_kernels.ts deleted file mode 100644 index a15a2b6d7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/register_all_kernels.ts +++ /dev/null @@ -1,325 +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. - * ============================================================================= - */ -// We explicitly import the modular kernels so they get registered in the -// global registry when we compile the library. A modular build would replace -// the contents of this file and import only the kernels that are needed. -import {KernelConfig, registerKernel} from '@tensorflow/tfjs'; - -import {_fusedMatMulConfig} from './kernels/_FusedMatMul'; -import {absConfig} from './kernels/Abs'; -import {acosConfig} from './kernels/Acos'; -import {acoshConfig} from './kernels/Acosh'; -import {addConfig} from './kernels/Add'; -import {addNConfig} from './kernels/AddN'; -import {allConfig} from './kernels/All'; -import {anyConfig} from './kernels/Any'; -import {argMaxConfig} from './kernels/ArgMax'; -import {argMinConfig} from './kernels/ArgMin'; -import {asinConfig} from './kernels/Asin'; -import {asinhConfig} from './kernels/Asinh'; -import {atanConfig} from './kernels/Atan'; -import {atan2Config} from './kernels/Atan2'; -import {atanhConfig} from './kernels/Atanh'; -import {avgPoolConfig} from './kernels/AvgPool'; -import {avgPool3DConfig} from './kernels/AvgPool3D'; -import {avgPool3DGradConfig} from './kernels/AvgPool3DGrad'; -import {avgPoolGradConfig} from './kernels/AvgPoolGrad'; -import {batchMatMulConfig} from './kernels/BatchMatMul'; -import {batchToSpaceNDConfig} from './kernels/BatchToSpaceND'; -import {bincountConfig} from './kernels/Bincount'; -import {castConfig} from './kernels/Cast'; -import {ceilConfig} from './kernels/Ceil'; -import {clipByValueConfig} from './kernels/ClipByValue'; -import {complexConfig} from './kernels/Complex'; -import {complexAbsConfig} from './kernels/ComplexAbs'; -import {concatConfig} from './kernels/Concat'; -import {conv2DConfig} from './kernels/Conv2D'; -import {conv2DBackpropFilterConfig} from './kernels/Conv2DBackpropFilter'; -import {conv2DBackpropInputConfig} from './kernels/Conv2DBackpropInput'; -import {conv3DConfig} from './kernels/Conv3D'; -import {conv3DBackpropFilterV2Config} from './kernels/Conv3DBackpropFilterV2'; -import {conv3DBackpropInputV2Config} from './kernels/Conv3DBackpropInputV2'; -import {cosConfig} from './kernels/Cos'; -import {coshConfig} from './kernels/Cosh'; -import {cropAndResizeConfig} from './kernels/CropAndResize'; -import {cumsumConfig} from './kernels/Cumsum'; -import {depthToSpaceConfig} from './kernels/DepthToSpace'; -import {depthwiseConv2dNativeConfig} from './kernels/DepthwiseConv2dNative'; -import {depthwiseConv2dNativeBackpropFilterConfig} from './kernels/DepthwiseConv2dNativeBackpropFilter'; -import {depthwiseConv2dNativeBackpropInputConfig} from './kernels/DepthwiseConv2dNativeBackpropInput'; -import {diagConfig} from './kernels/Diag'; -import {dilation2dConfig} from './kernels/Dilation2D'; -import {dilation2dBackpropFilterConfig} from './kernels/Dilation2DBackpropFilter'; -import {dilation2dBackpropInputConfig} from './kernels/Dilation2DBackpropInput'; -import {eluConfig} from './kernels/Elu'; -import {eluGradConfig} from './kernels/EluGrad'; -import {equalConfig} from './kernels/Equal'; -import {erfConfig} from './kernels/Erf'; -import {expConfig} from './kernels/Exp'; -import {expandDimsConfig} from './kernels/ExpandDims'; -import {expm1Config} from './kernels/Expm1'; -import {FFTConfig} from './kernels/FFT'; -import {fillConfig} from './kernels/Fill'; -import {floorConfig} from './kernels/Floor'; -import {floorDivConfig} from './kernels/FloorDiv'; -import {fusedBatchNormConfig} from './kernels/FusedBatchNorm'; -import {fusedConv2DConfig} from './kernels/FusedConv2D'; -import {fusedDepthwiseConv2DConfig} from './kernels/FusedDepthwiseConv2D'; -import {gatherNdConfig} from './kernels/GatherNd'; -import {gatherV2Config} from './kernels/GatherV2'; -import {greaterConfig} from './kernels/Greater'; -import {greaterEqualConfig} from './kernels/GreaterEqual'; -import {identityConfig} from './kernels/Identity'; -import {IFFTConfig} from './kernels/IFFT'; -import {imagConfig} from './kernels/Imag'; -import {isFiniteConfig} from './kernels/IsFinite'; -import {isInfConfig} from './kernels/IsInf'; -import {isNanConfig} from './kernels/IsNan'; -import {leakyReluConfig} from './kernels/LeakyRelu'; -import {lessConfig} from './kernels/Less'; -import {lessEqualConfig} from './kernels/LessEqual'; -import {linSpaceConfig} from './kernels/LinSpace'; -import {logConfig} from './kernels/Log'; -import {log1pConfig} from './kernels/Log1p'; -import {logicalAndConfig} from './kernels/LogicalAnd'; -import {logicalNotConfig} from './kernels/LogicalNot'; -import {logicalOrConfig} from './kernels/LogicalOr'; -import {LRNConfig} from './kernels/LRN'; -import {LRNGradConfig} from './kernels/LRNGrad'; -import {maxConfig} from './kernels/Max'; -import {maximumConfig} from './kernels/Maximum'; -import {maxPoolConfig} from './kernels/MaxPool'; -import {maxPool3DConfig} from './kernels/MaxPool3D'; -import {maxPool3DGradConfig} from './kernels/MaxPool3DGrad'; -import {maxPoolGradConfig} from './kernels/MaxPoolGrad'; -import {meanConfig} from './kernels/Mean'; -import {minConfig} from './kernels/Min'; -import {minimumConfig} from './kernels/Minimum'; -import {mirrorPadConfig} from './kernels/MirrorPad'; -import {modConfig} from './kernels/Mod'; -import {multinomialConfig} from './kernels/Multinomial'; -import {multiplyConfig} from './kernels/Multiply'; -import {negConfig} from './kernels/Neg'; -import {nonMaxSuppressionV3Config} from './kernels/NonMaxSuppressionV3'; -import {nonMaxSuppressionV4Config} from './kernels/NonMaxSuppressionV4'; -import {nonMaxSuppressionV5Config} from './kernels/NonMaxSuppressionV5'; -import {notEqualConfig} from './kernels/NotEqual'; -import {oneHotConfig} from './kernels/OneHot'; -import {onesLikeConfig} from './kernels/OnesLike'; -import {packConfig} from './kernels/Pack'; -import {padV2Config} from './kernels/PadV2'; -import {powConfig} from './kernels/Pow'; -import {preluConfig} from './kernels/Prelu'; -import {prodConfig} from './kernels/Prod'; -import {rangeConfig} from './kernels/Range'; -import {realConfig} from './kernels/Real'; -import {realDivConfig} from './kernels/RealDiv'; -import {reciprocalConfig} from './kernels/Reciprocal'; -import {reluConfig} from './kernels/Relu'; -import {relu6Config} from './kernels/Relu6'; -import {reshapeConfig} from './kernels/Reshape'; -import {resizeBilinearConfig} from './kernels/ResizeBilinear'; -import {resizeBilinearGradConfig} from './kernels/ResizeBilinearGrad'; -import {resizeNearestNeighborConfig} from './kernels/ResizeNearestNeighbor'; -import {resizeNearestNeighborGradConfig} from './kernels/ResizeNearestNeighborGrad'; -import {reverseConfig} from './kernels/Reverse'; -import {roundConfig} from './kernels/Round'; -import {rsqrtConfig} from './kernels/Rsqrt'; -import {scatterNdConfig} from './kernels/ScatterNd'; -import {selectConfig} from './kernels/Select'; -import {seluConfig} from './kernels/Selu'; -import {sigmoidConfig} from './kernels/Sigmoid'; -import {signConfig} from './kernels/Sign'; -import {sinConfig} from './kernels/Sin'; -import {sinhConfig} from './kernels/Sinh'; -import {sliceConfig} from './kernels/Slice'; -import {softmaxConfig} from './kernels/Softmax'; -import {softplusConfig} from './kernels/Softplus'; -import {spaceToBatchNDConfig} from './kernels/SpaceToBatchND'; -import {sparseToDenseConfig} from './kernels/SparseToDense'; -import {splitVConfig} from './kernels/SplitV'; -import {sqrtConfig} from './kernels/Sqrt'; -import {squareConfig} from './kernels/Square'; -import {squaredDifferenceConfig} from './kernels/SquaredDifference'; -import {stepConfig} from './kernels/Step'; -import {stridedSliceConfig} from './kernels/StridedSlice'; -import {subConfig} from './kernels/Sub'; -import {sumConfig} from './kernels/Sum'; -import {tanConfig} from './kernels/Tan'; -import {tanhConfig} from './kernels/Tanh'; -import {tileConfig} from './kernels/Tile'; -import {topKConfig} from './kernels/TopK'; -import {transposeConfig} from './kernels/Transpose'; -import {unpackConfig} from './kernels/Unpack'; -import {unsortedSegmentSumConfig} from './kernels/UnsortedSegmentSum'; -import {zerosLikeConfig} from './kernels/ZerosLike'; - -// List all kernel configs here -const kernelConfigs: KernelConfig[] = [ - FFTConfig, - IFFTConfig, - LRNConfig, - LRNGradConfig, - _fusedMatMulConfig, - absConfig, - acosConfig, - acoshConfig, - addConfig, - addNConfig, - allConfig, - anyConfig, - argMaxConfig, - argMinConfig, - asinConfig, - asinhConfig, - atan2Config, - atanConfig, - atanhConfig, - avgPool3DConfig, - avgPool3DGradConfig, - avgPoolConfig, - avgPoolGradConfig, - batchMatMulConfig, - batchToSpaceNDConfig, - castConfig, - ceilConfig, - clipByValueConfig, - complexAbsConfig, - complexConfig, - concatConfig, - conv2DBackpropFilterConfig, - conv2DBackpropInputConfig, - conv2DConfig, - conv3DBackpropFilterV2Config, - conv3DBackpropInputV2Config, - conv3DConfig, - cosConfig, - coshConfig, - cropAndResizeConfig, - cumsumConfig, - bincountConfig, - depthToSpaceConfig, - depthwiseConv2dNativeBackpropFilterConfig, - depthwiseConv2dNativeBackpropInputConfig, - depthwiseConv2dNativeConfig, - diagConfig, - dilation2dBackpropFilterConfig, - dilation2dBackpropInputConfig, - dilation2dConfig, - eluConfig, - eluGradConfig, - equalConfig, - erfConfig, - expConfig, - expandDimsConfig, - expm1Config, - fillConfig, - floorConfig, - floorDivConfig, - fusedBatchNormConfig, - fusedConv2DConfig, - fusedDepthwiseConv2DConfig, - gatherNdConfig, - gatherV2Config, - greaterConfig, - greaterEqualConfig, - identityConfig, - imagConfig, - isFiniteConfig, - isInfConfig, - isNanConfig, - leakyReluConfig, - lessConfig, - lessEqualConfig, - linSpaceConfig, - log1pConfig, - logConfig, - logicalAndConfig, - logicalNotConfig, - logicalOrConfig, - maxConfig, - maxPool3DConfig, - maxPool3DGradConfig, - maxPoolConfig, - maxPoolGradConfig, - maximumConfig, - meanConfig, - minConfig, - minimumConfig, - mirrorPadConfig, - modConfig, - multinomialConfig, - multiplyConfig, - negConfig, - nonMaxSuppressionV3Config, - nonMaxSuppressionV4Config, - nonMaxSuppressionV5Config, - notEqualConfig, - oneHotConfig, - onesLikeConfig, - packConfig, - padV2Config, - powConfig, - preluConfig, - prodConfig, - rangeConfig, - realConfig, - realDivConfig, - reciprocalConfig, - relu6Config, - reluConfig, - reshapeConfig, - resizeBilinearConfig, - resizeBilinearGradConfig, - resizeNearestNeighborConfig, - resizeNearestNeighborGradConfig, - reverseConfig, - roundConfig, - rsqrtConfig, - scatterNdConfig, - selectConfig, - seluConfig, - sigmoidConfig, - signConfig, - sinConfig, - sinhConfig, - sliceConfig, - softmaxConfig, - softplusConfig, - spaceToBatchNDConfig, - sparseToDenseConfig, - splitVConfig, - sqrtConfig, - squareConfig, - squaredDifferenceConfig, - stepConfig, - stridedSliceConfig, - subConfig, - sumConfig, - tanConfig, - tanhConfig, - tileConfig, - topKConfig, - transposeConfig, - unpackConfig, - unsortedSegmentSumConfig, - zerosLikeConfig -]; - -for (const kernelConfig of kernelConfigs) { - registerKernel(kernelConfig); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/run_tests.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/run_tests.ts deleted file mode 100644 index 5ddb499f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/run_tests.ts +++ /dev/null @@ -1,154 +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. - * ============================================================================= - */ - -// We import index.ts so that the Node backend gets registered. -import './index'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; - -import * as tf from '@tensorflow/tfjs'; -// tslint:disable-next-line:no-imports-from-dist -import * as jasmine_util from '@tensorflow/tfjs-core/dist/jasmine_util'; -import {argv} from 'yargs'; - -import {NodeJSKernelBackend} from './nodejs_kernel_backend'; - -Error.stackTraceLimit = Infinity; - -// tslint:disable-next-line:no-require-imports -const jasmineCtor = require('jasmine'); -// tslint:disable-next-line:no-require-imports - -process.on('unhandledRejection', e => { - throw e; -}); - -jasmine_util.setTestEnvs([{ - name: 'test-tensorflow', - backendName: 'tensorflow', - flags: {}, - isDataSync: true -}]); - -const IGNORE_LIST: string[] = [ - // Always ignore version tests: - 'version version', - 'unreliable is true due to both auto gc and string tensors', - 'unreliable is true due to auto gc', - // See https://github.com/tensorflow/tfjs/issues/161 - 'depthwiseConv2D', // Requires space_to_batch() for dilation > 1. - 'separableConv2d', // Requires space_to_batch() for dilation > 1. - 'complex64 memory', - // See https://github.com/tensorflow/tfjs-core/pull/1270 - 'depthToSpace test-tensorflow {} throws when blocksize < 2', - // tslint:disable-next-line:max-line-length - 'depthToSpace test-tensorflow {} throws when CPU backend used with data format NCHW', - // See https://github.com/tensorflow/tfjs/issues/806 - 'scatterND test-tensorflow {} should work for 2d', - 'scatterND test-tensorflow {} should work for simple 1d', - 'scatterND test-tensorflow {} should work for multiple 1d', - 'scatterND test-tensorflow {} should sum the duplicated indices', - 'scatterND test-tensorflow {} should work for tensorLike input', - // https://github.com/tensorflow/tfjs/issues/1077 - 'maxPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', - 'avgPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', - // tslint:disable-next-line:max-line-length - 'avgPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', - // tslint:disable-next-line:max-line-length - 'maxPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', - // libtensorflow doesn't support 6D ArgMax yet. - 'argmax test-tensorflow {} 6D, axis=0', 'diag test-tensorflow {} complex', - 'diag test-tensorflow {} bool', - // See https://github.com/tensorflow/tfjs/issues/1891 - 'conv2d test-tensorflow {} x=[2,1,2,2] f=[1,1,1,1] s=1 d=1 p=0 NCHW', - 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=explicit NCHW', - 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} x=[2,2,2] f=[2,2,2,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} x=[2,1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', - 'conv2d test-tensorflow {} gradient x=[1,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', - 'conv2d test-tensorflow {} gradient x=[2,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', - 'maxPoolWithArgmax', 'rotate', 'flipLeftRight', 'unique', - // libtensorflow does not yet support tf.matmul with broadcast - 'broadcast with unequal batch dims', 'broadcast with unequal ranks', - // tslint:disable-next-line:max-line-length - 'pool test-tensorflow {} max x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', - // tslint:disable-next-line:max-line-length - 'pool test-tensorflow {} avg x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', - // not available in tf yet. - 'denseBincount', - // only available in tf addon. - 'image.transform', - // Breaking change in NaN processing - // See https://github.com/tensorflow/tfjs/issues/4883 - 'max test-tensorflow {} ignores NaNs', 'min test-tensorflow {} ignores NaNs', - 'sign test-tensorflow {} basic', - 'sign test-tensorflow {} does not propagate NaNs', - 'sign test-tensorflow {} accepts a tensor-like object', - // Node kernel for einsum is yet to be implemented. - // See: ttps://github.com/tensorflow/tfjs/issues/2349 - 'einsum', 'sparseFillEmptyRows', 'sparseReshape' -]; - -if (process.platform === 'win32') { - // Ignore tensorboard on windows because tmp folder cleanup used in tests - // fails with tmp folder cleanup: - // https://github.com/tensorflow/tfjs/issues/1692 - IGNORE_LIST.push('tensorboard'); - IGNORE_LIST.push('tensorBoard'); - // Windows has two failing tests: - // https://github.com/tensorflow/tfjs/issues/598 - IGNORE_LIST.push('clip test-tensorflow {} propagates NaNs'); - IGNORE_LIST.push( - 'maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs'); -} - -const runner = new jasmineCtor(); -runner.loadConfig({spec_files: ['src/**/*_test.ts'], random: false}); -// Also import tests from core. -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/tests'; - -if (process.env.JASMINE_SEED) { - runner.seed(process.env.JASMINE_SEED); -} - -const env = jasmine.getEnv(); - -const grepRegex = new RegExp(argv.grep as string); - -// Filter method that returns boolean, if a given test should return. -env.specFilter = spec => { - // Filter based on the grep flag. - if (!grepRegex.test(spec.getFullName())) { - return false; - } - // Return false (skip the test) if the test is in the ignore list. - for (let i = 0; i < IGNORE_LIST.length; ++i) { - if (spec.getFullName().indexOf(IGNORE_LIST[i]) > -1) { - return false; - } - } - // Otherwise run the test. - return true; -}; - -// TODO(kreeger): Consider moving to C-code. -console.log(`Running tests against TensorFlow: ${ - (tf.backend() as NodeJSKernelBackend).binding.TF_Version}`); -runner.execute(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/saved_model.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/saved_model.ts deleted file mode 100644 index 26e0b2479..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/saved_model.ts +++ /dev/null @@ -1,464 +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 {DataType, InferenceModel, MetaGraph, ModelPredictConfig, ModelTensorInfo, NamedTensorMap, SignatureDef, SignatureDefEntry, Tensor, util} from '@tensorflow/tfjs'; -import * as fs from 'fs'; -import {promisify} from 'util'; - -import {ensureTensorflowBackend, nodeBackend, NodeJSKernelBackend} from './nodejs_kernel_backend'; - -const readFile = promisify(fs.readFile); - -// tslint:disable-next-line:no-require-imports -const messages = require('./proto/api_pb'); - -const SAVED_MODEL_FILE_NAME = '/saved_model.pb'; - -const SAVED_MODEL_INIT_OP_KEY = '__saved_model_init_op'; - -// This map is used to keep track of loaded SavedModel metagraph mapping -// information. The map key is TFSavedModel id in JavaScript, value is -// an object of path to the SavedModel, metagraph tags, and loaded Session ID in -// the c++ bindings. When user loads a SavedModel signature, it will go through -// entries in this map to find if the corresponding SavedModel session has -// already been loaded in C++ addon and will reuse it if existing. -const loadedSavedModelPathMap = - new Map(); - -// The ID of loaded TFSavedModel. This ID is used to keep track of loaded -// TFSavedModel, so the loaded session in c++ bindings for the corresponding -// TFSavedModel can be properly reused/disposed. -let nextTFSavedModelId = 0; - -/** - * Get a key in an object by its value. This is used to get protobuf enum value - * from index. - * - * @param object - * @param value - */ -// tslint:disable-next-line:no-any -export function getEnumKeyFromValue(object: any, value: number): string { - return Object.keys(object).find(key => object[key] === value); -} - -/** - * Read SavedModel proto message from path. - * - * @param path Path to SavedModel folder. - */ -export async function readSavedModelProto(path: string) { - // Load the SavedModel pb file and deserialize it into message. - try { - fs.accessSync(path + SAVED_MODEL_FILE_NAME, fs.constants.R_OK); - } catch (error) { - throw new Error( - 'There is no saved_model.pb file in the directory: ' + path); - } - const modelFile = await readFile(path + SAVED_MODEL_FILE_NAME); - const array = new Uint8Array(modelFile); - return messages.SavedModel.deserializeBinary(array); -} - -/** - * Inspect the MetaGraphs of the SavedModel from the provided path. This - * function will return an array of `MetaGraphInfo` objects. - * - * @param path Path to SavedModel folder. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export async function getMetaGraphsFromSavedModel(path: string): - Promise { - const result: MetaGraph[] = []; - - // Get SavedModel proto message - const modelMessage = await readSavedModelProto(path); - - // A SavedModel might have multiple MetaGraphs, identified by tags. - // Each MetaGraph also has it's own signatureDefs. - const metaGraphList = modelMessage.getMetaGraphsList(); - for (let i = 0; i < metaGraphList.length; i++) { - const metaGraph = {} as MetaGraph; - const tags = metaGraphList[i].getMetaInfoDef().getTagsList(); - metaGraph.tags = tags; - - // Each MetaGraph has it's own signatureDefs map. - const signatureDef: SignatureDef = {}; - const signatureDefMap = metaGraphList[i].getSignatureDefMap(); - const signatureDefKeys = signatureDefMap.keys(); - - // Go through all signatureDefs - while (true) { - const key = signatureDefKeys.next(); - if (key.done) { - break; - } - // Skip TensorFlow internal Signature '__saved_model_init_op'. - if (key.value === SAVED_MODEL_INIT_OP_KEY) { - continue; - } - const signatureDefEntry = signatureDefMap.get(key.value); - - // Get all input tensors information - const inputsMapMessage = signatureDefEntry.getInputsMap(); - const inputsMapKeys = inputsMapMessage.keys(); - const inputs: {[key: string]: ModelTensorInfo} = {}; - while (true) { - const inputsMapKey = inputsMapKeys.next(); - if (inputsMapKey.done) { - break; - } - const inputTensor = inputsMapMessage.get(inputsMapKey.value); - const inputTensorInfo = {} as ModelTensorInfo; - const dtype = - getEnumKeyFromValue(messages.DataType, inputTensor.getDtype()); - inputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); - inputTensorInfo.tfDtype = dtype; - inputTensorInfo.name = inputTensor.getName(); - inputTensorInfo.shape = inputTensor.getTensorShape().getDimList(); - inputs[inputsMapKey.value] = inputTensorInfo; - } - - // Get all output tensors information - const outputsMapMessage = signatureDefEntry.getOutputsMap(); - const outputsMapKeys = outputsMapMessage.keys(); - const outputs: {[key: string]: ModelTensorInfo} = {}; - while (true) { - const outputsMapKey = outputsMapKeys.next(); - if (outputsMapKey.done) { - break; - } - const outputTensor = outputsMapMessage.get(outputsMapKey.value); - const outputTensorInfo = {} as ModelTensorInfo; - const dtype = - getEnumKeyFromValue(messages.DataType, outputTensor.getDtype()); - outputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); - outputTensorInfo.tfDtype = dtype; - outputTensorInfo.name = outputTensor.getName(); - outputTensorInfo.shape = outputTensor.getTensorShape().getDimList(); - outputs[outputsMapKey.value] = outputTensorInfo; - } - - signatureDef[key.value] = {inputs, outputs}; - } - metaGraph.signatureDefs = signatureDef; - - result.push(metaGraph); - } - return result; -} - -/** - * Get SignatureDefEntry from SavedModel metagraphs info. The SignatureDefEntry - * will be used when executing a SavedModel signature. - * - * @param savedModelInfo The MetaGraphInfo array loaded through - * getMetaGraphsFromSavedModel(). - * @param tags The tags of the MetaGraph to get input/output node names from. - * @param signature The signature to get input/output node names from. - */ -export function getSignatureDefEntryFromMetaGraphInfo( - savedModelInfo: MetaGraph[], tags: string[], - signature: string): SignatureDefEntry { - for (let i = 0; i < savedModelInfo.length; i++) { - const metaGraphInfo = savedModelInfo[i]; - if (stringArraysHaveSameElements(tags, metaGraphInfo.tags)) { - if (metaGraphInfo.signatureDefs[signature] == null) { - throw new Error('The SavedModel does not have signature: ' + signature); - } - return metaGraphInfo.signatureDefs[signature]; - } - } - throw new Error(`The SavedModel does not have tags: ${tags}`); -} - -/** - * A `tf.TFSavedModel` is a signature loaded from a SavedModel - * metagraph, and allows inference execution. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export class TFSavedModel implements InferenceModel { - private disposed = false; - private outputNodeNames_: {[key: string]: string}; - constructor( - private sessionId: number, private jsid: number, - private signature: SignatureDefEntry, - private backend: NodeJSKernelBackend) {} - - /** - * Return the array of input tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - get inputs(): ModelTensorInfo[] { - const entries = this.signature.inputs; - const results = Object.keys(entries).map((key: string) => entries[key]); - results.forEach((info: ModelTensorInfo) => { - info.name = info.name.replace(/:0$/, ''); - }); - return results; - } - - /** - * Return the array of output tensor info. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - get outputs(): ModelTensorInfo[] { - const entries = this.signature.outputs; - const results = Object.keys(entries).map((key: string) => entries[key]); - results.forEach((info: ModelTensorInfo) => { - info.name = info.name.replace(/:0$/, ''); - }); - return results; - } - - /** - * Delete the SavedModel from nodeBackend and delete corresponding session in - * the C++ backend if the session is only used by this TFSavedModel. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - dispose() { - if (!this.disposed) { - this.disposed = true; - - loadedSavedModelPathMap.delete(this.jsid); - for (const id of Array.from(loadedSavedModelPathMap.keys())) { - const value = loadedSavedModelPathMap.get(id); - if (value.sessionId === this.sessionId) { - return; - } - } - this.backend.deleteSavedModel(this.sessionId); - } else { - throw new Error('This SavedModel has already been deleted.'); - } - } - - get outputNodeNames() { - if (this.outputNodeNames_ != null) { - return this.outputNodeNames_; - } - this.outputNodeNames_ = - Object.keys(this.signature.outputs) - .reduce((names: {[key: string]: string}, key: string) => { - names[key] = this.signature.outputs[key].name; - return names; - }, {}); - return this.outputNodeNames_; - } - - /** - * Execute the inference for the input tensors. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. The keys in the NamedTensorMap are the - * name of input tensors in SavedModel signatureDef. It can be found through - * `tf.node.getMetaGraphsFromSavedModel()`. - * - * For batch inference execution, the tensors for each input need to be - * concatenated together. For example with mobilenet, the required input shape - * is [1, 244, 244, 3], which represents the [batch, height, width, channel]. - * If we are provide a batched data of 100 images, the input tensor should be - * in the shape of [100, 244, 244, 3]. - * - * @param config Prediction configuration for specifying the batch size. - * - * @returns Inference result tensors. The output would be single Tensor if - * model has single output node, otherwise Tensor[] or NamedTensorMap[] will - * be returned for model with multiple outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - predict(inputs: Tensor|Tensor[]|NamedTensorMap, config?: ModelPredictConfig): - Tensor|Tensor[]|NamedTensorMap { - if (this.disposed) { - throw new Error('The TFSavedModel has already been deleted!'); - } else { - let inputTensors: Tensor[] = []; - if (inputs instanceof Tensor) { - inputTensors.push(inputs); - const result = this.backend.runSavedModel( - this.sessionId, inputTensors, Object.values(this.signature.inputs), - Object.values(this.outputNodeNames)); - return result.length > 1 ? result : result[0]; - } else if (Array.isArray(inputs)) { - inputTensors = inputs; - return this.backend.runSavedModel( - this.sessionId, inputTensors, Object.values(this.signature.inputs), - Object.values(this.outputNodeNames)); - } else { - const inputTensorNames = Object.keys(this.signature.inputs); - const providedInputNames = Object.keys(inputs); - if (!stringArraysHaveSameElements( - inputTensorNames, providedInputNames)) { - throw new Error(`The model signatureDef input names are ${ - inputTensorNames.join()}, however the provided input names are ${ - providedInputNames.join()}.`); - } - const inputNodeNamesArray: ModelTensorInfo[] = []; - for (let i = 0; i < inputTensorNames.length; i++) { - inputTensors.push(inputs[inputTensorNames[i]]); - inputNodeNamesArray.push(this.signature.inputs[inputTensorNames[i]]); - } - const outputTensorNames = Object.keys(this.outputNodeNames); - const outputNodeNamesArray = []; - for (let i = 0; i < outputTensorNames.length; i++) { - outputNodeNamesArray.push(this.outputNodeNames[outputTensorNames[i]]); - } - const outputTensors = this.backend.runSavedModel( - this.sessionId, inputTensors, inputNodeNamesArray, - outputNodeNamesArray); - util.assert( - outputTensors.length === outputNodeNamesArray.length, - () => 'Output tensors do not match output node names, ' + - `receive ${outputTensors.length}) output tensors but ` + - `there are ${this.outputNodeNames.length} output nodes.`); - const outputMap: NamedTensorMap = {}; - for (let i = 0; i < outputTensorNames.length; i++) { - outputMap[outputTensorNames[i]] = outputTensors[i]; - } - return outputMap; - } - } - } - - /** - * Execute the inference for the input tensors and return activation - * values for specified output node names without batching. - * - * @param input The input tensors, when there is single input for the model, - * inputs param should be a Tensor. For models with multiple inputs, inputs - * params should be in either Tensor[] if the input order is fixed, or - * otherwise NamedTensorMap format. - * - * @param outputs string|string[]. List of output node names to retrieve - * activation from. - * - * @returns Activation values for the output nodes result tensors. The return - * type matches specified parameter outputs type. The output would be single - * Tensor if single output is specified, otherwise Tensor[] for multiple - * outputs. - * - * @doc {heading: 'Models', subheading: 'SavedModel'} - */ - execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]): - Tensor|Tensor[] { - throw new Error('execute() of TFSavedModel is not supported yet.'); - } -} - -/** - * Load a TensorFlow SavedModel from disk. TensorFlow SavedModel is different - * from TensorFlow.js model format. A SavedModel is a directory containing - * serialized signatures and the states needed to run them. The directory has a - * saved_model.pb (or saved_model.pbtxt) file storing the actual TensorFlow - * program, or model, and a set of named signatures, each identifying a - * function. The directory also has a variables directory contains a standard - * training checkpoint. The directory may also has a assets directory contains - * files used by the TensorFlow graph, for example text files used to initialize - * vocabulary tables. These are supported datatypes: float32, int32, complex64, - * string.For more information, see this guide: - * https://www.tensorflow.org/guide/saved_model. - * - * @param path The path to the SavedModel. - * @param tags The tags of the MetaGraph to load. The available tags of a - * SavedModel can be retrieved through tf.node.getMetaGraphsFromSavedModel() - * API. Defaults to ['serve']. - * @param signature The name of the SignatureDef to load. The available - * SignatureDefs of a SavedModel can be retrieved through - * tf.node.getMetaGraphsFromSavedModel() API. Defaults to 'serving_default'. - * - * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} - */ -export async function loadSavedModel( - path: string, tags = ['serve'], - signature = 'serving_default'): Promise { - ensureTensorflowBackend(); - - const backend = nodeBackend(); - - const savedModelInfo = await getMetaGraphsFromSavedModel(path); - const signatureDefEntry = - getSignatureDefEntryFromMetaGraphInfo(savedModelInfo, tags, signature); - - let sessionId: number; - - for (const id of Array.from(loadedSavedModelPathMap.keys())) { - const modelInfo = loadedSavedModelPathMap.get(id); - if (modelInfo.path === path && - stringArraysHaveSameElements(modelInfo.tags, tags)) { - sessionId = modelInfo.sessionId; - } - } - if (sessionId == null) { - // Convert metagraph tags string array to a string. - const tagsString = tags.join(','); - sessionId = backend.loadSavedModelMetaGraph(path, tagsString); - } - const id = nextTFSavedModelId++; - const savedModel = - new TFSavedModel(sessionId, id, signatureDefEntry, backend); - loadedSavedModelPathMap.set(id, {path, tags, sessionId}); - return savedModel; -} - -/** - * Compare if two unsorted arrays of string have the same elements. - * @param arrayA - * @param arrayB - */ -function stringArraysHaveSameElements( - arrayA: string[], arrayB: string[]): boolean { - if (arrayA.length === arrayB.length && - arrayA.sort().join() === arrayB.sort().join()) { - return true; - } - return false; -} - -function mapTFDtypeToJSDtype(tfDtype: string): DataType { - switch (tfDtype) { - case 'DT_FLOAT': - return 'float32'; - case 'DT_INT64': - case 'DT_INT32': - case 'DT_UINT8': - return 'int32'; - case 'DT_BOOL': - return 'bool'; - case 'DT_COMPLEX64': - return 'complex64'; - case 'DT_STRING': - return 'string'; - default: - throw new Error( - 'Unsupported tensor DataType: ' + tfDtype + - ', try to modify the model in python to convert the datatype'); - } -} - -export function getNumOfSavedModels() { - ensureTensorflowBackend(); - const backend = nodeBackend(); - return backend.getNumOfSavedModels(); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tensorboard.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tensorboard.ts deleted file mode 100644 index 96d67035c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tensorboard.ts +++ /dev/null @@ -1,111 +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 {Scalar, Tensor, util} from '@tensorflow/tfjs'; - -import {ensureTensorflowBackend, nodeBackend, NodeJSKernelBackend} from './nodejs_kernel_backend'; - -export class SummaryFileWriter { - backend: NodeJSKernelBackend; - - constructor(private readonly resourceHandle: Tensor) { - ensureTensorflowBackend(); - this.backend = nodeBackend(); - } - - /** - * Write a scalar summary. - * - * @param name A name of the summary. The summary tag for TensorBoard will be - * this name. - * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript - * `number`. - * @param step Required `int64`-castable, monotically-increasing step value. - * @param description Optinal long-form description for this summary, as a - * `string`. *Not implemented yet*. - */ - scalar( - name: string, value: Scalar|number, step: number, description?: string) { - // N.B.: Unlike the Python TensorFlow API, step is a required parameter, - // because the construct of global step does not exist in TensorFlow.js. - if (description != null) { - throw new Error('scalar() does not support description yet'); - } - - this.backend.writeScalarSummary(this.resourceHandle, step, name, value); - } - - /** - * Force summary writer to send all buffered data to storage. - */ - flush() { - this.backend.flushSummaryWriter(this.resourceHandle); - } -} - -/** - * Use a cache for `SummaryFileWriter` instance. - * - * Using multiple instances of `SummaryFileWriter` pointing to the same - * logdir has potential problems. Using this cache avoids those problems. - */ -const summaryFileWriterCache: {[logdir: string]: SummaryFileWriter} = {}; - -/** - * Create a summary file writer for TensorBoard. - * - * Example: - * ```js - * const tf = require('@tensorflow/tfjs-node'); - * - * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir'); - * - * for (let step = 0; step < 100; ++step) { - * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step); - * } - * ``` - * - * @param logdir Log directory in which the summary data will be written. - * @param maxQueue Maximum queue length (default: `10`). - * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e, - * `120` seconds). - * @param filenameSuffix Suffix of the protocol buffer file names to be - * written in the `logdir` (default: `.v2`). - * @returns An instance of `SummaryFileWriter`. - * - * @doc {heading: 'TensorBoard', namespace: 'node'} - */ -export function summaryFileWriter( - logdir: string, maxQueue = 10, flushMillis = 120000, - filenameSuffix = '.v2'): SummaryFileWriter { - util.assert( - logdir != null && typeof logdir === 'string' && logdir.length > 0, - () => - `Invalid logdir: ${logdir}. Expected a non-empty string for logdir.`); - if (!(logdir in summaryFileWriterCache)) { - ensureTensorflowBackend(); - const backend = nodeBackend(); - const writerResource = backend.summaryWriter(logdir); - - backend.createSummaryFileWriter( - writerResource, logdir, maxQueue, flushMillis, filenameSuffix); - - summaryFileWriterCache[logdir] = new SummaryFileWriter(writerResource); - } - return summaryFileWriterCache[logdir]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tfjs_binding.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tfjs_binding.ts deleted file mode 100644 index f1bfc626d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/tfjs_binding.ts +++ /dev/null @@ -1,87 +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 {backend_util} from '@tensorflow/tfjs'; - -export declare class TensorMetadata { - id: number; - shape: number[]; - dtype: number; -} - -export declare class TFEOpAttr { - name: string; - type: number; - value: boolean|number|object|string|number[]; -} - -export interface TFJSBinding { - TensorMetadata: typeof TensorMetadata; - TFEOpAttr: typeof TFEOpAttr; - - // Creates a tensor with the backend. - createTensor( - shape: number[], dtype: number, - buffer: backend_util.BackendValues): number; - - // Deletes a tensor with the backend. - deleteTensor(tensorId: number): void; - - // Reads data-sync from a tensor on the backend. - tensorDataSync(tensorId: number): Float32Array|Int32Array|Uint8Array; - - // Executes an Op on the backend, returns an array of output TensorMetadata. - executeOp( - opName: string, opAttrs: TFEOpAttr[], inputTensorIds: number[], - numOutputs: number): TensorMetadata[]; - - // Load a SavedModel from a path. - loadSavedModel(exportDir: string, tags: string): number; - - // Remove a SavedModel from memory. - deleteSavedModel(savedModelId: number): void; - - // Execute a SavedModel with input, returns an array of output TensorMetadata. - runSavedModel( - savedModelId: number, inputTensorIds: number[], inputOpNames: string, - outputOpNames: string): TensorMetadata[]; - - getNumOfSavedModels(): number; - - isUsingGpuDevice(): boolean; - - // TF Types - TF_FLOAT: number; - TF_INT32: number; - TF_INT64: number; - TF_BOOL: number; - TF_COMPLEX64: number; - TF_STRING: number; - TF_RESOURCE: number; - TF_UINT8: number; - - // TF OpAttrTypes - TF_ATTR_STRING: number; - TF_ATTR_INT: number; - TF_ATTR_FLOAT: number; - TF_ATTR_BOOL: number; - TF_ATTR_TYPE: number; - TF_ATTR_SHAPE: number; - TF_ATTR_RESOURCE: number; - - TF_Version: string; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/version.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/version.ts deleted file mode 100644 index d376475fa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/version.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** @license See the LICENSE file. */ - -// This code is auto-generated, do not modify this file! -const version = '3.6.1'; -export {version}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.json deleted file mode 100644 index 70e3ee191..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "noImplicitAny": true, - "sourceMap": true, - "removeComments": false, - "preserveConstEnums": true, - "declaration": true, - "target": "es5", - "lib": ["es2015", "dom"], - "outDir": "./dist", - "noUnusedLocals": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "alwaysStrict": true, - "noUnusedParameters": false, - "pretty": true, - "noFallthroughCasesInSwitch": true, - "allowUnreachableCode": false, - "experimentalDecorators": true - }, - "include": [ - "src/" - ] -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.test.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.test.json deleted file mode 100644 index 76ea3c6cf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/tsconfig.test.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "./tsconfig", - "include": [ - "src/" - ], - "exclude": [ - "node_modules/" - ], - "compilerOptions": { - "allowJs": true, - "outDir": "./dist" - } -}